@vincentt-xr/sdk 2.0.0-alpha.11 → 2.0.0-alpha.12

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.
@@ -0,0 +1,2 @@
1
+ "use strict";const H=require("react/jsx-runtime"),x=require("react"),ve=require("@react-three/fiber"),Me=require("./context-hA0Rb2Xa.cjs"),Te=require("./useEditOverrides-C3ZVXuIH.cjs"),xe=require("three");function Oe(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Ce=Oe(xe),Le=({children:t,depth:e=0})=>{const{camera:n,size:r}=ve.useThree(),a=x.useMemo(()=>{if(!n.isPerspectiveCamera)return{width:10,height:10};const i=n,l=Math.abs(i.position.z-e),f=i.fov*Math.PI/180,s=2*Math.tan(f/2)*l;return{width:s*(r.width/r.height),height:s}},[n,r,e]);return H.jsx(Me.ScreenSpaceContext.Provider,{value:a,children:H.jsx("group",{position:[0,0,e],children:t})})},de=x.forwardRef(({texture:t,name:e,overlay:n,opacity:r,position:a,rotation:i,scale:l,visible:f,renderOrder:s},h)=>H.jsxs("mesh",{ref:h,name:e,position:a,rotation:i,scale:l,visible:f,renderOrder:s,children:[H.jsx("planeGeometry",{args:[1,1]}),H.jsx("meshBasicMaterial",{map:t,transparent:!0,opacity:r,depthTest:!n,depthWrite:!n})]}));de.displayName="TextLabelMesh";const Fe={color:"#ffffff",strokeWidth:0,strokeOpacity:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowOpacity:1,fontWeight:"bold",fontStyle:"normal",fontFamily:"Arial, sans-serif",fontSize:48,textAlign:"center",verticalAlign:"center",minFontSize:12,letterSpacing:0,lineSpacing:.3,bgColor:"rgba(20,40,110,0.88)",bgFillMode:"solid",bgOpacity:1,bgFit:"full",bgTextureFit:"cover",bgTextureFlipX:!1,bgTextureFlipY:!1,borderWidth:0,borderRadius:24,padding:32,aspect:2.5,resolution:512,opacity:1,underline:!1,strikethrough:!1,bendPreset:"arc",bendStrength:0},ue=t=>{x.useEffect(()=>()=>{t==null||t.dispose()},[t])};function We(t,e,n){return n==="left"?e:n==="right"?t-e:t/2}function Ye(t,e,n,r,a){return a==="top"?e+n/2:a==="bottom"?t-e-r+n/2:t/2-(r-n)/2}function ke(t,e,n,r){return r==="full"||n==="left"?0:n==="right"?t-e:(t-e)/2}function be(t,e,n,r){return`${t} ${e} ${n}px ${r}`}function R(t,e){const n=Math.max(0,Math.min(e,1));return t*n*.08}function me(t,e){const n=Math.max(0,Math.min(e,1));return t*(1.2+n*.6)}function Se(t,e){"letterSpacing"in t&&(t.letterSpacing=`${e}px`)}function ye(t){"letterSpacing"in t&&(t.letterSpacing="0px")}function p(t,e,n){Se(t,n);const r=t.measureText(e).width;return ye(t),r}function J(t,e,n,r){return Math.max(1,Math.floor((t-e*2)/me(n,r)))}function Pe(t,e,n,r,a){return e.length<=r&&e.every(i=>p(t,i,a)<=n)}function V(t,e,n,r,a,i,l,f){t.font=be(r,a,i,l);const s=e.split(" "),h=[];let o="";for(const d of s){const c=o?`${o} ${d}`:d;p(t,c,f)>n&&o?(h.push(o),o=d):o=c}return o&&h.push(o),h}function fe(t,e,n,r,a,i,l,f){const h=e.split(/\r?\n/).flatMap(o=>o.trim().length===0?[""]:V(t,o,n,r,a,i,l,f));return h.length>0?h:[e]}function we(t,e,n,r,a){const i=r?"...":"";let l=e.trimEnd();for(;l.length>0&&p(t,`${l}${i}`,a)>n;)l=l.slice(0,-1).trimEnd();return`${l}${i}`}function K(t,e,n,r,a){return e.map((i,l)=>{if(p(t,i,a)<=n)return i;const f=l===e.length-1;return we(t,i,n,r==="ellipsis"&&f,a)})}function he(t,e,n,r,a,i){if(e.length<=n)return K(t,e,r,a?"ellipsis":"clip",i);const l=e.slice(0,n),f=l[n-1];return l[n-1]=we(t,f,r,a,i),K(t,l,r,a?"ellipsis":"clip",i)}function He(t){const{ctx:e,text:n,explicitLines:r,maxWidth:a,maxHeight:i,padding:l,fontStyle:f,fontWeight:s,fontSize:h,fontFamily:o,letterSpacing:d,lineSpacing:c,overflow:u,resizeToFit:S,minFontSize:g}=t;let b=h,m=R(b,d),y=r??fe(e,n,a,f,s,b,o,m),v=J(i,l,b,c);const C=S===!0||u==="shrink";for(;C&&!Pe(e,y,a,v,m)&&b>g&&(b=Math.max(g,b-4),m=R(b,d),y=r??fe(e,n,a,f,s,b,o,m),v=J(i,l,b,c),b!==g););return u==="ellipsis"?y=he(e,y,v,a,!0,m):u==="clamp"||u==="shrink"?y=he(e,y,v,a,!1,m):u!=="clip"&&(y=K(e,y,a,void 0,m)),{fontSize:b,lines:y}}function Xe(t){const{ctx:e,text:n,maxWidth:r,maxHeight:a,padding:i,fontStyle:l,fontWeight:f,fontSize:s,fontFamily:h,letterSpacing:o,lineSpacing:d}=t;let c=s,u=V(e,n,r,l,f,c,h,R(c,o));const S=J(a,i,c,d);return u.length>S&&(c=Math.max(12,Math.round(c*.75)),u=V(e,n,r,l,f,c,h,R(c,o))),{fontSize:c,lines:u}}function Q(t,e){return typeof OffscreenCanvas<"u"?new OffscreenCanvas(t,e):(()=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n})()}function pe(t,e){const n=e.width-e.padding*2,a=Array.isArray(e.lines)||e.text.includes(`
2
+ `)||e.overflow!==void 0||e.resizeToFit!==void 0?He({ctx:t,text:e.text,explicitLines:e.lines,maxWidth:n,maxHeight:e.height,padding:e.padding,fontStyle:e.fontStyle,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFamily:e.fontFamily,overflow:e.overflow,resizeToFit:e.resizeToFit,minFontSize:e.minFontSize,letterSpacing:e.letterSpacing,lineSpacing:e.lineSpacing}):Xe({ctx:t,text:e.text,maxWidth:n,maxHeight:e.height,padding:e.padding,fontStyle:e.fontStyle,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFamily:e.fontFamily,letterSpacing:e.letterSpacing,lineSpacing:e.lineSpacing}),i=a.fontSize,l=a.lines;t.font=be(e.fontStyle,e.fontWeight,i,e.fontFamily);const f=R(i,e.letterSpacing),s=me(i,e.lineSpacing),h=Math.max(i,i+(l.length-1)*s),o=Ye(e.height,e.padding,i,h,e.verticalAlign),d=l.map(c=>p(t,c,f));return{fontSize:i,resolvedLines:l,letterSpacingPx:f,lineHeight:s,startY:o,textBlockWidth:Math.min(e.width,Math.max(0,Math.max(...d,0))+e.padding*2),textBlockHeight:Math.min(e.height,h+e.padding*2),textX:We(e.width,e.padding,e.textAlign)}}function Ae(t,e,n,r,a,i){t.beginPath(),t.moveTo(e+i,n),t.lineTo(e+r-i,n),t.quadraticCurveTo(e+r,n,e+r,n+i),t.lineTo(e+r,n+a-i),t.quadraticCurveTo(e+r,n+a,e+r-i,n+a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e,n+a,e,n+a-i),t.lineTo(e,n+i),t.quadraticCurveTo(e,n,e+i,n),t.closePath()}function ce(t,e,n){return typeof t!="number"||Number.isNaN(t)||t<=0?e:Math.min(t,n)}function Be(t,e){const n=ke(e.canvasWidth,e.panelWidth,e.textAlign,e.bgFit),r=(e.canvasHeight-e.panelHeight)/2,a=Math.min(e.borderRadius,Math.min(e.panelWidth,e.panelHeight)/2);Ae(t,n,r,e.panelWidth,e.panelHeight,a),ze(t,{panelX:n,panelY:r,panelWidth:e.panelWidth,panelHeight:e.panelHeight,bgColor:e.bgColor,bgFillMode:e.bgFillMode,bgOpacity:e.bgOpacity,bgGradientStops:e.bgGradientStops,bgTextureImage:e.bgTextureImage,bgTextureFit:e.bgTextureFit,bgTextureFlipX:e.bgTextureFlipX,bgTextureFlipY:e.bgTextureFlipY}),e.borderColor&&e.borderWidth>0&&(t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,t.stroke())}function ze(t,e){if(t.save(),t.globalAlpha=Math.max(0,Math.min(e.bgOpacity,1)),e.bgFillMode==="gradient"&&e.bgGradientStops&&e.bgGradientStops.length>1){const n=t.createLinearGradient(e.panelX,e.panelY,e.panelX+e.panelWidth,e.panelY+e.panelHeight);[...e.bgGradientStops].sort((r,a)=>r.position-a.position).forEach(r=>n.addColorStop(Math.max(0,Math.min(r.position,1)),r.color)),t.fillStyle=n,t.fill(),t.restore();return}if(e.bgTextureImage){t.clip(),Re(t,{image:e.bgTextureImage,x:e.panelX,y:e.panelY,width:e.panelWidth,height:e.panelHeight,fit:e.bgTextureFit,flipX:e.bgTextureFlipX,flipY:e.bgTextureFlipY}),t.restore();return}t.fillStyle=e.bgColor,t.fill(),t.restore()}function Re(t,e){const{image:n,x:r,y:a,width:i,height:l,fit:f,flipX:s,flipY:h}=e,o="naturalWidth"in n?n.naturalWidth:"videoWidth"in n?n.videoWidth:n.width,d="naturalHeight"in n?n.naturalHeight:"videoHeight"in n?n.videoHeight:n.height;let c=i,u=l,S=r,g=a;if(f!=="stretch"&&o>0&&d>0){const b=f==="cover"?Math.max(i/o,l/d):Math.min(i/o,l/d);c=o*b,u=d*b,S=r+(i-c)/2,g=a+(l-u)/2}t.save(),(s||h)&&(t.translate(s?r+i:0,h?a+l:0),t.scale(s?-1:1,h?-1:1),S=s?-(S-r)-c+r:S,g=h?-(g-a)-u+a:g),t.drawImage(n,S,g,c,u),t.restore()}function Ie(t,e,n,r,a,i){const l=a/72,f=Math.abs(l),s=1-Math.min(1,Math.abs(e)),h=Math.min(1,Math.abs(e)),o=r<=1?.5:n/(r-1),d=Math.sin(o*Math.PI*2-Math.PI/2),c=Math.sin(o*Math.PI*2.7-Math.PI/2)*(.65+o*.35),u=a*e*e,S=2*a*e/i,g={xOffset:0,yOffset:0,rotation:0,scaleX:1,scaleY:1};switch(t){case"arc":return{...g,yOffset:u,rotation:Math.atan(S)};case"arc-lower":return{...g,yOffset:u*.55,scaleY:Math.max(.2,1+l*e*e*.45)};case"arc-upper":return{...g,yOffset:-u*.55,scaleY:Math.max(.2,1-l*e*e*.45)};case"arch":return{...g,yOffset:u};case"bulge":return{...g,scaleY:Math.max(.2,1+l*s*.75)};case"shell-lower":return{...g,yOffset:a*.45*o*s,scaleY:Math.max(.2,1+l*o*s)};case"shell-upper":return{...g,yOffset:-a*.45*(1-o)*s,scaleY:Math.max(.2,1+l*(1-o)*s)};case"flag":return{...g,yOffset:a*.65*c,rotation:Math.atan(a/Math.max(i,1)*Math.cos(o*Math.PI*2.7)*1.6)};case"wave":return{...g,yOffset:a*.6*d,rotation:Math.atan(a/Math.max(i,1)*Math.cos(o*Math.PI*2)*1.4)};case"fish":return{...g,scaleX:Math.max(.25,1-f*h*.55),scaleY:Math.max(.2,1+l*s)};case"rise":return{...g,yOffset:a*e};case"fisheye":return{...g,yOffset:a*.18*e*s,scaleX:Math.max(.25,1+l*s*.7),scaleY:Math.max(.2,1+l*s*.7)};case"inflate":return{...g,scaleX:Math.max(.25,1+l*s*.6),scaleY:Math.max(.2,1+l*s*.6)};case"squeeze":return{...g,scaleY:Math.max(.2,1-l*s*.8)};case"twist":return{...g,yOffset:a*e,rotation:l*e*.45,scaleY:Math.max(.2,1+l*e*.25)};default:return g}}function X(t,e,n,r,a,i,l="arc",f=0){if(f!==0){Ee(t,e,n,r,a,i,l,f);return}Se(t,a),i==="fill"?t.fillText(e,n,r):t.strokeText(e,n,r),ye(t)}function Ee(t,e,n,r,a,i,l,f){const s=Array.from(e);if(s.length===0)return;const h=s.map(m=>t.measureText(m).width),o=h.reduce((m,y)=>m+y,0)+a*Math.max(0,s.length-1),d=t.textAlign,c=d==="right"?n-o:d==="center"?n-o/2:n,S=Math.max(-100,Math.min(f,100))/100*72,g=Math.max(o/2,1);let b=c;for(let m=0;m<s.length;m++){const y=s[m],v=h[m],C=b+v/2,W=(C-c-o/2)/g,O=Ie(l,W,m,s.length,S,g);t.save(),t.translate(C+O.xOffset,r+O.yOffset),t.rotate(O.rotation),t.scale(O.scaleX,O.scaleY),t.textAlign="center",i==="fill"?t.fillText(y,0,0):t.strokeText(y,0,0),t.restore(),b+=v+a}}function ge(t,e,n,r,a,i,l,f,s){const h=p(t,e,f),o=a==="center"?n-h/2:a==="right"?n-h:n,d=s==="underline"?l*.42:-l*.08,c=r+d;t.save(),t.strokeStyle=i,t.lineWidth=Math.max(2,l*.06),t.lineCap="round",t.beginPath(),t.moveTo(o,c),t.lineTo(o+h,c),t.stroke(),t.restore()}function De(t,e){for(let n=0;n<e.lines.length;n++){const r=e.lines[n],a=e.startY+n*e.lineHeight;for(const i of e.shadowLayers)t.save(),t.shadowColor=i.color,t.shadowBlur=i.blur,t.shadowOffsetX=i.offsetX??0,t.shadowOffsetY=i.offsetY??0,t.globalAlpha=i.opacity??1,t.fillStyle=e.color,X(t,r,e.textX,a,e.letterSpacingPx,"fill",e.bendPreset,e.bendStrength),t.restore();for(const i of e.strokeLayers)t.save(),t.lineJoin="round",t.miterLimit=2,t.lineWidth=i.width,t.strokeStyle=i.color,t.globalAlpha=i.opacity??1,X(t,r,e.textX,a,e.letterSpacingPx,"stroke",e.bendPreset,e.bendStrength),t.restore();t.save(),t.fillStyle=e.color,t.globalAlpha=1,X(t,r,e.textX,a,e.letterSpacingPx,"fill",e.bendPreset,e.bendStrength),t.restore(),e.underline&&ge(t,r,e.textX,a,e.textAlign,e.color,e.fontSize,e.letterSpacingPx,"underline"),e.strikethrough&&ge(t,r,e.textX,a,e.textAlign,e.color,e.fontSize,e.letterSpacingPx,"strikethrough")}}function $e(t,e){const n=Math.max(0,Math.min(e.intensity,1));if(n<=0)return;const r=Math.max(0,Math.min(e.range,1)),a=r*72,i=Math.max(-.5,Math.min(e.horizontalAngle,.5))*80,l=Math.max(-.5,Math.min(e.verticalAngle,.5))*80;for(let f=0;f<e.lines.length;f++){const s=e.startY+f*e.lineHeight;t.save(),t.globalAlpha=n,t.shadowColor=e.color,t.shadowBlur=a,t.shadowOffsetX=i,t.shadowOffsetY=l,e.style==="contoured"?(t.lineJoin="round",t.miterLimit=2,t.lineWidth=Math.max(2,r*42),t.strokeStyle=e.color,X(t,e.lines[f],e.textX,s,e.letterSpacingPx,"stroke",e.bendPreset,e.bendStrength)):(t.fillStyle=e.color,X(t,e.lines[f],e.textX,s,e.letterSpacingPx,"fill",e.bendPreset,e.bendStrength)),t.restore()}}function je(t,e){const n=Q(e.width,e.height),r=n.getContext("2d");r.clearRect(0,0,e.width,e.height),r.font=e.font,r.fillStyle="#ffffff",r.textAlign=e.textAlign,r.textBaseline="middle";for(let l=0;l<e.lines.length;l++)X(r,e.lines[l],e.textX,e.startY+l*e.lineHeight,e.letterSpacingPx,"fill",e.bendPreset,e.bendStrength);const a=Q(e.width,e.height),i=a.getContext("2d");i.clearRect(0,0,e.width,e.height),i.save(),i.globalAlpha=e.opacity,i.filter=e.blur>0?`blur(${e.blur}px)`:"none",i.drawImage(n,e.offsetX,e.offsetY),i.restore(),i.globalCompositeOperation="destination-in",i.drawImage(n,0,0),i.globalCompositeOperation="source-in",i.globalAlpha=e.opacity,i.fillStyle=e.color,i.fillRect(0,0,e.width,e.height),t.drawImage(a,0,0)}function qe(t){const{width:e,height:n,color:r,strokeLayers:a,strokeColor:i,strokeWidth:l,strokeOpacity:f,shadowLayers:s,innerShadow:h,glow:o,shadowColor:d,shadowBlur:c,shadowOffsetX:u,shadowOffsetY:S,shadowOpacity:g,textAlign:b,bgFillMode:m,bgOpacity:y,bgFit:v,bgAutoSize:C,bgWidth:W,bgHeight:O,bgGradientStops:L,bgTextureImage:F,bgTextureFit:I,bgTextureFlipX:E,bgTextureFlipY:D,underline:$,strikethrough:j,bendPreset:Y,bendStrength:k}=t;let{fontSize:A,bgColor:B}=t;const q=[...a??[],...i&&l>0?[{color:i,width:l,opacity:f}]:[]].filter(T=>T.width>0),G=[...s??[],...d&&(c>0||u!==0||S!==0)?[{color:d,blur:c,offsetX:u,offsetY:S,opacity:g}]:[]].filter(T=>T.blur>0||(T.offsetX??0)!==0||(T.offsetY??0)!==0);let P;const z=Q(e,n),M=z.getContext("2d");M.clearRect(0,0,e,n),M.fillStyle=r,M.textAlign=b,M.textBaseline="middle";const w=pe(M,t);if(A=w.fontSize,B!=="transparent"){const T=C===!0,_=ce(T?void 0:W,v==="text"||T?w.textBlockWidth:e,e),N=ce(T?void 0:O,v==="text"||T?w.textBlockHeight:n,n);Be(M,{canvasWidth:e,canvasHeight:n,textAlign:b,bgFit:v,panelWidth:_,panelHeight:N,bgColor:B,bgFillMode:m,bgOpacity:y,bgGradientStops:L,bgTextureImage:F,bgTextureFit:I,bgTextureFlipX:E,bgTextureFlipY:D,borderColor:t.borderColor,borderWidth:t.borderWidth,borderRadius:t.borderRadius})}return o&&$e(M,{lines:w.resolvedLines,textX:w.textX,startY:w.startY,lineHeight:w.lineHeight,letterSpacingPx:w.letterSpacingPx,bendPreset:Y,bendStrength:k,color:o.color,style:o.style,intensity:o.intensity??.5,range:o.range??.5,horizontalAngle:o.horizontalAngle??0,verticalAngle:o.verticalAngle??0}),De(M,{lines:w.resolvedLines,textX:w.textX,startY:w.startY,lineHeight:w.lineHeight,textAlign:b,color:r,fontSize:A,letterSpacingPx:w.letterSpacingPx,bendPreset:Y,bendStrength:k,shadowLayers:G,strokeLayers:q,underline:$,strikethrough:j}),h&&je(M,{width:e,height:n,font:M.font,lines:w.resolvedLines,textX:w.textX,startY:w.startY,lineHeight:w.lineHeight,letterSpacingPx:w.letterSpacingPx,bendPreset:Y,bendStrength:k,textAlign:b,color:h.color,opacity:h.opacity??1,blur:h.blur,offsetX:h.offsetX??0,offsetY:h.offsetY??0}),P=new Ce.CanvasTexture(z),P.needsUpdate=!0,P}function Ge(t,e){const{lines:n,color:r,strokeLayers:a,outlineEnabled:i,strokeColor:l,strokeWidth:f,strokeOpacity:s,shadowLayers:h,shadowEnabled:o,innerShadow:d,glow:c,shadowColor:u,shadowBlur:S,shadowOffsetX:g,shadowOffsetY:b,shadowOpacity:m,fontWeight:y,fontStyle:v,fontFamily:C,fontSize:W,textAlign:O,verticalAlign:L,overflow:F,resizeToFit:I,minFontSize:E,letterSpacing:D,lineSpacing:$,bgFillMode:j,bgOpacity:Y,bgFit:k,bgAutoSize:A,bgWidth:B,bgHeight:q,bgGradientStops:G,bgTextureFit:P,bgTextureFlipX:z,bgTextureFlipY:M,borderColor:w,borderWidth:T,borderRadius:_,padding:N,aspect:Z,resolution:U,underline:ee,strikethrough:te,bendPreset:ne,bendStrength:re}=t,ie=x.useMemo(()=>i===!1?[]:a,[i,a]),ae=x.useMemo(()=>o===!1?[]:h,[o,h]),le=void 0,oe=x.useMemo(()=>({text:e.text,lines:n,color:r,strokeLayers:ie,strokeColor:i===!1?void 0:l,strokeWidth:i===!1?0:f,strokeOpacity:s,shadowLayers:ae,innerShadow:d,glow:c,shadowColor:o===!1?void 0:u,shadowBlur:o===!1?0:S,shadowOffsetX:o===!1?0:g,shadowOffsetY:o===!1?0:b,shadowOpacity:m,fontWeight:y,fontStyle:v,fontFamily:C,fontSize:W,textAlign:O,verticalAlign:L,overflow:F,resizeToFit:I,minFontSize:E,letterSpacing:D,lineSpacing:$,bgColor:e.bgColor,bgFillMode:j,bgOpacity:Y,bgFit:k,bgAutoSize:A,bgWidth:B,bgHeight:q,bgGradientStops:G,bgTextureImage:le,bgTextureFit:P,bgTextureFlipX:z,bgTextureFlipY:M,borderColor:w,borderWidth:T,borderRadius:_,padding:N,height:U,width:Math.round(U*Math.max(Z,.1)),underline:ee,strikethrough:te,bendPreset:ne,bendStrength:re}),[e.text,e.bgColor,n,r,ie,i,l,f,s,ae,d,c,o,u,S,g,b,m,y,v,C,W,O,L,F,I,E,D,$,j,Y,k,A,B,q,G,le,P,z,M,w,T,_,N,Z,U,ee,te,ne,re]),se=x.useMemo(()=>qe(oe),[oe]);return ue(se),se}const _e=["color"];function Ne(t){const e=Te.useEditOverrides(t,_e),n={...Fe,...e},{text:r,bgColor:a,opacity:i,name:l,overlay:f=!0,position:s,rotation:h,scale:o,visible:d,renderOrder:c}=n,[u,S]=x.useState(null),[g,b]=x.useState(null),m=x.useRef(r);m.current!==r&&(m.current=r,u!==null&&S(null));const y=x.useRef(a);y.current!==a&&(y.current=a,g!==null&&b(null));const v=x.useRef(null),O=Ge(n,{text:u??r,bgColor:g??a});return x.useEffect(()=>{const L=v.current;if(L)return L.userData.setText=F=>S(F),L.userData.setBgColor=F=>b(F),()=>{delete L.userData.setText,delete L.userData.setBgColor}},[]),H.jsx(de,{ref:v,name:l,texture:O,overlay:f,opacity:i,position:s,rotation:h,scale:o,visible:d,renderOrder:c})}exports.ScreenSpaceUI=Le;exports.TextLabel=Ne;exports.useOwnedTexture=ue;
@@ -3,5 +3,5 @@ import { ScreenImageProps } from './types';
3
3
  /**
4
4
  * @editorElement screenImage transform.position transform.size transform.rotation
5
5
  */
6
- export declare function ScreenImage({ anchors, coordinateSpace, canvasSize, position, size, offsets, pivot, rotation, transform, onScreenTransformChange, transformGuideLayer, ...bodyProps }: ScreenImageProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export declare function ScreenImage(rawProps: ScreenImageProps): import("react/jsx-runtime").JSX.Element | null;
7
7
  export { defaultScreenImageUrl };
@@ -5,4 +5,4 @@ export declare const mergeScreenShapeSettings: (settings?: ScreenShapeSettingsIn
5
5
  /**
6
6
  * @editorElement screenShape transform.position transform.size transform.rotation settings.fillColor
7
7
  */
8
- export declare const ScreenShape: ({ name, onScreenTransformChange, renderOrder, settings: partialSettings, transform: partialTransform, transformGuideLayer, visible, }: ScreenShapeProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const ScreenShape: (rawProps: ScreenShapeProps) => import("react/jsx-runtime").JSX.Element | null;
package/dist/debug-ui.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./session-3aCMNb8W.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-B0N58SIA.cjs"),K=require("./index-CYwAL_d7.cjs"),Ae=require("react-dom"),$e=require("./index-J3Qy6hi3.cjs"),Gs=require("three"),J=require("./renderPasses-Bt8k0dkm.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-DHhn1nSV.cjs"),It=require("./landmarkMask-CvN-L5NT.cjs"),_s=require("./index-DzdKBXGE.cjs"),Us=require("./index-LC2Xs08E.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-Bxb_UcfF.cjs"),Zs=require("./contexts-CSz9stBV.cjs"),Ys=require("./selectors-Bq6tSgOY.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Pe=t.screenText.style.glow??Ss(),De=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Pe,bend:De,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:_e,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ue={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./session-3aCMNb8W.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-B0N58SIA.cjs"),K=require("./index-Cm3v6Dlg.cjs"),Ae=require("react-dom"),$e=require("./index-J3Qy6hi3.cjs"),Gs=require("three"),J=require("./renderPasses-Bt8k0dkm.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-DHhn1nSV.cjs"),It=require("./landmarkMask-CvN-L5NT.cjs"),_s=require("./index-DzdKBXGE.cjs"),Us=require("./index-LC2Xs08E.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-BzGLgXJm.cjs"),Zs=require("./contexts-CSz9stBV.cjs"),Ys=require("./selectors-Bq6tSgOY.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Pe=t.screenText.style.glow??Ss(),De=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Pe,bend:De,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:_e,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ue={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
2
2
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar { width: 10px; }
3
3
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
4
4
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
package/dist/debug-ui.js CHANGED
@@ -3,7 +3,7 @@ import { DefaultSettingPanel as gd } from "./debug-ui/default-setting.js";
3
3
  import { jsx as e, jsxs as l, Fragment as N } from "react/jsx-runtime";
4
4
  import { useState as S, useRef as ge, useEffect as V, useContext as Hn, createContext as Pn, useMemo as xn } from "react";
5
5
  import { D as Sn, a as _t, r as Gn, b as jn, c as _n } from "./renderGroups-BcQYy_J2.js";
6
- import { o as vn, b as xe, A as Xn, z as wn, s as Xt } from "./index-WkEZBuB4.js";
6
+ import { o as vn, b as xe, A as Xn, z as wn, s as Xt } from "./index-BaNlidsb.js";
7
7
  import { createPortal as Ne } from "react-dom";
8
8
  import { P as _e, aR as Un } from "./index-CTqQJj5p.js";
9
9
  import { DoubleSide as Zn } from "three";
@@ -15,7 +15,7 @@ import { n as Ml } from "./index-DlP4xxaT.js";
15
15
  import { F as Ll } from "./index-CNt8esFO.js";
16
16
  import { PerspectiveCamera as Fl, OrbitControls as $l } from "@react-three/drei";
17
17
  import { useThree as Nl } from "@react-three/fiber";
18
- import { e as Ol, f as Al } from "./index-CXaj3tOT.js";
18
+ import { e as Ol, f as Al } from "./index-bL819L-K.js";
19
19
  import { X as Bl } from "./contexts-B5GODwuV.js";
20
20
  import { c as Vl } from "./selectors-K5JKCWxw.js";
21
21
  const Kl = {