1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4837],{46957:function(e,t,n){"use strict";n.d(t,{H:function(){return o}});var r=n(7653),i=n(97551);function o(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];let l=r.useRef(),s=(0,i.D)(e=>e.scene);return r.useLayoutEffect(()=>{let n;if(e&&null!=e&&e.current&&t&&(l.current=n=new t(e.current,...o)),n)return n.traverse(e=>e.raycast=()=>null),s.add(n),()=>{l.current=void 0,s.remove(n),null==n.dispose||n.dispose()}},[s,t,e,...o]),(0,i.F)(()=>{var e;null==(e=l.current)||null==e.update||e.update()}),l}},43089:function(e,t,n){"use strict";n.d(t,{Y:function(){return f}});var r=n(17610),i=n(97551),o=n(7653),a=n(78813),l=Object.defineProperty,s=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t,n)=>(s(e,"symbol"!=typeof t?t+"":t,n),n);class u extends a.Object3D{constructor(e,t){super(),c(this,"isTransformControls",!0),c(this,"visible",!1),c(this,"domElement"),c(this,"raycaster",new a.Raycaster),c(this,"gizmo"),c(this,"plane"),c(this,"tempVector",new a.Vector3),c(this,"tempVector2",new a.Vector3),c(this,"tempQuaternion",new a.Quaternion),c(this,"unit",{X:new a.Vector3(1,0,0),Y:new a.Vector3(0,1,0),Z:new a.Vector3(0,0,1)}),c(this,"pointStart",new a.Vector3),c(this,"pointEnd",new a.Vector3),c(this,"offset",new a.Vector3),c(this,"rotationAxis",new a.Vector3),c(this,"startNorm",new a.Vector3),c(this,"endNorm",new a.Vector3),c(this,"rotationAngle",0),c(this,"cameraPosition",new a.Vector3),c(this,"cameraQuaternion",new a.Quaternion),c(this,"cameraScale",new a.Vector3),c(this,"parentPosition",new a.Vector3),c(this,"parentQuaternion",new a.Quaternion),c(this,"parentQuaternionInv",new a.Quaternion),c(this,"parentScale",new a.Vector3),c(this,"worldPositionStart",new a.Vector3),c(this,"worldQuaternionStart",new a.Quaternion),c(this,"worldScaleStart",new a.Vector3),c(this,"worldPosition",new a.Vector3),c(this,"worldQuaternion",new a.Quaternion),c(this,"worldQuaternionInv",new a.Quaternion),c(this,"worldScale",new a.Vector3),c(this,"eye",new a.Vector3),c(this,"positionStart",new a.Vector3),c(this,"quaternionStart",new a.Quaternion),c(this,"scaleStart",new a.Vector3),c(this,"camera"),c(this,"object"),c(this,"enabled",!0),c(this,"axis",null),c(this,"mode","translate"),c(this,"translationSnap",null),c(this,"rotationSnap",null),c(this,"scaleSnap",null),c(this,"space","world"),c(this,"size",1),c(this,"dragging",!1),c(this,"showX",!0),c(this,"showY",!0),c(this,"showZ",!0),c(this,"changeEvent",{type:"change"}),c(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),c(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),c(this,"objectChangeEvent",{type:"objectChange"}),c(this,"intersectObjectWithRay",(e,t,n)=>{let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}),c(this,"attach",e=>(this.object=e,this.visible=!0,this)),c(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),c(this,"reset",()=>(this.enabled&&this.dragging&&void 0!==this.object&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this)),c(this,"updateMatrixWorld",()=>{void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),c(this,"pointerHover",e=>{if(void 0===this.object||!0===this.dragging)return;this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);t?this.axis=t.object.name:this.axis=null}),c(this,"pointerDown",e=>{if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if("scale"===this.mode?e="local":("E"===this.axis||"XYZE"===this.axis||"XYZ"===this.axis)&&(e="world"),"local"===e&&"rotate"===this.mode){let e=this.rotationSnap;"X"===this.axis&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),"Y"===this.axis&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),"Z"===this.axis&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),c(this,"pointerMove",e=>{let t=this.axis,n=this.mode,r=this.object,i=this.space;if("scale"===n?i="local":("E"===t||"XYZE"===t||"XYZ"===t)&&(i="world"),void 0===r||null===t||!1===this.dragging||-1!==e.button)return;this.raycaster.setFromCamera(e,this.camera);let o=this.intersectObjectWithRay(this.plane,this.raycaster,!0);
1if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),"translate"===n)this.offset.copy(this.pointEnd).sub(this.pointStart),"local"===i&&"XYZ"!==t&&this.offset.applyQuaternion(this.worldQuaternionInv),-1===t.indexOf("X")&&(this.offset.x=0),-1===t.indexOf("Y")&&(this.offset.y=0),-1===t.indexOf("Z")&&(this.offset.z=0),"local"===i&&"XYZ"!==t?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&("local"===i&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),"world"===i&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();0>this.pointEnd.dot(this.pointStart)&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),-1===t.search("X")&&(this.tempVector2.x=1),-1===t.search("Y")&&(this.tempVector2.y=1),-1===t.search("Z")&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(-1!==t.search("X")&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this.offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=0>this.endNorm.cross(this.startNorm).dot(this.eye)?1:-1):"XYZE"===t?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):("X"===t||"Y"===t||"Z"===t)&&(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),"local"===i&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===i&&"E"!==t&&"XYZE"!==t?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),c(this,"pointerUp",e=>{0===e.button&&(this.dragging&&null!==this.axis&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),c(this,"getPointer",e=>{var t;if(this.domElement&&(null==(t=this.domElement.ownerDocument)?void 0:t.pointerLockElement))return{x:0,y:0,button:e.button};{let t=e.changedTouches?e.changedTouches[0]:e,n=this.domElement.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*2-1,y:-(t.clientY-n.top)/n.height*2+1,button:e.button}}}),c(this,"onPointerHover",e=>{if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(e))}}),c(this,"onPointerDown",e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))}),c(this,"onPointerMove",e=>{this.enabled&&this.pointerMove(this.getPointer(e))}),c(this,"onPointerUp",e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(e)))}),c(this,"getMode",()=>this.mode),c(this,"setMode",e=>{this.mode=e}),c(this,"setTranslationSnap",e=>{this.translationSnap=e}),c(this,"setRotationSnap",e=>{this.rotationSnap=e}),c(this,"setScaleSnap",e=>{this.scaleSnap=e}),c(this,"setSize",e=>{this.size=e}),c(this,"setSpace",e=>{this.space=e}),c(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),c(this,"connect",e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)}),c(this,"dispose",()=>{var e,t,n,r,i,o;null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointermove",this.onPointerHover),null==(r=null==(n=this.domElement)?void 0:n.ownerDocument)||r.removeEventListener("pointermove",this.onPointerMove),null==(o=null==(i=this.domElement)?void 0:i.ownerDocument)||o.removeEventListener("pointerup",this.onPointerUp),this.traverse(e=>{e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new d,this.add(this.gizmo),this.plane=new h,this.add(this.plane);let n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return void 0!==n?n:t},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+"-changed",value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n("camera",this.camera),n("object",this.object),n("enabled",this.enabled),n("axis",this.axis),n("mode",this.mode),n("translationSnap",this.translationSnap),n("rotationSnap",this.rotationSnap),n("scaleSnap",this.scaleSnap),n("space",this.space),n("size",this.size),n("dragging",this.dragging),n("showX",this.showX),n("showY",this.showY),n("showZ",this.showZ),n("worldPosition",this.worldPosition),n("worldPositionStart",this.worldPositionStart),n("worldQuaternion",this.worldQuaternion),n("worldQuaternionStart",this.worldQuaternionStart),n("cameraPosition",this.cameraPosition),n("cameraQuaternion",this.cameraQuaternion),n("pointStart",this.pointStart),n("pointEnd",this.pointEnd),n("rotationAxis",this.rotationAxis),n("rotationAngle",this.rotationAngle),n("eye",this.eye),void 0!==t&&this.connect(t)}}class d extends a.Object3D{constructor(){super(),c(this,"isTransformControlsGizmo",!0),c(this,"type","TransformControlsGizmo"),c(this,"tempVector",new a.Vector3(0,0,0)),c(this,"tempEuler",new a.Euler),c(this,"alignVector",new a.Vector3(0,1,0)),c(this,"zeroVector",new a.Vector3(0,0,0)),c(this,"lookAtMatrix",new a.Matrix4),c(this,"tempQuaternion",new a.Quaternion),c(this,"tempQuaternion2",new a.Quaternion),c(this,"identityQuaternion",new a.Quaternion),c(this,"unitX",new a.Vector3(1,0,0)),c(this,"unitY",new a.Vector3(0,1,0)),c(this,"unitZ",new a.Vector3(0,0,1)),c(this,"gizmo"),c(this,"picker"),c(this,"helper"),c(this,"rotationAxis",new a.Vector3),
1c(this,"cameraPosition",new a.Vector3),c(this,"worldPositionStart",new a.Vector3),c(this,"worldQuaternionStart",new a.Quaternion),c(this,"worldPosition",new a.Vector3),c(this,"worldQuaternion",new a.Quaternion),c(this,"eye",new a.Vector3),c(this,"camera",null),c(this,"enabled",!0),c(this,"axis",null),c(this,"mode","translate"),c(this,"space","world"),c(this,"size",1),c(this,"dragging",!1),c(this,"showX",!0),c(this,"showY",!0),c(this,"showZ",!0),c(this,"updateMatrixWorld",()=>{let e=this.space;"scale"===this.mode&&(e="local");let t="local"===e?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=(n=(n=n.concat(this.picker[this.mode].children)).concat(this.gizmo[this.mode].children)).concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r;let i=n[e];if(i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition),r=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(r*this.size/7),"helper"===i.tag){i.visible=!1,"AXIS"===i.name?(i.position.copy(this.worldPositionStart),i.visible=!!this.axis,"X"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),i.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"Y"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),i.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"Z"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),i.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"XYZE"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),i.quaternion.multiply(this.tempQuaternion),i.visible=this.dragging),"E"===this.axis&&(i.visible=!1)):"START"===i.name?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):"END"===i.name?(i.position.copy(this.worldPosition),i.visible=this.dragging):"DELTA"===i.name?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,
11e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(this.tempVector),i.visible=this.dragging):(i.quaternion.copy(t),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=-1!==this.axis.search(i.name)));continue}i.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode?(("X"===i.name||"XYZX"===i.name)&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),("Y"===i.name||"XYZY"===i.name)&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),("Z"===i.name||"XYZZ"===i.name)&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"XY"===i.name&&.2>Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))&&(i.scale.set(1e-10,
11e-10,1e-10),i.visible=!1),"YZ"===i.name&&.2>Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"XZ"===i.name&&.2>Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),-1!==i.name.search("X")&&(0>this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)?"fwd"===i.tag?i.visible=!1:i.scale.x*=-1:"bwd"===i.tag&&(i.visible=!1)),-1!==i.name.search("Y")&&(0>this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)?"fwd"===i.tag?i.visible=!1:i.scale.y*=-1:"bwd"===i.tag&&(i.visible=!1)),-1!==i.name.search("Z")&&(0>this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)?"fwd"===i.tag?i.visible=!1:i.scale.z*=-1:"bwd"===i.tag&&(i.visible=!1))):"rotate"===this.mode&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),-1!==i.name.search("E")&&i.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),"X"===i.name&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),i.quaternion.copy(this.tempQuaternion)),"Y"===i.name&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),i.quaternion.copy(this.tempQuaternion)),"Z"===i.name&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),i.quaternion.copy(this.tempQuaternion))),i.visible=i.visible&&(-1===i.name.indexOf("X")||this.showX),i.visible=i.visible&&(-1===i.name.indexOf("Y")||this.showY),i.visible=i.visible&&(-1===i.name.indexOf("Z")||this.showZ),i.visible=i.visible&&(-1===i.name.indexOf("E")||this.showX&&this.showY&&this.showZ),i.material.tempOpacity=i.material.tempOpacity||i.material.opacity,i.material.tempColor=i.material.tempColor||i.material.color.clone(),i.material.color.copy(i.material.tempColor),i.material.opacity=i.material.tempOpacity,this.enabled?this.axis&&(i.name===this.axis?i.material.opacity=1:this.axis.split("").some(function(e){return i.name===e})?i.material.opacity=1:i.material.opacity*=.25,i.material.color.lerp(new a.Color(1,1,1),.5)):(i.material.opacity*=.5,i.material.color.lerp(new a.Color(1,1,1),.5))}super.updateMatrixWorld()});let e=new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,side:a.DoubleSide,fog:!1,toneMapped:!1}),t=new a.LineBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;let r=e.clone();r.opacity=.33;let i=e.clone();i.color.set(16711680);let o=e.clone();o.color.set(65280);let l=e.clone();l.color.set(255);let s=e.clone();s.opacity=.25;let u=s.clone();u.color.set(16776960);let d=s.clone();d.color.set(65535);let h=s.clone();h.color.set(16711935),e.clone().color.set(16776960);let f=t.clone();f.color.set(16711680);let p=t.clone();p.color.set(65280);let m=t.clone();m.color.set(255);let g=t.clone();g.color.set(65535);let v=t.clone();v.color.set(16711935);let y=t.clone();y.color.set(16776960);let b=t.clone();b.color.set(7895160);let w=y.clone();w.opacity=.25;let E=new a.CylinderGeometry(0,.05,.2,12,1,!1),x=new a.BoxGeometry(.125,.125,.125),S=new a.BufferGeometry;S.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));let k=(e,t)=>{let n=new a.BufferGeometry,r=[];for(let n=0;n<=64*t;++n)r.push(0,Math.cos(n/32*Math.PI)*e,Math.sin(n/32*Math.PI)*e);return n.setAttribute("position",new a.Float32BufferAttribute(r,3)),n},C={X:[[new a.Mesh(E,i),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new a.Mesh(E,i),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new a.Line(S,f)]],Y:[[new a.Mesh(E,o),[0,1,0],null,null,"fwd"],[new a.Mesh(E,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new a.Line(S,p),null,[0,0,Math.PI/2]]],Z:[[new a.Mesh(E,l),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new a.Mesh(E,l),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new a.Line(S,m),null,[0,-Math.PI/2,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),s.clone()),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneGeometry(.295,.295),u.clone()),[.15,.15,0]],[new a.Line(S,y),[.18,.3,0],null,[.125,1,1]],[new a.Line(S,y),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new a.Mesh(new a.PlaneGeometry(.295,.295),d.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new a.Line(S,g),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new a.Line(S,g),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new a.Mesh(new a.PlaneGeometry(.295,.295),h.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new a.Line(S,v),[.18,0,.3],null,[.125,1,1]],[new a.Line(S,v),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},O={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),n)]],XY:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},R={START:[[new a.Mesh(new a.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new a.Mesh(new a.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new a.Line((()=>{let e=new a.BufferGeometry;return e.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,1,1],3)),e})(),r),null,null,null,"helper"]],X:[[new a.Line(S,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(S,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(S,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},P={X:[[new a.Line(k(1,.5),f)],[new a.Mesh(new a.OctahedronGeometry(.04,0),i),[0,0,.99],null,[1,3,1]]],Y:[[new a.Line(k(1,.5),p),null,[0,0,-Math.PI/2]],[new a.Mesh(new a.OctahedronGeometry(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new a.Line(k(1,.5),m),null,[0,Math.PI/2,0]],[new a.Mesh(new a.OctahedronGeometry(.04,0),l),[.99,0,0],null,[1,3,1]]],E:[[new a.Line(k(1.25,1),w),null,[0,Math.PI/2,0]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),w),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),w),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),w),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),w),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new a.Line(k(1,1),b),null,[0,Math.PI/2,0]]]},M={AXIS:[[new a.Line(S,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},$={X:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusGeometry(1.25,.1,2,24),n)]],XYZE:[[new a.Mesh(new a.SphereGeometry(.7,10,8),n)]]},_={X:[[new a.Mesh(x,i),[.8,0,0],[0,0,-Math.PI/2]],[new a.Line(S,f),null,null,[.8,1,1]]],Y:[[new a.Mesh(x,o),[0,.8,0]],[new a.Line(S,p),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new a.Mesh(x,l),[0,0,.8],[Math.PI/2,0,0]],[new a.Line(S,m),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new a.Mesh(x,u),[.85,.85,0],null,[2,2,.2]],[new a.Line(S,y),[.855,.98,0],null,[.125,1,1]],[new a.Line(S,y),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new a.Mesh(x,d),[0,.85,.85],null,[.2,2,2]],[new a.Line(S,g),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new a.Line(S,g),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new a.Mesh(x,h),[.85,0,.85],null,[2,.2,2]],[new a.Line(S,v),[.855,0,.98],null,[.125,1,1]],[new a.Line(S,v),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),s.clone()),[1.1,0,0]]],XYZY:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),s.clone()),[0,1.1,0]]],XYZZ:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),s.clone()),[0,0,1.1]]]},T={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new a.Mesh(x,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new a.Mesh(x,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new a.Mesh(x,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[0,0,1.1]]]},j={X:[[new a.Line(S,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(S,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(S,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},A=e=>{let t=new a.Object3D;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),o=e[n][r][1],a=e[n][r][2],l=e[n][r][3],s=e[n][r][4];i.name=n,i.tag=s,o&&i.position.set(o[0],o[1],o[2]),a&&i.rotation.set(a[0],a[1],a[2]),l&&i.scale.set(l[0],l[1],l[2]),i.updateMatrix();let c=i.geometry.clone();
1c.applyMatrix4(i.matrix),i.geometry=c,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=A(C)),this.add(this.gizmo.rotate=A(P)),this.add(this.gizmo.scale=A(_)),this.add(this.picker.translate=A(O)),this.add(this.picker.rotate=A($)),this.add(this.picker.scale=A(T)),this.add(this.helper.translate=A(R)),this.add(this.helper.rotate=A(M)),this.add(this.helper.scale=A(j)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class h extends a.Mesh{constructor(){super(new a.PlaneGeometry(1e5,1e5,2,2),new a.MeshBasicMaterial({visible:!1,wireframe:!0,side:a.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),c(this,"isTransformControlsPlane",!0),c(this,"type","TransformControlsPlane"),c(this,"unitX",new a.Vector3(1,0,0)),c(this,"unitY",new a.Vector3(0,1,0)),c(this,"unitZ",new a.Vector3(0,0,1)),c(this,"tempVector",new a.Vector3),c(this,"dirVector",new a.Vector3),c(this,"alignVector",new a.Vector3),c(this,"tempMatrix",new a.Matrix4),c(this,"identityQuaternion",new a.Quaternion),c(this,"cameraQuaternion",new a.Quaternion),c(this,"worldPosition",new a.Vector3),c(this,"worldQuaternion",new a.Quaternion),c(this,"eye",new a.Vector3),c(this,"axis",null),c(this,"mode","translate"),c(this,"space","world"),c(this,"updateMatrixWorld",()=>{let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),this.unitX.set(1,0,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0)}break;default:this.dirVector.set(0,0,0)}0===this.dirVector.length()?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}}let f=o.forwardRef((e,t)=>{let{children:n,domElement:l,onChange:s,onMouseDown:c,onMouseUp:d,onObjectChange:h,object:f,makeDefault:p,camera:m,enabled:g,axis:v,mode:y,translationSnap:b,rotationSnap:w,scaleSnap:E,space:x,size:S,showX:k,showY:C,showZ:O,...R}=e,P=(0,i.D)(e=>e.controls),M=(0,i.D)(e=>e.gl),$=(0,i.D)(e=>e.events),_=(0,i.D)(e=>e.camera),T=(0,i.D)(e=>e.invalidate),j=(0,i.D)(e=>e.get),A=(0,i.D)(e=>e.set),I=m||_,D=l||$.connected||M.domElement,L=o.useMemo(()=>new u(I,D),[I,D]),N=o.useRef(null);o.useLayoutEffect(()=>(f?L.attach(f instanceof a.Object3D?f:f.current):N.current instanceof a.Object3D&&L.attach(N.current),()=>void L.detach()),[f,n,L]),o.useEffect(()=>{if(P){let e=e=>P.enabled=!e.value;return L.addEventListener("dragging-changed",e),()=>L.removeEventListener("dragging-changed",e)}},[L,P]);let z=o.useRef(),V=o.useRef(),B=o.useRef(),F=o.useRef();return o.useLayoutEffect(()=>void(z.current=s),[s]),o.useLayoutEffect(()=>void(V.current=c),[c]),o.useLayoutEffect(()=>void(B.current=d),[d]),o.useLayoutEffect(()=>void(F.current=h),[h]),o.useEffect(()=>{let e=e=>{T(),null==z.current||z.current(e)},t=e=>null==V.current?void 0:V.current(e),n=e=>null==B.current?void 0:B.current(e),r=e=>null==F.current?void 0:F.current(e);return L.addEventListener("change",e),L.addEventListener("mouseDown",t),L.addEventListener("mouseUp",n),L.addEventListener("objectChange",r),()=>{L.removeEventListener("change",e),L.removeEventListener("mouseDown",t),L.removeEventListener("mouseUp",n),L.removeEventListener("objectChange",r)}},[T,L]),o.useEffect(()=>{if(p){let e=j().controls;return A({controls:L}),()=>A({controls:e})}},[p,L]),o.createElement(o.Fragment,null,o.createElement("primitive",{ref:t,object:L,enabled:g,axis:v,mode:y,translationSnap:b,rotationSnap:w,scaleSnap:E,space:x,size:S,showX:k,showY:C,showZ:O}),o.createElement("group",(0,r.Z)({ref:N},R),n))})},22874:function(e){"use strict";e.exports=function(e,t){if(null==e)throw TypeError("expected first argument to be an object.");if(void 0===t||"undefined"==typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),i=arguments.length,o=0;++o<i;)for(var a=Object(arguments[o]),l=Object.getOwnPropertySymbols(a),s=0;s<l.length;s++){var c=l[s];n.call(a,c)&&(r[c]=a[c])}return r}},29597:function(e,t){"use strict";t.Z=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(0===n.length)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?o===t.replace(/\/.*$/,""):i===t})}return!0}},65903:function(e,t,n){"use strict";var r=n(13247);e.exports=function(e){r(e)||(e={});for(var t=arguments.length,n=1;n<t;n++){var i=arguments[n];r(i)&&function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}(e,i)}return e}},13247:function(e){"use strict";e.exports=function(e){return null!=e&&("object"==typeof e||"function"==typeof e)}},99644:function(e){"use strict";e.exports=function(e,t,n){for(var r in e)if(!1===t.call(n,e[r],r,e))break}},52800:function(e){e.exports=function(e,n,r,i,o){var a;if(!(null!==(a=e)&&("object"==typeof a||"function"==typeof a))||!n)return e;if(n=t(n),r&&(n+="."+t(r)),i&&(n+="."+t(i)),o&&(n+="."+t(o)),n in e)return e[n];for(var l=n.split("."),s=l.length,c=-1;e&&++c<s;){for(var u=l[c];"\\"===u[u.length-1];)u=u.slice(0,-1)+"."+l[++c];e=e[u]}return e};
1function t(e){return e?Array.isArray(e)?e.join("."):e:""}},17710:function(e,t,n){"use strict";var r=n(54262);e.exports=function(e){return r(e)||"function"==typeof e||Array.isArray(e)}},54262:function(e,t,n){"use strict";var r=n(3660);function i(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==i(e)&&"function"==typeof(t=e.constructor)&&!1!==i(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}},3660:function(e){"use strict";e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},66101:function(e,t,n){"use strict";n.d(t,{LI:function(){return lt},M4:function(){return lD}});var r=n(7653),i=n.t(r,2),o=n(3458);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=a(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():a(e[t],null)}}}}function s(...e){return r.useCallback(l(...e),e)}var c=n(27573),u=Symbol.for("react.lazy"),d=i[" use ".trim().toString()];function h(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===u&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var f=Symbol("radix.slottable");function p(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}var m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(h(n)&&"function"==typeof d&&(n=d(n._payload)),r.isValidElement(n)){var o;let e,a;let s=(o=n,(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.ref:(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.props.ref:o.props.ref||o.ref),c=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(c.ref=t?l(t,s):s),r.cloneElement(n,c)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e;h(i)&&"function"==typeof d&&(i=d(i._payload));let a=r.Children.toArray(i),l=a.find(p);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),g=globalThis?.document?r.useLayoutEffect:()=>{},v=r.forwardRef((e,t)=>{var n,i;let{container:a,...l}=e,[s,u]=r.useState(!1);g(()=>u(!0),[]);let d=a||s&&(null===(i=globalThis)||void 0===i?void 0:null===(n=i.document)||void 0===n?void 0:n.body);return d?o.createPortal((0,c.jsx)(m.div,{...l,ref:t}),d):null});v.displayName="Portal";var y=Object.prototype.hasOwnProperty;function b(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&b(e[r],t[r]););return -1===r}if(!n||"object"==typeof e){for(n in r=0,e)if(y.call(e,n)&&++r&&!y.call(t,n)||!(n in t)||!b(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}function w(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var E=function(e,t,n,r){this.name=e,this.fn=t,this.args=n,this.modifiers=r};function x(e,t){return void 0===t&&(t="simple"),"object"==typeof e?e[t]:e}function S(e,t,n){if(!e.length)return x(t);var r=e.shift(),i=S(e,t,n);return r.perform(i,n)}E.prototype._test=function(e){var t=this.fn;try{S(this.modifiers.slice(),t,this)(e)}catch(e){t=function(){return!1}}try{return S(this.modifiers.slice(),t,this)(e)}catch(e){return!1}},E.prototype._check=function(e){try{S(this.modifiers.slice(),this.fn,this)(e)}catch(e){if(S(this.modifiers.slice(),function(e){return e},this)(!1))return}if(!S(this.modifiers.slice(),this.fn,this)(e))throw null},E.prototype._testAsync=function(e){var t=this;return new Promise(function(n,r){(function e(t,n,r){if(!t.length)return function(e){return Promise.resolve(x(n,"async")(e))};var i=t.shift(),o=e(t,n,r);return i.performAsync(o,r)})(t.modifiers.slice(),t.fn,t)(e).then(function(t){t?n(e):r(null)}
1).catch(function(e){return r(e)})})};var k=function(e,t,n){this.name=e,this.perform=t,this.performAsync=n},C=function(e){function t(n,r,i,o){for(var a=[],l=arguments.length-4;l-- >0;)a[l]=arguments[l+4];e.call(this,a),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=i,this.target=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),O=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.chain=e,this.nextRuleModifiers=t};O.prototype._applyRule=function(e,t){var n=this;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return n.chain.push(new E(t,e.apply(n,r),r,n.nextRuleModifiers)),n.nextRuleModifiers=[],n}},O.prototype._applyModifier=function(e,t){return this.nextRuleModifiers.push(new k(t,e.simple,e.async)),this},O.prototype._clone=function(){return new O(this.chain.slice(),this.nextRuleModifiers.slice())},O.prototype.test=function(e){return this.chain.every(function(t){return t._test(e)})},O.prototype.testAll=function(e){var t=[];return this.chain.forEach(function(n){try{n._check(e)}catch(r){t.push(new C(n,e,r))}}),t},O.prototype.check=function(e){this.chain.forEach(function(t){try{t._check(e)}catch(n){throw new C(t,e,n)}})},O.prototype.testAsync=function(e){var t=this;return new Promise(function(n,r){(function e(t,n,r,i){if(n.length){var o=n.shift();o._testAsync(t).then(function(){e(t,n,r,i)},function(e){i(new C(o,t,e))})}else r(t)})(e,t.chain.slice(),n,r)})};var R=function(e,t){return!!t&&"string"==typeof e&&0===e.trim().length||null==e};function P(){return"undefined"!=typeof Proxy?function e(t){return new Proxy(t,{get:function(n,r){if(r in n)return n[r];var i=e(t._clone());return r in $?i._applyModifier($[r],r):r in M?i._applyRule(M[r],r):r in j?i._applyRule(j[r],r):void 0}})}(new O):function e(t){var n=function(t,n){return Object.keys(t).forEach(function(r){n[r]=function(){for(var i=[],o=arguments.length;o--;)i[o]=arguments[o];return e(n._clone())._applyRule(t[r],r).apply(void 0,i)}}),n},r=n(j,t),i=n(M,r);return Object.keys($).forEach(function(t){Object.defineProperty(i,t,{get:function(){return e(i._clone())._applyModifier($[t],t)}})}),i}(new O)}var M={};P.extend=function(e){Object.assign(M,e)},P.clearCustomRules=function(){M={}};var $={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(e){return!e}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return T(t).some(function(t){try{return e(t)}catch(e){return!1}})}},async:function(e){return function(t){return Promise.all(T(t).map(function(t){try{return e(t).catch(function(){return!1})}catch(e){return!1}})).then(function(e){return e.some(Boolean)})}}},every:{simple:function(e){return function(t){return!1!==t&&T(t).every(e)}},async:function(e){return function(t){return Promise.all(T(t).map(e)).then(function(e){return e.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return _(t)&&n&&"object"==typeof n?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(e){return _(t)&&n&&"object"==typeof n?Object.keys(t.args[0]).length===Object.keys(n).length&&e:e}).catch(function(){return!1})}}}};function _(e){return e&&"schema"===e.name&&e.args.length>0&&"object"==typeof e.args[0]}function T(e){return"string"==typeof e?e.split(""):e}var j={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return void 0===e&&(e=!0),function(t){return"number"==typeof t&&(e||isFinite(t))}},integer:function(){return function(e){return(Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e})(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return A("string")},boolean:function(){return A("boolean")},undefined:function(){return A("undefined")},null:function(){return A("null")},array:function(){return A("array")},object:function(){return A("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return"boolean"==typeof e||e===e.toLowerCase()&&""!==e.trim()}},uppercase:function(){return function(e){return e===e.toUpperCase()&&""!==e.trim()}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return 0===e.length}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return t<e}},lessThanOrEqual:function(e){return function(t){return t<=e}},greaterThan:function(e){return function(t){return t>e}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2==0}
1},odd:function(){return function(e){return e%2!=0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var i=e[r];try{i.check((t||{})[r])}catch(e){e.target=r,n.push(e)}}),n.length>0)throw n;return!0},async:function(t){var n=[];return Promise.all(Object.keys(e).map(function(r){return e[r].testAsync((t||{})[r]).catch(function(e){e.target=r,n.push(e)})})).then(function(){if(n.length>0)throw n;return!0})}}},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t){return e.some(function(e){return e.test(t)})}},optional:function(e,t){return void 0===t&&(t=!1),{simple:function(n){return R(n,t)||void 0===e.check(n)},async:function(n){return R(n,t)||e.testAsync(n)}}}};function A(e){return function(t){return Array.isArray(t)&&"array"===e||null===t&&"null"===e||typeof t===e}}var I="colors",D="sizes",L="space",N={gap:L,gridGap:L,columnGap:L,gridColumnGap:L,rowGap:L,gridRowGap:L,inset:L,insetBlock:L,insetBlockEnd:L,insetBlockStart:L,insetInline:L,insetInlineEnd:L,insetInlineStart:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockEnd:L,marginBlockStart:L,marginInline:L,marginInlineEnd:L,marginInlineStart:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockEnd:L,paddingBlockStart:L,paddingInline:L,paddingInlineEnd:L,paddingInlineStart:L,top:L,right:L,bottom:L,left:L,scrollMargin:L,scrollMarginTop:L,scrollMarginRight:L,scrollMarginBottom:L,scrollMarginLeft:L,scrollMarginX:L,scrollMarginY:L,scrollMarginBlock:L,scrollMarginBlockEnd:L,scrollMarginBlockStart:L,scrollMarginInline:L,scrollMarginInlineEnd:L,scrollMarginInlineStart:L,scrollPadding:L,scrollPaddingTop:L,scrollPaddingRight:L,scrollPaddingBottom:L,scrollPaddingLeft:L,scrollPaddingX:L,scrollPaddingY:L,scrollPaddingBlock:L,scrollPaddingBlockEnd:L,scrollPaddingBlockStart:L,scrollPaddingInline:L,scrollPaddingInlineEnd:L,scrollPaddingInlineStart:L,fontSize:"fontSizes",background:I,backgroundColor:I,backgroundImage:I,borderImage:I,border:I,borderBlock:I,borderBlockEnd:I,borderBlockStart:I,borderBottom:I,borderBottomColor:I,borderColor:I,borderInline:I,borderInlineEnd:I,borderInlineStart:I,borderLeft:I,borderLeftColor:I,borderRight:I,borderRightColor:I,borderTop:I,borderTopColor:I,caretColor:I,color:I,columnRuleColor:I,fill:I,outline:I,outlineColor:I,stroke:I,textDecorationColor:I,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:D,minBlockSize:D,maxBlockSize:D,inlineSize:D,minInlineSize:D,maxInlineSize:D,width:D,minWidth:D,maxWidth:D,height:D,minHeight:D,maxHeight:D,flexBasis:D,gridTemplateColumns:D,gridTemplateRows:D,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},z=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,V=()=>{let e=Object.create(null);return(t,n,...r)=>{let i=JSON.stringify(t,z);return i in e?e[i]:e[i]=n(t,...r)}},B=Symbol.for("sxs.internal"),F=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),U=e=>{for(let t in e)return!0;return!1},{hasOwnProperty:W}=Object.prototype,H=e=>e.includes("-")?e:e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),Y=/\s+(?![^()]*\))/,Q=e=>t=>e(..."string"==typeof t?String(t).split(Y):[t]),X={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:Q((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:Q((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:Q((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:Q((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:Q((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:Q((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},G=/([\d.]+)([^]*)/,Z=(e,t)=>e.length?e.reduce((e,n)=>(e.push(...t.map(e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(n)&&/&.*&/.test(e)?`:is(${n})`:n):n+" "+e)),e),[]):t,K=(e,t)=>e in q&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\
1w-][^]*)?)$/,(t,n,r,i)=>n+("stretch"===r?`-moz-available${i};${H(e)}:${n}-webkit-fill-available`:`-moz-fit-content${i};${H(e)}:${n}fit-content`)+i):String(t),q={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},J=e=>e?e+"-":"",ee=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(e,r,i,o,a)=>"$"==o==!!i?e:(r||"--"==o?"calc(":"")+"var(--"+("$"===o?J(t)+(a.includes("$")?"":J(n))+a.replace(/\$/g,"-"):a)+")"+(r||"--"==o?"*"+(r||"")+(i||"1")+")":"")),et=/\s*,\s*(?![^()]*\))/,en=Object.prototype.toString,er=(e,t,n,r,i)=>{let o,a,l;let s=(e,t,n)=>{let c,u;let d=e=>{var h;for(c in e){let f=64===c.charCodeAt(0);for(u of f&&Array.isArray(e[c])?e[c]:[e[c]]){let e=/[A-Z]/.test(h=c)?h:h.replace(/-[^]/g,e=>e[1].toUpperCase()),p="object"==typeof u&&u&&u.toString===en&&(!r.utils[e]||!t.length);if(e in r.utils&&!p){let t=r.utils[e];if(t!==a){a=t,d(t(u)),a=null;continue}}else if(e in X){let t=X[e];if(t!==l){l=t,d(t(u)),l=null;continue}}if(f&&(c=(c.slice(1) in r.media?"@media "+r.media[c.slice(1)]:c).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(e,t,n,r,i,o)=>{let a=G.test(t),l=.0625*(a?-1:1),[s,c]=a?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===a?"max-":"min-")+s+":"+("="!==n[0]&&1===n.length?c.replace(G,(e,t,r)=>Number(t)+l*(">"===n?1:-1)+r):c)+(i?") and ("+(">"===i[0]?"min-":"max-")+s+":"+(1===i.length?o.replace(G,(e,t,n)=>Number(t)+l*(">"===i?-1:1)+n):o):"")+")"})),p){let e=f?n.concat(c):[...n],r=f?[...t]:Z(t,c.split(et));void 0!==o&&i(ei(...o)),o=void 0,s(u,r,e)}else void 0===o&&(o=[[],t,n]),c=f||36!==c.charCodeAt(0)?c:`--${J(r.prefix)}${c.slice(1).replace(/\$/g,"-")}`,u=p?u:"number"==typeof u?u&&e in eo?String(u)+"px":String(u):ee(K(e,null==u?"":u),r.prefix,r.themeMap[e]),o[0].push(`${f?`${c} `:`${H(c)}:`}${u}`)}}};d(e),void 0!==o&&i(ei(...o)),o=void 0};s(e,t,n)},ei=(e,t,n)=>`${n.map(e=>`${e}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,eo={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},ea=e=>String.fromCharCode(e+(e>25?39:97)),el=e=>(e=>{let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ea(t%52)+n;return ea(t%52)+n})(((e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e})(5381,JSON.stringify(e))>>>0),es=["themed","global","styled","onevar","resonevar","allvar","inline"],ec=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},eu=e=>{let t;let n=()=>{let{cssRules:e}=t.sheet;return[].map.call(e,(n,r)=>{let{cssText:i}=n,o="";if(i.startsWith("--sxs"))return"";if(e[r-1]&&(o=e[r-1].cssText).startsWith("--sxs")){if(!n.cssRules.length)return"";for(let e in t.rules)if(t.rules[e].group===n)return`--sxs{--sxs:${[...t.rules[e].cache].join(" ")}}${i}`;return n.cssRules.length?`${o}${i}`:""}return i}).join("")},r=()=>{if(t){let{rules:e,sheet:n}=t;if(!n.deleteRule){for(;3===Object(Object(n.cssRules)[0]).type;)n.cssRules.splice(0,1);n.cssRules=[]}for(let t in e)delete e[t]}for(let i of Object(e).styleSheets||[])if(ec(i)){for(let e=0,o=i.cssRules;o[e];++e){let a=Object(o[e]);if(1!==a.type)continue;let l=Object(o[e+1]);if(4!==l.type)continue;++e;let{cssText:s}=a;if(!s.startsWith("--sxs"))continue;let c=s.slice(14,-3).trim().split(/\s+/),u=es[c[0]];u&&(t||(t={sheet:i,reset:r,rules:{},toString:n}),t.rules[u]={group:l,index:e,cache:new Set(c)})}if(t)break}if(!t){let i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,e=>e.cssText).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:r,toString:n}}let{sheet:i,rules:o}=t;for(let e=es.length-1;e>=0;--e){let t=es[e];if(!o[t]){let n=es[e+1],r=o[n]?o[n].index:i.cssRules.length;i.insertRule("@media{}",r),i.insertRule(`--sxs{--sxs:${e}}`,r),o[t]={group:i.cssRules[r+1],index:r,cache:new Set([e])}}ed(o[t])}};return r(),t},ed=e=>{let t=e.group,n=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,n),++n}catch(e){}}},eh=Symbol(),ef=V(),ep=(e,t)=>ef(e,()=>(...n)=>{let r={type:null,composers:new Set};for(let t of n)if(null!=t){if(t[B])for(let e of(null==r.type&&(r.type=t[B].type),t[B].composers))r.composers.add(e);else t.constructor!==Object||t.$$typeof?null==r.type&&(r.type=t):r.composers.add(em(t,e))}return null==r.type&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),eg(e,r,t)}),em=({variants:e,compoundVariants:t,defaultVariants:n,...r},i)=>{let o=`${J(i.prefix)}c-${el(r)}`,a=[],l=[],s=Object.create(null),c=[];for(let e in n)s[e]=String(n[e]);if("object"==typeof e&&e)for(let t in e){W.call(s,t)||(s[t]="undefined");let n=e[t];for(let e in n){let r={[t]:String(e)};"undefined"===String(e)&&c.push(t);let i=n[e],o=[r,i,!U(i)];a.push(o)}}if("object"==typeof t&&t)for(let e of t){let{css:t,...n}=e;for(let e in t="object"==typeof t&&t||{},n)n[e]=String(n[e]);let r=[n,t,!U(t)];l.push(r)}return[o,r,a,l,s,c]},eg=(e,t,n)=>{let[r,i,o,a]=ev(t.composers),l="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let n=0;n<t[eh].length;n++){let[r,i]=t[eh][n];e.rules[r].apply(i)}return t[eh]=[],null}return t[eh]=[],t.rules={}
1,es.forEach(e=>t.rules[e]={apply:n=>t[eh].push([e,n])}),t})(n):null,s=(l||n).rules,c=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,u=u=>{let{css:d,...h}=u="object"==typeof u&&u||eb,f={};for(let e in o)if(delete h[e],e in u){let t=u[e];"object"==typeof t&&t?f[e]={"@initial":o[e],...t}:(t=String(t),f[e]="undefined"!==t||a.has(e)?t:o[e])}else f[e]=o[e];let p=new Set([...i]);for(let[r,i,o,a]of t.composers){n.rules.styled.cache.has(r)||(n.rules.styled.cache.add(r),er(i,[`.${r}`],[],e,e=>{s.styled.apply(e)}));let t=ey(o,f,e.media),l=ey(a,f,e.media,!0);for(let i of t)if(void 0!==i)for(let[t,o,a]of i){let i=`${r}-${el(o)}-${t}`;p.add(i);let l=(a?n.rules.resonevar:n.rules.onevar).cache,c=a?s.resonevar:s.onevar;l.has(i)||(l.add(i),er(o,[`.${i}`],[],e,e=>{c.apply(e)}))}for(let t of l)if(void 0!==t)for(let[i,o]of t){let t=`${r}-${el(o)}-${i}`;p.add(t),n.rules.allvar.cache.has(t)||(n.rules.allvar.cache.add(t),er(o,[`.${t}`],[],e,e=>{s.allvar.apply(e)}))}}if("object"==typeof d&&d){let t=`${r}-i${el(d)}-css`;p.add(t),n.rules.inline.cache.has(t)||(n.rules.inline.cache.add(t),er(d,[`.${t}`],[],e,e=>{s.inline.apply(e)}))}for(let e of String(u.className||"").trim().split(/\s+/))e&&p.add(e);let m=h.className=[...p].join(" ");return{type:t.type,className:m,selector:c,props:h,toString:()=>m,deferredInjector:l}};return F(u,{className:r,selector:c,[B]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},ev=e=>{let t="",n=[],r={},i=[];for(let[o,,,,a,l]of e)for(let e in""===t&&(t=o),n.push(o),i.push(...l),a){let t=a[e];(void 0===r[e]||"undefined"!==t||l.includes(t))&&(r[e]=t)}return[t,n,r,new Set(i)]},ey=(e,t,n,r)=>{let i=[];e:for(let[o,a,l]of e){if(l)continue;let e,s=0,c=!1;for(e in o){let r=o[e],i=t[e];if(i!==r){if("object"!=typeof i||!i)continue e;{let e,t,o=0;for(let a in i){if(r===String(i[a])){if("@initial"!==a){let e=a.slice(1);(t=t||[]).push(e in n?n[e]:a.replace(/^@media ?/,"")),c=!0}s+=o,e=!0}++o}if(t&&t.length&&(a={["@media "+t.join(", ")]:a}),!e)continue e}}}(i[s]=i[s]||[]).push([r?"cv":`${e}-${o[e]}`,a,c])}return i},eb={},ew=V(),eE=(e,t)=>ew(e,()=>(...n)=>{let r=()=>{for(let r of n){let n=el(r="object"==typeof r&&r||{});if(!t.rules.global.cache.has(n)){if(t.rules.global.cache.add(n),"@import"in r){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let n of[].concat(r["@import"]))n=n.includes('"')||n.includes("'")?n:`"${n}"`,t.sheet.insertRule(`@import ${n};`,e++);delete r["@import"]}er(r,[],[],e,e=>{t.rules.global.apply(e)})}}return""};return F(r,{toString:r})}),ex=V(),eS=(e,t)=>ex(e,()=>n=>{let r=`${J(e.prefix)}k-${el(n)}`,i=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);let i=[];er(n,[],[],e,e=>i.push(e));let o=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(o)}return r};return F(i,{get name(){return i()},toString:i})}),ek=class{constructor(e,t,n,r){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==n?"":String(n),this.prefix=null==r?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+J(this.prefix)+J(this.scale)+this.token}toString(){return this.computedValue}},eC=V(),eO=(e,t)=>eC(e,()=>(n,r)=>{r="object"==typeof n&&n||Object(r);let i=`.${n=(n="string"==typeof n?n:"")||`${J(e.prefix)}t-${el(r)}`}`,o={},a=[];for(let t in r)for(let n in o[t]={},r[t]){let i=`--${J(e.prefix)}${t}-${n}`,l=ee(String(r[t][n]),e.prefix,t);o[t][n]=new ek(n,l,t,e.prefix),a.push(`${i}:${l}`)}let l=()=>{if(a.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);let i=`${r===e.theme?":root,":""}.${n}{${a.join(";")}}`;t.rules.themed.apply(i)}return n};return{...o,get className(){return l()},selector:i,toString:l}}),eR=V(),eP=V();let eM={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function e$(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function e_(e,t,n,r=.15){return 0===r?Math.max(t,Math.min(e,n)):e<t?-e$(t-e,n-t,r)+t:e>n?+e$(e-n,n-t,r)+n:e}function eT(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ej(Object(n),!0).forEach(function(t){eT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ej(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let eI={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function eD(e){return e?e[0].toUpperCase()+e.slice(1):""}let eL=["enter","leave"],eN=["gotpointercapture","lostpointercapture"];function ez(e){return"touches"in e}function eV(e){return ez(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function eB(e){return ez(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function eF(e){let t=eB(e);return ez(e)?t.identifier:t.pointerId}function eU(e){let t=eB(e);return[t.clientX,t.clientY]}function eW(e,...t){return"function"==typeof e?e(...t):e}function eH(){}function eY(e,t){return Object.assign({},t,e||{})}class eQ{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?eW(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);eM.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[o,a]=t._movement,[l,s]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(o)>=l&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=s&&u[1])):(!1===c[0]&&(c[0]=Math.abs(o)>=l&&Math.sign(o)*l),!1===c[1]&&(c[1]=Math.abs(a)>=s&&Math.sign(a)*s)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;let d=[0,0];if(n.hasCustomTransform){let[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?o-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);let h=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=eW(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));
1let[p,m]=t.offset,[[g,v],[y,b]]=t._bounds;t.overflow=[p<g?-1:p>v?1:0,m<y?-1:m>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,i]){let[[o,a],[l,s]]=e;return[e_(t,o,a,r),e_(n,l,s,i)]}(t._bounds,t.offset,w),t.delta=eM.sub(t.offset,h),this.computeMovement(),f&&(!t.last||i>32)){t.delta=eM.sub(t.offset,h);let e=t.delta.map(Math.abs);eM.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){let e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;let r=this.handler(eA(eA(eA({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class eX extends eQ{constructor(...e){super(...e),eT(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=eM.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=eM.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,n=this.config;if(!t.axis&&e){let r="object"==typeof n.axisThreshold?n.axisThreshold[eV(e)]:n.axisThreshold;t.axis=function([e,t],n){let r=Math.abs(e),i=Math.abs(t);return r>i&&r>n?"x":i>r&&i>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let eG=e=>e,eZ={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>eA(eA({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return eM.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?eM.toVector(e):void 0,transform(e,t,n){let r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||eG},threshold:e=>eM.toVector(e,0)},eK=0,eq=eA(eA({},eZ),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=eK)=>e,bounds(e={}){if("function"==typeof e)return t=>eq.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),eJ={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class e0 extends eX{constructor(...e){super(...e),eT(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=eq.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=eF(e),n._pointerActive=!0,this.computeValues(eU(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==eV(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit
1())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,n=this.config;if(!t._pointerActive)return;let r=eF(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;let i=eU(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=eM.sub(i,t._values),this.computeValues(i)),eM.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll){if(!t.axis)return;if(t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis){t._active=!1,this.clean();return}this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;let r=eF(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[i,o]=t._distance;if(t.tap=i<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{let[e,r]=t._delta,[i,o]=t._movement,[a,l]=n.swipe.velocity,[s,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){let n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>a&&Math.abs(i)>s&&(t.swipe[0]=Math.sign(e)),u>l&&Math.abs(o)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,"persist"in e&&"function"==typeof e.persist&&e.persist();let t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=eJ[e.key];if(t){let n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,eM.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in eJ&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}let e1="undefined"!=typeof window&&window.document&&window.document.createElement;function e2(){return e1&&"ontouchstart"in window}let e3={isBrowser:e1,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:e2(),touchscreen:e2()||e1&&window.navigator.maxTouchPoints>1,pointer:e1&&"onpointerdown"in window,pointerLock:e1&&"exitPointerLock"in window.document},e5=10,e4={mouse:0,touch:0,pen:8},e6=eA(eA({},eq),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return(this.pointerLock=r&&e3.pointerLock,e3.touch&&n)?"touch":this.pointerLock?"mouse":e3.pointer&&!i?"pointer":e3.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,e3.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i}){let o=eM.toVector(e,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(eM.toVector(e)),distance:this.transform(eM.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?eA(eA({},e4),e):e4,keyboardDisplacement:(e=e5)=>e});eA(eA({},eZ),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!e3.touch&&e3.gesture)return"gesture";if(e3.touch&&r)return"touch";if(e3.touchscreen){if(e3.pointer)return"pointer";if(e3.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){let i=e=>{let t=eY(eW(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{let t=eY(eW(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[i(),o()]:e=>[i(e),o(e)]},threshold(e,t,n){return this.lockDirection="lock"===n.axis,eM.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),eA(eA({},eq),{},{mouseOnly:(e=!0)=>e}),eA(eA({},eq),{},{mouseOnly:(e=!0)=>e});let e8=new Map,e7=new Map,e9="drag",te=e0,tt=e6,tn={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=e3.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},tr=["target","eventOptions","window","enabled","transform"];function ti(e={},t){let n={};for(let[r,i]of Object.entries(t))switch(typeof i){case"function":n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=ti(e[r],i);break;case"boolean":i&&(n[r]=e[r])}return n}class to{constructor(e,t){eT(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){let o=this._listeners,a=function(e,t=""){let n=eI[e];return e+(n&&n[t]||t)}(t,n),l=eA(eA({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,r,l);let s=()=>{e.removeEventListener(a,r,l),o.delete(s)};return o.add(s),s}
1clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ta{constructor(){eT(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class tl{constructor(e){eT(this,"gestures",new Set),eT(this,"_targetEventStore",new to(this)),eT(this,"gestureEventStores",{}),eT(this,"gestureTimeoutStores",{}),eT(this,"handlers",{}),eT(this,"config",{}),eT(this,"pointerIds",new Set),eT(this,"touchIds",new Set),eT(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),e.drag&&ts(this,"drag"),e.wheel&&ts(this,"wheel"),e.scroll&&ts(this,"scroll"),e.move&&ts(this,"move"),e.pinch&&ts(this,"pinch"),e.hover&&ts(this,"hover")}setEventIds(e){return ez(e)?(this.touchIds=new Set(Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}).map(e=>e.identifier)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){let{target:r,eventOptions:i,window:o,enabled:a,transform:l}=e,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,tr);if(n.shared=ti({target:r,eventOptions:i,window:o,enabled:a,transform:l},tn),t){let e=e7.get(t);n[t]=ti(eA({shared:n.shared},s),e)}else for(let e in s){let t=e7.get(e);t&&(n[e]=ti(eA({shared:n.shared},s[e]),t))}return n}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t;let n=this.config.shared,r={};if(!n.target||(t=n.target())){if(n.enabled){for(let n of this.gestures){let i=this.config[n],o=tc(r,i.eventOptions,!!t);i.enabled&&new(e8.get(n))(this,e,n).bind(o)}let i=tc(r,n.eventOptions,!!t);for(let t in this.nativeHandlers)i(t,"",n=>this.nativeHandlers[t](eA(eA({},this.state.shared),{},{event:n,args:e})),void 0,!0)}for(let e in r)r[e]=function(...e){return 0===e.length?eH:1===e.length?e[0]:function(){let t;for(let n of e)t=n.apply(this,arguments)||t;return t}}(...r[e]);if(!t)return r;for(let e in r){let{device:n,capture:i,passive:o}=function(e){let t=e.substring(2).toLowerCase(),n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));let r=eN.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}(e);this._targetEventStore.add(t,n,"",r[e],{capture:i,passive:o})}}}}function ts(e,t){e.gestures.add(t),e.gestureEventStores[t]=new to(e,t),e.gestureTimeoutStores[t]=new ta}let tc=(e,t,n)=>(r,i,o,a={},l=!1)=>{var s,c;let u=null!==(s=a.capture)&&void 0!==s?s:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive,h=l?r:function(e,t="",n=!1){let r=eI[e],i=r&&r[t]||t;return"on"+eD(e)+eD(i)+(!function(e=!1,t){return e&&!eL.includes(t)}(n,i)?"":"Capture")}(r,i,u);n&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)};function tu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function td(e,t=[]){let n=[],i=()=>{let t=n.map(e=>r.createContext(e));return function(n){let i=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:i}}),[n,i])}};return i.scopeName=e,[function(t,i){let o=r.createContext(i),a=n.length;n=[...n,i];let l=t=>{let{scope:n,children:i,...l}=t,s=n?.[e]?.[a]||o,u=r.useMemo(()=>l,Object.values(l));return(0,c.jsx)(s.Provider,{value:u,children:i})};return l.displayName=t+"Provider",[l,function(n,l){let s=l?.[e]?.[a]||o,c=r.useContext(s);if(c)return c;if(void 0!==i)return i;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}(i,...t)]}"undefined"!=typeof window&&window.document&&window.document.createElement;var th=Symbol("radix.slottable");function tf(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===th}var tp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
1{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=t?l(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,a=r.Children.toArray(i),l=a.find(tf);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function tm(e){let t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var tg="dismissableLayer.update",tv=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ty=r.forwardRef((e,t)=>{var n,i;let{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:h,...f}=e,p=r.useContext(tv),[m,g]=r.useState(null),v=null!==(i=null==m?void 0:m.ownerDocument)&&void 0!==i?i:null===(n=globalThis)||void 0===n?void 0:n.document,[,y]=r.useState({}),b=s(t,e=>g(e)),w=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=w.indexOf(E),S=m?w.indexOf(m):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,C=S>=x,O=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,i=tm(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){tw("dismissableLayer.pointerDownOutside",i,r,{discrete:!0})},r={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,i]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!C||n||(null==l||l(e),null==d||d(e),e.defaultPrevented||null==h||h())},v),R=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,i=tm(e),o=r.useRef(!1);return r.useEffect(()=>{let e=e=>{e.target&&!o.current&&tw("dismissableLayer.focusOutside",i,{originalEvent:e},{discrete:!1})};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,i]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(null==u||u(e),null==d||d(e),e.defaultPrevented||null==h||h())},v);return!function(e,t=globalThis?.document){let n=tm(e);r.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{S!==p.layers.size-1||(null==a||a(e),!e.defaultPrevented&&h&&(e.preventDefault(),h()))},v),r.useEffect(()=>{if(m)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(ow=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),tb(),()=>{o&&1===p.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=ow)}},[m,v,o,p]),r.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),tb())},[m,p]),r.useEffect(()=>{let e=()=>y({});return document.addEventListener(tg,e),()=>document.removeEventListener(tg,e)},[]),(0,c.jsx)(tp.div,{...f,ref:b,style:{pointerEvents:k?C?"auto":"none":void 0,...e.style},onFocusCapture:tu(e.onFocusCapture,R.onFocusCapture),onBlurCapture:tu(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:tu(e.onPointerDownCapture,O.onPointerDownCapture)})});function tb(){let e=new CustomEvent(tg);document.dispatchEvent(e)}function tw(e,t,n,r){let{discrete:i}=r,a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});(t&&a.addEventListener(e,t,{once:!0}),i)?a&&o.flushSync(()=>a.dispatchEvent(l)):a.dispatchEvent(l)}ty.displayName="DismissableLayer",r.forwardRef((e,t)=>
1{let n=r.useContext(tv),i=r.useRef(null),o=s(t,i);return r.useEffect(()=>{let e=i.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(tp.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var tE=i[" useId ".trim().toString()]||(()=>void 0),tx=0,tS=n(24019),tk=n(75184),tC=Symbol("radix.slottable");function tO(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tC}var tR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=t?l(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,a=r.Children.toArray(i),l=a.find(tO);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),tP=r.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,c.jsx)(tR.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,c.jsx)("polygon",{points:"0,0 30,0 15,10"})})});tP.displayName="Arrow";var tM=Symbol("radix.slottable");function t$(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tM}var t_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=t?l(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,a=r.Children.toArray(i),l=a.find(t$);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),tT="Popper",[tj,tA]=td(tT),[tI,tD]=tj(tT),tL=e=>{let{__scopePopper:t,children:n}=e,[i,o]=r.useState(null);return(0,c.jsx)(tI,{scope:t,anchor:i,onAnchorChange:o,children:n})};tL.displayName=tT;var tN="PopperAnchor",tz=r.forwardRef((e,t)=>
1{let{__scopePopper:n,virtualRef:i,...o}=e,a=tD(tN,n),l=r.useRef(null),u=s(t,l),d=r.useRef(null);return r.useEffect(()=>{let e=d.current;d.current=(null==i?void 0:i.current)||l.current,e!==d.current&&a.onAnchorChange(d.current)}),i?null:(0,c.jsx)(t_.div,{...o,ref:u})});tz.displayName=tN;var tV="PopperContent",[tB,tF]=tj(tV),tU=r.forwardRef((e,t)=>{var n,i,o,a,l,u,d,h;let{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:v="center",alignOffset:y=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:E=[],collisionPadding:x=0,sticky:S="partial",hideWhenDetached:k=!1,updatePositionStrategy:C="optimized",onPlaced:O,...R}=e,P=tD(tV,f),[M,$]=r.useState(null),_=s(t,e=>$(e)),[T,j]=r.useState(null),A=function(e){let[t,n]=r.useState(void 0);return g(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(T),I=null!==(d=null==A?void 0:A.width)&&void 0!==d?d:0,D=null!==(h=null==A?void 0:A.height)&&void 0!==h?h:0,L="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},N=Array.isArray(E)?E:[E],z=N.length>0,V={padding:L,boundary:N.filter(tQ),altBoundary:z},{refs:B,floatingStyles:F,placement:U,isPositioned:W,middlewareData:H}=(0,tS.YF)({strategy:"fixed",placement:p+("center"!==v?"-"+v:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,tk.Me)(...t,{animationFrame:"always"===C})},elements:{reference:P.anchor},middleware:[(0,tS.cv)({mainAxis:m+D,alignmentAxis:y}),w&&(0,tS.uY)({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?(0,tS.dr)():void 0,...V}),w&&(0,tS.RR)({...V}),(0,tS.dp)({...V,apply:e=>{let{elements:t,rects:n,availableWidth:r,availableHeight:i}=e,{width:o,height:a}=n.reference,l=t.floating.style;l.setProperty("--radix-popper-available-width","".concat(r,"px")),l.setProperty("--radix-popper-available-height","".concat(i,"px")),l.setProperty("--radix-popper-anchor-width","".concat(o,"px")),l.setProperty("--radix-popper-anchor-height","".concat(a,"px"))}}),T&&(0,tS.x7)({element:T,padding:b}),tX({arrowWidth:I,arrowHeight:D}),k&&(0,tS.Cp)({strategy:"referenceHidden",...V})]}),[Y,Q]=tG(U),X=tm(O);g(()=>{W&&(null==X||X())},[W,X]);let G=null===(n=H.arrow)||void 0===n?void 0:n.x,Z=null===(i=H.arrow)||void 0===i?void 0:i.y,K=(null===(o=H.arrow)||void 0===o?void 0:o.centerOffset)!==0,[q,J]=r.useState();return g(()=>{M&&J(window.getComputedStyle(M).zIndex)},[M]),(0,c.jsx)("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:W?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[null===(a=H.transformOrigin)||void 0===a?void 0:a.x,null===(l=H.transformOrigin)||void 0===l?void 0:l.y].join(" "),...(null===(u=H.hide)||void 0===u?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,c.jsx)(tB,{scope:f,placedSide:Y,onArrowChange:j,arrowX:G,arrowY:Z,shouldHideArrow:K,children:(0,c.jsx)(t_.div,{"data-side":Y,"data-align":Q,...R,ref:_,style:{...R.style,animation:W?void 0:"none"}})})})});tU.displayName=tV;var tW="PopperArrow",tH={top:"bottom",right:"left",bottom:"top",left:"right"},tY=r.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=tF(tW,n),o=tH[i.placedSide];return(0,c.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,c.jsx)(tP,{...r,ref:t,style:{...r.style,display:"block"}})})});function tQ(e){return null!==e}tY.displayName=tW;var tX=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;let{placement:l,rects:s,middlewareData:c}=t,u=(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=tG(l),m={start:"0%",center:"50%",end:"100%"}[p],g=(null!==(o=null===(r=c.arrow)||void 0===r?void 0:r.x)&&void 0!==o?o:0)+d/2,v=(null!==(a=null===(i=c.arrow)||void 0===i?void 0:i.y)&&void 0!==a?a:0)+h/2,y="",b="";return"bottom"===f?(y=u?m:"".concat(g,"px"),b="".concat(-h,"px")):"top"===f?(y=u?m:"".concat(g,"px"),b="".concat(s.floating.height+h,"px")):"right"===f?(y="".concat(-h,"px"),b=u?m:"".concat(v,"px")):"left"===f&&(y="".concat(s.floating.width+h,"px"),b=u?m:"".concat(v,"px")),{data:{x:y,y:b}}}});function tG(e){let[t,n="center"]=e.split("-");return[t,n]}var tZ=Symbol("radix.slottable");function tK(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tZ}var tq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
1{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=t?l(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,a=r.Children.toArray(i),l=a.find(tK);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});r.forwardRef((e,t)=>{var n,i;let{container:a,...l}=e,[s,u]=r.useState(!1);g(()=>u(!0),[]);let d=a||s&&(null===(i=globalThis)||void 0===i?void 0:null===(n=i.document)||void 0===n?void 0:n.body);return d?o.createPortal((0,c.jsx)(tq.div,{...l,ref:t}),d):null}).displayName="Portal";var tJ=e=>{var t,n;let i,o;let{present:a,children:l}=e,c=function(e){var t,n;let[i,o]=r.useState(),a=r.useRef(null),l=r.useRef(e),s=r.useRef("none"),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=t0(a.current);s.current="mounted"===c?e:"none"},[c]),g(()=>{let t=a.current,n=l.current;if(n!==e){let r=s.current,i=t0(t);e?u("MOUNT"):"none"===i||(null==t?void 0:t.display)==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),g(()=>{if(i){var e;let t;let n=null!==(e=i.ownerDocument.defaultView)&&void 0!==e?e:window,r=e=>{let r=t0(a.current).includes(CSS.escape(e.animationName));if(e.target===i&&r&&(u("ANIMATION_END"),!l.current)){let e=i.style.animationFillMode;i.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===i.style.animationFillMode&&(i.style.animationFillMode=e)})}},o=e=>{e.target===i&&(s.current=t0(a.current))};return i.addEventListener("animationstart",o),i.addEventListener("animationcancel",r),i.addEventListener("animationend",r),()=>{n.clearTimeout(t),i.removeEventListener("animationstart",o),i.removeEventListener("animationcancel",r),i.removeEventListener("animationend",r)}}u("ANIMATION_END")},[i,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,o(e)},[])}}(a),u="function"==typeof l?l({present:c.isPresent}):r.Children.only(l),d=s(c.ref,(i=null===(t=Object.getOwnPropertyDescriptor(u.props,"ref"))||void 0===t?void 0:t.get)&&"isReactWarning"in i&&i.isReactWarning?u.ref:(i=null===(n=Object.getOwnPropertyDescriptor(u,"ref"))||void 0===n?void 0:n.get)&&"isReactWarning"in i&&i.isReactWarning?u.props.ref:u.props.ref||u.ref);return"function"==typeof l||c.isPresent?r.cloneElement(u,{ref:d}):null};function t0(e){return(null==e?void 0:e.animationName)||"none"}tJ.displayName="Presence";var t1=i[" useInsertionEffect ".trim().toString()]||g;Symbol("RADIX:SYNC_STATE");var t2=Symbol("radix.slottable");function t3(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===t2}var t5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>
1{let{children:n,...i}=e;if(r.isValidElement(n)){let e,o;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=t?l(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,a=r.Children.toArray(i),l=a.find(t3);if(l){let e=l.props.children,i=a.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,c.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,c.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e,a=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(a,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),t4=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),t6=r.forwardRef((e,t)=>(0,c.jsx)(t5.span,{...e,ref:t,style:{...t4,...e.style}}));t6.displayName="VisuallyHidden";var[t8,t7]=td("Tooltip",[tA]),t9=tA(),ne="TooltipProvider",nt="tooltip.open",[nn,nr]=t8(ne),ni=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:a}=e,l=r.useRef(!0),s=r.useRef(!1),u=r.useRef(0);return r.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,c.jsx)(nn,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:r.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:r.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,i)},[i]),isPointerInTransitRef:s,onPointerInTransitChange:r.useCallback(e=>{s.current=e},[]),disableHoverableContent:o,children:a})};ni.displayName=ne;var no="Tooltip",[na,nl]=t8(no),ns=e=>{let{__scopeTooltip:t,children:n,open:i,defaultOpen:o,onOpenChange:a,disableHoverableContent:l,delayDuration:s}=e,u=nr(no,e.__scopeTooltip),d=t9(t),[h,f]=r.useState(null),p=function(e){let[t,n]=r.useState(tE());return g(()=>{n(e=>e??String(tx++))},[void 0]),t?`radix-${t}`:""}(),m=r.useRef(0),v=null!=l?l:u.disableHoverableContent,y=null!=s?s:u.delayDuration,b=r.useRef(!1),[w,E]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){let[o,a,l]=function({defaultProp:e,onChange:t}){let[n,i]=r.useState(e),o=r.useRef(n),a=r.useRef(t);return t1(()=>{a.current=t},[t]),r.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,i,a]}({defaultProp:t,onChange:n}),s=void 0!==e,c=s?e:o;{let t=r.useRef(void 0!==e);r.useEffect(()=>{let e=t.current;if(e!==s){let t=s?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,i])}return[c,r.useCallback(t=>{if(s){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else a(t)},[s,e,a,l])]}({prop:i,defaultProp:null!=o&&o,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(nt))):u.onClose(),null==a||a(e)},caller:no}),x=r.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),S=r.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,E(!0)},[E]),k=r.useCallback(()=>{window.clearTimeout(m.current),m.current=0,E(!1)},[E]),C=r.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,E(!0),m.current=0},y)},[y,E]);return r.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,c.jsx)(tL,{...d,children:(0,c.jsx)(na,{scope:t,contentId:p,open:w,stateAttribute:x,trigger:h,onTriggerChange:f,onTriggerEnter:r.useCallback(()=>{u.isOpenDelayedRef.current?C():S()},[u.isOpenDelayedRef,C,S]),onTriggerLeave:r.useCallback(()=>{v?k():(window.clearTimeout(m.current),m.current=0)},[k,v]),onOpen:S,onClose:k,disableHoverableContent:v,children:n})})};ns.displayName=no;var nc="TooltipTrigger",nu=r.forwardRef((e,t)=>
1{let{__scopeTooltip:n,...i}=e,o=nl(nc,n),a=nr(nc,n),l=t9(n),u=s(t,r.useRef(null),o.onTriggerChange),d=r.useRef(!1),h=r.useRef(!1),f=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),(0,c.jsx)(tz,{asChild:!0,...l,children:(0,c.jsx)(tq.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:u,onPointerMove:tu(e.onPointerMove,e=>{"touch"===e.pointerType||h.current||a.isPointerInTransitRef.current||(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:tu(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:tu(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:tu(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:tu(e.onBlur,o.onClose),onClick:tu(e.onClick,o.onClose)})})});nu.displayName=nc;var[nd,nh]=t8("TooltipPortal",{forceMount:void 0}),nf="TooltipContent",np=r.forwardRef((e,t)=>{let n=nh(nf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=nl(nf,e.__scopeTooltip);return(0,c.jsx)(tJ,{present:r||a.open,children:a.disableHoverableContent?(0,c.jsx)(nb,{side:i,...o,ref:t}):(0,c.jsx)(nm,{side:i,...o,ref:t})})}),nm=r.forwardRef((e,t)=>{let n=nl(nf,e.__scopeTooltip),i=nr(nf,e.__scopeTooltip),o=r.useRef(null),a=s(t,o),[l,u]=r.useState(null),{trigger:d,onClose:h}=n,f=o.current,{onPointerInTransitChange:p}=i,m=r.useCallback(()=>{u(null),p(!1)},[p]),g=r.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(r,n.getBoundingClientRect());u(function(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}([...function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,i),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())])),p(!0)},[p]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&f){let e=e=>g(e,f),t=e=>g(e,d);return d.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}},[d,f,g,m]),r.useEffect(()=>{if(l){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==d?void 0:d.contains(t))||(null==f?void 0:f.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let a=t[e],l=t[o],s=a.x,c=a.y,u=l.x,d=l.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(i=!i)}return i}(n,l);r?m():i&&(m(),h())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,f,l,h,m]),(0,c.jsx)(nb,{...e,ref:a})}),[ng,nv]=t8(no,{isInside:!1}),ny=function(e){let t=({children:e})=>(0,c.jsx)(c.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=tZ,t}("TooltipContent"),nb=r.forwardRef((e,t)=>{let{__scopeTooltip:n,children:i,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:l,...s}=e,u=nl(nf,n),d=t9(n),{onClose:h}=u;return r.useEffect(()=>(document.addEventListener(nt,h),()=>document.removeEventListener(nt,h)),[h]),r.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;(null==t?void 0:t.contains(u.trigger))&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,h]),(0,c.jsx)(ty,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:(0,c.jsxs)(tU,{"data-state":u.stateAttribute,...d,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,c.jsx)(ny,{children:i}),(0,c.jsx)(ng,{scope:n,isInside:!0,children:(0,c.jsx)(t6,{id:u.contentId,role:"tooltip",children:o||i})})]})})});np.displayName=nf;var nw="TooltipArrow",nE=r.forwardRef((e,t)=>
1{let{__scopeTooltip:n,...r}=e,i=t9(n);return nv(nw,n).isInside?null:(0,c.jsx)(tY,{...i,...r,ref:t})});function nx(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}nE.displayName=nw;let nS=((ov={})[ov.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",ov[ov.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",ov[ov.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",ov[ov.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",ov[ov.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",ov[ov.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",ov[ov.THEME_ERROR=6]="THEME_ERROR",ov[ov.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",ov[ov.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",ov[ov.EMPTY_KEY=9]="EMPTY_KEY",ov),nk={[nS.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[nS.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[nS.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[nS.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[nS.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[nS.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[nS.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[nS.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[nS.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[nS.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function nC(e,t,...n){let[r,...i]=(0,nk[t])(...n);console[e]("LEVA: "+r,...i)}let nO=nC.bind(null,"warn"),nR=nC.bind(null,"log"),nP=["value"],nM=["schema"],n$=["value"],n_=[],nT={};function nj(e){let{value:t}=e,n=nx(e,nP);for(let e of n_){let r=e(t,n);if(r)return r}}function nA(e,t){let{schema:n}=t,r=nx(t,nM);if(e in nT){nO(nS.ALREADY_REGISTERED_TYPE,e);return}n_.push((t,r)=>n(t,r)&&e),nT[e]=r}function nI(e,t,n,r){let{normalize:i}=nT[e];if(i)return i(t,n,r);if("object"!=typeof t||!("value"in t))return{value:t};let{value:o}=t;return{value:o,settings:nx(t,n$)}}function nD(e,t,n){let{format:r}=nT[e];return r?r(t,n):t}function nL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(t){!function(e,t,n){var r;(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let nz=(e,t,n)=>e>n?n:e<t?t:e,nV=e=>{if(""===e||"number"==typeof e)return e;try{let t=function e(t){return(t=t.replace(/\s+/g,""),nY.test(t))?e(t.replace(nY,(t,n)=>e(n).toString())):nQ.test(t)?e(t.replace(nQ,(e,t,n)=>Math.pow(Number(t),Number(n)).toString())):nX.test(t)?e(t.replace(nX,(e,t,n,r)=>"*"===n?(Number(t)*Number(r)).toString():0===Number(r)?(()=>{throw Error("Division by zero")})():(Number(t)/Number(r)).toString())):nG.test(t)?e(t.replace(nG,(e,t,n,r)=>"+"===n?(Number(t)+Number(r)).toString():(Number(t)-Number(r)).toString())):Number(t)}(e);if(!isNaN(t))return t}catch(e){}return parseFloat(e)},nB=Math.log(10);function nF(e){let t=Math.abs(+String(e).replace(".",""));if(0===t)return .01;for(;0!==t&&t%10==0;)t/=10;return Math.max(Math.pow(10,Math.floor(Math.log10(Math.abs(e)))-(Math.floor(Math.log(t)/nB)+1)),.001)}let nU=(e,t,n)=>
1n===t?0:(nz(e,t,n)-t)/(n-t),nW=(e,t,n)=>e*(n-t)+t,nH=()=>"_"+Math.random().toString(36).substr(2,9),nY=/\(([^\(\)]+)\)/,nQ=/(-?\d+(?:\.\d+)?)\s*\^\s*(-?\d+(?:\.\d+)?)/,nX=/(-?\d+(?:\.\d+)?)\s*([*/])\s*(-?\d+(?:\.\d+)?)/,nG=/(-?\d+(?:\.\d+)?)\s*([+-])\s*(-?\d+(?:\.\d+)?)/;function nZ(e){return"[object Object]"===Object.prototype.toString.call(e)}let nK=e=>nZ(e)&&0===Object.keys(e).length,nq=((oy={}).BUTTON="BUTTON",oy.BUTTON_GROUP="BUTTON_GROUP",oy.MONITOR="MONITOR",oy.FOLDER="FOLDER",oy),nJ=((ob={}).SELECT="SELECT",ob.IMAGE="IMAGE",ob.NUMBER="NUMBER",ob.COLOR="COLOR",ob.STRING="STRING",ob.BOOLEAN="BOOLEAN",ob.INTERVAL="INTERVAL",ob.VECTOR3D="VECTOR3D",ob.VECTOR2D="VECTOR2D",ob),n0=["type","__customInput"],n1=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],n2=["type"];function n3(e,t,n,r,i){let{value:o,type:a,settings:l}=e;e.value=n4({type:a,value:o,settings:l},t,n,r),e.fromPanel=i}let n5=function(e,t,n){this.type="LEVA_ERROR",this.message="LEVA: "+e,this.previousValue=t,this.error=n};function n4({type:e,value:t,settings:n},r,i,o){let a;let l="SELECT"!==e&&"function"==typeof r?r(t):r;try{a=function(e,t,n,r,i,o){let{sanitize:a}=nT[e];return a?a(t,n,r,i,o):t}(e,l,n,t,i,o)}catch(e){throw new n5(`The value \`${r}\` did not result in a correct value.`,t,e)}return b(a,t)?t:a}let n6=(e,t,n=!1)=>{let r=0;return function(){let i=arguments,o=n&&!r,a=()=>e.apply(this,i);window.clearTimeout(r),r=window.setTimeout(a,t),o&&a()}},n8=e=>e.shiftKey?5:e.altKey?.2:1,n7=["value"],n9=["min","max"],re=(e,{min:t=-1/0,max:n=1/0,suffix:r})=>{let i=parseFloat(e);if(""===e||isNaN(i))throw Error("Invalid number");let o=nz(i,t,n);return r?o+r:o},rt=e=>{let{value:t}=e,n=nx(e,n7),{min:r=-1/0,max:i=1/0}=n,o=nx(n,n9),a=parseFloat(t),l="string"==typeof t?t.substring((""+a).length):void 0;a=nz(a,r,i);let s=n.step;!s&&(Number.isFinite(r)?s=Number.isFinite(i)?+(Math.abs(i-r)/100).toPrecision(1):+(Math.abs(a-r)/100).toPrecision(1):Number.isFinite(i)&&(s=+(Math.abs(i-a)/100).toPrecision(1)));let c=s?10*nF(s):nF(a);return{value:l?a+l:a,settings:nN({initialValue:a,step:s=s||c/10,pad:Math.round(nz(Math.log10(1/c),0,2)),min:r,max:i,suffix:l},o)}},rn=(e,{step:t,initialValue:n})=>n+Math.round((e-n)/t)*t;var rr=Object.freeze({__proto__:null,schema:e=>{if("number"==typeof e)return!0;if("string"==typeof e){let t=parseFloat(e);return!isNaN(t)&&e.substring((""+t).length).trim().length<4}return!1},sanitize:re,format:(e,{pad:t=0,suffix:n})=>{let r=parseFloat(e).toFixed(t);return n?r+n:r},normalize:rt,sanitizeStep:rn});function ri(){return(ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let ro=(0,r.createContext)({});function ra(){return(0,r.useContext)(ro)}let rl=(0,r.createContext)(null),rs=(0,r.createContext)(null),rc=(0,r.createContext)(null);function ru(){return(0,r.useContext)(rs)}let rd=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function rh(e,t){let[n,r]=e.split(" "),i={};return"none"!==n&&(i.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${"default"!==n&&n||t.borderColor}`),r&&(i.backgroundColor=r),i}let rf={$inputStyle:()=>e=>rh(e,{key:"$input",borderColor:"$highlight1",inset:!0}
1),$focusStyle:()=>e=>rh(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>rh(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>rh(e,{key:"$active",borderColor:"$accent1",inset:!0})},rp=(e=>{let t=(e=>{let t=!1,n=eR(e,e=>{t=!0;let n="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",r="object"==typeof e.media&&e.media||{},i="object"==typeof e.root?e.root||null:globalThis.document||null,o="object"==typeof e.theme&&e.theme||{},a={prefix:n,media:r,theme:o,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...N},utils:"object"==typeof e.utils&&e.utils||{}},l=eu(i),s={css:ep(a,l),globalCss:eE(a,l),keyframes:eS(a,l),createTheme:eO(a,l),reset(){l.reset(),s.theme.toString()},theme:{},sheet:l,config:a,prefix:n,getCssText:l.toString,toString:l.toString};return String(s.theme=s.createTheme(o)),s});return t||n.reset(),n})(e);return t.styled=(({config:e,sheet:t})=>eP(e,()=>{let n=ep(e,t);return(...e)=>{let t=n(...e),i=t[B].type,o=r.forwardRef((e,n)=>{let o=e&&e.as||i,{props:a,deferredInjector:l}=t(e);return delete a.as,a.ref=n,l?r.createElement(r.Fragment,null,r.createElement(o,a),r.createElement(l,null)):r.createElement(o,a)});return o.className=t.className,o.displayName=`Styled.${i.displayName||i.name||i}`,o.selector=t.selector,o.toString=()=>t.selector,o[B]=t[B],o}}))(t),t})({prefix:"leva",theme:rd(),utils:nN(nN({},rf),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":rf.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":rf.$focusStyle()(e)}),$hover:e=>({"&:hover":rf.$hoverStyle()(e)}),$active:e=>({"&:active":rf.$activeStyle()(e)})})}),rm=rp.styled;rp.css;let rg=rp.createTheme,rv=rp.globalCss;rp.keyframes;let ry=rv({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function rb(e,t){let{theme:n}=(0,r.useContext)(rl);if(!(e in n)||!(t in n[e]))return nO(nS.THEME_ERROR,e,t),"";let i=t;for(;;){let t=n[e][i];if("string"!=typeof t||"$"!==t.charAt(0))return t;i=t.substr(1)}}let rw=rm("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),rE=rm("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${rw}`]:{paddingLeft:0}}),rx=rm(rE,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),rS=rm("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),rk=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],rC=["onUpdate"];function rO(e){let{innerLabel:t,value:n,onUpdate:i,onChange:o,onKeyDown:a,type:l,id:s,inputType:c="text",rows:u=0}=e,d=nx(e,rk),{id:h,emitOnEditStart:f,emitOnEditEnd:p,disabled:m}=ra(),g=(0,r.useRef)(null),v=u>0,y=(0,r.useCallback)(e=>t=>{e(t.currentTarget.value)},[]);r.useEffect(()=>{let e=g.current,t=y(e=>{i(e),p()});return null==e||e.addEventListener("blur",t),()=>null==e?void 0:e.removeEventListener("blur",t)},[y,i,p]);let b=(0,r.useCallback)(e=>{"Enter"===e.key&&y(i)(e)},[y,i]),w=Object.assign({as:v?"textarea":"input"},v?{rows:u}:{},d);return r.createElement(rS,{textArea:v},t&&"string"==typeof t?r.createElement(rE,null,t):t,r.createElement(rw,ri({levaType:l,ref:g,id:s||h,type:c,autoComplete:"off",spellCheck:"false",value:n,onChange:y(o),onFocus:()=>f(),onKeyPress:b,onKeyDown:a,disabled:m},w)))}function rR(e){let{onUpdate:t}=e,n=nx(e,rC),i=(0,r.useCallback)(e=>t(nV(e)),[t]),o=(0,r.useCallback)(e=>{let n="ArrowUp"===e.key?1:"ArrowDown"===e.key?-1:0;if(n){e.preventDefault();let r=e.altKey?.1:e.shiftKey?10:1;t(e=>parseFloat(e)+n*r)}},[t]);return r.createElement(rO,ri({},n,{onUpdate:i,onKeyDown:o,type:"number"}))}let rP=rm("div",{}),rM=rm("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}}
1,isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),r$=rm("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${rM}::after`]:{opacity:.6},[`${rP}:hover > & + ${rM}::after`]:{opacity:.6},[`${rP}:hover > & > svg`]:{opacity:1}}),r_=rm("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${rP}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),rT=rm("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${r_} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),rj=rm(rT,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),rA=rm("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),rI=rm("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),rD=rm("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),rL=rm("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${rD}`]:{pointerEvents:"auto"}}}}}),rN=rm("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),rz=rm("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),rV=rm(nE,{fill:"$toolTipBackground"});function rB({children:e,container:t=(e=>null==globalThis||null===(e=globalThis.document)||void 0===e?void 0:e.body)()}){let{className:n}=(0,r.useContext)(rl);return r.createElement(v,{className:n,container:t},e)}let rF=["align"];function rU(){let{id:e,disable:t,disabled:n}=ra();return r.createElement(r.Fragment,null,r.createElement(rI,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),r.createElement("label",{htmlFor:e+"__disable"}))}function rW(e){let{id:t,optional:n,hint:i}=ra(),o=e.htmlFor||t||void 0,a=i||"string"!=typeof e.children?void 0:e.children;return r.createElement(r.Fragment,null,n&&r.createElement(rU,null),void 0!==i?r.createElement(ns,null,r.createElement(nu,{asChild:!0},r.createElement(rD,ri({htmlFor:o},e))),r.createElement(np,{side:"top",sideOffset:2},r.createElement(rz,null,i,r.createElement(rV,null)))):r.createElement(rD,ri({htmlFor:o,title:a},e)))}function rH(e){let{align:t}=e,n=nx(e,rF),{value:i,label:o,key:a,disabled:l}=ra(),{hideCopyButton:s}=(0,r.useContext)(rc),c=!s&&void 0!==a,[u,d]=(0,r.useState)(!1),h=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[a]:null!=i?i:""})),d(!0)}catch(e){nO(nS.CLIPBOARD_ERROR,{[a]:i})}};return r.createElement(rA,{align:t,onPointerLeave:()=>d(!1)},r.createElement(rW,n),c&&!l&&r.createElement("div",{title:`Click to copy ${"string"==typeof o?o:a} value`},u?r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),r.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):r.createElement("svg",{onClick:h,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),r.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}let rY=["toggled"],rQ=rm("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function rX(e){let{toggled:t}=e,n=nx(e,rY);return r.createElement(rQ,ri({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),r.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}let rG=["input"];
1function rZ(e){let{input:t}=e,n=nx(e,rG);return t?r.createElement(rj,n):r.createElement(rT,n)}function rK({value:e,type:t,settings:n,setValue:i}){let[o,a]=(0,r.useState)(nD(t,e,n)),l=(0,r.useRef)(e),s=(0,r.useRef)(n);s.current=n;let c=(0,r.useCallback)(e=>a(nD(t,e,s.current)),[t]),u=(0,r.useCallback)(e=>{try{i(e)}catch(n){let{type:e,previousValue:t}=n;if("LEVA_ERROR"!==e)throw n;c(t)}},[c,i]);return(0,r.useEffect)(()=>{b(e,l.current)||c(e),l.current=e},[e,c]),{displayValue:o,onChange:a,onUpdate:u}}function rq(e,t){var n;let{emitOnEditStart:i,emitOnEditEnd:o}=ra();return n=t=>{t.first&&(document.body.classList.add("leva__panel__dragged"),null==i||i());let n=e(t);return t.last&&(document.body.classList.remove("leva__panel__dragged"),null==o||o()),n},e8.set(e9,te),e7.set(e9,tt),function(e,t={},n,i){let o=r.useMemo(()=>new tl(e),[]);if(o.applyHandlers(e,void 0),o.applyConfig(t,n),r.useEffect(o.effect.bind(o)),r.useEffect(()=>o.clean.bind(o),[]),void 0===t.target)return o.bind.bind(o)}({drag:n},t||{},"drag")}function rJ(){let e=(0,r.useRef)(null),t=(0,r.useRef)({x:0,y:0}),n=(0,r.useCallback)(n=>{Object.assign(t.current,n),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}let r0=["__refCount"],r1=(e,t)=>e[t]?nx(e[t],r0):null,r2=rm("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),r3=rm("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),r5=rm("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),r4=rm("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),r6=rm("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function r8({value:e,min:t,max:n,onDrag:i,step:o,initialValue:a}){let l=(0,r.useRef)(null),s=(0,r.useRef)(null),c=(0,r.useRef)(0),u=rb("sizes","scrubberWidth"),d=rq(({event:r,first:d,xy:[h],movement:[f],memo:p})=>{if(d){let{width:i,left:o}=l.current.getBoundingClientRect();c.current=i-parseFloat(u),p=(null==r?void 0:r.target)===s.current?e:nW((h-o)/i,t,n)}return i(rn(p+nW(f/c.current,0,n-t),{step:o,initialValue:a})),p}),h=nU(e,t,n);return r.createElement(r4,ri({ref:l},d()),r.createElement(r3,null,r.createElement(r6,{style:{left:0,right:`${(1-h)*100}%`}})),r.createElement(r5,{ref:s,style:{left:`calc(${h} * (100% - ${u}))`}}))}let r7=r.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:i})=>{let[o,a]=(0,r.useState)(!1),l=rq(({active:e,delta:[r],event:i,memo:o=0,first:l,last:s,target:c})=>(l&&c.requestPointerLock(),s&&document.exitPointerLock(),a(e),Math.abs(o+=r/2)>=1&&(t(e=>parseFloat(e)+Math.floor(o)*n*n8(i)),o=0),o));return r.createElement(rx,ri({dragging:o,title:e.length>1?e:""},l()),e.slice(0,i))});function r9({label:e,id:t,displayValue:n,onUpdate:i,onChange:o,settings:a,innerLabelTrim:l=1}){let s=l>0&&r.createElement(r7,{label:e,step:a.step,onUpdate:i,innerLabelTrim:l});return r.createElement(rR,{id:t,value:String(n),onUpdate:i,onChange:o,innerLabel:s})}let{sanitizeStep:ie}=rr;var it=nN({component:function(){let e=ra(),{label:t,value:n,onUpdate:i,settings:o,id:a}=e,{min:l,max:s}=o,c=s!==1/0&&l!==-1/0;return r.createElement(rZ,{input:!0},r.createElement(rH,null,t),r.createElement(r2,{hasRange:c},c&&r.createElement(r8,ri({value:parseFloat(n),onDrag:i},o)),r.createElement(r9,ri({},e,{id:a,label:"value",innerLabelTrim:c?0:1}))))}},nx(rr,["sanitizeStep"])),ir=Object.freeze({__proto__:null,schema:(e,t)=>P().schema({options:P().passesAnyOf(P().object(),P().array())}).test(t),sanitize:(e,{values:t})=>{if(0>t.indexOf(e))throw Error("Selected value doesn't match Select options");return e},format:(e,{values:t})=>t.indexOf(e),normalize:e=>{let t,n,{value:r,options:i}=e;return Array.isArray(i)?(n=i,t=i.map(e=>String(e))):(n=Object.values(i),t=Object.keys(i)),"value"in e?n.includes(r)||(t.unshift(String(r)),n.unshift(r)):r=n[0],Object.values(i).includes(r)||(i[String(r)]=r),{value:r,settings:{keys:t,values:n}}}});let ii=rm("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),io=rm("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}
1),ia=rm("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${io}:focus + &`]:{$focusStyle:""},[`${io}:hover + &`]:{$hoverStyle:""}});function il({displayValue:e,value:t,onUpdate:n,id:i,settings:o,disabled:a}){let{keys:l,values:s}=o,c=(0,r.useRef)();return t===s[e]&&(c.current=l[e]),r.createElement(ii,null,r.createElement(io,{id:i,value:e,onChange:e=>n(s[Number(e.currentTarget.value)]),disabled:a},l.map((e,t)=>r.createElement("option",{key:e,value:t},e))),r.createElement(ia,null,c.current),r.createElement(rX,{toggled:!0}))}var is=nN({component:function(){let{label:e,value:t,displayValue:n,onUpdate:i,id:o,disabled:a,settings:l}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(il,{id:o,value:t,displayValue:n,onUpdate:i,settings:l,disabled:a}))}},ir),ic=Object.freeze({__proto__:null,schema:e=>P().string().test(e),sanitize:e=>{if("string"!=typeof e)throw Error("Invalid string");return e},normalize:({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:"number"==typeof n?n:n?5:0}})});let iu=["displayValue","onUpdate","onChange","editable"],id=rm("div",{whiteSpace:"pre-wrap"});function ih(e){let{displayValue:t,onUpdate:n,onChange:i,editable:o=!0}=e,a=nx(e,iu);return o?r.createElement(rO,ri({value:t,onUpdate:n,onChange:i},a)):r.createElement(id,null,t)}var ip=nN({component:function(){let{label:e,settings:t,displayValue:n,onUpdate:i,onChange:o}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(ih,ri({displayValue:n,onUpdate:i,onChange:o},t)))}},ic),im=Object.freeze({__proto__:null,schema:e=>P().boolean().test(e),sanitize:e=>{if("boolean"!=typeof e)throw Error("Invalid boolean");return e}});let ig=rm("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function iv({value:e,onUpdate:t,id:n,disabled:i}){return r.createElement(ig,null,r.createElement("input",{id:n,type:"checkbox",checked:e,onChange:e=>t(e.currentTarget.checked),disabled:i}),r.createElement("label",{htmlFor:n},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}var iy=nN({component:function(){let{label:e,value:t,onUpdate:n,disabled:i,id:o}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(iv,{value:t,onUpdate:n,id:o,disabled:i}))}},im);let ib=["locked"];function iw({value:e,id:t,valueKey:n,settings:i,onUpdate:o,innerLabelTrim:a}){let l=(0,r.useRef)(e[n]);l.current=e[n];let s=(0,r.useCallback)(e=>o({[n]:n4({type:"NUMBER",value:l.current,settings:i},e)}),[o,i,n]),c=rK({type:"NUMBER",value:e[n],settings:i,setValue:s});return r.createElement(r9,{id:t,label:n,value:e[n],displayValue:c.displayValue,onUpdate:c.onUpdate,onChange:c.onChange,settings:i,innerLabelTrim:a})}let iE=rm("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function ix(e){let{locked:t}=e,n=nx(e,ib);return r.createElement("svg",ri({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?r.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):r.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function iS({value:e,onUpdate:t,settings:n,innerLabelTrim:i}){let{id:o,setSettings:a}=ra(),{lock:l,locked:s}=n;return r.createElement(iE,{withLock:l},l&&r.createElement(ix,{locked:s,onClick:()=>a({locked:!s})}),Object.keys(e).map((a,l)=>r.createElement(iw,{id:0===l?o:`${o}.${a}
1`,key:a,valueKey:a,value:e,settings:n[a],onUpdate:t,innerLabelTrim:i})))}let ik=(e,t)=>{let n={},r=0,i=1/0;for(let o in Object.entries(e).forEach(([e,o])=>{n[e]=rt(nN({value:o},t[e])).settings,r=Math.max(r,n[e].step),i=Math.min(i,n[e].pad)}),n){let{step:e,min:a,max:l}=t[o]||{};isFinite(e)||isFinite(a)&&isFinite(l)||(n[o].step=r,n[o].pad=i)}return n},iC=["lock"],iO=["value"];function iR(e,t,n){return(Array.isArray(e)?"array":"object")===t?e:"array"===t?Object.values(e):e.reduce((e,t,r)=>Object.assign(e,{[n[r]]:t}),{})}let iP=(e,t,n)=>{let r=iR(e,"object",t.keys);for(let e in r)r[e]=re(r[e],t[e]);let i=Object.keys(r),o={};if(i.length===t.keys.length)o=r;else{let e=iR(n,"object",t.keys);if(1===i.length&&t.locked){let t=i[0],n=r[t],a=e[t],l=0!==a?n/a:1;for(let r in e)r===t?o[t]=n:o[r]=e[r]*l}else o=nN(nN({},e),r)}return iR(o,t.format,t.keys)},iM=(e,t)=>iR(e,"object",t.keys),i$=e=>!!e&&("step"in e||"min"in e||"max"in e);function i_(e){return{schema:function(e){let t=P().array().length(e).every.number(),n=t=>{if(!t||"object"!=typeof t)return!1;let n=Object.values(t);return n.length===e&&n.every(e=>isFinite(e))};return e=>t.test(e)||n(e)}(e.length),normalize:t=>{let{value:n}=t;return function(e,t,n=[]){let{lock:r=!1}=t,i=nx(t,iC),o=Array.isArray(e)?"array":"object",a="object"===o?Object.keys(e):n,l=iR(e,"object",a),s=ik(l,i$(i)?a.reduce((e,t)=>Object.assign(e,{[t]:i}),{}):i);return{value:"array"===o?e:l,settings:nN(nN({},s),{},{format:o,keys:a,lock:r,locked:!1})}}(n,nx(t,iO),e)},format:(e,t)=>iM(e,t),sanitize:(e,t,n)=>iP(e,t,n)}}var iT={grad:.9,turn:360,rad:360/(2*Math.PI)},ij=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},iA=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},iI=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},iD=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},iL=function(e){return{r:iI(e.r,0,255),g:iI(e.g,0,255),b:iI(e.b,0,255),a:iI(e.a)}},iN=function(e){return{r:iA(e.r),g:iA(e.g),b:iA(e.b),a:iA(e.a,3)}},iz=/^#([0-9a-f]{3,8})$/i,iV=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},iB=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),l=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(l<0?l+6:l),s:o?a/o*100:0,v:o/255*100,a:i}},iF=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),l=r*(1-(t-o)*n),s=r*(1-(1-t+o)*n),c=o%6;return{r:255*[r,l,a,a,s,r][c],g:255*[s,r,r,l,a,a][c],b:255*[a,a,s,r,r,l][c],a:i}},iU=function(e){return{h:iD(e.h),s:iI(e.s,0,100),l:iI(e.l,0,100),a:iI(e.a)}},iW=function(e){return{h:iA(e.h),s:iA(e.s),l:iA(e.l),a:iA(e.a,3)}},iH=function(e){var t,n;return iF((t=e.s,{h:e.h,s:(t*=((n=e.l)<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}))},iY=function(e){var t,n,r,i;return{h:(t=iB(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a}},iQ=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iX=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iG=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iZ=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iK={string:[[function(e){var t=iz.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?iA(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?iA(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=iG.exec(e)||iZ.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:iL({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t,n,r=iQ.exec(e)||iX.exec(e);return r?iH(iU({h:(t=r[1],void 0===(n=r[2])&&(n="deg"),Number(t)*(iT[n]||1)),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)})):null},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a;return ij(t)&&ij(n)&&ij(r)?iL({r:Number(t),g:Number(n),b:Number(r),a:Number(void 0===i?1:i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a;return ij(t)&&ij(n)&&ij(r)?iH(iU({h:Number(t),s:Number(n),l:Number(r),a:Number(void 0===i?1:i)})):null},"hsl"],[function(e){var t,n=e.h,r=e.s,i=e.v,o=e.a;return ij(n)&&ij(r)&&ij(i)?iF({h:iD((t={h:Number(n),s:Number(r),v:Number(i),a:Number(void 0===o?1:o)}).h),s:iI(t.s,0,100),v:iI(t.v,0,100),a:iI(t.a)}):null},"hsv"]]},iq=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},iJ=function(e){return"string"==typeof e?iq(e.trim(),iK.string):"object"==typeof e&&null!==e?iq(e,iK.object):[null,void 0]},i0=function(e,t){var n=iY(e);return{h:n.h,s:iI(n.s+100*t,0,100),l:n.l,a:n.a}},i1=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},i2=function(e,t){var n=iY(e);return{h:n.h,s:n.s,l:iI(n.l+100*t,0,100),a:n.a}
1},i3=function(){function e(e){this.parsed=iJ(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return iA(i1(this.rgba),2)},e.prototype.isDark=function(){return .5>i1(this.rgba)},e.prototype.isLight=function(){return i1(this.rgba)>=.5},e.prototype.toHex=function(){var e,t,n,r,i,o;return t=(e=iN(this.rgba)).r,n=e.g,r=e.b,o=(i=e.a)<1?iV(iA(255*i)):"","#"+iV(t)+iV(n)+iV(r)+o},e.prototype.toRgb=function(){return iN(this.rgba)},e.prototype.toRgbString=function(){var e,t,n,r,i;return t=(e=iN(this.rgba)).r,n=e.g,r=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+r+", "+i+")":"rgb("+t+", "+n+", "+r+")"},e.prototype.toHsl=function(){return iW(iY(this.rgba))},e.prototype.toHslString=function(){var e,t,n,r,i;return t=(e=iW(iY(this.rgba))).h,n=e.s,r=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+i+")":"hsl("+t+", "+n+"%, "+r+"%)"},e.prototype.toHsv=function(){var e;return{h:iA((e=iB(this.rgba)).h),s:iA(e.s),v:iA(e.v),a:iA(e.a,3)}},e.prototype.invert=function(){var e;return i5({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a})},e.prototype.saturate=function(e){return void 0===e&&(e=.1),i5(i0(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),i5(i0(this.rgba,-e))},e.prototype.grayscale=function(){return i5(i0(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),i5(i2(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),i5(i2(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){var t;return"number"==typeof e?i5({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):iA(this.rgba.a,3)},e.prototype.hue=function(e){var t=iY(this.rgba);return"number"==typeof e?i5({h:e,s:t.s,l:t.l,a:t.a}):iA(t.h)},e.prototype.isEqual=function(e){return this.toHex()===i5(e).toHex()},e}(),i5=function(e){return e instanceof i3?e:new i3(e)},i4=[];function i6(){return(i6=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i8(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function i7(e){var t=(0,r.useRef)(e),n=(0,r.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var i9=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},oe=function(e){return"touches"in e},ot=function(e){return e&&e.ownerDocument.defaultView||self},on=function(e,t,n){var r=e.getBoundingClientRect(),i=oe(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:i9((i.pageX-(r.left+ot(e).pageXOffset))/r.width),top:i9((i.pageY-(r.top+ot(e).pageYOffset))/r.height)}},or=function(e){oe(e)||e.preventDefault()},oi=r.memo(function(e){var t=e.onMove,n=e.onKey,i=e.onEnd,o=i8(e,["onMove","onKey","onEnd"]),a=(0,r.useRef)(null),l=i7(t),s=i7(n),c=i7(i),u=(0,r.useRef)(null),d=(0,r.useRef)(!1),h=(0,r.useMemo)(function(){var e=function(e){or(e),(oe(e)?e.touches.length>0:e.buttons>0)&&a.current?l(on(a.current,e,u.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=d.current,i=ot(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?"touchmove":"mousemove",e),o(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(or(t),(!d.current||oe(t))&&r)){if(oe(t)){d.current=!0;var i=t.changedTouches||[];i.length&&(u.current=i[0].identifier)}r.focus(),l(on(r,t,u.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,l,c]),f=h[0],p=h[1],m=h[2],g=h[3];return(0,r.useEffect)(function(){return g},[g]),r.createElement("div",i6({},o,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:"slider"}))}),oo=function(e){return e.filter(Boolean).join(" ")},oa=function(e){var t=e.color,n=e.left,i=e.top,o=oo(["react-colorful__pointer",e.className]);
1return r.createElement("div",{className:o,style:{top:100*(void 0===i?.5:i)+"%",left:100*n+"%"}},r.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ol=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},os=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:ol(e.h),s:ol(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:ol(i/2),a:ol(r,2)}},oc=function(e){var t=os(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ou=function(e){var t=os(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},od=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),l=r*(1-(t-o)*n),s=r*(1-(1-t+o)*n),c=o%6;return{r:ol(255*[r,l,a,a,s,r][c]),g:ol(255*[s,r,r,l,a,a][c]),b:ol(255*[a,a,s,r,r,l][c]),a:ol(i,2)}},oh=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),l=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:ol(60*(l<0?l+6:l)),s:ol(o?a/o*100:0),v:ol(o/255*100),a:i}},of=r.memo(function(e){var t=e.hue,n=e.onChange,i=e.onChangeEnd,o=oo(["react-colorful__hue",e.className]);return r.createElement("div",{className:o},r.createElement(oi,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:i9(t+360*e.left,0,360)})},onEnd:i,"aria-label":"Hue","aria-valuenow":ol(t),"aria-valuemax":"360","aria-valuemin":"0"},r.createElement(oa,{className:"react-colorful__hue-pointer",left:t/360,color:oc({h:t,s:100,v:100,a:1})})))}),op=r.memo(function(e){var t=e.hsva,n=e.onChange,i=e.onChangeEnd,o={backgroundColor:oc({h:t.h,s:100,v:100,a:1})};return r.createElement("div",{className:"react-colorful__saturation",style:o},r.createElement(oi,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:i9(t.s+100*e.left,0,100),v:i9(t.v-100*e.top,0,100)})},onEnd:i,"aria-label":"Color","aria-valuetext":"Saturation "+ol(t.s)+"%, Brightness "+ol(t.v)+"%"},r.createElement(oa,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:oc(t)})))}),om=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function og(e,t,n,i){var o=i7(n),a=i7(i),l=(0,r.useState)(function(){return e.toHsva(t)}),s=l[0],c=l[1],u=(0,r.useRef)({color:t,hsva:s}),d=(0,r.useRef)(!1);return(0,r.useEffect)(function(){if(!e.equal(t,u.current.color)){var n=e.toHsva(t);u.current={hsva:n,color:t},c(n),d.current=!1}},[t,e]),(0,r.useEffect)(function(){var t;om(s,u.current.hsva)||e.equal(t=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:t},o(t),d.current=!0)},[s,e,o]),[s,(0,r.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,r.useCallback)(function(){d.current&&(d.current=!1,a(u.current.color))},[a])]}var ov,oy,ob,ow,oE,ox="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,oS=new Map,ok=function(e){ox(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!oS.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',oS.set(t,r);var i=oE||n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])},oC=function(e){var t=e.className,n=e.colorModel,i=e.color,o=void 0===i?n.defaultColor:i,a=e.onChange,l=e.onChangeEnd,s=i8(e,["className","colorModel","color","onChange","onChangeEnd"]),c=(0,r.useRef)(null);ok(c);var u=og(n,o,a,l),d=u[0],h=u[1],f=u[2],p=oo(["react-colorful",t]);return r.createElement("div",i6({},s,{ref:c,className:p}),r.createElement(op,{hsva:d,onChange:h,onChangeEnd:f}),r.createElement(of,{hue:d.h,onChange:h,onChangeEnd:f,className:"react-colorful__last-control"}))}
1,oO=function(e){var t=e.className,n=e.hsva,i=e.onChange,o=e.onChangeEnd,a={backgroundImage:"linear-gradient(90deg, "+ou(Object.assign({},n,{a:0}))+", "+ou(Object.assign({},n,{a:1}))+")"},l=oo(["react-colorful__alpha",t]),s=ol(100*n.a);return r.createElement("div",{className:l},r.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),r.createElement(oi,{onMove:function(e){i({a:e.left})},onKey:function(e){i({a:i9(n.a+e.left)})},onEnd:o,"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},r.createElement(oa,{className:"react-colorful__alpha-pointer",left:n.a,color:ou(n)})))},oR=function(e){var t=e.className,n=e.colorModel,i=e.color,o=void 0===i?n.defaultColor:i,a=e.onChange,l=e.onChangeEnd,s=i8(e,["className","colorModel","color","onChange","onChangeEnd"]),c=(0,r.useRef)(null);ok(c);var u=og(n,o,a,l),d=u[0],h=u[1],f=u[2],p=oo(["react-colorful",t]);return r.createElement("div",i6({},s,{ref:c,className:p}),r.createElement(op,{hsva:d,onChange:h,onChangeEnd:f}),r.createElement(of,{hue:d.h,onChange:h,onChangeEnd:f}),r.createElement(oO,{hsva:d,onChange:h,onChangeEnd:f,className:"react-colorful__last-control"}))},oP={defaultColor:{r:0,g:0,b:0,a:1},toHsva:oh,fromHsva:od,equal:om},oM=function(e){return r.createElement(oR,i6({},e,{colorModel:oP}))},o$={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return oh({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){var t;return{r:(t=od(e)).r,g:t.g,b:t.b}},equal:om},o_=function(e){return r.createElement(oC,i6({},e,{colorModel:o$}))},oT=n(63074),oj=n.n(oT),oA=n(83780),oI=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function oD(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=oI.get(n);
1r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var oL=[".DS_Store","Thumbs.db"];function oN(e){return"object"==typeof e&&null!==e}function oz(e){return e.filter(function(e){return -1===oL.indexOf(e.name)})}function oV(e){if(null===e)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function oB(e){if("function"!=typeof e.webkitGetAsEntry)return oF(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?oW(t):oF(e)}function oF(e){var t=e.getAsFile();return t?Promise.resolve(oD(t)):Promise.reject(e+" is not a File")}function oU(e){return(0,oA.mG)(this,void 0,void 0,function(){return(0,oA.Jh)(this,function(t){return[2,e.isDirectory?oW(e):function(e){return(0,oA.mG)(this,void 0,void 0,function(){return(0,oA.Jh)(this,function(t){return[2,new Promise(function(t,n){e.file(function(n){t(oD(n,e.fullPath))},function(e){n(e)})})]})})}(e)]})})}function oW(e){var t=e.createReader();return new Promise(function(e,n){var r=[];!function i(){var o=this;t.readEntries(function(t){return(0,oA.mG)(o,void 0,void 0,function(){var o;return(0,oA.Jh)(this,function(a){switch(a.label){case 0:if(t.length)return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.all(r)];case 2:return e(a.sent()),[3,4];case 3:return n(a.sent()),[3,4];case 4:return[3,6];case 5:o=Promise.all(t.map(oU)),r.push(o),i(),a.label=6;case 6:return[2]}})})},function(e){n(e)})}()})}var oH=n(29597);function oY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oY(Object(n),!0).forEach(function(t){oX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return oZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oZ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var oK=function(e){var t=Array.isArray(e=Array.isArray(e)&&1===e.length?e[0]:e)?"one of ".concat(e.join(", ")):e;return{code:"file-invalid-type",message:"File type must be ".concat(t)}},oq=function(e){return{code:"file-too-large",message:"File is larger than ".concat(e," ").concat(1===e?"byte":"bytes")}},oJ=function(e){return{code:"file-too-small",message:"File is smaller than ".concat(e," ").concat(1===e?"byte":"bytes")}},o0={code:"too-many-files",message:"Too many files"};function o1(e,t){var n="application/x-moz-file"===e.type||(0,oH.Z)(e,t);return[n,n?null:oK(t)]}function o2(e,t,n){if(o3(e.size)){if(o3(t)&&o3(n)){if(e.size>n)return[!1,oq(n)];if(e.size<t)return[!1,oJ(t)]}else if(o3(t)&&e.size<t)return[!1,oJ(t)];else if(o3(n)&&e.size>n)return[!1,oq(n)]}return[!0,null]}function o3(e){return null!=e}function o5(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function o4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e}):!!e.target&&!!e.target.files}function o6(e){e.preventDefault()}function o8(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return!o5(e)&&t&&t.apply(void 0,[e].concat(r)),o5(e)})}}var o7=["children"],o9=["open"],ae=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],at=["refKey","onChange","onClick"];function an(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||ar(e,t)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ar(e,t){if(e){if("string"==typeof e)return ai(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ai(e,t)}}function ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function aa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach(function(t){al(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function as(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ac=(0,r.forwardRef)(function(e,t){var n=e.children,i=ah(as(e,o7)),o=i.open,a=as(i,o9);return(0,r.useImperativeHandle)(t,function(){return{open:o}},[o]),r.createElement(r.Fragment,null,n(aa(aa({},a),{},{open:o})))});ac.displayName="Dropzone";var au={disabled:!1,getFilesFromEvent:function(e){return(0,oA.mG)(this,void 0,void 0,function(){return(0,oA.Jh)(this,function(t){return oN(e)&&oN(e.dataTransfer)?[2,function(e,t){return(0,oA.mG)(this,void 0,void 0,function(){var n;return(0,oA.Jh)(this,function(r){switch(r.label){case 0:if(null===e)return[2,[]];if(!e.items)return[3,2];if(n=oV(e.items).filter(function(e){return"file"===e.kind}),"drop"!==t)return[2,n];return[4,Promise.all(n.map(oB))];case 1:return[2,oz(function e(t){return t.reduce(function(t,n){return(0,oA.fl)(t,Array.isArray(n)?e(n):[n])},[])}(r.sent()))];case 2:return[2,oz(oV(e.files).map(function(e){return oD(e)}))]}})})}(e.dataTransfer,e.type)]:oN(e)&&oN(e.target)?[2,oV(e.target.files).map(function(e){return oD(e)})]:Array.isArray(e)&&e.every(function(e){return"getFile"in e&&"function"==typeof e.getFile})?[2,function(e){return(0,oA.mG)(this,void 0,void 0,function(){return(0,oA.Jh)(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(e){return e.getFile()}))];case 1:return[2,t.sent().map(function(e){return oD(e)})]}})})}(e)]:[2,[]]})})},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};ac.defaultProps=au,ac.propTypes={children:oj().func,accept:oj().oneOfType([oj().string,oj().arrayOf(oj().string)]),multiple:oj().bool,preventDropOnDocument:oj().bool,noClick:oj().bool,noKeyboard:oj().bool,noDrag:oj().bool,noDragEventsBubbling:oj().bool,minSize:oj().number,maxSize:oj().number,maxFiles:oj().number,disabled:oj().bool,getFilesFromEvent:oj().func,onFileDialogCancel:oj().func,onFileDialogOpen:oj().func,useFsAccessApi:oj().bool,onDragEnter:oj().func,onDragLeave:oj().func,onDragOver:oj().func,onDrop:oj().func,onDropAccepted:oj().func,onDropRejected:oj().func,validator:oj().func};var ad={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function ah(){var e,t,n,i,o,a,l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=aa(aa({},au),s),u=c.accept,d=c.disabled,h=c.getFilesFromEvent,f=c.maxSize,p=c.minSize,m=c.multiple,g=c.maxFiles,v=c.onDragEnter,y=c.onDragLeave,b=c.onDragOver,w=c.onDrop,E=c.onDropAccepted,x=c.onDropRejected,S=c.onFileDialogCancel,k=c.onFileDialogOpen,C=c.useFsAccessApi,O=c.preventDropOnDocument,R=c.noClick,P=c.noKeyboard,M=c.noDrag,$=c.noDragEventsBubbling,_=c.validator,T=(0,r.useMemo)(function(){return"function"==typeof k?k:ap},[k]),j=(0,r.useMemo)(function(){return"function"==typeof S?S:ap},[S]),A=(0,r.useRef)(null),I=(0,r.useRef)(null),D=an((0,r.useReducer)(af,ad),2),L=D[0],N=D[1],z=L.isFocused,V=L.isFileDialogActive,B=L.draggedFiles,F=(0,r.useRef)("undefined"!=typeof window&&window.isSecureContext&&C&&"showOpenFilePicker"in window),U=function(){!F.current&&V&&setTimeout(function(){I.current&&!I.current.files.length&&(N({type:"closeDialog"}),j())},300)};(0,r.useEffect)(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[I,V,j,F]);var W=(0,r.useRef)([]),H=function(e){A.current&&A.current.contains(e.target)||(e.preventDefault(),W.current=[])};(0,r.useEffect)(function(){return O&&(document.addEventListener("dragover",o6,!1),document.addEventListener("drop",H,!1)),function(){O&&(document.removeEventListener("dragover",o6),document.removeEventListener("drop",H))}},[A,O]);var Y=(0,r.useCallback)(function(e){var t;e.preventDefault(),e.persist(),eo(e),W.current=[].concat(function(e){if(Array.isArray(e))return ai(e)}(t=W.current)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ar(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.target]),o4(e)&&Promise.resolve(h(e)).then(function(t){(!o5(e)||$)&&(N({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),v&&v(e))})},[h,v,$]),Q=(0,r.useCallback)(function(e){e.preventDefault(),e.persist(),eo(e);var t=o4(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return t&&b&&b(e),!1},[b,$]),X=(0,r.useCallback)(function(e){e.preventDefault(),e.persist(),eo(e);var t=W.current.filter(function(e){return A.current&&A.current.contains(e)}),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),W.current=t,!(t.length>0)&&(N({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),o4(e)&&y&&y(e))},[A,y,$]),G=(0,r.useCallback)(function(e,t){var n=[],r=[];e.forEach(function(e){var t=an(o1(e,u),2),i=t[0],o=t[1],a=an(o2(e,p,f),2),l=a[0],s=a[1],c=_?_(e):null;if(i&&l&&!c)n.push(e);else{var d=[o,s];c&&(d=d.concat(c)),r.push({file:e,errors:d.filter(function(e){return e})})}}),(!m&&n.length>1||m&&g>=1&&n.length>g)&&(n.forEach(function(e){r.push({file:e,errors:[o0]})}),n.splice(0)),N({acceptedFiles:n,fileRejections:r,type:"setFiles"}),w&&w(n,r,t),r.length>0&&x&&x(r,t),n.length>0&&E&&E(n,t)},[N,m,u,p,f,g,w,E,x,_]),Z=(0,r.useCallback)(function(e){e.preventDefault(),e.persist(),eo(e),W.current=[],o4(e)&&Promise.resolve(h(e)).then(function(t){(!o5(e)||$)&&G(t,e)}),N({type:"reset"})},[h,G,$]),K=(0,r.useCallback)(function(){if(F.current){N({type:"openDialog"}),T();var e,t={multiple:m,types:[{description:"everything",accept:Array.isArray(e="string"==typeof(e=u)?e.split(","):e)?e.filter(function(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||/\w+\/[-+.\w]+/g.test(e)}).reduce(function(e,t){return oQ(oQ({},e),{},oX({},t,[]))},{}):{}}]};window.showOpenFilePicker(t).then(function(e){return h(e)}).then(function(e){G(e,null),N({type:"closeDialog"})}).catch(function(e){e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)?(j(e),N({type:"closeDialog"})):e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)&&(F.current=!1,I.current&&(I.current.value=null,I.current.click()))});return}I.current&&(N({type:"openDialog"}),T(),I.current.value=null,I.current.click())},[N,T,j,C,G,u,m]),q=(0,r.useCallback)(function(e){A.current&&A.current.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),K())},[A,K]),J=(0,r.useCallback)(function(){N({type:"focus"})},[]),ee=(0,r.useCallback)(function(){N({type:"blur"})},[]),et=(0,r.useCallback)(function(){R||(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}
1()?setTimeout(K,0):K())},[R,K]),en=function(e){return d?null:e},er=function(e){return P?null:en(e)},ei=function(e){return M?null:en(e)},eo=function(e){$&&e.stopPropagation()},ea=(0,r.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=e.role,r=e.onKeyDown,i=e.onFocus,o=e.onBlur,a=e.onClick,l=e.onDragEnter,s=e.onDragOver,c=e.onDragLeave,u=e.onDrop,h=as(e,ae);return aa(aa(al({onKeyDown:er(o8(r,q)),onFocus:er(o8(i,J)),onBlur:er(o8(o,ee)),onClick:en(o8(a,et)),onDragEnter:ei(o8(l,Y)),onDragOver:ei(o8(s,Q)),onDragLeave:ei(o8(c,X)),onDrop:ei(o8(u,Z)),role:"string"==typeof n&&""!==n?n:"button"},void 0===t?"ref":t,A),d||P?{}:{tabIndex:0}),h)}},[A,q,J,ee,et,Y,Q,X,Z,P,M,d]),el=(0,r.useCallback)(function(e){e.stopPropagation()},[]),es=(0,r.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=e.onChange,r=e.onClick,i=as(e,at);return aa(aa({},al({accept:u,multiple:m,type:"file",style:{display:"none"},onChange:en(o8(n,Z)),onClick:en(o8(r,el)),tabIndex:-1},void 0===t?"ref":t,I)),i)}},[I,u,m,Z,d]),ec=B.length,eu=ec>0&&(t=(e={files:B,accept:u,minSize:p,maxSize:f,multiple:m,maxFiles:g}).files,n=e.accept,i=e.minSize,o=e.maxSize,a=e.multiple,l=e.maxFiles,(!!a||!(t.length>1))&&(!a||!(l>=1)||!(t.length>l))&&t.every(function(e){var t=oG(o1(e,n),1)[0],r=oG(o2(e,i,o),1)[0];return t&&r}));return aa(aa({},L),{},{isDragAccept:eu,isDragReject:ec>0&&!eu,isFocused:z&&!d,getRootProps:ea,getInputProps:es,rootRef:A,inputRef:I,open:en(K)})}function af(e,t){switch(t.type){case"focus":return aa(aa({},e),{},{isFocused:!0});case"blur":return aa(aa({},e),{},{isFocused:!1});case"openDialog":return aa(aa({},ad),{},{isFileDialogActive:!0});case"closeDialog":return aa(aa({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return aa(aa({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return aa(aa({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return aa({},ad);default:return e}}function ap(){}let am="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?r.useEffect:r.useLayoutEffect;Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let ag=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=(e,t,n)=>{let o=e;if(t){let i=(null==n?void 0:n.equalityFn)||Object.is,a=e(r.getState());o=n=>{let r=e(n);if(!i(a,r)){let e=a;t(a=r,e)}},(null==n?void 0:n.fireImmediately)&&t(a,a)}return i(o)},e(t,n,r)};Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var av=n(42291),ay=n(18911),ab=n.n(ay);let aw=(...e)=>e.filter(Boolean).join(".");function aE(e,t){var n;return(0,r.useMemo)(e,null!==(n=function(e,t){let n=(0,r.useRef)();return(t?b:w)(e,n.current)||(n.current=e),n.current}(t,!0))&&void 0!==n?n:[])}let ax=e=>{let[t,n]=(0,r.useState)(e.getVisiblePaths());return(0,r.useEffect)(()=>{n(e.getVisiblePaths());let t=e.useStore.subscribe(e.getVisiblePaths,n,{equalityFn:w});return()=>t()},[e]),t};function aS(e=3){let t=(0,r.useRef)(null),n=(0,r.useRef)(null),[i,o]=(0,r.useState)(!1),a=(0,r.useCallback)(()=>o(!0),[]),l=(0,r.useCallback)(()=>o(!1),[]);return(0,r.useLayoutEffect)(()=>{if(i){let{bottom:r,top:i,left:o}=t.current.getBoundingClientRect(),{height:a}=n.current.getBoundingClientRect(),l=r+a>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=o+"px","down"===l?n.current.style.top=r+e+"px":n.current.style.bottom=window.innerHeight-i+e+"px"}},[e,i]),{popinRef:t,wrapperRef:n,shown:i,show:a,hide:l}}!function(e){e.forEach(function(e){0>i4.indexOf(e)&&(e(i3,iK),i4.push(e))})}([function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",s
1andybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),s=1/0,c="black";if(!o.length)for(var u in n)o[u]=new e(n[u]).toRgb();for(var d in n){var h=(i=o[d],Math.pow(l.r-i.r,2)+Math.pow(l.g-i.g,2)+Math.pow(l.b-i.b,2));h<s&&(s=h,c=d)}return c}},t.string.push([function(t){var r=t.toLowerCase(),i="transparent"===r?"#0000":n[r];return i?new e(i).toRgb():null},"name"])}]);let ak={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};function aC(e,{format:t,hasAlpha:n,isString:r}){let i=e[ak[t]+(r&&"hex"!==t?"String":"")]();return"object"!=typeof i||n?i:function(e,t){let n=nN({},e);return t.forEach(t=>t in e&&delete n[t]),n}(i,["a"])}P.extend({color:()=>e=>i5(e).isValid()});let aO=(e,t)=>{let n=i5(e);if(!n.isValid())throw Error("Invalid color");return aC(n,t)};var aR=Object.freeze({__proto__:null,schema:e=>P().color().test(e),sanitize:aO,format:(e,t)=>aC(i5(e),nN(nN({},t),{},{isString:!0,format:"hex"})),normalize:({value:e})=>{let t=iJ(e)[1],n="object"==typeof e?"a"in e:"hex"===t&&8===e.length||/^(rgba)|(hsla)|(hsva)/.test(e),r={format:"name"===t?"hex":t,hasAlpha:n,isString:"string"==typeof e};return{value:aO(e,r),settings:r}}});let aP=rm("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')',$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),aM=rm("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),a$=rm("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function a_(e,t){return"rgb"!==t?i5(e).toRgb():e}function aT({value:e,displayValue:t,settings:n,onUpdate:i}){let{emitOnEditStart:o,emitOnEditEnd:a}=ra(),{format:l,hasAlpha:s}=n,{popinRef:c,wrapperRef:u,shown:d,show:h,hide:f}=aS(),p=(0,r.useRef)(0),[m,g]=(0,r.useState)(()=>a_(e,l)),v=()=>{g(a_(e,l)),h(),o()},y=()=>{f(),a(),window.clearTimeout(p.current)},b=()=>{p.current=window.setTimeout(y,500)};return(0,r.useEffect)(()=>()=>window.clearTimeout(p.current),[]),r.createElement(r.Fragment,null,r.createElement(aP,{ref:c,active:d,onClick:()=>v(),style:{color:t}}),d&&r.createElement(rB,null,r.createElement(rN,{onPointerUp:y}),r.createElement(a$,{ref:u,onMouseEnter:()=>window.clearTimeout(p.current),onMouseLeave:e=>0===e.buttons&&b()},r.createElement(s?oM:o_,{color:m,onChange:i}))))}var aj=nN({component:function(){let{value:e,displayValue:t,label:n,onChange:i,onUpdate:o,settings:a}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,n),r.createElement(aM,null,r.createElement(aT,{value:e,displayValue:t,onChange:i,onUpdate:o,settings:a}),r.createElement(rO,{value:t,onChange:i,onUpdate:o})))}},aR),aA=nN({component:function(){let{label:e,displayValue:t,onUpdate:n,settings:i}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(iS,{value:t,settings:i,onUpdate:n}))}},i_(["x","y","z"]));let aI=rm("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),aD=rm("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function aL({value:e,settings:t,onUpdate:n}){let i=(0,r.useRef)(),o=(0,r.useRef)(0),a=(0,r.useRef)(0),l=(0,r.useRef)(1),[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(!1),[h,f]=rJ(),p=(0,r.useRef)(null),m=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>
1{if(s){let{top:e,left:t,width:n,height:r}=p.current.getBoundingClientRect();m.current.style.left=t+n/2+"px",m.current.style.top=e+r/2+"px"}},[s]);let{keys:[g,v],joystick:y}=t,b="invertY"===y?1:-1,{[g]:{step:w},[v]:{step:E}}=t,x=rb("sizes","joystickWidth"),S=rb("sizes","joystickHeight"),k=.8*parseFloat(x)/2,C=.8*parseFloat(S)/2,O=(0,r.useCallback)(()=>{i.current||(d(!0),o.current&&f({x:o.current*k}),a.current&&f({y:-(a.current*C)}),i.current=window.setInterval(()=>{n(e=>{let t=w*o.current*l.current,n=b*E*a.current*l.current;return Array.isArray(e)?{[g]:e[0]+t,[v]:e[1]+n}:{[g]:e[g]+t,[v]:e[v]+n}})},16))},[k,C,n,f,w,E,g,v,b]),R=(0,r.useCallback)(()=>{window.clearTimeout(i.current),i.current=void 0,d(!1)},[]);(0,r.useEffect)(()=>{function e(e){l.current=n8(e)}return window.addEventListener("keydown",e),window.addEventListener("keyup",e),()=>{window.clearTimeout(i.current),window.removeEventListener("keydown",e),window.removeEventListener("keyup",e)}},[]);let P=rq(({first:t,active:r,delta:[i,s],movement:[u,d]})=>{t&&c(!0);let h=nz(u,-k,k),p=nz(d,-C,C);o.current=Math.abs(u)>Math.abs(h)?Math.sign(u-h):0,a.current=Math.abs(d)>Math.abs(p)?Math.sign(p-d):0;let m=e[g],y=e[v];r?(o.current||(m+=i*w*l.current,f({x:h})),a.current||(y-=b*s*E*l.current,f({y:p})),o.current||a.current?O():R(),n({[g]:m,[v]:y})):(c(!1),o.current=0,a.current=0,f({x:0,y:0}),R())});return r.createElement(aI,ri({ref:p},P()),s&&r.createElement(rB,null,r.createElement(aD,{ref:m,isOutOfBounds:u},r.createElement("div",null),r.createElement("span",{ref:h}))))}let aN=rm("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}}),az=["joystick"],aV=i_(["x","y"]);var aB=nN(nN({component:function(){let{label:e,displayValue:t,onUpdate:n,settings:i}=ra();return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(aN,{withJoystick:!!i.joystick},i.joystick&&r.createElement(aL,{value:t,settings:i,onUpdate:n}),r.createElement(iS,{value:t,settings:i,onUpdate:n})))}},aV),{},{normalize:e=>{let{joystick:t=!0}=e,n=nx(e,az),{value:r,settings:i}=aV.normalize(n);return{value:r,settings:nN(nN({},i),{},{joystick:t})}}}),aF=Object.freeze({__proto__:null,sanitize:e=>{if(void 0!==e){if(e instanceof File)try{return URL.createObjectURL(e)}catch(e){return}if("string"==typeof e&&0===e.indexOf("blob:"))return e;throw Error(`Invalid image format [undefined | blob |\xa0File].`)}},schema:(e,t)=>"object"==typeof t&&"image"in t,normalize:({image:e})=>({value:e})});let aU=rm("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),aW=rm("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),aH=rm("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),aY=rm("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),aQ=rm("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),aX=rm("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});var aG=nN({component:function(){let{label:e,value:t,onUpdate:n,disabled:i}=ra(),{popinRef:o,wrapperRef:a,shown:l,show:s,hide:c}=aS(),u=(0,r.useCallback)(e=>{e.length&&n(e[0])},[n]),d=(0,r.useCallback)(e=>{e.stopPropagation(),n(void 0)},[n]),{getRootProps:h,getInputProps:f,isDragAccept:p}=ah({maxFiles:1,accept:"image/*",onDrop:u,disabled:i});return r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(aU,null,r.createElement(aH,{ref:o,hasImage:!!t,onPointerDown:()=>!!t&&s(),onPointerUp:c,style:{backgroundImage:t?`url(${t})`:"none"}}),l&&!!t&&r.createElement(rB,null,r.createElement(rN,{onPointerUp:c,style:{cursor:"pointer"}}),r.createElement(aY,{ref:a,style:{backgroundImage:`url(${t})`}})),r.createElement(aW,h({isDragAccept:p}),r.createElement("input",f()),r.createElement(aQ,null,p?"drop image":"click or drop")),r.createElement(aX,{onClick:d,disabled:!t})))}},aF);let aZ=P().number(),aK=e=>({min:e[0],max:e[1]}),aq=(e,{bounds:[t,n]},r)=>
1{let i=Array.isArray(e)?aK(e):e,{min:o,max:a}=nN(nN({},{min:r[0],max:r[1]}),i);return[nz(Number(o),t,Math.max(t,a)),nz(Number(a),Math.min(n,o),n)]};var aJ=Object.freeze({__proto__:null,schema:(e,t)=>P().array().length(2).every.number().test(e)&&P().schema({min:aZ,max:aZ}).test(t),format:aK,sanitize:aq,normalize:({value:e,min:t,max:n})=>{let r={min:t,max:n},i=nN(nN({},ik(aK(e),{min:r,max:r})),{},{bounds:[t,n]});return{value:aq(aK(e),i,e),settings:i}}});let a0=["value","bounds","onDrag"],a1=["bounds"],a2=rm("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function a3(e){let{value:t,bounds:[n,i],onDrag:o}=e,a=nx(e,a0),l=(0,r.useRef)(null),s=(0,r.useRef)(null),c=(0,r.useRef)(null),u=(0,r.useRef)(0),d=rb("sizes","scrubberWidth"),h=rq(({event:e,first:r,xy:[h],movement:[f],memo:p={}})=>{if(r){let{width:r,left:o}=l.current.getBoundingClientRect();u.current=r-parseFloat(d);let a=(null==e?void 0:e.target)===s.current||(null==e?void 0:e.target)===c.current;p.pos=nW((h-o)/r,n,i);let f=Math.abs(p.pos-t.min)-Math.abs(p.pos-t.max);p.key=f<0||0===f&&p.pos<=t.min?"min":"max",a&&(p.pos=t[p.key])}let m=p.pos+nW(f/u.current,0,i-n);return o({[p.key]:ie(m,a[p.key])}),p}),f=`calc(${nU(t.min,n,i)} * (100% - ${d} - 8px) + 4px)`,p=`calc(${1-nU(t.max,n,i)} * (100% - ${d} - 8px) + 4px)`;return r.createElement(r4,ri({ref:l},h()),r.createElement(r3,null,r.createElement(r6,{style:{left:f,right:p}})),r.createElement(r5,{position:"left",ref:s,style:{left:f}}),r.createElement(r5,{position:"right",ref:c,style:{right:p}}))}var a5=nN({component:function(){let{label:e,displayValue:t,onUpdate:n,settings:i}=ra(),o=nx(i,a1);return r.createElement(r.Fragment,null,r.createElement(rZ,{input:!0},r.createElement(rH,null,e),r.createElement(a2,null,r.createElement(a3,ri({value:t},i,{onDrag:n})),r.createElement(iS,{value:t,settings:o,onUpdate:n,innerLabelTrim:0}))))}},aJ);let a4=()=>{let e=new Map;return{on:(t,n)=>{let r=e.get(t);void 0===r&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{let r=e.get(t);void 0!==r&&(r.delete(n),0===r.size&&e.delete(t))},emit:(t,...n)=>{let r=e.get(t);if(void 0!==r)for(let e of r)e(...n)}}},a6=["type","value"],a8=["onChange","transient","onEditStart","onEditEnd"],a7=new function(){let e=function(e){let t="function"==typeof e?function(e){let t;let n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(i!==t){let e=t;t=r?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o=(e,r=i,o=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let a=r(t);function l(){let n=r(t);if(!o(a,n)){let t=a;e(a=n,t)}}return n.add(l),()=>n.delete(l)},a={setState:r,getState:i,subscribe:(e,t,r)=>t||r?o(e,t,r):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,a),a}(e):e,n=(e=t.getState,n=Object.is)=>{let i;let[,o]=(0,r.useReducer)(e=>e+1,0),a=t.getState(),l=(0,r.useRef)(a),s=(0,r.useRef)(e),c=(0,r.useRef)(n),u=(0,r.useRef)(!1),d=(0,r.useRef)();void 0===d.current&&(d.current=e(a));let h=!1;(l.current!==a||s.current!==e||c.current!==n||u.current)&&(i=e(a),h=!n(d.current,i)),am(()=>{h&&(d.current=i),l.current=a,s.current=e,c.current=n,u.current=!1});let f=(0,r.useRef)(a);am(()=>{let e=()=>{try{let e=t.getState(),n=s.current(e);c.current(d.current,n)||(l.current=e,d.current=n,o())}catch(e){u.current=!0,o()}},n=t.subscribe(e);return t.getState()!==f.current&&e(),n},[]);let p=h?i:d.current;return(0,r.useDebugValue)(p),p};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");let e=[n,t];return{next(){let t=e.length<=0;return{value:e.shift(),done:t}}}},n}(ag(()=>({data:{}}))),t=a4();this.storeId=nH(),this.useStore=e;let n={},i=new Set;this.getVisiblePaths=()=>{let e=this.getData(),t=Object.keys(e),r=[];Object.entries(n).forEach(([e,n])=>{n.render&&t.some(t=>0===t.indexOf(e))&&!n.render(this.get)&&r.push(e+".")});let o=[];return i.forEach(t=>{t in e&&e[t].__refCount>0&&r.every(e=>-1===t.indexOf(e))&&(!e[t].render||e[t].render(this.get))&&o.push(t)}),o},this.setOrderedPaths=e=>
1{e.forEach(e=>i.add(e))},this.orderPaths=e=>(this.setOrderedPaths(e),e),this.disposePaths=t=>{e.setState(e=>{let n=e.data;return t.forEach(e=>{if(e in n){let t=n[e];t.__refCount--,0===t.__refCount&&t.type in nq&&delete n[e]}}),{data:n}})},this.dispose=()=>{e.setState(()=>({data:{}}))},this.getFolderSettings=e=>n[e]||{},this.getData=()=>e.getState().data,this.addData=(t,n)=>{e.setState(e=>{let r=e.data;return Object.entries(t).forEach(([e,t])=>{let i=r[e];if(i){let{type:r,value:o}=t,a=nx(t,a6);r!==i.type?nO(nS.INPUT_TYPE_OVERRIDE,e,i.type,r):((0===i.__refCount||n)&&Object.assign(i,a),i.__refCount++)}else r[e]=nN(nN({},t),{},{__refCount:1})}),{data:r}})},this.setValueAtPath=(t,n,r)=>{e.setState(e=>{let i=e.data;return n3(i[t],n,t,this,r),{data:i}})},this.setSettingsAtPath=(t,n)=>{e.setState(e=>{let r=e.data;return r[t].settings=nN(nN({},r[t].settings),n),{data:r}})},this.disableInputAtPath=(t,n)=>{e.setState(e=>{let r=e.data;return r[t].disabled=n,{data:r}})},this.set=(t,n)=>{e.setState(e=>{let r=e.data;return Object.entries(t).forEach(([e,t])=>{try{n3(r[e],t,void 0,void 0,n)}catch(e){}}),{data:r}})},this.getInput=e=>{try{return this.getData()[e]}catch(t){nO(nS.PATH_DOESNT_EXIST,e)}},this.get=e=>{var t;return null===(t=this.getInput(e))||void 0===t?void 0:t.value},this.emitOnEditStart=e=>{t.emit(`onEditStart:${e}`,this.get(e),e,nN(nN({},this.getInput(e)),{},{get:this.get}))},this.emitOnEditEnd=e=>{t.emit(`onEditEnd:${e}`,this.get(e),e,nN(nN({},this.getInput(e)),{},{get:this.get}))},this.subscribeToEditStart=(e,n)=>{let r=`onEditStart:${e}`;return t.on(r,n),()=>t.off(r,n)},this.subscribeToEditEnd=(e,n)=>{let r=`onEditEnd:${e}`;return t.on(r,n),()=>t.off(r,n)};let o=(e,t,r)=>{let i={};return Object.entries(e).forEach(([e,a])=>{if(""===e)return nO(nS.EMPTY_KEY);let l=aw(t,e);if(a.type===nq.FOLDER)Object.assign(i,o(a.schema,l,r)),l in n||(n[l]=a.settings);else if(e in r)nO(nS.DUPLICATE_KEYS,e,l,r[e].path);else{let t=function(e,t,n,r){let i=function e(t,n,r={},i){var o,a;if("object"!=typeof t||Array.isArray(t))return{type:i,input:t,options:nN({key:n,label:n,optional:!1,disabled:!1,order:0},r)};if("__customInput"in t){let{type:r,__customInput:i}=t;return e(i,n,nx(t,n0),r)}let{render:l,label:s,optional:c,order:u=0,disabled:d,hint:h,onChange:f,onEditStart:p,onEditEnd:m,transient:g}=t,v=nx(t,n1),y=nN({render:l,key:n,label:null!=s?s:n,hint:h,transient:null!=g?g:!!f,onEditStart:p,onEditEnd:m,disabled:d,optional:c,order:u},r),{type:b}=v,w=nx(v,n2);return(b=null!=i?i:b)in nq?{type:b,input:w,options:y}:{type:b,input:i&&nZ(w)&&"value"in w?w.value:nK(w)?void 0:w,options:nN(nN({},y),{},{onChange:f,optional:null!==(o=y.optional)&&void 0!==o&&o,disabled:null!==(a=y.disabled)&&void 0!==a&&a})}}(e,t),{type:o,input:a,options:l}=i;if(o)return o in nq?i:{type:o,input:nI(o,a,n,r),options:l};let s=nj(a);return s?{type:s,input:nI(s,a,n,r),options:l}:!!(s=nj({value:a}))&&{type:s,input:nI(s,{value:a},n,r),options:l}}(a,e,l,i);if(t){let{type:n,options:o,input:a}=t,{onChange:s,transient:c,onEditStart:u,onEditEnd:d}=o,h=nx(o,a8);i[l]=nN(nN(nN({type:n},h),a),{},{fromPanel:!0}),r[e]={path:l,onChange:s,transient:c,onEditStart:u,onEditEnd:d}}else nO(nS.UNKNOWN_INPUT,l,a)}}),i};this.getDataFromSchema=e=>{let t={};return[o(e,"",t),t]}},a9={collapsed:!1},le={disabled:!1};function lt(e,t){return{type:nq.BUTTON,onClick:e,settings:nN(nN({},le),t)}}let ln=e=>"__levaInput"in e,lr=(e,t)=>{let n={},r=t?t.toLowerCase():null;return e.forEach(e=>{let[t,i]=function(e){let t=e.split(".");return[t.pop(),t.join(".")||void 0]}(e);(!r||t.toLowerCase().indexOf(r)>-1)&&ab()(n,i,{[t]:{__levaInput:!0,path:e}})}),n},li=["type","label","path","valueKey","value","settings","setValue","disabled"];function lo(e){let{type:t,label:n,path:i,valueKey:o,value:a,settings:l,setValue:s,disabled:c}=e,u=nx(e,li),{displayValue:d,onChange:h,onUpdate:f}=rK({type:t,value:a,settings:l,setValue:s}),p=nT[t].component;return p?r.createElement(ro.Provider,{value:nN({key:o,path:i,id:""+i,label:n,displayValue:d,value:a,onChange:h,onUpdate:f,settings:l,setValue:s,disabled:c},u)},r.createElement(rL,{disabled:c},r.createElement(p,null))):(nO(nS.NO_COMPONENT_FOR_TYPE,t,i),null)}let la=rm("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}}),ll=rm("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}
1),ls=rm("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),lc=({label:e,opts:t})=>{let n="string"==typeof e&&""===e.trim()?null:e,r=t;return"object"==typeof t.opts&&(void 0!==r.label&&(n=t.label),r=t.opts),{label:n,opts:r}},lu=rm("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),ld=(0,r.forwardRef)(function({initialValue:e},t){let n=rb("colors","highlight3"),i=rb("colors","elevation2"),o=rb("colors","highlight1"),[a,l]=(0,r.useMemo)(()=>[i5(o).alpha(.4).toRgbString(),i5(o).alpha(.1).toRgbString()],[o]),s=(0,r.useRef)([e]),c=(0,r.useRef)(e),u=(0,r.useRef)(e),d=(0,r.useRef)(),h=(0,r.useCallback)((e,t)=>{if(!e)return;let{width:r,height:o}=e,d=new Path2D,h=r/100,f=.05*o;for(let e=0;e<s.current.length;e++){let t=nU(s.current[e],c.current,u.current),n=h*e,r=o-t*(o-2*f)-f;d.lineTo(n,r)}t.clearRect(0,0,r,o);let p=new Path2D(d);p.lineTo(h*(s.current.length+1),o),p.lineTo(0,o),p.lineTo(0,0);let m=t.createLinearGradient(0,0,0,o);m.addColorStop(0,a),m.addColorStop(1,l),t.fillStyle=m,t.fill(p),t.strokeStyle=i,t.lineJoin="round",t.lineWidth=14,t.stroke(d),t.strokeStyle=n,t.lineWidth=2,t.stroke(d)},[n,i,a,l]),[f,p]=function(e){let t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let r=n6(()=>{t.current.width=t.current.offsetWidth*window.devicePixelRatio,t.current.height=t.current.offsetHeight*window.devicePixelRatio,e(t.current,n.current)},250);return window.addEventListener("resize",r),i.current||(r(),i.current=!0),()=>window.removeEventListener("resize",r)},[e]),(0,r.useEffect)(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}(h);return(0,r.useImperativeHandle)(t,()=>({frame:e=>{var t;(void 0===c.current||e<c.current)&&(c.current=e),(void 0===u.current||e>u.current)&&(u.current=e),(t=s.current).push(e),t.length>100&&t.shift(),d.current=requestAnimationFrame(()=>h(f.current,p.current))}}),[f,p,h]),(0,r.useEffect)(()=>()=>cancelAnimationFrame(d.current),[]),r.createElement(lu,{ref:f})}),lh=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),lf=(0,r.forwardRef)(function({initialValue:e},t){let[n,i]=(0,r.useState)(lh(e));return(0,r.useImperativeHandle)(t,()=>({frame:e=>i(lh(e))}),[]),r.createElement("div",null,n)});function lp(e){return"function"==typeof e?e():e.current}let lm=["type","label","key"],lg={[nq.BUTTON]:function({onClick:e,settings:t,label:n}){let i=ru();return r.createElement(rZ,null,r.createElement(la,{disabled:t.disabled,onClick:()=>e(i.get)},n))},[nq.BUTTON_GROUP]:function(e){let{label:t,opts:n}=lc(e),i=ru();return r.createElement(rZ,{input:!!t},t&&r.createElement(rH,null,t),r.createElement(ll,null,Object.entries(n).map(([e,t])=>r.createElement(ls,{key:e,onClick:()=>t(i.get)},e))))},[nq.MONITOR]:function({label:e,objectOrFn:t,settings:n}){let i=(0,r.useRef)(),o=(0,r.useRef)(lp(t));return(0,r.useEffect)(()=>{let e=window.setInterval(()=>{var e;document.hidden||null===(e=i.current)||void 0===e||e.frame(lp(t))},n.interval);return()=>window.clearInterval(e)},[t,n.interval]),r.createElement(rZ,{input:!0},r.createElement(rH,{align:"top"},e),n.graph?r.createElement(ld,{ref:i,initialValue:o.current}):r.createElement(lf,{ref:i,initialValue:o.current}))}},lv=r.memo(({path:e})=>{let[t,{set:n,setSettings:i,disable:o,storeId:a,emitOnEditStart:l,emitOnEditEnd:s}]=function(e){let t=ru(),[n,i]=(0,r.useState)(r1(t.getData(),e)),o=(0,r.useCallback)(n=>t.setValueAtPath(e,n,!0),[e,t]),a=(0,r.useCallback)(n=>t.setSettingsAtPath(e,n),[e,t]),l=(0,r.useCallback)(n=>t.disableInputAtPath(e,n),[e,t]),s=(0,r.useCallback)(()=>t.emitOnEditStart(e),[e,t]),c=(0,r.useCallback)(()=>t.emitOnEditEnd(e),[e,t]);return(0,r.useEffect)(()=>{i(r1(t.getData(),e));let n=t.useStore.subscribe(t=>r1(t.data,e),i,{equalityFn:w});return()=>n()},[t,e]),[n,{set:o,setSettings:a,disable:l,storeId:t.storeId,emitOnEditStart:s,emitOnEditEnd:c}]}(e);if(!t)return null;let{type:c,label:u,key:d}=t,h=nx(t,lm);if(c in nq){let t=lg[c];return r.createElement(t,ri({label:u,path:e},h))}return c in nT?r.createElement(lo,ri({key:a+e,type:c,label:u,storeId:a,path:e,valueKey:d,setValue:n,setSettings:i,disable:o,emitOnEditStart:l,emitOnEditEnd:s},h)):(nR(nS.UNSUPPORTED_INPUT,c,e),null)});function ly({toggle:e,toggled:t,name:n}){return r.createElement(r$,{onClick:()=>e()},r.createElement(rX,{toggled:t}),r.createElement("div",null,n))}let lb=({name:e,path:t,tree:n})=>{let i=ru(),o=aw(t,e),{collapsed:a,color:l}=i.getFolderSettings(o),[s,c]=(0,r.useState)(!a),u=(0,r.useRef)(null),d=rb("colors","folderWidgetColor"),h=rb("colors","folderTextColor");return(0,r.useLayoutEffect)(()=>{u.current.style.setProperty("--leva-colors-folderWidgetColor",l||d),u.current.style.setProperty("--leva-colors-folderTextColor",l||h)},[l,d,h]),r.createElement(rP,{ref:u},r.createElement(ly,{name:e,toggled:s,toggle:()=>c(e=>!e)}),r.createElement(lw,{parent:o,tree:n,toggled:s}))},lw=r.memo(({isRoot:e=!1,fill:t=!1,flat:n=!1,parent:i,tree:o,toggled:a})=>{let{wrapperRef:l,contentRef:s}=function(e){let t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useRef)(!0);return(0,r.useLayoutEffect)(()=>{e||(t.current.style.height="0px",t.current.style.overflow="hidden")},[]),(0,r.useEffect)(()=>{let r;if(i.current){i.current=!1;return}let o=t.current,a=()=>{e&&(o.style.removeProperty("height"),o.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};o.addEventListener("transitionend",a,{once:!0});let{height:l}=n.current.getBoundingClientRect();return o.style.height=l+"px",e||(o.style.overflow="hidden",r=window.setTimeout(()=>
1o.style.height="0px",50)),()=>{o.removeEventListener("transitionend",a),clearTimeout(r)}},[e]),{wrapperRef:t,contentRef:n}}(a),c=ru(),u=([e,t])=>{var n;return(ln(t)?null===(n=c.getInput(t.path))||void 0===n?void 0:n.order:c.getFolderSettings(aw(i,e)).order)||0},d=Object.entries(o).sort((e,t)=>u(e)-u(t));return r.createElement(rM,{ref:l,isRoot:e,fill:t,flat:n},r.createElement(r_,{ref:s,isRoot:e,toggled:a},d.map(([e,t])=>ln(t)?r.createElement(lv,{key:t.path,valueKey:t.valueKey,path:t.path}):r.createElement(lb,{key:e,name:e,path:i,tree:t}))))}),lE=rm("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${rj}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),lx=rm("i",{$flexCenter:"",width:40,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),lS=rm("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),lk=rm("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${lx}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),lC=rm("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),lO=rm("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:40}}}}),lR=r.forwardRef(({setFilter:e,toggle:t},n)=>{let[i,o]=(0,r.useState)(""),a=(0,r.useMemo)(()=>n6(e,250),[e]),l=()=>{e(""),o("")};return(0,r.useEffect)(()=>{a(i)},[i,a]),r.createElement(r.Fragment,null,r.createElement(lC,{ref:n,value:i,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:e=>e.stopPropagation(),onChange:e=>{let n=e.currentTarget.value;t(!0),o(n)}}),r.createElement(lx,{onClick:()=>l(),style:{visibility:i?"visible":"hidden"}},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function lP({setFilter:e,onDrag:t,onDragStart:n,onDragEnd:i,toggle:o,toggled:a,title:l,drag:s,filterEnabled:c,from:u}){let[d,h]=(0,r.useState)(!1),f=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e,t;d?null===(e=f.current)||void 0===e||e.focus():null===(t=f.current)||void 0===t||t.blur()},[d]);let p=rq(({offset:[e,r],first:o,last:a})=>{t({x:e,y:r}),o&&n({x:e,y:r}),a&&i({x:e,y:r})},{filterTaps:!0,from:({offset:[e,t]})=>[(null==u?void 0:u.x)||e,(null==u?void 0:u.y)||t]});return(0,r.useEffect)(()=>{let e=e=>{"L"===e.key&&e.shiftKey&&e.metaKey&&h(e=>!e)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),r.createElement(r.Fragment,null,r.createElement(lS,{mode:s?"drag":void 0},r.createElement(lx,{active:!a,onClick:()=>o()},r.createElement(rX,{toggled:a,width:12,height:8})),r.createElement(lO,ri({},s?p():{},{drag:s,filterEnabled:c}),void 0===l&&s?r.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},r.createElement("circle",{cx:"2",cy:"2",r:"2"}),r.createElement("circle",{cx:"14",cy:"2",r:"2"}),r.createElement("circle",{cx:"26",cy:"2",r:"2"}),r.createElement("circle",{cx:"2",cy:"12",r:"2"}),r.createElement("circle",{cx:"14",cy:"12",r:"2"}),r.createElement("circle",{cx:"26",cy:"12",r:"2"})):l),c&&r.createElement(lx,{active:d,onClick:()=>h(e=>!e)},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"}
1,r.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),r.createElement(lk,{toggled:d},r.createElement(lR,{ref:f,setFilter:e,toggle:o})))}let lM=["store","hidden","theme","collapsed"];function l$(e){let{store:t,hidden:n=!1,theme:i,collapsed:o=!1}=e,a=nx(e,lM),l=aE(()=>(function(e){let t=rd();if(!e)return{theme:t,className:""};Object.keys(e).forEach(n=>{Object.assign(t[n],e[n])});let n=rg(t);return{theme:t,className:n.className}})(i),[i]),[s,c]=(0,r.useState)(!o),u="object"==typeof o?!o.collapsed:s,d=(0,r.useMemo)(()=>"object"==typeof o?e=>{"function"==typeof e?o.onChange(!e(!o.collapsed)):o.onChange(!e)}:c,[o]);return!t||n?null:r.createElement(rl.Provider,{value:l},r.createElement(l_,ri({store:t},a,{toggled:u,setToggle:d,rootClass:l.className})))}let l_=r.memo(({store:e,rootClass:t,fill:n=!1,flat:i=!1,neverHide:o=!1,oneLineLabels:a=!1,titleBar:l={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:s=!1,toggled:c,setToggle:u})=>{var d,h;let f=ax(e),[p,m]=(0,r.useState)(""),g=(0,r.useMemo)(()=>lr(f,p),[f,p]),[v,y]=rJ(),b=o||f.length>0,w="object"==typeof l&&l.title||void 0,E="object"!=typeof l||null===(d=l.drag)||void 0===d||d,x="object"!=typeof l||null===(h=l.filter)||void 0===h||h,S="object"==typeof l&&l.position||void 0,k="object"==typeof l&&l.onDrag||void 0,C="object"==typeof l&&l.onDragStart||void 0,O="object"==typeof l&&l.onDragEnd||void 0;return r.useEffect(()=>{y({x:null==S?void 0:S.x,y:null==S?void 0:S.y})},[S,y]),ry(),r.createElement(ni,null,r.createElement(rc.Provider,{value:{hideCopyButton:s}},r.createElement(lE,{ref:v,className:t,fill:n,flat:i,oneLineLabels:a,hideTitleBar:!l,style:{display:b?"block":"none"}},l&&r.createElement(lP,{onDrag:e=>{y(e),null==k||k(e)},onDragStart:e=>null==C?void 0:C(e),onDragEnd:e=>null==O?void 0:O(e),setFilter:m,toggle:e=>u(t=>null!=e?e:!t),toggled:c,title:w,drag:E,filterEnabled:x,from:S}),b&&r.createElement(rs.Provider,{value:e},r.createElement(lw,{isRoot:!0,fill:n,flat:i,tree:g,toggled:c})))))}),lT=["isRoot"],lj=!1,lA=null;function lI(e){let{isRoot:t=!1}=e,n=nx(e,lT);return(0,r.useEffect)(()=>(lj=!0,!t&&lA&&(lA.remove(),lA=null),()=>{t||(lj=!1)}),[t]),r.createElement(l$,ri({store:a7},n))}function lD(e,t,n,i,o){var a;let l,s,c,u,d;let{folderName:h,schema:f,folderSettings:p,hookSettings:m,deps:g}=("string"==typeof e?(d=e,l=t,Array.isArray(n)?u=n:n&&("store"in n?(c=n,u=i):(s=n,Array.isArray(i)?u=i:(c=i,u=o)))):(l=e,Array.isArray(t)?u=t:(c=t,u=n)),{schema:l,folderName:d,folderSettings:s,hookSettings:c,deps:u||[]}),v="function"==typeof f,y=(0,r.useRef)(!1),b=(0,r.useRef)(!0),E=aE(()=>{y.current=!0;let e="function"==typeof f?f():f;return h?{[h]:{type:nq.FOLDER,schema:e,settings:nN(nN({},a9),p)}}:e},g);a=!(null!=m&&m.store),(0,r.useEffect)(()=>{a&&!lj&&(!lA&&(lA=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(lA),(0,av.createRoot)(lA).render(r.createElement(lI,{isRoot:!0})))),lj=!0)},[a]);let[x]=(0,r.useState)(()=>(null==m?void 0:m.store)||a7),[S,k]=(0,r.useMemo)(()=>x.getDataFromSchema(E),[x,E]),[C,O,R,P,M]=(0,r.useMemo)(()=>{let e=[],t=[],n={},r={},i={};return Object.values(k).forEach(({path:o,onChange:a,onEditStart:l,onEditEnd:s,transient:c})=>{e.push(o),a?(n[o]=a,c||t.push(o)):t.push(o),l&&(r[o]=l),s&&(i[o]=s)}),[e,t,n,r,i]},[k]),$=(0,r.useMemo)(()=>x.orderPaths(C),[C,x]),_=x.useStore(e=>{var t;return t=nN(nN({},S),e.data),Object.entries(O.reduce((e,n)=>(t&&t.hasOwnProperty(n)&&(e[n]=t[n]),e),{})).reduce((e,[,{value:t,disabled:n,key:r}])=>(e[r]=n?void 0:t,e),{})},w),T=(0,r.useCallback)(e=>{let t=Object.entries(e).reduce((e,[t,n])=>Object.assign(e,{[k[t].path]:n}),{});x.set(t,!1)},[x,k]),j=(0,r.useCallback)(e=>x.get(k[e].path),[x,k]);return((0,r.useEffect)(()=>{let e=!b.current&&y.current;return x.addData(S,e),b.current=!1,y.current=!1,()=>x.disposePaths($)},[x,$,S]),(0,r.useEffect)(()=>{let e=[];
1return Object.entries(R).forEach(([t,n])=>{n(x.get(t),t,nN({initial:!0,get:x.get},x.getInput(t)));let r=x.useStore.subscribe(e=>{let n=e.data[t];return[n.disabled?void 0:n.value,n]},([e,r])=>n(e,t,nN({initial:!1,get:x.get},r)),{equalityFn:w});e.push(r)}),()=>e.forEach(e=>e())},[x,R]),(0,r.useEffect)(()=>{let e=[];return Object.entries(P).forEach(([t,n])=>e.push(x.subscribeToEditStart(t,n))),Object.entries(M).forEach(([t,n])=>e.push(x.subscribeToEditEnd(t,n))),()=>e.forEach(e=>e())},[P,M,x]),v)?[_,T,j]:_}nA(nJ.SELECT,is),nA(nJ.IMAGE,aG),nA(nJ.NUMBER,it),nA(nJ.COLOR,aj),nA(nJ.STRING,ip),nA(nJ.BOOLEAN,iy),nA(nJ.INTERVAL,a5),nA(nJ.VECTOR3D,aA),nA(nJ.VECTOR2D,aB)},18911:function(e,t,n){"use strict";var r=n(17710),i=n(83746),o=n(52800),a=n(72331);e.exports=function(e,t,n){if(!r(e))throw TypeError("expected an object");if("string"!=typeof t||null==n)return i.apply(null,arguments);if("string"==typeof n)return a(e,t,n),e;var l=o(e,t);return r(n)&&r(l)&&(n=i({},l,n)),a(e,t,n),e}},83746:function(e,t,n){"use strict";var r=n(17710),i=n(99644);function o(e,t){for(var n=arguments.length,r=0;++r<n;){var o=arguments[r];l(o)&&i(o,a,e)}return e}function a(e,t){if("__proto__"!==t&&"constructor"!==t&&"prototype"!==t){var n=this[t];l(e)&&l(n)?o(n,e):this[t]=e}}function l(e){return r(e)&&!Array.isArray(e)}e.exports=o},30924:function(e,t,n){"use strict";var r=n(15979);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i}
1;return n.PropTypes=n,n}},63074:function(e,t,n){e.exports=n(30924)()},15979:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},72331:function(e,t,n){"use strict";var r=n(83381),i=n(65903),o=n(54262),a=n(11225);function l(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e}e.exports=function(e,t,n){if(!a(e)||(Array.isArray(t)&&(t=[].concat.apply([],t).join(".")),"string"!=typeof t))return e;for(var s=r(t,{sep:".",brackets:!0}).filter(l),c=s.length,u=-1,d=e;++u<c;){var h=s[u];if(u!==c-1){a(d[h])||(d[h]={}),d=d[h];continue}o(d[h])&&o(n)?d[h]=i({},d[h],n):d[h]=n}return e}},11225:function(e){"use strict";e.exports=function(e){return null!=e&&("object"==typeof e||"function"==typeof e)}},83381:function(e,t,n){"use strict";var r=n(47850);function i(e,t,n,r){var o=e.indexOf(t,n);return"\\"===e.charAt(o-1)?i(e,t,o+1):o}e.exports=function(e,t,n){if("string"!=typeof e)throw TypeError("expected a string");"function"==typeof t&&(n=t,t=null),"string"==typeof t&&(t={sep:t});var o,a,l=r({sep:"."},t),s=l.quotes||['"',"'","`"];!0===l.brackets?o={"<":">","(":")","[":"]","{":"}"}:l.brackets&&(o=l.brackets);var c=[],u=[],d=[""],h=l.sep,f=e.length,p=-1;function m(){if(o&&u.length)return o[u[u.length-1]]}for(;++p<f;){var g,v,y=e[p],b=e[p+1],w={val:y,idx:p,arr:d,str:e};if(c.push(w),"\\"===y){w.val=!0===(g=p,"function"==typeof l.keepEscaping?l.keepEscaping(e,g):!0===l.keepEscaping||"\\"===e[g+1])?y+b:b,w.escaped=!0,"function"==typeof n&&n(w),d[d.length-1]+=w.val,p++;continue}if(o&&o[y]){u.push(y);var E=m(),x=p+1;if(-1!==e.indexOf(E,x+1))for(;u.length&&x<f;){var S=e[++x];if("\\"===S){S++;continue}if(-1!==s.indexOf(S)){x=i(e,S,x+1);continue}if(E=m(),u.length&&-1===e.indexOf(E,x+1))break;if(o[S]){u.push(S);continue}E===S&&u.pop()}if(-1===(a=x)){d[d.length-1]+=y;continue}y=e.slice(p,a+1),w.val=y,w.idx=p=a}if(-1!==s.indexOf(y)){if(-1===(a=i(e,y,p+1))){d[d.length-1]+=y;continue}y=!0===(v=y,!0===l.keepDoubleQuotes&&'"'===v||!0===l.keepSingleQuotes&&"'"===v||l.keepQuotes)?e.slice(p,a+1):e.slice(p+1,a),w.val=y,w.idx=p=a}if("function"==typeof n&&(n(w,c),y=w.val,p=w.idx),w.val===h&&!1!==w.split){d.push("");continue}d[d.length-1]+=w.val}return d}},47850:function(e,t,n){"use strict";var r=n(17710),i=n(22874);function o(e){return e&&"object"==typeof e||r(e)}e.exports=Object.assign||function(e){if(null==e)throw TypeError("Cannot convert undefined or null to object");o(e)||(e={});for(var t=1;t<arguments.length;t++){var n,r=arguments[t];(n=r)&&"string"==typeof n&&(r=function(e){var t={};for(var n in e)t[n]=e[n];return t}(r)),o(r)&&(function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}(e,r),i(e,r))}return e}},50078:function(e,t,n){"use strict";n.d(t,{I:function(){return Q}});var r=n(78813),i={},o=Uint8Array,a=Uint16Array,l=Int32Array,s=new o([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c=new o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(e,t){for(var n=new a(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},h=d(s,2),f=h.b,p=h.r;f[28]=258,p[258]=28;for(var m=d(c,0),g=m.b,v=m.r,y=new a(32768),b=0;b<32768;++b){var w=(43690&b)>>1|(21845&b)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,y[b]=((65280&w)>>8|(255&w)<<8)>>1}for(var E=function(e,t,n){for(var r,i=e.length,o=0,l=new a(t);o<i;++o)e[o]&&++l[e[o]-1];var s=new a(t);for(o=1;o<t;++o)s[o]=s[o-1]+l[o-1]<<1;if(n){r=new a(1<<t);var c=15-t;for(o=0;o<i;++o)if(e[o])for(var u=o<<4|e[o],d=t-e[o],h=s[e[o]-1]++<<d,f=h|(1<<d)-1;h<=f;++h)r[y[h]>>c]=u}else for(o=0,r=new a(i);o<i;++o)e[o]&&(r[o]=y[s[e[o]-1]++]>>15-e[o]);return r},x=new o(288),b=0;b<144;++b)x[b]=8;for(var b=144;b<256;++b)x[b]=9;for(var b=256;b<280;++b)x[b]=7;for(var b=280;b<288;++b)x[b]=8;for(var S=new o(32),b=0;b<32;++b)S[b]=5;var k=E(x,9,1),C=E(S,5,1),O=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},R=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},P=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},M=function(e){return(e+7)/8|0},$=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new o(e.subarray(t,n))}
1,_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(e,t,n){var r=Error(t||_[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,T),!n)throw r;return r},j=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new o(0);var l=!n,d=l||2!=t.i,h=t.i;l&&(n=new o(3*i));var p=function(e){var t=n.length;if(e>t){var r=new o(Math.max(2*t,e));r.set(n),n=r}},m=t.f||0,v=t.p||0,y=t.b||0,b=t.l,w=t.d,x=t.m,S=t.n,_=8*i;do{if(!b){m=R(e,v,1);var j=R(e,v+1,3);if(v+=3,j){if(1==j)b=k,w=C,x=9,S=5;else if(2==j){var A=R(e,v,31)+257,I=R(e,v+10,15)+4,D=A+R(e,v+5,31)+1;v+=14;for(var L=new o(D),N=new o(19),z=0;z<I;++z)N[u[z]]=R(e,v+3*z,7);v+=3*I;for(var V=O(N),B=(1<<V)-1,F=E(N,V,1),z=0;z<D;){var U=F[R(e,v,B)];v+=15&U;var W=U>>4;if(W<16)L[z++]=W;else{var H=0,Y=0;for(16==W?(Y=3+R(e,v,3),v+=2,H=L[z-1]):17==W?(Y=3+R(e,v,7),v+=3):18==W&&(Y=11+R(e,v,127),v+=7);Y--;)L[z++]=H}}var Q=L.subarray(0,A),X=L.subarray(A);x=O(Q),S=O(X),b=E(Q,x,1),w=E(X,S,1)}else T(1)}else{var W=M(v)+4,G=e[W-4]|e[W-3]<<8,Z=W+G;if(Z>i){h&&T(0);break}d&&p(y+G),n.set(e.subarray(W,Z),y),t.b=y+=G,t.p=v=8*Z,t.f=m;continue}if(v>_){h&&T(0);break}}d&&p(y+131072);for(var K=(1<<x)-1,q=(1<<S)-1,J=v;;J=v){var H=b[P(e,v)&K],ee=H>>4;if((v+=15&H)>_){h&&T(0);break}if(H||T(2),ee<256)n[y++]=ee;else if(256==ee){J=v,b=null;break}else{var et=ee-254;if(ee>264){var z=ee-257,en=s[z];et=R(e,v,(1<<en)-1)+f[z],v+=en}var er=w[P(e,v)&q],ei=er>>4;er||T(3),v+=15&er;var X=g[ei];if(ei>3){var en=c[ei];X+=P(e,v)&(1<<en)-1,v+=en}if(v>_){h&&T(0);break}d&&p(y+131072);var eo=y+et;if(y<X){var ea=a-X,el=Math.min(X,eo);for(ea+y<0&&T(3);y<el;++y)n[y]=r[ea+y]}for(;y<eo;++y)n[y]=n[y-X]}}t.l=b,t.p=J,t.b=y,t.f=m,b&&(m=1,t.m=x,t.d=w,t.n=S)}while(!m);return y!=n.length&&l?$(n,0,y):n.subarray(0,y)},A=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},I=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},D=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,l=n.slice();if(!i)return{t:U,l:0};if(1==i){var s=new o(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var c=n[0],u=n[1],d=0,h=1,f=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};h!=i-1;)c=n[n[d].f<n[f].f?d++:f++],u=n[d!=h&&n[d].f<n[f].f?d++:f++],n[h++]={s:-1,f:c.f+u.f,l:c,r:u};for(var p=l[0].s,r=1;r<i;++r)l[r].s>p&&(p=l[r].s);var m=new a(p+1),g=L(n[h-1],m,0);if(g>t){var r=0,v=0,y=g-t,b=1<<y;for(l.sort(function(e,t){return m[t.s]-m[e.s]||e.f-t.f});r<i;++r){var w=l[r].s;if(m[w]>t)v+=b-(1<<g-m[w]),m[w]=t;else break}for(v>>=y;v>0;){var E=l[r].s;m[E]<t?v-=1<<t-m[E]++-1:++r}for(;r>=0&&v;--r){var x=l[r].s;m[x]==t&&(--m[x],++v)}g=t}return{t:new o(m),l:g}},L=function(e,t,n){return -1==e.s?Math.max(L(e.l,t,n+1),L(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new a(++t),r=0,i=e[0],o=1,l=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(i),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(i);o=1,i=e[s]}return{c:n.subarray(0,r),n:t}},z=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},V=function(e,t,n){var r=n.length,i=M(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},B=function(e,t,n,r,i,o,l,d,h,f,p){A(t,p++,n),++i[256];for(var m,g,v,y,b=D(i,15),w=b.t,k=b.l,C=D(o,15),O=C.t,R=C.l,P=N(w),M=P.c,$=P.n,_=N(O),T=_.c,j=_.n,L=new a(19),B=0;B<M.length;++B)++L[31&M[B]];for(var B=0;B<T.length;++B)++L[31&T[B]];for(var F=D(L,7),U=F.t,W=F.l,H=19;H>4&&!U[u[H-1]];--H);var Y=f+5<<3,Q=z(i,x)+z(o,S)+l,X=z(i,w)+z(o,O)+l+14+3*H+z(L,U)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Y<=Q&&Y<=X)return V(t,p,e.subarray(h,h+f));if(A(t,p,1+(X<Q)),p+=2,X<Q){m=E(w,k,0),g=w,v=E(O,R,0),y=O;var G=E(U,W,0);A(t,p,$-257),A(t,p+5,j-1),A(t,p+10,H-4),p+=14;for(var B=0;B<H;++B)A(t,p+3*B,U[u[B]]);p+=3*H;for(var Z=[M,T],K=0;K<2;++K)for(var q=Z[K],B=0;B<q.length;++B){var J=31&q[B];A(t,p,G[J]),p+=U[J],J>15&&(A(t,p,q[B]>>5&127),p+=q[B]>>12)}}else m=null,g=x,v=null,y=S;for(var B=0;B<d;++B){var ee=r[B];if(ee>255){var J=ee>>18&31;I(t,p,m[J+257]),p+=g[J+257],J>7&&(A(t,p,ee>>23&31),p+=s[J]);var et=31ⅇI(t,p,v[et]),p+=y[et],et>3&&(I(t,p,ee>>5&8191),p+=c[et])}else I(t,p,m[ee]),p+=g[ee]}return I(t,p,m[256]),p+g[256]},F=new l([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),U=new o(0),W=function(e,t,n,r,i,u){var d=u.z||e.length,h=new o(r+d+5*(1+Math.ceil(d/7e3))+i),f=h.subarray(r,h.length-i),m=u.l,g=7&(u.r||0
1);if(t){g&&(f[0]=u.r>>3);for(var y=F[t-1],b=y>>13,w=8191&y,E=(1<<n)-1,x=u.p||new a(32768),S=u.h||new a(E+1),k=Math.ceil(n/3),C=2*k,O=function(t){return(e[t]^e[t+1]<<k^e[t+2]<<C)&E},R=new l(25e3),P=new a(288),_=new a(32),T=0,j=0,A=u.i||0,I=0,D=u.w||0,L=0;A+2<d;++A){var N=O(A),z=32767&A,U=S[N];if(x[z]=U,S[N]=z,D<=A){var W=d-A;if((T>7e3||I>24576)&&(W>423||!m)){g=B(e,f,0,R,P,_,j,I,L,A-L,g),I=T=j=0,L=A;for(var H=0;H<286;++H)P[H]=0;for(var H=0;H<30;++H)_[H]=0}var Y=2,Q=0,X=w,G=z-U&32767;if(W>2&&N==O(A-G))for(var Z=Math.min(b,W)-1,K=Math.min(32767,A),q=Math.min(258,W);G<=K&&--X&&z!=U;){if(e[A+Y]==e[A+Y-G]){for(var J=0;J<q&&e[A+J]==e[A+J-G];++J);if(J>Y){if(Y=J,Q=G,J>Z)break;for(var ee=Math.min(G,J-2),et=0,H=0;H<ee;++H){var en=A-G+H&32767,er=x[en],ei=en-er&32767;ei>et&&(et=ei,U=en)}}}U=x[z=U],G+=z-U&32767}if(Q){R[I++]=268435456|p[Y]<<18|v[Q];var eo=31&p[Y],ea=31&v[Q];j+=s[eo]+c[ea],++P[257+eo],++_[ea],D=A+Y,++T}else R[I++]=e[A],++P[e[A]]}}for(A=Math.max(A,D);A<d;++A)R[I++]=e[A],++P[e[A]];g=B(e,f,m,R,P,_,j,I,L,A-L,g),m||(u.r=7&g|f[g/8|0]<<3,g-=7,u.h=S,u.p=x,u.i=A,u.w=D)}else{for(var A=u.w||0;A<d+m;A+=65535){var el=A+65535;el>=d&&(f[g/8|0]=m,el=d),g=V(f,g+1,e.subarray(A,el))}u.i=d}return $(h,0,r+M(g)+i)};function H(e,t){var n;return j(e.subarray((n=t&&t.dictionary,((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&T(6,"invalid zlib data"),(e[1]>>5&1)==+!n&&T(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2),-4),{i:2},t&&t.out,t&&t.dictionary)}var Y="undefined"!=typeof TextDecoder&&new TextDecoder;try{Y.decode(U,{stream:!0})}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;class Q extends r.DataTextureLoader{parse(e){let t={l:0,c:0,lc:0};function n(e,n,r,i,o){for(;r<e;)n=n<<8|O(i,o),r+=8;r-=e,t.l=n>>r&(1<<e)-1,t.c=n,t.lc=r}let i=Array(59),o={c:0,lc:0};function a(e,t,n,r){e=e<<8|O(n,r),t+=8,o.c=e,o.lc=t}let l={c:0,lc:0};function s(e,t,n,r,i,s,c,u,d){if(e==t){r<8&&(a(n,r,i,s),n=o.c,r=o.lc);let e=n>>(r-=8);if(e=new Uint8Array([e])[0],u.value+e>d)return!1;let t=c[u.value-1];for(;e-- >0;)c[u.value++]=t}else{if(!(u.value<d))return!1;c[u.value++]=e}l.c=n,l.lc=r}function c(e){let t=65535&e;return t>32767?t-65536:t}let u={a:0,b:0};function d(e,t){let n=c(e),r=c(t),i=n+(1&r)+(r>>1),o=i-r;u.a=i,u.b=o}function h(e,t){let n=65535&t,r=(65535&e)-(n>>1)&65535;u.a=n+r-32768&65535,u.b=r}function f(e,r,c,u,d,h){let f=c.value,p=C(r,c),m=C(r,c);c.value+=4;let g=C(r,c);if(c.value+=4,p<0||p>=65537||m<0||m>=65537)throw Error("Something wrong with HUF_ENCSIZE");let v=Array(65537),y=Array(16384);!function(e){for(let t=0;t<16384;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(y);let b=u-(c.value-f);if(!function(e,r,o,a,l,s){let c=0,u=0;for(;a<=l;a++){if(r.value-r.value>o)return!1;n(6,c,u,e,r);let i=t.l;if(c=t.c,u=t.lc,s[a]=i,63==i){if(r.value-r.value>o)throw Error("Something wrong with hufUnpackEncTable");n(8,c,u,e,r);let i=t.l+6;if(c=t.c,u=t.lc,a+i>l+1)throw Error("Something wrong with hufUnpackEncTable");for(;i--;)s[a++]=0;a--}else if(i>=59){let e=i-59+2;if(a+e>l+1)throw Error("Something wrong with hufUnpackEncTable");for(;e--;)s[a++]=0;a--}}!function(e){for(let e=0;e<=58;++e)i[e]=0;for(let t=0;t<65537;++t)i[e[t]]+=1;let t=0;for(let e=58;e>0;--e){let n=t+i[e]>>1;i[e]=t,t=n}for(let t=0;t<65537;++t){let n=e[t];n>0&&(e[t]=n|i[n]++<<6)}}(s)}(e,c,b,p,m,v),g>8*(u-(c.value-f)))throw Error("Something wrong with hufUncompress");!function(e,t,n,r){for(;t<=n;t++){let n=e[t]>>6,i=63&e[t];if(n>>i)throw Error("Invalid table entry");if(i>14){let e=r[n>>i-14];if(e.len)throw Error("Invalid table entry");if(e.lit++,e.p){let t=e.p;e.p=Array(e.lit);for(let n=0;n<e.lit-1;++n)e.p[n]=t[n]}else e.p=[,];e.p[e.lit-1]=t}else if(i){let e=0;for(let o=1<<14-i;o>0;o--){let o=r[(n<<14-i)+e];if(o.len||o.p)throw Error("Invalid table entry");o.len=i,o.lit=t,e++}}}}(v,p,m,y),function(e,t,n,r,i,c,u,d,h){let f=0,p=0,m=Math.trunc(r.value+(i+7)/8);for(;r.value<m;)for(a(f,p,n,r),f=o.c,p=o.lc;p>=14;){let i=t[f>>p-14&16383];if(i.len)p-=i.len,s(i.lit,c,f,p,n,r,d,h,u),f=l.c,p=l.lc;else{let t;if(!i.p)throw Error("hufDecode issues");for(t=0;t<i.lit;t++){let g=63&e[i.p[t]];for(;p<g&&r.value<m;)a(f,p,n,r),f=o.c,p=o.lc;if(p>=g&&e[i.p[t]]>>6==(f>>p-g&(1<<g)-1)){p-=g,s(i.p[t],c,f,p,n,r,d,h,u),f=l.c,p=l.lc;break}}if(t==i.lit)throw Error("hufDecode issues")}}let g=8-i&7;for(f>>=g,p-=g;p>0;){let e=t[f<<14-p&16383];if(e.len)p-=e.len,s(e.lit,c,f,p,n,r,d,h,u),f=l.c,p=l.lc;else throw Error("hufDecode issues")}}(v,y,e,c,g,m,h,d,{value:0})}function p(e){for(let t=1;t<e.length;t++){let n=e[t-1]+e[t]-128;e[t]=n}}function m(e,t){let n=0,r=Math.floor((e.length+1)/2),i=0,o=e.length-1;for(;!(i>o)&&(t[i++]=e[n++],!(i>o));)t[i++]=e[r++]}function g(e){let t=e.byteLength,n=[],r=0,i=new DataView(e);for(;t>0;){let e=i.getInt8(r++);if(e<0){let o=-e;t-=o+1;for(let e=0;e<o;e++)n.push(i.getUint8(r++))}else{t-=2;let o=i.getUint8(r++);for(let t=0;t<e+1;t++)n.push(o)}}return n}function v(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function y(e){let t=new Uint8Array(g(e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size))),n=new Uint8Array(t.length);return p(t),m(t,n),new DataView(n.buffer)}function b(e){let t=H(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return p(t),m(t,n),new DataView(n.buffer)}function w(e){let t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.columns*e.lines*(e.inputChannels.length*e.type)),i=new Uint8Array(8192),o=0,a=Array(e.inputChannels.length);for(let t=0,n=e.inputChannels.length;t<n;t++)a[t]={},a[t].start=o,a[t].end=a[t].start,a[t].nx=e.columns,a[t].ny=e.lines,a[t].size=e.type,o+=a[t].nx*a[t].ny*a[t].size;let l=T(t,n),s=T(t,n);if(s>=8192)throw Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(l<=s)for(let e=0;e<s-l+1;e++)i[e+l]=R(t,n);let c=new Uint16Array(65536),p=function(e,t){let n=0;for(let r=0;r<65536;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);let r=n-1;for(;n<65536;)t[n++]=0;return r}(i,c),m=C(t,n);f(e.array,t,n,m,r,o);for(let t=0;t<e.inputChannels.length;++t){let e=a[t];for(let n=0;n<a[t].size;++n)!function(e,t,n,r,i,o,a){let l,s;let c=a<16384,f=n>i?i:n,p=1;for(;p<=f;)p<<=1;for(p>>=1,l=p,p>>=1;p>=1;){let a,f,m,g;let v=(s=0)+o*(i-l),y=o*p,b=o*l,w=r*p,E=r*l;for(;s<=v;s+=b){let i=s,o=s+r*(n-l);for(;i<=o;i+=E){let n=i+w,r=i+y,o=r+w;c?(d(e[i+t],e[r+t]),a=u.a,m=u.b,d(e[n+t],e[o+t]),f=u.a,g=u.b,d(a,f),e[i+t]=u.a,e[n+t]=u.b,d(m,g)):(h(e[i+t],e[r+t]),a=u.a,m=u.b,h(e[n+t],e[o+t]),f=u.a,g=u.b,h(a,f),e[i+t]=u.a,e[n+t]=u.b,h(m,g)),e[r+t]=u.a,e[o+t]=u.b}if(n&p){let n=i+y;c?d(e[i+t],e[n+t]):h(e[i+t],e[n+t]),a=u.a,e[n+t]=u.b,e[i+t]=a}}if(i&p){let i=s,o=s+r*(n-l);for(;i<=o;i+=E){let n=i+w;c?d(e[i+t],e[n+t]):h(e[i+t],e[n+t]),a=u.a,e[n+t]=u.b,e[i+t]=a}}l=p,p>>=1}}
1(r,e.start+n,e.nx,e.size,e.ny,e.nx*e.size,p)}!function(e,t,n){for(let r=0;r<n;++r)t[r]=e[t[r]]}(c,r,o);let g=0,v=new Uint8Array(r.buffer.byteLength);for(let t=0;t<e.lines;t++)for(let t=0;t<e.inputChannels.length;t++){let e=a[t],n=e.nx*e.size,i=new Uint8Array(r.buffer,2*e.end,2*n);v.set(i,g),g+=2*n,e.end+=n}return new DataView(v.buffer)}function E(e){let t=H(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new DataView(new ArrayBuffer(e.inputChannels.length*e.lines*e.columns*e.totalBytes)),r=0,i=0,o=[,,,,];for(let a=0;a<e.lines;a++)for(let a=0;a<e.inputChannels.length;a++){let l=0;switch(e.inputChannels[a].pixelType){case 1:o[0]=r,o[1]=o[0]+e.columns,r=o[1]+e.columns;for(let r=0;r<e.columns;++r)l+=t[o[0]++]<<8|t[o[1]++],n.setUint16(i,l,!0),i+=2;break;case 2:o[0]=r,o[1]=o[0]+e.columns,o[2]=o[1]+e.columns,r=o[2]+e.columns;for(let r=0;r<e.columns;++r)l+=t[o[0]++]<<24|t[o[1]++]<<16|t[o[2]++]<<8,n.setUint32(i,l,!0),i+=4}}return n}function x(e){let t,n,i;let o=e.viewer,a={value:e.offset.value},l=new Uint8Array(e.columns*e.lines*(e.inputChannels.length*e.type*2)),s={version:P(o,a),unknownUncompressedSize:P(o,a),unknownCompressedSize:P(o,a),acCompressedSize:P(o,a),dcCompressedSize:P(o,a),rleCompressedSize:P(o,a),rleUncompressedSize:P(o,a),rleRawSize:P(o,a),totalAcUncompressedCount:P(o,a),totalDcUncompressedCount:P(o,a),acCompression:P(o,a)};if(s.version<2)throw Error("EXRLoader.parse: "+V.compression+" version "+s.version+" is unsupported");let c=[],u=T(o,a)-2;for(;u>0;){let e=S(o.buffer,a),t=R(o,a),n=t>>2&3,r=new Int8Array([(t>>4)-1])[0],i=R(o,a);c.push({name:e,index:r,type:i,compression:n}),u-=e.length+3}let d=V.channels,h=Array(e.inputChannels.length);for(let t=0;t<e.inputChannels.length;++t){let n=h[t]={},r=d[t];n.name=r.name,n.compression=0,n.decoded=!1,n.type=r.pixelType,n.pLinear=r.pLinear,n.width=e.columns,n.height=e.lines}let p={idx:[,,,]};for(let t=0;t<e.inputChannels.length;++t){let e=h[t];for(let n=0;n<c.length;++n){let r=c[n];e.name==r.name&&(e.compression=r.compression,r.index>=0&&(p.idx[r.index]=t),e.offset=t)}}if(s.acCompressedSize>0)switch(s.acCompression){case 0:t=new Uint16Array(s.totalAcUncompressedCount),f(e.array,o,a,s.acCompressedSize,t,s.totalAcUncompressedCount);break;case 1:t=new Uint16Array(H(e.array.slice(a.value,a.value+s.totalAcUncompressedCount)).buffer),a.value+=s.totalAcUncompressedCount}s.dcCompressedSize>0&&(n=new Uint16Array(b({array:e.array,offset:a,size:s.dcCompressedSize}).buffer),a.value+=s.dcCompressedSize),s.rleRawSize>0&&(i=g(H(e.array.slice(a.value,a.value+s.rleCompressedSize)).buffer),a.value+=s.rleCompressedSize);let m=0,v=Array(h.length);for(let e=0;e<v.length;++e)v[e]=[];for(let t=0;t<e.lines;++t)for(let t=0;t<h.length;++t)v[t].push(m),m+=h[t].width*e.type*2;!function(e,t,n,i,o,a){let l=new DataView(a.buffer),s=n[e.idx[0]].width,c=n[e.idx[0]].height,u=Math.floor(s/8),d=Math.ceil(s/8),h=Math.ceil(c/8),f=s-(d-1)*8,p=c-(h-1)*8,m={value:0},g=[,,,],v=[,,,],y=[,,,],b=[,,,],w=[,,,];for(let n=0;n<3;++n)w[n]=t[e.idx[n]],g[n]=n<1?0:g[n-1]+d*h,v[n]=new Float32Array(64),y[n]=new Uint16Array(64),b[n]=new Uint16Array(64*d);for(let t=0;t<h;++t){let a=8;t==h-1&&(a=p);let s=8;for(let e=0;e<d;++e){e==d-1&&(s=f);for(let e=0;e<3;++e){var E,x;y[e].fill(0),y[e][0]=o[g[e]++],function(e,t,n){let r;let i=1;for(;i<64;)65280==(r=t[e.value])?i=64:r>>8==255?i+=255&r:(n[i]=r,i++),e.value++}(m,i,y[e]),E=y[e],(x=v[e])[0]=_(E[0]),x[1]=_(E[1]),x[2]=_(E[5]),x[3]=_(E[6]),x[4]=_(E[14]),x[5]=_(E[15]),x[6]=_(E[27]),x[7]=_(E[28]),x[8]=_(E[2]),x[9]=_(E[4]),x[10]=_(E[7]),x[11]=_(E[13]),x[12]=_(E[16]),x[13]=_(E[26]),x[14]=_(E[29]),x[15]=_(E[42]),x[16]=_(E[3]),x[17]=_(E[8]),x[18]=_(E[12]),x[19]=_(E[17]),x[20]=_(E[25]),x[21]=_(E[30]),x[22]=_(E[41]),x[23]=_(E[43]),x[24]=_(E[9]),x[25]=_(E[11]),x[26]=_(E[18]),x[27]=_(E[24]),x[28]=_(E[31]),x[29]=_(E[40]),x[30]=_(E[44]),x[31]=_(E[53]),x[32]=_(E[10]),x[33]=_(E[19]),x[34]=_(E[23]),x[35]=_(E[32]),x[36]=_(E[39]),x[37]=_(E[45]),x[38]=_(E[52]),x[39]=_(E[54]),x[40]=_(E[20]),x[41]=_(E[22]),x[42]=_(E[33]),x[43]=_(E[38]),x[44]=_(E[46]),x[45]=_(E[51]),x[46]=_(E[55]),x[47]=_(E[60]),x[48]=_(E[21]),x[49]=_(E[34]),x[50]=_(E[37]),x[51]=_(E[47]),x[52]=_(E[50]),x[53]=_(E[56]
1),x[54]=_(E[59]),x[55]=_(E[61]),x[56]=_(E[35]),x[57]=_(E[36]),x[58]=_(E[48]),x[59]=_(E[49]),x[60]=_(E[57]),x[61]=_(E[58]),x[62]=_(E[62]),x[63]=_(E[63]),function(e){let t=.5*Math.cos(3*3.14159/16),n=.5*Math.cos(3*3.14159/8),r=[,,,,],i=[,,,,],o=[,,,,],a=[,,,,];for(let l=0;l<8;++l){let s=8*l;r[0]=.4619398297234211*e[s+2],r[1]=n*e[s+2],r[2]=.4619398297234211*e[s+6],r[3]=n*e[s+6],i[0]=.4903926563794112*e[s+1]+t*e[s+3]+.2777854612564676*e[s+5]+.09754573032714427*e[s+7],i[1]=t*e[s+1]-.09754573032714427*e[s+3]-.4903926563794112*e[s+5]-.2777854612564676*e[s+7],i[2]=.2777854612564676*e[s+1]-.4903926563794112*e[s+3]+.09754573032714427*e[s+5]+t*e[s+7],i[3]=.09754573032714427*e[s+1]-.2777854612564676*e[s+3]+t*e[s+5]-.4903926563794112*e[s+7],o[0]=.35355362513961314*(e[s+0]+e[s+4]),o[3]=.35355362513961314*(e[s+0]-e[s+4]),o[1]=r[0]+r[3],o[2]=r[1]-r[2],a[0]=o[0]+o[1],a[1]=o[3]+o[2],a[2]=o[3]-o[2],a[3]=o[0]-o[1],e[s+0]=a[0]+i[0],e[s+1]=a[1]+i[1],e[s+2]=a[2]+i[2],e[s+3]=a[3]+i[3],e[s+4]=a[3]-i[3],e[s+5]=a[2]-i[2],e[s+6]=a[1]-i[1],e[s+7]=a[0]-i[0]}for(let l=0;l<8;++l)r[0]=.4619398297234211*e[16+l],r[1]=n*e[16+l],r[2]=.4619398297234211*e[48+l],r[3]=n*e[48+l],i[0]=.4903926563794112*e[8+l]+t*e[24+l]+.2777854612564676*e[40+l]+.09754573032714427*e[56+l],i[1]=t*e[8+l]-.09754573032714427*e[24+l]-.4903926563794112*e[40+l]-.2777854612564676*e[56+l],i[2]=.2777854612564676*e[8+l]-.4903926563794112*e[24+l]+.09754573032714427*e[40+l]+t*e[56+l],i[3]=.09754573032714427*e[8+l]-.2777854612564676*e[24+l]+t*e[40+l]-.4903926563794112*e[56+l],o[0]=.35355362513961314*(e[l]+e[32+l]),o[3]=.35355362513961314*(e[l]-e[32+l]),o[1]=r[0]+r[3],o[2]=r[1]-r[2],a[0]=o[0]+o[1],a[1]=o[3]+o[2],a[2]=o[3]-o[2],a[3]=o[0]-o[1],e[0+l]=a[0]+i[0],e[8+l]=a[1]+i[1],e[16+l]=a[2]+i[2],e[24+l]=a[3]+i[3],e[32+l]=a[3]-i[3],e[40+l]=a[2]-i[2],e[48+l]=a[1]-i[1],e[56+l]=a[0]-i[0]}(v[e])}!function(e){for(let t=0;t<64;++t){let n=e[0][t],r=e[1][t],i=e[2][t];e[0][t]=n+1.5747*i,e[1][t]=n-.1873*r-.4682*i,e[2][t]=n+1.8556*r}}(v);for(let t=0;t<3;++t)!function(e,t,n){for(let o=0;o<64;++o){var i;t[n+o]=r.DataUtils.toHalfFloat((i=e[o])<=1?Math.sign(i)*Math.pow(Math.abs(i),2.2):Math.sign(i)*Math.pow(9.025013291561939,Math.abs(i)-1))}}(v[t],b[t],64*e)}let c=0;for(let r=0;r<3;++r){let i=n[e.idx[r]].type;for(let e=8*t;e<8*t+a;++e){c=w[r][e];for(let t=0;t<u;++t){let n=64*t+(7&e)*8;l.setUint16(c+0*i,b[r][n+0],!0),l.setUint16(c+2*i,b[r][n+1],!0),l.setUint16(c+4*i,b[r][n+2],!0),l.setUint16(c+6*i,b[r][n+3],!0),l.setUint16(c+8*i,b[r][n+4],!0),l.setUint16(c+10*i,b[r][n+5],!0),l.setUint16(c+12*i,b[r][n+6],!0),l.setUint16(c+14*i,b[r][n+7],!0),c+=16*i}}if(u!=d)for(let e=8*t;e<8*t+a;++e){let t=w[r][e]+8*u*2*i,n=64*u+(7&e)*8;for(let e=0;e<s;++e)l.setUint16(t+2*e*i,b[r][n+e],!0)}}}let S=new Uint16Array(s);l=new DataView(a.buffer);for(let t=0;t<3;++t){n[e.idx[t]].decoded=!0;let r=n[e.idx[t]].type;if(2==n[t].type)for(let e=0;e<c;++e){let n=w[t][e];for(let e=0;e<s;++e)S[e]=l.getUint16(n+2*e*r,!0);for(let e=0;e<s;++e)l.setFloat32(n+2*e*r,_(S[e]),!0)}}}(p,v,h,t,n,l);for(let t=0;t<h.length;++t){let n=h[t];if(!n.decoded){if(2===n.compression){let r=0,o=0;for(let a=0;a<e.lines;++a){let e=v[t][r];for(let t=0;t<n.width;++t){for(let t=0;t<2*n.type;++t)l[e++]=i[o+t*n.width*n.height];o++}r++}}else throw Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(l.buffer)}function S(e,t){let n=new Uint8Array(e),r=0;for(;0!=n[t.value+r];)r+=1;let i=new TextDecoder().decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,i}function k(e,t){let n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function C(e,t){let n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function O(e,t){let n=e[t.value];return t.value=t.value+1,n}function R(e,t){let n=e.getUint8(t.value);return t.value=t.value+1,n}let P=function(e,t){let n;return"getBigInt64"in DataView.prototype?n=Number(e.getBigInt64(t.value,!0)):n=e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function M(e,t){let n=e.getFloat32(t.value,!0);return t.value+=4,n}function $(e,t){return r.DataUtils.toHalfFloat(M(e,t))}function _(e){let t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function T(e,t){let n=e.getUint16(t.value,!0);return t.value+=2,n}function j(e,t){return _(T(e,t))}function A(e,t,n,r){let i=Array(e);for(let o=0;o<e;o++){let e=1<<o,a=t/e|0;"ROUND_UP"==r&&a*e<t&&(a+=1);let l=Math.max(a,1);i[o]=(l+n-1)/n|0}return i}function I(){let e=this.offset,t={value:0};for(let n=0;n<this.tileCount;n++){let n=k(this.viewer,e),r=k(this.viewer,e);e.value+=8,this.size=C(this.viewer,e);let i=n*this.blockWidth,o=r*this.blockHeight;this.columns=i+this.blockWidth>this.width?this.width-i:this.blockWidth,this.lines=o+this.blockHeight>this.height?this.height-o:this.blockHeight;let a=this.columns*this.totalBytes,l=this.size<this.lines*a?this.uncompress(this):v(this);e.value+=this.size;
1for(let e=0;e<this.lines;e++){let n=e*this.columns*this.totalBytes;for(let r=0;r<this.inputChannels.length;r++){let a=V.channels[r].name,s=this.channelByteOffsets[a]*this.columns,c=this.decodeChannels[a];if(void 0===c)continue;t.value=n+s;let u=(this.height-(1+o+e))*this.outLineWidth;for(let e=0;e<this.columns;e++){let n=u+(e+i)*this.outputChannels+c;this.byteArray[n]=this.getter(l,t)}}}}}function D(){let e=this.offset,t={value:0};for(let n=0;n<this.height/this.blockHeight;n++){let r=k(this.viewer,e)-V.dataWindow.yMin;this.size=C(this.viewer,e),this.lines=r+this.blockHeight>this.height?this.height-r:this.blockHeight;let i=this.columns*this.totalBytes,o=this.size<this.lines*i?this.uncompress(this):v(this);e.value+=this.size;for(let e=0;e<this.blockHeight;e++){let r=n*this.blockHeight,a=e+this.scanOrder(r);if(a>=this.height)continue;let l=e*i,s=(this.height-1-a)*this.outLineWidth;for(let e=0;e<this.inputChannels.length;e++){let n=V.channels[e].name,r=this.channelByteOffsets[n]*this.columns,i=this.decodeChannels[n];if(void 0!==i){t.value=l+r;for(let e=0;e<this.columns;e++){let n=s+e*this.outputChannels+i;this.byteArray[n]=this.getter(o,t)}}}}}}let L={value:0},N=new DataView(e),z=new Uint8Array(e),V=function(e,t,n){let r={};if(20000630!=e.getUint32(0,!0))throw Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");r.version=e.getUint8(4);let i=e.getUint8(5);r.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},n.value=8;let o=!0;for(;o;){let i=S(t,n);if(0==i)o=!1;else{let o=S(t,n),a=C(e,n),l=function(e,t,n,r,i){if("string"===r||"stringvector"===r||"iccProfile"===r)return function(e,t,n){let r=new TextDecoder().decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(t,n,i);if("chlist"===r)return function(e,t,n,r){let i=n.value,o=[];for(;n.value<i+r-1;){let r=S(t,n),i=k(e,n),a=R(e,n);n.value+=3;let l=k(e,n),s=k(e,n);o.push({name:r,pixelType:i,pLinear:a,xSampling:l,ySampling:s})}return n.value+=1,o}(e,t,n,i);if("chromaticities"===r)return function(e,t){let n=M(e,t),r=M(e,t),i=M(e,t),o=M(e,t),a=M(e,t);return{redX:n,redY:r,greenX:i,greenY:o,blueX:a,blueY:M(e,t),whiteX:M(e,t),whiteY:M(e,t)}}(e,n);if("compression"===r)return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][R(e,n)];if("box2i"===r)return function(e,t){let n=k(e,t);return{xMin:n,yMin:k(e,t),xMax:k(e,t),yMax:k(e,t)}}(e,n);if("envmap"===r)return["ENVMAP_LATLONG","ENVMAP_CUBE"][R(e,n)];if("tiledesc"===r)return function(e,t){let n=C(e,t),r=C(e,t),i=R(e,t);return{xSize:n,ySize:r,levelMode:["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"][15&i],roundingMode:["ROUND_DOWN","ROUND_UP"][i>>4]}}(e,n);if("lineOrder"===r)return["INCREASING_Y","DECREASING_Y","RANDOM_Y"][R(e,n)];if("float"===r)return M(e,n);if("v2f"===r)return[M(e,n),M(e,n)];if("v3f"===r){var o,a;return[M(o=e,a=n),M(o,a),M(o,a)]}return"int"===r?k(e,n):"rational"===r?[k(e,n),C(e,n)]:"timecode"===r?[C(e,n),C(e,n)]:"preview"===r?(n.value+=i,"skipped"):void(n.value+=i)}(e,t,n,o,a);void 0===l?console.warn("THREE.EXRLoader: Skipped unknown header attribute type '".concat(o,"'.")):r[i]=l}}if((-7&i)!=0)throw console.error("THREE.EXRHeader:",r),Error("THREE.EXRLoader: Provided file is currently unsupported.");return r}(N,e,L),B=function(e,t,n,i,o){let a={size:0,viewer:t,array:n,offset:i,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,inputChannels:e.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:r.LinearSRGBColorSpace};switch(e.compression){case"NO_COMPRESSION":a.blockHeight=1,a.uncompress=v;break;case"RLE_COMPRESSION":a.blockHeight=1,a.uncompress=y;break;case"ZIPS_COMPRESSION":a.blockHeight=1,a.uncompress=b;break;case"ZIP_COMPRESSION":a.blockHeight=16,a.uncompress=b;break;case"PIZ_COMPRESSION":a.blockHeight=32,a.uncompress=w;break;case"PXR24_COMPRESSION":a.blockHeight=16,a.uncompress=E;break;case"DWAA_COMPRESSION":a.blockHeight=32,a.uncompress=x;break;case"DWAB_COMPRESSION":a.blockHeight=256,a.uncompress=x;break;default:throw Error("EXRLoader.parse: "+e.compression+" is unsupported")}let l={};for(let t of e.channels)switch(t.name){case"Y":case"R":case"G":case"B":case"A":l[t.name]=!0,a.type=t.pixelType}let s=!1;if(l.R&&l.G&&l.B)s=!l.A,a.outputChannels=4,a.decodeChannels={R:0,G:1,B:2,A:3};else if(l.Y)a.outputChannels=1,a.decodeChannels={Y:0};else throw Error("EXRLoader.parse: file contains unsupported data channels.");if(1==a.type)switch(o){case r.FloatType:a.getter=j;break;case r.HalfFloatType:a.getter=T}else if(2==a.type)switch(o){case r.FloatType:a.getter=M;break;case r.HalfFloatType:a.getter=$}else throw Error("EXRLoader.parse: unsupported pixelType "+a.type+" for "+e.compression+".");a.columns=a.width;let c=a.width*a.height*a.outputChannels;switch(o){case r.FloatType:a.byteArray=new Float32Array(c),s&&a.byteArray.fill(1,0,c);break;case r.HalfFloatType:a.byteArray=new Uint16Array(c),s&&a.byteArray.fill(15360,0,c);break;default:console.error("THREE.EXRLoader: unsupported type: ",o)}let u=0;for(let t of e.channels)void 0!==a.decodeChannels[t.name]&&(a.channelByteOffsets[t.name]=u),u+=2*t.pixelType;if(a.totalBytes=u,a.outLineWidth=a.width*a.outputChannels,"INCREASING_Y"===e.lineOrder?a.scanOrder=e=>e:a.scanOrder=e=>a.height-1-e,4==a.outputChannels?(a.format=r.RGBAFormat,a.colorSpace
1=r.LinearSRGBColorSpace):(a.format=r.RedFormat,a.colorSpace=r.NoColorSpace),e.spec.singleTile){a.blockHeight=e.tiles.ySize,a.blockWidth=e.tiles.xSize;let n=function(e,t,n){let r=0;switch(e.levelMode){case"ONE_LEVEL":r=1;break;case"MIPMAP_LEVELS":r=function(e,t){let n=Math.log2(e);return"ROUND_DOWN"==t?Math.floor(n):Math.ceil(n)}(Math.max(t,n),e.roundingMode)+1;break;case"RIPMAP_LEVELS":throw Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return r}(e.tiles,a.width,a.height),r=A(n,a.width,e.tiles.xSize,e.tiles.roundingMode),o=A(n,a.height,e.tiles.ySize,e.tiles.roundingMode);a.tileCount=r[0]*o[0];for(let e=0;e<n;e++)for(let n=0;n<o[e];n++)for(let n=0;n<r[e];n++)P(t,i);a.decode=I.bind(a)}else{a.blockWidth=a.width;let e=Math.ceil(a.height/a.blockHeight);for(let n=0;n<e;n++)P(t,i);a.decode=D.bind(a)}return a}(V,N,z,L,this.type);return B.decode(),{header:V,width:B.width,height:B.height,data:B.byteArray,format:B.format,colorSpace:B.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){return super.load(e,function(e,n){e.colorSpace=n.colorSpace,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)},n,i)}constructor(e){super(e),this.type=r.HalfFloatType}}},84405:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(78813);class i extends r.DataTextureLoader{parse(e){let t,n,i;let o=function(e,t){switch(e){case 1:throw Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw Error("THREE.RGBELoader: Memory Error: "+(t||""))}},a=function(e,t,n){t=t||1024;let r=e.pos,i=-1,o=0,a="",l=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=l.indexOf("\n"))&&o<t&&r<e.byteLength;)a+=l,o+=l.length,r+=128,l+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return -1<i&&(!1!==n&&(e.pos+=o+i+1),a+l.slice(0,i))},l=new Uint8Array(e);l.pos=0;let s=function(e){let t,n;let r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,l=/^\s*FORMAT=(\S+)\s*$/,s=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,c={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(t=a(e))||o(1,"no header found"),(n=t.match(/^#\?(\S+)/))||o(3,"bad initial token"),c.valid|=1,c.programtype=n[1],c.string+=t+"\n";!1!==(t=a(e));){if(c.string+=t+"\n","#"===t.charAt(0)){c.comments+=t+"\n";continue}if((n=t.match(r))&&(c.gamma=parseFloat(n[1])),(n=t.match(i))&&(c.exposure=parseFloat(n[1])),(n=t.match(l))&&(c.valid|=2,c.format=n[1]),(n=t.match(s))&&(c.valid|=4,c.height=parseInt(n[1],10),c.width=parseInt(n[2],10)),2&c.valid&&4&c.valid)break}return 2&c.valid||o(3,"missing format specifier"),4&c.valid||o(3,"missing image size specifier"),c}(l),c=s.width,u=s.height,d=function(e,t,n){if(t<8||t>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);t!==(e[2]<<8|e[3])&&o(3,"wrong scanline width");let r=new Uint8Array(4*t*n);r.length||o(4,"unable to allocate buffer space");let i=0,a=0,l=4*t,s=new Uint8Array(4),c=new Uint8Array(l),u=n;for(;u>0&&a<e.byteLength;){a+4>e.byteLength&&o(1),s[0]=e[a++],s[1]=e[a++],s[2]=e[a++],s[3]=e[a++],(2!=s[0]||2!=s[1]||(s[2]<<8|s[3])!=t)&&o(3,"bad rgbe scanline format");let n=0,d;for(;n<l&&a<e.byteLength;){let t=(d=e[a++])>128;if(t&&(d-=128),(0===d||n+d>l)&&o(3,"bad scanline data"),t){let t=e[a++];for(let e=0;e<d;e++)c[n++]=t}else c.set(e.subarray(a,a+d),n),n+=d,a+=d}for(let e=0;e<t;e++){let n=0;r[i]=c[e+n],n+=t,r[i+1]=c[e+n],n+=t,r[i+2]=c[e+n],n+=t,r[i+3]=c[e+n],i+=4}u--}return r}(l.subarray(l.pos),c,u);switch(this.type){case r.FloatType:let h=new Float32Array(4*(i=d.length/4));for(let e=0;e<i;e++)!function(e,t,n,r){let i=Math.pow(2,e[t+3]-128)/255;n[r+0]=e[t+0]*i,n[r+1]=e[t+1]*i,n[r+2]=e[t+2]*i,n[r+3]=1}(d,4*e,h,4*e);t=h,n=r.FloatType;break;case r.HalfFloatType:let f=new Uint16Array(4*(i=d.length/4));for(let e=0;e<i;e++)!function(e,t,n,i){let o=Math.pow(2,e[t+3]-128)/255;n[i+0]=r.DataUtils.toHalfFloat(Math.min(e[t+0]*o,65504)),n[i+1]=r.DataUtils.toHalfFloat(Math.min(e[t+1]*o,65504)),n[i+2]=r.DataUtils.toHalfFloat(Math.min(e[t+2]*o,65504)),n[i+3]=r.DataUtils.toHalfFloat(1)}(d,4*e,f,4*e);t=f,n=r.HalfFloatType;break;default:throw Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:c,height:u,data:t,header:s.string,gamma:s.gamma,exposure:s.exposure,type:n}}setDataType(e){return this.type=e,this}load(e,t,n,i){return super.load(e,function(e,n){switch(e.type){case r.FloatType:case r.HalfFloatType:e.colorSpace
1=r.LinearSRGBColorSpace,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)},n,i)}constructor(e){super(e),this.type=r.HalfFloatType}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.