@tresjs/leches 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Folder.vue.d.ts +14 -0
- package/dist/composables/useControls.d.ts +3 -2
- package/dist/style.css +2 -2
- package/dist/tresleches.js +401 -351
- package/dist/tresleches.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/tresleches.umd.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.2.0
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Tasty GUI for Vue controls 🍰
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
(function(z,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],n):(z=typeof globalThis<"u"?globalThis:z||self,n(z.tresleches={},z.Vue,z.VueUseCore))})(this,function(z,n,
|
|
8
|
+
(function(z,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],n):(z=typeof globalThis<"u"?globalThis:z||self,n(z.tresleches={},z.Vue,z.VueUseCore))})(this,function(z,n,b){"use strict";const Qt="",Zt="";function $(i){return n.getCurrentScope()?(n.onScopeDispose(i),!0):!1}function C(i){return typeof i=="function"?i():n.unref(i)}const T=typeof window<"u",I=()=>{},A=Y();function Y(){var i;return T&&((i=window==null?void 0:window.navigator)==null?void 0:i.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function O(...i){if(i.length!==1)return n.toRef(...i);const t=i[0];return typeof t=="function"?n.readonly(n.customRef(()=>({get:t,set:I}))):n.ref(t)}function H(i){var t;const e=C(i);return(t=e==null?void 0:e.$el)!=null?t:e}const Q=T?window:void 0;function Z(...i){let t,e,s,o;if(typeof i[0]=="string"||Array.isArray(i[0])?([e,s,o]=i,t=Q):[t,e,s,o]=i,!t)return I;Array.isArray(e)||(e=[e]),Array.isArray(s)||(s=[s]);const r=[],l=()=>{r.forEach(c=>c()),r.length=0},h=(c,a,d,u)=>(c.addEventListener(a,d,u),()=>c.removeEventListener(a,d,u)),x=n.watch(()=>[H(t),C(o)],([c,a])=>{l(),c&&r.push(...e.flatMap(d=>s.map(u=>h(c,d,u,a))))},{immediate:!0,flush:"post"}),y=()=>{x(),l()};return $(y),y}var W=Object.defineProperty,U=Object.defineProperties,K=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,q=(i,t,e)=>t in i?W(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,v=(i,t)=>{for(var e in t||(t={}))G.call(t,e)&&q(i,e,t[e]);if(D)for(var e of D(t))J.call(t,e)&&q(i,e,t[e]);return i},tt=(i,t)=>U(i,K(t));const et=n.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis"],setup(i,{slots:t}){const e=n.ref(),s=n.computed(()=>{var x;return(x=i.handle)!=null?x:e.value}),o=i.storageKey&&b.useStorage(i.storageKey,C(i.initialValue)||{x:0,y:0},b.isClient?i.storageType==="session"?sessionStorage:localStorage:void 0),r=o||i.initialValue||{x:0,y:0},l=x=>{o&&(o.value.x=x.x,o.value.y=x.y)},h=n.reactive(b.useDraggable(e,tt(v({},i),{handle:s,initialValue:r,onEnd:l})));return()=>{if(t.default)return n.h(i.as||"div",{ref:e,style:`touch-action:none;${h.style}`},t.default(h))}}});function j(i){const t=window.getComputedStyle(i);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&i.clientHeight<i.scrollHeight||t.overflowY==="auto"&&i.clientWidth<i.scrollWidth)return!0;{const e=i.parentNode;return!e||e.tagName==="BODY"?!1:j(e)}}function nt(i){const t=i||window.event,e=t.target;return j(e)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}function st(i,t=!1){const e=n.ref(t);let s=null,o;n.watch(O(i),h=>{if(h){const x=h;o=x.style.overflow,e.value&&(x.style.overflow="hidden")}},{immediate:!0});const r=()=>{const h=C(i);!h||e.value||(A&&(s=Z(h,"touchmove",x=>{nt(x)},{passive:!1})),h.style.overflow="hidden",e.value=!0)},l=()=>{const h=C(i);!h||!e.value||(A&&(s==null||s()),h.style.overflow=o,e.value=!1)};return $(l),n.computed({get(){return e.value},set(h){h?r():l()}})}function it(){let i=!1;const t=n.ref(!1);return(e,s)=>{if(t.value=s.value,i)return;i=!0;const o=st(e,s.value);n.watch(t,r=>o.value=r)}}it();const ot=Symbol("CONTROLS_CONTEXT_KEY"),E=n.reactive({controls:[]});function rt(){return E}function V(i){return Object.entries(i).map(([t,e])=>!n.isRef(e)&&e.value?{...e,label:e.label||t,value:e.value,type:typeof e.value.value,visible:!0}:{label:e.label||t,value:e,type:n.isRef(e)?typeof e.value:typeof e,visible:!0})}function lt(i,t){const e=n.inject(ot,{});let s=[];if(typeof i=="string")s.push({label:i,visible:!0,type:"folder",controls:V(t)});else if(n.isReactive(i)){const o=n.toRefs(i);s=V(o)}else s=V(i);return E.controls=[...E.controls,...s],e}/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2010-2023 Three.js Authors
|
|
11
11
|
* SPDX-License-Identifier: MIT
|
|
12
|
-
*/const P="152";function V(i,t,e){return Math.max(t,Math.min(e,i))}class k{constructor(t=0,e=0){k.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,o=t.elements;return this.x=o[0]*e+o[3]*s+o[6],this.y=o[1]*e+o[4]*s+o[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),o=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*s-a*o+t.x,this.y=r*o+a*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ht{constructor(t=0,e=0,s=0,o=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=o}static slerpFlat(t,e,s,o,r,a,l){let x=s[o+0],y=s[o+1],c=s[o+2],h=s[o+3];const d=r[a+0],u=r[a+1],_=r[a+2],f=r[a+3];if(l===0){t[e+0]=x,t[e+1]=y,t[e+2]=c,t[e+3]=h;return}if(l===1){t[e+0]=d,t[e+1]=u,t[e+2]=_,t[e+3]=f;return}if(h!==f||x!==d||y!==u||c!==_){let p=1-l;const m=x*d+y*u+c*_+h*f,g=m>=0?1:-1,X=1-m*m;if(X>Number.EPSILON){const M=Math.sqrt(X),F=Math.atan2(M,m*g);p=Math.sin(p*F)/M,l=Math.sin(l*F)/M}const S=l*g;if(x=x*p+d*S,y=y*p+u*S,c=c*p+_*S,h=h*p+f*S,p===1-l){const M=1/Math.sqrt(x*x+y*y+c*c+h*h);x*=M,y*=M,c*=M,h*=M}}t[e]=x,t[e+1]=y,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,s,o,r,a){const l=s[o],x=s[o+1],y=s[o+2],c=s[o+3],h=r[a],d=r[a+1],u=r[a+2],_=r[a+3];return t[e]=l*_+c*h+x*u-y*d,t[e+1]=x*_+c*d+y*h-l*u,t[e+2]=y*_+c*u+l*d-x*h,t[e+3]=c*_-l*h-x*d-y*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,o){return this._x=t,this._y=e,this._z=s,this._w=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const s=t._x,o=t._y,r=t._z,a=t._order,l=Math.cos,x=Math.sin,y=l(s/2),c=l(o/2),h=l(r/2),d=x(s/2),u=x(o/2),_=x(r/2);switch(a){case"XYZ":this._x=d*c*h+y*u*_,this._y=y*u*h-d*c*_,this._z=y*c*_+d*u*h,this._w=y*c*h-d*u*_;break;case"YXZ":this._x=d*c*h+y*u*_,this._y=y*u*h-d*c*_,this._z=y*c*_-d*u*h,this._w=y*c*h+d*u*_;break;case"ZXY":this._x=d*c*h-y*u*_,this._y=y*u*h+d*c*_,this._z=y*c*_+d*u*h,this._w=y*c*h-d*u*_;break;case"ZYX":this._x=d*c*h-y*u*_,this._y=y*u*h+d*c*_,this._z=y*c*_-d*u*h,this._w=y*c*h+d*u*_;break;case"YZX":this._x=d*c*h+y*u*_,this._y=y*u*h+d*c*_,this._z=y*c*_-d*u*h,this._w=y*c*h-d*u*_;break;case"XZY":this._x=d*c*h-y*u*_,this._y=y*u*h-d*c*_,this._z=y*c*_+d*u*h,this._w=y*c*h+d*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,o=Math.sin(s);return this._x=t.x*o,this._y=t.y*o,this._z=t.z*o,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],o=e[4],r=e[8],a=e[1],l=e[5],x=e[9],y=e[2],c=e[6],h=e[10],d=s+l+h;if(d>0){const u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(c-x)*u,this._y=(r-y)*u,this._z=(a-o)*u}else if(s>l&&s>h){const u=2*Math.sqrt(1+s-l-h);this._w=(c-x)/u,this._x=.25*u,this._y=(o+a)/u,this._z=(r+y)/u}else if(l>h){const u=2*Math.sqrt(1+l-s-h);this._w=(r-y)/u,this._x=(o+a)/u,this._y=.25*u,this._z=(x+c)/u}else{const u=2*Math.sqrt(1+h-s-l);this._w=(a-o)/u,this._x=(r+y)/u,this._y=(x+c)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(V(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const o=Math.min(1,e/s);return this.slerp(t,o),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,o=t._y,r=t._z,a=t._w,l=e._x,x=e._y,y=e._z,c=e._w;return this._x=s*c+a*l+o*y-r*x,this._y=o*c+a*x+r*l-s*y,this._z=r*c+a*y+s*x-o*l,this._w=a*c-s*l-o*x-r*y,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,o=this._y,r=this._z,a=this._w;let l=a*t._w+s*t._x+o*t._y+r*t._z;if(l<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,l=-l):this.copy(t),l>=1)return this._w=a,this._x=s,this._y=o,this._z=r,this;const x=1-l*l;if(x<=Number.EPSILON){const u=1-e;return this._w=u*a+e*this._w,this._x=u*s+e*this._x,this._y=u*o+e*this._y,this._z=u*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const y=Math.sqrt(x),c=Math.atan2(y,l),h=Math.sin((1-e)*c)/y,d=Math.sin(e*c)/y;return this._w=a*h+this._w*d,this._x=s*h+this._x*d,this._y=o*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=Math.random(),e=Math.sqrt(1-t),s=Math.sqrt(t),o=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(o),s*Math.sin(r),s*Math.cos(r),e*Math.sin(o))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class b{constructor(t=0,e=0,s=0){b.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(L.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(L.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,o=this.z,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6]*o,this.y=r[1]*e+r[4]*s+r[7]*o,this.z=r[2]*e+r[5]*s+r[8]*o,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,o=this.z,r=t.elements,a=1/(r[3]*e+r[7]*s+r[11]*o+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*o+r[12])*a,this.y=(r[1]*e+r[5]*s+r[9]*o+r[13])*a,this.z=(r[2]*e+r[6]*s+r[10]*o+r[14])*a,this}applyQuaternion(t){const e=this.x,s=this.y,o=this.z,r=t.x,a=t.y,l=t.z,x=t.w,y=x*e+a*o-l*s,c=x*s+l*e-r*o,h=x*o+r*s-a*e,d=-r*e-a*s-l*o;return this.x=y*x+d*-r+c*-l-h*-a,this.y=c*x+d*-a+h*-r-y*-l,this.z=h*x+d*-l+y*-a-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,o=this.z,r=t.elements;return this.x=r[0]*e+r[4]*s+r[8]*o,this.y=r[1]*e+r[5]*s+r[9]*o,this.z=r[2]*e+r[6]*s+r[10]*o,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,o=t.y,r=t.z,a=e.x,l=e.y,x=e.z;return this.x=o*x-r*l,this.y=r*a-s*x,this.z=s*l-o*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return N.copy(this).projectOnVector(t),this.sub(N)}reflect(t){return this.sub(N.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(V(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,o=this.z-t.z;return e*e+s*s+o*o}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const o=Math.sin(e)*t;return this.x=o*Math.sin(s),this.y=Math.cos(e)*t,this.z=o*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),o=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=o,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,s=Math.sqrt(1-t**2);return this.x=s*Math.cos(e),this.y=s*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const N=new b,L=new ht;typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:P}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=P);const lt={class:"flex justify-between gap-4 items-center mb-2"},at={class:"text-gray-500 w-1/3"},ct=["value","min","max","step"],ut=n.defineComponent({__name:"NumberControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i;function s(c){const{target:h}=c;t("change",h.valueAsNumber)}const o=w.useMouse(),r=n.ref(0),a=n.ref(!1),l=c=>{r.value=c.clientX,a.value=!0},x=()=>{a.value=!1},y=c=>Math.floor(Math.abs(c)/10);return n.watch(o.x,c=>{if(a.value){const h=c-r.value,d=y(h);h>0?t("change",e.control.value+1+d):h<0&&t("change",e.control.value-1+d),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),r.value=c}}),(c,h)=>(n.openBlock(),n.createElementBlock("div",lt,[n.createElementVNode("label",at,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,class:n.normalizeClass(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":a.value}]),type:"number",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s,onMousedown:l,onMouseup:x},null,42,ct)]))}}),yt={class:"flex justify-between gap-4 items-center mb-2 min-h-32px"},xt={class:"text-gray-500 w-1/3"},dt=["value"],_t=n.defineComponent({__name:"TextControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){t("change",s)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",yt,[n.createElementVNode("label",xt,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,type:"string",class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",onChange:e},null,40,dt)]))}}),mt={class:"flex justify-start gap-2 items-center mb-2 min-h-32px"},ft={class:"text-gray-500 w-1/3"},pt=["id","checked"],gt=["for"],zt={class:"i-ic:baseline-check text-light"},Mt=n.defineComponent({__name:"BooleanControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){const{target:o}=s;t("change",o.checked)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",mt,[n.createElementVNode("label",ft,n.toDisplayString(i.label),1),n.createElementVNode("input",{id:i.control.label,checked:i.control.value,class:"hidden",type:"checkbox",onInput:e},null,40,pt),n.createElementVNode("label",{for:i.control.label,class:"inline-flex items-center cursor-pointer"},[n.createElementVNode("span",{class:n.normalizeClass([{"bg-dark-500":i.control.value,"bg-gray-200":!i.control.value},"w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])},[n.withDirectives(n.createElementVNode("i",zt,null,512),[[n.vShow,i.control.value]])],2)],8,gt)]))}}),wt={class:"relative flex justify-between gap-4 items-center mb-2"},bt={class:"text-gray-500 w-1/3"},Ct=["value","min","max","step"],kt=["value","min","max","step"],St=n.defineComponent({__name:"SliderControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i;function s(h){const{target:d}=h;t("change",d.valueAsNumber)}const o=n.computed(()=>({backgroundImage:`linear-gradient(to right, #333 0% ${100*(e.control.value-(e.control.min||0))/((e.control.max||100)-(e.control.min||0))}%, #e2e2e2 0%)`})),r=w.useMouse(),a=n.ref(0),l=n.ref(!1),x=h=>{a.value=h.clientX,l.value=!0},y=()=>{l.value=!1},c=h=>Math.floor(Math.abs(h)/10);return n.watch(r.x,h=>{if(l.value){const d=h-a.value,u=c(d);d>0?t("change",e.control.value+1+u):d<0&&t("change",e.control.value-1+u),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),a.value=h}}),(h,d)=>(n.openBlock(),n.createElementBlock("div",wt,[n.createElementVNode("label",bt,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,class:"w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",style:n.normalizeStyle(n.unref(o)),type:"range",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s},null,44,Ct),n.createElementVNode("input",{value:i.control.value,class:n.normalizeClass(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":l.value}]),type:"number",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s,onMousedown:x,onMouseup:y},null,42,kt)]))}}),Zt="",Et=((i,t)=>{const e=i.__vccOpts||i;for(const[s,o]of t)e[s]=o;return e})(St,[["__scopeId","data-v-546d47fc"]]),Vt={class:"flex justify-between gap-4 items-center mb-2"},Nt={class:"text-gray-500 w-1/3"},Bt=["value"],$t=["value"],Tt=n.defineComponent({__name:"ColorControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){const{target:o}=s;t("change",o.value)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",Vt,[n.createElementVNode("label",Nt,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,type:"color",onInput:e},null,40,Bt),n.createElementVNode("input",{value:i.control.value,class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",type:"text",onInput:e},null,40,$t)]))}}),Ut="";function At(i){return typeof i=="number"?[i,i,i]:i instanceof b?[i.x,i.y,i.z]:i}const It={class:"flex justify-between gap-2 items-center mb-2"},Dt={class:"text-gray-500 w-1/3"},qt={class:"w-2/3 flex justify-between gap-1"},jt={key:0,class:"font-bold px-0.5 py-1 text-0.65rem text-gray-300"},Pt=["value","onInput","onMousedown","onMouseup"],Lt=n.defineComponent({__name:"VectorControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i,s=w.useMouse(),o=n.ref(0),r=n.ref(!1),a=n.ref(0),l=(_,f)=>{a.value=f,o.value=_.clientX,r.value=!0},x=(_,f)=>{a.value=f,r.value=!1},y=_=>Math.floor(Math.abs(_)/10),c=n.computed(()=>At(e.control.value)),h=n.computed(()=>Object.keys(e.control.value)),d=n.computed(()=>e.control.value instanceof k||e.control.value instanceof b);function u(_,f){const{value:p}=e.control,{target:m}=_;a.value=f,p[d.value?h.value[a.value]:a.value]=parseInt(m.value,10),t("change",p)}return n.watch(s.x,_=>{if(r.value){const f=_-o.value,p=y(f),{value:m}=e.control,g=d.value?h.value[a.value]:a.value;f>0?m[g]+=1+p:f<0&&(m[g]-=1+p),e.control.min!==void 0&&m<e.control.min&&(m[g]=e.control.min),e.control.max!==void 0&&m>e.control.max&&(m[g]=e.control.max),t("change",m),o.value=_}}),(_,f)=>(n.openBlock(),n.createElementBlock("div",It,[n.createElementVNode("label",Dt,n.toDisplayString(i.label),1),n.createElementVNode("div",qt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(c),(p,m)=>(n.openBlock(),n.createElementBlock("div",{key:i.label+m,class:"flex items-center w-1/3 bg-gray-100 rounded"},[n.unref(h)[m]&&n.unref(d)?(n.openBlock(),n.createElementBlock("span",jt,n.toDisplayString(n.unref(h)[m]),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"text",class:n.normalizeClass(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":r.value}]),value:n.unref(c)[m].toFixed(2),onInput:g=>u(g,m),onMousedown:g=>l(g,m),onMouseup:g=>x(g,m)},null,42,Pt)]))),128))])]))}}),Xt=n.defineComponent({__name:"ControlInput",props:{control:null},emits:["change"],setup(i,{emit:t}){const e=i,s=n.computed(()=>e.control.type==="number"&&(e.control.step||e.control.max||e.control.min)),o=n.computed(()=>{const l=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return e.control.type==="color"||l.test(e.control.value)}),r=n.computed(()=>e.control.value instanceof Array||e.control.value instanceof k||e.control.value instanceof b);function a(l){t("change",l)}return(l,x)=>i.control.visible?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(o)?(n.openBlock(),n.createBlock(Tt,{key:0,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"])):n.unref(r)?(n.openBlock(),n.createBlock(Lt,{key:1,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"])):i.control.type==="boolean"?(n.openBlock(),n.createBlock(Mt,{key:2,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"])):n.unref(s)?n.unref(s)?(n.openBlock(),n.createBlock(Et,{key:4,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"])):(n.openBlock(),n.createBlock(_t,{key:5,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"])):(n.openBlock(),n.createBlock(ut,{key:3,label:i.control.label,control:i.control,onChange:a},null,8,["label","control"]))],64)):n.createCommentVNode("",!0)}}),Ft={class:"bg-white shadow-xl rounded border-4 border-solid border-black"},Rt=[n.createElementVNode("i",{class:"h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs"},"🍰",-1),n.createElementVNode("div",null,[n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"})],-1),n.createElementVNode("div",null,null,-1)],Yt={class:"p-4"},Ot=n.defineComponent({__name:"TresLeches",setup(i){const{width:t}=w.useWindowSize(),e=280,s=n.ref(null),o=ot();function r(a,l){l.value=a}return(a,l)=>(n.openBlock(),n.createBlock(n.unref(tt),{"initial-value":{x:n.unref(t)-e-20,y:10},class:"fixed select-none z-24 w-280px font-sans text-xs",handle:s.value},{default:n.withCtx(()=>[n.createElementVNode("div",Ft,[n.createElementVNode("header",{ref_key:"handle",ref:s,class:"relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"},Rt,512),n.createElementVNode("div",Yt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o).controls,x=>(n.openBlock(),n.createBlock(Xt,{key:x.label,control:x,onChange:y=>r(y,x)},null,8,["control","onChange"]))),128))])])]),_:1},8,["initial-value","handle"]))}});z.TresLeches=Ot,z.useControls=rt,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
12
|
+
*/const P="152";function B(i,t,e){return Math.max(t,Math.min(e,i))}class k{constructor(t=0,e=0){k.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,o=t.elements;return this.x=o[0]*e+o[3]*s+o[6],this.y=o[1]*e+o[4]*s+o[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(B(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),o=Math.sin(e),r=this.x-t.x,l=this.y-t.y;return this.x=r*s-l*o+t.x,this.y=r*o+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ht{constructor(t=0,e=0,s=0,o=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=o}static slerpFlat(t,e,s,o,r,l,h){let x=s[o+0],y=s[o+1],c=s[o+2],a=s[o+3];const d=r[l+0],u=r[l+1],_=r[l+2],f=r[l+3];if(h===0){t[e+0]=x,t[e+1]=y,t[e+2]=c,t[e+3]=a;return}if(h===1){t[e+0]=d,t[e+1]=u,t[e+2]=_,t[e+3]=f;return}if(a!==f||x!==d||y!==u||c!==_){let p=1-h;const m=x*d+y*u+c*_+a*f,g=m>=0?1:-1,X=1-m*m;if(X>Number.EPSILON){const M=Math.sqrt(X),R=Math.atan2(M,m*g);p=Math.sin(p*R)/M,h=Math.sin(h*R)/M}const S=h*g;if(x=x*p+d*S,y=y*p+u*S,c=c*p+_*S,a=a*p+f*S,p===1-h){const M=1/Math.sqrt(x*x+y*y+c*c+a*a);x*=M,y*=M,c*=M,a*=M}}t[e]=x,t[e+1]=y,t[e+2]=c,t[e+3]=a}static multiplyQuaternionsFlat(t,e,s,o,r,l){const h=s[o],x=s[o+1],y=s[o+2],c=s[o+3],a=r[l],d=r[l+1],u=r[l+2],_=r[l+3];return t[e]=h*_+c*a+x*u-y*d,t[e+1]=x*_+c*d+y*a-h*u,t[e+2]=y*_+c*u+h*d-x*a,t[e+3]=c*_-h*a-x*d-y*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,o){return this._x=t,this._y=e,this._z=s,this._w=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const s=t._x,o=t._y,r=t._z,l=t._order,h=Math.cos,x=Math.sin,y=h(s/2),c=h(o/2),a=h(r/2),d=x(s/2),u=x(o/2),_=x(r/2);switch(l){case"XYZ":this._x=d*c*a+y*u*_,this._y=y*u*a-d*c*_,this._z=y*c*_+d*u*a,this._w=y*c*a-d*u*_;break;case"YXZ":this._x=d*c*a+y*u*_,this._y=y*u*a-d*c*_,this._z=y*c*_-d*u*a,this._w=y*c*a+d*u*_;break;case"ZXY":this._x=d*c*a-y*u*_,this._y=y*u*a+d*c*_,this._z=y*c*_+d*u*a,this._w=y*c*a-d*u*_;break;case"ZYX":this._x=d*c*a-y*u*_,this._y=y*u*a+d*c*_,this._z=y*c*_-d*u*a,this._w=y*c*a+d*u*_;break;case"YZX":this._x=d*c*a+y*u*_,this._y=y*u*a+d*c*_,this._z=y*c*_-d*u*a,this._w=y*c*a-d*u*_;break;case"XZY":this._x=d*c*a-y*u*_,this._y=y*u*a-d*c*_,this._z=y*c*_+d*u*a,this._w=y*c*a+d*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,o=Math.sin(s);return this._x=t.x*o,this._y=t.y*o,this._z=t.z*o,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],o=e[4],r=e[8],l=e[1],h=e[5],x=e[9],y=e[2],c=e[6],a=e[10],d=s+h+a;if(d>0){const u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(c-x)*u,this._y=(r-y)*u,this._z=(l-o)*u}else if(s>h&&s>a){const u=2*Math.sqrt(1+s-h-a);this._w=(c-x)/u,this._x=.25*u,this._y=(o+l)/u,this._z=(r+y)/u}else if(h>a){const u=2*Math.sqrt(1+h-s-a);this._w=(r-y)/u,this._x=(o+l)/u,this._y=.25*u,this._z=(x+c)/u}else{const u=2*Math.sqrt(1+a-s-h);this._w=(l-o)/u,this._x=(r+y)/u,this._y=(x+c)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(B(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const o=Math.min(1,e/s);return this.slerp(t,o),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,o=t._y,r=t._z,l=t._w,h=e._x,x=e._y,y=e._z,c=e._w;return this._x=s*c+l*h+o*y-r*x,this._y=o*c+l*x+r*h-s*y,this._z=r*c+l*y+s*x-o*h,this._w=l*c-s*h-o*x-r*y,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,o=this._y,r=this._z,l=this._w;let h=l*t._w+s*t._x+o*t._y+r*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=l,this._x=s,this._y=o,this._z=r,this;const x=1-h*h;if(x<=Number.EPSILON){const u=1-e;return this._w=u*l+e*this._w,this._x=u*s+e*this._x,this._y=u*o+e*this._y,this._z=u*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const y=Math.sqrt(x),c=Math.atan2(y,h),a=Math.sin((1-e)*c)/y,d=Math.sin(e*c)/y;return this._w=l*a+this._w*d,this._x=s*a+this._x*d,this._y=o*a+this._y*d,this._z=r*a+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=Math.random(),e=Math.sqrt(1-t),s=Math.sqrt(t),o=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(o),s*Math.sin(r),s*Math.cos(r),e*Math.sin(o))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class w{constructor(t=0,e=0,s=0){w.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(L.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(L.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,o=this.z,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6]*o,this.y=r[1]*e+r[4]*s+r[7]*o,this.z=r[2]*e+r[5]*s+r[8]*o,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,o=this.z,r=t.elements,l=1/(r[3]*e+r[7]*s+r[11]*o+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*o+r[12])*l,this.y=(r[1]*e+r[5]*s+r[9]*o+r[13])*l,this.z=(r[2]*e+r[6]*s+r[10]*o+r[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,o=this.z,r=t.x,l=t.y,h=t.z,x=t.w,y=x*e+l*o-h*s,c=x*s+h*e-r*o,a=x*o+r*s-l*e,d=-r*e-l*s-h*o;return this.x=y*x+d*-r+c*-h-a*-l,this.y=c*x+d*-l+a*-r-y*-h,this.z=a*x+d*-h+y*-l-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,o=this.z,r=t.elements;return this.x=r[0]*e+r[4]*s+r[8]*o,this.y=r[1]*e+r[5]*s+r[9]*o,this.z=r[2]*e+r[6]*s+r[10]*o,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(t,Math.min(e,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,o=t.y,r=t.z,l=e.x,h=e.y,x=e.z;return this.x=o*x-r*h,this.y=r*l-s*x,this.z=s*h-o*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return N.copy(this).projectOnVector(t),this.sub(N)}reflect(t){return this.sub(N.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(B(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,o=this.z-t.z;return e*e+s*s+o*o}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const o=Math.sin(e)*t;return this.x=o*Math.sin(s),this.y=Math.cos(e)*t,this.z=o*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),o=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=o,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,s=Math.sqrt(1-t**2);return this.x=s*Math.cos(e),this.y=s*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const N=new w,L=new ht;typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:P}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=P);const at={class:"flex px-4 justify-between gap-4 items-center mb-2"},ct={class:"text-gray-500 w-1/3"},ut=["value","min","max","step"],yt=n.defineComponent({__name:"NumberControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i;function s(c){const{target:a}=c;t("change",a.valueAsNumber)}const o=b.useMouse(),r=n.ref(0),l=n.ref(!1),h=c=>{r.value=c.clientX,l.value=!0},x=()=>{l.value=!1},y=c=>Math.floor(Math.abs(c)/10);return n.watch(o.x,c=>{if(l.value){const a=c-r.value,d=y(a);a>0?t("change",e.control.value+1+d):a<0&&t("change",e.control.value-1+d),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),r.value=c}}),(c,a)=>(n.openBlock(),n.createElementBlock("div",at,[n.createElementVNode("label",ct,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,class:n.normalizeClass(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":l.value}]),type:"number",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s,onMousedown:h,onMouseup:x},null,42,ut)]))}}),xt={class:"flex px-4 justify-between gap-4 items-center mb-2 min-h-32px"},dt={class:"text-gray-500 w-1/3"},_t=["value"],mt=n.defineComponent({__name:"TextControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){t("change",s)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",xt,[n.createElementVNode("label",dt,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,type:"string",class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",onChange:e},null,40,_t)]))}}),ft={class:"flex px-4 justify-start gap-2 items-center mb-2 min-h-32px"},pt={class:"text-gray-500 w-1/3"},gt=["id","checked"],zt=["for"],Mt={class:"i-ic:baseline-check text-light"},bt=n.defineComponent({__name:"BooleanControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){const{target:o}=s;t("change",o.checked)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",ft,[n.createElementVNode("label",pt,n.toDisplayString(i.label),1),n.createElementVNode("input",{id:i.control.label,checked:i.control.value,class:"hidden",type:"checkbox",onInput:e},null,40,gt),n.createElementVNode("label",{for:i.control.label,class:"inline-flex items-center cursor-pointer"},[n.createElementVNode("span",{class:n.normalizeClass([{"bg-dark-500":i.control.value,"bg-gray-200":!i.control.value},"w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])},[n.withDirectives(n.createElementVNode("i",Mt,null,512),[[n.vShow,i.control.value]])],2)],8,zt)]))}}),wt={class:"px-4 relative flex justify-between gap-4 items-center mb-2"},Ct={class:"text-gray-500 w-1/3"},kt=["value","min","max","step"],St=["value","min","max","step"],Et=n.defineComponent({__name:"SliderControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i;function s(a){const{target:d}=a;t("change",d.valueAsNumber)}const o=n.computed(()=>({backgroundImage:`linear-gradient(to right, #333 0% ${100*(e.control.value-(e.control.min||0))/((e.control.max||100)-(e.control.min||0))}%, #e2e2e2 0%)`})),r=b.useMouse(),l=n.ref(0),h=n.ref(!1),x=a=>{l.value=a.clientX,h.value=!0},y=()=>{h.value=!1},c=a=>Math.floor(Math.abs(a)/10);return n.watch(r.x,a=>{if(h.value){const d=a-l.value,u=c(d);d>0?t("change",e.control.value+1+u):d<0&&t("change",e.control.value-1+u),e.control.min!==void 0&&e.control.value<e.control.min&&t("change",e.control.min),e.control.max!==void 0&&e.control.value>e.control.max&&t("change",e.control.max),l.value=a}}),(a,d)=>(n.openBlock(),n.createElementBlock("div",wt,[n.createElementVNode("label",Ct,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,class:"w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",style:n.normalizeStyle(n.unref(o)),type:"range",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s},null,44,kt),n.createElementVNode("input",{value:i.control.value,class:n.normalizeClass(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":h.value}]),type:"number",min:i.control.min,max:i.control.max,step:i.control.step,onInput:s,onMousedown:x,onMouseup:y},null,42,St)]))}}),Wt="",Vt=((i,t)=>{const e=i.__vccOpts||i;for(const[s,o]of t)e[s]=o;return e})(Et,[["__scopeId","data-v-da7e8146"]]),Bt={class:"flex px-4 justify-between gap-4 items-center mb-2"},Nt={class:"text-gray-500 w-1/3"},$t=["value"],Tt=["value"],It=n.defineComponent({__name:"ColorControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){function e(s){const{target:o}=s;t("change",o.value)}return(s,o)=>(n.openBlock(),n.createElementBlock("div",Bt,[n.createElementVNode("label",Nt,n.toDisplayString(i.label),1),n.createElementVNode("input",{value:i.control.value,type:"color",onInput:e},null,40,$t),n.createElementVNode("input",{value:i.control.value,class:"p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",type:"text",onInput:e},null,40,Tt)]))}}),Kt="";function At(i){return typeof i=="number"?[i,i,i]:i instanceof w?[i.x,i.y,i.z]:i}const Dt={class:"flex px-4 justify-between gap-2 items-center mb-2"},qt={class:"text-gray-500 w-1/3"},jt={class:"w-2/3 flex justify-between gap-1"},Pt={key:0,class:"font-bold px-0.5 py-1 text-0.65rem text-gray-300"},Lt=["value","onInput","onMousedown","onMouseup"],Ft=n.defineComponent({__name:"VectorControl",props:{label:null,control:null},emits:["change"],setup(i,{emit:t}){const e=i,s=b.useMouse(),o=n.ref(0),r=n.ref(!1),l=n.ref(0),h=(_,f)=>{l.value=f,o.value=_.clientX,r.value=!0},x=(_,f)=>{l.value=f,r.value=!1},y=_=>Math.floor(Math.abs(_)/10),c=n.computed(()=>At(e.control.value)),a=n.computed(()=>Object.keys(e.control.value)),d=n.computed(()=>e.control.value instanceof k||e.control.value instanceof w);function u(_,f){const{value:p}=e.control,{target:m}=_;l.value=f,p[d.value?a.value[l.value]:l.value]=parseInt(m.value,10),t("change",p)}return n.watch(s.x,_=>{if(r.value){const f=_-o.value,p=y(f),{value:m}=e.control,g=d.value?a.value[l.value]:l.value;f>0?m[g]+=1+p:f<0&&(m[g]-=1+p),e.control.min!==void 0&&m<e.control.min&&(m[g]=e.control.min),e.control.max!==void 0&&m>e.control.max&&(m[g]=e.control.max),t("change",m),o.value=_}}),(_,f)=>(n.openBlock(),n.createElementBlock("div",Dt,[n.createElementVNode("label",qt,n.toDisplayString(i.label),1),n.createElementVNode("div",jt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(c),(p,m)=>(n.openBlock(),n.createElementBlock("div",{key:i.label+m,class:"flex items-center w-1/3 bg-gray-100 rounded"},[n.unref(a)[m]&&n.unref(d)?(n.openBlock(),n.createElementBlock("span",Pt,n.toDisplayString(n.unref(a)[m]),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"text",class:n.normalizeClass(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans",{"cursor-ew-resize":r.value}]),value:n.unref(c)[m].toFixed(2),onInput:g=>u(g,m),onMousedown:g=>h(g,m),onMouseup:g=>x(g,m)},null,42,Lt)]))),128))])]))}}),Xt={class:"bg-white rounded-b"},Rt=n.defineComponent({__name:"Folder",props:{control:null},setup(i){function t(o,r){r.value=o}const e=n.ref(!1),s=()=>{e.value=!e.value};return(o,r)=>(n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("button",{class:"flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",onClick:s},[n.createElementVNode("span",null,n.toDisplayString(i.control.label),1),n.createElementVNode("i",{class:n.normalizeClass(e.value?"i-ic:baseline-keyboard-arrow-up":"i-ic:baseline-keyboard-arrow-down")},null,2)]),n.createVNode(n.Transition,{name:"animate__animated","enter-active-class":"animate__fadeIn","leave-active-class":"animate__fadeOut"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",Xt,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.control.controls,l=>(n.openBlock(),n.createBlock(F,{key:l.label,control:l,onChange:r[0]||(r[0]=h=>t(h,i.control))},null,8,["control"]))),128))],512),[[n.vShow,e.value]])]),_:1})]))}}),F=n.defineComponent({__name:"ControlInput",props:{control:null},emits:["change"],setup(i,{emit:t}){const e=i,s=n.computed(()=>e.control.type==="number"&&(e.control.step||e.control.max||e.control.min)),o=n.computed(()=>{const h=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return e.control.type==="color"||h.test(e.control.value)}),r=n.computed(()=>e.control.value instanceof Array||e.control.value instanceof k||e.control.value instanceof w);function l(h){t("change",h)}return(h,x)=>i.control.visible?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(o)?(n.openBlock(),n.createBlock(It,{key:0,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"])):n.unref(r)?(n.openBlock(),n.createBlock(Ft,{key:1,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"])):i.control.type==="boolean"?(n.openBlock(),n.createBlock(bt,{key:2,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"])):i.control.type==="folder"?(n.openBlock(),n.createBlock(Rt,{key:3,label:i.control.label,control:i.control},null,8,["label","control"])):n.unref(s)?n.unref(s)?(n.openBlock(),n.createBlock(Vt,{key:5,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"])):(n.openBlock(),n.createBlock(mt,{key:6,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"])):(n.openBlock(),n.createBlock(yt,{key:4,label:i.control.label,control:i.control,onChange:l},null,8,["label","control"]))],64)):n.createCommentVNode("",!0)}}),Yt={class:"bg-white shadow-xl rounded border-4 border-solid border-black"},Ot=[n.createElementVNode("i",{class:"h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs"},"🍰",-1),n.createElementVNode("div",null,[n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"}),n.createElementVNode("i",{class:"i-ic-baseline-drag-indicator"})],-1),n.createElementVNode("div",null,null,-1)],Ht=n.defineComponent({__name:"TresLeches",setup(i){const{width:t}=b.useWindowSize(),e=280,s=n.ref(null),o=rt();function r(l,h){h.value=l}return(l,h)=>(n.openBlock(),n.createBlock(n.unref(et),{"initial-value":{x:n.unref(t)-e-20,y:10},class:"fixed select-none z-24 w-280px font-sans text-xs",handle:s.value},{default:n.withCtx(()=>[n.createElementVNode("div",Yt,[n.createElementVNode("header",{ref_key:"handle",ref:s,class:"relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"},Ot,512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o).controls,x=>(n.openBlock(),n.createBlock(F,{key:x.label,control:x,onChange:y=>r(y,x)},null,8,["control","onChange"]))),128))])]),_:1},8,["initial-value","handle"]))}});z.TresLeches=Ht,z.useControls=lt,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED