@uxpilot/openai-astra-shape-cue 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@ Use the minified browser bundle with one script tag, or install the package in a
7
7
  ## HTML
8
8
 
9
9
  ```html
10
- <script defer src="https://cdn.jsdelivr.net/npm/@uxpilot/openai-astra-shape-cue@1.0.0/dist/astra.min.js"></script>
10
+ <script defer src="https://cdn.jsdelivr.net/npm/@uxpilot/openai-astra-shape-cue@1.0.1/dist/astra.min.js"></script>
11
11
  <astra-shape-cue
12
12
  shape="star"
13
13
  transform="load"
package/dist/astra.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @uxpilot/openai-astra-shape-cue v1.0.0 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
1
+ /*! @uxpilot/openai-astra-shape-cue v1.0.1 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
2
2
 
3
3
  three
4
4
  The MIT License
@@ -4044,7 +4044,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4044
4044
  `+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,r.colorSpace===bt&&(n+=`color0 = sRGBToLinear(color0);
4045
4045
  `),r.uvTransformation?(i=`vec2 transformedUv = vUv;
4046
4046
  `+i,r.defines.set("UV","transformedUv")):r.defines.set("UV","vUv"),r.shaderParts.set(Xt.FRAGMENT_HEAD,t),r.shaderParts.set(Xt.FRAGMENT_MAIN_IMAGE,n),r.shaderParts.set(Xt.FRAGMENT_MAIN_UV,i);for(let[a,o]of r.shaderParts)o!==null&&r.shaderParts.set(a,o.trim().replace(/^#/,`
4047
- #`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(r)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(r,e=Gi){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(r,e)}render(r,e,t,n,i){for(let s of this.effects)s.update(r,e,n);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=n*this.timeScale,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}}setSize(r,e){this.fullscreenMaterial.setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){this.renderer=r;for(let n of this.effects)n.initialize(r,e,t);this.updateMaterial(),t!==void 0&&t!==an&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let r of this.effects)r.removeEventListener("change",this.listener),r.dispose()}handleEvent(r){switch(r.type){case"change":this.recompile();break}}};var $E=[new Float32Array(3),new Float32Array(3)],eT=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],tT=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var nT=[new Float32Array(2),new Float32Array(2)];var iT=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),rT=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],sT=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],aT=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var oT=new Map([[oi(0,0,0,0),new Float32Array([0,0,0,0])],[oi(0,0,0,1),new Float32Array([0,0,0,1])],[oi(0,0,1,0),new Float32Array([0,0,1,0])],[oi(0,0,1,1),new Float32Array([0,0,1,1])],[oi(0,1,0,0),new Float32Array([0,1,0,0])],[oi(0,1,0,1),new Float32Array([0,1,0,1])],[oi(0,1,1,0),new Float32Array([0,1,1,0])],[oi(0,1,1,1),new Float32Array([0,1,1,1])],[oi(1,0,0,0),new Float32Array([1,0,0,0])],[oi(1,0,0,1),new Float32Array([1,0,0,1])],[oi(1,0,1,0),new Float32Array([1,0,1,0])],[oi(1,0,1,1),new Float32Array([1,0,1,1])],[oi(1,1,0,0),new Float32Array([1,1,0,0])],[oi(1,1,0,1),new Float32Array([1,1,0,1])],[oi(1,1,1,0),new Float32Array([1,1,1,0])],[oi(1,1,1,1),new Float32Array([1,1,1,1])]]);function rm(r,e,t){return r+(e-r)*t}function oi(r,e,t,n){let i=rm(r,e,.75),s=rm(t,n,1-.25);return rm(i,s,1-.125)}var gE=bt,zf=class r extends Hn{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,i){let s=this,a=new xi(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){let t=this;function n(se,W){if(se.nodeType!==1)return;let C=A(se),b=!1,re=null;switch(se.nodeName){case"svg":W=m(se,W);break;case"style":s(se);break;case"g":W=m(se,W);break;case"path":W=m(se,W),se.hasAttribute("d")&&(re=i(se));break;case"rect":W=m(se,W),re=l(se);break;case"polygon":W=m(se,W),re=c(se);break;case"polyline":W=m(se,W),re=u(se);break;case"circle":W=m(se,W),re=h(se);break;case"ellipse":W=m(se,W),re=f(se);break;case"line":W=m(se,W),re=d(se);break;case"defs":b=!0;break;case"use":W=m(se,W);let Ae=(se.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),Ue=se.viewportElement.getElementById(Ae);Ue?n(Ue,W):console.warn("SVGLoader: 'use node' references non-existent node id: "+Ae);break;default:}re&&(W.fill!==void 0&&W.fill!=="none"&&re.color.setStyle(W.fill,gE),R(re,We),V.push(re),re.userData={node:se,style:W});let xe=se.childNodes;for(let j=0;j<xe.length;j++){let Ae=xe[j];b&&Ae.nodeName!=="style"&&Ae.nodeName!=="defs"||n(Ae,W)}C&&(oe.pop(),oe.length>0?We.copy(oe[oe.length-1]):We.identity())}function i(se){let W=new ki,C=new K,b=new K,re=new K,xe=!0,j=!1,Ae=se.getAttribute("d");if(Ae===""||Ae==="none")return null;let Ue=Ae.match(/[a-df-z][^a-df-z]*/ig);for(let B=0,q=Ue.length;B<q;B++){let Q=Ue[B],ne=Q.charAt(0),te=Q.slice(1).trim();xe===!0&&(j=!0,xe=!1);let G;switch(ne){case"M":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"H":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"V":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"L":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"C":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(G[L+0],G[L+1],G[L+2],G[L+3],G[L+4],G[L+5]),b.x=G[L+2],b.y=G[L+3],C.x=G[L+4],C.y=G[L+5],L===0&&j===!0&&re.copy(C);break;case"S":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"Q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"T":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,G[L+0],G[L+1]),b.x=Oe,b.y=tt,C.x=G[L+0],C.y=G[L+1],L===0&&j===!0&&re.copy(C)}break;case"A":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==C.x&&G[L+6]==C.y)continue;let Oe=C.clone();C.x=G[L+5],C.y=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"m":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"h":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"v":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"l":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"c":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3],C.x+G[L+4],C.y+G[L+5]),b.x=C.x+G[L+2],b.y=C.y+G[L+3],C.x+=G[L+4],C.y+=G[L+5],L===0&&j===!0&&re.copy(C);break;case"s":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"t":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,C.x+G[L+0],C.y+G[L+1]),b.x=Oe,b.y=tt,C.x=C.x+G[L+0],C.y=C.y+G[L+1],L===0&&j===!0&&re.copy(C)}break;case"a":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==0&&G[L+6]==0)continue;let Oe=C.clone();C.x+=G[L+5],C.y+=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"Z":case"z":W.currentPath.autoClose=!0,W.currentPath.curves.length>0&&(C.copy(re),W.currentPath.currentPoint.copy(C),xe=!0);break;default:console.warn(Q)}j=!1}return W}function s(se){if(!(!se.sheet||!se.sheet.cssRules||!se.sheet.cssRules.length))for(let W=0;W<se.sheet.cssRules.length;W++){let C=se.sheet.cssRules[W];if(C.type!==1)continue;let b=C.selectorText.split(/,/gm).filter(Boolean).map(re=>re.trim());for(let re=0;re<b.length;re++){let xe=Object.fromEntries(Object.entries(C.style).filter(([,j])=>j!==""));ae[b[re]]=Object.assign(ae[b[re]]||{},xe)}}}function a(se,W,C,b,re,xe,j,Ae){if(W==0||C==0){se.lineTo(Ae.x,Ae.y);return}b=b*Math.PI/180,W=Math.abs(W),C=Math.abs(C);let Ue=(j.x-Ae.x)/2,B=(j.y-Ae.y)/2,q=Math.cos(b)*Ue+Math.sin(b)*B,Q=-Math.sin(b)*Ue+Math.cos(b)*B,ne=W*W,te=C*C,G=q*q,L=Q*Q,fe=G/ne+L/te;if(fe>1){let Be=Math.sqrt(fe);W=Be*W,C=Be*C,ne=W*W,te=C*C}let Oe=ne*L+te*G,tt=(ne*te-Oe)/Oe,N=Math.sqrt(Math.max(0,tt));re===xe&&(N=-N);let E=N*W*Q/C,$=-N*C*q/W,me=Math.cos(b)*E-Math.sin(b)*$+(j.x+Ae.x)/2,Me=Math.sin(b)*E+Math.cos(b)*$+(j.y+Ae.y)/2,ve=o(1,0,(q-E)/W,(Q-$)/C),je=o((q-E)/W,(Q-$)/C,(-q-E)/W,(-Q-$)/C)%(Math.PI*2);se.currentPath.absellipse(me,Me,W,C,ve,ve+je,xe===0,b)}function o(se,W,C,b){let re=se*C+W*b,xe=Math.sqrt(se*se+W*W)*Math.sqrt(C*C+b*b),j=Math.acos(Math.max(-1,Math.min(1,re/xe)));return se*b-W*C<0&&(j=-j),j}function l(se){let W=S(se.getAttribute("x")||0),C=S(se.getAttribute("y")||0),b=S(se.getAttribute("rx")||se.getAttribute("ry")||0),re=S(se.getAttribute("ry")||se.getAttribute("rx")||0),xe=S(se.getAttribute("width")),j=S(se.getAttribute("height")),Ae=1-.551915024494,Ue=new ki;return Ue.moveTo(W+b,C),Ue.lineTo(W+xe-b,C),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe-b*Ae,C,W+xe,C+re*Ae,W+xe,C+re),Ue.lineTo(W+xe,C+j-re),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe,C+j-re*Ae,W+xe-b*Ae,C+j,W+xe-b,C+j),Ue.lineTo(W+b,C+j),(b!==0||re!==0)&&Ue.bezierCurveTo(W+b*Ae,C+j,W,C+j-re*Ae,W,C+j-re),Ue.lineTo(W,C+re),(b!==0||re!==0)&&Ue.bezierCurveTo(W,C+re*Ae,W+b*Ae,C,W+b,C),Ue}function c(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!0,b}function u(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!1,b}function h(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("r")||0),re=new er;re.absarc(W,C,b,0,Math.PI*2);let xe=new ki;return xe.subPaths.push(re),xe}function f(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("rx")||0),re=S(se.getAttribute("ry")||0),xe=new er;xe.absellipse(W,C,b,re,0,Math.PI*2);let j=new ki;return j.subPaths.push(xe),j}function d(se){let W=S(se.getAttribute("x1")||0),C=S(se.getAttribute("y1")||0),b=S(se.getAttribute("x2")||0),re=S(se.getAttribute("y2")||0),xe=new ki;return xe.moveTo(W,C),xe.lineTo(b,re),xe.currentPath.autoClose=!1,xe}function m(se,W){W=Object.assign({},W);let C={};if(se.hasAttribute("class")){let j=se.getAttribute("class").split(/\s/).filter(Boolean).map(Ae=>Ae.trim());for(let Ae=0;Ae<j.length;Ae++)C=Object.assign(C,ae["."+j[Ae]])}se.hasAttribute("id")&&(C=Object.assign(C,ae["#"+se.getAttribute("id")]));function b(j,Ae,Ue){Ue===void 0&&(Ue=function(q){return q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),q}),se.hasAttribute(j)&&(W[Ae]=Ue(se.getAttribute(j))),C[j]&&(W[Ae]=Ue(C[j])),se.style&&se.style[j]!==""&&(W[Ae]=Ue(se.style[j]))}function re(j){return Math.max(0,Math.min(1,S(j)))}function xe(j){return Math.max(0,S(j))}return b("fill","fill"),b("fill-opacity","fillOpacity",re),b("fill-rule","fillRule"),b("opacity","opacity",re),b("stroke","stroke"),b("stroke-opacity","strokeOpacity",re),b("stroke-width","strokeWidth",xe),b("stroke-linejoin","strokeLineJoin"),b("stroke-linecap","strokeLineCap"),b("stroke-miterlimit","strokeMiterLimit",xe),b("visibility","visibility"),W}function x(se,W){return se-(W-se)}function g(se,W,C){if(typeof se!="string")throw new TypeError("Invalid input: "+typeof se);let b={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},re=0,xe=1,j=2,Ae=3,Ue=re,B=!0,q="",Q="",ne=[];function te(Oe,tt,N){let E=new SyntaxError('Unexpected character "'+Oe+'" at index '+tt+".");throw E.partial=N,E}function G(){q!==""&&(Q===""?ne.push(Number(q)):ne.push(Number(q)*Math.pow(10,Number(Q)))),q="",Q=""}let L,fe=se.length;for(let Oe=0;Oe<fe;Oe++){if(L=se[Oe],Array.isArray(W)&&W.includes(ne.length%C)&&b.FLAGS.test(L)){Ue=xe,q=L,G();continue}if(Ue===re){if(b.WHITESPACE.test(L))continue;if(b.DIGIT.test(L)||b.SIGN.test(L)){Ue=xe,q=L;continue}if(b.POINT.test(L)){Ue=j,q=L;continue}b.COMMA.test(L)&&(B&&te(L,Oe,ne),B=!0)}if(Ue===xe){if(b.DIGIT.test(L)){q+=L;continue}if(b.POINT.test(L)){q+=L,Ue=j;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.SIGN.test(L)&&q.length===1&&b.SIGN.test(q[0])&&te(L,Oe,ne)}if(Ue===j){if(b.DIGIT.test(L)){q+=L;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.POINT.test(L)&&q[q.length-1]==="."&&te(L,Oe,ne)}if(Ue===Ae){if(b.DIGIT.test(L)){Q+=L;continue}if(b.SIGN.test(L)){if(Q===""){Q+=L;continue}Q.length===1&&b.SIGN.test(Q)&&te(L,Oe,ne)}}b.WHITESPACE.test(L)?(G(),Ue=re,B=!1):b.COMMA.test(L)?(G(),Ue=re,B=!0):b.SIGN.test(L)?(G(),Ue=xe,q=L):b.POINT.test(L)?(G(),Ue=j,q=L):te(L,Oe,ne)}return G(),ne}let p=["mm","cm","in","pt","pc","px"],M={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function S(se){let W="px";if(typeof se=="string"||se instanceof String)for(let b=0,re=p.length;b<re;b++){let xe=p[b];if(se.endsWith(xe)){W=xe,se=se.substring(0,se.length-xe.length);break}}let C;return W==="px"&&t.defaultUnit!=="px"?C=M.in[t.defaultUnit]/t.defaultDPI:(C=M[W][t.defaultUnit],C<0&&(C=M[W].in*t.defaultDPI)),C*parseFloat(se)}function A(se){if(!(se.hasAttribute("transform")||se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))))return null;let W=P(se);return oe.length>0&&W.premultiply(oe[oe.length-1]),We.copy(W),oe.push(W),W}function P(se){let W=new ft,C=he;if(se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))){let b=S(se.getAttribute("x")),re=S(se.getAttribute("y"));W.translate(b,re)}if(se.hasAttribute("transform")){let b=se.getAttribute("transform").split(")");for(let re=b.length-1;re>=0;re--){let xe=b[re].trim();if(xe==="")continue;let j=xe.indexOf("("),Ae=xe.length;if(j>0&&j<Ae){let Ue=xe.slice(0,j),B=g(xe.slice(j+1));switch(C.identity(),Ue){case"translate":if(B.length>=1){let q=B[0],Q=0;B.length>=2&&(Q=B[1]),C.translate(q,Q)}break;case"rotate":if(B.length>=1){let q=0,Q=0,ne=0;q=B[0]*Math.PI/180,B.length>=3&&(Q=B[1],ne=B[2]),le.makeTranslation(-Q,-ne),ue.makeRotation(q),X.multiplyMatrices(ue,le),le.makeTranslation(Q,ne),C.multiplyMatrices(le,X)}break;case"scale":if(B.length>=1){let q=B[0],Q=q;B.length>=2&&(Q=B[1]),C.scale(q,Q)}break;case"skewX":B.length===1&&C.set(1,Math.tan(B[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":B.length===1&&C.set(1,0,0,Math.tan(B[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":B.length===6&&C.set(B[0],B[2],B[4],B[1],B[3],B[5],0,0,1);break}}W.premultiply(C)}}return W}function R(se,W){function C(j){Ce.set(j.x,j.y,1).applyMatrix3(W),j.set(Ce.x,Ce.y)}function b(j){let Ae=j.xRadius,Ue=j.yRadius,B=Math.cos(j.aRotation),q=Math.sin(j.aRotation),Q=new U(Ae*B,Ae*q,0),ne=new U(-Ue*q,Ue*B,0),te=Q.applyMatrix3(W),G=ne.applyMatrix3(W),L=he.set(te.x,G.x,0,te.y,G.y,0,0,0,1),fe=le.copy(L).invert(),N=ue.copy(fe).transpose().multiply(fe).elements,E=H(N[0],N[1],N[4]),$=Math.sqrt(E.rt1),me=Math.sqrt(E.rt2);if(j.xRadius=1/$,j.yRadius=1/me,j.aRotation=Math.atan2(E.sn,E.cs),!((j.aEndAngle-j.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let ve=le.set($,0,0,0,me,0,0,0,1),je=ue.set(E.cs,E.sn,0,-E.sn,E.cs,0,0,0,1),Be=ve.multiply(je).multiply(L),$e=et=>{let{x:Pe,y:qe}=new U(Math.cos(et),Math.sin(et),0).applyMatrix3(Be);return Math.atan2(qe,Pe)};j.aStartAngle=$e(j.aStartAngle),j.aEndAngle=$e(j.aEndAngle),F(W)&&(j.aClockwise=!j.aClockwise)}}function re(j){let Ae=w(W),Ue=T(W);j.xRadius*=Ae,j.yRadius*=Ue;let B=Ae>Number.EPSILON?Math.atan2(W.elements[1],W.elements[0]):Math.atan2(-W.elements[3],W.elements[4]);j.aRotation+=B,F(W)&&(j.aStartAngle*=-1,j.aEndAngle*=-1,j.aClockwise=!j.aClockwise)}let xe=se.subPaths;for(let j=0,Ae=xe.length;j<Ae;j++){let B=xe[j].curves;for(let q=0;q<B.length;q++){let Q=B[q];Q.isLineCurve?(C(Q.v1),C(Q.v2)):Q.isCubicBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2),C(Q.v3)):Q.isQuadraticBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2)):Q.isEllipseCurve&&(be.set(Q.aX,Q.aY),C(be),Q.aX=be.x,Q.aY=be.y,O(W)?b(Q):re(Q))}}}function F(se){let W=se.elements;return W[0]*W[4]-W[1]*W[3]<0}function O(se){let W=se.elements,C=W[0]*W[3]+W[1]*W[4];if(C===0)return!1;let b=w(se),re=T(se);return Math.abs(C/(b*re))>Number.EPSILON}function w(se){let W=se.elements;return Math.sqrt(W[0]*W[0]+W[1]*W[1])}function T(se){let W=se.elements;return Math.sqrt(W[3]*W[3]+W[4]*W[4])}function H(se,W,C){let b,re,xe,j,Ae,Ue=se+C,B=se-C,q=Math.sqrt(B*B+4*W*W);return Ue>0?(b=.5*(Ue+q),Ae=1/b,re=se*Ae*C-W*Ae*W):Ue<0?re=.5*(Ue-q):(b=.5*q,re=-.5*q),B>0?xe=B+q:xe=B-q,Math.abs(xe)>2*Math.abs(W)?(Ae=-2*W/xe,j=1/Math.sqrt(1+Ae*Ae),xe=Ae*j):Math.abs(W)===0?(xe=1,j=0):(Ae=-.5*xe/W,xe=1/Math.sqrt(1+Ae*Ae),j=Ae*xe),B>0&&(Ae=xe,xe=-j,j=Ae),{rt1:b,rt2:re,cs:xe,sn:j}}let V=[],ae={},oe=[],he=new ft,le=new ft,ue=new ft,X=new ft,be=new K,Ce=new U,We=new ft,ct=new DOMParser().parseFromString(e,"image/svg+xml");return n(ct.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:V,xml:ct.documentElement}}static createShapes(e){let n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:n.ORIGIN,t:0};function s(x,g,p,M){let S=x.x,A=g.x,P=p.x,R=M.x,F=x.y,O=g.y,w=p.y,T=M.y,H=(R-P)*(F-w)-(T-w)*(S-P),V=(A-S)*(F-w)-(O-F)*(S-P),ae=(T-w)*(A-S)-(R-P)*(O-F),oe=H/ae,he=V/ae;if(ae===0&&H!==0||oe<=0||oe>=1||he<0||he>1)return null;if(H===0&&ae===0){for(let le=0;le<2;le++)if(a(le===0?p:M,x,g),i.loc==n.ORIGIN){let ue=le===0?p:M;return{x:ue.x,y:ue.y,t:i.t}}else if(i.loc==n.BETWEEN){let ue=+(S+i.t*(A-S)).toPrecision(10),X=+(F+i.t*(O-F)).toPrecision(10);return{x:ue,y:X,t:i.t}}return null}else{for(let X=0;X<2;X++)if(a(X===0?p:M,x,g),i.loc==n.ORIGIN){let be=X===0?p:M;return{x:be.x,y:be.y,t:i.t}}let le=+(S+oe*(A-S)).toPrecision(10),ue=+(F+oe*(O-F)).toPrecision(10);return{x:le,y:ue,t:oe}}}function a(x,g,p){let M=p.x-g.x,S=p.y-g.y,A=x.x-g.x,P=x.y-g.y,R=M*P-A*S;if(x.x===g.x&&x.y===g.y){i.loc=n.ORIGIN,i.t=0;return}if(x.x===p.x&&x.y===p.y){i.loc=n.DESTINATION,i.t=1;return}if(R<-Number.EPSILON){i.loc=n.LEFT;return}if(R>Number.EPSILON){i.loc=n.RIGHT;return}if(M*A<0||S*P<0){i.loc=n.BEHIND;return}if(Math.sqrt(M*M+S*S)<Math.sqrt(A*A+P*P)){i.loc=n.BEYOND;return}let F;M!==0?F=A/M:F=P/S,i.loc=n.BETWEEN,i.t=F}function o(x,g){let p=[],M=[];for(let S=1;S<x.length;S++){let A=x[S-1],P=x[S];for(let R=1;R<g.length;R++){let F=g[R-1],O=g[R],w=s(A,P,F,O);w!==null&&p.find(T=>T.t<=w.t+Number.EPSILON&&T.t>=w.t-Number.EPSILON)===void 0&&(p.push(w),M.push(new K(w.x,w.y)))}}return M}function l(x,g,p){let M=new K;g.getCenter(M);let S=[];return p.forEach(A=>{A.boundingBox.containsPoint(M)&&o(x,A.points).forEach(R=>{S.push({identifier:A.identifier,isCW:A.isCW,point:R})})}),S.sort((A,P)=>A.point.x-P.point.x),S}function c(x,g,p,M,S){(S==null||S==="")&&(S="nonzero");let A=new K;x.boundingBox.getCenter(A);let P=[new K(p,A.y),new K(M,A.y)],R=l(P,x.boundingBox,g);R.sort((V,ae)=>V.point.x-ae.point.x);let F=[],O=[];R.forEach(V=>{V.identifier===x.identifier?F.push(V):O.push(V)});let w=F[0].point.x,T=[],H=0;for(;H<O.length&&O[H].point.x<w;)T.length>0&&T[T.length-1]===O[H].identifier?T.pop():T.push(O[H].identifier),H++;if(T.push(x.identifier),S==="evenodd"){let V=T.length%2===0,ae=T[T.length-2];return{identifier:x.identifier,isHole:V,for:ae}}else if(S==="nonzero"){let V=!0,ae=null,oe=null;for(let he=0;he<T.length;he++){let le=T[he];V?(oe=g[le].isCW,V=!1,ae=le):oe!==g[le].isCW&&(oe=g[le].isCW,V=!0)}return{identifier:x.identifier,isHole:V,for:ae}}else console.warn('fill-rule: "'+S+'" is currently not implemented.')}let u=999999999,h=-999999999,f=e.subPaths.map(x=>{let g=x.getPoints(),p=-999999999,M=999999999,S=-999999999,A=999999999;for(let P=0;P<g.length;P++){let R=g[P];R.y>p&&(p=R.y),R.y<M&&(M=R.y),R.x>S&&(S=R.x),R.x<A&&(A=R.x)}return h<=S&&(h=S+1),u>=A&&(u=A-1),{curves:x.curves,points:g,isCW:vi.isClockWise(g),identifier:-1,boundingBox:new mo(new K(A,M),new K(S,p))}});f=f.filter(x=>x.points.length>1);for(let x=0;x<f.length;x++)f[x].identifier=x;let d=f.map(x=>c(x,f,u,h,e.userData?e.userData.style.fillRule:void 0)),m=[];return f.forEach(x=>{if(!d[x.identifier].isHole){let p=new Bi;p.curves=x.curves,d.filter(S=>S.isHole&&S.for===x.identifier).forEach(S=>{let A=f[S.identifier],P=new er;P.curves=A.curves,p.holes.push(P)}),m.push(p)}}),m}static getStrokeStyle(e,t,n,i,s){return e=e!==void 0?e:1,t=t!==void 0?t:"#000",n=n!==void 0?n:"miter",i=i!==void 0?i:"butt",s=s!==void 0?s:4,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:i,strokeMiterLimit:s}}static pointsToStroke(e,t,n,i){let s=[],a=[],o=[];if(r.pointsToStrokeWithBuffers(e,t,n,i,s,a,o)===0)return null;let l=new dt;return l.setAttribute("position",new Te(s,3)),l.setAttribute("normal",new Te(a,3)),l.setAttribute("uv",new Te(o,2)),l}static pointsToStrokeWithBuffers(e,t,n,i,s,a,o,l){let c=new K,u=new K,h=new K,f=new K,d=new K,m=new K,x=new K,g=new K,p=new K,M=new K,S=new K,A=new K,P=new K,R=new K,F=new K,O=new K,w=new K;n=n!==void 0?n:12,i=i!==void 0?i:.001,l=l!==void 0?l:0,e=B(e);let T=e.length;if(T<2)return 0;let H=e[0].equals(e[T-1]),V,ae=e[0],oe,he=t.strokeWidth/2,le=1/(T-1),ue=0,X,be,Ce,We,ct=!1,Pt=0,se=l*3,W=l*2;C(e[0],e[1],c).multiplyScalar(he),g.copy(e[0]).sub(c),p.copy(e[0]).add(c),M.copy(g),S.copy(p);for(let q=1;q<T;q++){V=e[q],q===T-1?H?oe=e[1]:oe=void 0:oe=e[q+1];let Q=c;if(C(ae,V,Q),h.copy(Q).multiplyScalar(he),A.copy(V).sub(h),P.copy(V).add(h),X=ue+le,be=!1,oe!==void 0){C(V,oe,u),h.copy(u).multiplyScalar(he),R.copy(V).sub(h),F.copy(V).add(h),Ce=!0,h.subVectors(oe,ae),Q.dot(h)<0&&(Ce=!1),q===1&&(ct=Ce),h.subVectors(oe,V),h.normalize();let ne=Math.abs(Q.dot(h));if(ne>Number.EPSILON){let te=he/ne;h.multiplyScalar(-te),f.subVectors(V,ae),d.copy(f).setLength(te).add(h),O.copy(d).negate();let G=d.length(),L=f.length();f.divideScalar(L),m.subVectors(oe,V);let fe=m.length();switch(m.divideScalar(fe),f.dot(O)<L&&m.dot(O)<fe&&(be=!0),w.copy(d).add(V),O.add(V),We=!1,be?Ce?(F.copy(O),P.copy(O)):(R.copy(O),A.copy(O)):xe(),t.strokeLineJoin){case"bevel":j(Ce,be,X);break;case"round":Ae(Ce,be),Ce?re(V,A,R,X,0):re(V,F,P,X,1);break;case"miter":case"miter-clip":default:let Oe=he*t.strokeMiterLimit/G;if(Oe<1)if(t.strokeLineJoin!=="miter-clip"){j(Ce,be,X);break}else Ae(Ce,be),Ce?(m.subVectors(w,A).multiplyScalar(Oe).add(A),x.subVectors(w,R).multiplyScalar(Oe).add(R),b(A,X,0),b(m,X,0),b(V,X,.5),b(V,X,.5),b(m,X,0),b(x,X,0),b(V,X,.5),b(x,X,0),b(R,X,0)):(m.subVectors(w,P).multiplyScalar(Oe).add(P),x.subVectors(w,F).multiplyScalar(Oe).add(F),b(P,X,1),b(m,X,1),b(V,X,.5),b(V,X,.5),b(m,X,1),b(x,X,1),b(V,X,.5),b(x,X,1),b(F,X,1));else be?(Ce?(b(p,ue,1),b(g,ue,0),b(w,X,0),b(p,ue,1),b(w,X,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(w,X,1),b(g,ue,0),b(O,X,0),b(w,X,1)),Ce?R.copy(w):F.copy(w)):Ce?(b(A,X,0),b(w,X,0),b(V,X,.5),b(V,X,.5),b(w,X,0),b(R,X,0)):(b(P,X,1),b(w,X,1),b(V,X,.5),b(V,X,.5),b(w,X,1),b(F,X,1)),We=!0;break}}else xe()}else xe();!H&&q===T-1&&Ue(e[0],M,S,Ce,!0,ue),ue=X,ae=V,g.copy(R),p.copy(F)}if(!H)Ue(V,A,P,Ce,!1,X);else if(be&&s){let q=w,Q=O;ct!==Ce&&(q=O,Q=w),Ce?(We||ct)&&(Q.toArray(s,0*3),Q.toArray(s,3*3),We&&q.toArray(s,1*3)):(We||!ct)&&(Q.toArray(s,1*3),Q.toArray(s,3*3),We&&q.toArray(s,0*3))}return Pt;function C(q,Q,ne){return ne.subVectors(Q,q),ne.set(-ne.y,ne.x).normalize()}function b(q,Q,ne){s&&(s[se]=q.x,s[se+1]=q.y,s[se+2]=0,a&&(a[se]=0,a[se+1]=0,a[se+2]=1),se+=3,o&&(o[W]=Q,o[W+1]=ne,W+=2)),Pt+=3}function re(q,Q,ne,te,G){c.copy(Q).sub(q).normalize(),u.copy(ne).sub(q).normalize();let L=Math.PI,fe=c.dot(u);Math.abs(fe)<1&&(L=Math.abs(Math.acos(fe))),L/=n,h.copy(Q);for(let Oe=0,tt=n-1;Oe<tt;Oe++)f.copy(h).rotateAround(q,L),b(h,te,G),b(f,te,G),b(q,te,.5),h.copy(f);b(f,te,G),b(ne,te,G),b(q,te,.5)}function xe(){b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(P,X,1)}function j(q,Q,ne){Q?q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ne,0),b(R,ne,0),b(O,ne,.5)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ne,1),b(O,ne,0),b(F,ne,1)):q?(b(A,ne,0),b(R,ne,0),b(V,ne,.5)):(b(P,ne,1),b(F,ne,0),b(V,ne,.5))}function Ae(q,Q){Q&&(q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ue,0),b(V,X,.5),b(O,X,1),b(V,X,.5),b(R,ue,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ue,1),b(O,X,0),b(V,X,.5),b(V,X,.5),b(O,X,0),b(F,ue,1)))}function Ue(q,Q,ne,te,G,L){switch(t.strokeLineCap){case"round":G?re(q,ne,Q,L,.5):re(q,Q,ne,L,.5);break;case"square":if(G)c.subVectors(Q,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q),te?(h.toArray(s,1*3),f.toArray(s,0*3),f.toArray(s,3*3)):(h.toArray(s,1*3),o[3*2+1]===1?f.toArray(s,3*3):h.toArray(s,3*3),f.toArray(s,0*3));else{c.subVectors(ne,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q);let fe=s.length;te?(h.toArray(s,fe-1*3),f.toArray(s,fe-2*3),f.toArray(s,fe-4*3)):(f.toArray(s,fe-2*3),h.toArray(s,fe-1*3),f.toArray(s,fe-4*3))}break;case"butt":default:break}}function B(q){let Q=!1;for(let te=1,G=q.length-1;te<G;te++)if(q[te].distanceTo(q[te+1])<i){Q=!0;break}if(!Q)return q;let ne=[];ne.push(q[0]);for(let te=1,G=q.length-1;te<G;te++)q[te].distanceTo(q[te+1])>=i&&ne.push(q[te]);return ne.push(q[q.length-1]),ne}}};var vv="1.0.0",lm=[{key:"shape",label:"Shape",kind:"select",optionPath:"shape",defaultValue:"star",choices:["star","heart","infinity","hexagon","spiral","custom"]},{key:"transform",label:"Transform on scroll",kind:"select",optionPath:"transform",defaultValue:"load",choices:["scroll","load","off"]},{key:"interactionMode",label:"Interaction",kind:"select",optionPath:"interaction",defaultValue:"rotate",choices:["rotate","depth-lens","none"]},{key:"palette",label:"Palette",kind:"select",optionPath:"palette",defaultValue:"astra",choices:["astra","aurora","ember"]},{key:"background",label:"Background",kind:"select",optionPath:"background",defaultValue:"#000",choices:["#000","#0b0f1a","transparent"]},{key:"holdAtEnd",label:"Hold shape after scrolling past",kind:"checkbox",optionPath:"holdAtEnd",defaultValue:!1},{key:"parallax",label:"Scroll parallax while dispersed",kind:"checkbox",optionPath:"parallax",defaultValue:!0},{key:"ambient",label:"Ambient glow + vignette",kind:"checkbox",optionPath:"ambient",defaultValue:!1},{key:"padding",label:"Padding",kind:"range",optionPath:"padding",defaultValue:.1,min:0,max:.4,step:.01},{key:"pathShapeAutoRotateAmount",label:"Auto-rotate amount",kind:"range",optionPath:"config.pathShapeAutoRotateAmount",defaultValue:.42,min:0,max:1.2,step:.01},{key:"pathShapeScatter",label:"Shape scatter",kind:"range",optionPath:"config.pathShapeScatter",defaultValue:1,min:0,max:3,step:.01},{key:"rotationDepth",label:"Shape depth",kind:"range",optionPath:"config.rotationDepth",defaultValue:1.4,min:0,max:2,step:.01},{key:"stars.density",label:"Star density",kind:"range",optionPath:"config.stars.density",defaultValue:4,min:.25,max:4,step:.05},{key:"stars.intensity",label:"Star intensity",kind:"range",optionPath:"config.stars.intensity",defaultValue:1.35,min:.1,max:3,step:.01},{key:"stars.size",label:"Star size",kind:"range",optionPath:"config.stars.size",defaultValue:2.05,min:.25,max:3,step:.01},{key:"bloomIntensity",label:"Bloom",kind:"range",optionPath:"config.bloomIntensity",defaultValue:.7,min:0,max:2,step:.01},{key:"lensFlare.intensity",label:"Lens flare",kind:"range",optionPath:"config.lensFlare.intensity",defaultValue:.28,min:0,max:1.5,step:.01},{key:"interaction.repelRadius",label:"Pointer repel radius",kind:"range",optionPath:"config.interaction.repelRadius",defaultValue:176,min:16,max:360,step:1},{key:"pathShapeAutoRotate",label:"Auto-rotate shape",kind:"checkbox",optionPath:"config.pathShapeAutoRotate",defaultValue:!0},{key:"faceForward",label:"Return to front on release",kind:"checkbox",optionPath:"config.faceForward",defaultValue:!0},{key:"interaction.particleRepel",label:"Pointer repels particles",kind:"checkbox",optionPath:"config.interaction.particleRepel",defaultValue:!0},{key:"lensFlare.enabled",label:"Lens flare",kind:"checkbox",optionPath:"config.lensFlare.enabled",defaultValue:!0},{key:"dirtyGlass.enabled",label:"Dirty glass + grain",kind:"checkbox",optionPath:"config.dirtyGlass.enabled",defaultValue:!0},{key:"orbitalDust.enabled",label:"Orbital dust",kind:"checkbox",optionPath:"config.orbitalDust.enabled",defaultValue:!1},{key:"showCenterCluster",label:"Center cluster",kind:"checkbox",optionPath:"config.showCenterCluster",defaultValue:!0}];function vE(){return JSON.parse(JSON.stringify(lm))}function cm(){if(typeof window>"u"||typeof document>"u")throw new Error("Shape Cue requires a browser. Initialize it after mounting.");let r=Symbol.for("@uxpilot/openai-astra-shape-cue/"+vv);if(window[r])return window[r];let{MathUtils:e}=tm,t=(v,y,_)=>Math.min(_,Math.max(y,v)),n=(v,y)=>(v%y+y)%y,i=v=>typeof v=="number"&&Number.isFinite(v),s=32,a=Object.freeze({animationPlaying:!0,animationRestartKey:0,bloomIntensity:.7,bloomThreshold:.08,colorMode:!0,convergeDuration:5.5,faceForward:!0,pathShapeAutoRotate:!0,pathShapeAutoRotateAmount:.42,pathShapeAutoRotateSpeed:.22,pathShapeScatter:1,rotationDepth:1.4,scrollDisperseDistance:800,scrollEffects:!0,scrollStarDriftSpeed:3,scrollStartOffset:0,scrollTextFadeDistance:200,showCenterCluster:!0}),o=Object.freeze({density:4,densityFalloff:.22,flowInward:!0,flowSpeed:.8,intensity:1.35,scatter:.4,size:2.05,sizeFalloff:.45,twinkleSpeed:.62}),l=Object.freeze({depthDisplacement:.5,followDamping:6,illumination:.55,magnification:.18,particleRepel:!0,repelDistance:52,repelFalloff:2,repelHighlight:.16,repelHighlightRadius:196,repelPressMultiplier:2.2,repelRadius:176,repelReturnSpring:2.8,repelSpring:7,rotationLag:.68,radius:156,smearCurl:.24,smearTrailLength:2.25}),c=Object.freeze({density:.55,driftSpeed:.2,enabled:!1,intensity:2,reach:.17,spread:.4,tightSpread:.03}),u=Object.freeze({animated:!0,enabled:!0,ghosts:.1,halo:.12,intensity:.28,secondary:.55,streakLength:.03485,streaks:.18,verticalStreaks:1}),h=Object.freeze({distortion:.68,drift:!0,driftStrength:.28,enabled:!0,grain:.031,procedural:0,texture:0}),f=Object.freeze({accretionRatio:.42,ambientAmount:.04,ambientSpeed:.55,coreIntensity:1.45,duration:8,exhaleStrength:.42,inwardStrength:1.2,propagationSoftness:.16,settleDuration:1.2,startScale:.58}),d=Object.freeze({duration:8,growthSpeed:.55,softness:.075,startZoom:4}),m=[{id:"astra",label:"Astra",colors:["#6DCBF4","#7AB1FE","#F87915","#FA994C","#F5F6FB"]},{id:"aurora",label:"Aurora",colors:["#47E2C2","#6DCBF4","#B06DFF","#E96AC8","#F5F6FB"]},{id:"ember",label:"Ember",colors:["#F7CB59","#FA994C","#F67576","#B06DFF","#F5F6FB"]}];function x(){return{...a,accretionExhale:{...f},animationPreset:"converge-tilt",colorPalette:"astra",colorPaletteColors:[...m[0].colors],dirtyGlass:{...h},grow:{...d},interaction:{...l},interactionMode:"rotate",lensFlare:{...u},orbitalDust:{...c},stars:{...o}}}let g=Object.freeze({background:{ambientColor:"#23435F",ambientOpacity:.55},motion:{disperseDistance:800,headingTrailingSpaceVh:7,labelRevealDelay:.85,labelRevealDuration:1,labelStagger:.1},activationLine:.5,easing:"smoothstep"});function p(v,y,_){if(!y.scrollEffects)return{textOpacity:1,dispersion:0,progress:0};let D=(Number.isFinite(v)?v:0)-Math.max(y.scrollStartOffset,0),k=t(D/Math.max(y.scrollTextFadeDistance,1),0,1),z=Math.max(D/Math.max(y.scrollDisperseDistance,1),0),J=t(z,0,1);if(_){let Y=J<.5?0:1;return{textOpacity:+(k<.5),dispersion:Y,progress:Y}}return{textOpacity:1-k*k*k*(k*(6*k-15)+10),dispersion:J,progress:z}}function M(v,y){let _=t(Number.isFinite(v)?v:0,0,1);return y==="linear"?_:_*_*(3-2*_)}let S={spiral:{label:"Spiral field",width:100,height:100,paths:[],native:!0},star:{label:"Star",width:100,height:100,strokeWidth:3,paths:["M50 4 L61.8 36.3 L96.2 36.3 L68.4 56.3 L79 89.4 L50 69.5 L21 89.4 L31.6 56.3 L3.8 36.3 L38.2 36.3 Z"]},heart:{label:"Heart",width:100,height:100,strokeWidth:3,paths:["M50 88 C20 66 6 50 6 32 C6 18 17 8 30 8 C39 8 46 13 50 20 C54 13 61 8 70 8 C83 8 94 18 94 32 C94 50 80 66 50 88 Z"]},infinity:{label:"Infinity",width:200,height:100,strokeWidth:4,paths:["M100 50 C80 20 30 20 30 50 C30 80 80 80 100 50 C120 20 170 20 170 50 C170 80 120 80 100 50 Z"]},hexagon:{label:"Hexagon",width:100,height:100,strokeWidth:3,paths:["M50 4 L90 27 L90 73 L50 96 L10 73 L10 27 Z"]},custom:{label:"Custom SVG\u2026",width:100,height:100,strokeWidth:2,paths:[]}};function A(v){let y=v>>>0;return()=>{let _=y+=1831565813;return _=Math.imul(_^_>>>15,1|_),(((_^=_+Math.imul(_^_>>>7,61|_))^_>>>14)>>>0)/4294967296}}function P(v,y,_,D){let k=43758.5453*Math.sin(v*_+y*D);return k-Math.floor(k)}let R=[.08,.58,.22,.68,.44],F=new Map;function O(v,y){let _=(m.find(J=>J.id===v)??m[0]).colors,D=y?.length?y:_,k=D.join(","),z=F.get(k);return z||(z=D.map(J=>new Ve(J)),F.set(k,z)),z}let w=new Ve(1,1,1);function T(v,y,_,D,k,z){let J=w;if(_){let Y=O(k,z);J=k==="custom"||Y.length!==5?Y[Math.min(Math.floor(D*Y.length),Y.length-1)]:D<.36?Y[0]:D<.52?Y[1]:D<.64?Y[2]:D<.74?Y[3]:Y[4]}v[y]=J.r,v[y+1]=J.g,v[y+2]=J.b}let H=.12,V=.035,ae=.8,oe=.4,he=.28,le=.08,ue=6,X=.2;function be(v,y,_,D,k,z,J){let Y=t(k,0,1),ge=t(J,0,1);if(ge===0)return v.set(0,0);let Ee=e.lerp(.4,.8,Y),_e=e.lerp(.035,.12,Y)*ge,Xe=_*Math.PI*2+2.7*D,Re=D*Math.PI*2+3.1*k,ce=z*e.lerp(.08,.28,Y*Y)*ge;return v.set((Math.sin(Xe+y*Ee)-Math.sin(Xe))*_e,(Math.cos(Re+y*Ee*.73)-Math.cos(Re))*_e+ce)}let Ce=`
4047
+ #`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(r)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(r,e=Gi){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(r,e)}render(r,e,t,n,i){for(let s of this.effects)s.update(r,e,n);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=n*this.timeScale,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}}setSize(r,e){this.fullscreenMaterial.setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){this.renderer=r;for(let n of this.effects)n.initialize(r,e,t);this.updateMaterial(),t!==void 0&&t!==an&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let r of this.effects)r.removeEventListener("change",this.listener),r.dispose()}handleEvent(r){switch(r.type){case"change":this.recompile();break}}};var $E=[new Float32Array(3),new Float32Array(3)],eT=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],tT=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var nT=[new Float32Array(2),new Float32Array(2)];var iT=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),rT=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],sT=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],aT=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var oT=new Map([[oi(0,0,0,0),new Float32Array([0,0,0,0])],[oi(0,0,0,1),new Float32Array([0,0,0,1])],[oi(0,0,1,0),new Float32Array([0,0,1,0])],[oi(0,0,1,1),new Float32Array([0,0,1,1])],[oi(0,1,0,0),new Float32Array([0,1,0,0])],[oi(0,1,0,1),new Float32Array([0,1,0,1])],[oi(0,1,1,0),new Float32Array([0,1,1,0])],[oi(0,1,1,1),new Float32Array([0,1,1,1])],[oi(1,0,0,0),new Float32Array([1,0,0,0])],[oi(1,0,0,1),new Float32Array([1,0,0,1])],[oi(1,0,1,0),new Float32Array([1,0,1,0])],[oi(1,0,1,1),new Float32Array([1,0,1,1])],[oi(1,1,0,0),new Float32Array([1,1,0,0])],[oi(1,1,0,1),new Float32Array([1,1,0,1])],[oi(1,1,1,0),new Float32Array([1,1,1,0])],[oi(1,1,1,1),new Float32Array([1,1,1,1])]]);function rm(r,e,t){return r+(e-r)*t}function oi(r,e,t,n){let i=rm(r,e,.75),s=rm(t,n,1-.25);return rm(i,s,1-.125)}var gE=bt,zf=class r extends Hn{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,i){let s=this,a=new xi(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){let t=this;function n(se,W){if(se.nodeType!==1)return;let C=A(se),b=!1,re=null;switch(se.nodeName){case"svg":W=m(se,W);break;case"style":s(se);break;case"g":W=m(se,W);break;case"path":W=m(se,W),se.hasAttribute("d")&&(re=i(se));break;case"rect":W=m(se,W),re=l(se);break;case"polygon":W=m(se,W),re=c(se);break;case"polyline":W=m(se,W),re=u(se);break;case"circle":W=m(se,W),re=h(se);break;case"ellipse":W=m(se,W),re=f(se);break;case"line":W=m(se,W),re=d(se);break;case"defs":b=!0;break;case"use":W=m(se,W);let Ae=(se.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),Ue=se.viewportElement.getElementById(Ae);Ue?n(Ue,W):console.warn("SVGLoader: 'use node' references non-existent node id: "+Ae);break;default:}re&&(W.fill!==void 0&&W.fill!=="none"&&re.color.setStyle(W.fill,gE),R(re,We),V.push(re),re.userData={node:se,style:W});let xe=se.childNodes;for(let j=0;j<xe.length;j++){let Ae=xe[j];b&&Ae.nodeName!=="style"&&Ae.nodeName!=="defs"||n(Ae,W)}C&&(oe.pop(),oe.length>0?We.copy(oe[oe.length-1]):We.identity())}function i(se){let W=new ki,C=new K,b=new K,re=new K,xe=!0,j=!1,Ae=se.getAttribute("d");if(Ae===""||Ae==="none")return null;let Ue=Ae.match(/[a-df-z][^a-df-z]*/ig);for(let B=0,q=Ue.length;B<q;B++){let Q=Ue[B],ne=Q.charAt(0),te=Q.slice(1).trim();xe===!0&&(j=!0,xe=!1);let G;switch(ne){case"M":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"H":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"V":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"L":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"C":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(G[L+0],G[L+1],G[L+2],G[L+3],G[L+4],G[L+5]),b.x=G[L+2],b.y=G[L+3],C.x=G[L+4],C.y=G[L+5],L===0&&j===!0&&re.copy(C);break;case"S":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"Q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"T":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,G[L+0],G[L+1]),b.x=Oe,b.y=tt,C.x=G[L+0],C.y=G[L+1],L===0&&j===!0&&re.copy(C)}break;case"A":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==C.x&&G[L+6]==C.y)continue;let Oe=C.clone();C.x=G[L+5],C.y=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"m":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"h":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"v":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"l":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"c":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3],C.x+G[L+4],C.y+G[L+5]),b.x=C.x+G[L+2],b.y=C.y+G[L+3],C.x+=G[L+4],C.y+=G[L+5],L===0&&j===!0&&re.copy(C);break;case"s":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"t":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,C.x+G[L+0],C.y+G[L+1]),b.x=Oe,b.y=tt,C.x=C.x+G[L+0],C.y=C.y+G[L+1],L===0&&j===!0&&re.copy(C)}break;case"a":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==0&&G[L+6]==0)continue;let Oe=C.clone();C.x+=G[L+5],C.y+=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"Z":case"z":W.currentPath.autoClose=!0,W.currentPath.curves.length>0&&(C.copy(re),W.currentPath.currentPoint.copy(C),xe=!0);break;default:console.warn(Q)}j=!1}return W}function s(se){if(!(!se.sheet||!se.sheet.cssRules||!se.sheet.cssRules.length))for(let W=0;W<se.sheet.cssRules.length;W++){let C=se.sheet.cssRules[W];if(C.type!==1)continue;let b=C.selectorText.split(/,/gm).filter(Boolean).map(re=>re.trim());for(let re=0;re<b.length;re++){let xe=Object.fromEntries(Object.entries(C.style).filter(([,j])=>j!==""));ae[b[re]]=Object.assign(ae[b[re]]||{},xe)}}}function a(se,W,C,b,re,xe,j,Ae){if(W==0||C==0){se.lineTo(Ae.x,Ae.y);return}b=b*Math.PI/180,W=Math.abs(W),C=Math.abs(C);let Ue=(j.x-Ae.x)/2,B=(j.y-Ae.y)/2,q=Math.cos(b)*Ue+Math.sin(b)*B,Q=-Math.sin(b)*Ue+Math.cos(b)*B,ne=W*W,te=C*C,G=q*q,L=Q*Q,fe=G/ne+L/te;if(fe>1){let Be=Math.sqrt(fe);W=Be*W,C=Be*C,ne=W*W,te=C*C}let Oe=ne*L+te*G,tt=(ne*te-Oe)/Oe,N=Math.sqrt(Math.max(0,tt));re===xe&&(N=-N);let E=N*W*Q/C,$=-N*C*q/W,me=Math.cos(b)*E-Math.sin(b)*$+(j.x+Ae.x)/2,Me=Math.sin(b)*E+Math.cos(b)*$+(j.y+Ae.y)/2,ve=o(1,0,(q-E)/W,(Q-$)/C),je=o((q-E)/W,(Q-$)/C,(-q-E)/W,(-Q-$)/C)%(Math.PI*2);se.currentPath.absellipse(me,Me,W,C,ve,ve+je,xe===0,b)}function o(se,W,C,b){let re=se*C+W*b,xe=Math.sqrt(se*se+W*W)*Math.sqrt(C*C+b*b),j=Math.acos(Math.max(-1,Math.min(1,re/xe)));return se*b-W*C<0&&(j=-j),j}function l(se){let W=S(se.getAttribute("x")||0),C=S(se.getAttribute("y")||0),b=S(se.getAttribute("rx")||se.getAttribute("ry")||0),re=S(se.getAttribute("ry")||se.getAttribute("rx")||0),xe=S(se.getAttribute("width")),j=S(se.getAttribute("height")),Ae=1-.551915024494,Ue=new ki;return Ue.moveTo(W+b,C),Ue.lineTo(W+xe-b,C),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe-b*Ae,C,W+xe,C+re*Ae,W+xe,C+re),Ue.lineTo(W+xe,C+j-re),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe,C+j-re*Ae,W+xe-b*Ae,C+j,W+xe-b,C+j),Ue.lineTo(W+b,C+j),(b!==0||re!==0)&&Ue.bezierCurveTo(W+b*Ae,C+j,W,C+j-re*Ae,W,C+j-re),Ue.lineTo(W,C+re),(b!==0||re!==0)&&Ue.bezierCurveTo(W,C+re*Ae,W+b*Ae,C,W+b,C),Ue}function c(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!0,b}function u(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!1,b}function h(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("r")||0),re=new er;re.absarc(W,C,b,0,Math.PI*2);let xe=new ki;return xe.subPaths.push(re),xe}function f(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("rx")||0),re=S(se.getAttribute("ry")||0),xe=new er;xe.absellipse(W,C,b,re,0,Math.PI*2);let j=new ki;return j.subPaths.push(xe),j}function d(se){let W=S(se.getAttribute("x1")||0),C=S(se.getAttribute("y1")||0),b=S(se.getAttribute("x2")||0),re=S(se.getAttribute("y2")||0),xe=new ki;return xe.moveTo(W,C),xe.lineTo(b,re),xe.currentPath.autoClose=!1,xe}function m(se,W){W=Object.assign({},W);let C={};if(se.hasAttribute("class")){let j=se.getAttribute("class").split(/\s/).filter(Boolean).map(Ae=>Ae.trim());for(let Ae=0;Ae<j.length;Ae++)C=Object.assign(C,ae["."+j[Ae]])}se.hasAttribute("id")&&(C=Object.assign(C,ae["#"+se.getAttribute("id")]));function b(j,Ae,Ue){Ue===void 0&&(Ue=function(q){return q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),q}),se.hasAttribute(j)&&(W[Ae]=Ue(se.getAttribute(j))),C[j]&&(W[Ae]=Ue(C[j])),se.style&&se.style[j]!==""&&(W[Ae]=Ue(se.style[j]))}function re(j){return Math.max(0,Math.min(1,S(j)))}function xe(j){return Math.max(0,S(j))}return b("fill","fill"),b("fill-opacity","fillOpacity",re),b("fill-rule","fillRule"),b("opacity","opacity",re),b("stroke","stroke"),b("stroke-opacity","strokeOpacity",re),b("stroke-width","strokeWidth",xe),b("stroke-linejoin","strokeLineJoin"),b("stroke-linecap","strokeLineCap"),b("stroke-miterlimit","strokeMiterLimit",xe),b("visibility","visibility"),W}function x(se,W){return se-(W-se)}function g(se,W,C){if(typeof se!="string")throw new TypeError("Invalid input: "+typeof se);let b={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},re=0,xe=1,j=2,Ae=3,Ue=re,B=!0,q="",Q="",ne=[];function te(Oe,tt,N){let E=new SyntaxError('Unexpected character "'+Oe+'" at index '+tt+".");throw E.partial=N,E}function G(){q!==""&&(Q===""?ne.push(Number(q)):ne.push(Number(q)*Math.pow(10,Number(Q)))),q="",Q=""}let L,fe=se.length;for(let Oe=0;Oe<fe;Oe++){if(L=se[Oe],Array.isArray(W)&&W.includes(ne.length%C)&&b.FLAGS.test(L)){Ue=xe,q=L,G();continue}if(Ue===re){if(b.WHITESPACE.test(L))continue;if(b.DIGIT.test(L)||b.SIGN.test(L)){Ue=xe,q=L;continue}if(b.POINT.test(L)){Ue=j,q=L;continue}b.COMMA.test(L)&&(B&&te(L,Oe,ne),B=!0)}if(Ue===xe){if(b.DIGIT.test(L)){q+=L;continue}if(b.POINT.test(L)){q+=L,Ue=j;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.SIGN.test(L)&&q.length===1&&b.SIGN.test(q[0])&&te(L,Oe,ne)}if(Ue===j){if(b.DIGIT.test(L)){q+=L;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.POINT.test(L)&&q[q.length-1]==="."&&te(L,Oe,ne)}if(Ue===Ae){if(b.DIGIT.test(L)){Q+=L;continue}if(b.SIGN.test(L)){if(Q===""){Q+=L;continue}Q.length===1&&b.SIGN.test(Q)&&te(L,Oe,ne)}}b.WHITESPACE.test(L)?(G(),Ue=re,B=!1):b.COMMA.test(L)?(G(),Ue=re,B=!0):b.SIGN.test(L)?(G(),Ue=xe,q=L):b.POINT.test(L)?(G(),Ue=j,q=L):te(L,Oe,ne)}return G(),ne}let p=["mm","cm","in","pt","pc","px"],M={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function S(se){let W="px";if(typeof se=="string"||se instanceof String)for(let b=0,re=p.length;b<re;b++){let xe=p[b];if(se.endsWith(xe)){W=xe,se=se.substring(0,se.length-xe.length);break}}let C;return W==="px"&&t.defaultUnit!=="px"?C=M.in[t.defaultUnit]/t.defaultDPI:(C=M[W][t.defaultUnit],C<0&&(C=M[W].in*t.defaultDPI)),C*parseFloat(se)}function A(se){if(!(se.hasAttribute("transform")||se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))))return null;let W=P(se);return oe.length>0&&W.premultiply(oe[oe.length-1]),We.copy(W),oe.push(W),W}function P(se){let W=new ft,C=he;if(se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))){let b=S(se.getAttribute("x")),re=S(se.getAttribute("y"));W.translate(b,re)}if(se.hasAttribute("transform")){let b=se.getAttribute("transform").split(")");for(let re=b.length-1;re>=0;re--){let xe=b[re].trim();if(xe==="")continue;let j=xe.indexOf("("),Ae=xe.length;if(j>0&&j<Ae){let Ue=xe.slice(0,j),B=g(xe.slice(j+1));switch(C.identity(),Ue){case"translate":if(B.length>=1){let q=B[0],Q=0;B.length>=2&&(Q=B[1]),C.translate(q,Q)}break;case"rotate":if(B.length>=1){let q=0,Q=0,ne=0;q=B[0]*Math.PI/180,B.length>=3&&(Q=B[1],ne=B[2]),le.makeTranslation(-Q,-ne),ue.makeRotation(q),X.multiplyMatrices(ue,le),le.makeTranslation(Q,ne),C.multiplyMatrices(le,X)}break;case"scale":if(B.length>=1){let q=B[0],Q=q;B.length>=2&&(Q=B[1]),C.scale(q,Q)}break;case"skewX":B.length===1&&C.set(1,Math.tan(B[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":B.length===1&&C.set(1,0,0,Math.tan(B[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":B.length===6&&C.set(B[0],B[2],B[4],B[1],B[3],B[5],0,0,1);break}}W.premultiply(C)}}return W}function R(se,W){function C(j){Ce.set(j.x,j.y,1).applyMatrix3(W),j.set(Ce.x,Ce.y)}function b(j){let Ae=j.xRadius,Ue=j.yRadius,B=Math.cos(j.aRotation),q=Math.sin(j.aRotation),Q=new U(Ae*B,Ae*q,0),ne=new U(-Ue*q,Ue*B,0),te=Q.applyMatrix3(W),G=ne.applyMatrix3(W),L=he.set(te.x,G.x,0,te.y,G.y,0,0,0,1),fe=le.copy(L).invert(),N=ue.copy(fe).transpose().multiply(fe).elements,E=H(N[0],N[1],N[4]),$=Math.sqrt(E.rt1),me=Math.sqrt(E.rt2);if(j.xRadius=1/$,j.yRadius=1/me,j.aRotation=Math.atan2(E.sn,E.cs),!((j.aEndAngle-j.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let ve=le.set($,0,0,0,me,0,0,0,1),je=ue.set(E.cs,E.sn,0,-E.sn,E.cs,0,0,0,1),Be=ve.multiply(je).multiply(L),$e=et=>{let{x:Pe,y:qe}=new U(Math.cos(et),Math.sin(et),0).applyMatrix3(Be);return Math.atan2(qe,Pe)};j.aStartAngle=$e(j.aStartAngle),j.aEndAngle=$e(j.aEndAngle),F(W)&&(j.aClockwise=!j.aClockwise)}}function re(j){let Ae=w(W),Ue=T(W);j.xRadius*=Ae,j.yRadius*=Ue;let B=Ae>Number.EPSILON?Math.atan2(W.elements[1],W.elements[0]):Math.atan2(-W.elements[3],W.elements[4]);j.aRotation+=B,F(W)&&(j.aStartAngle*=-1,j.aEndAngle*=-1,j.aClockwise=!j.aClockwise)}let xe=se.subPaths;for(let j=0,Ae=xe.length;j<Ae;j++){let B=xe[j].curves;for(let q=0;q<B.length;q++){let Q=B[q];Q.isLineCurve?(C(Q.v1),C(Q.v2)):Q.isCubicBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2),C(Q.v3)):Q.isQuadraticBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2)):Q.isEllipseCurve&&(be.set(Q.aX,Q.aY),C(be),Q.aX=be.x,Q.aY=be.y,O(W)?b(Q):re(Q))}}}function F(se){let W=se.elements;return W[0]*W[4]-W[1]*W[3]<0}function O(se){let W=se.elements,C=W[0]*W[3]+W[1]*W[4];if(C===0)return!1;let b=w(se),re=T(se);return Math.abs(C/(b*re))>Number.EPSILON}function w(se){let W=se.elements;return Math.sqrt(W[0]*W[0]+W[1]*W[1])}function T(se){let W=se.elements;return Math.sqrt(W[3]*W[3]+W[4]*W[4])}function H(se,W,C){let b,re,xe,j,Ae,Ue=se+C,B=se-C,q=Math.sqrt(B*B+4*W*W);return Ue>0?(b=.5*(Ue+q),Ae=1/b,re=se*Ae*C-W*Ae*W):Ue<0?re=.5*(Ue-q):(b=.5*q,re=-.5*q),B>0?xe=B+q:xe=B-q,Math.abs(xe)>2*Math.abs(W)?(Ae=-2*W/xe,j=1/Math.sqrt(1+Ae*Ae),xe=Ae*j):Math.abs(W)===0?(xe=1,j=0):(Ae=-.5*xe/W,xe=1/Math.sqrt(1+Ae*Ae),j=Ae*xe),B>0&&(Ae=xe,xe=-j,j=Ae),{rt1:b,rt2:re,cs:xe,sn:j}}let V=[],ae={},oe=[],he=new ft,le=new ft,ue=new ft,X=new ft,be=new K,Ce=new U,We=new ft,ct=new DOMParser().parseFromString(e,"image/svg+xml");return n(ct.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:V,xml:ct.documentElement}}static createShapes(e){let n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:n.ORIGIN,t:0};function s(x,g,p,M){let S=x.x,A=g.x,P=p.x,R=M.x,F=x.y,O=g.y,w=p.y,T=M.y,H=(R-P)*(F-w)-(T-w)*(S-P),V=(A-S)*(F-w)-(O-F)*(S-P),ae=(T-w)*(A-S)-(R-P)*(O-F),oe=H/ae,he=V/ae;if(ae===0&&H!==0||oe<=0||oe>=1||he<0||he>1)return null;if(H===0&&ae===0){for(let le=0;le<2;le++)if(a(le===0?p:M,x,g),i.loc==n.ORIGIN){let ue=le===0?p:M;return{x:ue.x,y:ue.y,t:i.t}}else if(i.loc==n.BETWEEN){let ue=+(S+i.t*(A-S)).toPrecision(10),X=+(F+i.t*(O-F)).toPrecision(10);return{x:ue,y:X,t:i.t}}return null}else{for(let X=0;X<2;X++)if(a(X===0?p:M,x,g),i.loc==n.ORIGIN){let be=X===0?p:M;return{x:be.x,y:be.y,t:i.t}}let le=+(S+oe*(A-S)).toPrecision(10),ue=+(F+oe*(O-F)).toPrecision(10);return{x:le,y:ue,t:oe}}}function a(x,g,p){let M=p.x-g.x,S=p.y-g.y,A=x.x-g.x,P=x.y-g.y,R=M*P-A*S;if(x.x===g.x&&x.y===g.y){i.loc=n.ORIGIN,i.t=0;return}if(x.x===p.x&&x.y===p.y){i.loc=n.DESTINATION,i.t=1;return}if(R<-Number.EPSILON){i.loc=n.LEFT;return}if(R>Number.EPSILON){i.loc=n.RIGHT;return}if(M*A<0||S*P<0){i.loc=n.BEHIND;return}if(Math.sqrt(M*M+S*S)<Math.sqrt(A*A+P*P)){i.loc=n.BEYOND;return}let F;M!==0?F=A/M:F=P/S,i.loc=n.BETWEEN,i.t=F}function o(x,g){let p=[],M=[];for(let S=1;S<x.length;S++){let A=x[S-1],P=x[S];for(let R=1;R<g.length;R++){let F=g[R-1],O=g[R],w=s(A,P,F,O);w!==null&&p.find(T=>T.t<=w.t+Number.EPSILON&&T.t>=w.t-Number.EPSILON)===void 0&&(p.push(w),M.push(new K(w.x,w.y)))}}return M}function l(x,g,p){let M=new K;g.getCenter(M);let S=[];return p.forEach(A=>{A.boundingBox.containsPoint(M)&&o(x,A.points).forEach(R=>{S.push({identifier:A.identifier,isCW:A.isCW,point:R})})}),S.sort((A,P)=>A.point.x-P.point.x),S}function c(x,g,p,M,S){(S==null||S==="")&&(S="nonzero");let A=new K;x.boundingBox.getCenter(A);let P=[new K(p,A.y),new K(M,A.y)],R=l(P,x.boundingBox,g);R.sort((V,ae)=>V.point.x-ae.point.x);let F=[],O=[];R.forEach(V=>{V.identifier===x.identifier?F.push(V):O.push(V)});let w=F[0].point.x,T=[],H=0;for(;H<O.length&&O[H].point.x<w;)T.length>0&&T[T.length-1]===O[H].identifier?T.pop():T.push(O[H].identifier),H++;if(T.push(x.identifier),S==="evenodd"){let V=T.length%2===0,ae=T[T.length-2];return{identifier:x.identifier,isHole:V,for:ae}}else if(S==="nonzero"){let V=!0,ae=null,oe=null;for(let he=0;he<T.length;he++){let le=T[he];V?(oe=g[le].isCW,V=!1,ae=le):oe!==g[le].isCW&&(oe=g[le].isCW,V=!0)}return{identifier:x.identifier,isHole:V,for:ae}}else console.warn('fill-rule: "'+S+'" is currently not implemented.')}let u=999999999,h=-999999999,f=e.subPaths.map(x=>{let g=x.getPoints(),p=-999999999,M=999999999,S=-999999999,A=999999999;for(let P=0;P<g.length;P++){let R=g[P];R.y>p&&(p=R.y),R.y<M&&(M=R.y),R.x>S&&(S=R.x),R.x<A&&(A=R.x)}return h<=S&&(h=S+1),u>=A&&(u=A-1),{curves:x.curves,points:g,isCW:vi.isClockWise(g),identifier:-1,boundingBox:new mo(new K(A,M),new K(S,p))}});f=f.filter(x=>x.points.length>1);for(let x=0;x<f.length;x++)f[x].identifier=x;let d=f.map(x=>c(x,f,u,h,e.userData?e.userData.style.fillRule:void 0)),m=[];return f.forEach(x=>{if(!d[x.identifier].isHole){let p=new Bi;p.curves=x.curves,d.filter(S=>S.isHole&&S.for===x.identifier).forEach(S=>{let A=f[S.identifier],P=new er;P.curves=A.curves,p.holes.push(P)}),m.push(p)}}),m}static getStrokeStyle(e,t,n,i,s){return e=e!==void 0?e:1,t=t!==void 0?t:"#000",n=n!==void 0?n:"miter",i=i!==void 0?i:"butt",s=s!==void 0?s:4,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:i,strokeMiterLimit:s}}static pointsToStroke(e,t,n,i){let s=[],a=[],o=[];if(r.pointsToStrokeWithBuffers(e,t,n,i,s,a,o)===0)return null;let l=new dt;return l.setAttribute("position",new Te(s,3)),l.setAttribute("normal",new Te(a,3)),l.setAttribute("uv",new Te(o,2)),l}static pointsToStrokeWithBuffers(e,t,n,i,s,a,o,l){let c=new K,u=new K,h=new K,f=new K,d=new K,m=new K,x=new K,g=new K,p=new K,M=new K,S=new K,A=new K,P=new K,R=new K,F=new K,O=new K,w=new K;n=n!==void 0?n:12,i=i!==void 0?i:.001,l=l!==void 0?l:0,e=B(e);let T=e.length;if(T<2)return 0;let H=e[0].equals(e[T-1]),V,ae=e[0],oe,he=t.strokeWidth/2,le=1/(T-1),ue=0,X,be,Ce,We,ct=!1,Pt=0,se=l*3,W=l*2;C(e[0],e[1],c).multiplyScalar(he),g.copy(e[0]).sub(c),p.copy(e[0]).add(c),M.copy(g),S.copy(p);for(let q=1;q<T;q++){V=e[q],q===T-1?H?oe=e[1]:oe=void 0:oe=e[q+1];let Q=c;if(C(ae,V,Q),h.copy(Q).multiplyScalar(he),A.copy(V).sub(h),P.copy(V).add(h),X=ue+le,be=!1,oe!==void 0){C(V,oe,u),h.copy(u).multiplyScalar(he),R.copy(V).sub(h),F.copy(V).add(h),Ce=!0,h.subVectors(oe,ae),Q.dot(h)<0&&(Ce=!1),q===1&&(ct=Ce),h.subVectors(oe,V),h.normalize();let ne=Math.abs(Q.dot(h));if(ne>Number.EPSILON){let te=he/ne;h.multiplyScalar(-te),f.subVectors(V,ae),d.copy(f).setLength(te).add(h),O.copy(d).negate();let G=d.length(),L=f.length();f.divideScalar(L),m.subVectors(oe,V);let fe=m.length();switch(m.divideScalar(fe),f.dot(O)<L&&m.dot(O)<fe&&(be=!0),w.copy(d).add(V),O.add(V),We=!1,be?Ce?(F.copy(O),P.copy(O)):(R.copy(O),A.copy(O)):xe(),t.strokeLineJoin){case"bevel":j(Ce,be,X);break;case"round":Ae(Ce,be),Ce?re(V,A,R,X,0):re(V,F,P,X,1);break;case"miter":case"miter-clip":default:let Oe=he*t.strokeMiterLimit/G;if(Oe<1)if(t.strokeLineJoin!=="miter-clip"){j(Ce,be,X);break}else Ae(Ce,be),Ce?(m.subVectors(w,A).multiplyScalar(Oe).add(A),x.subVectors(w,R).multiplyScalar(Oe).add(R),b(A,X,0),b(m,X,0),b(V,X,.5),b(V,X,.5),b(m,X,0),b(x,X,0),b(V,X,.5),b(x,X,0),b(R,X,0)):(m.subVectors(w,P).multiplyScalar(Oe).add(P),x.subVectors(w,F).multiplyScalar(Oe).add(F),b(P,X,1),b(m,X,1),b(V,X,.5),b(V,X,.5),b(m,X,1),b(x,X,1),b(V,X,.5),b(x,X,1),b(F,X,1));else be?(Ce?(b(p,ue,1),b(g,ue,0),b(w,X,0),b(p,ue,1),b(w,X,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(w,X,1),b(g,ue,0),b(O,X,0),b(w,X,1)),Ce?R.copy(w):F.copy(w)):Ce?(b(A,X,0),b(w,X,0),b(V,X,.5),b(V,X,.5),b(w,X,0),b(R,X,0)):(b(P,X,1),b(w,X,1),b(V,X,.5),b(V,X,.5),b(w,X,1),b(F,X,1)),We=!0;break}}else xe()}else xe();!H&&q===T-1&&Ue(e[0],M,S,Ce,!0,ue),ue=X,ae=V,g.copy(R),p.copy(F)}if(!H)Ue(V,A,P,Ce,!1,X);else if(be&&s){let q=w,Q=O;ct!==Ce&&(q=O,Q=w),Ce?(We||ct)&&(Q.toArray(s,0*3),Q.toArray(s,3*3),We&&q.toArray(s,1*3)):(We||!ct)&&(Q.toArray(s,1*3),Q.toArray(s,3*3),We&&q.toArray(s,0*3))}return Pt;function C(q,Q,ne){return ne.subVectors(Q,q),ne.set(-ne.y,ne.x).normalize()}function b(q,Q,ne){s&&(s[se]=q.x,s[se+1]=q.y,s[se+2]=0,a&&(a[se]=0,a[se+1]=0,a[se+2]=1),se+=3,o&&(o[W]=Q,o[W+1]=ne,W+=2)),Pt+=3}function re(q,Q,ne,te,G){c.copy(Q).sub(q).normalize(),u.copy(ne).sub(q).normalize();let L=Math.PI,fe=c.dot(u);Math.abs(fe)<1&&(L=Math.abs(Math.acos(fe))),L/=n,h.copy(Q);for(let Oe=0,tt=n-1;Oe<tt;Oe++)f.copy(h).rotateAround(q,L),b(h,te,G),b(f,te,G),b(q,te,.5),h.copy(f);b(f,te,G),b(ne,te,G),b(q,te,.5)}function xe(){b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(P,X,1)}function j(q,Q,ne){Q?q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ne,0),b(R,ne,0),b(O,ne,.5)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ne,1),b(O,ne,0),b(F,ne,1)):q?(b(A,ne,0),b(R,ne,0),b(V,ne,.5)):(b(P,ne,1),b(F,ne,0),b(V,ne,.5))}function Ae(q,Q){Q&&(q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ue,0),b(V,X,.5),b(O,X,1),b(V,X,.5),b(R,ue,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ue,1),b(O,X,0),b(V,X,.5),b(V,X,.5),b(O,X,0),b(F,ue,1)))}function Ue(q,Q,ne,te,G,L){switch(t.strokeLineCap){case"round":G?re(q,ne,Q,L,.5):re(q,Q,ne,L,.5);break;case"square":if(G)c.subVectors(Q,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q),te?(h.toArray(s,1*3),f.toArray(s,0*3),f.toArray(s,3*3)):(h.toArray(s,1*3),o[3*2+1]===1?f.toArray(s,3*3):h.toArray(s,3*3),f.toArray(s,0*3));else{c.subVectors(ne,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q);let fe=s.length;te?(h.toArray(s,fe-1*3),f.toArray(s,fe-2*3),f.toArray(s,fe-4*3)):(f.toArray(s,fe-2*3),h.toArray(s,fe-1*3),f.toArray(s,fe-4*3))}break;case"butt":default:break}}function B(q){let Q=!1;for(let te=1,G=q.length-1;te<G;te++)if(q[te].distanceTo(q[te+1])<i){Q=!0;break}if(!Q)return q;let ne=[];ne.push(q[0]);for(let te=1,G=q.length-1;te<G;te++)q[te].distanceTo(q[te+1])>=i&&ne.push(q[te]);return ne.push(q[q.length-1]),ne}}};var vv="1.0.1",lm=[{key:"shape",label:"Shape",kind:"select",optionPath:"shape",defaultValue:"star",choices:["star","heart","infinity","hexagon","spiral","custom"]},{key:"transform",label:"Transform on scroll",kind:"select",optionPath:"transform",defaultValue:"load",choices:["scroll","load","off"]},{key:"interactionMode",label:"Interaction",kind:"select",optionPath:"interaction",defaultValue:"rotate",choices:["rotate","depth-lens","none"]},{key:"palette",label:"Palette",kind:"select",optionPath:"palette",defaultValue:"astra",choices:["astra","aurora","ember"]},{key:"background",label:"Background",kind:"select",optionPath:"background",defaultValue:"#000",choices:["#000","#0b0f1a","transparent"]},{key:"holdAtEnd",label:"Hold shape after scrolling past",kind:"checkbox",optionPath:"holdAtEnd",defaultValue:!1},{key:"parallax",label:"Scroll parallax while dispersed",kind:"checkbox",optionPath:"parallax",defaultValue:!0},{key:"ambient",label:"Ambient glow + vignette",kind:"checkbox",optionPath:"ambient",defaultValue:!1},{key:"padding",label:"Padding",kind:"range",optionPath:"padding",defaultValue:.1,min:0,max:.4,step:.01},{key:"pathShapeAutoRotateAmount",label:"Auto-rotate amount",kind:"range",optionPath:"config.pathShapeAutoRotateAmount",defaultValue:.42,min:0,max:1.2,step:.01},{key:"pathShapeScatter",label:"Shape scatter",kind:"range",optionPath:"config.pathShapeScatter",defaultValue:1,min:0,max:3,step:.01},{key:"rotationDepth",label:"Shape depth",kind:"range",optionPath:"config.rotationDepth",defaultValue:1.4,min:0,max:2,step:.01},{key:"stars.density",label:"Star density",kind:"range",optionPath:"config.stars.density",defaultValue:4,min:.25,max:4,step:.05},{key:"stars.intensity",label:"Star intensity",kind:"range",optionPath:"config.stars.intensity",defaultValue:1.35,min:.1,max:3,step:.01},{key:"stars.size",label:"Star size",kind:"range",optionPath:"config.stars.size",defaultValue:2.05,min:.25,max:3,step:.01},{key:"bloomIntensity",label:"Bloom",kind:"range",optionPath:"config.bloomIntensity",defaultValue:.7,min:0,max:2,step:.01},{key:"lensFlare.intensity",label:"Lens flare",kind:"range",optionPath:"config.lensFlare.intensity",defaultValue:.28,min:0,max:1.5,step:.01},{key:"interaction.repelRadius",label:"Pointer repel radius",kind:"range",optionPath:"config.interaction.repelRadius",defaultValue:176,min:16,max:360,step:1},{key:"pathShapeAutoRotate",label:"Auto-rotate shape",kind:"checkbox",optionPath:"config.pathShapeAutoRotate",defaultValue:!0},{key:"faceForward",label:"Return to front on release",kind:"checkbox",optionPath:"config.faceForward",defaultValue:!0},{key:"interaction.particleRepel",label:"Pointer repels particles",kind:"checkbox",optionPath:"config.interaction.particleRepel",defaultValue:!0},{key:"lensFlare.enabled",label:"Lens flare",kind:"checkbox",optionPath:"config.lensFlare.enabled",defaultValue:!0},{key:"dirtyGlass.enabled",label:"Dirty glass + grain",kind:"checkbox",optionPath:"config.dirtyGlass.enabled",defaultValue:!0},{key:"orbitalDust.enabled",label:"Orbital dust",kind:"checkbox",optionPath:"config.orbitalDust.enabled",defaultValue:!1},{key:"showCenterCluster",label:"Center cluster",kind:"checkbox",optionPath:"config.showCenterCluster",defaultValue:!0}];function vE(){return JSON.parse(JSON.stringify(lm))}function cm(){if(typeof window>"u"||typeof document>"u")throw new Error("Shape Cue requires a browser. Initialize it after mounting.");let r=Symbol.for("@uxpilot/openai-astra-shape-cue/"+vv);if(window[r])return window[r];let{MathUtils:e}=tm,t=(v,y,_)=>Math.min(_,Math.max(y,v)),n=(v,y)=>(v%y+y)%y,i=v=>typeof v=="number"&&Number.isFinite(v),s=32,a=Object.freeze({animationPlaying:!0,animationRestartKey:0,bloomIntensity:.7,bloomThreshold:.08,colorMode:!0,convergeDuration:5.5,faceForward:!0,pathShapeAutoRotate:!0,pathShapeAutoRotateAmount:.42,pathShapeAutoRotateSpeed:.22,pathShapeScatter:1,rotationDepth:1.4,scrollDisperseDistance:800,scrollEffects:!0,scrollStarDriftSpeed:3,scrollStartOffset:0,scrollTextFadeDistance:200,showCenterCluster:!0}),o=Object.freeze({density:4,densityFalloff:.22,flowInward:!0,flowSpeed:.8,intensity:1.35,scatter:.4,size:2.05,sizeFalloff:.45,twinkleSpeed:.62}),l=Object.freeze({depthDisplacement:.5,followDamping:6,illumination:.55,magnification:.18,particleRepel:!0,repelDistance:52,repelFalloff:2,repelHighlight:.16,repelHighlightRadius:196,repelPressMultiplier:2.2,repelRadius:176,repelReturnSpring:2.8,repelSpring:7,rotationLag:.68,radius:156,smearCurl:.24,smearTrailLength:2.25}),c=Object.freeze({density:.55,driftSpeed:.2,enabled:!1,intensity:2,reach:.17,spread:.4,tightSpread:.03}),u=Object.freeze({animated:!0,enabled:!0,ghosts:.1,halo:.12,intensity:.28,secondary:.55,streakLength:.03485,streaks:.18,verticalStreaks:1}),h=Object.freeze({distortion:.68,drift:!0,driftStrength:.28,enabled:!0,grain:.031,procedural:0,texture:0}),f=Object.freeze({accretionRatio:.42,ambientAmount:.04,ambientSpeed:.55,coreIntensity:1.45,duration:8,exhaleStrength:.42,inwardStrength:1.2,propagationSoftness:.16,settleDuration:1.2,startScale:.58}),d=Object.freeze({duration:8,growthSpeed:.55,softness:.075,startZoom:4}),m=[{id:"astra",label:"Astra",colors:["#6DCBF4","#7AB1FE","#F87915","#FA994C","#F5F6FB"]},{id:"aurora",label:"Aurora",colors:["#47E2C2","#6DCBF4","#B06DFF","#E96AC8","#F5F6FB"]},{id:"ember",label:"Ember",colors:["#F7CB59","#FA994C","#F67576","#B06DFF","#F5F6FB"]}];function x(){return{...a,accretionExhale:{...f},animationPreset:"converge-tilt",colorPalette:"astra",colorPaletteColors:[...m[0].colors],dirtyGlass:{...h},grow:{...d},interaction:{...l},interactionMode:"rotate",lensFlare:{...u},orbitalDust:{...c},stars:{...o}}}let g=Object.freeze({background:{ambientColor:"#23435F",ambientOpacity:.55},motion:{disperseDistance:800,headingTrailingSpaceVh:7,labelRevealDelay:.85,labelRevealDuration:1,labelStagger:.1},activationLine:.5,easing:"smoothstep"});function p(v,y,_){if(!y.scrollEffects)return{textOpacity:1,dispersion:0,progress:0};let D=(Number.isFinite(v)?v:0)-Math.max(y.scrollStartOffset,0),k=t(D/Math.max(y.scrollTextFadeDistance,1),0,1),z=Math.max(D/Math.max(y.scrollDisperseDistance,1),0),J=t(z,0,1);if(_){let Y=J<.5?0:1;return{textOpacity:+(k<.5),dispersion:Y,progress:Y}}return{textOpacity:1-k*k*k*(k*(6*k-15)+10),dispersion:J,progress:z}}function M(v,y){let _=t(Number.isFinite(v)?v:0,0,1);return y==="linear"?_:_*_*(3-2*_)}let S={spiral:{label:"Spiral field",width:100,height:100,paths:[],native:!0},star:{label:"Star",width:100,height:100,strokeWidth:3,paths:["M50 4 L61.8 36.3 L96.2 36.3 L68.4 56.3 L79 89.4 L50 69.5 L21 89.4 L31.6 56.3 L3.8 36.3 L38.2 36.3 Z"]},heart:{label:"Heart",width:100,height:100,strokeWidth:3,paths:["M50 88 C20 66 6 50 6 32 C6 18 17 8 30 8 C39 8 46 13 50 20 C54 13 61 8 70 8 C83 8 94 18 94 32 C94 50 80 66 50 88 Z"]},infinity:{label:"Infinity",width:200,height:100,strokeWidth:4,paths:["M100 50 C80 20 30 20 30 50 C30 80 80 80 100 50 C120 20 170 20 170 50 C170 80 120 80 100 50 Z"]},hexagon:{label:"Hexagon",width:100,height:100,strokeWidth:3,paths:["M50 4 L90 27 L90 73 L50 96 L10 73 L10 27 Z"]},custom:{label:"Custom SVG\u2026",width:100,height:100,strokeWidth:2,paths:[]}};function A(v){let y=v>>>0;return()=>{let _=y+=1831565813;return _=Math.imul(_^_>>>15,1|_),(((_^=_+Math.imul(_^_>>>7,61|_))^_>>>14)>>>0)/4294967296}}function P(v,y,_,D){let k=43758.5453*Math.sin(v*_+y*D);return k-Math.floor(k)}let R=[.08,.58,.22,.68,.44],F=new Map;function O(v,y){let _=(m.find(J=>J.id===v)??m[0]).colors,D=y?.length?y:_,k=D.join(","),z=F.get(k);return z||(z=D.map(J=>new Ve(J)),F.set(k,z)),z}let w=new Ve(1,1,1);function T(v,y,_,D,k,z){let J=w;if(_){let Y=O(k,z);J=k==="custom"||Y.length!==5?Y[Math.min(Math.floor(D*Y.length),Y.length-1)]:D<.36?Y[0]:D<.52?Y[1]:D<.64?Y[2]:D<.74?Y[3]:Y[4]}v[y]=J.r,v[y+1]=J.g,v[y+2]=J.b}let H=.12,V=.035,ae=.8,oe=.4,he=.28,le=.08,ue=6,X=.2;function be(v,y,_,D,k,z,J){let Y=t(k,0,1),ge=t(J,0,1);if(ge===0)return v.set(0,0);let Ee=e.lerp(.4,.8,Y),_e=e.lerp(.035,.12,Y)*ge,Xe=_*Math.PI*2+2.7*D,Re=D*Math.PI*2+3.1*k,ce=z*e.lerp(.08,.28,Y*Y)*ge;return v.set((Math.sin(Xe+y*Ee)-Math.sin(Xe))*_e,(Math.cos(Re+y*Ee*.73)-Math.cos(Re))*_e+ce)}let Ce=`
4048
4048
  vec4 astraCoast(vec4 state, float mass, float age) {
4049
4049
  float drag = 2.3 / sqrt(mass);
4050
4050
  float velocityDecay = exp(-drag * age);
@@ -4819,7 +4819,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4819
4819
  #include <tonemapping_fragment>
4820
4820
  #include <colorspace_fragment>
4821
4821
  }
4822
- `;else{ze=new uv(ye,{depthBuffer:!1,frameBufferType:ir,multisampling:z.multisampling}),qt(Lt(new pv(_e,ce)));let Dt=[Tt=Lt(new pt({blendFunction:Rt.ADD,intensity:y.bloomIntensity,levels:z.bloomLevels,luminanceSmoothing:.18,luminanceThreshold:y.bloomThreshold,mipmapBlur:!0,radius:.72}))];if(z.optics){let yt=St();ge.add(yt),ht=Lt(new cu(y.lensFlare,yt,y.dirtyGlass,z.optics)),Dt.push(ht)}Dt.push(Lt(new mv({mode:fi.ACES_FILMIC})));let Bt=Lt(new gv(ce,...Dt));for(let yt of Dt)Y.delete(yt);qt(Bt)}return Ut(v.clientWidth,v.clientHeight),xt(),{field:st,camera:ce,animationRoot:Xe,spinRoot:Re,quality:z,ready:we,resize:Ut,dispose:Ze,render(Dt,Bt,yt=y,vn=!z.continuousMotion){if(J)return;let _t=Number.isFinite(Dt)?t(Dt,0,.05):0;if(ln&&Bt.particleMotion){let cn=Bt.particleMotion,nn=v.ownerDocument.defaultView;if(!gn&&!vn&&yt.interaction.particleRepel&&yt.interactionMode!=="none"&&nn?.requestIdleCallback&&nn.matchMedia?.("(any-hover: hover)")?.matches){gn=!0;let Qt=nn.requestIdleCallback(()=>{!J&&v.ownerDocument.visibilityState==="visible"&&cn.scrollCooldown===0&&ln.prepare(ye,ce)});Lt({dispose:()=>nn.cancelIdleCallback(Qt)})}ln.update(ye,ce,cn),ht?.setParticleMotion(ln.texture.value,ln.age.value,Nn,An)}if(Tt&&(It!==yt.bloomIntensity||Et!==yt.bloomThreshold)&&(It=yt.bloomIntensity,Et=yt.bloomThreshold,Tt.intensity=yt.bloomIntensity,Tt.luminanceMaterial.threshold=yt.bloomThreshold),ht){let cn=yt.lensFlare,nn=en;(nn?.animated!==cn.animated||nn.enabled!==cn.enabled||nn.ghosts!==cn.ghosts||nn.halo!==cn.halo||nn.intensity!==cn.intensity||nn.secondary!==cn.secondary||nn.streakLength!==cn.streakLength||nn.streaks!==cn.streaks||nn.verticalStreaks!==cn.verticalStreaks)&&(ht.setConfig(cn),en={...cn});let Qt=yt.dirtyGlass,Si=Fn;(Si?.distortion!==Qt.distortion||Si.drift!==Qt.drift||Si.driftStrength!==Qt.driftStrength||Si.enabled!==Qt.enabled||Si.grain!==Qt.grain||Si.procedural!==Qt.procedural||Si.texture!==Qt.texture)&&(ht.setDirtyGlass(Qt),Fn={...Qt});let Ai=t(Bt.scrollProgress,0,1),Pn=yt.scrollEffects?e.smootherstep(Ai,.5,1):0;ht.updateSources(st.coreSource,st.secondarySources,ce,vn?0:Bt.elapsed,vn,yt.showCenterCluster?1-Pn:0,{config:yt.interaction,lensPointer:Bt.lensPointer,lensStrength:yt.interactionMode==="depth-lens"?Bt.lensStrength:0}),ht.updateDirtDrift(Re.rotation.x,Re.rotation.y,Re.rotation.z,yt.dirtyGlass,vn)}ze?ze.render(_t):ye.render(_e,ce)}}}catch(at){Ze();try{ye?.forceContextLoss()}catch{}throw at}}let ia=e.degToRad(-52);function ar(v,y,_,D=6){let k=e.damp(v,y,D,_);return Math.abs(y-k)<=1e-4?y:k}let Di=(v,y)=>Math.abs(v-y)>.001;function fu(v,y,_,D,k,z,J,Y,ge,Ee,_e,Xe,Re,ce,Ne,we){let ye=v.uniforms;ye.uAccretionRatio.value=t(Ee.accretionRatio,.12,.72),ye.uAmbientPulse.value=Y,ye.uCoreIntensity.value=t(Ee.coreIntensity,.5,3),ye.uExhaleStrength.value=t(Ee.exhaleStrength,0,1.5),ye.uFormationEnabled.value=Number(y),ye.uFormationProgress.value=_,ye.uIntroProgress.value=D,ye.uGrowthEnabled.value=Number(k),ye.uGrowthProgress.value=z,ye.uGrowthSoftness.value=t(J,.005,.3),ye.uInwardStrength.value=t(Ee.inwardStrength,0,3),ye.uPropagationSoftness.value=t(Ee.propagationSoftness,0,.6),ye.uSettleRatio.value=ge,ye.uLensActive.value=_e,ye.uLensDepth.value=t(we.depthDisplacement,-1.5,1.5),ye.uLensIllumination.value=t(we.illumination,0,2),ye.uLensMagnification.value=t(we.magnification,-.3,.8),ye.uLensPointer.value.copy(Xe),ye.uLensRadius.value=Re,ye.uPointerRepelRadius.value=2*t(we.repelRadius,16,360)/Math.max(Ne,1),ye.uViewportAspect.value=ce}function Hf(v,y=0){let _=v.animationPreset==="accretion-exhale"?v.accretionExhale.duration:v.animationPreset==="grow"?v.grow.duration:v.animationPreset==="converge-tilt"?t(v.convergeDuration,1,10):10,D=v.animationPlaying&&y===0,k=G();return{elapsed:0,introElapsed:D?0:_,growthElapsed:D?0:_/v.grow.growthSpeed,coreTargetRotation:0,coreRotation:0,scrollProgress:t(y,0,1),tiltProgress:t(y,0,1),scatterScrollProgress:t(y,0,1.1875),scatterPositionProgress:0,shapePositionProgress:0,starsOpacity:1,hasResolvedInitialPose:!1,lastShapeId:null,lastShapeSamples:null,shapeProgress:0,shapeAutoRotation:0,introProgress:v.animationPreset==="converge-tilt"&&D?0:1,scatter:0,railPresence:0,railContentBounds:new K(0,1),spinRotation:new K,shapePointerRotation:new K,shapeRotation:new K,lensPointer:new K,lensStrength:0,particleMotion:{pointer:new K,previous:new K,impulse:new K,active:!1,pressed:!1,remaining:0,scrollCooldown:0,epoch:0,frame:0,delta:0},pathShapeTexture:k,scratch:{normal:new U,tangent:new U,next:new U,previous:new U,euler:new ni,formed:new U,relative:new U,position:new U,scattered:new U,dispersedOffset:new K,range:new K,center:new K,size:new K},dispose:()=>k.dispose()}}function Gf(v,y,_,D,k=!1){v.frame+=1,v.delta=D,v.impulse.set(0,0),v.scrollCooldown=k?.12:Math.max(0,v.scrollCooldown-D),(y.reset||!_&&(v.active||v.remaining>0))&&(v.epoch+=1,v.remaining=0,v.active=!1);let z=_&&y.active&&!y.pressed&&v.scrollCooldown===0;return z&&(v.previous.copy(v.pointer),v.pointer.set(y.x,y.y),v.active?(v.impulse.subVectors(v.pointer,v.previous),v.impulse.lengthSq()>1e-8&&(v.remaining=ue)):v.previous.copy(v.pointer)),v.active=z,v.pressed=y.pressed,v.remaining=Math.max(0,v.remaining-D),v.remaining>0}function Vf({state:v,config:y,input:_,camera:D,animationRoot:k,spinRoot:z,field:J,viewport:Y},ge,Ee=ge){if(!k||!z)return!1;let _e={width:Number.isFinite(Y.width)?Math.max(Y.width,1):1,height:Number.isFinite(Y.height)?Math.max(Y.height,1):1},Xe=Number.isFinite(ge)?t(ge,0,.05):0,Re=Number.isFinite(Ee)?t(Ee,0,.05):0,ce=y.scrollEffects?Math.max(_.progress,0):0,Ne=ce>0,we=!1;_.reducedMotion||(v.elapsed+=Xe);let ye=y.animationPreset==="accretion-exhale"?t(y.accretionExhale.duration,1,30):y.animationPreset==="grow"?t(y.grow.duration,1,30):y.animationPreset==="converge-tilt"?t(y.convergeDuration,1,10):10,ze=ye/t(y.grow.growthSpeed,.2,2);if(Ne&&(!v.hasResolvedInitialPose||y.animationPreset!=="converge-tilt"))v.introElapsed=ye,v.growthElapsed=ze;else if(!_.reducedMotion&&y.animationPlaying&&y.animationPreset!=="none"){let He=Math.min(v.introElapsed+Xe,ye);v.introElapsed=ye-He<=1e-4?ye:He}!Ne&&!_.reducedMotion&&y.animationPlaying&&y.animationPreset==="grow"&&(v.growthElapsed=Math.min(v.growthElapsed+Xe,ze));let st=_.reducedMotion||!y.animationPlaying||y.animationPreset==="none"?1:t(v.introElapsed/ye,0,1),ht=y.animationPreset==="converge-tilt"?st:1;v.introProgress=ht;let Tt=y.animationPreset==="legacy-zoom"?E(st):1,It=y.animationPreset==="accretion-exhale"?e.smootherstep(st,0,1):1,Et=y.animationPreset==="grow"?e.smootherstep(st,0,1):1,en=y.animationPreset==="grow"?_.reducedMotion||!y.animationPlaying?1:e.smootherstep(t(v.growthElapsed/ze,0,1),0,1):1,Fn=y.animationPreset==="grow"?e.smootherstep(en,.72,1):1,xt=t(ce,0,1),Ze=_.reducedMotion||!v.hasResolvedInitialPose,Lt=t(_.starsOpacity,0,1),qt=Ze?Lt:ar(v.starsOpacity,Lt,Re);v.starsOpacity=qt,qt!==Lt&&(we=!0);let at=Ze?xt:ar(v.scrollProgress,xt,Re);v.scrollProgress=at,at!==xt&&(we=!0);let ln=y.scrollEffects&&!_.reducedMotion&&_.tiltProgress!==null?t(_.tiltProgress,0,1):xt,Nn=Ze?ln:ar(v.tiltProgress,ln,Re);v.tiltProgress=Nn,Nn!==ln&&(we=!0);let An=_.reducedMotion?.5:.375,gn=_.reducedMotion?1:1.1875,Ut=y.scrollEffects&&!_.reducedMotion&&_.scatterProgress!==null?e.lerp(An,gn,t(_.scatterProgress,0,1)):t(ce,0,gn),Dt=Ze?Ut:ar(v.scatterScrollProgress,Ut,Re);v.scatterScrollProgress=Dt,Dt!==Ut&&(we=!0);let Bt=e.smootherstep(at,0,.5),yt=Math.sin(t(Nn/.75,0,1)*Math.PI*.5),vn=1-e.smootherstep(Nn,.75,1),_t=e.smootherstep(Dt,An,gn),cn=e.smoothstep(e.smootherstep(Ut,An,gn),0,1),nn=Ze?cn:ar(v.scatterPositionProgress,cn,Re,4);v.scatterPositionProgress=nn,nn!==cn&&(we=!0);let Qt=(1-_t)*e.smoothstep(ht,.55,1);v.scatter=_t;let Si=y.scrollEffects?e.lerp(1,.45,Bt):1;if(y.animationPreset==="legacy-zoom")k.scale.setScalar(e.lerp(2.35,1,Tt)),k.rotation.set(e.lerp(e.degToRad(-42),0,Tt),e.lerp(Math.PI,0,Tt),e.lerp(e.degToRad(5),0,Tt));else if(y.animationPreset==="accretion-exhale"){let He=e.smootherstep(It,t(y.accretionExhale.accretionRatio,.12,.72),1);k.scale.setScalar(e.lerp(t(y.accretionExhale.startScale,.3,1.25),1,He)),k.rotation.set(0,0,0)}else k.scale.setScalar(1),k.rotation.set(0,0,0);k.scale.setScalar(e.lerp(k.scale.x,1,_t)),k.rotation.x=e.lerp(k.rotation.x,0,Bt)+ia*yt*vn,k.rotation.y=e.lerp(k.rotation.y,0,Bt),k.rotation.z=e.lerp(k.rotation.z,0,Bt);let Ai=+(y.interactionMode==="rotate");if(_.reducedMotion)v.spinRotation.set(0,0),z.rotation.set(0,0,0);else{let He=1-Math.exp(-(_.returning?5.5:14)*Re),Mi=Ai*_.rotation.x,yn=Ai*_.rotation.y;v.spinRotation.x=e.lerp(v.spinRotation.x,Mi,He),v.spinRotation.y=e.lerp(v.spinRotation.y,yn,He),z.rotation.set(v.spinRotation.x*Qt,v.spinRotation.y*Qt,0),(Di(v.spinRotation.x,Mi)||Di(v.spinRotation.y,yn))&&(we=!0)}let Pn=_.pointer,du=Gf(v.particleMotion,Pn,J.particleMotionEnabled===!0&&!_.reducedMotion&&y.interaction.particleRepel&&y.interactionMode!=="none",Re,_.scrolling);Pn.reset&&(v.lensPointer.set(0,0),v.lensStrength=0,Pn.reset=!1);let pu=!_.reducedMotion&&y.interactionMode==="depth-lens",sa=1-Math.exp(-t(y.interaction.followDamping,1,30)*Re);if(_.reducedMotion)v.lensPointer.set(0,0),v.lensStrength=0;else{let He=pu&&Pn.active?1:0;v.lensPointer.x=e.lerp(v.lensPointer.x,Pn.x,sa),v.lensPointer.y=e.lerp(v.lensPointer.y,Pn.y,sa),v.lensStrength=e.lerp(v.lensStrength,He,sa),(Di(v.lensStrength,He)||He>0&&(Di(v.lensPointer.x,Pn.x)||Di(v.lensPointer.y,Pn.y)))&&(we=!0)}let Ro=+!!Pn.active,Do=!_.reducedMotion&&y.interactionMode==="depth-lens"&&(Math.abs(v.lensStrength-Ro)>1e-4||Pn.active&&(Math.abs(v.lensPointer.x-Pn.x)>1e-4||Math.abs(v.lensPointer.y-Pn.y)>1e-4));!Do&&y.interactionMode==="depth-lens"&&(v.lensStrength=Ro,Pn.active&&v.lensPointer.set(Pn.x,Pn.y));let Qn=y.interactionMode==="depth-lens"?v.lensStrength:0,fs=_e.width/Math.max(_e.height,1),lr=_e.width/Math.max(_e.height,1)<.72?12.7:10.9,un=lr*fs,Wt=_.shape;Wt.id&&Wt.samples&&(Wt.id!==v.lastShapeId||Wt.samples!==v.lastShapeSamples)&&(v.pathShapeTexture.image.data.set(Wt.samples),v.pathShapeTexture.needsUpdate=!0,v.lastShapeId=Wt.id,v.lastShapeSamples=Wt.samples);let xn=Ze?Wt.strength:ar(v.shapeProgress,Wt.strength,Re*5.5/t(y.convergeDuration,1,10));v.shapeProgress=xn;let aa=e.smoothstep(Wt.strength,0,1),zr=Ze?aa:ar(v.shapePositionProgress,aa,Re*5.5/t(y.convergeDuration,1,10),4);v.shapePositionProgress=zr,zr!==aa&&(we=!0);let vr=y.scrollEffects?t(_t*(1-xn),0,1):0,ds=_.reducedMotion?0:vr;v.railPresence=vr;let Io=_.reducedMotion?0:ce*t(y.scrollStarDriftSpeed,0,3),mu=e.lerp(1,.18,vr),Lo=e.lerp(1,.1,vr),Wf=e.lerp(1,.1,vr);if(v.hasResolvedInitialPose=!0,xn!==Wt.strength&&(we=!0),_.reducedMotion)v.shapeAutoRotation=0,v.shapePointerRotation.set(0,0),v.shapeRotation.set(0,0);else{let He=e.smootherstep(xn,.05,.4),Mi=1-Math.exp(-(_.returning?5.5:14)*Re),yn=Ai*_.rotation.x,Li=Ai*_.rotation.y;v.shapePointerRotation.x=e.lerp(v.shapePointerRotation.x,yn,Mi),v.shapePointerRotation.y=e.lerp(v.shapePointerRotation.y,Li,Mi);let gs=t(y.pathShapeAutoRotateAmount,0,1.2);v.shapeAutoRotation=0;let Hr=e.smootherstep(xn,.001,.12),oa=e.smootherstep(xn,.04,.82),Bo=Number(y.pathShapeAutoRotate&&y.animationPlaying),dn=e.lerp(-gs,0,oa)*Hr*Bo,Sn=oa>0&&oa<1?Math.sin(oa*Math.PI):0;v.shapeRotation.set(v.shapePointerRotation.x*He+-Sn*gs*.34*Hr*Bo,v.shapePointerRotation.y*He+dn),(Di(v.shapePointerRotation.x,yn)||Di(v.shapePointerRotation.y,Li))&&(we=!0)}v.scratch.center.set(Wt.centerNdc.x*un*.5,Wt.centerNdc.y*lr*.5),v.scratch.size.set(Wt.sizeNdc.x*un*.5,Wt.sizeNdc.y*lr*.5);let ps=Math.min(.5*Math.min(676,Math.max(_e.width-48,0))+48,.36*_e.width)/Math.max(_e.width,1)*un;v.railContentBounds.set(_.contentBounds?.left??.5-ps/un,_.contentBounds?.right??.5+ps/un);let hm=(v.railContentBounds.x-.5)*un,fm=(v.railContentBounds.y-.5)*un,dm=y.animationPreset==="grow"?e.smootherstep(Et,0,1):1,Mv=y.animationPreset==="grow"?e.lerp(0,1.2,dm):1.2,pm=e.lerp(Mv,0,Bt);D.position.set(0,pm,12),D.lookAt(0,pm,0);let _v=y.animationPreset==="grow"?e.lerp(t(y.grow.startZoom,1,8),1,dm):1;D.zoom=_e.height/lr*e.lerp(_v,1,_t),D.updateProjectionMatrix();let Ev=t(_.heroViewportHeight??_e.height,1,_e.height);k.position.y=(_e.height-Ev)/(2*D.zoom)*(1-_t)*(1-xn);let Uo=lr*fs*1.12,ms=1.12*lr,Tv=y.animationPreset==="legacy-zoom"?e.lerp(8,1,Tt):y.animationPreset==="accretion-exhale"?e.lerp(Math.max(1,4*y.accretionExhale.inwardStrength),1,It):1,Xf=t(y.accretionExhale.settleDuration/ye,.03,.4),mm=y.animationPreset==="accretion-exhale"&&It>=.999&&!_.reducedMotion?1+Math.sin(v.elapsed*t(y.accretionExhale.ambientSpeed,0,3)*Math.PI*2)*t(y.accretionExhale.ambientAmount,0,.16):1,gm=2*t(y.interaction.radius,32,360)/Math.max(_e.height,1);if(J.coreCluster){let He=.36*t(y.stars.flowSpeed,0,3),Mi=y.animationPreset!=="grow"&&y.stars.flowInward?1:-1;if(_.reducedMotion)v.coreTargetRotation=0,v.coreRotation=0;else{v.coreTargetRotation=n(v.coreTargetRotation+Xe*He*Mi+Math.PI,2*Math.PI)-Math.PI;let yn=1-Math.exp(-14*Re),Li=Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation));v.coreRotation=n(v.coreRotation+Li*yn+Math.PI,2*Math.PI)-Math.PI,!y.animationPlaying&&Xe===0&&Math.abs(Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation)))>.001&&(we=!0)}J.coreCluster.rotation.set(_.reducedMotion?0:.08*Math.sin(.22*v.elapsed)*Qt,_.reducedMotion?0:.14*Math.cos(.28*v.elapsed)*Qt,v.coreRotation*Qt)}let wv=t(y.interaction.rotationLag,0,1),bv=_.returning?5.5:14;for(let He of J.orbits){if(_.reducedMotion)He.spin.set(0,0);else{let Li=1-Math.exp(-(bv/(1+He.lag*wv*2.5))*Re),gs=Ai*_.rotation.x,Hr=Ai*_.rotation.y;He.spin.x=e.lerp(He.spin.x,gs,Li),He.spin.y=e.lerp(He.spin.y,Hr,Li),(Di(He.spin.x,gs)||Di(He.spin.y,Hr))&&(we=!0)}let Mi=0,yn=0;if(y.animationPreset==="legacy-zoom"){let Li=Tt-Tt**(1+.9*He.lag);Mi=e.degToRad(-42*Li),yn=Math.PI*Li}He.group.rotation.set(Mi+He.spin.x*Qt*Ai-z.rotation.x,yn+He.spin.y*Qt*Ai-z.rotation.y,0)}for(let He of J.pathLayers){let Mi=He.isCore&&Wt.id?0:1,yn=y.animationPreset==="grow"?He.outwardSpeed:He.speed,Li=He.isCore?.022:Math.abs(yn),gs=e.smootherstep(xn,.08,.5);if(!_.reducedMotion)if(He.pathShapeTravel=n(He.pathShapeTravel+Xe*Li*(y.stars.flowInward?1:-1)*t(y.stars.flowSpeed,0,3)*gs,1),y.animationPreset==="grow"&&yn!==0){let Sn=Math.abs(yn)*t(y.stars.flowSpeed,0,3)*Fn;He.motionOffset=n(He.motionOffset+Xe*Sn*Math.sign(yn)*Qt,1),He.travel=n(He.phase+He.motionOffset,1)}else He.motionOffset=n(He.motionOffset+Xe*yn*t(y.stars.flowSpeed,0,3)*Qt,1),He.travel=n(He.travel+Xe*Tv*Math.abs(yn)*Qt,1);let Hr=_.reducedMotion?He.phase:He.travel,oa=yn<0?1-Hr:Hr,Bo=_.reducedMotion?0:y.animationPreset==="grow"?He.motionOffset:v.elapsed,dn=He.starMaterial.uniforms;if(dn.uTime.value=Bo,dn.uBackgroundStarsEnabled.value=+(y.animationPreset==="converge-tilt"&&!Wt.id),dn.uPathSpeed.value=y.animationPreset==="grow"&&yn!==0?1:yn,dn.uPathOffset.value=_.reducedMotion?0:He.motionOffset,dn.uPathShapeCenter.value.copy(v.scratch.center),dn.uPathShapeProgress.value=xn,dn.uPathShapePositionProgress.value=zr,dn.uPathShapeMotion.value=He.pathShapeTravel,dn.uPathShapeRotation.value.copy(v.shapeRotation),dn.uPathShapeScatter.value=t(y.pathShapeScatter,0,3),dn.uPathShapeSize.value.copy(v.scratch.size),dn.uPathShapeTexture.value=v.pathShapeTexture,dn.uGrowthDirection.value=yn<0?-1:1,dn.uFlowSpeed.value=y.animationPreset==="grow"&&yn!==0?Qt:t(y.stars.flowSpeed,0,3)*Qt,dn.uTwinkleSpeed.value=_.reducedMotion?0:t(y.stars.twinkleSpeed,0,2)*Qt,dn.uIntensity.value=t(y.stars.intensity*(He.isCore?1.22:1)*mu,.1,3)*qt*Mi,dn.uDispersedMotion.value=ds,dn.uScrollScatter.value=_t,dn.uScrollPositionProgress.value=nn,dn.uScrollDrift.value=Io,dn.uScrollSizeScale.value=Si,dn.uTextBounds.value.set(hm,fm),dn.uScatterSize.value.set(Uo,ms),fu(He.starMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow"&&!He.isCore,en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction),He.flareSource){let Sn=He.flarePathSamples,gu=Sn!==null,Cv=n(He.flareProgress+(_.reducedMotion?0:He.motionOffset),1),vu=gu?tt(Cv,y.stars.densityFalloff):0,la=vu,Yf=1,xu=1;if(gu&&y.animationPreset==="grow"){let Zn=yn<0?-1:1,cr=.24*(Zn>0?vu:1-vu),Gr=t((en-cr)/Math.max(1-cr,1e-4),0,1);xu=e.smoothstep(Gr,0,1),la=e.lerp(Zn>0?0:1,vu,xu),Yf=e.smoothstep(en,cr,cr+.025)}if(Sn){let Zn=1/Math.max(Math.floor(Sn.length/4)-1,1);$(Sn,la,v.scratch.position),$(Sn,Math.max(la-Zn,0),v.scratch.previous),$(Sn,Math.min(la+Zn,1),v.scratch.next),v.scratch.tangent.subVectors(v.scratch.next,v.scratch.previous).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize(),v.scratch.position.addScaledVector(v.scratch.normal,He.flareAcrossOffset*xu),v.scratch.position.z+=He.flareDepthOffset*xu}else v.scratch.position.copy(He.flareBasePosition);let yu=1;if(y.animationPreset==="accretion-exhale"){let Zn=Math.hypot(v.scratch.position.x,v.scratch.position.y),cr=t(It-Zn*y.accretionExhale.propagationSoftness*.018,0,1),Gr=t(y.accretionExhale.accretionRatio,.12,.72),vs=Math.max(Gr+.08,1-Xf),ua=e.smoothstep(cr,0,Gr),xr=e.smoothstep(cr,Gr,vs),ha=Zn>1e-4?v.scratch.position.x/Zn:0,Au=Zn>1e-4?v.scratch.position.y/Zn:0;v.scratch.formed.copy(v.scratch.position),v.scratch.formed.x+=ha*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.y+=Au*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.z+=.8*y.accretionExhale.inwardStrength,v.scratch.previous.set(.045*v.scratch.position.x,.045*v.scratch.position.y,.12*v.scratch.position.z),v.scratch.formed.lerp(v.scratch.previous,ua),v.scratch.formed.lerp(v.scratch.position,xr);let fa=Math.sin(xr*Math.PI)*(1-xr)*y.accretionExhale.exhaleStrength;v.scratch.formed.x+=ha*fa,v.scratch.formed.y+=Au*fa,v.scratch.position.copy(v.scratch.formed),yu=e.lerp(.06,.58,ua),yu=e.lerp(yu,1,xr)}let Fo=Math.fround(He.flareScatter.x),Su=Math.fround(He.flareScatter.y),ca=Math.fround(He.flareScatter.z),Pv=+(Math.fround(He.flareClearanceSeed)>=.72),vm=Fo<.5?-1:1,Rv=Math.sqrt(n(2*Fo,1)),Dv=vm*e.lerp(vm<0?-hm:fm,.5*Uo,Rv);be(v.scratch.dispersedOffset,Math.fround(Bo),Fo,Su,ca,Io,ds),v.scratch.scattered.set(e.lerp(Dv,(Fo-.5)*Uo,Pv)+v.scratch.dispersedOffset.x,n((Su-.5)*ms+v.scratch.dispersedOffset.y+.5*ms,ms)-.5*ms-Math.sin(nn*Math.PI)*(.15+.25*ca),(ca-.5)*.5),v.scratch.position.lerp(v.scratch.scattered,nn);let No=gu?fe(la):1,Oo=gu?Oe(la,y.stars.sizeFalloff):1;No=e.lerp(No,1,_t),Oo=e.lerp(Oo,1,_t);let xm=1,ym=1;if(Wt.samples&&(xn>0||zr>0)){me(Wt.samples,He.flareShapeSeed,v.scratch.range);let Zn=v.scratch.range.x,cr=v.scratch.range.y,Gr=Math.max(cr-Zn,.0009775171065493646),vs=tt(t((He.flareShapeSeed-Zn)/Gr,0,1)+He.pathShapeTravel/Gr,y.stars.densityFalloff),ua=Math.max(Math.floor(Wt.samples.length/4),1),xr=Math.max(ua-1,1),ha=t(Math.ceil(Zn*ua-.5),0,xr),Au=t(Math.max(Math.floor(cr*ua-.5),ha),ha,xr),fa=ha/xr,qf=Au/xr,Qf=e.lerp(fa,qf,vs),Am=Math.min(.0009775171065493646*s,Math.max(qf-fa,.0009775171065493646)*.2);$(Wt.samples,Qf,v.scratch.formed),$(Wt.samples,Math.max(Qf-Am,fa),v.scratch.previous),$(Wt.samples,Math.min(Qf+Am,qf),v.scratch.next),v.scratch.tangent.set((v.scratch.next.x-v.scratch.previous.x)*v.scratch.size.x+1e-4,(v.scratch.next.y-v.scratch.previous.y)*v.scratch.size.y,0).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize();let Fv=Math.sin(vs*Math.PI),Nv=Math.sin(vs*Math.PI*1.35+He.pathShapeDepthPhase)*He.pathShapeDepth*Fv,Mm=t(y.pathShapeScatter,0,3);v.scratch.relative.set(v.scratch.formed.x*v.scratch.size.x,v.scratch.formed.y*v.scratch.size.y,(Nv+.75*He.flareDepthOffset+He.flareShapeDepthScatter)*Mm).addScaledVector(v.scratch.normal,(1.1*He.flareAcrossOffset+He.flareShapeAcrossScatter)*Mm),v.scratch.euler.set(v.shapeRotation.x,v.shapeRotation.y,0,"YXZ"),v.scratch.relative.applyEuler(v.scratch.euler),v.scratch.formed.set(v.scratch.center.x+v.scratch.relative.x,v.scratch.center.y+v.scratch.relative.y,v.scratch.relative.z),v.scratch.position.lerp(v.scratch.formed,zr);let _m=e.smoothstep(v.scratch.relative.z,-1.15,1.15);No=e.lerp(No,fe(vs),xn),Oo=e.lerp(Oo,Oe(vs,y.stars.sizeFalloff),xn),xm=e.lerp(1,e.lerp(.78,1.18,_m),xn),ym=e.lerp(1,e.lerp(.72,1,_m),xn)}v.scratch.formed.set((Fo-.5)*Uo,(n(Su,1)-.5)*ms,(ca-.5)*.5),Pt(v.scratch.position,v.scratch.formed,ht,ca,Su);let Sm=se(ht,ca),Iv=Math.sqrt(Sm),Lv=e.smoothstep(Sm,0,X),Uv=y.animationPreset!=="grow"||He.isCore?1:.3+.7*Yf,Bv=No*Oo*xm*ym*yu*Yf*Uv*e.lerp(Si,1,xn)*Iv*Lv*Wf;He.flareSource.position.copy(v.scratch.position),He.flareSource.scale.setScalar(t(Bv,0,1)*qt*Mi)}if(He.dustMaterial){let Sn=He.dustMaterial.uniforms;Sn.uDispersedMotion.value=ds,Sn.uDriftSpeed.value=_.reducedMotion?0:t(y.orbitalDust.driftSpeed,0,1.5)*Qt,Sn.uScrollScatter.value=_t,Sn.uScrollPositionProgress.value=nn,Sn.uScrollDrift.value=Io,Sn.uStarVisibility.value=Qt,Sn.uTrailEnabled.value=Qt,Sn.uScatterSize.value.set(Uo,ms),Sn.uHeadProgress.value=oa,Sn.uDirection.value=yn<0?-1:1,Sn.uIntensity.value=t(y.orbitalDust.intensity*Lo,0,3),Sn.uLightReach.value=t(y.orbitalDust.reach,.02,.4)*(He.strong?1.15:1),Sn.uTime.value=_.reducedMotion?0:v.elapsed,fu(He.dustMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow",en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction)}}return we||Do||du}let li={pointer:"astra:pointer",replay:"astra:replay",return:"astra:return",rotate:"astra:rotate"},um=new Set([" ","ArrowDown","ArrowUp","End","Home","PageDown","PageUp","Spacebar"]),I="path, circle, ellipse, line, polyline, polygon, rect",ee=(v,y,_)=>{let D=t((v-y)/(_-y),0,1);return D*D*D*(D*(6*D-15)+10)},de=v=>String(Math.round(1e4*t(v,0,1))/1e4),pe=4*Math.PI,ie=v=>Number.isFinite(v)?t(v,-pe,pe):0,Le=v=>Number.isFinite(v)?t(v,-1,1):0;function Qe(v,y,_,D={},k=window){let z=i(D.shapeHeightVh)?t(D.shapeHeightVh,40,120):80,J=i(D.maxWidth)?t(D.maxWidth,240,960):576;v.className="astra-shapeCue",v.dataset.astraPathShape=y,v.dataset.astraScrollCue="true",v.style.setProperty("--astra-shape-height",`calc(${z/100} * var(--astra-viewport-height, 100vh))`),v.style.setProperty("--astra-shape-max-width",`${J}px`);let Y="http://www.w3.org/2000/svg",ge=document.createElementNS(Y,"svg");if(ge.setAttribute("aria-hidden","true"),ge.setAttribute("class","astra-shapeTarget"),ge.setAttribute("fill","none"),ge.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup)ge.innerHTML=_.markup;else for(let _e of _.paths){let Xe=document.createElementNS(Y,"path");Xe.setAttribute("d",_e),Xe.setAttribute("stroke","currentColor"),Xe.setAttribute("stroke-width",String(_.strokeWidth??1)),ge.appendChild(Xe)}let Ee=document.createElement("button");return Ee.type="button",Ee.className="astra-dragSurface",Ee.dataset.dragging="false",Ee.setAttribute("aria-label",D.interactionLabel??`Drag or use arrow keys to rotate the ${_.label?.toLowerCase()??"shape"}`),v.replaceChildren(ge,Ee),mt(Ee,k),v}function nt(v,y){let _=v instanceof SVGSVGElement?v:v.querySelector("svg.astra-shapeTarget, svg"),D=_?.viewBox.baseVal;if(!_||!D||D.width<=0||D.height<=0)return null;let k=_.getScreenCTM(),z=Array.from(_.querySelectorAll(I)).map(_e=>{try{let Xe=_e.getTotalLength(),Re=_e.getScreenCTM(),ce=k&&Re?k.inverse().multiply(Re):null;return Xe>0&&Number.isFinite(Xe)?{path:_e,length:Xe,matrix:ce}:null}catch{return null}}).filter(_e=>_e!==null),J=z.reduce((_e,Xe)=>_e+Xe.length,0);if(J<=0)return null;let Y=new Float32Array(4096),ge=0,Ee=0;for(let _e=0;_e<1024;_e+=1){let Xe=(_e+.5)/1024*J;for(;ge<z.length-1&&Xe>Ee+z[ge].length;)Ee+=z[ge].length,ge+=1;let{path:Re,length:ce,matrix:Ne}=z[ge],we=Re.getPointAtLength(Xe-Ee),ye=Ne?new DOMPoint(we.x,we.y).matrixTransform(Ne):we,ze=4*_e;Y[ze]=(ye.x-D.x)/D.width-.5,Y[ze+1]=.5-(ye.y-D.y)/D.height,Y[ze+2]=Ee/J,Y[ze+3]=(Ee+ce)/J}return Y.some(_e=>!Number.isFinite(_e))?null:{element:v,id:y,samples:Y,aspectRatio:D.width/D.height}}function Ke(v,y){v.dispatchEvent(new CustomEvent(li.pointer,{detail:y}))}function ut(v){if(v)try{v.target.hasPointerCapture(v.id)&&v.target.releasePointerCapture(v.id)}catch{}}function mt(v,y=window){let _=null,D=!1,k=!1,z=!1,J=ce=>y.dispatchEvent(new CustomEvent(li.rotate,{detail:ce})),Y=(ce,Ne,we)=>!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY)?!1:(D=Ne,k=we,Ke(y,{active:Ne,clientX:ce.clientX,clientY:ce.clientY,pressed:we}),!0),ge=()=>{(D||k)&&(D=!1,k=!1,Ke(y,{active:!1,clientX:0,clientY:0,pressed:!1}))},Ee=(ce,Ne=!0)=>{let we=_!==null||D||k||z,ye=_;_=null,ut(ye),z=!1,Ne&&(v.dataset.dragging="false"),we&&(ce?Y(ce,!0,!1):ge(),y.dispatchEvent(new Event(li.return)))};v.addEventListener("keydown",ce=>{let we={ArrowDown:{x:0,y:.08},ArrowLeft:{x:-.08,y:0},ArrowRight:{x:.08,y:0},ArrowUp:{x:0,y:-.08}}[ce.key];we&&(ce.preventDefault(),J(we))}),v.addEventListener("pointerdown",ce=>{if(!(!ce.isPrimary||ce.button!==0||_!==null||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))){try{v.setPointerCapture(ce.pointerId)}catch{return}if(_={id:ce.pointerId,target:v,x:ce.clientX,y:ce.clientY},!Y(ce,!0,!0)){let Ne=_;_=null,ut(Ne);return}z=!0,v.dataset.dragging="true"}}),v.addEventListener("pointermove",ce=>{if(!ce.isPrimary||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))return;let Ne=_;if(!(Ne&&(ce.pointerId!==Ne.id||ce.currentTarget!==Ne.target))){if(!Ne){if(ce.buttons!==0)return;Y(ce,!0,!1);return}Y(ce,!0,!0)&&(J({x:(ce.clientX-Ne.x)*.005,y:(ce.clientY-Ne.y)*.005}),Ne.x=ce.clientX,Ne.y=ce.clientY)}}),v.addEventListener("pointerup",ce=>{let Ne=_;if(Ne&&Ne.id===ce.pointerId&&Ne.target===ce.currentTarget){let we=v.getBoundingClientRect(),ye=ce.pointerType==="mouse"&&Number.isFinite(ce.clientX)&&Number.isFinite(ce.clientY)&&ce.clientX>=we.left&&ce.clientX<=we.right&&ce.clientY>=we.top&&ce.clientY<=we.bottom;Ee(ye?ce:void 0)}}),v.addEventListener("pointercancel",ce=>{let Ne=_;Ne&&Ne.id!==ce.pointerId||(Ne||ce.isPrimary&&D)&&Ee()}),v.addEventListener("pointerleave",ce=>{ce.isPrimary&&!_&&ge()}),v.addEventListener("lostpointercapture",ce=>{_?.id===ce.pointerId&&Ee()});let _e=()=>Ee(),Xe=()=>Ee(),Re=()=>{document.visibilityState==="hidden"&&Ee()};return window.addEventListener("blur",_e),y.addEventListener(li.replay,Xe),document.addEventListener("visibilitychange",Re),()=>{ut(_),_=null,window.removeEventListener("blur",_e),y.removeEventListener(li.replay,Xe),document.removeEventListener("visibilitychange",Re)}}function lt(v){let y=new DOMParser().parseFromString(v.trim(),"image/svg+xml"),_=y.querySelector("svg");if(!_||y.querySelector("parsererror"))throw new Error("That is not valid SVG markup.");let D=(_.getAttribute("viewBox")||"").trim().split(/[\s,]+/).map(Number),k=Number(_.getAttribute("width")),z=Number(_.getAttribute("height"));if(D.length===4&&D.every(Number.isFinite)&&(k=D[2],z=D[3]),!(k>0&&z>0))throw new Error("The SVG needs a viewBox (or width/height).");let J=Array.from(_.querySelectorAll(I));if(J.length===0)throw new Error("No path, line, polyline, polygon, circle, ellipse or rect found.");let Y=Math.max(k,z)/40,ge=J.map(Ee=>{let _e=document.createElementNS("http://www.w3.org/2000/svg",Ee.localName),Xe=new Set(["d","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","width","height","points","transform"]);for(let ce of Ee.attributes)Xe.has(ce.name)&&_e.setAttribute(ce.name,ce.value);for(let ce of["fill","stroke","stroke-width","style","class"])_e.removeAttribute(ce);_e.setAttribute("fill","none"),_e.setAttribute("stroke","currentColor"),_e.setAttribute("stroke-width",String(Y));let Re=_e.getAttribute("transform")||"";for(let ce=Ee.parentElement;ce&&ce!==_;ce=ce.parentElement){let Ne=ce.getAttribute("transform");Ne&&(Re=`${Ne} ${Re}`)}return Re.trim()&&_e.setAttribute("transform",Re.trim()),_e.outerHTML}).join("");return{label:"Custom",width:k,height:z,strokeWidth:Y,paths:[],markup:ge}}let Mt=Object.freeze({shape:"star",transform:"load",holdAtEnd:!1,interaction:"rotate",autoRotate:!0,palette:"astra",background:"#000",ambient:!1,padding:.1,parallax:!0,interactionLabel:null,tier:3,config:null});function Yt(v,y){if(!y||typeof y!="object")return v;for(let[_,D]of Object.entries(y))D&&typeof D=="object"&&!Array.isArray(D)&&v[_]&&typeof v[_]=="object"?Yt(v[_],D):v[_]=Array.isArray(D)?[...D]:D;return v}function fn(v){if(typeof v=="string"){if(S[v])return{id:v,def:S[v]};if(v.trim().startsWith("<"))return{id:"custom",def:{...S.custom,...lt(v),label:"Custom"}};throw new Error(`Unknown shape "${v}". Use one of: ${Object.keys(S).join(", ")} or SVG markup.`)}if(v&&typeof v=="object")return{id:v.id??"custom",def:{strokeWidth:1,paths:[],label:"Custom",...v}};throw new Error("shape must be a string or a shape definition object.")}let rn=`
4822
+ `;else{ze=new uv(ye,{depthBuffer:!1,frameBufferType:ir,multisampling:z.multisampling}),qt(Lt(new pv(_e,ce)));let Dt=[Tt=Lt(new pt({blendFunction:Rt.ADD,intensity:y.bloomIntensity,levels:z.bloomLevels,luminanceSmoothing:.18,luminanceThreshold:y.bloomThreshold,mipmapBlur:!0,radius:.72}))];if(z.optics){let yt=St();ge.add(yt),ht=Lt(new cu(y.lensFlare,yt,y.dirtyGlass,z.optics)),Dt.push(ht)}Dt.push(Lt(new mv({mode:fi.ACES_FILMIC})));let Bt=Lt(new gv(ce,...Dt));for(let yt of Dt)Y.delete(yt);qt(Bt)}return Ut(v.clientWidth,v.clientHeight),xt(),{field:st,camera:ce,animationRoot:Xe,spinRoot:Re,quality:z,ready:we,resize:Ut,dispose:Ze,render(Dt,Bt,yt=y,vn=!z.continuousMotion){if(J)return;let _t=Number.isFinite(Dt)?t(Dt,0,.05):0;if(ln&&Bt.particleMotion){let cn=Bt.particleMotion,nn=v.ownerDocument.defaultView;if(!gn&&!vn&&yt.interaction.particleRepel&&yt.interactionMode!=="none"&&nn?.requestIdleCallback&&nn.matchMedia?.("(any-hover: hover)")?.matches){gn=!0;let Qt=nn.requestIdleCallback(()=>{!J&&v.ownerDocument.visibilityState==="visible"&&cn.scrollCooldown===0&&ln.prepare(ye,ce)});Lt({dispose:()=>nn.cancelIdleCallback(Qt)})}ln.update(ye,ce,cn),ht?.setParticleMotion(ln.texture.value,ln.age.value,Nn,An)}if(Tt&&(It!==yt.bloomIntensity||Et!==yt.bloomThreshold)&&(It=yt.bloomIntensity,Et=yt.bloomThreshold,Tt.intensity=yt.bloomIntensity,Tt.luminanceMaterial.threshold=yt.bloomThreshold),ht){let cn=yt.lensFlare,nn=en;(nn?.animated!==cn.animated||nn.enabled!==cn.enabled||nn.ghosts!==cn.ghosts||nn.halo!==cn.halo||nn.intensity!==cn.intensity||nn.secondary!==cn.secondary||nn.streakLength!==cn.streakLength||nn.streaks!==cn.streaks||nn.verticalStreaks!==cn.verticalStreaks)&&(ht.setConfig(cn),en={...cn});let Qt=yt.dirtyGlass,Si=Fn;(Si?.distortion!==Qt.distortion||Si.drift!==Qt.drift||Si.driftStrength!==Qt.driftStrength||Si.enabled!==Qt.enabled||Si.grain!==Qt.grain||Si.procedural!==Qt.procedural||Si.texture!==Qt.texture)&&(ht.setDirtyGlass(Qt),Fn={...Qt});let Ai=t(Bt.scrollProgress,0,1),Pn=yt.scrollEffects?e.smootherstep(Ai,.5,1):0;ht.updateSources(st.coreSource,st.secondarySources,ce,vn?0:Bt.elapsed,vn,yt.showCenterCluster?1-Pn:0,{config:yt.interaction,lensPointer:Bt.lensPointer,lensStrength:yt.interactionMode==="depth-lens"?Bt.lensStrength:0}),ht.updateDirtDrift(Re.rotation.x,Re.rotation.y,Re.rotation.z,yt.dirtyGlass,vn)}ze?ze.render(_t):ye.render(_e,ce)}}}catch(at){Ze();try{ye?.forceContextLoss()}catch{}throw at}}let ia=e.degToRad(-52);function ar(v,y,_,D=6){let k=e.damp(v,y,D,_);return Math.abs(y-k)<=1e-4?y:k}let Di=(v,y)=>Math.abs(v-y)>.001;function fu(v,y,_,D,k,z,J,Y,ge,Ee,_e,Xe,Re,ce,Ne,we){let ye=v.uniforms;ye.uAccretionRatio.value=t(Ee.accretionRatio,.12,.72),ye.uAmbientPulse.value=Y,ye.uCoreIntensity.value=t(Ee.coreIntensity,.5,3),ye.uExhaleStrength.value=t(Ee.exhaleStrength,0,1.5),ye.uFormationEnabled.value=Number(y),ye.uFormationProgress.value=_,ye.uIntroProgress.value=D,ye.uGrowthEnabled.value=Number(k),ye.uGrowthProgress.value=z,ye.uGrowthSoftness.value=t(J,.005,.3),ye.uInwardStrength.value=t(Ee.inwardStrength,0,3),ye.uPropagationSoftness.value=t(Ee.propagationSoftness,0,.6),ye.uSettleRatio.value=ge,ye.uLensActive.value=_e,ye.uLensDepth.value=t(we.depthDisplacement,-1.5,1.5),ye.uLensIllumination.value=t(we.illumination,0,2),ye.uLensMagnification.value=t(we.magnification,-.3,.8),ye.uLensPointer.value.copy(Xe),ye.uLensRadius.value=Re,ye.uPointerRepelRadius.value=2*t(we.repelRadius,16,360)/Math.max(Ne,1),ye.uViewportAspect.value=ce}function Hf(v,y=0){let _=v.animationPreset==="accretion-exhale"?v.accretionExhale.duration:v.animationPreset==="grow"?v.grow.duration:v.animationPreset==="converge-tilt"?t(v.convergeDuration,1,10):10,D=v.animationPlaying&&y===0,k=G();return{elapsed:0,introElapsed:D?0:_,growthElapsed:D?0:_/v.grow.growthSpeed,coreTargetRotation:0,coreRotation:0,scrollProgress:t(y,0,1),tiltProgress:t(y,0,1),scatterScrollProgress:t(y,0,1.1875),scatterPositionProgress:0,shapePositionProgress:0,starsOpacity:1,hasResolvedInitialPose:!1,lastShapeId:null,lastShapeSamples:null,shapeProgress:0,shapeAutoRotation:0,introProgress:v.animationPreset==="converge-tilt"&&D?0:1,scatter:0,railPresence:0,railContentBounds:new K(0,1),spinRotation:new K,shapePointerRotation:new K,shapeRotation:new K,lensPointer:new K,lensStrength:0,particleMotion:{pointer:new K,previous:new K,impulse:new K,active:!1,pressed:!1,remaining:0,scrollCooldown:0,epoch:0,frame:0,delta:0},pathShapeTexture:k,scratch:{normal:new U,tangent:new U,next:new U,previous:new U,euler:new ni,formed:new U,relative:new U,position:new U,scattered:new U,dispersedOffset:new K,range:new K,center:new K,size:new K},dispose:()=>k.dispose()}}function Gf(v,y,_,D,k=!1){v.frame+=1,v.delta=D,v.impulse.set(0,0),v.scrollCooldown=k?.12:Math.max(0,v.scrollCooldown-D),(y.reset||!_&&(v.active||v.remaining>0))&&(v.epoch+=1,v.remaining=0,v.active=!1);let z=_&&y.active&&!y.pressed&&v.scrollCooldown===0;return z&&(v.previous.copy(v.pointer),v.pointer.set(y.x,y.y),v.active?(v.impulse.subVectors(v.pointer,v.previous),v.impulse.lengthSq()>1e-8&&(v.remaining=ue)):v.previous.copy(v.pointer)),v.active=z,v.pressed=y.pressed,v.remaining=Math.max(0,v.remaining-D),v.remaining>0}function Vf({state:v,config:y,input:_,camera:D,animationRoot:k,spinRoot:z,field:J,viewport:Y},ge,Ee=ge){if(!k||!z)return!1;let _e={width:Number.isFinite(Y.width)?Math.max(Y.width,1):1,height:Number.isFinite(Y.height)?Math.max(Y.height,1):1},Xe=Number.isFinite(ge)?t(ge,0,.05):0,Re=Number.isFinite(Ee)?t(Ee,0,.05):0,ce=y.scrollEffects?Math.max(_.progress,0):0,Ne=ce>0,we=!1;_.reducedMotion||(v.elapsed+=Xe);let ye=y.animationPreset==="accretion-exhale"?t(y.accretionExhale.duration,1,30):y.animationPreset==="grow"?t(y.grow.duration,1,30):y.animationPreset==="converge-tilt"?t(y.convergeDuration,1,10):10,ze=ye/t(y.grow.growthSpeed,.2,2);if(Ne&&(!v.hasResolvedInitialPose||y.animationPreset!=="converge-tilt"))v.introElapsed=ye,v.growthElapsed=ze;else if(!_.reducedMotion&&y.animationPlaying&&y.animationPreset!=="none"){let He=Math.min(v.introElapsed+Xe,ye);v.introElapsed=ye-He<=1e-4?ye:He}!Ne&&!_.reducedMotion&&y.animationPlaying&&y.animationPreset==="grow"&&(v.growthElapsed=Math.min(v.growthElapsed+Xe,ze));let st=_.reducedMotion||!y.animationPlaying||y.animationPreset==="none"?1:t(v.introElapsed/ye,0,1),ht=y.animationPreset==="converge-tilt"?st:1;v.introProgress=ht;let Tt=y.animationPreset==="legacy-zoom"?E(st):1,It=y.animationPreset==="accretion-exhale"?e.smootherstep(st,0,1):1,Et=y.animationPreset==="grow"?e.smootherstep(st,0,1):1,en=y.animationPreset==="grow"?_.reducedMotion||!y.animationPlaying?1:e.smootherstep(t(v.growthElapsed/ze,0,1),0,1):1,Fn=y.animationPreset==="grow"?e.smootherstep(en,.72,1):1,xt=t(ce,0,1),Ze=_.reducedMotion||!v.hasResolvedInitialPose,Lt=t(_.starsOpacity,0,1),qt=Ze?Lt:ar(v.starsOpacity,Lt,Re);v.starsOpacity=qt,qt!==Lt&&(we=!0);let at=Ze?xt:ar(v.scrollProgress,xt,Re);v.scrollProgress=at,at!==xt&&(we=!0);let ln=y.scrollEffects&&!_.reducedMotion&&_.tiltProgress!==null?t(_.tiltProgress,0,1):xt,Nn=Ze?ln:ar(v.tiltProgress,ln,Re);v.tiltProgress=Nn,Nn!==ln&&(we=!0);let An=_.reducedMotion?.5:.375,gn=_.reducedMotion?1:1.1875,Ut=y.scrollEffects&&!_.reducedMotion&&_.scatterProgress!==null?e.lerp(An,gn,t(_.scatterProgress,0,1)):t(ce,0,gn),Dt=Ze?Ut:ar(v.scatterScrollProgress,Ut,Re);v.scatterScrollProgress=Dt,Dt!==Ut&&(we=!0);let Bt=e.smootherstep(at,0,.5),yt=Math.sin(t(Nn/.75,0,1)*Math.PI*.5),vn=1-e.smootherstep(Nn,.75,1),_t=e.smootherstep(Dt,An,gn),cn=e.smoothstep(e.smootherstep(Ut,An,gn),0,1),nn=Ze?cn:ar(v.scatterPositionProgress,cn,Re,4);v.scatterPositionProgress=nn,nn!==cn&&(we=!0);let Qt=(1-_t)*e.smoothstep(ht,.55,1);v.scatter=_t;let Si=y.scrollEffects?e.lerp(1,.45,Bt):1;if(y.animationPreset==="legacy-zoom")k.scale.setScalar(e.lerp(2.35,1,Tt)),k.rotation.set(e.lerp(e.degToRad(-42),0,Tt),e.lerp(Math.PI,0,Tt),e.lerp(e.degToRad(5),0,Tt));else if(y.animationPreset==="accretion-exhale"){let He=e.smootherstep(It,t(y.accretionExhale.accretionRatio,.12,.72),1);k.scale.setScalar(e.lerp(t(y.accretionExhale.startScale,.3,1.25),1,He)),k.rotation.set(0,0,0)}else k.scale.setScalar(1),k.rotation.set(0,0,0);k.scale.setScalar(e.lerp(k.scale.x,1,_t)),k.rotation.x=e.lerp(k.rotation.x,0,Bt)+ia*yt*vn,k.rotation.y=e.lerp(k.rotation.y,0,Bt),k.rotation.z=e.lerp(k.rotation.z,0,Bt);let Ai=+(y.interactionMode==="rotate");if(_.reducedMotion)v.spinRotation.set(0,0),z.rotation.set(0,0,0);else{let He=1-Math.exp(-(_.returning?5.5:14)*Re),Mi=Ai*_.rotation.x,yn=Ai*_.rotation.y;v.spinRotation.x=e.lerp(v.spinRotation.x,Mi,He),v.spinRotation.y=e.lerp(v.spinRotation.y,yn,He),z.rotation.set(v.spinRotation.x*Qt,v.spinRotation.y*Qt,0),(Di(v.spinRotation.x,Mi)||Di(v.spinRotation.y,yn))&&(we=!0)}let Pn=_.pointer,du=Gf(v.particleMotion,Pn,J.particleMotionEnabled===!0&&!_.reducedMotion&&y.interaction.particleRepel&&y.interactionMode!=="none",Re,_.scrolling);Pn.reset&&(v.lensPointer.set(0,0),v.lensStrength=0,Pn.reset=!1);let pu=!_.reducedMotion&&y.interactionMode==="depth-lens",sa=1-Math.exp(-t(y.interaction.followDamping,1,30)*Re);if(_.reducedMotion)v.lensPointer.set(0,0),v.lensStrength=0;else{let He=pu&&Pn.active?1:0;v.lensPointer.x=e.lerp(v.lensPointer.x,Pn.x,sa),v.lensPointer.y=e.lerp(v.lensPointer.y,Pn.y,sa),v.lensStrength=e.lerp(v.lensStrength,He,sa),(Di(v.lensStrength,He)||He>0&&(Di(v.lensPointer.x,Pn.x)||Di(v.lensPointer.y,Pn.y)))&&(we=!0)}let Ro=+!!Pn.active,Do=!_.reducedMotion&&y.interactionMode==="depth-lens"&&(Math.abs(v.lensStrength-Ro)>1e-4||Pn.active&&(Math.abs(v.lensPointer.x-Pn.x)>1e-4||Math.abs(v.lensPointer.y-Pn.y)>1e-4));!Do&&y.interactionMode==="depth-lens"&&(v.lensStrength=Ro,Pn.active&&v.lensPointer.set(Pn.x,Pn.y));let Qn=y.interactionMode==="depth-lens"?v.lensStrength:0,fs=_e.width/Math.max(_e.height,1),lr=_e.width/Math.max(_e.height,1)<.72?12.7:10.9,un=lr*fs,Wt=_.shape;Wt.id&&Wt.samples&&(Wt.id!==v.lastShapeId||Wt.samples!==v.lastShapeSamples)&&(v.pathShapeTexture.image.data.set(Wt.samples),v.pathShapeTexture.needsUpdate=!0,v.lastShapeId=Wt.id,v.lastShapeSamples=Wt.samples);let xn=Ze?Wt.strength:ar(v.shapeProgress,Wt.strength,Re*5.5/t(y.convergeDuration,1,10));v.shapeProgress=xn;let aa=e.smoothstep(Wt.strength,0,1),zr=Ze?aa:ar(v.shapePositionProgress,aa,Re*5.5/t(y.convergeDuration,1,10),4);v.shapePositionProgress=zr,zr!==aa&&(we=!0);let vr=y.scrollEffects?t(_t*(1-xn),0,1):0,ds=_.reducedMotion?0:vr;v.railPresence=vr;let Io=_.reducedMotion?0:ce*t(y.scrollStarDriftSpeed,0,3),mu=e.lerp(1,.18,vr),Lo=e.lerp(1,.1,vr),Wf=e.lerp(1,.1,vr);if(v.hasResolvedInitialPose=!0,xn!==Wt.strength&&(we=!0),_.reducedMotion)v.shapeAutoRotation=0,v.shapePointerRotation.set(0,0),v.shapeRotation.set(0,0);else{let He=e.smootherstep(xn,.05,.4),Mi=1-Math.exp(-(_.returning?5.5:14)*Re),yn=Ai*_.rotation.x,Li=Ai*_.rotation.y;v.shapePointerRotation.x=e.lerp(v.shapePointerRotation.x,yn,Mi),v.shapePointerRotation.y=e.lerp(v.shapePointerRotation.y,Li,Mi);let gs=t(y.pathShapeAutoRotateAmount,0,1.2);v.shapeAutoRotation=0;let Hr=e.smootherstep(xn,.001,.12),oa=e.smootherstep(xn,.04,.82),Bo=Number(y.pathShapeAutoRotate&&y.animationPlaying),dn=e.lerp(-gs,0,oa)*Hr*Bo,Sn=oa>0&&oa<1?Math.sin(oa*Math.PI):0;v.shapeRotation.set(v.shapePointerRotation.x*He+-Sn*gs*.34*Hr*Bo,v.shapePointerRotation.y*He+dn),(Di(v.shapePointerRotation.x,yn)||Di(v.shapePointerRotation.y,Li))&&(we=!0)}v.scratch.center.set(Wt.centerNdc.x*un*.5,Wt.centerNdc.y*lr*.5),v.scratch.size.set(Wt.sizeNdc.x*un*.5,Wt.sizeNdc.y*lr*.5);let ps=Math.min(.5*Math.min(676,Math.max(_e.width-48,0))+48,.36*_e.width)/Math.max(_e.width,1)*un;v.railContentBounds.set(_.contentBounds?.left??.5-ps/un,_.contentBounds?.right??.5+ps/un);let hm=(v.railContentBounds.x-.5)*un,fm=(v.railContentBounds.y-.5)*un,dm=y.animationPreset==="grow"?e.smootherstep(Et,0,1):1,Mv=y.animationPreset==="grow"?e.lerp(0,1.2,dm):1.2,pm=e.lerp(Mv,0,Bt);D.position.set(0,pm,12),D.lookAt(0,pm,0);let _v=y.animationPreset==="grow"?e.lerp(t(y.grow.startZoom,1,8),1,dm):1;D.zoom=_e.height/lr*e.lerp(_v,1,_t),D.updateProjectionMatrix();let Ev=t(_.heroViewportHeight??_e.height,1,_e.height);k.position.y=(_e.height-Ev)/(2*D.zoom)*(1-_t)*(1-xn);let Uo=lr*fs*1.12,ms=1.12*lr,Tv=y.animationPreset==="legacy-zoom"?e.lerp(8,1,Tt):y.animationPreset==="accretion-exhale"?e.lerp(Math.max(1,4*y.accretionExhale.inwardStrength),1,It):1,Xf=t(y.accretionExhale.settleDuration/ye,.03,.4),mm=y.animationPreset==="accretion-exhale"&&It>=.999&&!_.reducedMotion?1+Math.sin(v.elapsed*t(y.accretionExhale.ambientSpeed,0,3)*Math.PI*2)*t(y.accretionExhale.ambientAmount,0,.16):1,gm=2*t(y.interaction.radius,32,360)/Math.max(_e.height,1);if(J.coreCluster){let He=.36*t(y.stars.flowSpeed,0,3),Mi=y.animationPreset!=="grow"&&y.stars.flowInward?1:-1;if(_.reducedMotion)v.coreTargetRotation=0,v.coreRotation=0;else{v.coreTargetRotation=n(v.coreTargetRotation+Xe*He*Mi+Math.PI,2*Math.PI)-Math.PI;let yn=1-Math.exp(-14*Re),Li=Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation));v.coreRotation=n(v.coreRotation+Li*yn+Math.PI,2*Math.PI)-Math.PI,!y.animationPlaying&&Xe===0&&Math.abs(Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation)))>.001&&(we=!0)}J.coreCluster.rotation.set(_.reducedMotion?0:.08*Math.sin(.22*v.elapsed)*Qt,_.reducedMotion?0:.14*Math.cos(.28*v.elapsed)*Qt,v.coreRotation*Qt)}let wv=t(y.interaction.rotationLag,0,1),bv=_.returning?5.5:14;for(let He of J.orbits){if(_.reducedMotion)He.spin.set(0,0);else{let Li=1-Math.exp(-(bv/(1+He.lag*wv*2.5))*Re),gs=Ai*_.rotation.x,Hr=Ai*_.rotation.y;He.spin.x=e.lerp(He.spin.x,gs,Li),He.spin.y=e.lerp(He.spin.y,Hr,Li),(Di(He.spin.x,gs)||Di(He.spin.y,Hr))&&(we=!0)}let Mi=0,yn=0;if(y.animationPreset==="legacy-zoom"){let Li=Tt-Tt**(1+.9*He.lag);Mi=e.degToRad(-42*Li),yn=Math.PI*Li}He.group.rotation.set(Mi+He.spin.x*Qt*Ai-z.rotation.x,yn+He.spin.y*Qt*Ai-z.rotation.y,0)}for(let He of J.pathLayers){let Mi=He.isCore&&Wt.id?0:1,yn=y.animationPreset==="grow"?He.outwardSpeed:He.speed,Li=He.isCore?.022:Math.abs(yn),gs=e.smootherstep(xn,.08,.5);if(!_.reducedMotion)if(He.pathShapeTravel=n(He.pathShapeTravel+Xe*Li*(y.stars.flowInward?1:-1)*t(y.stars.flowSpeed,0,3)*gs,1),y.animationPreset==="grow"&&yn!==0){let Sn=Math.abs(yn)*t(y.stars.flowSpeed,0,3)*Fn;He.motionOffset=n(He.motionOffset+Xe*Sn*Math.sign(yn)*Qt,1),He.travel=n(He.phase+He.motionOffset,1)}else He.motionOffset=n(He.motionOffset+Xe*yn*t(y.stars.flowSpeed,0,3)*Qt,1),He.travel=n(He.travel+Xe*Tv*Math.abs(yn)*Qt,1);let Hr=_.reducedMotion?He.phase:He.travel,oa=yn<0?1-Hr:Hr,Bo=_.reducedMotion?0:y.animationPreset==="grow"?He.motionOffset:v.elapsed,dn=He.starMaterial.uniforms;if(dn.uTime.value=Bo,dn.uBackgroundStarsEnabled.value=+(y.animationPreset==="converge-tilt"&&!Wt.id),dn.uPathSpeed.value=y.animationPreset==="grow"&&yn!==0?1:yn,dn.uPathOffset.value=_.reducedMotion?0:He.motionOffset,dn.uPathShapeCenter.value.copy(v.scratch.center),dn.uPathShapeProgress.value=xn,dn.uPathShapePositionProgress.value=zr,dn.uPathShapeMotion.value=He.pathShapeTravel,dn.uPathShapeRotation.value.copy(v.shapeRotation),dn.uPathShapeScatter.value=t(y.pathShapeScatter,0,3),dn.uPathShapeSize.value.copy(v.scratch.size),dn.uPathShapeTexture.value=v.pathShapeTexture,dn.uGrowthDirection.value=yn<0?-1:1,dn.uFlowSpeed.value=y.animationPreset==="grow"&&yn!==0?Qt:t(y.stars.flowSpeed,0,3)*Qt,dn.uTwinkleSpeed.value=_.reducedMotion?0:t(y.stars.twinkleSpeed,0,2)*Qt,dn.uIntensity.value=t(y.stars.intensity*(He.isCore?1.22:1)*mu,.1,3)*qt*Mi,dn.uDispersedMotion.value=ds,dn.uScrollScatter.value=_t,dn.uScrollPositionProgress.value=nn,dn.uScrollDrift.value=Io,dn.uScrollSizeScale.value=Si,dn.uTextBounds.value.set(hm,fm),dn.uScatterSize.value.set(Uo,ms),fu(He.starMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow"&&!He.isCore,en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction),He.flareSource){let Sn=He.flarePathSamples,gu=Sn!==null,Cv=n(He.flareProgress+(_.reducedMotion?0:He.motionOffset),1),vu=gu?tt(Cv,y.stars.densityFalloff):0,la=vu,Yf=1,xu=1;if(gu&&y.animationPreset==="grow"){let Zn=yn<0?-1:1,cr=.24*(Zn>0?vu:1-vu),Gr=t((en-cr)/Math.max(1-cr,1e-4),0,1);xu=e.smoothstep(Gr,0,1),la=e.lerp(Zn>0?0:1,vu,xu),Yf=e.smoothstep(en,cr,cr+.025)}if(Sn){let Zn=1/Math.max(Math.floor(Sn.length/4)-1,1);$(Sn,la,v.scratch.position),$(Sn,Math.max(la-Zn,0),v.scratch.previous),$(Sn,Math.min(la+Zn,1),v.scratch.next),v.scratch.tangent.subVectors(v.scratch.next,v.scratch.previous).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize(),v.scratch.position.addScaledVector(v.scratch.normal,He.flareAcrossOffset*xu),v.scratch.position.z+=He.flareDepthOffset*xu}else v.scratch.position.copy(He.flareBasePosition);let yu=1;if(y.animationPreset==="accretion-exhale"){let Zn=Math.hypot(v.scratch.position.x,v.scratch.position.y),cr=t(It-Zn*y.accretionExhale.propagationSoftness*.018,0,1),Gr=t(y.accretionExhale.accretionRatio,.12,.72),vs=Math.max(Gr+.08,1-Xf),ua=e.smoothstep(cr,0,Gr),xr=e.smoothstep(cr,Gr,vs),ha=Zn>1e-4?v.scratch.position.x/Zn:0,Au=Zn>1e-4?v.scratch.position.y/Zn:0;v.scratch.formed.copy(v.scratch.position),v.scratch.formed.x+=ha*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.y+=Au*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.z+=.8*y.accretionExhale.inwardStrength,v.scratch.previous.set(.045*v.scratch.position.x,.045*v.scratch.position.y,.12*v.scratch.position.z),v.scratch.formed.lerp(v.scratch.previous,ua),v.scratch.formed.lerp(v.scratch.position,xr);let fa=Math.sin(xr*Math.PI)*(1-xr)*y.accretionExhale.exhaleStrength;v.scratch.formed.x+=ha*fa,v.scratch.formed.y+=Au*fa,v.scratch.position.copy(v.scratch.formed),yu=e.lerp(.06,.58,ua),yu=e.lerp(yu,1,xr)}let Fo=Math.fround(He.flareScatter.x),Su=Math.fround(He.flareScatter.y),ca=Math.fround(He.flareScatter.z),Pv=+(Math.fround(He.flareClearanceSeed)>=.72),vm=Fo<.5?-1:1,Rv=Math.sqrt(n(2*Fo,1)),Dv=vm*e.lerp(vm<0?-hm:fm,.5*Uo,Rv);be(v.scratch.dispersedOffset,Math.fround(Bo),Fo,Su,ca,Io,ds),v.scratch.scattered.set(e.lerp(Dv,(Fo-.5)*Uo,Pv)+v.scratch.dispersedOffset.x,n((Su-.5)*ms+v.scratch.dispersedOffset.y+.5*ms,ms)-.5*ms-Math.sin(nn*Math.PI)*(.15+.25*ca),(ca-.5)*.5),v.scratch.position.lerp(v.scratch.scattered,nn);let No=gu?fe(la):1,Oo=gu?Oe(la,y.stars.sizeFalloff):1;No=e.lerp(No,1,_t),Oo=e.lerp(Oo,1,_t);let xm=1,ym=1;if(Wt.samples&&(xn>0||zr>0)){me(Wt.samples,He.flareShapeSeed,v.scratch.range);let Zn=v.scratch.range.x,cr=v.scratch.range.y,Gr=Math.max(cr-Zn,.0009775171065493646),vs=tt(t((He.flareShapeSeed-Zn)/Gr,0,1)+He.pathShapeTravel/Gr,y.stars.densityFalloff),ua=Math.max(Math.floor(Wt.samples.length/4),1),xr=Math.max(ua-1,1),ha=t(Math.ceil(Zn*ua-.5),0,xr),Au=t(Math.max(Math.floor(cr*ua-.5),ha),ha,xr),fa=ha/xr,qf=Au/xr,Qf=e.lerp(fa,qf,vs),Am=Math.min(.0009775171065493646*s,Math.max(qf-fa,.0009775171065493646)*.2);$(Wt.samples,Qf,v.scratch.formed),$(Wt.samples,Math.max(Qf-Am,fa),v.scratch.previous),$(Wt.samples,Math.min(Qf+Am,qf),v.scratch.next),v.scratch.tangent.set((v.scratch.next.x-v.scratch.previous.x)*v.scratch.size.x+1e-4,(v.scratch.next.y-v.scratch.previous.y)*v.scratch.size.y,0).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize();let Fv=Math.sin(vs*Math.PI),Nv=Math.sin(vs*Math.PI*1.35+He.pathShapeDepthPhase)*He.pathShapeDepth*Fv,Mm=t(y.pathShapeScatter,0,3);v.scratch.relative.set(v.scratch.formed.x*v.scratch.size.x,v.scratch.formed.y*v.scratch.size.y,(Nv+.75*He.flareDepthOffset+He.flareShapeDepthScatter)*Mm).addScaledVector(v.scratch.normal,(1.1*He.flareAcrossOffset+He.flareShapeAcrossScatter)*Mm),v.scratch.euler.set(v.shapeRotation.x,v.shapeRotation.y,0,"YXZ"),v.scratch.relative.applyEuler(v.scratch.euler),v.scratch.formed.set(v.scratch.center.x+v.scratch.relative.x,v.scratch.center.y+v.scratch.relative.y,v.scratch.relative.z),v.scratch.position.lerp(v.scratch.formed,zr);let _m=e.smoothstep(v.scratch.relative.z,-1.15,1.15);No=e.lerp(No,fe(vs),xn),Oo=e.lerp(Oo,Oe(vs,y.stars.sizeFalloff),xn),xm=e.lerp(1,e.lerp(.78,1.18,_m),xn),ym=e.lerp(1,e.lerp(.72,1,_m),xn)}v.scratch.formed.set((Fo-.5)*Uo,(n(Su,1)-.5)*ms,(ca-.5)*.5),Pt(v.scratch.position,v.scratch.formed,ht,ca,Su);let Sm=se(ht,ca),Iv=Math.sqrt(Sm),Lv=e.smoothstep(Sm,0,X),Uv=y.animationPreset!=="grow"||He.isCore?1:.3+.7*Yf,Bv=No*Oo*xm*ym*yu*Yf*Uv*e.lerp(Si,1,xn)*Iv*Lv*Wf;He.flareSource.position.copy(v.scratch.position),He.flareSource.scale.setScalar(t(Bv,0,1)*qt*Mi)}if(He.dustMaterial){let Sn=He.dustMaterial.uniforms;Sn.uDispersedMotion.value=ds,Sn.uDriftSpeed.value=_.reducedMotion?0:t(y.orbitalDust.driftSpeed,0,1.5)*Qt,Sn.uScrollScatter.value=_t,Sn.uScrollPositionProgress.value=nn,Sn.uScrollDrift.value=Io,Sn.uStarVisibility.value=Qt,Sn.uTrailEnabled.value=Qt,Sn.uScatterSize.value.set(Uo,ms),Sn.uHeadProgress.value=oa,Sn.uDirection.value=yn<0?-1:1,Sn.uIntensity.value=t(y.orbitalDust.intensity*Lo,0,3),Sn.uLightReach.value=t(y.orbitalDust.reach,.02,.4)*(He.strong?1.15:1),Sn.uTime.value=_.reducedMotion?0:v.elapsed,fu(He.dustMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow",en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction)}}return we||Do||du}let li={pointer:"astra:pointer",replay:"astra:replay",return:"astra:return",rotate:"astra:rotate"},um=new Set([" ","ArrowDown","ArrowUp","End","Home","PageDown","PageUp","Spacebar"]),I="path, circle, ellipse, line, polyline, polygon, rect",ee=(v,y,_)=>{let D=t((v-y)/(_-y),0,1);return D*D*D*(D*(6*D-15)+10)},de=v=>String(Math.round(1e4*t(v,0,1))/1e4),pe=4*Math.PI,ie=v=>Number.isFinite(v)?t(v,-pe,pe):0,Le=v=>Number.isFinite(v)?t(v,-1,1):0;function Qe(v,y,_,D={},k=window){let z=i(D.shapeHeightVh)?t(D.shapeHeightVh,40,120):80,J=i(D.maxWidth)?t(D.maxWidth,240,960):576;v.className="astra-shapeCue",v.dataset.astraPathShape=y,v.dataset.astraScrollCue="true",v.style.setProperty("--astra-shape-height",`calc(${z/100} * var(--astra-viewport-height, 100vh))`),v.style.setProperty("--astra-shape-max-width",`${J}px`);let Y="http://www.w3.org/2000/svg",ge=document.createElementNS(Y,"svg");if(ge.setAttribute("aria-hidden","true"),ge.setAttribute("class","astra-shapeTarget"),ge.setAttribute("fill","none"),ge.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup)ge.innerHTML=_.markup;else for(let _e of _.paths){let Xe=document.createElementNS(Y,"path");Xe.setAttribute("d",_e),Xe.setAttribute("stroke","currentColor"),Xe.setAttribute("stroke-width",String(_.strokeWidth??1)),ge.appendChild(Xe)}let Ee=document.createElement("button");return Ee.type="button",Ee.className="astra-dragSurface",Ee.dataset.dragging="false",Ee.setAttribute("aria-label",D.interactionLabel??`Drag or use arrow keys to rotate the ${_.label?.toLowerCase()??"shape"}`),v.replaceChildren(ge,Ee),mt(Ee,k),v}function nt(v,y){let _=v?.localName==="svg"&&v?.namespaceURI==="http://www.w3.org/2000/svg"?v:v.querySelector("svg.astra-shapeTarget, svg"),D=_?.viewBox.baseVal;if(!_||!D||D.width<=0||D.height<=0)return null;let k=_.getScreenCTM(),z=Array.from(_.querySelectorAll(I)).map(_e=>{try{let Xe=_e.getTotalLength(),Re=_e.getScreenCTM(),ce=k&&Re?k.inverse().multiply(Re):null;return Xe>0&&Number.isFinite(Xe)?{path:_e,length:Xe,matrix:ce}:null}catch{return null}}).filter(_e=>_e!==null),J=z.reduce((_e,Xe)=>_e+Xe.length,0);if(J<=0)return null;let Y=new Float32Array(4096),ge=0,Ee=0;for(let _e=0;_e<1024;_e+=1){let Xe=(_e+.5)/1024*J;for(;ge<z.length-1&&Xe>Ee+z[ge].length;)Ee+=z[ge].length,ge+=1;let{path:Re,length:ce,matrix:Ne}=z[ge],we=Re.getPointAtLength(Xe-Ee),ye=Ne?new DOMPoint(we.x,we.y).matrixTransform(Ne):we,ze=4*_e;Y[ze]=(ye.x-D.x)/D.width-.5,Y[ze+1]=.5-(ye.y-D.y)/D.height,Y[ze+2]=Ee/J,Y[ze+3]=(Ee+ce)/J}return Y.some(_e=>!Number.isFinite(_e))?null:{element:v,id:y,samples:Y,aspectRatio:D.width/D.height}}function Ke(v,y){v.dispatchEvent(new CustomEvent(li.pointer,{detail:y}))}function ut(v){if(v)try{v.target.hasPointerCapture(v.id)&&v.target.releasePointerCapture(v.id)}catch{}}function mt(v,y=window){let _=null,D=!1,k=!1,z=!1,J=ce=>y.dispatchEvent(new CustomEvent(li.rotate,{detail:ce})),Y=(ce,Ne,we)=>!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY)?!1:(D=Ne,k=we,Ke(y,{active:Ne,clientX:ce.clientX,clientY:ce.clientY,pressed:we}),!0),ge=()=>{(D||k)&&(D=!1,k=!1,Ke(y,{active:!1,clientX:0,clientY:0,pressed:!1}))},Ee=(ce,Ne=!0)=>{let we=_!==null||D||k||z,ye=_;_=null,ut(ye),z=!1,Ne&&(v.dataset.dragging="false"),we&&(ce?Y(ce,!0,!1):ge(),y.dispatchEvent(new Event(li.return)))};v.addEventListener("keydown",ce=>{let we={ArrowDown:{x:0,y:.08},ArrowLeft:{x:-.08,y:0},ArrowRight:{x:.08,y:0},ArrowUp:{x:0,y:-.08}}[ce.key];we&&(ce.preventDefault(),J(we))}),v.addEventListener("pointerdown",ce=>{if(!(!ce.isPrimary||ce.button!==0||_!==null||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))){try{v.setPointerCapture(ce.pointerId)}catch{return}if(_={id:ce.pointerId,target:v,x:ce.clientX,y:ce.clientY},!Y(ce,!0,!0)){let Ne=_;_=null,ut(Ne);return}z=!0,v.dataset.dragging="true"}}),v.addEventListener("pointermove",ce=>{if(!ce.isPrimary||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))return;let Ne=_;if(!(Ne&&(ce.pointerId!==Ne.id||ce.currentTarget!==Ne.target))){if(!Ne){if(ce.buttons!==0)return;Y(ce,!0,!1);return}Y(ce,!0,!0)&&(J({x:(ce.clientX-Ne.x)*.005,y:(ce.clientY-Ne.y)*.005}),Ne.x=ce.clientX,Ne.y=ce.clientY)}}),v.addEventListener("pointerup",ce=>{let Ne=_;if(Ne&&Ne.id===ce.pointerId&&Ne.target===ce.currentTarget){let we=v.getBoundingClientRect(),ye=ce.pointerType==="mouse"&&Number.isFinite(ce.clientX)&&Number.isFinite(ce.clientY)&&ce.clientX>=we.left&&ce.clientX<=we.right&&ce.clientY>=we.top&&ce.clientY<=we.bottom;Ee(ye?ce:void 0)}}),v.addEventListener("pointercancel",ce=>{let Ne=_;Ne&&Ne.id!==ce.pointerId||(Ne||ce.isPrimary&&D)&&Ee()}),v.addEventListener("pointerleave",ce=>{ce.isPrimary&&!_&&ge()}),v.addEventListener("lostpointercapture",ce=>{_?.id===ce.pointerId&&Ee()});let _e=()=>Ee(),Xe=()=>Ee(),Re=()=>{document.visibilityState==="hidden"&&Ee()};return window.addEventListener("blur",_e),y.addEventListener(li.replay,Xe),document.addEventListener("visibilitychange",Re),()=>{ut(_),_=null,window.removeEventListener("blur",_e),y.removeEventListener(li.replay,Xe),document.removeEventListener("visibilitychange",Re)}}function lt(v){let y=new DOMParser().parseFromString(v.trim(),"image/svg+xml"),_=y.querySelector("svg");if(!_||y.querySelector("parsererror"))throw new Error("That is not valid SVG markup.");let D=(_.getAttribute("viewBox")||"").trim().split(/[\s,]+/).map(Number),k=Number(_.getAttribute("width")),z=Number(_.getAttribute("height"));if(D.length===4&&D.every(Number.isFinite)&&(k=D[2],z=D[3]),!(k>0&&z>0))throw new Error("The SVG needs a viewBox (or width/height).");let J=Array.from(_.querySelectorAll(I));if(J.length===0)throw new Error("No path, line, polyline, polygon, circle, ellipse or rect found.");let Y=Math.max(k,z)/40,ge=J.map(Ee=>{let _e=document.createElementNS("http://www.w3.org/2000/svg",Ee.localName),Xe=new Set(["d","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","width","height","points","transform"]);for(let ce of Ee.attributes)Xe.has(ce.name)&&_e.setAttribute(ce.name,ce.value);for(let ce of["fill","stroke","stroke-width","style","class"])_e.removeAttribute(ce);_e.setAttribute("fill","none"),_e.setAttribute("stroke","currentColor"),_e.setAttribute("stroke-width",String(Y));let Re=_e.getAttribute("transform")||"";for(let ce=Ee.parentElement;ce&&ce!==_;ce=ce.parentElement){let Ne=ce.getAttribute("transform");Ne&&(Re=`${Ne} ${Re}`)}return Re.trim()&&_e.setAttribute("transform",Re.trim()),_e.outerHTML}).join("");return{label:"Custom",width:k,height:z,strokeWidth:Y,paths:[],markup:ge}}let Mt=Object.freeze({shape:"star",transform:"load",holdAtEnd:!1,interaction:"rotate",autoRotate:!0,palette:"astra",background:"#000",ambient:!1,padding:.1,parallax:!0,interactionLabel:null,tier:3,config:null});function Yt(v,y){if(!y||typeof y!="object")return v;for(let[_,D]of Object.entries(y))D&&typeof D=="object"&&!Array.isArray(D)&&v[_]&&typeof v[_]=="object"?Yt(v[_],D):v[_]=Array.isArray(D)?[...D]:D;return v}function fn(v){if(typeof v=="string"){if(S[v])return{id:v,def:S[v]};if(v.trim().startsWith("<"))return{id:"custom",def:{...S.custom,...lt(v),label:"Custom"}};throw new Error(`Unknown shape "${v}". Use one of: ${Object.keys(S).join(", ")} or SVG markup.`)}if(v&&typeof v=="object")return{id:v.id??"custom",def:{strokeWidth:1,paths:[],label:"Custom",...v}};throw new Error("shape must be a string or a shape definition object.")}let rn=`
4823
4823
  .astra-cue { position: relative; display: block; overflow: hidden; background: var(--astra-cue-background, #000); touch-action: pan-y pinch-zoom; isolation: isolate; }
4824
4824
  .astra-cue > .astra-cue-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
4825
4825
  .astra-cue > .astra-cue-ambient { pointer-events: none; position: absolute; inset: 0; mix-blend-mode: plus-lighter; opacity: 0;
@@ -4843,7 +4843,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4843
4843
  .astra-cue > .astra-dragSurface { cursor: auto; pointer-events: none; }
4844
4844
  }
4845
4845
  astra-shape-cue { display: block; }
4846
- `;function jt(){if(document.getElementById("astra-shape-cue-styles"))return;let v=document.createElement("style");v.id="astra-shape-cue-styles",v.textContent=rn,document.head.appendChild(v)}let kr=class kr{constructor(y,_={}){if(!(y instanceof Element))throw new Error("AstraShapeCue needs a host element.");if(jt(),this.host=y,this.options={...Mt,..._},this.config=Yt(x(),this.options.config),this.config.interactionMode=this.options.interaction,this.config.pathShapeAutoRotate=this.options.autoRotate,this.options.palette!==this.config.colorPalette){let D=m.find(k=>k.id===this.options.palette);D&&(this.config.colorPalette=D.id,this.config.colorPaletteColors=[...D.colors])}this._reducedMotionQuery=window.matchMedia?.("(prefers-reduced-motion: reduce)"),this.reducedMotion=!!this._reducedMotionQuery?.matches,this.profile=sr(this.options.tier,this.reducedMotion),this.input={contentBounds:{left:.5,right:.5},heroViewportHeight:null,reducedMotion:this.reducedMotion,progress:1,scatterProgress:1,tiltProgress:1,starsOpacity:1,scrolling:!1,returning:!1,rotation:{x:0,y:0},pointer:{active:!1,pressed:!1,reset:!1,x:0,y:0},shape:{centerNdc:{x:0,y:0},id:null,samples:null,sizeNdc:{x:0,y:0},strength:0}},this.size={width:1,height:1},this.renderer=null,this.animation=null,this.status="loading",this._raf=null,this._lastTime=null,this._needsFrame=!0,this._sizeDirty=!0,this._lastDpr=0,this._shapeDirty=!0,this._shapeVersion=0,this._sample=null,this._visible=!1,this._gathered=!1,this._frames=0,this._disposed=!1,this._lastScrollY=NaN,this._cachedRect=null,this._buildDom(),this._bindEvents(),this.setShape(this.options.shape),this._buildRenderer(),kr.instances.add(this)}_buildDom(){let y=this.host;y.classList.add("astra-cue"),y.dataset.astraCue="",getComputedStyle(y).position==="static"&&(y.style.position="relative"),y.style.setProperty("--astra-cue-background",this.options.background),this.canvas=document.createElement("canvas"),this.canvas.className="astra-cue-canvas",this.canvas.setAttribute("aria-hidden","true"),this.ambient=document.createElement("div"),this.ambient.className="astra-cue-ambient",this.ambient.setAttribute("aria-hidden","true"),this.ambient.style.setProperty("--astra-ambient-color",g.background.ambientColor),this.ambient.style.setProperty("--astra-ambient-fade-duration",`${this.config.convergeDuration}s`),this.ambient.style.setProperty("--astra-ambient-opacity",String(g.background.ambientOpacity)),this.ambient.hidden=!this.options.ambient,this.vignette=document.createElement("div"),this.vignette.className="astra-cue-vignette",this.vignette.setAttribute("aria-hidden","true"),this.vignette.hidden=!this.options.ambient,this.target=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.target.setAttribute("class","astra-shapeTarget"),this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("fill","none"),this.button=document.createElement("button"),this.button.type="button",this.button.className="astra-dragSurface",this.button.dataset.dragging="false",y.replaceChildren(this.canvas,this.ambient,this.vignette,this.target,this.button),this._unbindDrag=mt(this.button,y)}_renderTarget(y,_){let D="http://www.w3.org/2000/svg";this.target.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup?this.target.innerHTML=_.markup:this.target.replaceChildren(..._.paths.map(k=>{let z=document.createElementNS(D,"path");return z.setAttribute("d",k),z.setAttribute("stroke","currentColor"),z.setAttribute("stroke-width",String(_.strokeWidth??1)),z})),this.button.setAttribute("aria-label",this.options.interactionLabel??`Drag or use arrow keys to rotate the ${(_.label??"shape").toLowerCase()}`),this.host.dataset.astraPathShape=y}setShape(y){let{id:_,def:D}=fn(y);return this.shapeId=_,this.shapeDef=D,this._renderTarget(_,D),this._shapeVersion+=1,this._shapeDirty=!0,this.invalidate(),this}setTransform(y){if(!["scroll","load","off"].includes(y))throw new Error(`transform must be scroll | load | off (got ${y})`);return this.options.transform=y,this._gathered=!1,this.invalidate(),this}replay(){return this._gathered=!1,this._replayUntil=performance.now()+250,this.host.dispatchEvent(new Event(li.replay)),this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate(),this}rotate(y,_){return this.host.dispatchEvent(new CustomEvent(li.rotate,{detail:{x:y,y:_}})),this}set(y,_){let D=y.split("."),k=D.pop(),z=D.reduce((J,Y)=>J[Y],this.config);return z[k]=_,kr.FIELD_KEYS.has(y)?this.rebuild():this.invalidate(),this}setPalette(y){let _=m.find(D=>D.id===y);if(!_)throw new Error(`Unknown palette ${y}`);return this.options.palette=y,this.config.colorPalette=_.id,this.config.colorPaletteColors=[..._.colors],this.rebuild(),this}setBackground(y){let _=this.options.background==="transparent";return this.options.background=y,this.host.style.setProperty("--astra-cue-background",y),_!==(y==="transparent")&&this.rebuild(),this}setAmbient(y){return this.options.ambient=y,this.ambient.hidden=!y,this.vignette.hidden=!y,this}rebuild(){return clearTimeout(this._rebuildTimer),this._rebuildTimer=setTimeout(()=>this._buildRenderer(),60),this}invalidate(){this._needsFrame=!0,this._schedule()}dispose(){this._disposed||(this._disposed=!0,this._raf!==null&&cancelAnimationFrame(this._raf),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._unbind?.(),this._unbindDrag?.(),clearTimeout(this._rebuildTimer),this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null,this.host.replaceChildren(),this.host.classList.remove("astra-cue"),kr.instances.delete(this))}_buildRenderer(){if(!this._disposed){this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null;try{this.renderer=hu(this.canvas,this.config,this.profile,{invalidate:()=>this.invalidate(),transparent:this.options.background==="transparent"}),this.animation=Hf(this.config,1),this.status="ready",this._sizeDirty=!0,this._frames=0,this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="ready"}catch(y){console.error(y),this.status="error",this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="error"}this.invalidate()}}_bindEvents(){let y=this.host,_=()=>{let ye=this.input.pointer;ye.active=!1,ye.pressed=!1,ye.reset=!0},D=(ye,ze,st)=>{if(this.reducedMotion){_(),this.invalidate();return}let ht=this._cachedRect??(()=>{let en=this.canvas.getBoundingClientRect();return en.width>0&&en.height>0?en:null})();if(!ht)return;this._cachedRect=ht;let Tt=Le((ye-ht.left)/ht.width*2-1),It=Le(-((ze-ht.top)/ht.height*2-1)),Et=this.input.pointer;(!Et.active||Et.pressed!==st||Et.reset||Et.x!==Tt||Et.y!==It)&&(Et.active=!0,Et.pressed=st,Et.reset=!1,Et.x=Tt,Et.y=It,this.invalidate())},k=(ye=!1)=>{let ze=this.input.pointer,st=ze.reset||ye;(ze.active||ze.pressed||ze.reset!==st)&&(ze.active=!1,ze.pressed=!1,ze.reset=st,this.invalidate())},z=ye=>{let ze=ye.detail;if(ze){if(!ze.active||this.reducedMotion){k(this.reducedMotion);return}D(ze.clientX,ze.clientY,ze.pressed===!0)}},J=ye=>{if(this.reducedMotion)return;let ze=ye.detail;ze&&(this.input.rotation.x=ie(this.input.rotation.x+ze.y),this.input.rotation.y=ie(this.input.rotation.y+ze.x),this.input.returning=!1,this.invalidate())},Y=()=>{this.config.faceForward&&(this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate())},ge=ye=>ye.isPrimary&&(ye.pointerType==="mouse"||ye.pointerType==="pen"),Ee=ye=>{ge(ye)&&ye.buttons===0&&D(ye.clientX,ye.clientY,!1)},_e=ye=>{ge(ye)&&k()},Xe=()=>k(!0),Re=()=>{(this.options.transform==="scroll"||this.options.transform==="load")&&(this._cachedRect=null,this.invalidate())},ce=()=>{this._sizeDirty=!0,this._cachedRect=null,this._shapeDirty=!0,this.invalidate()},Ne=()=>{document.visibilityState==="hidden"?_():(this._lastTime=null,this.invalidate())},we=ye=>{this.reducedMotion=ye.matches,this.input.reducedMotion=ye.matches,ye.matches&&_(),this.invalidate()};y.addEventListener(li.pointer,z),y.addEventListener(li.rotate,J),y.addEventListener(li.return,Y),y.addEventListener("pointermove",Ee,{capture:!0,passive:!0}),y.addEventListener("pointerleave",_e,{passive:!0}),window.addEventListener("blur",Xe),window.addEventListener("scroll",Re,{passive:!0}),window.addEventListener("resize",ce,{passive:!0}),document.addEventListener("visibilitychange",Ne),this._reducedMotionQuery?.addEventListener?.("change",we),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(ce),this._resizeObserver.observe(y)),typeof IntersectionObserver<"u"?(this._intersection=new IntersectionObserver(ye=>{for(let ze of ye)this._visible=ze.isIntersecting,this._visibleRatio=ze.intersectionRatio;this._visible&&(this._lastTime=null,this.invalidate())},{rootMargin:"120px",threshold:[0,.2,.5]}),this._intersection.observe(y)):this._visible=!0,this._unbind=()=>{y.removeEventListener(li.pointer,z),y.removeEventListener(li.rotate,J),y.removeEventListener(li.return,Y),y.removeEventListener("pointermove",Ee,{capture:!0}),y.removeEventListener("pointerleave",_e),window.removeEventListener("blur",Xe),window.removeEventListener("scroll",Re),window.removeEventListener("resize",ce),document.removeEventListener("visibilitychange",Ne),this._reducedMotionQuery?.removeEventListener?.("change",we)}}_updateShape(){let y=this.input.shape;if(this.shapeDef?.native){this._sample=null,this._shapeDirty=!1,y.id=null,y.samples=null,y.strength=0,this.input.progress=0,this.input.scatterProgress=0,this.input.tiltProgress=0,this.input.starsOpacity=1;return}this._shapeDirty&&(this._sample=nt(this.target,`${this.shapeId}:${this._shapeVersion}`),this._shapeDirty=!1);let _=this.host.getBoundingClientRect(),D=Math.max(window.innerHeight||1,1),k=window.scrollY||0;this.input.scrolling=k!==this._lastScrollY,this._lastScrollY=k,this.input.progress=this.options.transform==="scroll"&&this.options.parallax?1+Math.max(0,k)/Math.max(1,this.config.scrollDisperseDistance):1;let z=0,J=this.options.transform;if(this.reducedMotion)z=1;else if(J==="off")z=this._replayUntil&&performance.now()<this._replayUntil?0:1;else if(J==="load")!this._gathered&&this._frames>1&&(this._visibleRatio??0)>=.2&&!(this._replayUntil&&performance.now()<this._replayUntil)&&(this._gathered=!0),z=this._gathered?1:0;else{let ce=this._scrollProgress??(k+D-(_.top+k))/Math.max(D+_.height,1),Ne=this.options.scroll?.gather??[0,.36],we=this.options.scroll?.disperse??[.5,.86],ye=this.options.holdAtEnd?1:1-ee(ce,...we);z=ee(ce,...Ne)*ye}if(y.strength=this._sample?z:0,!this._sample)return;let Y=t(this.options.padding,0,.45),ge=Math.max(_.width*(1-2*Y),1),Ee=Math.max(_.height*(1-2*Y),1),_e=this._sample.aspectRatio,Xe=ge/Math.max(Ee,1)>_e?Ee*_e:ge,Re=Xe/_e;y.centerNdc.x=0,y.centerNdc.y=0,y.sizeNdc.x=Xe/Math.max(_.width,1)*2,y.sizeNdc.y=Re/Math.max(_.height,1)*2,y.id=this._sample.id,y.samples=this._sample.samples}_schedule(){this._raf===null&&!this._disposed&&document.visibilityState!=="hidden"&&(this._raf=requestAnimationFrame(y=>this._tick(y)))}_tick(y){this._raf=null;let _=this._lastTime===null?0:t((y-this._lastTime)/1e3,0,.05);this._lastTime=y,this.step(_),this._visible&&!this.reducedMotion&&this.config.animationPlaying||this._needsFrame?this._schedule():this._lastTime=null}step(y){if(this._needsFrame=!1,!this.renderer||!this.animation)return!1;if(this._sizeDirty){let k=this.canvas.getBoundingClientRect();if(k.width>0&&k.height>0){let z=Math.max(1,Math.floor(k.width)),J=Math.max(1,Math.floor(k.height)),Y=window.devicePixelRatio;(this.size.width!==z||this.size.height!==J||this._lastDpr!==Y)&&(this.size.width=z,this.size.height=J,this._lastDpr=Y,this.renderer.resize(z,J,Y),this.input.pointer.reset=!0),this._sizeDirty=!1}else return!1}this._updateShape(),this._frames+=1;let _=this.reducedMotion||!this.config.animationPlaying?0:y,D=Vf({state:this.animation,config:this.config,input:this.input,camera:this.renderer.camera,animationRoot:this.renderer.animationRoot,spinRoot:this.renderer.spinRoot,field:this.renderer.field,viewport:this.size},_,this.reducedMotion?0:y);return this.renderer.render(_,this.animation,this.config,this.reducedMotion),(D||this._replayUntil&&performance.now()<this._replayUntil+50)&&(this._needsFrame=!0),D}};Mu(kr,"shapes",S),Mu(kr,"palettes",m),Mu(kr,"instances",new Set);let ot=kr;ot.FIELD_KEYS=new Set(["stars.density","stars.size","stars.scatter","stars.densityFalloff","rotationDepth","orbitalDust.enabled","orbitalDust.density","showCenterCluster","colorMode","animationPreset"]);let on={shape:"shape",transform:"transform",interaction:"interaction",palette:"palette",background:"background",label:"interactionLabel"},kt={"auto-rotate":"autoRotate",ambient:"ambient","hold-at-end":"holdAtEnd",parallax:"parallax"};class Ln extends HTMLElement{static get observedAttributes(){return[...Object.keys(on),...Object.keys(kt),"padding"]}connectedCallback(){if(this.cue)return;let y={};for(let[D,k]of Object.entries(on))this.hasAttribute(D)&&(y[k]=this.getAttribute(D));for(let[D,k]of Object.entries(kt))this.hasAttribute(D)&&(y[k]=this.getAttribute(D)!=="false");this.hasAttribute("padding")&&(y.padding=Number(this.getAttribute("padding")));let _=this.querySelector(":scope > svg");_&&!y.shape&&(y.shape=_.outerHTML),this.cue=new ra(this,yv(this,y))}disconnectedCallback(){this.cue?.dispose(),this.cue=null}attributeChangedCallback(y,_,D){!this.cue||_===D||(y==="shape"?this.cue.setShape(D):y==="transform"?this.cue.setTransform(D):y==="palette"?this.cue.setPalette(D):y==="background"?this.cue.setBackground(D):y==="interaction"?(this.cue.config.interactionMode=D,this.cue.invalidate()):y==="auto-rotate"?(this.cue.config.pathShapeAutoRotate=D!=="false",this.cue.invalidate()):y==="ambient"?this.cue.setAmbient(D!=="false"):y==="hold-at-end"?(this.cue.options.holdAtEnd=D!=="false",this.cue.invalidate()):y==="parallax"?(this.cue.options.parallax=D!=="false",this.cue.invalidate()):y==="padding"&&(this.cue.options.padding=Number(D),this.cue.invalidate()))}}function Or(v,y){let _=v.config,D=(z,J,Y,ge,Ee,_e)=>`<label class="astra-range">${J} <span data-out="${z}">${_e}</span><input type="range" data-key="${z}" min="${Y}" max="${ge}" step="${Ee}" value="${_e}"></label>`,k=(z,J,Y)=>`<label class="astra-check"><input type="checkbox" data-key="${z}"${Y?" checked":""}> ${J}</label>`;y.innerHTML=`
4846
+ `;function jt(){if(document.getElementById("astra-shape-cue-styles"))return;let v=document.createElement("style");v.id="astra-shape-cue-styles",v.textContent=rn,document.head.appendChild(v)}let kr=class kr{constructor(y,_={}){if(!y||y.nodeType!==1||typeof y.appendChild!="function"||typeof y.getBoundingClientRect!="function")throw new Error("AstraShapeCue needs a host element.");if(jt(),this.host=y,this.options={...Mt,..._},this.config=Yt(x(),this.options.config),this.config.interactionMode=this.options.interaction,this.config.pathShapeAutoRotate=this.options.autoRotate,this.options.palette!==this.config.colorPalette){let D=m.find(k=>k.id===this.options.palette);D&&(this.config.colorPalette=D.id,this.config.colorPaletteColors=[...D.colors])}this._reducedMotionQuery=window.matchMedia?.("(prefers-reduced-motion: reduce)"),this.reducedMotion=!!this._reducedMotionQuery?.matches,this.profile=sr(this.options.tier,this.reducedMotion),this.input={contentBounds:{left:.5,right:.5},heroViewportHeight:null,reducedMotion:this.reducedMotion,progress:1,scatterProgress:1,tiltProgress:1,starsOpacity:1,scrolling:!1,returning:!1,rotation:{x:0,y:0},pointer:{active:!1,pressed:!1,reset:!1,x:0,y:0},shape:{centerNdc:{x:0,y:0},id:null,samples:null,sizeNdc:{x:0,y:0},strength:0}},this.size={width:1,height:1},this.renderer=null,this.animation=null,this.status="loading",this._raf=null,this._lastTime=null,this._needsFrame=!0,this._sizeDirty=!0,this._lastDpr=0,this._shapeDirty=!0,this._shapeVersion=0,this._sample=null,this._visible=!1,this._gathered=!1,this._frames=0,this._disposed=!1,this._lastScrollY=NaN,this._cachedRect=null,this._buildDom(),this._bindEvents(),this.setShape(this.options.shape),this._buildRenderer(),kr.instances.add(this)}_buildDom(){let y=this.host;y.classList.add("astra-cue"),y.dataset.astraCue="",getComputedStyle(y).position==="static"&&(y.style.position="relative"),y.style.setProperty("--astra-cue-background",this.options.background),this.canvas=document.createElement("canvas"),this.canvas.className="astra-cue-canvas",this.canvas.setAttribute("aria-hidden","true"),this.ambient=document.createElement("div"),this.ambient.className="astra-cue-ambient",this.ambient.setAttribute("aria-hidden","true"),this.ambient.style.setProperty("--astra-ambient-color",g.background.ambientColor),this.ambient.style.setProperty("--astra-ambient-fade-duration",`${this.config.convergeDuration}s`),this.ambient.style.setProperty("--astra-ambient-opacity",String(g.background.ambientOpacity)),this.ambient.hidden=!this.options.ambient,this.vignette=document.createElement("div"),this.vignette.className="astra-cue-vignette",this.vignette.setAttribute("aria-hidden","true"),this.vignette.hidden=!this.options.ambient,this.target=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.target.setAttribute("class","astra-shapeTarget"),this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("fill","none"),this.button=document.createElement("button"),this.button.type="button",this.button.className="astra-dragSurface",this.button.dataset.dragging="false",y.replaceChildren(this.canvas,this.ambient,this.vignette,this.target,this.button),this._unbindDrag=mt(this.button,y)}_renderTarget(y,_){let D="http://www.w3.org/2000/svg";this.target.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup?this.target.innerHTML=_.markup:this.target.replaceChildren(..._.paths.map(k=>{let z=document.createElementNS(D,"path");return z.setAttribute("d",k),z.setAttribute("stroke","currentColor"),z.setAttribute("stroke-width",String(_.strokeWidth??1)),z})),this.button.setAttribute("aria-label",this.options.interactionLabel??`Drag or use arrow keys to rotate the ${(_.label??"shape").toLowerCase()}`),this.host.dataset.astraPathShape=y}setShape(y){let{id:_,def:D}=fn(y);return this.shapeId=_,this.shapeDef=D,this._renderTarget(_,D),this._shapeVersion+=1,this._shapeDirty=!0,this.invalidate(),this}setTransform(y){if(!["scroll","load","off"].includes(y))throw new Error(`transform must be scroll | load | off (got ${y})`);return this.options.transform=y,this._gathered=!1,this.invalidate(),this}replay(){return this._gathered=!1,this._replayUntil=performance.now()+250,this.host.dispatchEvent(new Event(li.replay)),this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate(),this}rotate(y,_){return this.host.dispatchEvent(new CustomEvent(li.rotate,{detail:{x:y,y:_}})),this}set(y,_){let D=y.split("."),k=D.pop(),z=D.reduce((J,Y)=>J[Y],this.config);return z[k]=_,kr.FIELD_KEYS.has(y)?this.rebuild():this.invalidate(),this}setPalette(y){let _=m.find(D=>D.id===y);if(!_)throw new Error(`Unknown palette ${y}`);return this.options.palette=y,this.config.colorPalette=_.id,this.config.colorPaletteColors=[..._.colors],this.rebuild(),this}setBackground(y){let _=this.options.background==="transparent";return this.options.background=y,this.host.style.setProperty("--astra-cue-background",y),_!==(y==="transparent")&&this.rebuild(),this}setAmbient(y){return this.options.ambient=y,this.ambient.hidden=!y,this.vignette.hidden=!y,this}rebuild(){return clearTimeout(this._rebuildTimer),this._rebuildTimer=setTimeout(()=>this._buildRenderer(),60),this}invalidate(){this._needsFrame=!0,this._schedule()}dispose(){this._disposed||(this._disposed=!0,this._raf!==null&&cancelAnimationFrame(this._raf),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._unbind?.(),this._unbindDrag?.(),clearTimeout(this._rebuildTimer),this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null,this.host.replaceChildren(),this.host.classList.remove("astra-cue"),kr.instances.delete(this))}_buildRenderer(){if(!this._disposed){this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null;try{this.renderer=hu(this.canvas,this.config,this.profile,{invalidate:()=>this.invalidate(),transparent:this.options.background==="transparent"}),this.animation=Hf(this.config,1),this.status="ready",this._sizeDirty=!0,this._frames=0,this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="ready"}catch(y){console.error(y),this.status="error",this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="error"}this.invalidate()}}_bindEvents(){let y=this.host,_=()=>{let ye=this.input.pointer;ye.active=!1,ye.pressed=!1,ye.reset=!0},D=(ye,ze,st)=>{if(this.reducedMotion){_(),this.invalidate();return}let ht=this._cachedRect??(()=>{let en=this.canvas.getBoundingClientRect();return en.width>0&&en.height>0?en:null})();if(!ht)return;this._cachedRect=ht;let Tt=Le((ye-ht.left)/ht.width*2-1),It=Le(-((ze-ht.top)/ht.height*2-1)),Et=this.input.pointer;(!Et.active||Et.pressed!==st||Et.reset||Et.x!==Tt||Et.y!==It)&&(Et.active=!0,Et.pressed=st,Et.reset=!1,Et.x=Tt,Et.y=It,this.invalidate())},k=(ye=!1)=>{let ze=this.input.pointer,st=ze.reset||ye;(ze.active||ze.pressed||ze.reset!==st)&&(ze.active=!1,ze.pressed=!1,ze.reset=st,this.invalidate())},z=ye=>{let ze=ye.detail;if(ze){if(!ze.active||this.reducedMotion){k(this.reducedMotion);return}D(ze.clientX,ze.clientY,ze.pressed===!0)}},J=ye=>{if(this.reducedMotion)return;let ze=ye.detail;ze&&(this.input.rotation.x=ie(this.input.rotation.x+ze.y),this.input.rotation.y=ie(this.input.rotation.y+ze.x),this.input.returning=!1,this.invalidate())},Y=()=>{this.config.faceForward&&(this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate())},ge=ye=>ye.isPrimary&&(ye.pointerType==="mouse"||ye.pointerType==="pen"),Ee=ye=>{ge(ye)&&ye.buttons===0&&D(ye.clientX,ye.clientY,!1)},_e=ye=>{ge(ye)&&k()},Xe=()=>k(!0),Re=()=>{(this.options.transform==="scroll"||this.options.transform==="load")&&(this._cachedRect=null,this.invalidate())},ce=()=>{this._sizeDirty=!0,this._cachedRect=null,this._shapeDirty=!0,this.invalidate()},Ne=()=>{document.visibilityState==="hidden"?_():(this._lastTime=null,this.invalidate())},we=ye=>{this.reducedMotion=ye.matches,this.input.reducedMotion=ye.matches,ye.matches&&_(),this.invalidate()};y.addEventListener(li.pointer,z),y.addEventListener(li.rotate,J),y.addEventListener(li.return,Y),y.addEventListener("pointermove",Ee,{capture:!0,passive:!0}),y.addEventListener("pointerleave",_e,{passive:!0}),window.addEventListener("blur",Xe),window.addEventListener("scroll",Re,{passive:!0}),window.addEventListener("resize",ce,{passive:!0}),document.addEventListener("visibilitychange",Ne),this._reducedMotionQuery?.addEventListener?.("change",we),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(ce),this._resizeObserver.observe(y)),typeof IntersectionObserver<"u"?(this._intersection=new IntersectionObserver(ye=>{for(let ze of ye)this._visible=ze.isIntersecting,this._visibleRatio=ze.intersectionRatio;this._visible&&(this._lastTime=null,this.invalidate())},{rootMargin:"120px",threshold:[0,.2,.5]}),this._intersection.observe(y)):this._visible=!0,this._unbind=()=>{y.removeEventListener(li.pointer,z),y.removeEventListener(li.rotate,J),y.removeEventListener(li.return,Y),y.removeEventListener("pointermove",Ee,{capture:!0}),y.removeEventListener("pointerleave",_e),window.removeEventListener("blur",Xe),window.removeEventListener("scroll",Re),window.removeEventListener("resize",ce),document.removeEventListener("visibilitychange",Ne),this._reducedMotionQuery?.removeEventListener?.("change",we)}}_updateShape(){let y=this.input.shape;if(this.shapeDef?.native){this._sample=null,this._shapeDirty=!1,y.id=null,y.samples=null,y.strength=0,this.input.progress=0,this.input.scatterProgress=0,this.input.tiltProgress=0,this.input.starsOpacity=1;return}this._shapeDirty&&(this._sample=nt(this.target,`${this.shapeId}:${this._shapeVersion}`),this._shapeDirty=!1);let _=this.host.getBoundingClientRect(),D=Math.max(window.innerHeight||1,1),k=window.scrollY||0;this.input.scrolling=k!==this._lastScrollY,this._lastScrollY=k,this.input.progress=this.options.transform==="scroll"&&this.options.parallax?1+Math.max(0,k)/Math.max(1,this.config.scrollDisperseDistance):1;let z=0,J=this.options.transform;if(this.reducedMotion)z=1;else if(J==="off")z=this._replayUntil&&performance.now()<this._replayUntil?0:1;else if(J==="load")!this._gathered&&this._frames>1&&(this._visibleRatio??0)>=.2&&!(this._replayUntil&&performance.now()<this._replayUntil)&&(this._gathered=!0),z=this._gathered?1:0;else{let ce=this._scrollProgress??(k+D-(_.top+k))/Math.max(D+_.height,1),Ne=this.options.scroll?.gather??[0,.36],we=this.options.scroll?.disperse??[.5,.86],ye=this.options.holdAtEnd?1:1-ee(ce,...we);z=ee(ce,...Ne)*ye}if(y.strength=this._sample?z:0,!this._sample)return;let Y=t(this.options.padding,0,.45),ge=Math.max(_.width*(1-2*Y),1),Ee=Math.max(_.height*(1-2*Y),1),_e=this._sample.aspectRatio,Xe=ge/Math.max(Ee,1)>_e?Ee*_e:ge,Re=Xe/_e;y.centerNdc.x=0,y.centerNdc.y=0,y.sizeNdc.x=Xe/Math.max(_.width,1)*2,y.sizeNdc.y=Re/Math.max(_.height,1)*2,y.id=this._sample.id,y.samples=this._sample.samples}_schedule(){this._raf===null&&!this._disposed&&document.visibilityState!=="hidden"&&(this._raf=requestAnimationFrame(y=>this._tick(y)))}_tick(y){this._raf=null;let _=this._lastTime===null?0:t((y-this._lastTime)/1e3,0,.05);this._lastTime=y,this.step(_),this._visible&&!this.reducedMotion&&this.config.animationPlaying||this._needsFrame?this._schedule():this._lastTime=null}step(y){if(this._needsFrame=!1,!this.renderer||!this.animation)return!1;if(this._sizeDirty){let k=this.canvas.getBoundingClientRect();if(k.width>0&&k.height>0){let z=Math.max(1,Math.floor(k.width)),J=Math.max(1,Math.floor(k.height)),Y=window.devicePixelRatio;(this.size.width!==z||this.size.height!==J||this._lastDpr!==Y)&&(this.size.width=z,this.size.height=J,this._lastDpr=Y,this.renderer.resize(z,J,Y),this.input.pointer.reset=!0),this._sizeDirty=!1}else return!1}this._updateShape(),this._frames+=1;let _=this.reducedMotion||!this.config.animationPlaying?0:y,D=Vf({state:this.animation,config:this.config,input:this.input,camera:this.renderer.camera,animationRoot:this.renderer.animationRoot,spinRoot:this.renderer.spinRoot,field:this.renderer.field,viewport:this.size},_,this.reducedMotion?0:y);return this.renderer.render(_,this.animation,this.config,this.reducedMotion),(D||this._replayUntil&&performance.now()<this._replayUntil+50)&&(this._needsFrame=!0),D}};Mu(kr,"shapes",S),Mu(kr,"palettes",m),Mu(kr,"instances",new Set);let ot=kr;ot.FIELD_KEYS=new Set(["stars.density","stars.size","stars.scatter","stars.densityFalloff","rotationDepth","orbitalDust.enabled","orbitalDust.density","showCenterCluster","colorMode","animationPreset"]);let on={shape:"shape",transform:"transform",interaction:"interaction",palette:"palette",background:"background",label:"interactionLabel"},kt={"auto-rotate":"autoRotate",ambient:"ambient","hold-at-end":"holdAtEnd",parallax:"parallax"};class Ln extends HTMLElement{static get observedAttributes(){return[...Object.keys(on),...Object.keys(kt),"padding"]}connectedCallback(){if(this.cue)return;let y={};for(let[D,k]of Object.entries(on))this.hasAttribute(D)&&(y[k]=this.getAttribute(D));for(let[D,k]of Object.entries(kt))this.hasAttribute(D)&&(y[k]=this.getAttribute(D)!=="false");this.hasAttribute("padding")&&(y.padding=Number(this.getAttribute("padding")));let _=this.querySelector(":scope > svg");_&&!y.shape&&(y.shape=_.outerHTML),this.cue=new ra(this,yv(this,y))}disconnectedCallback(){this.cue?.dispose(),this.cue=null}attributeChangedCallback(y,_,D){!this.cue||_===D||(y==="shape"?this.cue.setShape(D):y==="transform"?this.cue.setTransform(D):y==="palette"?this.cue.setPalette(D):y==="background"?this.cue.setBackground(D):y==="interaction"?(this.cue.config.interactionMode=D,this.cue.invalidate()):y==="auto-rotate"?(this.cue.config.pathShapeAutoRotate=D!=="false",this.cue.invalidate()):y==="ambient"?this.cue.setAmbient(D!=="false"):y==="hold-at-end"?(this.cue.options.holdAtEnd=D!=="false",this.cue.invalidate()):y==="parallax"?(this.cue.options.parallax=D!=="false",this.cue.invalidate()):y==="padding"&&(this.cue.options.padding=Number(D),this.cue.invalidate()))}}function Or(v,y){let _=v.config,D=(z,J,Y,ge,Ee,_e)=>`<label class="astra-range">${J} <span data-out="${z}">${_e}</span><input type="range" data-key="${z}" min="${Y}" max="${ge}" step="${Ee}" value="${_e}"></label>`,k=(z,J,Y)=>`<label class="astra-check"><input type="checkbox" data-key="${z}"${Y?" checked":""}> ${J}</label>`;y.innerHTML=`
4847
4847
  <header><strong>Shape Cue by UX Pilot</strong><button type="button" class="astra-panel-toggle" aria-expanded="true" aria-label="Collapse panel">\u2013</button></header>
4848
4848
  <div class="astra-panel-body">
4849
4849
  <label>Shape <select data-key="shape">${Object.entries(S).map(([z,J])=>`<option value="${z}"${z===v.shapeId?" selected":""}>${J.label}</option>`).join("")}</select></label>
@@ -4873,4 +4873,4 @@ astra-shape-cue { display: block; }
4873
4873
  ${k("orbitalDust.enabled","Orbital dust",_.orbitalDust.enabled)}
4874
4874
  ${k("showCenterCluster","Center cluster",_.showCenterCluster)}
4875
4875
  <div class="astra-actions"><button type="button" data-action="replay">Replay gather</button></div>
4876
- </div>`,y.addEventListener("input",z=>{let J=z.target,Y=J.dataset.key;if(!Y||Y==="customSvgFile")return;let ge=y.querySelector(`[data-out="${Y}"]`);Y==="shape"?J.value!=="custom"&&v.setShape(J.value):Y==="transform"?v.setTransform(J.value):Y==="palette"?v.setPalette(J.value):Y==="background"?v.setBackground(J.value):Y==="interactionMode"?v.update({interaction:J.value}):Y==="ambient"?v.setAmbient(J.checked):Y==="holdAtEnd"||Y==="parallax"?v.update({[Y]:J.checked}):Y==="padding"?v.update({padding:Number(J.value)}):J.type==="checkbox"?v.set(Y,J.checked):(v.set(Y,Number(J.value)),ge&&(ge.textContent=J.value))}),y.addEventListener("change",async z=>{let J=z.target;if(J?.dataset.key!=="customSvgFile")return;let Y=y.querySelector('[data-key="customError"]'),ge=J.files?.[0];if(ge){if(!ge.name.toLowerCase().endsWith(".svg")&&ge.type!=="image/svg+xml"){Y.textContent="Choose an SVG file.",J.value="";return}if(ge.size>2*1024*1024){Y.textContent="SVG files must be 2 MB or smaller.",J.value="";return}try{await v.loadSVG(ge),y.querySelector('select[data-key="shape"]').value="custom",Y.textContent=""}catch(Ee){Y.textContent=Ee.message}}}),y.addEventListener("click",z=>{z.target.closest("[data-action]")?.dataset.action==="replay"&&v.replay(),z.target.closest("[data-upload-svg]")&&y.querySelector('input[data-key="customSvgFile"]').click();let Y=z.target.closest(".astra-panel-toggle");if(Y){let ge=y.querySelector(".astra-panel-body");ge.hidden=!ge.hidden,Y.textContent=ge.hidden?"+":"\u2013",Y.setAttribute("aria-expanded",String(!ge.hidden))}})}let Un=(v,y)=>Object.prototype.hasOwnProperty.call(v,y),or=(v,y)=>JSON.stringify(v)===JSON.stringify(y),$t=(v,y)=>{if(!v||typeof v!="object"||Array.isArray(v))throw new TypeError(`${y} must be an object.`)},wn=(v,y,_,D)=>{if(typeof v!="number"||!Number.isFinite(v)||v<y||v>_)throw new RangeError(`${D} must be a number from ${y} to ${_}.`);return v};function jn(v){if(!Array.isArray(v)||v.length<1||v.length>8||v.some(y=>typeof y!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{6})$/i.test(y)))throw new TypeError('colors must contain 1\u20138 hex colors, such as ["#9b87ff", "#47e2c2"].');return v.slice()}function Bn(v,y=x(),_="config"){$t(v,_);let D={};for(let[k,z]of Object.entries(v)){if(!Un(y,k)||["__proto__","prototype","constructor"].includes(k))throw new TypeError(`Unknown setting: ${_}.${k}`);let J=y[k];if(Array.isArray(J))D[k]=jn(z);else if(J&&typeof J=="object")D[k]=Bn(z,J,`${_}.${k}`);else{if(typeof z!=typeof J||typeof z=="number"&&!Number.isFinite(z))throw new TypeError(`Invalid value for ${_}.${k}`);D[k]=z}let Y=_==="config"?k:_.slice(7)+"."+k,ge=lm.find(_e=>_e.optionPath==="config."+Y&&_e.kind==="range");ge&&wn(z,ge.min,ge.max,_+"."+k);let Ee={animationPreset:["none","converge-tilt","legacy-zoom","grow","accretion-exhale"],interactionMode:["rotate","depth-lens","none"],colorPalette:[...m.map(_e=>_e.id),"custom"]};if(Un(Ee,Y)&&!Ee[Y].includes(z))throw new TypeError(`Unknown ${Y}: ${z}`)}return D}function qn(v){$t(v,"options");let y={},_=v.config===void 0?{}:Bn(v.config),D=new Set([...Object.keys(Mt),"colors","particles","animation","bloom","scroll"]);for(let k of Object.keys(v))if(!D.has(k))throw new TypeError(`Unknown option: ${k}`);for(let k of Object.keys(Mt)){if(k==="config"||v[k]===void 0)continue;let z=v[k];if(typeof Mt[k]=="boolean"&&typeof z!="boolean")throw new TypeError(`${k} must be true or false.`);y[k]=z}y.shape!==void 0&&fn(y.shape);for(let[k,z]of Object.entries({transform:["load","scroll","off"],interaction:["rotate","depth-lens","none"],palette:m.map(J=>J.id)}))if(y[k]!==void 0&&!z.includes(y[k]))throw new TypeError(`${k} must be one of: ${z.join(", ")}.`);if(y.padding!==void 0&&wn(y.padding,0,.45,"padding"),y.tier!==void 0&&![0,1,2,3].includes(y.tier))throw new RangeError("tier must be 0, 1, 2, or 3.");if(y.background!==void 0&&(typeof y.background!="string"||!CSS.supports("color",y.background)))throw new TypeError("background must be a CSS color or transparent.");if(v.scroll!==void 0){$t(v.scroll,"scroll"),y.scroll={};for(let[k,z]of Object.entries(v.scroll)){if(!["gather","disperse"].includes(k)||!Array.isArray(z)||z.length!==2)throw new TypeError("scroll ranges must be gather/disperse: [start, end].");if(z.forEach(J=>wn(J,0,1,"scroll."+k)),z[0]>=z[1])throw new RangeError("Scroll range start must be less than its end.");y.scroll[k]=z.slice()}}if(v.particles!==void 0){$t(v.particles,"particles");let k={density:[.25,4],size:[.25,3],intensity:[.1,3],scatter:[0,.45],twinkle:[0,2]};_.stars={..._.stars};for(let[z,J]of Object.entries(v.particles)){if(!Un(k,z))throw new TypeError(`Unknown particle setting: ${z}`);_.stars[z==="twinkle"?"twinkleSpeed":z]=wn(J,...k[z],`particles.${z}`)}}if(v.animation!==void 0){$t(v.animation,"animation");for(let Y of Object.keys(v.animation))if(!["speed","duration","playing"].includes(Y))throw new TypeError(`Unknown animation setting: ${Y}`);let{speed:k,duration:z,playing:J}=v.animation;if(k!==void 0&&(_.stars={..._.stars,flowSpeed:wn(k,0,3,"animation.speed")}),z!==void 0&&(_.convergeDuration=wn(z,1,10,"animation.duration")),J!==void 0){if(typeof J!="boolean")throw new TypeError("animation.playing must be true or false.");_.animationPlaying=J}}return v.bloom!==void 0&&(_.bloomIntensity=wn(v.bloom,0,2,"bloom")),v.colors!==void 0&&(v.colors===null?y.palette=y.palette??Mt.palette:(_.colorMode=!0,_.colorPalette="custom",_.colorPaletteColors=jn(v.colors))),y.interaction!==void 0&&(_.interactionMode=y.interaction),y.autoRotate!==void 0&&(_.pathShapeAutoRotate=y.autoRotate),y.palette!==void 0&&v.colors==null&&(_.colorPalette=y.palette,_.colorPaletteColors=m.find(k=>k.id===y.palette).colors.slice()),Object.keys(_).length&&(y.config=_),y}class ra extends ot{constructor(y,_={}){let D=qn(_);D.interaction===void 0&&D.config?.interactionMode!==void 0&&(D.interaction=D.config.interactionMode),D.autoRotate===void 0&&D.config?.pathShapeAutoRotate!==void 0&&(D.autoRotate=D.config.pathShapeAutoRotate),D.config?.colorPalette==="custom"?D.palette="custom":D.palette===void 0&&D.config?.colorPalette!==void 0&&(D.palette=D.config.colorPalette),super(y,D),this._lastSettingsHash=JSON.stringify(this.getOptions())}update(y={}){if(this._disposed)throw new Error("Cannot update a disposed cue.");let _=qn(y);_.shape!==void 0&&!or(_.shape,this.options.shape)&&this.setShape(_.shape),_.transform!==void 0&&_.transform!==this.options.transform&&this.setTransform(_.transform),_.palette!==void 0&&_.config?.colorPalette!=="custom"&&(this.config.colorPalette!==_.palette||!or(this.config.colorPaletteColors,m.find(k=>k.id===_.palette).colors))&&this.setPalette(_.palette),_.background!==void 0&&_.background!==this.options.background&&this.setBackground(_.background),_.ambient!==void 0&&_.ambient!==this.options.ambient&&this.setAmbient(_.ambient);for(let k of["padding","parallax","holdAtEnd","autoRotate","interaction","interactionLabel"])_[k]===void 0||or(_[k],this.options[k])||(this.options[k]=_[k],k==="autoRotate"&&(this.config.pathShapeAutoRotate=_[k]),k==="interaction"&&(this.config.interactionMode=_[k]),k==="interactionLabel"&&this.button.setAttribute("aria-label",_[k]),this.invalidate());_.tier!==void 0&&_.tier!==this.options.tier&&(this.options.tier=_.tier,this.profile=sr(_.tier,this.reducedMotion),this.rebuild());let D=(k,z="")=>{for(let[J,Y]of Object.entries(k)){let ge=z?`${z}.${J}`:J;if(Y&&typeof Y=="object"&&!Array.isArray(Y))D(Y,ge);else{let Ee=ge.split(".").reduce((_e,Xe)=>_e[Xe],this.config);or(Ee,Y)||this.set(ge,Y)}}};return _.config&&D(_.config),_.scroll&&(this.options.scroll={...this.options.scroll,..._.scroll},this.invalidate()),this._notify(),this}setShape(y){return super.setShape(y),this._svgRequest=(this._svgRequest??0)+1,this.options.shape=y,this._notify(),this}set(y,_){let D=y.split("."),k=x();for(let J of D){if(!k||!Un(k,J)||["__proto__","prototype","constructor"].includes(J))throw new TypeError(`Unknown setting: ${y}`);k=k[J]}if(Array.isArray(k))jn(_);else if(typeof k!=typeof _||typeof _=="object"||typeof _=="number"&&!Number.isFinite(_))throw new TypeError(`Invalid value for ${y}`);let z=D.reduceRight((J,Y)=>({[Y]:J}),_);return Bn(z),super.set(y,Array.isArray(_)?_.slice():_),["colorPalette","colorPaletteColors"].includes(y)&&this.rebuild(),this._notify(),this}getOptions(){let y={};for(let _ of Object.keys(Mt))_!=="config"&&(y[_]=this.options[_]);return y.interaction=this.config.interactionMode,y.autoRotate=this.config.pathShapeAutoRotate,y.palette=m.some(_=>_.id===this.config.colorPalette)?this.config.colorPalette:Mt.palette,this.config.colorPalette==="custom"&&(y.colors=this.config.colorPaletteColors),y.config=this.config,y.scroll={gather:[0,.36],disperse:[.5,.86],...this.options.scroll},JSON.parse(JSON.stringify(y))}onChange(y){if(typeof y!="function")throw new TypeError("onChange expects a function.");let _=()=>y(this.getOptions());return this.host.addEventListener("shape-cue:change",_),()=>this.host.removeEventListener("shape-cue:change",_)}_notify(){this._disposed||!this.host||this._notifyQueued||(this._notifyQueued=!0,queueMicrotask(()=>{if(this._notifyQueued=!1,this._disposed)return;let y=this.getOptions(),_=JSON.stringify(y);_!==this._lastSettingsHash&&(this._lastSettingsHash=_,this.host.dispatchEvent(new CustomEvent("shape-cue:change",{detail:y})))}))}setTransform(y){return super.setTransform(y),this._notify(),this}setPalette(y){return super.setPalette(y),this._notify(),this}setBackground(y){return super.setBackground(y),this._notify(),this}setAmbient(y){return super.setAmbient(y),this._notify(),this}setScrollProgress(y){return y!==null&&wn(y,0,1,"scroll progress"),this._scrollProgress=y,this.input.pointer.reset=!0,this.invalidate(),this}async loadSVG(y){let _=(this._svgRequest??0)+1;this._svgRequest=_;let D;if(typeof y=="string"){if(!y.trim().startsWith("<"))throw new TypeError("loadSVG expects SVG markup or a File, not a URL.");if(new TextEncoder().encode(y).length>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=y}else if(y instanceof Blob){if(y.size>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=await y.text()}else throw new TypeError("loadSVG expects SVG markup, a File, or a Blob.");return this._disposed||_!==this._svgRequest?this:(this.setShape(D),this)}setColors(y){return this.update({colors:y})}pause(){return this.update({animation:{playing:!1}})}play(){return this.update({animation:{playing:!0}})}}let Ii={colors:v=>({colors:v===null?null:v.trim().split(/[\s,]+/)}),speed:v=>({animation:{speed:v===null?.8:Number(v)}}),"gather-duration":v=>({animation:{duration:v===null?5.5:Number(v)}}),paused:v=>({animation:{playing:v===null||v==="false"}}),bloom:v=>({bloom:v===null?.7:Number(v)}),"particle-density":v=>({particles:{density:v===null?4:Number(v)}}),"particle-size":v=>({particles:{size:v===null?2.05:Number(v)}})};function yv(v,y){let _={...y};for(let[D,k]of Object.entries(Ii)){if(!v.hasAttribute(D))continue;let z=k(v.getAttribute(D));for(let[J,Y]of Object.entries(z))_[J]=Y&&typeof Y=="object"&&!Array.isArray(Y)?{..._[J],...Y}:Y}return _}let Sv=Ln.observedAttributes;Object.defineProperty(Ln,"observedAttributes",{get:()=>[...Sv,...Object.keys(Ii)]});let Av=Ln.prototype.attributeChangedCallback;return Ln.prototype.attributeChangedCallback=function(v,y,_){Un(Ii,v)?this.cue&&y!==_&&this.cue.update(Ii[v](_)):(Av.call(this,v,y,_),this.cue&&y!==_&&this.cue._notify())},window[r]={AstraShapeCue:ra,AstraShapeCueElement:Ln,createComponentPanel:Or}}function xv(){let r=cm();customElements.get("astra-shape-cue")||customElements.define("astra-shape-cue",r.AstraShapeCueElement)}function xE(r,e={}){let t=cm();return new t.AstraShapeCue(r,e)}function yE(r,e){let t=cm();if(!(e instanceof HTMLElement))throw new Error("Controls require a host element.");let n=document.createElement("aside");n.className="astra-panel",n.setAttribute("aria-label","Shape Cue controls"),e.appendChild(n),t.createComponentPanel(r,n);let i=()=>{let a=r.getOptions();for(let o of lm){let l=[...n.querySelectorAll("[data-key]")].find(h=>h.dataset.key===o.key);if(!l)continue;let c=o.optionPath.split(".").reduce((h,f)=>h?.[f],a);if(o.key==="shape"&&(c=r.shapeId),o.key==="palette"&&a.colors&&(c="custom"),l.tagName==="SELECT"&&![...l.options].some(h=>h.value===String(c))){let h=document.createElement("option");h.value=String(c),h.textContent=c==="custom"?"Custom":String(c),h.disabled=!0,l.appendChild(h)}o.kind==="checkbox"?l.checked=!!c:l.value=String(c);let u=[...n.querySelectorAll("[data-out]")].find(h=>h.dataset.out===o.key);u&&(u.textContent=String(c))}};i();let s=r.onChange(i);return()=>{s(),n.remove()}}xv();window.UXPShapeCue={version:vv,registerShapeCue:xv,createShapeCue:xE,mountControls:yE,getControlDefinitions:vE};})();
4876
+ </div>`,y.addEventListener("input",z=>{let J=z.target,Y=J.dataset.key;if(!Y||Y==="customSvgFile")return;let ge=y.querySelector(`[data-out="${Y}"]`);Y==="shape"?J.value!=="custom"&&v.setShape(J.value):Y==="transform"?v.setTransform(J.value):Y==="palette"?v.setPalette(J.value):Y==="background"?v.setBackground(J.value):Y==="interactionMode"?v.update({interaction:J.value}):Y==="ambient"?v.setAmbient(J.checked):Y==="holdAtEnd"||Y==="parallax"?v.update({[Y]:J.checked}):Y==="padding"?v.update({padding:Number(J.value)}):J.type==="checkbox"?v.set(Y,J.checked):(v.set(Y,Number(J.value)),ge&&(ge.textContent=J.value))}),y.addEventListener("change",async z=>{let J=z.target;if(J?.dataset.key!=="customSvgFile")return;let Y=y.querySelector('[data-key="customError"]'),ge=J.files?.[0];if(ge){if(!ge.name.toLowerCase().endsWith(".svg")&&ge.type!=="image/svg+xml"){Y.textContent="Choose an SVG file.",J.value="";return}if(ge.size>2*1024*1024){Y.textContent="SVG files must be 2 MB or smaller.",J.value="";return}try{await v.loadSVG(ge),y.querySelector('select[data-key="shape"]').value="custom",Y.textContent=""}catch(Ee){Y.textContent=Ee.message}}}),y.addEventListener("click",z=>{z.target.closest("[data-action]")?.dataset.action==="replay"&&v.replay(),z.target.closest("[data-upload-svg]")&&y.querySelector('input[data-key="customSvgFile"]').click();let Y=z.target.closest(".astra-panel-toggle");if(Y){let ge=y.querySelector(".astra-panel-body");ge.hidden=!ge.hidden,Y.textContent=ge.hidden?"+":"\u2013",Y.setAttribute("aria-expanded",String(!ge.hidden))}})}let Un=(v,y)=>Object.prototype.hasOwnProperty.call(v,y),or=(v,y)=>JSON.stringify(v)===JSON.stringify(y),$t=(v,y)=>{if(!v||typeof v!="object"||Array.isArray(v))throw new TypeError(`${y} must be an object.`)},wn=(v,y,_,D)=>{if(typeof v!="number"||!Number.isFinite(v)||v<y||v>_)throw new RangeError(`${D} must be a number from ${y} to ${_}.`);return v};function jn(v){if(!Array.isArray(v)||v.length<1||v.length>8||v.some(y=>typeof y!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{6})$/i.test(y)))throw new TypeError('colors must contain 1\u20138 hex colors, such as ["#9b87ff", "#47e2c2"].');return v.slice()}function Bn(v,y=x(),_="config"){$t(v,_);let D={};for(let[k,z]of Object.entries(v)){if(!Un(y,k)||["__proto__","prototype","constructor"].includes(k))throw new TypeError(`Unknown setting: ${_}.${k}`);let J=y[k];if(Array.isArray(J))D[k]=jn(z);else if(J&&typeof J=="object")D[k]=Bn(z,J,`${_}.${k}`);else{if(typeof z!=typeof J||typeof z=="number"&&!Number.isFinite(z))throw new TypeError(`Invalid value for ${_}.${k}`);D[k]=z}let Y=_==="config"?k:_.slice(7)+"."+k,ge=lm.find(_e=>_e.optionPath==="config."+Y&&_e.kind==="range");ge&&wn(z,ge.min,ge.max,_+"."+k);let Ee={animationPreset:["none","converge-tilt","legacy-zoom","grow","accretion-exhale"],interactionMode:["rotate","depth-lens","none"],colorPalette:[...m.map(_e=>_e.id),"custom"]};if(Un(Ee,Y)&&!Ee[Y].includes(z))throw new TypeError(`Unknown ${Y}: ${z}`)}return D}function qn(v){$t(v,"options");let y={},_=v.config===void 0?{}:Bn(v.config),D=new Set([...Object.keys(Mt),"colors","particles","animation","bloom","scroll"]);for(let k of Object.keys(v))if(!D.has(k))throw new TypeError(`Unknown option: ${k}`);for(let k of Object.keys(Mt)){if(k==="config"||v[k]===void 0)continue;let z=v[k];if(typeof Mt[k]=="boolean"&&typeof z!="boolean")throw new TypeError(`${k} must be true or false.`);y[k]=z}y.shape!==void 0&&fn(y.shape);for(let[k,z]of Object.entries({transform:["load","scroll","off"],interaction:["rotate","depth-lens","none"],palette:m.map(J=>J.id)}))if(y[k]!==void 0&&!z.includes(y[k]))throw new TypeError(`${k} must be one of: ${z.join(", ")}.`);if(y.padding!==void 0&&wn(y.padding,0,.45,"padding"),y.tier!==void 0&&![0,1,2,3].includes(y.tier))throw new RangeError("tier must be 0, 1, 2, or 3.");if(y.background!==void 0&&(typeof y.background!="string"||!CSS.supports("color",y.background)))throw new TypeError("background must be a CSS color or transparent.");if(v.scroll!==void 0){$t(v.scroll,"scroll"),y.scroll={};for(let[k,z]of Object.entries(v.scroll)){if(!["gather","disperse"].includes(k)||!Array.isArray(z)||z.length!==2)throw new TypeError("scroll ranges must be gather/disperse: [start, end].");if(z.forEach(J=>wn(J,0,1,"scroll."+k)),z[0]>=z[1])throw new RangeError("Scroll range start must be less than its end.");y.scroll[k]=z.slice()}}if(v.particles!==void 0){$t(v.particles,"particles");let k={density:[.25,4],size:[.25,3],intensity:[.1,3],scatter:[0,.45],twinkle:[0,2]};_.stars={..._.stars};for(let[z,J]of Object.entries(v.particles)){if(!Un(k,z))throw new TypeError(`Unknown particle setting: ${z}`);_.stars[z==="twinkle"?"twinkleSpeed":z]=wn(J,...k[z],`particles.${z}`)}}if(v.animation!==void 0){$t(v.animation,"animation");for(let Y of Object.keys(v.animation))if(!["speed","duration","playing"].includes(Y))throw new TypeError(`Unknown animation setting: ${Y}`);let{speed:k,duration:z,playing:J}=v.animation;if(k!==void 0&&(_.stars={..._.stars,flowSpeed:wn(k,0,3,"animation.speed")}),z!==void 0&&(_.convergeDuration=wn(z,1,10,"animation.duration")),J!==void 0){if(typeof J!="boolean")throw new TypeError("animation.playing must be true or false.");_.animationPlaying=J}}return v.bloom!==void 0&&(_.bloomIntensity=wn(v.bloom,0,2,"bloom")),v.colors!==void 0&&(v.colors===null?y.palette=y.palette??Mt.palette:(_.colorMode=!0,_.colorPalette="custom",_.colorPaletteColors=jn(v.colors))),y.interaction!==void 0&&(_.interactionMode=y.interaction),y.autoRotate!==void 0&&(_.pathShapeAutoRotate=y.autoRotate),y.palette!==void 0&&v.colors==null&&(_.colorPalette=y.palette,_.colorPaletteColors=m.find(k=>k.id===y.palette).colors.slice()),Object.keys(_).length&&(y.config=_),y}class ra extends ot{constructor(y,_={}){let D=qn(_);D.interaction===void 0&&D.config?.interactionMode!==void 0&&(D.interaction=D.config.interactionMode),D.autoRotate===void 0&&D.config?.pathShapeAutoRotate!==void 0&&(D.autoRotate=D.config.pathShapeAutoRotate),D.config?.colorPalette==="custom"?D.palette="custom":D.palette===void 0&&D.config?.colorPalette!==void 0&&(D.palette=D.config.colorPalette),super(y,D),this._lastSettingsHash=JSON.stringify(this.getOptions())}update(y={}){if(this._disposed)throw new Error("Cannot update a disposed cue.");let _=qn(y);_.shape!==void 0&&!or(_.shape,this.options.shape)&&this.setShape(_.shape),_.transform!==void 0&&_.transform!==this.options.transform&&this.setTransform(_.transform),_.palette!==void 0&&_.config?.colorPalette!=="custom"&&(this.config.colorPalette!==_.palette||!or(this.config.colorPaletteColors,m.find(k=>k.id===_.palette).colors))&&this.setPalette(_.palette),_.background!==void 0&&_.background!==this.options.background&&this.setBackground(_.background),_.ambient!==void 0&&_.ambient!==this.options.ambient&&this.setAmbient(_.ambient);for(let k of["padding","parallax","holdAtEnd","autoRotate","interaction","interactionLabel"])_[k]===void 0||or(_[k],this.options[k])||(this.options[k]=_[k],k==="autoRotate"&&(this.config.pathShapeAutoRotate=_[k]),k==="interaction"&&(this.config.interactionMode=_[k]),k==="interactionLabel"&&this.button.setAttribute("aria-label",_[k]),this.invalidate());_.tier!==void 0&&_.tier!==this.options.tier&&(this.options.tier=_.tier,this.profile=sr(_.tier,this.reducedMotion),this.rebuild());let D=(k,z="")=>{for(let[J,Y]of Object.entries(k)){let ge=z?`${z}.${J}`:J;if(Y&&typeof Y=="object"&&!Array.isArray(Y))D(Y,ge);else{let Ee=ge.split(".").reduce((_e,Xe)=>_e[Xe],this.config);or(Ee,Y)||this.set(ge,Y)}}};return _.config&&D(_.config),_.scroll&&(this.options.scroll={...this.options.scroll,..._.scroll},this.invalidate()),this._notify(),this}setShape(y){return super.setShape(y),this._svgRequest=(this._svgRequest??0)+1,this.options.shape=y,this._notify(),this}set(y,_){let D=y.split("."),k=x();for(let J of D){if(!k||!Un(k,J)||["__proto__","prototype","constructor"].includes(J))throw new TypeError(`Unknown setting: ${y}`);k=k[J]}if(Array.isArray(k))jn(_);else if(typeof k!=typeof _||typeof _=="object"||typeof _=="number"&&!Number.isFinite(_))throw new TypeError(`Invalid value for ${y}`);let z=D.reduceRight((J,Y)=>({[Y]:J}),_);return Bn(z),super.set(y,Array.isArray(_)?_.slice():_),["colorPalette","colorPaletteColors"].includes(y)&&this.rebuild(),this._notify(),this}getOptions(){let y={};for(let _ of Object.keys(Mt))_!=="config"&&(y[_]=this.options[_]);return y.interaction=this.config.interactionMode,y.autoRotate=this.config.pathShapeAutoRotate,y.palette=m.some(_=>_.id===this.config.colorPalette)?this.config.colorPalette:Mt.palette,this.config.colorPalette==="custom"&&(y.colors=this.config.colorPaletteColors),y.config=this.config,y.scroll={gather:[0,.36],disperse:[.5,.86],...this.options.scroll},JSON.parse(JSON.stringify(y))}onChange(y){if(typeof y!="function")throw new TypeError("onChange expects a function.");let _=()=>y(this.getOptions());return this.host.addEventListener("shape-cue:change",_),()=>this.host.removeEventListener("shape-cue:change",_)}_notify(){this._disposed||!this.host||this._notifyQueued||(this._notifyQueued=!0,queueMicrotask(()=>{if(this._notifyQueued=!1,this._disposed)return;let y=this.getOptions(),_=JSON.stringify(y);_!==this._lastSettingsHash&&(this._lastSettingsHash=_,this.host.dispatchEvent(new CustomEvent("shape-cue:change",{detail:y})))}))}setTransform(y){return super.setTransform(y),this._notify(),this}setPalette(y){return super.setPalette(y),this._notify(),this}setBackground(y){return super.setBackground(y),this._notify(),this}setAmbient(y){return super.setAmbient(y),this._notify(),this}setScrollProgress(y){return y!==null&&wn(y,0,1,"scroll progress"),this._scrollProgress=y,this.input.pointer.reset=!0,this.invalidate(),this}async loadSVG(y){let _=(this._svgRequest??0)+1;this._svgRequest=_;let D;if(typeof y=="string"){if(!y.trim().startsWith("<"))throw new TypeError("loadSVG expects SVG markup or a File, not a URL.");if(new TextEncoder().encode(y).length>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=y}else if(y&&typeof y=="object"&&typeof y.text=="function"&&typeof y.size=="number"){if(y.size>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=await y.text()}else throw new TypeError("loadSVG expects SVG markup, a File, or a Blob.");return this._disposed||_!==this._svgRequest?this:(this.setShape(D),this)}setColors(y){return this.update({colors:y})}pause(){return this.update({animation:{playing:!1}})}play(){return this.update({animation:{playing:!0}})}}let Ii={colors:v=>({colors:v===null?null:v.trim().split(/[\s,]+/)}),speed:v=>({animation:{speed:v===null?.8:Number(v)}}),"gather-duration":v=>({animation:{duration:v===null?5.5:Number(v)}}),paused:v=>({animation:{playing:v===null||v==="false"}}),bloom:v=>({bloom:v===null?.7:Number(v)}),"particle-density":v=>({particles:{density:v===null?4:Number(v)}}),"particle-size":v=>({particles:{size:v===null?2.05:Number(v)}})};function yv(v,y){let _={...y};for(let[D,k]of Object.entries(Ii)){if(!v.hasAttribute(D))continue;let z=k(v.getAttribute(D));for(let[J,Y]of Object.entries(z))_[J]=Y&&typeof Y=="object"&&!Array.isArray(Y)?{..._[J],...Y}:Y}return _}let Sv=Ln.observedAttributes;Object.defineProperty(Ln,"observedAttributes",{get:()=>[...Sv,...Object.keys(Ii)]});let Av=Ln.prototype.attributeChangedCallback;return Ln.prototype.attributeChangedCallback=function(v,y,_){Un(Ii,v)?this.cue&&y!==_&&this.cue.update(Ii[v](_)):(Av.call(this,v,y,_),this.cue&&y!==_&&this.cue._notify())},window[r]={AstraShapeCue:ra,AstraShapeCueElement:Ln,createComponentPanel:Or}}function xv(){let r=cm();customElements.get("astra-shape-cue")||customElements.define("astra-shape-cue",r.AstraShapeCueElement)}function xE(r,e={}){let t=cm();return new t.AstraShapeCue(r,e)}function yE(r,e){let t=cm();if(!e||e.nodeType!==1||typeof e.appendChild!="function")throw new Error("Controls require a host element.");let n=document.createElement("aside");n.className="astra-panel",n.setAttribute("aria-label","Shape Cue controls"),e.appendChild(n),t.createComponentPanel(r,n);let i=()=>{let a=r.getOptions();for(let o of lm){let l=[...n.querySelectorAll("[data-key]")].find(h=>h.dataset.key===o.key);if(!l)continue;let c=o.optionPath.split(".").reduce((h,f)=>h?.[f],a);if(o.key==="shape"&&(c=r.shapeId),o.key==="palette"&&a.colors&&(c="custom"),l.tagName==="SELECT"&&![...l.options].some(h=>h.value===String(c))){let h=document.createElement("option");h.value=String(c),h.textContent=c==="custom"?"Custom":String(c),h.disabled=!0,l.appendChild(h)}o.kind==="checkbox"?l.checked=!!c:l.value=String(c);let u=[...n.querySelectorAll("[data-out]")].find(h=>h.dataset.out===o.key);u&&(u.textContent=String(c))}};i();let s=r.onChange(i);return()=>{s(),n.remove()}}xv();window.UXPShapeCue={version:vv,registerShapeCue:xv,createShapeCue:xE,mountControls:yE,getControlDefinitions:vE};})();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @uxpilot/openai-astra-shape-cue v1.0.0 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
1
+ /*! @uxpilot/openai-astra-shape-cue v1.0.1 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
2
2
 
3
3
  three
4
4
  The MIT License
@@ -4044,7 +4044,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4044
4044
  `+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,r.colorSpace===bt&&(n+=`color0 = sRGBToLinear(color0);
4045
4045
  `),r.uvTransformation?(i=`vec2 transformedUv = vUv;
4046
4046
  `+i,r.defines.set("UV","transformedUv")):r.defines.set("UV","vUv"),r.shaderParts.set(Xt.FRAGMENT_HEAD,t),r.shaderParts.set(Xt.FRAGMENT_MAIN_IMAGE,n),r.shaderParts.set(Xt.FRAGMENT_MAIN_UV,i);for(let[a,o]of r.shaderParts)o!==null&&r.shaderParts.set(a,o.trim().replace(/^#/,`
4047
- #`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(r)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(r,e=Gi){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(r,e)}render(r,e,t,n,i){for(let s of this.effects)s.update(r,e,n);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=n*this.timeScale,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}}setSize(r,e){this.fullscreenMaterial.setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){this.renderer=r;for(let n of this.effects)n.initialize(r,e,t);this.updateMaterial(),t!==void 0&&t!==an&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let r of this.effects)r.removeEventListener("change",this.listener),r.dispose()}handleEvent(r){switch(r.type){case"change":this.recompile();break}}};var ZE=[new Float32Array(3),new Float32Array(3)],KE=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],JE=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var jE=[new Float32Array(2),new Float32Array(2)];var $E=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),eT=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],tT=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],nT=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var iT=new Map([[oi(0,0,0,0),new Float32Array([0,0,0,0])],[oi(0,0,0,1),new Float32Array([0,0,0,1])],[oi(0,0,1,0),new Float32Array([0,0,1,0])],[oi(0,0,1,1),new Float32Array([0,0,1,1])],[oi(0,1,0,0),new Float32Array([0,1,0,0])],[oi(0,1,0,1),new Float32Array([0,1,0,1])],[oi(0,1,1,0),new Float32Array([0,1,1,0])],[oi(0,1,1,1),new Float32Array([0,1,1,1])],[oi(1,0,0,0),new Float32Array([1,0,0,0])],[oi(1,0,0,1),new Float32Array([1,0,0,1])],[oi(1,0,1,0),new Float32Array([1,0,1,0])],[oi(1,0,1,1),new Float32Array([1,0,1,1])],[oi(1,1,0,0),new Float32Array([1,1,0,0])],[oi(1,1,0,1),new Float32Array([1,1,0,1])],[oi(1,1,1,0),new Float32Array([1,1,1,0])],[oi(1,1,1,1),new Float32Array([1,1,1,1])]]);function rm(r,e,t){return r+(e-r)*t}function oi(r,e,t,n){let i=rm(r,e,.75),s=rm(t,n,1-.25);return rm(i,s,1-.125)}var pE=bt,zf=class r extends Hn{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,i){let s=this,a=new xi(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){let t=this;function n(se,W){if(se.nodeType!==1)return;let C=A(se),b=!1,re=null;switch(se.nodeName){case"svg":W=m(se,W);break;case"style":s(se);break;case"g":W=m(se,W);break;case"path":W=m(se,W),se.hasAttribute("d")&&(re=i(se));break;case"rect":W=m(se,W),re=l(se);break;case"polygon":W=m(se,W),re=c(se);break;case"polyline":W=m(se,W),re=u(se);break;case"circle":W=m(se,W),re=h(se);break;case"ellipse":W=m(se,W),re=f(se);break;case"line":W=m(se,W),re=d(se);break;case"defs":b=!0;break;case"use":W=m(se,W);let Ae=(se.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),Ue=se.viewportElement.getElementById(Ae);Ue?n(Ue,W):console.warn("SVGLoader: 'use node' references non-existent node id: "+Ae);break;default:}re&&(W.fill!==void 0&&W.fill!=="none"&&re.color.setStyle(W.fill,pE),R(re,We),V.push(re),re.userData={node:se,style:W});let xe=se.childNodes;for(let j=0;j<xe.length;j++){let Ae=xe[j];b&&Ae.nodeName!=="style"&&Ae.nodeName!=="defs"||n(Ae,W)}C&&(oe.pop(),oe.length>0?We.copy(oe[oe.length-1]):We.identity())}function i(se){let W=new ki,C=new K,b=new K,re=new K,xe=!0,j=!1,Ae=se.getAttribute("d");if(Ae===""||Ae==="none")return null;let Ue=Ae.match(/[a-df-z][^a-df-z]*/ig);for(let B=0,q=Ue.length;B<q;B++){let Q=Ue[B],ne=Q.charAt(0),te=Q.slice(1).trim();xe===!0&&(j=!0,xe=!1);let G;switch(ne){case"M":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"H":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"V":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"L":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"C":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(G[L+0],G[L+1],G[L+2],G[L+3],G[L+4],G[L+5]),b.x=G[L+2],b.y=G[L+3],C.x=G[L+4],C.y=G[L+5],L===0&&j===!0&&re.copy(C);break;case"S":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"Q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"T":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,G[L+0],G[L+1]),b.x=Oe,b.y=tt,C.x=G[L+0],C.y=G[L+1],L===0&&j===!0&&re.copy(C)}break;case"A":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==C.x&&G[L+6]==C.y)continue;let Oe=C.clone();C.x=G[L+5],C.y=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"m":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"h":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"v":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"l":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"c":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3],C.x+G[L+4],C.y+G[L+5]),b.x=C.x+G[L+2],b.y=C.y+G[L+3],C.x+=G[L+4],C.y+=G[L+5],L===0&&j===!0&&re.copy(C);break;case"s":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"t":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,C.x+G[L+0],C.y+G[L+1]),b.x=Oe,b.y=tt,C.x=C.x+G[L+0],C.y=C.y+G[L+1],L===0&&j===!0&&re.copy(C)}break;case"a":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==0&&G[L+6]==0)continue;let Oe=C.clone();C.x+=G[L+5],C.y+=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"Z":case"z":W.currentPath.autoClose=!0,W.currentPath.curves.length>0&&(C.copy(re),W.currentPath.currentPoint.copy(C),xe=!0);break;default:console.warn(Q)}j=!1}return W}function s(se){if(!(!se.sheet||!se.sheet.cssRules||!se.sheet.cssRules.length))for(let W=0;W<se.sheet.cssRules.length;W++){let C=se.sheet.cssRules[W];if(C.type!==1)continue;let b=C.selectorText.split(/,/gm).filter(Boolean).map(re=>re.trim());for(let re=0;re<b.length;re++){let xe=Object.fromEntries(Object.entries(C.style).filter(([,j])=>j!==""));ae[b[re]]=Object.assign(ae[b[re]]||{},xe)}}}function a(se,W,C,b,re,xe,j,Ae){if(W==0||C==0){se.lineTo(Ae.x,Ae.y);return}b=b*Math.PI/180,W=Math.abs(W),C=Math.abs(C);let Ue=(j.x-Ae.x)/2,B=(j.y-Ae.y)/2,q=Math.cos(b)*Ue+Math.sin(b)*B,Q=-Math.sin(b)*Ue+Math.cos(b)*B,ne=W*W,te=C*C,G=q*q,L=Q*Q,fe=G/ne+L/te;if(fe>1){let Be=Math.sqrt(fe);W=Be*W,C=Be*C,ne=W*W,te=C*C}let Oe=ne*L+te*G,tt=(ne*te-Oe)/Oe,N=Math.sqrt(Math.max(0,tt));re===xe&&(N=-N);let E=N*W*Q/C,$=-N*C*q/W,me=Math.cos(b)*E-Math.sin(b)*$+(j.x+Ae.x)/2,Me=Math.sin(b)*E+Math.cos(b)*$+(j.y+Ae.y)/2,ve=o(1,0,(q-E)/W,(Q-$)/C),je=o((q-E)/W,(Q-$)/C,(-q-E)/W,(-Q-$)/C)%(Math.PI*2);se.currentPath.absellipse(me,Me,W,C,ve,ve+je,xe===0,b)}function o(se,W,C,b){let re=se*C+W*b,xe=Math.sqrt(se*se+W*W)*Math.sqrt(C*C+b*b),j=Math.acos(Math.max(-1,Math.min(1,re/xe)));return se*b-W*C<0&&(j=-j),j}function l(se){let W=S(se.getAttribute("x")||0),C=S(se.getAttribute("y")||0),b=S(se.getAttribute("rx")||se.getAttribute("ry")||0),re=S(se.getAttribute("ry")||se.getAttribute("rx")||0),xe=S(se.getAttribute("width")),j=S(se.getAttribute("height")),Ae=1-.551915024494,Ue=new ki;return Ue.moveTo(W+b,C),Ue.lineTo(W+xe-b,C),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe-b*Ae,C,W+xe,C+re*Ae,W+xe,C+re),Ue.lineTo(W+xe,C+j-re),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe,C+j-re*Ae,W+xe-b*Ae,C+j,W+xe-b,C+j),Ue.lineTo(W+b,C+j),(b!==0||re!==0)&&Ue.bezierCurveTo(W+b*Ae,C+j,W,C+j-re*Ae,W,C+j-re),Ue.lineTo(W,C+re),(b!==0||re!==0)&&Ue.bezierCurveTo(W,C+re*Ae,W+b*Ae,C,W+b,C),Ue}function c(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!0,b}function u(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!1,b}function h(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("r")||0),re=new er;re.absarc(W,C,b,0,Math.PI*2);let xe=new ki;return xe.subPaths.push(re),xe}function f(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("rx")||0),re=S(se.getAttribute("ry")||0),xe=new er;xe.absellipse(W,C,b,re,0,Math.PI*2);let j=new ki;return j.subPaths.push(xe),j}function d(se){let W=S(se.getAttribute("x1")||0),C=S(se.getAttribute("y1")||0),b=S(se.getAttribute("x2")||0),re=S(se.getAttribute("y2")||0),xe=new ki;return xe.moveTo(W,C),xe.lineTo(b,re),xe.currentPath.autoClose=!1,xe}function m(se,W){W=Object.assign({},W);let C={};if(se.hasAttribute("class")){let j=se.getAttribute("class").split(/\s/).filter(Boolean).map(Ae=>Ae.trim());for(let Ae=0;Ae<j.length;Ae++)C=Object.assign(C,ae["."+j[Ae]])}se.hasAttribute("id")&&(C=Object.assign(C,ae["#"+se.getAttribute("id")]));function b(j,Ae,Ue){Ue===void 0&&(Ue=function(q){return q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),q}),se.hasAttribute(j)&&(W[Ae]=Ue(se.getAttribute(j))),C[j]&&(W[Ae]=Ue(C[j])),se.style&&se.style[j]!==""&&(W[Ae]=Ue(se.style[j]))}function re(j){return Math.max(0,Math.min(1,S(j)))}function xe(j){return Math.max(0,S(j))}return b("fill","fill"),b("fill-opacity","fillOpacity",re),b("fill-rule","fillRule"),b("opacity","opacity",re),b("stroke","stroke"),b("stroke-opacity","strokeOpacity",re),b("stroke-width","strokeWidth",xe),b("stroke-linejoin","strokeLineJoin"),b("stroke-linecap","strokeLineCap"),b("stroke-miterlimit","strokeMiterLimit",xe),b("visibility","visibility"),W}function x(se,W){return se-(W-se)}function g(se,W,C){if(typeof se!="string")throw new TypeError("Invalid input: "+typeof se);let b={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},re=0,xe=1,j=2,Ae=3,Ue=re,B=!0,q="",Q="",ne=[];function te(Oe,tt,N){let E=new SyntaxError('Unexpected character "'+Oe+'" at index '+tt+".");throw E.partial=N,E}function G(){q!==""&&(Q===""?ne.push(Number(q)):ne.push(Number(q)*Math.pow(10,Number(Q)))),q="",Q=""}let L,fe=se.length;for(let Oe=0;Oe<fe;Oe++){if(L=se[Oe],Array.isArray(W)&&W.includes(ne.length%C)&&b.FLAGS.test(L)){Ue=xe,q=L,G();continue}if(Ue===re){if(b.WHITESPACE.test(L))continue;if(b.DIGIT.test(L)||b.SIGN.test(L)){Ue=xe,q=L;continue}if(b.POINT.test(L)){Ue=j,q=L;continue}b.COMMA.test(L)&&(B&&te(L,Oe,ne),B=!0)}if(Ue===xe){if(b.DIGIT.test(L)){q+=L;continue}if(b.POINT.test(L)){q+=L,Ue=j;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.SIGN.test(L)&&q.length===1&&b.SIGN.test(q[0])&&te(L,Oe,ne)}if(Ue===j){if(b.DIGIT.test(L)){q+=L;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.POINT.test(L)&&q[q.length-1]==="."&&te(L,Oe,ne)}if(Ue===Ae){if(b.DIGIT.test(L)){Q+=L;continue}if(b.SIGN.test(L)){if(Q===""){Q+=L;continue}Q.length===1&&b.SIGN.test(Q)&&te(L,Oe,ne)}}b.WHITESPACE.test(L)?(G(),Ue=re,B=!1):b.COMMA.test(L)?(G(),Ue=re,B=!0):b.SIGN.test(L)?(G(),Ue=xe,q=L):b.POINT.test(L)?(G(),Ue=j,q=L):te(L,Oe,ne)}return G(),ne}let p=["mm","cm","in","pt","pc","px"],M={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function S(se){let W="px";if(typeof se=="string"||se instanceof String)for(let b=0,re=p.length;b<re;b++){let xe=p[b];if(se.endsWith(xe)){W=xe,se=se.substring(0,se.length-xe.length);break}}let C;return W==="px"&&t.defaultUnit!=="px"?C=M.in[t.defaultUnit]/t.defaultDPI:(C=M[W][t.defaultUnit],C<0&&(C=M[W].in*t.defaultDPI)),C*parseFloat(se)}function A(se){if(!(se.hasAttribute("transform")||se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))))return null;let W=P(se);return oe.length>0&&W.premultiply(oe[oe.length-1]),We.copy(W),oe.push(W),W}function P(se){let W=new ft,C=he;if(se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))){let b=S(se.getAttribute("x")),re=S(se.getAttribute("y"));W.translate(b,re)}if(se.hasAttribute("transform")){let b=se.getAttribute("transform").split(")");for(let re=b.length-1;re>=0;re--){let xe=b[re].trim();if(xe==="")continue;let j=xe.indexOf("("),Ae=xe.length;if(j>0&&j<Ae){let Ue=xe.slice(0,j),B=g(xe.slice(j+1));switch(C.identity(),Ue){case"translate":if(B.length>=1){let q=B[0],Q=0;B.length>=2&&(Q=B[1]),C.translate(q,Q)}break;case"rotate":if(B.length>=1){let q=0,Q=0,ne=0;q=B[0]*Math.PI/180,B.length>=3&&(Q=B[1],ne=B[2]),le.makeTranslation(-Q,-ne),ue.makeRotation(q),X.multiplyMatrices(ue,le),le.makeTranslation(Q,ne),C.multiplyMatrices(le,X)}break;case"scale":if(B.length>=1){let q=B[0],Q=q;B.length>=2&&(Q=B[1]),C.scale(q,Q)}break;case"skewX":B.length===1&&C.set(1,Math.tan(B[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":B.length===1&&C.set(1,0,0,Math.tan(B[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":B.length===6&&C.set(B[0],B[2],B[4],B[1],B[3],B[5],0,0,1);break}}W.premultiply(C)}}return W}function R(se,W){function C(j){Ce.set(j.x,j.y,1).applyMatrix3(W),j.set(Ce.x,Ce.y)}function b(j){let Ae=j.xRadius,Ue=j.yRadius,B=Math.cos(j.aRotation),q=Math.sin(j.aRotation),Q=new U(Ae*B,Ae*q,0),ne=new U(-Ue*q,Ue*B,0),te=Q.applyMatrix3(W),G=ne.applyMatrix3(W),L=he.set(te.x,G.x,0,te.y,G.y,0,0,0,1),fe=le.copy(L).invert(),N=ue.copy(fe).transpose().multiply(fe).elements,E=H(N[0],N[1],N[4]),$=Math.sqrt(E.rt1),me=Math.sqrt(E.rt2);if(j.xRadius=1/$,j.yRadius=1/me,j.aRotation=Math.atan2(E.sn,E.cs),!((j.aEndAngle-j.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let ve=le.set($,0,0,0,me,0,0,0,1),je=ue.set(E.cs,E.sn,0,-E.sn,E.cs,0,0,0,1),Be=ve.multiply(je).multiply(L),$e=et=>{let{x:Pe,y:qe}=new U(Math.cos(et),Math.sin(et),0).applyMatrix3(Be);return Math.atan2(qe,Pe)};j.aStartAngle=$e(j.aStartAngle),j.aEndAngle=$e(j.aEndAngle),F(W)&&(j.aClockwise=!j.aClockwise)}}function re(j){let Ae=w(W),Ue=T(W);j.xRadius*=Ae,j.yRadius*=Ue;let B=Ae>Number.EPSILON?Math.atan2(W.elements[1],W.elements[0]):Math.atan2(-W.elements[3],W.elements[4]);j.aRotation+=B,F(W)&&(j.aStartAngle*=-1,j.aEndAngle*=-1,j.aClockwise=!j.aClockwise)}let xe=se.subPaths;for(let j=0,Ae=xe.length;j<Ae;j++){let B=xe[j].curves;for(let q=0;q<B.length;q++){let Q=B[q];Q.isLineCurve?(C(Q.v1),C(Q.v2)):Q.isCubicBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2),C(Q.v3)):Q.isQuadraticBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2)):Q.isEllipseCurve&&(be.set(Q.aX,Q.aY),C(be),Q.aX=be.x,Q.aY=be.y,O(W)?b(Q):re(Q))}}}function F(se){let W=se.elements;return W[0]*W[4]-W[1]*W[3]<0}function O(se){let W=se.elements,C=W[0]*W[3]+W[1]*W[4];if(C===0)return!1;let b=w(se),re=T(se);return Math.abs(C/(b*re))>Number.EPSILON}function w(se){let W=se.elements;return Math.sqrt(W[0]*W[0]+W[1]*W[1])}function T(se){let W=se.elements;return Math.sqrt(W[3]*W[3]+W[4]*W[4])}function H(se,W,C){let b,re,xe,j,Ae,Ue=se+C,B=se-C,q=Math.sqrt(B*B+4*W*W);return Ue>0?(b=.5*(Ue+q),Ae=1/b,re=se*Ae*C-W*Ae*W):Ue<0?re=.5*(Ue-q):(b=.5*q,re=-.5*q),B>0?xe=B+q:xe=B-q,Math.abs(xe)>2*Math.abs(W)?(Ae=-2*W/xe,j=1/Math.sqrt(1+Ae*Ae),xe=Ae*j):Math.abs(W)===0?(xe=1,j=0):(Ae=-.5*xe/W,xe=1/Math.sqrt(1+Ae*Ae),j=Ae*xe),B>0&&(Ae=xe,xe=-j,j=Ae),{rt1:b,rt2:re,cs:xe,sn:j}}let V=[],ae={},oe=[],he=new ft,le=new ft,ue=new ft,X=new ft,be=new K,Ce=new U,We=new ft,ct=new DOMParser().parseFromString(e,"image/svg+xml");return n(ct.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:V,xml:ct.documentElement}}static createShapes(e){let n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:n.ORIGIN,t:0};function s(x,g,p,M){let S=x.x,A=g.x,P=p.x,R=M.x,F=x.y,O=g.y,w=p.y,T=M.y,H=(R-P)*(F-w)-(T-w)*(S-P),V=(A-S)*(F-w)-(O-F)*(S-P),ae=(T-w)*(A-S)-(R-P)*(O-F),oe=H/ae,he=V/ae;if(ae===0&&H!==0||oe<=0||oe>=1||he<0||he>1)return null;if(H===0&&ae===0){for(let le=0;le<2;le++)if(a(le===0?p:M,x,g),i.loc==n.ORIGIN){let ue=le===0?p:M;return{x:ue.x,y:ue.y,t:i.t}}else if(i.loc==n.BETWEEN){let ue=+(S+i.t*(A-S)).toPrecision(10),X=+(F+i.t*(O-F)).toPrecision(10);return{x:ue,y:X,t:i.t}}return null}else{for(let X=0;X<2;X++)if(a(X===0?p:M,x,g),i.loc==n.ORIGIN){let be=X===0?p:M;return{x:be.x,y:be.y,t:i.t}}let le=+(S+oe*(A-S)).toPrecision(10),ue=+(F+oe*(O-F)).toPrecision(10);return{x:le,y:ue,t:oe}}}function a(x,g,p){let M=p.x-g.x,S=p.y-g.y,A=x.x-g.x,P=x.y-g.y,R=M*P-A*S;if(x.x===g.x&&x.y===g.y){i.loc=n.ORIGIN,i.t=0;return}if(x.x===p.x&&x.y===p.y){i.loc=n.DESTINATION,i.t=1;return}if(R<-Number.EPSILON){i.loc=n.LEFT;return}if(R>Number.EPSILON){i.loc=n.RIGHT;return}if(M*A<0||S*P<0){i.loc=n.BEHIND;return}if(Math.sqrt(M*M+S*S)<Math.sqrt(A*A+P*P)){i.loc=n.BEYOND;return}let F;M!==0?F=A/M:F=P/S,i.loc=n.BETWEEN,i.t=F}function o(x,g){let p=[],M=[];for(let S=1;S<x.length;S++){let A=x[S-1],P=x[S];for(let R=1;R<g.length;R++){let F=g[R-1],O=g[R],w=s(A,P,F,O);w!==null&&p.find(T=>T.t<=w.t+Number.EPSILON&&T.t>=w.t-Number.EPSILON)===void 0&&(p.push(w),M.push(new K(w.x,w.y)))}}return M}function l(x,g,p){let M=new K;g.getCenter(M);let S=[];return p.forEach(A=>{A.boundingBox.containsPoint(M)&&o(x,A.points).forEach(R=>{S.push({identifier:A.identifier,isCW:A.isCW,point:R})})}),S.sort((A,P)=>A.point.x-P.point.x),S}function c(x,g,p,M,S){(S==null||S==="")&&(S="nonzero");let A=new K;x.boundingBox.getCenter(A);let P=[new K(p,A.y),new K(M,A.y)],R=l(P,x.boundingBox,g);R.sort((V,ae)=>V.point.x-ae.point.x);let F=[],O=[];R.forEach(V=>{V.identifier===x.identifier?F.push(V):O.push(V)});let w=F[0].point.x,T=[],H=0;for(;H<O.length&&O[H].point.x<w;)T.length>0&&T[T.length-1]===O[H].identifier?T.pop():T.push(O[H].identifier),H++;if(T.push(x.identifier),S==="evenodd"){let V=T.length%2===0,ae=T[T.length-2];return{identifier:x.identifier,isHole:V,for:ae}}else if(S==="nonzero"){let V=!0,ae=null,oe=null;for(let he=0;he<T.length;he++){let le=T[he];V?(oe=g[le].isCW,V=!1,ae=le):oe!==g[le].isCW&&(oe=g[le].isCW,V=!0)}return{identifier:x.identifier,isHole:V,for:ae}}else console.warn('fill-rule: "'+S+'" is currently not implemented.')}let u=999999999,h=-999999999,f=e.subPaths.map(x=>{let g=x.getPoints(),p=-999999999,M=999999999,S=-999999999,A=999999999;for(let P=0;P<g.length;P++){let R=g[P];R.y>p&&(p=R.y),R.y<M&&(M=R.y),R.x>S&&(S=R.x),R.x<A&&(A=R.x)}return h<=S&&(h=S+1),u>=A&&(u=A-1),{curves:x.curves,points:g,isCW:vi.isClockWise(g),identifier:-1,boundingBox:new mo(new K(A,M),new K(S,p))}});f=f.filter(x=>x.points.length>1);for(let x=0;x<f.length;x++)f[x].identifier=x;let d=f.map(x=>c(x,f,u,h,e.userData?e.userData.style.fillRule:void 0)),m=[];return f.forEach(x=>{if(!d[x.identifier].isHole){let p=new Bi;p.curves=x.curves,d.filter(S=>S.isHole&&S.for===x.identifier).forEach(S=>{let A=f[S.identifier],P=new er;P.curves=A.curves,p.holes.push(P)}),m.push(p)}}),m}static getStrokeStyle(e,t,n,i,s){return e=e!==void 0?e:1,t=t!==void 0?t:"#000",n=n!==void 0?n:"miter",i=i!==void 0?i:"butt",s=s!==void 0?s:4,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:i,strokeMiterLimit:s}}static pointsToStroke(e,t,n,i){let s=[],a=[],o=[];if(r.pointsToStrokeWithBuffers(e,t,n,i,s,a,o)===0)return null;let l=new dt;return l.setAttribute("position",new Te(s,3)),l.setAttribute("normal",new Te(a,3)),l.setAttribute("uv",new Te(o,2)),l}static pointsToStrokeWithBuffers(e,t,n,i,s,a,o,l){let c=new K,u=new K,h=new K,f=new K,d=new K,m=new K,x=new K,g=new K,p=new K,M=new K,S=new K,A=new K,P=new K,R=new K,F=new K,O=new K,w=new K;n=n!==void 0?n:12,i=i!==void 0?i:.001,l=l!==void 0?l:0,e=B(e);let T=e.length;if(T<2)return 0;let H=e[0].equals(e[T-1]),V,ae=e[0],oe,he=t.strokeWidth/2,le=1/(T-1),ue=0,X,be,Ce,We,ct=!1,Pt=0,se=l*3,W=l*2;C(e[0],e[1],c).multiplyScalar(he),g.copy(e[0]).sub(c),p.copy(e[0]).add(c),M.copy(g),S.copy(p);for(let q=1;q<T;q++){V=e[q],q===T-1?H?oe=e[1]:oe=void 0:oe=e[q+1];let Q=c;if(C(ae,V,Q),h.copy(Q).multiplyScalar(he),A.copy(V).sub(h),P.copy(V).add(h),X=ue+le,be=!1,oe!==void 0){C(V,oe,u),h.copy(u).multiplyScalar(he),R.copy(V).sub(h),F.copy(V).add(h),Ce=!0,h.subVectors(oe,ae),Q.dot(h)<0&&(Ce=!1),q===1&&(ct=Ce),h.subVectors(oe,V),h.normalize();let ne=Math.abs(Q.dot(h));if(ne>Number.EPSILON){let te=he/ne;h.multiplyScalar(-te),f.subVectors(V,ae),d.copy(f).setLength(te).add(h),O.copy(d).negate();let G=d.length(),L=f.length();f.divideScalar(L),m.subVectors(oe,V);let fe=m.length();switch(m.divideScalar(fe),f.dot(O)<L&&m.dot(O)<fe&&(be=!0),w.copy(d).add(V),O.add(V),We=!1,be?Ce?(F.copy(O),P.copy(O)):(R.copy(O),A.copy(O)):xe(),t.strokeLineJoin){case"bevel":j(Ce,be,X);break;case"round":Ae(Ce,be),Ce?re(V,A,R,X,0):re(V,F,P,X,1);break;case"miter":case"miter-clip":default:let Oe=he*t.strokeMiterLimit/G;if(Oe<1)if(t.strokeLineJoin!=="miter-clip"){j(Ce,be,X);break}else Ae(Ce,be),Ce?(m.subVectors(w,A).multiplyScalar(Oe).add(A),x.subVectors(w,R).multiplyScalar(Oe).add(R),b(A,X,0),b(m,X,0),b(V,X,.5),b(V,X,.5),b(m,X,0),b(x,X,0),b(V,X,.5),b(x,X,0),b(R,X,0)):(m.subVectors(w,P).multiplyScalar(Oe).add(P),x.subVectors(w,F).multiplyScalar(Oe).add(F),b(P,X,1),b(m,X,1),b(V,X,.5),b(V,X,.5),b(m,X,1),b(x,X,1),b(V,X,.5),b(x,X,1),b(F,X,1));else be?(Ce?(b(p,ue,1),b(g,ue,0),b(w,X,0),b(p,ue,1),b(w,X,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(w,X,1),b(g,ue,0),b(O,X,0),b(w,X,1)),Ce?R.copy(w):F.copy(w)):Ce?(b(A,X,0),b(w,X,0),b(V,X,.5),b(V,X,.5),b(w,X,0),b(R,X,0)):(b(P,X,1),b(w,X,1),b(V,X,.5),b(V,X,.5),b(w,X,1),b(F,X,1)),We=!0;break}}else xe()}else xe();!H&&q===T-1&&Ue(e[0],M,S,Ce,!0,ue),ue=X,ae=V,g.copy(R),p.copy(F)}if(!H)Ue(V,A,P,Ce,!1,X);else if(be&&s){let q=w,Q=O;ct!==Ce&&(q=O,Q=w),Ce?(We||ct)&&(Q.toArray(s,0*3),Q.toArray(s,3*3),We&&q.toArray(s,1*3)):(We||!ct)&&(Q.toArray(s,1*3),Q.toArray(s,3*3),We&&q.toArray(s,0*3))}return Pt;function C(q,Q,ne){return ne.subVectors(Q,q),ne.set(-ne.y,ne.x).normalize()}function b(q,Q,ne){s&&(s[se]=q.x,s[se+1]=q.y,s[se+2]=0,a&&(a[se]=0,a[se+1]=0,a[se+2]=1),se+=3,o&&(o[W]=Q,o[W+1]=ne,W+=2)),Pt+=3}function re(q,Q,ne,te,G){c.copy(Q).sub(q).normalize(),u.copy(ne).sub(q).normalize();let L=Math.PI,fe=c.dot(u);Math.abs(fe)<1&&(L=Math.abs(Math.acos(fe))),L/=n,h.copy(Q);for(let Oe=0,tt=n-1;Oe<tt;Oe++)f.copy(h).rotateAround(q,L),b(h,te,G),b(f,te,G),b(q,te,.5),h.copy(f);b(f,te,G),b(ne,te,G),b(q,te,.5)}function xe(){b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(P,X,1)}function j(q,Q,ne){Q?q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ne,0),b(R,ne,0),b(O,ne,.5)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ne,1),b(O,ne,0),b(F,ne,1)):q?(b(A,ne,0),b(R,ne,0),b(V,ne,.5)):(b(P,ne,1),b(F,ne,0),b(V,ne,.5))}function Ae(q,Q){Q&&(q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ue,0),b(V,X,.5),b(O,X,1),b(V,X,.5),b(R,ue,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ue,1),b(O,X,0),b(V,X,.5),b(V,X,.5),b(O,X,0),b(F,ue,1)))}function Ue(q,Q,ne,te,G,L){switch(t.strokeLineCap){case"round":G?re(q,ne,Q,L,.5):re(q,Q,ne,L,.5);break;case"square":if(G)c.subVectors(Q,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q),te?(h.toArray(s,1*3),f.toArray(s,0*3),f.toArray(s,3*3)):(h.toArray(s,1*3),o[3*2+1]===1?f.toArray(s,3*3):h.toArray(s,3*3),f.toArray(s,0*3));else{c.subVectors(ne,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q);let fe=s.length;te?(h.toArray(s,fe-1*3),f.toArray(s,fe-2*3),f.toArray(s,fe-4*3)):(f.toArray(s,fe-2*3),h.toArray(s,fe-1*3),f.toArray(s,fe-4*3))}break;case"butt":default:break}}function B(q){let Q=!1;for(let te=1,G=q.length-1;te<G;te++)if(q[te].distanceTo(q[te+1])<i){Q=!0;break}if(!Q)return q;let ne=[];ne.push(q[0]);for(let te=1,G=q.length-1;te<G;te++)q[te].distanceTo(q[te+1])>=i&&ne.push(q[te]);return ne.push(q[q.length-1]),ne}}};var mE="1.0.0",lm=[{key:"shape",label:"Shape",kind:"select",optionPath:"shape",defaultValue:"star",choices:["star","heart","infinity","hexagon","spiral","custom"]},{key:"transform",label:"Transform on scroll",kind:"select",optionPath:"transform",defaultValue:"load",choices:["scroll","load","off"]},{key:"interactionMode",label:"Interaction",kind:"select",optionPath:"interaction",defaultValue:"rotate",choices:["rotate","depth-lens","none"]},{key:"palette",label:"Palette",kind:"select",optionPath:"palette",defaultValue:"astra",choices:["astra","aurora","ember"]},{key:"background",label:"Background",kind:"select",optionPath:"background",defaultValue:"#000",choices:["#000","#0b0f1a","transparent"]},{key:"holdAtEnd",label:"Hold shape after scrolling past",kind:"checkbox",optionPath:"holdAtEnd",defaultValue:!1},{key:"parallax",label:"Scroll parallax while dispersed",kind:"checkbox",optionPath:"parallax",defaultValue:!0},{key:"ambient",label:"Ambient glow + vignette",kind:"checkbox",optionPath:"ambient",defaultValue:!1},{key:"padding",label:"Padding",kind:"range",optionPath:"padding",defaultValue:.1,min:0,max:.4,step:.01},{key:"pathShapeAutoRotateAmount",label:"Auto-rotate amount",kind:"range",optionPath:"config.pathShapeAutoRotateAmount",defaultValue:.42,min:0,max:1.2,step:.01},{key:"pathShapeScatter",label:"Shape scatter",kind:"range",optionPath:"config.pathShapeScatter",defaultValue:1,min:0,max:3,step:.01},{key:"rotationDepth",label:"Shape depth",kind:"range",optionPath:"config.rotationDepth",defaultValue:1.4,min:0,max:2,step:.01},{key:"stars.density",label:"Star density",kind:"range",optionPath:"config.stars.density",defaultValue:4,min:.25,max:4,step:.05},{key:"stars.intensity",label:"Star intensity",kind:"range",optionPath:"config.stars.intensity",defaultValue:1.35,min:.1,max:3,step:.01},{key:"stars.size",label:"Star size",kind:"range",optionPath:"config.stars.size",defaultValue:2.05,min:.25,max:3,step:.01},{key:"bloomIntensity",label:"Bloom",kind:"range",optionPath:"config.bloomIntensity",defaultValue:.7,min:0,max:2,step:.01},{key:"lensFlare.intensity",label:"Lens flare",kind:"range",optionPath:"config.lensFlare.intensity",defaultValue:.28,min:0,max:1.5,step:.01},{key:"interaction.repelRadius",label:"Pointer repel radius",kind:"range",optionPath:"config.interaction.repelRadius",defaultValue:176,min:16,max:360,step:1},{key:"pathShapeAutoRotate",label:"Auto-rotate shape",kind:"checkbox",optionPath:"config.pathShapeAutoRotate",defaultValue:!0},{key:"faceForward",label:"Return to front on release",kind:"checkbox",optionPath:"config.faceForward",defaultValue:!0},{key:"interaction.particleRepel",label:"Pointer repels particles",kind:"checkbox",optionPath:"config.interaction.particleRepel",defaultValue:!0},{key:"lensFlare.enabled",label:"Lens flare",kind:"checkbox",optionPath:"config.lensFlare.enabled",defaultValue:!0},{key:"dirtyGlass.enabled",label:"Dirty glass + grain",kind:"checkbox",optionPath:"config.dirtyGlass.enabled",defaultValue:!0},{key:"orbitalDust.enabled",label:"Orbital dust",kind:"checkbox",optionPath:"config.orbitalDust.enabled",defaultValue:!1},{key:"showCenterCluster",label:"Center cluster",kind:"checkbox",optionPath:"config.showCenterCluster",defaultValue:!0}];function UT(){return JSON.parse(JSON.stringify(lm))}function cm(){if(typeof window>"u"||typeof document>"u")throw new Error("Shape Cue requires a browser. Initialize it after mounting.");let r=Symbol.for("@uxpilot/openai-astra-shape-cue/"+mE);if(window[r])return window[r];let{MathUtils:e}=tm,t=(v,y,_)=>Math.min(_,Math.max(y,v)),n=(v,y)=>(v%y+y)%y,i=v=>typeof v=="number"&&Number.isFinite(v),s=32,a=Object.freeze({animationPlaying:!0,animationRestartKey:0,bloomIntensity:.7,bloomThreshold:.08,colorMode:!0,convergeDuration:5.5,faceForward:!0,pathShapeAutoRotate:!0,pathShapeAutoRotateAmount:.42,pathShapeAutoRotateSpeed:.22,pathShapeScatter:1,rotationDepth:1.4,scrollDisperseDistance:800,scrollEffects:!0,scrollStarDriftSpeed:3,scrollStartOffset:0,scrollTextFadeDistance:200,showCenterCluster:!0}),o=Object.freeze({density:4,densityFalloff:.22,flowInward:!0,flowSpeed:.8,intensity:1.35,scatter:.4,size:2.05,sizeFalloff:.45,twinkleSpeed:.62}),l=Object.freeze({depthDisplacement:.5,followDamping:6,illumination:.55,magnification:.18,particleRepel:!0,repelDistance:52,repelFalloff:2,repelHighlight:.16,repelHighlightRadius:196,repelPressMultiplier:2.2,repelRadius:176,repelReturnSpring:2.8,repelSpring:7,rotationLag:.68,radius:156,smearCurl:.24,smearTrailLength:2.25}),c=Object.freeze({density:.55,driftSpeed:.2,enabled:!1,intensity:2,reach:.17,spread:.4,tightSpread:.03}),u=Object.freeze({animated:!0,enabled:!0,ghosts:.1,halo:.12,intensity:.28,secondary:.55,streakLength:.03485,streaks:.18,verticalStreaks:1}),h=Object.freeze({distortion:.68,drift:!0,driftStrength:.28,enabled:!0,grain:.031,procedural:0,texture:0}),f=Object.freeze({accretionRatio:.42,ambientAmount:.04,ambientSpeed:.55,coreIntensity:1.45,duration:8,exhaleStrength:.42,inwardStrength:1.2,propagationSoftness:.16,settleDuration:1.2,startScale:.58}),d=Object.freeze({duration:8,growthSpeed:.55,softness:.075,startZoom:4}),m=[{id:"astra",label:"Astra",colors:["#6DCBF4","#7AB1FE","#F87915","#FA994C","#F5F6FB"]},{id:"aurora",label:"Aurora",colors:["#47E2C2","#6DCBF4","#B06DFF","#E96AC8","#F5F6FB"]},{id:"ember",label:"Ember",colors:["#F7CB59","#FA994C","#F67576","#B06DFF","#F5F6FB"]}];function x(){return{...a,accretionExhale:{...f},animationPreset:"converge-tilt",colorPalette:"astra",colorPaletteColors:[...m[0].colors],dirtyGlass:{...h},grow:{...d},interaction:{...l},interactionMode:"rotate",lensFlare:{...u},orbitalDust:{...c},stars:{...o}}}let g=Object.freeze({background:{ambientColor:"#23435F",ambientOpacity:.55},motion:{disperseDistance:800,headingTrailingSpaceVh:7,labelRevealDelay:.85,labelRevealDuration:1,labelStagger:.1},activationLine:.5,easing:"smoothstep"});function p(v,y,_){if(!y.scrollEffects)return{textOpacity:1,dispersion:0,progress:0};let D=(Number.isFinite(v)?v:0)-Math.max(y.scrollStartOffset,0),k=t(D/Math.max(y.scrollTextFadeDistance,1),0,1),z=Math.max(D/Math.max(y.scrollDisperseDistance,1),0),J=t(z,0,1);if(_){let Y=J<.5?0:1;return{textOpacity:+(k<.5),dispersion:Y,progress:Y}}return{textOpacity:1-k*k*k*(k*(6*k-15)+10),dispersion:J,progress:z}}function M(v,y){let _=t(Number.isFinite(v)?v:0,0,1);return y==="linear"?_:_*_*(3-2*_)}let S={spiral:{label:"Spiral field",width:100,height:100,paths:[],native:!0},star:{label:"Star",width:100,height:100,strokeWidth:3,paths:["M50 4 L61.8 36.3 L96.2 36.3 L68.4 56.3 L79 89.4 L50 69.5 L21 89.4 L31.6 56.3 L3.8 36.3 L38.2 36.3 Z"]},heart:{label:"Heart",width:100,height:100,strokeWidth:3,paths:["M50 88 C20 66 6 50 6 32 C6 18 17 8 30 8 C39 8 46 13 50 20 C54 13 61 8 70 8 C83 8 94 18 94 32 C94 50 80 66 50 88 Z"]},infinity:{label:"Infinity",width:200,height:100,strokeWidth:4,paths:["M100 50 C80 20 30 20 30 50 C30 80 80 80 100 50 C120 20 170 20 170 50 C170 80 120 80 100 50 Z"]},hexagon:{label:"Hexagon",width:100,height:100,strokeWidth:3,paths:["M50 4 L90 27 L90 73 L50 96 L10 73 L10 27 Z"]},custom:{label:"Custom SVG\u2026",width:100,height:100,strokeWidth:2,paths:[]}};function A(v){let y=v>>>0;return()=>{let _=y+=1831565813;return _=Math.imul(_^_>>>15,1|_),(((_^=_+Math.imul(_^_>>>7,61|_))^_>>>14)>>>0)/4294967296}}function P(v,y,_,D){let k=43758.5453*Math.sin(v*_+y*D);return k-Math.floor(k)}let R=[.08,.58,.22,.68,.44],F=new Map;function O(v,y){let _=(m.find(J=>J.id===v)??m[0]).colors,D=y?.length?y:_,k=D.join(","),z=F.get(k);return z||(z=D.map(J=>new Ve(J)),F.set(k,z)),z}let w=new Ve(1,1,1);function T(v,y,_,D,k,z){let J=w;if(_){let Y=O(k,z);J=k==="custom"||Y.length!==5?Y[Math.min(Math.floor(D*Y.length),Y.length-1)]:D<.36?Y[0]:D<.52?Y[1]:D<.64?Y[2]:D<.74?Y[3]:Y[4]}v[y]=J.r,v[y+1]=J.g,v[y+2]=J.b}let H=.12,V=.035,ae=.8,oe=.4,he=.28,le=.08,ue=6,X=.2;function be(v,y,_,D,k,z,J){let Y=t(k,0,1),ge=t(J,0,1);if(ge===0)return v.set(0,0);let Ee=e.lerp(.4,.8,Y),_e=e.lerp(.035,.12,Y)*ge,Xe=_*Math.PI*2+2.7*D,Re=D*Math.PI*2+3.1*k,ce=z*e.lerp(.08,.28,Y*Y)*ge;return v.set((Math.sin(Xe+y*Ee)-Math.sin(Xe))*_e,(Math.cos(Re+y*Ee*.73)-Math.cos(Re))*_e+ce)}let Ce=`
4047
+ #`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(r)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(r,e=Gi){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(r,e)}render(r,e,t,n,i){for(let s of this.effects)s.update(r,e,n);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=n*this.timeScale,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}}setSize(r,e){this.fullscreenMaterial.setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){this.renderer=r;for(let n of this.effects)n.initialize(r,e,t);this.updateMaterial(),t!==void 0&&t!==an&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let r of this.effects)r.removeEventListener("change",this.listener),r.dispose()}handleEvent(r){switch(r.type){case"change":this.recompile();break}}};var ZE=[new Float32Array(3),new Float32Array(3)],KE=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],JE=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var jE=[new Float32Array(2),new Float32Array(2)];var $E=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),eT=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],tT=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],nT=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var iT=new Map([[oi(0,0,0,0),new Float32Array([0,0,0,0])],[oi(0,0,0,1),new Float32Array([0,0,0,1])],[oi(0,0,1,0),new Float32Array([0,0,1,0])],[oi(0,0,1,1),new Float32Array([0,0,1,1])],[oi(0,1,0,0),new Float32Array([0,1,0,0])],[oi(0,1,0,1),new Float32Array([0,1,0,1])],[oi(0,1,1,0),new Float32Array([0,1,1,0])],[oi(0,1,1,1),new Float32Array([0,1,1,1])],[oi(1,0,0,0),new Float32Array([1,0,0,0])],[oi(1,0,0,1),new Float32Array([1,0,0,1])],[oi(1,0,1,0),new Float32Array([1,0,1,0])],[oi(1,0,1,1),new Float32Array([1,0,1,1])],[oi(1,1,0,0),new Float32Array([1,1,0,0])],[oi(1,1,0,1),new Float32Array([1,1,0,1])],[oi(1,1,1,0),new Float32Array([1,1,1,0])],[oi(1,1,1,1),new Float32Array([1,1,1,1])]]);function rm(r,e,t){return r+(e-r)*t}function oi(r,e,t,n){let i=rm(r,e,.75),s=rm(t,n,1-.25);return rm(i,s,1-.125)}var pE=bt,zf=class r extends Hn{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,i){let s=this,a=new xi(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){let t=this;function n(se,W){if(se.nodeType!==1)return;let C=A(se),b=!1,re=null;switch(se.nodeName){case"svg":W=m(se,W);break;case"style":s(se);break;case"g":W=m(se,W);break;case"path":W=m(se,W),se.hasAttribute("d")&&(re=i(se));break;case"rect":W=m(se,W),re=l(se);break;case"polygon":W=m(se,W),re=c(se);break;case"polyline":W=m(se,W),re=u(se);break;case"circle":W=m(se,W),re=h(se);break;case"ellipse":W=m(se,W),re=f(se);break;case"line":W=m(se,W),re=d(se);break;case"defs":b=!0;break;case"use":W=m(se,W);let Ae=(se.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),Ue=se.viewportElement.getElementById(Ae);Ue?n(Ue,W):console.warn("SVGLoader: 'use node' references non-existent node id: "+Ae);break;default:}re&&(W.fill!==void 0&&W.fill!=="none"&&re.color.setStyle(W.fill,pE),R(re,We),V.push(re),re.userData={node:se,style:W});let xe=se.childNodes;for(let j=0;j<xe.length;j++){let Ae=xe[j];b&&Ae.nodeName!=="style"&&Ae.nodeName!=="defs"||n(Ae,W)}C&&(oe.pop(),oe.length>0?We.copy(oe[oe.length-1]):We.identity())}function i(se){let W=new ki,C=new K,b=new K,re=new K,xe=!0,j=!1,Ae=se.getAttribute("d");if(Ae===""||Ae==="none")return null;let Ue=Ae.match(/[a-df-z][^a-df-z]*/ig);for(let B=0,q=Ue.length;B<q;B++){let Q=Ue[B],ne=Q.charAt(0),te=Q.slice(1).trim();xe===!0&&(j=!0,xe=!1);let G;switch(ne){case"M":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"H":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"V":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"L":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x=G[L+0],C.y=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"C":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(G[L+0],G[L+1],G[L+2],G[L+3],G[L+4],G[L+5]),b.x=G[L+2],b.y=G[L+3],C.x=G[L+4],C.y=G[L+5],L===0&&j===!0&&re.copy(C);break;case"S":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"Q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(G[L+0],G[L+1],G[L+2],G[L+3]),b.x=G[L+0],b.y=G[L+1],C.x=G[L+2],C.y=G[L+3],L===0&&j===!0&&re.copy(C);break;case"T":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,G[L+0],G[L+1]),b.x=Oe,b.y=tt,C.x=G[L+0],C.y=G[L+1],L===0&&j===!0&&re.copy(C)}break;case"A":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==C.x&&G[L+6]==C.y)continue;let Oe=C.clone();C.x=G[L+5],C.y=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"m":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,L===0?W.moveTo(C.x,C.y):W.lineTo(C.x,C.y),L===0&&re.copy(C);break;case"h":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.x+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"v":G=g(te);for(let L=0,fe=G.length;L<fe;L++)C.y+=G[L],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"l":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2)C.x+=G[L+0],C.y+=G[L+1],b.x=C.x,b.y=C.y,W.lineTo(C.x,C.y),L===0&&j===!0&&re.copy(C);break;case"c":G=g(te);for(let L=0,fe=G.length;L<fe;L+=6)W.bezierCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3],C.x+G[L+4],C.y+G[L+5]),b.x=C.x+G[L+2],b.y=C.y+G[L+3],C.x+=G[L+4],C.y+=G[L+5],L===0&&j===!0&&re.copy(C);break;case"s":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.bezierCurveTo(x(C.x,b.x),x(C.y,b.y),C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"q":G=g(te);for(let L=0,fe=G.length;L<fe;L+=4)W.quadraticCurveTo(C.x+G[L+0],C.y+G[L+1],C.x+G[L+2],C.y+G[L+3]),b.x=C.x+G[L+0],b.y=C.y+G[L+1],C.x+=G[L+2],C.y+=G[L+3],L===0&&j===!0&&re.copy(C);break;case"t":G=g(te);for(let L=0,fe=G.length;L<fe;L+=2){let Oe=x(C.x,b.x),tt=x(C.y,b.y);W.quadraticCurveTo(Oe,tt,C.x+G[L+0],C.y+G[L+1]),b.x=Oe,b.y=tt,C.x=C.x+G[L+0],C.y=C.y+G[L+1],L===0&&j===!0&&re.copy(C)}break;case"a":G=g(te,[3,4],7);for(let L=0,fe=G.length;L<fe;L+=7){if(G[L+5]==0&&G[L+6]==0)continue;let Oe=C.clone();C.x+=G[L+5],C.y+=G[L+6],b.x=C.x,b.y=C.y,a(W,G[L],G[L+1],G[L+2],G[L+3],G[L+4],Oe,C),L===0&&j===!0&&re.copy(C)}break;case"Z":case"z":W.currentPath.autoClose=!0,W.currentPath.curves.length>0&&(C.copy(re),W.currentPath.currentPoint.copy(C),xe=!0);break;default:console.warn(Q)}j=!1}return W}function s(se){if(!(!se.sheet||!se.sheet.cssRules||!se.sheet.cssRules.length))for(let W=0;W<se.sheet.cssRules.length;W++){let C=se.sheet.cssRules[W];if(C.type!==1)continue;let b=C.selectorText.split(/,/gm).filter(Boolean).map(re=>re.trim());for(let re=0;re<b.length;re++){let xe=Object.fromEntries(Object.entries(C.style).filter(([,j])=>j!==""));ae[b[re]]=Object.assign(ae[b[re]]||{},xe)}}}function a(se,W,C,b,re,xe,j,Ae){if(W==0||C==0){se.lineTo(Ae.x,Ae.y);return}b=b*Math.PI/180,W=Math.abs(W),C=Math.abs(C);let Ue=(j.x-Ae.x)/2,B=(j.y-Ae.y)/2,q=Math.cos(b)*Ue+Math.sin(b)*B,Q=-Math.sin(b)*Ue+Math.cos(b)*B,ne=W*W,te=C*C,G=q*q,L=Q*Q,fe=G/ne+L/te;if(fe>1){let Be=Math.sqrt(fe);W=Be*W,C=Be*C,ne=W*W,te=C*C}let Oe=ne*L+te*G,tt=(ne*te-Oe)/Oe,N=Math.sqrt(Math.max(0,tt));re===xe&&(N=-N);let E=N*W*Q/C,$=-N*C*q/W,me=Math.cos(b)*E-Math.sin(b)*$+(j.x+Ae.x)/2,Me=Math.sin(b)*E+Math.cos(b)*$+(j.y+Ae.y)/2,ve=o(1,0,(q-E)/W,(Q-$)/C),je=o((q-E)/W,(Q-$)/C,(-q-E)/W,(-Q-$)/C)%(Math.PI*2);se.currentPath.absellipse(me,Me,W,C,ve,ve+je,xe===0,b)}function o(se,W,C,b){let re=se*C+W*b,xe=Math.sqrt(se*se+W*W)*Math.sqrt(C*C+b*b),j=Math.acos(Math.max(-1,Math.min(1,re/xe)));return se*b-W*C<0&&(j=-j),j}function l(se){let W=S(se.getAttribute("x")||0),C=S(se.getAttribute("y")||0),b=S(se.getAttribute("rx")||se.getAttribute("ry")||0),re=S(se.getAttribute("ry")||se.getAttribute("rx")||0),xe=S(se.getAttribute("width")),j=S(se.getAttribute("height")),Ae=1-.551915024494,Ue=new ki;return Ue.moveTo(W+b,C),Ue.lineTo(W+xe-b,C),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe-b*Ae,C,W+xe,C+re*Ae,W+xe,C+re),Ue.lineTo(W+xe,C+j-re),(b!==0||re!==0)&&Ue.bezierCurveTo(W+xe,C+j-re*Ae,W+xe-b*Ae,C+j,W+xe-b,C+j),Ue.lineTo(W+b,C+j),(b!==0||re!==0)&&Ue.bezierCurveTo(W+b*Ae,C+j,W,C+j-re*Ae,W,C+j-re),Ue.lineTo(W,C+re),(b!==0||re!==0)&&Ue.bezierCurveTo(W,C+re*Ae,W+b*Ae,C,W+b,C),Ue}function c(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!0,b}function u(se){function W(xe,j,Ae){let Ue=S(j),B=S(Ae);re===0?b.moveTo(Ue,B):b.lineTo(Ue,B),re++}let C=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,b=new ki,re=0;return se.getAttribute("points").replace(C,W),b.currentPath.autoClose=!1,b}function h(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("r")||0),re=new er;re.absarc(W,C,b,0,Math.PI*2);let xe=new ki;return xe.subPaths.push(re),xe}function f(se){let W=S(se.getAttribute("cx")||0),C=S(se.getAttribute("cy")||0),b=S(se.getAttribute("rx")||0),re=S(se.getAttribute("ry")||0),xe=new er;xe.absellipse(W,C,b,re,0,Math.PI*2);let j=new ki;return j.subPaths.push(xe),j}function d(se){let W=S(se.getAttribute("x1")||0),C=S(se.getAttribute("y1")||0),b=S(se.getAttribute("x2")||0),re=S(se.getAttribute("y2")||0),xe=new ki;return xe.moveTo(W,C),xe.lineTo(b,re),xe.currentPath.autoClose=!1,xe}function m(se,W){W=Object.assign({},W);let C={};if(se.hasAttribute("class")){let j=se.getAttribute("class").split(/\s/).filter(Boolean).map(Ae=>Ae.trim());for(let Ae=0;Ae<j.length;Ae++)C=Object.assign(C,ae["."+j[Ae]])}se.hasAttribute("id")&&(C=Object.assign(C,ae["#"+se.getAttribute("id")]));function b(j,Ae,Ue){Ue===void 0&&(Ue=function(q){return q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),q}),se.hasAttribute(j)&&(W[Ae]=Ue(se.getAttribute(j))),C[j]&&(W[Ae]=Ue(C[j])),se.style&&se.style[j]!==""&&(W[Ae]=Ue(se.style[j]))}function re(j){return Math.max(0,Math.min(1,S(j)))}function xe(j){return Math.max(0,S(j))}return b("fill","fill"),b("fill-opacity","fillOpacity",re),b("fill-rule","fillRule"),b("opacity","opacity",re),b("stroke","stroke"),b("stroke-opacity","strokeOpacity",re),b("stroke-width","strokeWidth",xe),b("stroke-linejoin","strokeLineJoin"),b("stroke-linecap","strokeLineCap"),b("stroke-miterlimit","strokeMiterLimit",xe),b("visibility","visibility"),W}function x(se,W){return se-(W-se)}function g(se,W,C){if(typeof se!="string")throw new TypeError("Invalid input: "+typeof se);let b={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},re=0,xe=1,j=2,Ae=3,Ue=re,B=!0,q="",Q="",ne=[];function te(Oe,tt,N){let E=new SyntaxError('Unexpected character "'+Oe+'" at index '+tt+".");throw E.partial=N,E}function G(){q!==""&&(Q===""?ne.push(Number(q)):ne.push(Number(q)*Math.pow(10,Number(Q)))),q="",Q=""}let L,fe=se.length;for(let Oe=0;Oe<fe;Oe++){if(L=se[Oe],Array.isArray(W)&&W.includes(ne.length%C)&&b.FLAGS.test(L)){Ue=xe,q=L,G();continue}if(Ue===re){if(b.WHITESPACE.test(L))continue;if(b.DIGIT.test(L)||b.SIGN.test(L)){Ue=xe,q=L;continue}if(b.POINT.test(L)){Ue=j,q=L;continue}b.COMMA.test(L)&&(B&&te(L,Oe,ne),B=!0)}if(Ue===xe){if(b.DIGIT.test(L)){q+=L;continue}if(b.POINT.test(L)){q+=L,Ue=j;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.SIGN.test(L)&&q.length===1&&b.SIGN.test(q[0])&&te(L,Oe,ne)}if(Ue===j){if(b.DIGIT.test(L)){q+=L;continue}if(b.EXP.test(L)){Ue=Ae;continue}b.POINT.test(L)&&q[q.length-1]==="."&&te(L,Oe,ne)}if(Ue===Ae){if(b.DIGIT.test(L)){Q+=L;continue}if(b.SIGN.test(L)){if(Q===""){Q+=L;continue}Q.length===1&&b.SIGN.test(Q)&&te(L,Oe,ne)}}b.WHITESPACE.test(L)?(G(),Ue=re,B=!1):b.COMMA.test(L)?(G(),Ue=re,B=!0):b.SIGN.test(L)?(G(),Ue=xe,q=L):b.POINT.test(L)?(G(),Ue=j,q=L):te(L,Oe,ne)}return G(),ne}let p=["mm","cm","in","pt","pc","px"],M={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function S(se){let W="px";if(typeof se=="string"||se instanceof String)for(let b=0,re=p.length;b<re;b++){let xe=p[b];if(se.endsWith(xe)){W=xe,se=se.substring(0,se.length-xe.length);break}}let C;return W==="px"&&t.defaultUnit!=="px"?C=M.in[t.defaultUnit]/t.defaultDPI:(C=M[W][t.defaultUnit],C<0&&(C=M[W].in*t.defaultDPI)),C*parseFloat(se)}function A(se){if(!(se.hasAttribute("transform")||se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))))return null;let W=P(se);return oe.length>0&&W.premultiply(oe[oe.length-1]),We.copy(W),oe.push(W),W}function P(se){let W=new ft,C=he;if(se.nodeName==="use"&&(se.hasAttribute("x")||se.hasAttribute("y"))){let b=S(se.getAttribute("x")),re=S(se.getAttribute("y"));W.translate(b,re)}if(se.hasAttribute("transform")){let b=se.getAttribute("transform").split(")");for(let re=b.length-1;re>=0;re--){let xe=b[re].trim();if(xe==="")continue;let j=xe.indexOf("("),Ae=xe.length;if(j>0&&j<Ae){let Ue=xe.slice(0,j),B=g(xe.slice(j+1));switch(C.identity(),Ue){case"translate":if(B.length>=1){let q=B[0],Q=0;B.length>=2&&(Q=B[1]),C.translate(q,Q)}break;case"rotate":if(B.length>=1){let q=0,Q=0,ne=0;q=B[0]*Math.PI/180,B.length>=3&&(Q=B[1],ne=B[2]),le.makeTranslation(-Q,-ne),ue.makeRotation(q),X.multiplyMatrices(ue,le),le.makeTranslation(Q,ne),C.multiplyMatrices(le,X)}break;case"scale":if(B.length>=1){let q=B[0],Q=q;B.length>=2&&(Q=B[1]),C.scale(q,Q)}break;case"skewX":B.length===1&&C.set(1,Math.tan(B[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":B.length===1&&C.set(1,0,0,Math.tan(B[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":B.length===6&&C.set(B[0],B[2],B[4],B[1],B[3],B[5],0,0,1);break}}W.premultiply(C)}}return W}function R(se,W){function C(j){Ce.set(j.x,j.y,1).applyMatrix3(W),j.set(Ce.x,Ce.y)}function b(j){let Ae=j.xRadius,Ue=j.yRadius,B=Math.cos(j.aRotation),q=Math.sin(j.aRotation),Q=new U(Ae*B,Ae*q,0),ne=new U(-Ue*q,Ue*B,0),te=Q.applyMatrix3(W),G=ne.applyMatrix3(W),L=he.set(te.x,G.x,0,te.y,G.y,0,0,0,1),fe=le.copy(L).invert(),N=ue.copy(fe).transpose().multiply(fe).elements,E=H(N[0],N[1],N[4]),$=Math.sqrt(E.rt1),me=Math.sqrt(E.rt2);if(j.xRadius=1/$,j.yRadius=1/me,j.aRotation=Math.atan2(E.sn,E.cs),!((j.aEndAngle-j.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let ve=le.set($,0,0,0,me,0,0,0,1),je=ue.set(E.cs,E.sn,0,-E.sn,E.cs,0,0,0,1),Be=ve.multiply(je).multiply(L),$e=et=>{let{x:Pe,y:qe}=new U(Math.cos(et),Math.sin(et),0).applyMatrix3(Be);return Math.atan2(qe,Pe)};j.aStartAngle=$e(j.aStartAngle),j.aEndAngle=$e(j.aEndAngle),F(W)&&(j.aClockwise=!j.aClockwise)}}function re(j){let Ae=w(W),Ue=T(W);j.xRadius*=Ae,j.yRadius*=Ue;let B=Ae>Number.EPSILON?Math.atan2(W.elements[1],W.elements[0]):Math.atan2(-W.elements[3],W.elements[4]);j.aRotation+=B,F(W)&&(j.aStartAngle*=-1,j.aEndAngle*=-1,j.aClockwise=!j.aClockwise)}let xe=se.subPaths;for(let j=0,Ae=xe.length;j<Ae;j++){let B=xe[j].curves;for(let q=0;q<B.length;q++){let Q=B[q];Q.isLineCurve?(C(Q.v1),C(Q.v2)):Q.isCubicBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2),C(Q.v3)):Q.isQuadraticBezierCurve?(C(Q.v0),C(Q.v1),C(Q.v2)):Q.isEllipseCurve&&(be.set(Q.aX,Q.aY),C(be),Q.aX=be.x,Q.aY=be.y,O(W)?b(Q):re(Q))}}}function F(se){let W=se.elements;return W[0]*W[4]-W[1]*W[3]<0}function O(se){let W=se.elements,C=W[0]*W[3]+W[1]*W[4];if(C===0)return!1;let b=w(se),re=T(se);return Math.abs(C/(b*re))>Number.EPSILON}function w(se){let W=se.elements;return Math.sqrt(W[0]*W[0]+W[1]*W[1])}function T(se){let W=se.elements;return Math.sqrt(W[3]*W[3]+W[4]*W[4])}function H(se,W,C){let b,re,xe,j,Ae,Ue=se+C,B=se-C,q=Math.sqrt(B*B+4*W*W);return Ue>0?(b=.5*(Ue+q),Ae=1/b,re=se*Ae*C-W*Ae*W):Ue<0?re=.5*(Ue-q):(b=.5*q,re=-.5*q),B>0?xe=B+q:xe=B-q,Math.abs(xe)>2*Math.abs(W)?(Ae=-2*W/xe,j=1/Math.sqrt(1+Ae*Ae),xe=Ae*j):Math.abs(W)===0?(xe=1,j=0):(Ae=-.5*xe/W,xe=1/Math.sqrt(1+Ae*Ae),j=Ae*xe),B>0&&(Ae=xe,xe=-j,j=Ae),{rt1:b,rt2:re,cs:xe,sn:j}}let V=[],ae={},oe=[],he=new ft,le=new ft,ue=new ft,X=new ft,be=new K,Ce=new U,We=new ft,ct=new DOMParser().parseFromString(e,"image/svg+xml");return n(ct.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:V,xml:ct.documentElement}}static createShapes(e){let n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:n.ORIGIN,t:0};function s(x,g,p,M){let S=x.x,A=g.x,P=p.x,R=M.x,F=x.y,O=g.y,w=p.y,T=M.y,H=(R-P)*(F-w)-(T-w)*(S-P),V=(A-S)*(F-w)-(O-F)*(S-P),ae=(T-w)*(A-S)-(R-P)*(O-F),oe=H/ae,he=V/ae;if(ae===0&&H!==0||oe<=0||oe>=1||he<0||he>1)return null;if(H===0&&ae===0){for(let le=0;le<2;le++)if(a(le===0?p:M,x,g),i.loc==n.ORIGIN){let ue=le===0?p:M;return{x:ue.x,y:ue.y,t:i.t}}else if(i.loc==n.BETWEEN){let ue=+(S+i.t*(A-S)).toPrecision(10),X=+(F+i.t*(O-F)).toPrecision(10);return{x:ue,y:X,t:i.t}}return null}else{for(let X=0;X<2;X++)if(a(X===0?p:M,x,g),i.loc==n.ORIGIN){let be=X===0?p:M;return{x:be.x,y:be.y,t:i.t}}let le=+(S+oe*(A-S)).toPrecision(10),ue=+(F+oe*(O-F)).toPrecision(10);return{x:le,y:ue,t:oe}}}function a(x,g,p){let M=p.x-g.x,S=p.y-g.y,A=x.x-g.x,P=x.y-g.y,R=M*P-A*S;if(x.x===g.x&&x.y===g.y){i.loc=n.ORIGIN,i.t=0;return}if(x.x===p.x&&x.y===p.y){i.loc=n.DESTINATION,i.t=1;return}if(R<-Number.EPSILON){i.loc=n.LEFT;return}if(R>Number.EPSILON){i.loc=n.RIGHT;return}if(M*A<0||S*P<0){i.loc=n.BEHIND;return}if(Math.sqrt(M*M+S*S)<Math.sqrt(A*A+P*P)){i.loc=n.BEYOND;return}let F;M!==0?F=A/M:F=P/S,i.loc=n.BETWEEN,i.t=F}function o(x,g){let p=[],M=[];for(let S=1;S<x.length;S++){let A=x[S-1],P=x[S];for(let R=1;R<g.length;R++){let F=g[R-1],O=g[R],w=s(A,P,F,O);w!==null&&p.find(T=>T.t<=w.t+Number.EPSILON&&T.t>=w.t-Number.EPSILON)===void 0&&(p.push(w),M.push(new K(w.x,w.y)))}}return M}function l(x,g,p){let M=new K;g.getCenter(M);let S=[];return p.forEach(A=>{A.boundingBox.containsPoint(M)&&o(x,A.points).forEach(R=>{S.push({identifier:A.identifier,isCW:A.isCW,point:R})})}),S.sort((A,P)=>A.point.x-P.point.x),S}function c(x,g,p,M,S){(S==null||S==="")&&(S="nonzero");let A=new K;x.boundingBox.getCenter(A);let P=[new K(p,A.y),new K(M,A.y)],R=l(P,x.boundingBox,g);R.sort((V,ae)=>V.point.x-ae.point.x);let F=[],O=[];R.forEach(V=>{V.identifier===x.identifier?F.push(V):O.push(V)});let w=F[0].point.x,T=[],H=0;for(;H<O.length&&O[H].point.x<w;)T.length>0&&T[T.length-1]===O[H].identifier?T.pop():T.push(O[H].identifier),H++;if(T.push(x.identifier),S==="evenodd"){let V=T.length%2===0,ae=T[T.length-2];return{identifier:x.identifier,isHole:V,for:ae}}else if(S==="nonzero"){let V=!0,ae=null,oe=null;for(let he=0;he<T.length;he++){let le=T[he];V?(oe=g[le].isCW,V=!1,ae=le):oe!==g[le].isCW&&(oe=g[le].isCW,V=!0)}return{identifier:x.identifier,isHole:V,for:ae}}else console.warn('fill-rule: "'+S+'" is currently not implemented.')}let u=999999999,h=-999999999,f=e.subPaths.map(x=>{let g=x.getPoints(),p=-999999999,M=999999999,S=-999999999,A=999999999;for(let P=0;P<g.length;P++){let R=g[P];R.y>p&&(p=R.y),R.y<M&&(M=R.y),R.x>S&&(S=R.x),R.x<A&&(A=R.x)}return h<=S&&(h=S+1),u>=A&&(u=A-1),{curves:x.curves,points:g,isCW:vi.isClockWise(g),identifier:-1,boundingBox:new mo(new K(A,M),new K(S,p))}});f=f.filter(x=>x.points.length>1);for(let x=0;x<f.length;x++)f[x].identifier=x;let d=f.map(x=>c(x,f,u,h,e.userData?e.userData.style.fillRule:void 0)),m=[];return f.forEach(x=>{if(!d[x.identifier].isHole){let p=new Bi;p.curves=x.curves,d.filter(S=>S.isHole&&S.for===x.identifier).forEach(S=>{let A=f[S.identifier],P=new er;P.curves=A.curves,p.holes.push(P)}),m.push(p)}}),m}static getStrokeStyle(e,t,n,i,s){return e=e!==void 0?e:1,t=t!==void 0?t:"#000",n=n!==void 0?n:"miter",i=i!==void 0?i:"butt",s=s!==void 0?s:4,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:i,strokeMiterLimit:s}}static pointsToStroke(e,t,n,i){let s=[],a=[],o=[];if(r.pointsToStrokeWithBuffers(e,t,n,i,s,a,o)===0)return null;let l=new dt;return l.setAttribute("position",new Te(s,3)),l.setAttribute("normal",new Te(a,3)),l.setAttribute("uv",new Te(o,2)),l}static pointsToStrokeWithBuffers(e,t,n,i,s,a,o,l){let c=new K,u=new K,h=new K,f=new K,d=new K,m=new K,x=new K,g=new K,p=new K,M=new K,S=new K,A=new K,P=new K,R=new K,F=new K,O=new K,w=new K;n=n!==void 0?n:12,i=i!==void 0?i:.001,l=l!==void 0?l:0,e=B(e);let T=e.length;if(T<2)return 0;let H=e[0].equals(e[T-1]),V,ae=e[0],oe,he=t.strokeWidth/2,le=1/(T-1),ue=0,X,be,Ce,We,ct=!1,Pt=0,se=l*3,W=l*2;C(e[0],e[1],c).multiplyScalar(he),g.copy(e[0]).sub(c),p.copy(e[0]).add(c),M.copy(g),S.copy(p);for(let q=1;q<T;q++){V=e[q],q===T-1?H?oe=e[1]:oe=void 0:oe=e[q+1];let Q=c;if(C(ae,V,Q),h.copy(Q).multiplyScalar(he),A.copy(V).sub(h),P.copy(V).add(h),X=ue+le,be=!1,oe!==void 0){C(V,oe,u),h.copy(u).multiplyScalar(he),R.copy(V).sub(h),F.copy(V).add(h),Ce=!0,h.subVectors(oe,ae),Q.dot(h)<0&&(Ce=!1),q===1&&(ct=Ce),h.subVectors(oe,V),h.normalize();let ne=Math.abs(Q.dot(h));if(ne>Number.EPSILON){let te=he/ne;h.multiplyScalar(-te),f.subVectors(V,ae),d.copy(f).setLength(te).add(h),O.copy(d).negate();let G=d.length(),L=f.length();f.divideScalar(L),m.subVectors(oe,V);let fe=m.length();switch(m.divideScalar(fe),f.dot(O)<L&&m.dot(O)<fe&&(be=!0),w.copy(d).add(V),O.add(V),We=!1,be?Ce?(F.copy(O),P.copy(O)):(R.copy(O),A.copy(O)):xe(),t.strokeLineJoin){case"bevel":j(Ce,be,X);break;case"round":Ae(Ce,be),Ce?re(V,A,R,X,0):re(V,F,P,X,1);break;case"miter":case"miter-clip":default:let Oe=he*t.strokeMiterLimit/G;if(Oe<1)if(t.strokeLineJoin!=="miter-clip"){j(Ce,be,X);break}else Ae(Ce,be),Ce?(m.subVectors(w,A).multiplyScalar(Oe).add(A),x.subVectors(w,R).multiplyScalar(Oe).add(R),b(A,X,0),b(m,X,0),b(V,X,.5),b(V,X,.5),b(m,X,0),b(x,X,0),b(V,X,.5),b(x,X,0),b(R,X,0)):(m.subVectors(w,P).multiplyScalar(Oe).add(P),x.subVectors(w,F).multiplyScalar(Oe).add(F),b(P,X,1),b(m,X,1),b(V,X,.5),b(V,X,.5),b(m,X,1),b(x,X,1),b(V,X,.5),b(x,X,1),b(F,X,1));else be?(Ce?(b(p,ue,1),b(g,ue,0),b(w,X,0),b(p,ue,1),b(w,X,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(w,X,1),b(g,ue,0),b(O,X,0),b(w,X,1)),Ce?R.copy(w):F.copy(w)):Ce?(b(A,X,0),b(w,X,0),b(V,X,.5),b(V,X,.5),b(w,X,0),b(R,X,0)):(b(P,X,1),b(w,X,1),b(V,X,.5),b(V,X,.5),b(w,X,1),b(F,X,1)),We=!0;break}}else xe()}else xe();!H&&q===T-1&&Ue(e[0],M,S,Ce,!0,ue),ue=X,ae=V,g.copy(R),p.copy(F)}if(!H)Ue(V,A,P,Ce,!1,X);else if(be&&s){let q=w,Q=O;ct!==Ce&&(q=O,Q=w),Ce?(We||ct)&&(Q.toArray(s,0*3),Q.toArray(s,3*3),We&&q.toArray(s,1*3)):(We||!ct)&&(Q.toArray(s,1*3),Q.toArray(s,3*3),We&&q.toArray(s,0*3))}return Pt;function C(q,Q,ne){return ne.subVectors(Q,q),ne.set(-ne.y,ne.x).normalize()}function b(q,Q,ne){s&&(s[se]=q.x,s[se+1]=q.y,s[se+2]=0,a&&(a[se]=0,a[se+1]=0,a[se+2]=1),se+=3,o&&(o[W]=Q,o[W+1]=ne,W+=2)),Pt+=3}function re(q,Q,ne,te,G){c.copy(Q).sub(q).normalize(),u.copy(ne).sub(q).normalize();let L=Math.PI,fe=c.dot(u);Math.abs(fe)<1&&(L=Math.abs(Math.acos(fe))),L/=n,h.copy(Q);for(let Oe=0,tt=n-1;Oe<tt;Oe++)f.copy(h).rotateAround(q,L),b(h,te,G),b(f,te,G),b(q,te,.5),h.copy(f);b(f,te,G),b(ne,te,G),b(q,te,.5)}function xe(){b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(P,X,1)}function j(q,Q,ne){Q?q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ne,0),b(R,ne,0),b(O,ne,.5)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ne,1),b(O,ne,0),b(F,ne,1)):q?(b(A,ne,0),b(R,ne,0),b(V,ne,.5)):(b(P,ne,1),b(F,ne,0),b(V,ne,.5))}function Ae(q,Q){Q&&(q?(b(p,ue,1),b(g,ue,0),b(A,X,0),b(p,ue,1),b(A,X,0),b(O,X,1),b(A,ue,0),b(V,X,.5),b(O,X,1),b(V,X,.5),b(R,ue,0),b(O,X,1)):(b(p,ue,1),b(g,ue,0),b(P,X,1),b(g,ue,0),b(O,X,0),b(P,X,1),b(P,ue,1),b(O,X,0),b(V,X,.5),b(V,X,.5),b(O,X,0),b(F,ue,1)))}function Ue(q,Q,ne,te,G,L){switch(t.strokeLineCap){case"round":G?re(q,ne,Q,L,.5):re(q,Q,ne,L,.5);break;case"square":if(G)c.subVectors(Q,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q),te?(h.toArray(s,1*3),f.toArray(s,0*3),f.toArray(s,3*3)):(h.toArray(s,1*3),o[3*2+1]===1?f.toArray(s,3*3):h.toArray(s,3*3),f.toArray(s,0*3));else{c.subVectors(ne,q),u.set(c.y,-c.x),h.addVectors(c,u).add(q),f.subVectors(u,c).add(q);let fe=s.length;te?(h.toArray(s,fe-1*3),f.toArray(s,fe-2*3),f.toArray(s,fe-4*3)):(f.toArray(s,fe-2*3),h.toArray(s,fe-1*3),f.toArray(s,fe-4*3))}break;case"butt":default:break}}function B(q){let Q=!1;for(let te=1,G=q.length-1;te<G;te++)if(q[te].distanceTo(q[te+1])<i){Q=!0;break}if(!Q)return q;let ne=[];ne.push(q[0]);for(let te=1,G=q.length-1;te<G;te++)q[te].distanceTo(q[te+1])>=i&&ne.push(q[te]);return ne.push(q[q.length-1]),ne}}};var mE="1.0.1",lm=[{key:"shape",label:"Shape",kind:"select",optionPath:"shape",defaultValue:"star",choices:["star","heart","infinity","hexagon","spiral","custom"]},{key:"transform",label:"Transform on scroll",kind:"select",optionPath:"transform",defaultValue:"load",choices:["scroll","load","off"]},{key:"interactionMode",label:"Interaction",kind:"select",optionPath:"interaction",defaultValue:"rotate",choices:["rotate","depth-lens","none"]},{key:"palette",label:"Palette",kind:"select",optionPath:"palette",defaultValue:"astra",choices:["astra","aurora","ember"]},{key:"background",label:"Background",kind:"select",optionPath:"background",defaultValue:"#000",choices:["#000","#0b0f1a","transparent"]},{key:"holdAtEnd",label:"Hold shape after scrolling past",kind:"checkbox",optionPath:"holdAtEnd",defaultValue:!1},{key:"parallax",label:"Scroll parallax while dispersed",kind:"checkbox",optionPath:"parallax",defaultValue:!0},{key:"ambient",label:"Ambient glow + vignette",kind:"checkbox",optionPath:"ambient",defaultValue:!1},{key:"padding",label:"Padding",kind:"range",optionPath:"padding",defaultValue:.1,min:0,max:.4,step:.01},{key:"pathShapeAutoRotateAmount",label:"Auto-rotate amount",kind:"range",optionPath:"config.pathShapeAutoRotateAmount",defaultValue:.42,min:0,max:1.2,step:.01},{key:"pathShapeScatter",label:"Shape scatter",kind:"range",optionPath:"config.pathShapeScatter",defaultValue:1,min:0,max:3,step:.01},{key:"rotationDepth",label:"Shape depth",kind:"range",optionPath:"config.rotationDepth",defaultValue:1.4,min:0,max:2,step:.01},{key:"stars.density",label:"Star density",kind:"range",optionPath:"config.stars.density",defaultValue:4,min:.25,max:4,step:.05},{key:"stars.intensity",label:"Star intensity",kind:"range",optionPath:"config.stars.intensity",defaultValue:1.35,min:.1,max:3,step:.01},{key:"stars.size",label:"Star size",kind:"range",optionPath:"config.stars.size",defaultValue:2.05,min:.25,max:3,step:.01},{key:"bloomIntensity",label:"Bloom",kind:"range",optionPath:"config.bloomIntensity",defaultValue:.7,min:0,max:2,step:.01},{key:"lensFlare.intensity",label:"Lens flare",kind:"range",optionPath:"config.lensFlare.intensity",defaultValue:.28,min:0,max:1.5,step:.01},{key:"interaction.repelRadius",label:"Pointer repel radius",kind:"range",optionPath:"config.interaction.repelRadius",defaultValue:176,min:16,max:360,step:1},{key:"pathShapeAutoRotate",label:"Auto-rotate shape",kind:"checkbox",optionPath:"config.pathShapeAutoRotate",defaultValue:!0},{key:"faceForward",label:"Return to front on release",kind:"checkbox",optionPath:"config.faceForward",defaultValue:!0},{key:"interaction.particleRepel",label:"Pointer repels particles",kind:"checkbox",optionPath:"config.interaction.particleRepel",defaultValue:!0},{key:"lensFlare.enabled",label:"Lens flare",kind:"checkbox",optionPath:"config.lensFlare.enabled",defaultValue:!0},{key:"dirtyGlass.enabled",label:"Dirty glass + grain",kind:"checkbox",optionPath:"config.dirtyGlass.enabled",defaultValue:!0},{key:"orbitalDust.enabled",label:"Orbital dust",kind:"checkbox",optionPath:"config.orbitalDust.enabled",defaultValue:!1},{key:"showCenterCluster",label:"Center cluster",kind:"checkbox",optionPath:"config.showCenterCluster",defaultValue:!0}];function UT(){return JSON.parse(JSON.stringify(lm))}function cm(){if(typeof window>"u"||typeof document>"u")throw new Error("Shape Cue requires a browser. Initialize it after mounting.");let r=Symbol.for("@uxpilot/openai-astra-shape-cue/"+mE);if(window[r])return window[r];let{MathUtils:e}=tm,t=(v,y,_)=>Math.min(_,Math.max(y,v)),n=(v,y)=>(v%y+y)%y,i=v=>typeof v=="number"&&Number.isFinite(v),s=32,a=Object.freeze({animationPlaying:!0,animationRestartKey:0,bloomIntensity:.7,bloomThreshold:.08,colorMode:!0,convergeDuration:5.5,faceForward:!0,pathShapeAutoRotate:!0,pathShapeAutoRotateAmount:.42,pathShapeAutoRotateSpeed:.22,pathShapeScatter:1,rotationDepth:1.4,scrollDisperseDistance:800,scrollEffects:!0,scrollStarDriftSpeed:3,scrollStartOffset:0,scrollTextFadeDistance:200,showCenterCluster:!0}),o=Object.freeze({density:4,densityFalloff:.22,flowInward:!0,flowSpeed:.8,intensity:1.35,scatter:.4,size:2.05,sizeFalloff:.45,twinkleSpeed:.62}),l=Object.freeze({depthDisplacement:.5,followDamping:6,illumination:.55,magnification:.18,particleRepel:!0,repelDistance:52,repelFalloff:2,repelHighlight:.16,repelHighlightRadius:196,repelPressMultiplier:2.2,repelRadius:176,repelReturnSpring:2.8,repelSpring:7,rotationLag:.68,radius:156,smearCurl:.24,smearTrailLength:2.25}),c=Object.freeze({density:.55,driftSpeed:.2,enabled:!1,intensity:2,reach:.17,spread:.4,tightSpread:.03}),u=Object.freeze({animated:!0,enabled:!0,ghosts:.1,halo:.12,intensity:.28,secondary:.55,streakLength:.03485,streaks:.18,verticalStreaks:1}),h=Object.freeze({distortion:.68,drift:!0,driftStrength:.28,enabled:!0,grain:.031,procedural:0,texture:0}),f=Object.freeze({accretionRatio:.42,ambientAmount:.04,ambientSpeed:.55,coreIntensity:1.45,duration:8,exhaleStrength:.42,inwardStrength:1.2,propagationSoftness:.16,settleDuration:1.2,startScale:.58}),d=Object.freeze({duration:8,growthSpeed:.55,softness:.075,startZoom:4}),m=[{id:"astra",label:"Astra",colors:["#6DCBF4","#7AB1FE","#F87915","#FA994C","#F5F6FB"]},{id:"aurora",label:"Aurora",colors:["#47E2C2","#6DCBF4","#B06DFF","#E96AC8","#F5F6FB"]},{id:"ember",label:"Ember",colors:["#F7CB59","#FA994C","#F67576","#B06DFF","#F5F6FB"]}];function x(){return{...a,accretionExhale:{...f},animationPreset:"converge-tilt",colorPalette:"astra",colorPaletteColors:[...m[0].colors],dirtyGlass:{...h},grow:{...d},interaction:{...l},interactionMode:"rotate",lensFlare:{...u},orbitalDust:{...c},stars:{...o}}}let g=Object.freeze({background:{ambientColor:"#23435F",ambientOpacity:.55},motion:{disperseDistance:800,headingTrailingSpaceVh:7,labelRevealDelay:.85,labelRevealDuration:1,labelStagger:.1},activationLine:.5,easing:"smoothstep"});function p(v,y,_){if(!y.scrollEffects)return{textOpacity:1,dispersion:0,progress:0};let D=(Number.isFinite(v)?v:0)-Math.max(y.scrollStartOffset,0),k=t(D/Math.max(y.scrollTextFadeDistance,1),0,1),z=Math.max(D/Math.max(y.scrollDisperseDistance,1),0),J=t(z,0,1);if(_){let Y=J<.5?0:1;return{textOpacity:+(k<.5),dispersion:Y,progress:Y}}return{textOpacity:1-k*k*k*(k*(6*k-15)+10),dispersion:J,progress:z}}function M(v,y){let _=t(Number.isFinite(v)?v:0,0,1);return y==="linear"?_:_*_*(3-2*_)}let S={spiral:{label:"Spiral field",width:100,height:100,paths:[],native:!0},star:{label:"Star",width:100,height:100,strokeWidth:3,paths:["M50 4 L61.8 36.3 L96.2 36.3 L68.4 56.3 L79 89.4 L50 69.5 L21 89.4 L31.6 56.3 L3.8 36.3 L38.2 36.3 Z"]},heart:{label:"Heart",width:100,height:100,strokeWidth:3,paths:["M50 88 C20 66 6 50 6 32 C6 18 17 8 30 8 C39 8 46 13 50 20 C54 13 61 8 70 8 C83 8 94 18 94 32 C94 50 80 66 50 88 Z"]},infinity:{label:"Infinity",width:200,height:100,strokeWidth:4,paths:["M100 50 C80 20 30 20 30 50 C30 80 80 80 100 50 C120 20 170 20 170 50 C170 80 120 80 100 50 Z"]},hexagon:{label:"Hexagon",width:100,height:100,strokeWidth:3,paths:["M50 4 L90 27 L90 73 L50 96 L10 73 L10 27 Z"]},custom:{label:"Custom SVG\u2026",width:100,height:100,strokeWidth:2,paths:[]}};function A(v){let y=v>>>0;return()=>{let _=y+=1831565813;return _=Math.imul(_^_>>>15,1|_),(((_^=_+Math.imul(_^_>>>7,61|_))^_>>>14)>>>0)/4294967296}}function P(v,y,_,D){let k=43758.5453*Math.sin(v*_+y*D);return k-Math.floor(k)}let R=[.08,.58,.22,.68,.44],F=new Map;function O(v,y){let _=(m.find(J=>J.id===v)??m[0]).colors,D=y?.length?y:_,k=D.join(","),z=F.get(k);return z||(z=D.map(J=>new Ve(J)),F.set(k,z)),z}let w=new Ve(1,1,1);function T(v,y,_,D,k,z){let J=w;if(_){let Y=O(k,z);J=k==="custom"||Y.length!==5?Y[Math.min(Math.floor(D*Y.length),Y.length-1)]:D<.36?Y[0]:D<.52?Y[1]:D<.64?Y[2]:D<.74?Y[3]:Y[4]}v[y]=J.r,v[y+1]=J.g,v[y+2]=J.b}let H=.12,V=.035,ae=.8,oe=.4,he=.28,le=.08,ue=6,X=.2;function be(v,y,_,D,k,z,J){let Y=t(k,0,1),ge=t(J,0,1);if(ge===0)return v.set(0,0);let Ee=e.lerp(.4,.8,Y),_e=e.lerp(.035,.12,Y)*ge,Xe=_*Math.PI*2+2.7*D,Re=D*Math.PI*2+3.1*k,ce=z*e.lerp(.08,.28,Y*Y)*ge;return v.set((Math.sin(Xe+y*Ee)-Math.sin(Xe))*_e,(Math.cos(Re+y*Ee*.73)-Math.cos(Re))*_e+ce)}let Ce=`
4048
4048
  vec4 astraCoast(vec4 state, float mass, float age) {
4049
4049
  float drag = 2.3 / sqrt(mass);
4050
4050
  float velocityDecay = exp(-drag * age);
@@ -4819,7 +4819,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4819
4819
  #include <tonemapping_fragment>
4820
4820
  #include <colorspace_fragment>
4821
4821
  }
4822
- `;else{ze=new uv(ye,{depthBuffer:!1,frameBufferType:ir,multisampling:z.multisampling}),qt(Lt(new pv(_e,ce)));let Dt=[Tt=Lt(new pt({blendFunction:Rt.ADD,intensity:y.bloomIntensity,levels:z.bloomLevels,luminanceSmoothing:.18,luminanceThreshold:y.bloomThreshold,mipmapBlur:!0,radius:.72}))];if(z.optics){let yt=St();ge.add(yt),ht=Lt(new cu(y.lensFlare,yt,y.dirtyGlass,z.optics)),Dt.push(ht)}Dt.push(Lt(new mv({mode:fi.ACES_FILMIC})));let Bt=Lt(new gv(ce,...Dt));for(let yt of Dt)Y.delete(yt);qt(Bt)}return Ut(v.clientWidth,v.clientHeight),xt(),{field:st,camera:ce,animationRoot:Xe,spinRoot:Re,quality:z,ready:we,resize:Ut,dispose:Ze,render(Dt,Bt,yt=y,vn=!z.continuousMotion){if(J)return;let _t=Number.isFinite(Dt)?t(Dt,0,.05):0;if(ln&&Bt.particleMotion){let cn=Bt.particleMotion,nn=v.ownerDocument.defaultView;if(!gn&&!vn&&yt.interaction.particleRepel&&yt.interactionMode!=="none"&&nn?.requestIdleCallback&&nn.matchMedia?.("(any-hover: hover)")?.matches){gn=!0;let Qt=nn.requestIdleCallback(()=>{!J&&v.ownerDocument.visibilityState==="visible"&&cn.scrollCooldown===0&&ln.prepare(ye,ce)});Lt({dispose:()=>nn.cancelIdleCallback(Qt)})}ln.update(ye,ce,cn),ht?.setParticleMotion(ln.texture.value,ln.age.value,Nn,An)}if(Tt&&(It!==yt.bloomIntensity||Et!==yt.bloomThreshold)&&(It=yt.bloomIntensity,Et=yt.bloomThreshold,Tt.intensity=yt.bloomIntensity,Tt.luminanceMaterial.threshold=yt.bloomThreshold),ht){let cn=yt.lensFlare,nn=en;(nn?.animated!==cn.animated||nn.enabled!==cn.enabled||nn.ghosts!==cn.ghosts||nn.halo!==cn.halo||nn.intensity!==cn.intensity||nn.secondary!==cn.secondary||nn.streakLength!==cn.streakLength||nn.streaks!==cn.streaks||nn.verticalStreaks!==cn.verticalStreaks)&&(ht.setConfig(cn),en={...cn});let Qt=yt.dirtyGlass,Si=Fn;(Si?.distortion!==Qt.distortion||Si.drift!==Qt.drift||Si.driftStrength!==Qt.driftStrength||Si.enabled!==Qt.enabled||Si.grain!==Qt.grain||Si.procedural!==Qt.procedural||Si.texture!==Qt.texture)&&(ht.setDirtyGlass(Qt),Fn={...Qt});let Ai=t(Bt.scrollProgress,0,1),Pn=yt.scrollEffects?e.smootherstep(Ai,.5,1):0;ht.updateSources(st.coreSource,st.secondarySources,ce,vn?0:Bt.elapsed,vn,yt.showCenterCluster?1-Pn:0,{config:yt.interaction,lensPointer:Bt.lensPointer,lensStrength:yt.interactionMode==="depth-lens"?Bt.lensStrength:0}),ht.updateDirtDrift(Re.rotation.x,Re.rotation.y,Re.rotation.z,yt.dirtyGlass,vn)}ze?ze.render(_t):ye.render(_e,ce)}}}catch(at){Ze();try{ye?.forceContextLoss()}catch{}throw at}}let ia=e.degToRad(-52);function ar(v,y,_,D=6){let k=e.damp(v,y,D,_);return Math.abs(y-k)<=1e-4?y:k}let Di=(v,y)=>Math.abs(v-y)>.001;function fu(v,y,_,D,k,z,J,Y,ge,Ee,_e,Xe,Re,ce,Ne,we){let ye=v.uniforms;ye.uAccretionRatio.value=t(Ee.accretionRatio,.12,.72),ye.uAmbientPulse.value=Y,ye.uCoreIntensity.value=t(Ee.coreIntensity,.5,3),ye.uExhaleStrength.value=t(Ee.exhaleStrength,0,1.5),ye.uFormationEnabled.value=Number(y),ye.uFormationProgress.value=_,ye.uIntroProgress.value=D,ye.uGrowthEnabled.value=Number(k),ye.uGrowthProgress.value=z,ye.uGrowthSoftness.value=t(J,.005,.3),ye.uInwardStrength.value=t(Ee.inwardStrength,0,3),ye.uPropagationSoftness.value=t(Ee.propagationSoftness,0,.6),ye.uSettleRatio.value=ge,ye.uLensActive.value=_e,ye.uLensDepth.value=t(we.depthDisplacement,-1.5,1.5),ye.uLensIllumination.value=t(we.illumination,0,2),ye.uLensMagnification.value=t(we.magnification,-.3,.8),ye.uLensPointer.value.copy(Xe),ye.uLensRadius.value=Re,ye.uPointerRepelRadius.value=2*t(we.repelRadius,16,360)/Math.max(Ne,1),ye.uViewportAspect.value=ce}function Hf(v,y=0){let _=v.animationPreset==="accretion-exhale"?v.accretionExhale.duration:v.animationPreset==="grow"?v.grow.duration:v.animationPreset==="converge-tilt"?t(v.convergeDuration,1,10):10,D=v.animationPlaying&&y===0,k=G();return{elapsed:0,introElapsed:D?0:_,growthElapsed:D?0:_/v.grow.growthSpeed,coreTargetRotation:0,coreRotation:0,scrollProgress:t(y,0,1),tiltProgress:t(y,0,1),scatterScrollProgress:t(y,0,1.1875),scatterPositionProgress:0,shapePositionProgress:0,starsOpacity:1,hasResolvedInitialPose:!1,lastShapeId:null,lastShapeSamples:null,shapeProgress:0,shapeAutoRotation:0,introProgress:v.animationPreset==="converge-tilt"&&D?0:1,scatter:0,railPresence:0,railContentBounds:new K(0,1),spinRotation:new K,shapePointerRotation:new K,shapeRotation:new K,lensPointer:new K,lensStrength:0,particleMotion:{pointer:new K,previous:new K,impulse:new K,active:!1,pressed:!1,remaining:0,scrollCooldown:0,epoch:0,frame:0,delta:0},pathShapeTexture:k,scratch:{normal:new U,tangent:new U,next:new U,previous:new U,euler:new ni,formed:new U,relative:new U,position:new U,scattered:new U,dispersedOffset:new K,range:new K,center:new K,size:new K},dispose:()=>k.dispose()}}function Gf(v,y,_,D,k=!1){v.frame+=1,v.delta=D,v.impulse.set(0,0),v.scrollCooldown=k?.12:Math.max(0,v.scrollCooldown-D),(y.reset||!_&&(v.active||v.remaining>0))&&(v.epoch+=1,v.remaining=0,v.active=!1);let z=_&&y.active&&!y.pressed&&v.scrollCooldown===0;return z&&(v.previous.copy(v.pointer),v.pointer.set(y.x,y.y),v.active?(v.impulse.subVectors(v.pointer,v.previous),v.impulse.lengthSq()>1e-8&&(v.remaining=ue)):v.previous.copy(v.pointer)),v.active=z,v.pressed=y.pressed,v.remaining=Math.max(0,v.remaining-D),v.remaining>0}function Vf({state:v,config:y,input:_,camera:D,animationRoot:k,spinRoot:z,field:J,viewport:Y},ge,Ee=ge){if(!k||!z)return!1;let _e={width:Number.isFinite(Y.width)?Math.max(Y.width,1):1,height:Number.isFinite(Y.height)?Math.max(Y.height,1):1},Xe=Number.isFinite(ge)?t(ge,0,.05):0,Re=Number.isFinite(Ee)?t(Ee,0,.05):0,ce=y.scrollEffects?Math.max(_.progress,0):0,Ne=ce>0,we=!1;_.reducedMotion||(v.elapsed+=Xe);let ye=y.animationPreset==="accretion-exhale"?t(y.accretionExhale.duration,1,30):y.animationPreset==="grow"?t(y.grow.duration,1,30):y.animationPreset==="converge-tilt"?t(y.convergeDuration,1,10):10,ze=ye/t(y.grow.growthSpeed,.2,2);if(Ne&&(!v.hasResolvedInitialPose||y.animationPreset!=="converge-tilt"))v.introElapsed=ye,v.growthElapsed=ze;else if(!_.reducedMotion&&y.animationPlaying&&y.animationPreset!=="none"){let He=Math.min(v.introElapsed+Xe,ye);v.introElapsed=ye-He<=1e-4?ye:He}!Ne&&!_.reducedMotion&&y.animationPlaying&&y.animationPreset==="grow"&&(v.growthElapsed=Math.min(v.growthElapsed+Xe,ze));let st=_.reducedMotion||!y.animationPlaying||y.animationPreset==="none"?1:t(v.introElapsed/ye,0,1),ht=y.animationPreset==="converge-tilt"?st:1;v.introProgress=ht;let Tt=y.animationPreset==="legacy-zoom"?E(st):1,It=y.animationPreset==="accretion-exhale"?e.smootherstep(st,0,1):1,Et=y.animationPreset==="grow"?e.smootherstep(st,0,1):1,en=y.animationPreset==="grow"?_.reducedMotion||!y.animationPlaying?1:e.smootherstep(t(v.growthElapsed/ze,0,1),0,1):1,Fn=y.animationPreset==="grow"?e.smootherstep(en,.72,1):1,xt=t(ce,0,1),Ze=_.reducedMotion||!v.hasResolvedInitialPose,Lt=t(_.starsOpacity,0,1),qt=Ze?Lt:ar(v.starsOpacity,Lt,Re);v.starsOpacity=qt,qt!==Lt&&(we=!0);let at=Ze?xt:ar(v.scrollProgress,xt,Re);v.scrollProgress=at,at!==xt&&(we=!0);let ln=y.scrollEffects&&!_.reducedMotion&&_.tiltProgress!==null?t(_.tiltProgress,0,1):xt,Nn=Ze?ln:ar(v.tiltProgress,ln,Re);v.tiltProgress=Nn,Nn!==ln&&(we=!0);let An=_.reducedMotion?.5:.375,gn=_.reducedMotion?1:1.1875,Ut=y.scrollEffects&&!_.reducedMotion&&_.scatterProgress!==null?e.lerp(An,gn,t(_.scatterProgress,0,1)):t(ce,0,gn),Dt=Ze?Ut:ar(v.scatterScrollProgress,Ut,Re);v.scatterScrollProgress=Dt,Dt!==Ut&&(we=!0);let Bt=e.smootherstep(at,0,.5),yt=Math.sin(t(Nn/.75,0,1)*Math.PI*.5),vn=1-e.smootherstep(Nn,.75,1),_t=e.smootherstep(Dt,An,gn),cn=e.smoothstep(e.smootherstep(Ut,An,gn),0,1),nn=Ze?cn:ar(v.scatterPositionProgress,cn,Re,4);v.scatterPositionProgress=nn,nn!==cn&&(we=!0);let Qt=(1-_t)*e.smoothstep(ht,.55,1);v.scatter=_t;let Si=y.scrollEffects?e.lerp(1,.45,Bt):1;if(y.animationPreset==="legacy-zoom")k.scale.setScalar(e.lerp(2.35,1,Tt)),k.rotation.set(e.lerp(e.degToRad(-42),0,Tt),e.lerp(Math.PI,0,Tt),e.lerp(e.degToRad(5),0,Tt));else if(y.animationPreset==="accretion-exhale"){let He=e.smootherstep(It,t(y.accretionExhale.accretionRatio,.12,.72),1);k.scale.setScalar(e.lerp(t(y.accretionExhale.startScale,.3,1.25),1,He)),k.rotation.set(0,0,0)}else k.scale.setScalar(1),k.rotation.set(0,0,0);k.scale.setScalar(e.lerp(k.scale.x,1,_t)),k.rotation.x=e.lerp(k.rotation.x,0,Bt)+ia*yt*vn,k.rotation.y=e.lerp(k.rotation.y,0,Bt),k.rotation.z=e.lerp(k.rotation.z,0,Bt);let Ai=+(y.interactionMode==="rotate");if(_.reducedMotion)v.spinRotation.set(0,0),z.rotation.set(0,0,0);else{let He=1-Math.exp(-(_.returning?5.5:14)*Re),Mi=Ai*_.rotation.x,yn=Ai*_.rotation.y;v.spinRotation.x=e.lerp(v.spinRotation.x,Mi,He),v.spinRotation.y=e.lerp(v.spinRotation.y,yn,He),z.rotation.set(v.spinRotation.x*Qt,v.spinRotation.y*Qt,0),(Di(v.spinRotation.x,Mi)||Di(v.spinRotation.y,yn))&&(we=!0)}let Pn=_.pointer,du=Gf(v.particleMotion,Pn,J.particleMotionEnabled===!0&&!_.reducedMotion&&y.interaction.particleRepel&&y.interactionMode!=="none",Re,_.scrolling);Pn.reset&&(v.lensPointer.set(0,0),v.lensStrength=0,Pn.reset=!1);let pu=!_.reducedMotion&&y.interactionMode==="depth-lens",sa=1-Math.exp(-t(y.interaction.followDamping,1,30)*Re);if(_.reducedMotion)v.lensPointer.set(0,0),v.lensStrength=0;else{let He=pu&&Pn.active?1:0;v.lensPointer.x=e.lerp(v.lensPointer.x,Pn.x,sa),v.lensPointer.y=e.lerp(v.lensPointer.y,Pn.y,sa),v.lensStrength=e.lerp(v.lensStrength,He,sa),(Di(v.lensStrength,He)||He>0&&(Di(v.lensPointer.x,Pn.x)||Di(v.lensPointer.y,Pn.y)))&&(we=!0)}let Ro=+!!Pn.active,Do=!_.reducedMotion&&y.interactionMode==="depth-lens"&&(Math.abs(v.lensStrength-Ro)>1e-4||Pn.active&&(Math.abs(v.lensPointer.x-Pn.x)>1e-4||Math.abs(v.lensPointer.y-Pn.y)>1e-4));!Do&&y.interactionMode==="depth-lens"&&(v.lensStrength=Ro,Pn.active&&v.lensPointer.set(Pn.x,Pn.y));let Qn=y.interactionMode==="depth-lens"?v.lensStrength:0,fs=_e.width/Math.max(_e.height,1),lr=_e.width/Math.max(_e.height,1)<.72?12.7:10.9,un=lr*fs,Wt=_.shape;Wt.id&&Wt.samples&&(Wt.id!==v.lastShapeId||Wt.samples!==v.lastShapeSamples)&&(v.pathShapeTexture.image.data.set(Wt.samples),v.pathShapeTexture.needsUpdate=!0,v.lastShapeId=Wt.id,v.lastShapeSamples=Wt.samples);let xn=Ze?Wt.strength:ar(v.shapeProgress,Wt.strength,Re*5.5/t(y.convergeDuration,1,10));v.shapeProgress=xn;let aa=e.smoothstep(Wt.strength,0,1),zr=Ze?aa:ar(v.shapePositionProgress,aa,Re*5.5/t(y.convergeDuration,1,10),4);v.shapePositionProgress=zr,zr!==aa&&(we=!0);let vr=y.scrollEffects?t(_t*(1-xn),0,1):0,ds=_.reducedMotion?0:vr;v.railPresence=vr;let Io=_.reducedMotion?0:ce*t(y.scrollStarDriftSpeed,0,3),mu=e.lerp(1,.18,vr),Lo=e.lerp(1,.1,vr),Wf=e.lerp(1,.1,vr);if(v.hasResolvedInitialPose=!0,xn!==Wt.strength&&(we=!0),_.reducedMotion)v.shapeAutoRotation=0,v.shapePointerRotation.set(0,0),v.shapeRotation.set(0,0);else{let He=e.smootherstep(xn,.05,.4),Mi=1-Math.exp(-(_.returning?5.5:14)*Re),yn=Ai*_.rotation.x,Li=Ai*_.rotation.y;v.shapePointerRotation.x=e.lerp(v.shapePointerRotation.x,yn,Mi),v.shapePointerRotation.y=e.lerp(v.shapePointerRotation.y,Li,Mi);let gs=t(y.pathShapeAutoRotateAmount,0,1.2);v.shapeAutoRotation=0;let Hr=e.smootherstep(xn,.001,.12),oa=e.smootherstep(xn,.04,.82),Bo=Number(y.pathShapeAutoRotate&&y.animationPlaying),dn=e.lerp(-gs,0,oa)*Hr*Bo,Sn=oa>0&&oa<1?Math.sin(oa*Math.PI):0;v.shapeRotation.set(v.shapePointerRotation.x*He+-Sn*gs*.34*Hr*Bo,v.shapePointerRotation.y*He+dn),(Di(v.shapePointerRotation.x,yn)||Di(v.shapePointerRotation.y,Li))&&(we=!0)}v.scratch.center.set(Wt.centerNdc.x*un*.5,Wt.centerNdc.y*lr*.5),v.scratch.size.set(Wt.sizeNdc.x*un*.5,Wt.sizeNdc.y*lr*.5);let ps=Math.min(.5*Math.min(676,Math.max(_e.width-48,0))+48,.36*_e.width)/Math.max(_e.width,1)*un;v.railContentBounds.set(_.contentBounds?.left??.5-ps/un,_.contentBounds?.right??.5+ps/un);let hm=(v.railContentBounds.x-.5)*un,fm=(v.railContentBounds.y-.5)*un,dm=y.animationPreset==="grow"?e.smootherstep(Et,0,1):1,Sv=y.animationPreset==="grow"?e.lerp(0,1.2,dm):1.2,pm=e.lerp(Sv,0,Bt);D.position.set(0,pm,12),D.lookAt(0,pm,0);let Av=y.animationPreset==="grow"?e.lerp(t(y.grow.startZoom,1,8),1,dm):1;D.zoom=_e.height/lr*e.lerp(Av,1,_t),D.updateProjectionMatrix();let Mv=t(_.heroViewportHeight??_e.height,1,_e.height);k.position.y=(_e.height-Mv)/(2*D.zoom)*(1-_t)*(1-xn);let Uo=lr*fs*1.12,ms=1.12*lr,_v=y.animationPreset==="legacy-zoom"?e.lerp(8,1,Tt):y.animationPreset==="accretion-exhale"?e.lerp(Math.max(1,4*y.accretionExhale.inwardStrength),1,It):1,Xf=t(y.accretionExhale.settleDuration/ye,.03,.4),mm=y.animationPreset==="accretion-exhale"&&It>=.999&&!_.reducedMotion?1+Math.sin(v.elapsed*t(y.accretionExhale.ambientSpeed,0,3)*Math.PI*2)*t(y.accretionExhale.ambientAmount,0,.16):1,gm=2*t(y.interaction.radius,32,360)/Math.max(_e.height,1);if(J.coreCluster){let He=.36*t(y.stars.flowSpeed,0,3),Mi=y.animationPreset!=="grow"&&y.stars.flowInward?1:-1;if(_.reducedMotion)v.coreTargetRotation=0,v.coreRotation=0;else{v.coreTargetRotation=n(v.coreTargetRotation+Xe*He*Mi+Math.PI,2*Math.PI)-Math.PI;let yn=1-Math.exp(-14*Re),Li=Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation));v.coreRotation=n(v.coreRotation+Li*yn+Math.PI,2*Math.PI)-Math.PI,!y.animationPlaying&&Xe===0&&Math.abs(Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation)))>.001&&(we=!0)}J.coreCluster.rotation.set(_.reducedMotion?0:.08*Math.sin(.22*v.elapsed)*Qt,_.reducedMotion?0:.14*Math.cos(.28*v.elapsed)*Qt,v.coreRotation*Qt)}let Ev=t(y.interaction.rotationLag,0,1),Tv=_.returning?5.5:14;for(let He of J.orbits){if(_.reducedMotion)He.spin.set(0,0);else{let Li=1-Math.exp(-(Tv/(1+He.lag*Ev*2.5))*Re),gs=Ai*_.rotation.x,Hr=Ai*_.rotation.y;He.spin.x=e.lerp(He.spin.x,gs,Li),He.spin.y=e.lerp(He.spin.y,Hr,Li),(Di(He.spin.x,gs)||Di(He.spin.y,Hr))&&(we=!0)}let Mi=0,yn=0;if(y.animationPreset==="legacy-zoom"){let Li=Tt-Tt**(1+.9*He.lag);Mi=e.degToRad(-42*Li),yn=Math.PI*Li}He.group.rotation.set(Mi+He.spin.x*Qt*Ai-z.rotation.x,yn+He.spin.y*Qt*Ai-z.rotation.y,0)}for(let He of J.pathLayers){let Mi=He.isCore&&Wt.id?0:1,yn=y.animationPreset==="grow"?He.outwardSpeed:He.speed,Li=He.isCore?.022:Math.abs(yn),gs=e.smootherstep(xn,.08,.5);if(!_.reducedMotion)if(He.pathShapeTravel=n(He.pathShapeTravel+Xe*Li*(y.stars.flowInward?1:-1)*t(y.stars.flowSpeed,0,3)*gs,1),y.animationPreset==="grow"&&yn!==0){let Sn=Math.abs(yn)*t(y.stars.flowSpeed,0,3)*Fn;He.motionOffset=n(He.motionOffset+Xe*Sn*Math.sign(yn)*Qt,1),He.travel=n(He.phase+He.motionOffset,1)}else He.motionOffset=n(He.motionOffset+Xe*yn*t(y.stars.flowSpeed,0,3)*Qt,1),He.travel=n(He.travel+Xe*_v*Math.abs(yn)*Qt,1);let Hr=_.reducedMotion?He.phase:He.travel,oa=yn<0?1-Hr:Hr,Bo=_.reducedMotion?0:y.animationPreset==="grow"?He.motionOffset:v.elapsed,dn=He.starMaterial.uniforms;if(dn.uTime.value=Bo,dn.uBackgroundStarsEnabled.value=+(y.animationPreset==="converge-tilt"&&!Wt.id),dn.uPathSpeed.value=y.animationPreset==="grow"&&yn!==0?1:yn,dn.uPathOffset.value=_.reducedMotion?0:He.motionOffset,dn.uPathShapeCenter.value.copy(v.scratch.center),dn.uPathShapeProgress.value=xn,dn.uPathShapePositionProgress.value=zr,dn.uPathShapeMotion.value=He.pathShapeTravel,dn.uPathShapeRotation.value.copy(v.shapeRotation),dn.uPathShapeScatter.value=t(y.pathShapeScatter,0,3),dn.uPathShapeSize.value.copy(v.scratch.size),dn.uPathShapeTexture.value=v.pathShapeTexture,dn.uGrowthDirection.value=yn<0?-1:1,dn.uFlowSpeed.value=y.animationPreset==="grow"&&yn!==0?Qt:t(y.stars.flowSpeed,0,3)*Qt,dn.uTwinkleSpeed.value=_.reducedMotion?0:t(y.stars.twinkleSpeed,0,2)*Qt,dn.uIntensity.value=t(y.stars.intensity*(He.isCore?1.22:1)*mu,.1,3)*qt*Mi,dn.uDispersedMotion.value=ds,dn.uScrollScatter.value=_t,dn.uScrollPositionProgress.value=nn,dn.uScrollDrift.value=Io,dn.uScrollSizeScale.value=Si,dn.uTextBounds.value.set(hm,fm),dn.uScatterSize.value.set(Uo,ms),fu(He.starMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow"&&!He.isCore,en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction),He.flareSource){let Sn=He.flarePathSamples,gu=Sn!==null,wv=n(He.flareProgress+(_.reducedMotion?0:He.motionOffset),1),vu=gu?tt(wv,y.stars.densityFalloff):0,la=vu,Yf=1,xu=1;if(gu&&y.animationPreset==="grow"){let Zn=yn<0?-1:1,cr=.24*(Zn>0?vu:1-vu),Gr=t((en-cr)/Math.max(1-cr,1e-4),0,1);xu=e.smoothstep(Gr,0,1),la=e.lerp(Zn>0?0:1,vu,xu),Yf=e.smoothstep(en,cr,cr+.025)}if(Sn){let Zn=1/Math.max(Math.floor(Sn.length/4)-1,1);$(Sn,la,v.scratch.position),$(Sn,Math.max(la-Zn,0),v.scratch.previous),$(Sn,Math.min(la+Zn,1),v.scratch.next),v.scratch.tangent.subVectors(v.scratch.next,v.scratch.previous).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize(),v.scratch.position.addScaledVector(v.scratch.normal,He.flareAcrossOffset*xu),v.scratch.position.z+=He.flareDepthOffset*xu}else v.scratch.position.copy(He.flareBasePosition);let yu=1;if(y.animationPreset==="accretion-exhale"){let Zn=Math.hypot(v.scratch.position.x,v.scratch.position.y),cr=t(It-Zn*y.accretionExhale.propagationSoftness*.018,0,1),Gr=t(y.accretionExhale.accretionRatio,.12,.72),vs=Math.max(Gr+.08,1-Xf),ua=e.smoothstep(cr,0,Gr),xr=e.smoothstep(cr,Gr,vs),ha=Zn>1e-4?v.scratch.position.x/Zn:0,Au=Zn>1e-4?v.scratch.position.y/Zn:0;v.scratch.formed.copy(v.scratch.position),v.scratch.formed.x+=ha*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.y+=Au*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.z+=.8*y.accretionExhale.inwardStrength,v.scratch.previous.set(.045*v.scratch.position.x,.045*v.scratch.position.y,.12*v.scratch.position.z),v.scratch.formed.lerp(v.scratch.previous,ua),v.scratch.formed.lerp(v.scratch.position,xr);let fa=Math.sin(xr*Math.PI)*(1-xr)*y.accretionExhale.exhaleStrength;v.scratch.formed.x+=ha*fa,v.scratch.formed.y+=Au*fa,v.scratch.position.copy(v.scratch.formed),yu=e.lerp(.06,.58,ua),yu=e.lerp(yu,1,xr)}let Fo=Math.fround(He.flareScatter.x),Su=Math.fround(He.flareScatter.y),ca=Math.fround(He.flareScatter.z),bv=+(Math.fround(He.flareClearanceSeed)>=.72),vm=Fo<.5?-1:1,Cv=Math.sqrt(n(2*Fo,1)),Pv=vm*e.lerp(vm<0?-hm:fm,.5*Uo,Cv);be(v.scratch.dispersedOffset,Math.fround(Bo),Fo,Su,ca,Io,ds),v.scratch.scattered.set(e.lerp(Pv,(Fo-.5)*Uo,bv)+v.scratch.dispersedOffset.x,n((Su-.5)*ms+v.scratch.dispersedOffset.y+.5*ms,ms)-.5*ms-Math.sin(nn*Math.PI)*(.15+.25*ca),(ca-.5)*.5),v.scratch.position.lerp(v.scratch.scattered,nn);let No=gu?fe(la):1,Oo=gu?Oe(la,y.stars.sizeFalloff):1;No=e.lerp(No,1,_t),Oo=e.lerp(Oo,1,_t);let xm=1,ym=1;if(Wt.samples&&(xn>0||zr>0)){me(Wt.samples,He.flareShapeSeed,v.scratch.range);let Zn=v.scratch.range.x,cr=v.scratch.range.y,Gr=Math.max(cr-Zn,.0009775171065493646),vs=tt(t((He.flareShapeSeed-Zn)/Gr,0,1)+He.pathShapeTravel/Gr,y.stars.densityFalloff),ua=Math.max(Math.floor(Wt.samples.length/4),1),xr=Math.max(ua-1,1),ha=t(Math.ceil(Zn*ua-.5),0,xr),Au=t(Math.max(Math.floor(cr*ua-.5),ha),ha,xr),fa=ha/xr,qf=Au/xr,Qf=e.lerp(fa,qf,vs),Am=Math.min(.0009775171065493646*s,Math.max(qf-fa,.0009775171065493646)*.2);$(Wt.samples,Qf,v.scratch.formed),$(Wt.samples,Math.max(Qf-Am,fa),v.scratch.previous),$(Wt.samples,Math.min(Qf+Am,qf),v.scratch.next),v.scratch.tangent.set((v.scratch.next.x-v.scratch.previous.x)*v.scratch.size.x+1e-4,(v.scratch.next.y-v.scratch.previous.y)*v.scratch.size.y,0).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize();let Uv=Math.sin(vs*Math.PI),Bv=Math.sin(vs*Math.PI*1.35+He.pathShapeDepthPhase)*He.pathShapeDepth*Uv,Mm=t(y.pathShapeScatter,0,3);v.scratch.relative.set(v.scratch.formed.x*v.scratch.size.x,v.scratch.formed.y*v.scratch.size.y,(Bv+.75*He.flareDepthOffset+He.flareShapeDepthScatter)*Mm).addScaledVector(v.scratch.normal,(1.1*He.flareAcrossOffset+He.flareShapeAcrossScatter)*Mm),v.scratch.euler.set(v.shapeRotation.x,v.shapeRotation.y,0,"YXZ"),v.scratch.relative.applyEuler(v.scratch.euler),v.scratch.formed.set(v.scratch.center.x+v.scratch.relative.x,v.scratch.center.y+v.scratch.relative.y,v.scratch.relative.z),v.scratch.position.lerp(v.scratch.formed,zr);let _m=e.smoothstep(v.scratch.relative.z,-1.15,1.15);No=e.lerp(No,fe(vs),xn),Oo=e.lerp(Oo,Oe(vs,y.stars.sizeFalloff),xn),xm=e.lerp(1,e.lerp(.78,1.18,_m),xn),ym=e.lerp(1,e.lerp(.72,1,_m),xn)}v.scratch.formed.set((Fo-.5)*Uo,(n(Su,1)-.5)*ms,(ca-.5)*.5),Pt(v.scratch.position,v.scratch.formed,ht,ca,Su);let Sm=se(ht,ca),Rv=Math.sqrt(Sm),Dv=e.smoothstep(Sm,0,X),Iv=y.animationPreset!=="grow"||He.isCore?1:.3+.7*Yf,Lv=No*Oo*xm*ym*yu*Yf*Iv*e.lerp(Si,1,xn)*Rv*Dv*Wf;He.flareSource.position.copy(v.scratch.position),He.flareSource.scale.setScalar(t(Lv,0,1)*qt*Mi)}if(He.dustMaterial){let Sn=He.dustMaterial.uniforms;Sn.uDispersedMotion.value=ds,Sn.uDriftSpeed.value=_.reducedMotion?0:t(y.orbitalDust.driftSpeed,0,1.5)*Qt,Sn.uScrollScatter.value=_t,Sn.uScrollPositionProgress.value=nn,Sn.uScrollDrift.value=Io,Sn.uStarVisibility.value=Qt,Sn.uTrailEnabled.value=Qt,Sn.uScatterSize.value.set(Uo,ms),Sn.uHeadProgress.value=oa,Sn.uDirection.value=yn<0?-1:1,Sn.uIntensity.value=t(y.orbitalDust.intensity*Lo,0,3),Sn.uLightReach.value=t(y.orbitalDust.reach,.02,.4)*(He.strong?1.15:1),Sn.uTime.value=_.reducedMotion?0:v.elapsed,fu(He.dustMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow",en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction)}}return we||Do||du}let li={pointer:"astra:pointer",replay:"astra:replay",return:"astra:return",rotate:"astra:rotate"},um=new Set([" ","ArrowDown","ArrowUp","End","Home","PageDown","PageUp","Spacebar"]),I="path, circle, ellipse, line, polyline, polygon, rect",ee=(v,y,_)=>{let D=t((v-y)/(_-y),0,1);return D*D*D*(D*(6*D-15)+10)},de=v=>String(Math.round(1e4*t(v,0,1))/1e4),pe=4*Math.PI,ie=v=>Number.isFinite(v)?t(v,-pe,pe):0,Le=v=>Number.isFinite(v)?t(v,-1,1):0;function Qe(v,y,_,D={},k=window){let z=i(D.shapeHeightVh)?t(D.shapeHeightVh,40,120):80,J=i(D.maxWidth)?t(D.maxWidth,240,960):576;v.className="astra-shapeCue",v.dataset.astraPathShape=y,v.dataset.astraScrollCue="true",v.style.setProperty("--astra-shape-height",`calc(${z/100} * var(--astra-viewport-height, 100vh))`),v.style.setProperty("--astra-shape-max-width",`${J}px`);let Y="http://www.w3.org/2000/svg",ge=document.createElementNS(Y,"svg");if(ge.setAttribute("aria-hidden","true"),ge.setAttribute("class","astra-shapeTarget"),ge.setAttribute("fill","none"),ge.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup)ge.innerHTML=_.markup;else for(let _e of _.paths){let Xe=document.createElementNS(Y,"path");Xe.setAttribute("d",_e),Xe.setAttribute("stroke","currentColor"),Xe.setAttribute("stroke-width",String(_.strokeWidth??1)),ge.appendChild(Xe)}let Ee=document.createElement("button");return Ee.type="button",Ee.className="astra-dragSurface",Ee.dataset.dragging="false",Ee.setAttribute("aria-label",D.interactionLabel??`Drag or use arrow keys to rotate the ${_.label?.toLowerCase()??"shape"}`),v.replaceChildren(ge,Ee),mt(Ee,k),v}function nt(v,y){let _=v instanceof SVGSVGElement?v:v.querySelector("svg.astra-shapeTarget, svg"),D=_?.viewBox.baseVal;if(!_||!D||D.width<=0||D.height<=0)return null;let k=_.getScreenCTM(),z=Array.from(_.querySelectorAll(I)).map(_e=>{try{let Xe=_e.getTotalLength(),Re=_e.getScreenCTM(),ce=k&&Re?k.inverse().multiply(Re):null;return Xe>0&&Number.isFinite(Xe)?{path:_e,length:Xe,matrix:ce}:null}catch{return null}}).filter(_e=>_e!==null),J=z.reduce((_e,Xe)=>_e+Xe.length,0);if(J<=0)return null;let Y=new Float32Array(4096),ge=0,Ee=0;for(let _e=0;_e<1024;_e+=1){let Xe=(_e+.5)/1024*J;for(;ge<z.length-1&&Xe>Ee+z[ge].length;)Ee+=z[ge].length,ge+=1;let{path:Re,length:ce,matrix:Ne}=z[ge],we=Re.getPointAtLength(Xe-Ee),ye=Ne?new DOMPoint(we.x,we.y).matrixTransform(Ne):we,ze=4*_e;Y[ze]=(ye.x-D.x)/D.width-.5,Y[ze+1]=.5-(ye.y-D.y)/D.height,Y[ze+2]=Ee/J,Y[ze+3]=(Ee+ce)/J}return Y.some(_e=>!Number.isFinite(_e))?null:{element:v,id:y,samples:Y,aspectRatio:D.width/D.height}}function Ke(v,y){v.dispatchEvent(new CustomEvent(li.pointer,{detail:y}))}function ut(v){if(v)try{v.target.hasPointerCapture(v.id)&&v.target.releasePointerCapture(v.id)}catch{}}function mt(v,y=window){let _=null,D=!1,k=!1,z=!1,J=ce=>y.dispatchEvent(new CustomEvent(li.rotate,{detail:ce})),Y=(ce,Ne,we)=>!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY)?!1:(D=Ne,k=we,Ke(y,{active:Ne,clientX:ce.clientX,clientY:ce.clientY,pressed:we}),!0),ge=()=>{(D||k)&&(D=!1,k=!1,Ke(y,{active:!1,clientX:0,clientY:0,pressed:!1}))},Ee=(ce,Ne=!0)=>{let we=_!==null||D||k||z,ye=_;_=null,ut(ye),z=!1,Ne&&(v.dataset.dragging="false"),we&&(ce?Y(ce,!0,!1):ge(),y.dispatchEvent(new Event(li.return)))};v.addEventListener("keydown",ce=>{let we={ArrowDown:{x:0,y:.08},ArrowLeft:{x:-.08,y:0},ArrowRight:{x:.08,y:0},ArrowUp:{x:0,y:-.08}}[ce.key];we&&(ce.preventDefault(),J(we))}),v.addEventListener("pointerdown",ce=>{if(!(!ce.isPrimary||ce.button!==0||_!==null||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))){try{v.setPointerCapture(ce.pointerId)}catch{return}if(_={id:ce.pointerId,target:v,x:ce.clientX,y:ce.clientY},!Y(ce,!0,!0)){let Ne=_;_=null,ut(Ne);return}z=!0,v.dataset.dragging="true"}}),v.addEventListener("pointermove",ce=>{if(!ce.isPrimary||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))return;let Ne=_;if(!(Ne&&(ce.pointerId!==Ne.id||ce.currentTarget!==Ne.target))){if(!Ne){if(ce.buttons!==0)return;Y(ce,!0,!1);return}Y(ce,!0,!0)&&(J({x:(ce.clientX-Ne.x)*.005,y:(ce.clientY-Ne.y)*.005}),Ne.x=ce.clientX,Ne.y=ce.clientY)}}),v.addEventListener("pointerup",ce=>{let Ne=_;if(Ne&&Ne.id===ce.pointerId&&Ne.target===ce.currentTarget){let we=v.getBoundingClientRect(),ye=ce.pointerType==="mouse"&&Number.isFinite(ce.clientX)&&Number.isFinite(ce.clientY)&&ce.clientX>=we.left&&ce.clientX<=we.right&&ce.clientY>=we.top&&ce.clientY<=we.bottom;Ee(ye?ce:void 0)}}),v.addEventListener("pointercancel",ce=>{let Ne=_;Ne&&Ne.id!==ce.pointerId||(Ne||ce.isPrimary&&D)&&Ee()}),v.addEventListener("pointerleave",ce=>{ce.isPrimary&&!_&&ge()}),v.addEventListener("lostpointercapture",ce=>{_?.id===ce.pointerId&&Ee()});let _e=()=>Ee(),Xe=()=>Ee(),Re=()=>{document.visibilityState==="hidden"&&Ee()};return window.addEventListener("blur",_e),y.addEventListener(li.replay,Xe),document.addEventListener("visibilitychange",Re),()=>{ut(_),_=null,window.removeEventListener("blur",_e),y.removeEventListener(li.replay,Xe),document.removeEventListener("visibilitychange",Re)}}function lt(v){let y=new DOMParser().parseFromString(v.trim(),"image/svg+xml"),_=y.querySelector("svg");if(!_||y.querySelector("parsererror"))throw new Error("That is not valid SVG markup.");let D=(_.getAttribute("viewBox")||"").trim().split(/[\s,]+/).map(Number),k=Number(_.getAttribute("width")),z=Number(_.getAttribute("height"));if(D.length===4&&D.every(Number.isFinite)&&(k=D[2],z=D[3]),!(k>0&&z>0))throw new Error("The SVG needs a viewBox (or width/height).");let J=Array.from(_.querySelectorAll(I));if(J.length===0)throw new Error("No path, line, polyline, polygon, circle, ellipse or rect found.");let Y=Math.max(k,z)/40,ge=J.map(Ee=>{let _e=document.createElementNS("http://www.w3.org/2000/svg",Ee.localName),Xe=new Set(["d","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","width","height","points","transform"]);for(let ce of Ee.attributes)Xe.has(ce.name)&&_e.setAttribute(ce.name,ce.value);for(let ce of["fill","stroke","stroke-width","style","class"])_e.removeAttribute(ce);_e.setAttribute("fill","none"),_e.setAttribute("stroke","currentColor"),_e.setAttribute("stroke-width",String(Y));let Re=_e.getAttribute("transform")||"";for(let ce=Ee.parentElement;ce&&ce!==_;ce=ce.parentElement){let Ne=ce.getAttribute("transform");Ne&&(Re=`${Ne} ${Re}`)}return Re.trim()&&_e.setAttribute("transform",Re.trim()),_e.outerHTML}).join("");return{label:"Custom",width:k,height:z,strokeWidth:Y,paths:[],markup:ge}}let Mt=Object.freeze({shape:"star",transform:"load",holdAtEnd:!1,interaction:"rotate",autoRotate:!0,palette:"astra",background:"#000",ambient:!1,padding:.1,parallax:!0,interactionLabel:null,tier:3,config:null});function Yt(v,y){if(!y||typeof y!="object")return v;for(let[_,D]of Object.entries(y))D&&typeof D=="object"&&!Array.isArray(D)&&v[_]&&typeof v[_]=="object"?Yt(v[_],D):v[_]=Array.isArray(D)?[...D]:D;return v}function fn(v){if(typeof v=="string"){if(S[v])return{id:v,def:S[v]};if(v.trim().startsWith("<"))return{id:"custom",def:{...S.custom,...lt(v),label:"Custom"}};throw new Error(`Unknown shape "${v}". Use one of: ${Object.keys(S).join(", ")} or SVG markup.`)}if(v&&typeof v=="object")return{id:v.id??"custom",def:{strokeWidth:1,paths:[],label:"Custom",...v}};throw new Error("shape must be a string or a shape definition object.")}let rn=`
4822
+ `;else{ze=new uv(ye,{depthBuffer:!1,frameBufferType:ir,multisampling:z.multisampling}),qt(Lt(new pv(_e,ce)));let Dt=[Tt=Lt(new pt({blendFunction:Rt.ADD,intensity:y.bloomIntensity,levels:z.bloomLevels,luminanceSmoothing:.18,luminanceThreshold:y.bloomThreshold,mipmapBlur:!0,radius:.72}))];if(z.optics){let yt=St();ge.add(yt),ht=Lt(new cu(y.lensFlare,yt,y.dirtyGlass,z.optics)),Dt.push(ht)}Dt.push(Lt(new mv({mode:fi.ACES_FILMIC})));let Bt=Lt(new gv(ce,...Dt));for(let yt of Dt)Y.delete(yt);qt(Bt)}return Ut(v.clientWidth,v.clientHeight),xt(),{field:st,camera:ce,animationRoot:Xe,spinRoot:Re,quality:z,ready:we,resize:Ut,dispose:Ze,render(Dt,Bt,yt=y,vn=!z.continuousMotion){if(J)return;let _t=Number.isFinite(Dt)?t(Dt,0,.05):0;if(ln&&Bt.particleMotion){let cn=Bt.particleMotion,nn=v.ownerDocument.defaultView;if(!gn&&!vn&&yt.interaction.particleRepel&&yt.interactionMode!=="none"&&nn?.requestIdleCallback&&nn.matchMedia?.("(any-hover: hover)")?.matches){gn=!0;let Qt=nn.requestIdleCallback(()=>{!J&&v.ownerDocument.visibilityState==="visible"&&cn.scrollCooldown===0&&ln.prepare(ye,ce)});Lt({dispose:()=>nn.cancelIdleCallback(Qt)})}ln.update(ye,ce,cn),ht?.setParticleMotion(ln.texture.value,ln.age.value,Nn,An)}if(Tt&&(It!==yt.bloomIntensity||Et!==yt.bloomThreshold)&&(It=yt.bloomIntensity,Et=yt.bloomThreshold,Tt.intensity=yt.bloomIntensity,Tt.luminanceMaterial.threshold=yt.bloomThreshold),ht){let cn=yt.lensFlare,nn=en;(nn?.animated!==cn.animated||nn.enabled!==cn.enabled||nn.ghosts!==cn.ghosts||nn.halo!==cn.halo||nn.intensity!==cn.intensity||nn.secondary!==cn.secondary||nn.streakLength!==cn.streakLength||nn.streaks!==cn.streaks||nn.verticalStreaks!==cn.verticalStreaks)&&(ht.setConfig(cn),en={...cn});let Qt=yt.dirtyGlass,Si=Fn;(Si?.distortion!==Qt.distortion||Si.drift!==Qt.drift||Si.driftStrength!==Qt.driftStrength||Si.enabled!==Qt.enabled||Si.grain!==Qt.grain||Si.procedural!==Qt.procedural||Si.texture!==Qt.texture)&&(ht.setDirtyGlass(Qt),Fn={...Qt});let Ai=t(Bt.scrollProgress,0,1),Pn=yt.scrollEffects?e.smootherstep(Ai,.5,1):0;ht.updateSources(st.coreSource,st.secondarySources,ce,vn?0:Bt.elapsed,vn,yt.showCenterCluster?1-Pn:0,{config:yt.interaction,lensPointer:Bt.lensPointer,lensStrength:yt.interactionMode==="depth-lens"?Bt.lensStrength:0}),ht.updateDirtDrift(Re.rotation.x,Re.rotation.y,Re.rotation.z,yt.dirtyGlass,vn)}ze?ze.render(_t):ye.render(_e,ce)}}}catch(at){Ze();try{ye?.forceContextLoss()}catch{}throw at}}let ia=e.degToRad(-52);function ar(v,y,_,D=6){let k=e.damp(v,y,D,_);return Math.abs(y-k)<=1e-4?y:k}let Di=(v,y)=>Math.abs(v-y)>.001;function fu(v,y,_,D,k,z,J,Y,ge,Ee,_e,Xe,Re,ce,Ne,we){let ye=v.uniforms;ye.uAccretionRatio.value=t(Ee.accretionRatio,.12,.72),ye.uAmbientPulse.value=Y,ye.uCoreIntensity.value=t(Ee.coreIntensity,.5,3),ye.uExhaleStrength.value=t(Ee.exhaleStrength,0,1.5),ye.uFormationEnabled.value=Number(y),ye.uFormationProgress.value=_,ye.uIntroProgress.value=D,ye.uGrowthEnabled.value=Number(k),ye.uGrowthProgress.value=z,ye.uGrowthSoftness.value=t(J,.005,.3),ye.uInwardStrength.value=t(Ee.inwardStrength,0,3),ye.uPropagationSoftness.value=t(Ee.propagationSoftness,0,.6),ye.uSettleRatio.value=ge,ye.uLensActive.value=_e,ye.uLensDepth.value=t(we.depthDisplacement,-1.5,1.5),ye.uLensIllumination.value=t(we.illumination,0,2),ye.uLensMagnification.value=t(we.magnification,-.3,.8),ye.uLensPointer.value.copy(Xe),ye.uLensRadius.value=Re,ye.uPointerRepelRadius.value=2*t(we.repelRadius,16,360)/Math.max(Ne,1),ye.uViewportAspect.value=ce}function Hf(v,y=0){let _=v.animationPreset==="accretion-exhale"?v.accretionExhale.duration:v.animationPreset==="grow"?v.grow.duration:v.animationPreset==="converge-tilt"?t(v.convergeDuration,1,10):10,D=v.animationPlaying&&y===0,k=G();return{elapsed:0,introElapsed:D?0:_,growthElapsed:D?0:_/v.grow.growthSpeed,coreTargetRotation:0,coreRotation:0,scrollProgress:t(y,0,1),tiltProgress:t(y,0,1),scatterScrollProgress:t(y,0,1.1875),scatterPositionProgress:0,shapePositionProgress:0,starsOpacity:1,hasResolvedInitialPose:!1,lastShapeId:null,lastShapeSamples:null,shapeProgress:0,shapeAutoRotation:0,introProgress:v.animationPreset==="converge-tilt"&&D?0:1,scatter:0,railPresence:0,railContentBounds:new K(0,1),spinRotation:new K,shapePointerRotation:new K,shapeRotation:new K,lensPointer:new K,lensStrength:0,particleMotion:{pointer:new K,previous:new K,impulse:new K,active:!1,pressed:!1,remaining:0,scrollCooldown:0,epoch:0,frame:0,delta:0},pathShapeTexture:k,scratch:{normal:new U,tangent:new U,next:new U,previous:new U,euler:new ni,formed:new U,relative:new U,position:new U,scattered:new U,dispersedOffset:new K,range:new K,center:new K,size:new K},dispose:()=>k.dispose()}}function Gf(v,y,_,D,k=!1){v.frame+=1,v.delta=D,v.impulse.set(0,0),v.scrollCooldown=k?.12:Math.max(0,v.scrollCooldown-D),(y.reset||!_&&(v.active||v.remaining>0))&&(v.epoch+=1,v.remaining=0,v.active=!1);let z=_&&y.active&&!y.pressed&&v.scrollCooldown===0;return z&&(v.previous.copy(v.pointer),v.pointer.set(y.x,y.y),v.active?(v.impulse.subVectors(v.pointer,v.previous),v.impulse.lengthSq()>1e-8&&(v.remaining=ue)):v.previous.copy(v.pointer)),v.active=z,v.pressed=y.pressed,v.remaining=Math.max(0,v.remaining-D),v.remaining>0}function Vf({state:v,config:y,input:_,camera:D,animationRoot:k,spinRoot:z,field:J,viewport:Y},ge,Ee=ge){if(!k||!z)return!1;let _e={width:Number.isFinite(Y.width)?Math.max(Y.width,1):1,height:Number.isFinite(Y.height)?Math.max(Y.height,1):1},Xe=Number.isFinite(ge)?t(ge,0,.05):0,Re=Number.isFinite(Ee)?t(Ee,0,.05):0,ce=y.scrollEffects?Math.max(_.progress,0):0,Ne=ce>0,we=!1;_.reducedMotion||(v.elapsed+=Xe);let ye=y.animationPreset==="accretion-exhale"?t(y.accretionExhale.duration,1,30):y.animationPreset==="grow"?t(y.grow.duration,1,30):y.animationPreset==="converge-tilt"?t(y.convergeDuration,1,10):10,ze=ye/t(y.grow.growthSpeed,.2,2);if(Ne&&(!v.hasResolvedInitialPose||y.animationPreset!=="converge-tilt"))v.introElapsed=ye,v.growthElapsed=ze;else if(!_.reducedMotion&&y.animationPlaying&&y.animationPreset!=="none"){let He=Math.min(v.introElapsed+Xe,ye);v.introElapsed=ye-He<=1e-4?ye:He}!Ne&&!_.reducedMotion&&y.animationPlaying&&y.animationPreset==="grow"&&(v.growthElapsed=Math.min(v.growthElapsed+Xe,ze));let st=_.reducedMotion||!y.animationPlaying||y.animationPreset==="none"?1:t(v.introElapsed/ye,0,1),ht=y.animationPreset==="converge-tilt"?st:1;v.introProgress=ht;let Tt=y.animationPreset==="legacy-zoom"?E(st):1,It=y.animationPreset==="accretion-exhale"?e.smootherstep(st,0,1):1,Et=y.animationPreset==="grow"?e.smootherstep(st,0,1):1,en=y.animationPreset==="grow"?_.reducedMotion||!y.animationPlaying?1:e.smootherstep(t(v.growthElapsed/ze,0,1),0,1):1,Fn=y.animationPreset==="grow"?e.smootherstep(en,.72,1):1,xt=t(ce,0,1),Ze=_.reducedMotion||!v.hasResolvedInitialPose,Lt=t(_.starsOpacity,0,1),qt=Ze?Lt:ar(v.starsOpacity,Lt,Re);v.starsOpacity=qt,qt!==Lt&&(we=!0);let at=Ze?xt:ar(v.scrollProgress,xt,Re);v.scrollProgress=at,at!==xt&&(we=!0);let ln=y.scrollEffects&&!_.reducedMotion&&_.tiltProgress!==null?t(_.tiltProgress,0,1):xt,Nn=Ze?ln:ar(v.tiltProgress,ln,Re);v.tiltProgress=Nn,Nn!==ln&&(we=!0);let An=_.reducedMotion?.5:.375,gn=_.reducedMotion?1:1.1875,Ut=y.scrollEffects&&!_.reducedMotion&&_.scatterProgress!==null?e.lerp(An,gn,t(_.scatterProgress,0,1)):t(ce,0,gn),Dt=Ze?Ut:ar(v.scatterScrollProgress,Ut,Re);v.scatterScrollProgress=Dt,Dt!==Ut&&(we=!0);let Bt=e.smootherstep(at,0,.5),yt=Math.sin(t(Nn/.75,0,1)*Math.PI*.5),vn=1-e.smootherstep(Nn,.75,1),_t=e.smootherstep(Dt,An,gn),cn=e.smoothstep(e.smootherstep(Ut,An,gn),0,1),nn=Ze?cn:ar(v.scatterPositionProgress,cn,Re,4);v.scatterPositionProgress=nn,nn!==cn&&(we=!0);let Qt=(1-_t)*e.smoothstep(ht,.55,1);v.scatter=_t;let Si=y.scrollEffects?e.lerp(1,.45,Bt):1;if(y.animationPreset==="legacy-zoom")k.scale.setScalar(e.lerp(2.35,1,Tt)),k.rotation.set(e.lerp(e.degToRad(-42),0,Tt),e.lerp(Math.PI,0,Tt),e.lerp(e.degToRad(5),0,Tt));else if(y.animationPreset==="accretion-exhale"){let He=e.smootherstep(It,t(y.accretionExhale.accretionRatio,.12,.72),1);k.scale.setScalar(e.lerp(t(y.accretionExhale.startScale,.3,1.25),1,He)),k.rotation.set(0,0,0)}else k.scale.setScalar(1),k.rotation.set(0,0,0);k.scale.setScalar(e.lerp(k.scale.x,1,_t)),k.rotation.x=e.lerp(k.rotation.x,0,Bt)+ia*yt*vn,k.rotation.y=e.lerp(k.rotation.y,0,Bt),k.rotation.z=e.lerp(k.rotation.z,0,Bt);let Ai=+(y.interactionMode==="rotate");if(_.reducedMotion)v.spinRotation.set(0,0),z.rotation.set(0,0,0);else{let He=1-Math.exp(-(_.returning?5.5:14)*Re),Mi=Ai*_.rotation.x,yn=Ai*_.rotation.y;v.spinRotation.x=e.lerp(v.spinRotation.x,Mi,He),v.spinRotation.y=e.lerp(v.spinRotation.y,yn,He),z.rotation.set(v.spinRotation.x*Qt,v.spinRotation.y*Qt,0),(Di(v.spinRotation.x,Mi)||Di(v.spinRotation.y,yn))&&(we=!0)}let Pn=_.pointer,du=Gf(v.particleMotion,Pn,J.particleMotionEnabled===!0&&!_.reducedMotion&&y.interaction.particleRepel&&y.interactionMode!=="none",Re,_.scrolling);Pn.reset&&(v.lensPointer.set(0,0),v.lensStrength=0,Pn.reset=!1);let pu=!_.reducedMotion&&y.interactionMode==="depth-lens",sa=1-Math.exp(-t(y.interaction.followDamping,1,30)*Re);if(_.reducedMotion)v.lensPointer.set(0,0),v.lensStrength=0;else{let He=pu&&Pn.active?1:0;v.lensPointer.x=e.lerp(v.lensPointer.x,Pn.x,sa),v.lensPointer.y=e.lerp(v.lensPointer.y,Pn.y,sa),v.lensStrength=e.lerp(v.lensStrength,He,sa),(Di(v.lensStrength,He)||He>0&&(Di(v.lensPointer.x,Pn.x)||Di(v.lensPointer.y,Pn.y)))&&(we=!0)}let Ro=+!!Pn.active,Do=!_.reducedMotion&&y.interactionMode==="depth-lens"&&(Math.abs(v.lensStrength-Ro)>1e-4||Pn.active&&(Math.abs(v.lensPointer.x-Pn.x)>1e-4||Math.abs(v.lensPointer.y-Pn.y)>1e-4));!Do&&y.interactionMode==="depth-lens"&&(v.lensStrength=Ro,Pn.active&&v.lensPointer.set(Pn.x,Pn.y));let Qn=y.interactionMode==="depth-lens"?v.lensStrength:0,fs=_e.width/Math.max(_e.height,1),lr=_e.width/Math.max(_e.height,1)<.72?12.7:10.9,un=lr*fs,Wt=_.shape;Wt.id&&Wt.samples&&(Wt.id!==v.lastShapeId||Wt.samples!==v.lastShapeSamples)&&(v.pathShapeTexture.image.data.set(Wt.samples),v.pathShapeTexture.needsUpdate=!0,v.lastShapeId=Wt.id,v.lastShapeSamples=Wt.samples);let xn=Ze?Wt.strength:ar(v.shapeProgress,Wt.strength,Re*5.5/t(y.convergeDuration,1,10));v.shapeProgress=xn;let aa=e.smoothstep(Wt.strength,0,1),zr=Ze?aa:ar(v.shapePositionProgress,aa,Re*5.5/t(y.convergeDuration,1,10),4);v.shapePositionProgress=zr,zr!==aa&&(we=!0);let vr=y.scrollEffects?t(_t*(1-xn),0,1):0,ds=_.reducedMotion?0:vr;v.railPresence=vr;let Io=_.reducedMotion?0:ce*t(y.scrollStarDriftSpeed,0,3),mu=e.lerp(1,.18,vr),Lo=e.lerp(1,.1,vr),Wf=e.lerp(1,.1,vr);if(v.hasResolvedInitialPose=!0,xn!==Wt.strength&&(we=!0),_.reducedMotion)v.shapeAutoRotation=0,v.shapePointerRotation.set(0,0),v.shapeRotation.set(0,0);else{let He=e.smootherstep(xn,.05,.4),Mi=1-Math.exp(-(_.returning?5.5:14)*Re),yn=Ai*_.rotation.x,Li=Ai*_.rotation.y;v.shapePointerRotation.x=e.lerp(v.shapePointerRotation.x,yn,Mi),v.shapePointerRotation.y=e.lerp(v.shapePointerRotation.y,Li,Mi);let gs=t(y.pathShapeAutoRotateAmount,0,1.2);v.shapeAutoRotation=0;let Hr=e.smootherstep(xn,.001,.12),oa=e.smootherstep(xn,.04,.82),Bo=Number(y.pathShapeAutoRotate&&y.animationPlaying),dn=e.lerp(-gs,0,oa)*Hr*Bo,Sn=oa>0&&oa<1?Math.sin(oa*Math.PI):0;v.shapeRotation.set(v.shapePointerRotation.x*He+-Sn*gs*.34*Hr*Bo,v.shapePointerRotation.y*He+dn),(Di(v.shapePointerRotation.x,yn)||Di(v.shapePointerRotation.y,Li))&&(we=!0)}v.scratch.center.set(Wt.centerNdc.x*un*.5,Wt.centerNdc.y*lr*.5),v.scratch.size.set(Wt.sizeNdc.x*un*.5,Wt.sizeNdc.y*lr*.5);let ps=Math.min(.5*Math.min(676,Math.max(_e.width-48,0))+48,.36*_e.width)/Math.max(_e.width,1)*un;v.railContentBounds.set(_.contentBounds?.left??.5-ps/un,_.contentBounds?.right??.5+ps/un);let hm=(v.railContentBounds.x-.5)*un,fm=(v.railContentBounds.y-.5)*un,dm=y.animationPreset==="grow"?e.smootherstep(Et,0,1):1,Sv=y.animationPreset==="grow"?e.lerp(0,1.2,dm):1.2,pm=e.lerp(Sv,0,Bt);D.position.set(0,pm,12),D.lookAt(0,pm,0);let Av=y.animationPreset==="grow"?e.lerp(t(y.grow.startZoom,1,8),1,dm):1;D.zoom=_e.height/lr*e.lerp(Av,1,_t),D.updateProjectionMatrix();let Mv=t(_.heroViewportHeight??_e.height,1,_e.height);k.position.y=(_e.height-Mv)/(2*D.zoom)*(1-_t)*(1-xn);let Uo=lr*fs*1.12,ms=1.12*lr,_v=y.animationPreset==="legacy-zoom"?e.lerp(8,1,Tt):y.animationPreset==="accretion-exhale"?e.lerp(Math.max(1,4*y.accretionExhale.inwardStrength),1,It):1,Xf=t(y.accretionExhale.settleDuration/ye,.03,.4),mm=y.animationPreset==="accretion-exhale"&&It>=.999&&!_.reducedMotion?1+Math.sin(v.elapsed*t(y.accretionExhale.ambientSpeed,0,3)*Math.PI*2)*t(y.accretionExhale.ambientAmount,0,.16):1,gm=2*t(y.interaction.radius,32,360)/Math.max(_e.height,1);if(J.coreCluster){let He=.36*t(y.stars.flowSpeed,0,3),Mi=y.animationPreset!=="grow"&&y.stars.flowInward?1:-1;if(_.reducedMotion)v.coreTargetRotation=0,v.coreRotation=0;else{v.coreTargetRotation=n(v.coreTargetRotation+Xe*He*Mi+Math.PI,2*Math.PI)-Math.PI;let yn=1-Math.exp(-14*Re),Li=Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation));v.coreRotation=n(v.coreRotation+Li*yn+Math.PI,2*Math.PI)-Math.PI,!y.animationPlaying&&Xe===0&&Math.abs(Math.atan2(Math.sin(v.coreTargetRotation-v.coreRotation),Math.cos(v.coreTargetRotation-v.coreRotation)))>.001&&(we=!0)}J.coreCluster.rotation.set(_.reducedMotion?0:.08*Math.sin(.22*v.elapsed)*Qt,_.reducedMotion?0:.14*Math.cos(.28*v.elapsed)*Qt,v.coreRotation*Qt)}let Ev=t(y.interaction.rotationLag,0,1),Tv=_.returning?5.5:14;for(let He of J.orbits){if(_.reducedMotion)He.spin.set(0,0);else{let Li=1-Math.exp(-(Tv/(1+He.lag*Ev*2.5))*Re),gs=Ai*_.rotation.x,Hr=Ai*_.rotation.y;He.spin.x=e.lerp(He.spin.x,gs,Li),He.spin.y=e.lerp(He.spin.y,Hr,Li),(Di(He.spin.x,gs)||Di(He.spin.y,Hr))&&(we=!0)}let Mi=0,yn=0;if(y.animationPreset==="legacy-zoom"){let Li=Tt-Tt**(1+.9*He.lag);Mi=e.degToRad(-42*Li),yn=Math.PI*Li}He.group.rotation.set(Mi+He.spin.x*Qt*Ai-z.rotation.x,yn+He.spin.y*Qt*Ai-z.rotation.y,0)}for(let He of J.pathLayers){let Mi=He.isCore&&Wt.id?0:1,yn=y.animationPreset==="grow"?He.outwardSpeed:He.speed,Li=He.isCore?.022:Math.abs(yn),gs=e.smootherstep(xn,.08,.5);if(!_.reducedMotion)if(He.pathShapeTravel=n(He.pathShapeTravel+Xe*Li*(y.stars.flowInward?1:-1)*t(y.stars.flowSpeed,0,3)*gs,1),y.animationPreset==="grow"&&yn!==0){let Sn=Math.abs(yn)*t(y.stars.flowSpeed,0,3)*Fn;He.motionOffset=n(He.motionOffset+Xe*Sn*Math.sign(yn)*Qt,1),He.travel=n(He.phase+He.motionOffset,1)}else He.motionOffset=n(He.motionOffset+Xe*yn*t(y.stars.flowSpeed,0,3)*Qt,1),He.travel=n(He.travel+Xe*_v*Math.abs(yn)*Qt,1);let Hr=_.reducedMotion?He.phase:He.travel,oa=yn<0?1-Hr:Hr,Bo=_.reducedMotion?0:y.animationPreset==="grow"?He.motionOffset:v.elapsed,dn=He.starMaterial.uniforms;if(dn.uTime.value=Bo,dn.uBackgroundStarsEnabled.value=+(y.animationPreset==="converge-tilt"&&!Wt.id),dn.uPathSpeed.value=y.animationPreset==="grow"&&yn!==0?1:yn,dn.uPathOffset.value=_.reducedMotion?0:He.motionOffset,dn.uPathShapeCenter.value.copy(v.scratch.center),dn.uPathShapeProgress.value=xn,dn.uPathShapePositionProgress.value=zr,dn.uPathShapeMotion.value=He.pathShapeTravel,dn.uPathShapeRotation.value.copy(v.shapeRotation),dn.uPathShapeScatter.value=t(y.pathShapeScatter,0,3),dn.uPathShapeSize.value.copy(v.scratch.size),dn.uPathShapeTexture.value=v.pathShapeTexture,dn.uGrowthDirection.value=yn<0?-1:1,dn.uFlowSpeed.value=y.animationPreset==="grow"&&yn!==0?Qt:t(y.stars.flowSpeed,0,3)*Qt,dn.uTwinkleSpeed.value=_.reducedMotion?0:t(y.stars.twinkleSpeed,0,2)*Qt,dn.uIntensity.value=t(y.stars.intensity*(He.isCore?1.22:1)*mu,.1,3)*qt*Mi,dn.uDispersedMotion.value=ds,dn.uScrollScatter.value=_t,dn.uScrollPositionProgress.value=nn,dn.uScrollDrift.value=Io,dn.uScrollSizeScale.value=Si,dn.uTextBounds.value.set(hm,fm),dn.uScatterSize.value.set(Uo,ms),fu(He.starMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow"&&!He.isCore,en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction),He.flareSource){let Sn=He.flarePathSamples,gu=Sn!==null,wv=n(He.flareProgress+(_.reducedMotion?0:He.motionOffset),1),vu=gu?tt(wv,y.stars.densityFalloff):0,la=vu,Yf=1,xu=1;if(gu&&y.animationPreset==="grow"){let Zn=yn<0?-1:1,cr=.24*(Zn>0?vu:1-vu),Gr=t((en-cr)/Math.max(1-cr,1e-4),0,1);xu=e.smoothstep(Gr,0,1),la=e.lerp(Zn>0?0:1,vu,xu),Yf=e.smoothstep(en,cr,cr+.025)}if(Sn){let Zn=1/Math.max(Math.floor(Sn.length/4)-1,1);$(Sn,la,v.scratch.position),$(Sn,Math.max(la-Zn,0),v.scratch.previous),$(Sn,Math.min(la+Zn,1),v.scratch.next),v.scratch.tangent.subVectors(v.scratch.next,v.scratch.previous).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize(),v.scratch.position.addScaledVector(v.scratch.normal,He.flareAcrossOffset*xu),v.scratch.position.z+=He.flareDepthOffset*xu}else v.scratch.position.copy(He.flareBasePosition);let yu=1;if(y.animationPreset==="accretion-exhale"){let Zn=Math.hypot(v.scratch.position.x,v.scratch.position.y),cr=t(It-Zn*y.accretionExhale.propagationSoftness*.018,0,1),Gr=t(y.accretionExhale.accretionRatio,.12,.72),vs=Math.max(Gr+.08,1-Xf),ua=e.smoothstep(cr,0,Gr),xr=e.smoothstep(cr,Gr,vs),ha=Zn>1e-4?v.scratch.position.x/Zn:0,Au=Zn>1e-4?v.scratch.position.y/Zn:0;v.scratch.formed.copy(v.scratch.position),v.scratch.formed.x+=ha*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.y+=Au*y.accretionExhale.inwardStrength*(2+.28*Zn),v.scratch.formed.z+=.8*y.accretionExhale.inwardStrength,v.scratch.previous.set(.045*v.scratch.position.x,.045*v.scratch.position.y,.12*v.scratch.position.z),v.scratch.formed.lerp(v.scratch.previous,ua),v.scratch.formed.lerp(v.scratch.position,xr);let fa=Math.sin(xr*Math.PI)*(1-xr)*y.accretionExhale.exhaleStrength;v.scratch.formed.x+=ha*fa,v.scratch.formed.y+=Au*fa,v.scratch.position.copy(v.scratch.formed),yu=e.lerp(.06,.58,ua),yu=e.lerp(yu,1,xr)}let Fo=Math.fround(He.flareScatter.x),Su=Math.fround(He.flareScatter.y),ca=Math.fround(He.flareScatter.z),bv=+(Math.fround(He.flareClearanceSeed)>=.72),vm=Fo<.5?-1:1,Cv=Math.sqrt(n(2*Fo,1)),Pv=vm*e.lerp(vm<0?-hm:fm,.5*Uo,Cv);be(v.scratch.dispersedOffset,Math.fround(Bo),Fo,Su,ca,Io,ds),v.scratch.scattered.set(e.lerp(Pv,(Fo-.5)*Uo,bv)+v.scratch.dispersedOffset.x,n((Su-.5)*ms+v.scratch.dispersedOffset.y+.5*ms,ms)-.5*ms-Math.sin(nn*Math.PI)*(.15+.25*ca),(ca-.5)*.5),v.scratch.position.lerp(v.scratch.scattered,nn);let No=gu?fe(la):1,Oo=gu?Oe(la,y.stars.sizeFalloff):1;No=e.lerp(No,1,_t),Oo=e.lerp(Oo,1,_t);let xm=1,ym=1;if(Wt.samples&&(xn>0||zr>0)){me(Wt.samples,He.flareShapeSeed,v.scratch.range);let Zn=v.scratch.range.x,cr=v.scratch.range.y,Gr=Math.max(cr-Zn,.0009775171065493646),vs=tt(t((He.flareShapeSeed-Zn)/Gr,0,1)+He.pathShapeTravel/Gr,y.stars.densityFalloff),ua=Math.max(Math.floor(Wt.samples.length/4),1),xr=Math.max(ua-1,1),ha=t(Math.ceil(Zn*ua-.5),0,xr),Au=t(Math.max(Math.floor(cr*ua-.5),ha),ha,xr),fa=ha/xr,qf=Au/xr,Qf=e.lerp(fa,qf,vs),Am=Math.min(.0009775171065493646*s,Math.max(qf-fa,.0009775171065493646)*.2);$(Wt.samples,Qf,v.scratch.formed),$(Wt.samples,Math.max(Qf-Am,fa),v.scratch.previous),$(Wt.samples,Math.min(Qf+Am,qf),v.scratch.next),v.scratch.tangent.set((v.scratch.next.x-v.scratch.previous.x)*v.scratch.size.x+1e-4,(v.scratch.next.y-v.scratch.previous.y)*v.scratch.size.y,0).normalize(),v.scratch.normal.set(-v.scratch.tangent.y,v.scratch.tangent.x,0).normalize();let Uv=Math.sin(vs*Math.PI),Bv=Math.sin(vs*Math.PI*1.35+He.pathShapeDepthPhase)*He.pathShapeDepth*Uv,Mm=t(y.pathShapeScatter,0,3);v.scratch.relative.set(v.scratch.formed.x*v.scratch.size.x,v.scratch.formed.y*v.scratch.size.y,(Bv+.75*He.flareDepthOffset+He.flareShapeDepthScatter)*Mm).addScaledVector(v.scratch.normal,(1.1*He.flareAcrossOffset+He.flareShapeAcrossScatter)*Mm),v.scratch.euler.set(v.shapeRotation.x,v.shapeRotation.y,0,"YXZ"),v.scratch.relative.applyEuler(v.scratch.euler),v.scratch.formed.set(v.scratch.center.x+v.scratch.relative.x,v.scratch.center.y+v.scratch.relative.y,v.scratch.relative.z),v.scratch.position.lerp(v.scratch.formed,zr);let _m=e.smoothstep(v.scratch.relative.z,-1.15,1.15);No=e.lerp(No,fe(vs),xn),Oo=e.lerp(Oo,Oe(vs,y.stars.sizeFalloff),xn),xm=e.lerp(1,e.lerp(.78,1.18,_m),xn),ym=e.lerp(1,e.lerp(.72,1,_m),xn)}v.scratch.formed.set((Fo-.5)*Uo,(n(Su,1)-.5)*ms,(ca-.5)*.5),Pt(v.scratch.position,v.scratch.formed,ht,ca,Su);let Sm=se(ht,ca),Rv=Math.sqrt(Sm),Dv=e.smoothstep(Sm,0,X),Iv=y.animationPreset!=="grow"||He.isCore?1:.3+.7*Yf,Lv=No*Oo*xm*ym*yu*Yf*Iv*e.lerp(Si,1,xn)*Rv*Dv*Wf;He.flareSource.position.copy(v.scratch.position),He.flareSource.scale.setScalar(t(Lv,0,1)*qt*Mi)}if(He.dustMaterial){let Sn=He.dustMaterial.uniforms;Sn.uDispersedMotion.value=ds,Sn.uDriftSpeed.value=_.reducedMotion?0:t(y.orbitalDust.driftSpeed,0,1.5)*Qt,Sn.uScrollScatter.value=_t,Sn.uScrollPositionProgress.value=nn,Sn.uScrollDrift.value=Io,Sn.uStarVisibility.value=Qt,Sn.uTrailEnabled.value=Qt,Sn.uScatterSize.value.set(Uo,ms),Sn.uHeadProgress.value=oa,Sn.uDirection.value=yn<0?-1:1,Sn.uIntensity.value=t(y.orbitalDust.intensity*Lo,0,3),Sn.uLightReach.value=t(y.orbitalDust.reach,.02,.4)*(He.strong?1.15:1),Sn.uTime.value=_.reducedMotion?0:v.elapsed,fu(He.dustMaterial,y.animationPreset==="accretion-exhale",It,ht,y.animationPreset==="grow",en,y.grow.softness,mm,Xf,y.accretionExhale,Qn,v.lensPointer,gm,fs,_e.height,y.interaction)}}return we||Do||du}let li={pointer:"astra:pointer",replay:"astra:replay",return:"astra:return",rotate:"astra:rotate"},um=new Set([" ","ArrowDown","ArrowUp","End","Home","PageDown","PageUp","Spacebar"]),I="path, circle, ellipse, line, polyline, polygon, rect",ee=(v,y,_)=>{let D=t((v-y)/(_-y),0,1);return D*D*D*(D*(6*D-15)+10)},de=v=>String(Math.round(1e4*t(v,0,1))/1e4),pe=4*Math.PI,ie=v=>Number.isFinite(v)?t(v,-pe,pe):0,Le=v=>Number.isFinite(v)?t(v,-1,1):0;function Qe(v,y,_,D={},k=window){let z=i(D.shapeHeightVh)?t(D.shapeHeightVh,40,120):80,J=i(D.maxWidth)?t(D.maxWidth,240,960):576;v.className="astra-shapeCue",v.dataset.astraPathShape=y,v.dataset.astraScrollCue="true",v.style.setProperty("--astra-shape-height",`calc(${z/100} * var(--astra-viewport-height, 100vh))`),v.style.setProperty("--astra-shape-max-width",`${J}px`);let Y="http://www.w3.org/2000/svg",ge=document.createElementNS(Y,"svg");if(ge.setAttribute("aria-hidden","true"),ge.setAttribute("class","astra-shapeTarget"),ge.setAttribute("fill","none"),ge.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup)ge.innerHTML=_.markup;else for(let _e of _.paths){let Xe=document.createElementNS(Y,"path");Xe.setAttribute("d",_e),Xe.setAttribute("stroke","currentColor"),Xe.setAttribute("stroke-width",String(_.strokeWidth??1)),ge.appendChild(Xe)}let Ee=document.createElement("button");return Ee.type="button",Ee.className="astra-dragSurface",Ee.dataset.dragging="false",Ee.setAttribute("aria-label",D.interactionLabel??`Drag or use arrow keys to rotate the ${_.label?.toLowerCase()??"shape"}`),v.replaceChildren(ge,Ee),mt(Ee,k),v}function nt(v,y){let _=v?.localName==="svg"&&v?.namespaceURI==="http://www.w3.org/2000/svg"?v:v.querySelector("svg.astra-shapeTarget, svg"),D=_?.viewBox.baseVal;if(!_||!D||D.width<=0||D.height<=0)return null;let k=_.getScreenCTM(),z=Array.from(_.querySelectorAll(I)).map(_e=>{try{let Xe=_e.getTotalLength(),Re=_e.getScreenCTM(),ce=k&&Re?k.inverse().multiply(Re):null;return Xe>0&&Number.isFinite(Xe)?{path:_e,length:Xe,matrix:ce}:null}catch{return null}}).filter(_e=>_e!==null),J=z.reduce((_e,Xe)=>_e+Xe.length,0);if(J<=0)return null;let Y=new Float32Array(4096),ge=0,Ee=0;for(let _e=0;_e<1024;_e+=1){let Xe=(_e+.5)/1024*J;for(;ge<z.length-1&&Xe>Ee+z[ge].length;)Ee+=z[ge].length,ge+=1;let{path:Re,length:ce,matrix:Ne}=z[ge],we=Re.getPointAtLength(Xe-Ee),ye=Ne?new DOMPoint(we.x,we.y).matrixTransform(Ne):we,ze=4*_e;Y[ze]=(ye.x-D.x)/D.width-.5,Y[ze+1]=.5-(ye.y-D.y)/D.height,Y[ze+2]=Ee/J,Y[ze+3]=(Ee+ce)/J}return Y.some(_e=>!Number.isFinite(_e))?null:{element:v,id:y,samples:Y,aspectRatio:D.width/D.height}}function Ke(v,y){v.dispatchEvent(new CustomEvent(li.pointer,{detail:y}))}function ut(v){if(v)try{v.target.hasPointerCapture(v.id)&&v.target.releasePointerCapture(v.id)}catch{}}function mt(v,y=window){let _=null,D=!1,k=!1,z=!1,J=ce=>y.dispatchEvent(new CustomEvent(li.rotate,{detail:ce})),Y=(ce,Ne,we)=>!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY)?!1:(D=Ne,k=we,Ke(y,{active:Ne,clientX:ce.clientX,clientY:ce.clientY,pressed:we}),!0),ge=()=>{(D||k)&&(D=!1,k=!1,Ke(y,{active:!1,clientX:0,clientY:0,pressed:!1}))},Ee=(ce,Ne=!0)=>{let we=_!==null||D||k||z,ye=_;_=null,ut(ye),z=!1,Ne&&(v.dataset.dragging="false"),we&&(ce?Y(ce,!0,!1):ge(),y.dispatchEvent(new Event(li.return)))};v.addEventListener("keydown",ce=>{let we={ArrowDown:{x:0,y:.08},ArrowLeft:{x:-.08,y:0},ArrowRight:{x:.08,y:0},ArrowUp:{x:0,y:-.08}}[ce.key];we&&(ce.preventDefault(),J(we))}),v.addEventListener("pointerdown",ce=>{if(!(!ce.isPrimary||ce.button!==0||_!==null||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))){try{v.setPointerCapture(ce.pointerId)}catch{return}if(_={id:ce.pointerId,target:v,x:ce.clientX,y:ce.clientY},!Y(ce,!0,!0)){let Ne=_;_=null,ut(Ne);return}z=!0,v.dataset.dragging="true"}}),v.addEventListener("pointermove",ce=>{if(!ce.isPrimary||!Number.isFinite(ce.clientX)||!Number.isFinite(ce.clientY))return;let Ne=_;if(!(Ne&&(ce.pointerId!==Ne.id||ce.currentTarget!==Ne.target))){if(!Ne){if(ce.buttons!==0)return;Y(ce,!0,!1);return}Y(ce,!0,!0)&&(J({x:(ce.clientX-Ne.x)*.005,y:(ce.clientY-Ne.y)*.005}),Ne.x=ce.clientX,Ne.y=ce.clientY)}}),v.addEventListener("pointerup",ce=>{let Ne=_;if(Ne&&Ne.id===ce.pointerId&&Ne.target===ce.currentTarget){let we=v.getBoundingClientRect(),ye=ce.pointerType==="mouse"&&Number.isFinite(ce.clientX)&&Number.isFinite(ce.clientY)&&ce.clientX>=we.left&&ce.clientX<=we.right&&ce.clientY>=we.top&&ce.clientY<=we.bottom;Ee(ye?ce:void 0)}}),v.addEventListener("pointercancel",ce=>{let Ne=_;Ne&&Ne.id!==ce.pointerId||(Ne||ce.isPrimary&&D)&&Ee()}),v.addEventListener("pointerleave",ce=>{ce.isPrimary&&!_&&ge()}),v.addEventListener("lostpointercapture",ce=>{_?.id===ce.pointerId&&Ee()});let _e=()=>Ee(),Xe=()=>Ee(),Re=()=>{document.visibilityState==="hidden"&&Ee()};return window.addEventListener("blur",_e),y.addEventListener(li.replay,Xe),document.addEventListener("visibilitychange",Re),()=>{ut(_),_=null,window.removeEventListener("blur",_e),y.removeEventListener(li.replay,Xe),document.removeEventListener("visibilitychange",Re)}}function lt(v){let y=new DOMParser().parseFromString(v.trim(),"image/svg+xml"),_=y.querySelector("svg");if(!_||y.querySelector("parsererror"))throw new Error("That is not valid SVG markup.");let D=(_.getAttribute("viewBox")||"").trim().split(/[\s,]+/).map(Number),k=Number(_.getAttribute("width")),z=Number(_.getAttribute("height"));if(D.length===4&&D.every(Number.isFinite)&&(k=D[2],z=D[3]),!(k>0&&z>0))throw new Error("The SVG needs a viewBox (or width/height).");let J=Array.from(_.querySelectorAll(I));if(J.length===0)throw new Error("No path, line, polyline, polygon, circle, ellipse or rect found.");let Y=Math.max(k,z)/40,ge=J.map(Ee=>{let _e=document.createElementNS("http://www.w3.org/2000/svg",Ee.localName),Xe=new Set(["d","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","width","height","points","transform"]);for(let ce of Ee.attributes)Xe.has(ce.name)&&_e.setAttribute(ce.name,ce.value);for(let ce of["fill","stroke","stroke-width","style","class"])_e.removeAttribute(ce);_e.setAttribute("fill","none"),_e.setAttribute("stroke","currentColor"),_e.setAttribute("stroke-width",String(Y));let Re=_e.getAttribute("transform")||"";for(let ce=Ee.parentElement;ce&&ce!==_;ce=ce.parentElement){let Ne=ce.getAttribute("transform");Ne&&(Re=`${Ne} ${Re}`)}return Re.trim()&&_e.setAttribute("transform",Re.trim()),_e.outerHTML}).join("");return{label:"Custom",width:k,height:z,strokeWidth:Y,paths:[],markup:ge}}let Mt=Object.freeze({shape:"star",transform:"load",holdAtEnd:!1,interaction:"rotate",autoRotate:!0,palette:"astra",background:"#000",ambient:!1,padding:.1,parallax:!0,interactionLabel:null,tier:3,config:null});function Yt(v,y){if(!y||typeof y!="object")return v;for(let[_,D]of Object.entries(y))D&&typeof D=="object"&&!Array.isArray(D)&&v[_]&&typeof v[_]=="object"?Yt(v[_],D):v[_]=Array.isArray(D)?[...D]:D;return v}function fn(v){if(typeof v=="string"){if(S[v])return{id:v,def:S[v]};if(v.trim().startsWith("<"))return{id:"custom",def:{...S.custom,...lt(v),label:"Custom"}};throw new Error(`Unknown shape "${v}". Use one of: ${Object.keys(S).join(", ")} or SVG markup.`)}if(v&&typeof v=="object")return{id:v.id??"custom",def:{strokeWidth:1,paths:[],label:"Custom",...v}};throw new Error("shape must be a string or a shape definition object.")}let rn=`
4823
4823
  .astra-cue { position: relative; display: block; overflow: hidden; background: var(--astra-cue-background, #000); touch-action: pan-y pinch-zoom; isolation: isolate; }
4824
4824
  .astra-cue > .astra-cue-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
4825
4825
  .astra-cue > .astra-cue-ambient { pointer-events: none; position: absolute; inset: 0; mix-blend-mode: plus-lighter; opacity: 0;
@@ -4843,7 +4843,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4843
4843
  .astra-cue > .astra-dragSurface { cursor: auto; pointer-events: none; }
4844
4844
  }
4845
4845
  astra-shape-cue { display: block; }
4846
- `;function jt(){if(document.getElementById("astra-shape-cue-styles"))return;let v=document.createElement("style");v.id="astra-shape-cue-styles",v.textContent=rn,document.head.appendChild(v)}let kr=class kr{constructor(y,_={}){if(!(y instanceof Element))throw new Error("AstraShapeCue needs a host element.");if(jt(),this.host=y,this.options={...Mt,..._},this.config=Yt(x(),this.options.config),this.config.interactionMode=this.options.interaction,this.config.pathShapeAutoRotate=this.options.autoRotate,this.options.palette!==this.config.colorPalette){let D=m.find(k=>k.id===this.options.palette);D&&(this.config.colorPalette=D.id,this.config.colorPaletteColors=[...D.colors])}this._reducedMotionQuery=window.matchMedia?.("(prefers-reduced-motion: reduce)"),this.reducedMotion=!!this._reducedMotionQuery?.matches,this.profile=sr(this.options.tier,this.reducedMotion),this.input={contentBounds:{left:.5,right:.5},heroViewportHeight:null,reducedMotion:this.reducedMotion,progress:1,scatterProgress:1,tiltProgress:1,starsOpacity:1,scrolling:!1,returning:!1,rotation:{x:0,y:0},pointer:{active:!1,pressed:!1,reset:!1,x:0,y:0},shape:{centerNdc:{x:0,y:0},id:null,samples:null,sizeNdc:{x:0,y:0},strength:0}},this.size={width:1,height:1},this.renderer=null,this.animation=null,this.status="loading",this._raf=null,this._lastTime=null,this._needsFrame=!0,this._sizeDirty=!0,this._lastDpr=0,this._shapeDirty=!0,this._shapeVersion=0,this._sample=null,this._visible=!1,this._gathered=!1,this._frames=0,this._disposed=!1,this._lastScrollY=NaN,this._cachedRect=null,this._buildDom(),this._bindEvents(),this.setShape(this.options.shape),this._buildRenderer(),kr.instances.add(this)}_buildDom(){let y=this.host;y.classList.add("astra-cue"),y.dataset.astraCue="",getComputedStyle(y).position==="static"&&(y.style.position="relative"),y.style.setProperty("--astra-cue-background",this.options.background),this.canvas=document.createElement("canvas"),this.canvas.className="astra-cue-canvas",this.canvas.setAttribute("aria-hidden","true"),this.ambient=document.createElement("div"),this.ambient.className="astra-cue-ambient",this.ambient.setAttribute("aria-hidden","true"),this.ambient.style.setProperty("--astra-ambient-color",g.background.ambientColor),this.ambient.style.setProperty("--astra-ambient-fade-duration",`${this.config.convergeDuration}s`),this.ambient.style.setProperty("--astra-ambient-opacity",String(g.background.ambientOpacity)),this.ambient.hidden=!this.options.ambient,this.vignette=document.createElement("div"),this.vignette.className="astra-cue-vignette",this.vignette.setAttribute("aria-hidden","true"),this.vignette.hidden=!this.options.ambient,this.target=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.target.setAttribute("class","astra-shapeTarget"),this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("fill","none"),this.button=document.createElement("button"),this.button.type="button",this.button.className="astra-dragSurface",this.button.dataset.dragging="false",y.replaceChildren(this.canvas,this.ambient,this.vignette,this.target,this.button),this._unbindDrag=mt(this.button,y)}_renderTarget(y,_){let D="http://www.w3.org/2000/svg";this.target.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup?this.target.innerHTML=_.markup:this.target.replaceChildren(..._.paths.map(k=>{let z=document.createElementNS(D,"path");return z.setAttribute("d",k),z.setAttribute("stroke","currentColor"),z.setAttribute("stroke-width",String(_.strokeWidth??1)),z})),this.button.setAttribute("aria-label",this.options.interactionLabel??`Drag or use arrow keys to rotate the ${(_.label??"shape").toLowerCase()}`),this.host.dataset.astraPathShape=y}setShape(y){let{id:_,def:D}=fn(y);return this.shapeId=_,this.shapeDef=D,this._renderTarget(_,D),this._shapeVersion+=1,this._shapeDirty=!0,this.invalidate(),this}setTransform(y){if(!["scroll","load","off"].includes(y))throw new Error(`transform must be scroll | load | off (got ${y})`);return this.options.transform=y,this._gathered=!1,this.invalidate(),this}replay(){return this._gathered=!1,this._replayUntil=performance.now()+250,this.host.dispatchEvent(new Event(li.replay)),this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate(),this}rotate(y,_){return this.host.dispatchEvent(new CustomEvent(li.rotate,{detail:{x:y,y:_}})),this}set(y,_){let D=y.split("."),k=D.pop(),z=D.reduce((J,Y)=>J[Y],this.config);return z[k]=_,kr.FIELD_KEYS.has(y)?this.rebuild():this.invalidate(),this}setPalette(y){let _=m.find(D=>D.id===y);if(!_)throw new Error(`Unknown palette ${y}`);return this.options.palette=y,this.config.colorPalette=_.id,this.config.colorPaletteColors=[..._.colors],this.rebuild(),this}setBackground(y){let _=this.options.background==="transparent";return this.options.background=y,this.host.style.setProperty("--astra-cue-background",y),_!==(y==="transparent")&&this.rebuild(),this}setAmbient(y){return this.options.ambient=y,this.ambient.hidden=!y,this.vignette.hidden=!y,this}rebuild(){return clearTimeout(this._rebuildTimer),this._rebuildTimer=setTimeout(()=>this._buildRenderer(),60),this}invalidate(){this._needsFrame=!0,this._schedule()}dispose(){this._disposed||(this._disposed=!0,this._raf!==null&&cancelAnimationFrame(this._raf),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._unbind?.(),this._unbindDrag?.(),clearTimeout(this._rebuildTimer),this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null,this.host.replaceChildren(),this.host.classList.remove("astra-cue"),kr.instances.delete(this))}_buildRenderer(){if(!this._disposed){this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null;try{this.renderer=hu(this.canvas,this.config,this.profile,{invalidate:()=>this.invalidate(),transparent:this.options.background==="transparent"}),this.animation=Hf(this.config,1),this.status="ready",this._sizeDirty=!0,this._frames=0,this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="ready"}catch(y){console.error(y),this.status="error",this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="error"}this.invalidate()}}_bindEvents(){let y=this.host,_=()=>{let ye=this.input.pointer;ye.active=!1,ye.pressed=!1,ye.reset=!0},D=(ye,ze,st)=>{if(this.reducedMotion){_(),this.invalidate();return}let ht=this._cachedRect??(()=>{let en=this.canvas.getBoundingClientRect();return en.width>0&&en.height>0?en:null})();if(!ht)return;this._cachedRect=ht;let Tt=Le((ye-ht.left)/ht.width*2-1),It=Le(-((ze-ht.top)/ht.height*2-1)),Et=this.input.pointer;(!Et.active||Et.pressed!==st||Et.reset||Et.x!==Tt||Et.y!==It)&&(Et.active=!0,Et.pressed=st,Et.reset=!1,Et.x=Tt,Et.y=It,this.invalidate())},k=(ye=!1)=>{let ze=this.input.pointer,st=ze.reset||ye;(ze.active||ze.pressed||ze.reset!==st)&&(ze.active=!1,ze.pressed=!1,ze.reset=st,this.invalidate())},z=ye=>{let ze=ye.detail;if(ze){if(!ze.active||this.reducedMotion){k(this.reducedMotion);return}D(ze.clientX,ze.clientY,ze.pressed===!0)}},J=ye=>{if(this.reducedMotion)return;let ze=ye.detail;ze&&(this.input.rotation.x=ie(this.input.rotation.x+ze.y),this.input.rotation.y=ie(this.input.rotation.y+ze.x),this.input.returning=!1,this.invalidate())},Y=()=>{this.config.faceForward&&(this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate())},ge=ye=>ye.isPrimary&&(ye.pointerType==="mouse"||ye.pointerType==="pen"),Ee=ye=>{ge(ye)&&ye.buttons===0&&D(ye.clientX,ye.clientY,!1)},_e=ye=>{ge(ye)&&k()},Xe=()=>k(!0),Re=()=>{(this.options.transform==="scroll"||this.options.transform==="load")&&(this._cachedRect=null,this.invalidate())},ce=()=>{this._sizeDirty=!0,this._cachedRect=null,this._shapeDirty=!0,this.invalidate()},Ne=()=>{document.visibilityState==="hidden"?_():(this._lastTime=null,this.invalidate())},we=ye=>{this.reducedMotion=ye.matches,this.input.reducedMotion=ye.matches,ye.matches&&_(),this.invalidate()};y.addEventListener(li.pointer,z),y.addEventListener(li.rotate,J),y.addEventListener(li.return,Y),y.addEventListener("pointermove",Ee,{capture:!0,passive:!0}),y.addEventListener("pointerleave",_e,{passive:!0}),window.addEventListener("blur",Xe),window.addEventListener("scroll",Re,{passive:!0}),window.addEventListener("resize",ce,{passive:!0}),document.addEventListener("visibilitychange",Ne),this._reducedMotionQuery?.addEventListener?.("change",we),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(ce),this._resizeObserver.observe(y)),typeof IntersectionObserver<"u"?(this._intersection=new IntersectionObserver(ye=>{for(let ze of ye)this._visible=ze.isIntersecting,this._visibleRatio=ze.intersectionRatio;this._visible&&(this._lastTime=null,this.invalidate())},{rootMargin:"120px",threshold:[0,.2,.5]}),this._intersection.observe(y)):this._visible=!0,this._unbind=()=>{y.removeEventListener(li.pointer,z),y.removeEventListener(li.rotate,J),y.removeEventListener(li.return,Y),y.removeEventListener("pointermove",Ee,{capture:!0}),y.removeEventListener("pointerleave",_e),window.removeEventListener("blur",Xe),window.removeEventListener("scroll",Re),window.removeEventListener("resize",ce),document.removeEventListener("visibilitychange",Ne),this._reducedMotionQuery?.removeEventListener?.("change",we)}}_updateShape(){let y=this.input.shape;if(this.shapeDef?.native){this._sample=null,this._shapeDirty=!1,y.id=null,y.samples=null,y.strength=0,this.input.progress=0,this.input.scatterProgress=0,this.input.tiltProgress=0,this.input.starsOpacity=1;return}this._shapeDirty&&(this._sample=nt(this.target,`${this.shapeId}:${this._shapeVersion}`),this._shapeDirty=!1);let _=this.host.getBoundingClientRect(),D=Math.max(window.innerHeight||1,1),k=window.scrollY||0;this.input.scrolling=k!==this._lastScrollY,this._lastScrollY=k,this.input.progress=this.options.transform==="scroll"&&this.options.parallax?1+Math.max(0,k)/Math.max(1,this.config.scrollDisperseDistance):1;let z=0,J=this.options.transform;if(this.reducedMotion)z=1;else if(J==="off")z=this._replayUntil&&performance.now()<this._replayUntil?0:1;else if(J==="load")!this._gathered&&this._frames>1&&(this._visibleRatio??0)>=.2&&!(this._replayUntil&&performance.now()<this._replayUntil)&&(this._gathered=!0),z=this._gathered?1:0;else{let ce=this._scrollProgress??(k+D-(_.top+k))/Math.max(D+_.height,1),Ne=this.options.scroll?.gather??[0,.36],we=this.options.scroll?.disperse??[.5,.86],ye=this.options.holdAtEnd?1:1-ee(ce,...we);z=ee(ce,...Ne)*ye}if(y.strength=this._sample?z:0,!this._sample)return;let Y=t(this.options.padding,0,.45),ge=Math.max(_.width*(1-2*Y),1),Ee=Math.max(_.height*(1-2*Y),1),_e=this._sample.aspectRatio,Xe=ge/Math.max(Ee,1)>_e?Ee*_e:ge,Re=Xe/_e;y.centerNdc.x=0,y.centerNdc.y=0,y.sizeNdc.x=Xe/Math.max(_.width,1)*2,y.sizeNdc.y=Re/Math.max(_.height,1)*2,y.id=this._sample.id,y.samples=this._sample.samples}_schedule(){this._raf===null&&!this._disposed&&document.visibilityState!=="hidden"&&(this._raf=requestAnimationFrame(y=>this._tick(y)))}_tick(y){this._raf=null;let _=this._lastTime===null?0:t((y-this._lastTime)/1e3,0,.05);this._lastTime=y,this.step(_),this._visible&&!this.reducedMotion&&this.config.animationPlaying||this._needsFrame?this._schedule():this._lastTime=null}step(y){if(this._needsFrame=!1,!this.renderer||!this.animation)return!1;if(this._sizeDirty){let k=this.canvas.getBoundingClientRect();if(k.width>0&&k.height>0){let z=Math.max(1,Math.floor(k.width)),J=Math.max(1,Math.floor(k.height)),Y=window.devicePixelRatio;(this.size.width!==z||this.size.height!==J||this._lastDpr!==Y)&&(this.size.width=z,this.size.height=J,this._lastDpr=Y,this.renderer.resize(z,J,Y),this.input.pointer.reset=!0),this._sizeDirty=!1}else return!1}this._updateShape(),this._frames+=1;let _=this.reducedMotion||!this.config.animationPlaying?0:y,D=Vf({state:this.animation,config:this.config,input:this.input,camera:this.renderer.camera,animationRoot:this.renderer.animationRoot,spinRoot:this.renderer.spinRoot,field:this.renderer.field,viewport:this.size},_,this.reducedMotion?0:y);return this.renderer.render(_,this.animation,this.config,this.reducedMotion),(D||this._replayUntil&&performance.now()<this._replayUntil+50)&&(this._needsFrame=!0),D}};Mu(kr,"shapes",S),Mu(kr,"palettes",m),Mu(kr,"instances",new Set);let ot=kr;ot.FIELD_KEYS=new Set(["stars.density","stars.size","stars.scatter","stars.densityFalloff","rotationDepth","orbitalDust.enabled","orbitalDust.density","showCenterCluster","colorMode","animationPreset"]);let on={shape:"shape",transform:"transform",interaction:"interaction",palette:"palette",background:"background",label:"interactionLabel"},kt={"auto-rotate":"autoRotate",ambient:"ambient","hold-at-end":"holdAtEnd",parallax:"parallax"};class Ln extends HTMLElement{static get observedAttributes(){return[...Object.keys(on),...Object.keys(kt),"padding"]}connectedCallback(){if(this.cue)return;let y={};for(let[D,k]of Object.entries(on))this.hasAttribute(D)&&(y[k]=this.getAttribute(D));for(let[D,k]of Object.entries(kt))this.hasAttribute(D)&&(y[k]=this.getAttribute(D)!=="false");this.hasAttribute("padding")&&(y.padding=Number(this.getAttribute("padding")));let _=this.querySelector(":scope > svg");_&&!y.shape&&(y.shape=_.outerHTML),this.cue=new ra(this,vv(this,y))}disconnectedCallback(){this.cue?.dispose(),this.cue=null}attributeChangedCallback(y,_,D){!this.cue||_===D||(y==="shape"?this.cue.setShape(D):y==="transform"?this.cue.setTransform(D):y==="palette"?this.cue.setPalette(D):y==="background"?this.cue.setBackground(D):y==="interaction"?(this.cue.config.interactionMode=D,this.cue.invalidate()):y==="auto-rotate"?(this.cue.config.pathShapeAutoRotate=D!=="false",this.cue.invalidate()):y==="ambient"?this.cue.setAmbient(D!=="false"):y==="hold-at-end"?(this.cue.options.holdAtEnd=D!=="false",this.cue.invalidate()):y==="parallax"?(this.cue.options.parallax=D!=="false",this.cue.invalidate()):y==="padding"&&(this.cue.options.padding=Number(D),this.cue.invalidate()))}}function Or(v,y){let _=v.config,D=(z,J,Y,ge,Ee,_e)=>`<label class="astra-range">${J} <span data-out="${z}">${_e}</span><input type="range" data-key="${z}" min="${Y}" max="${ge}" step="${Ee}" value="${_e}"></label>`,k=(z,J,Y)=>`<label class="astra-check"><input type="checkbox" data-key="${z}"${Y?" checked":""}> ${J}</label>`;y.innerHTML=`
4846
+ `;function jt(){if(document.getElementById("astra-shape-cue-styles"))return;let v=document.createElement("style");v.id="astra-shape-cue-styles",v.textContent=rn,document.head.appendChild(v)}let kr=class kr{constructor(y,_={}){if(!y||y.nodeType!==1||typeof y.appendChild!="function"||typeof y.getBoundingClientRect!="function")throw new Error("AstraShapeCue needs a host element.");if(jt(),this.host=y,this.options={...Mt,..._},this.config=Yt(x(),this.options.config),this.config.interactionMode=this.options.interaction,this.config.pathShapeAutoRotate=this.options.autoRotate,this.options.palette!==this.config.colorPalette){let D=m.find(k=>k.id===this.options.palette);D&&(this.config.colorPalette=D.id,this.config.colorPaletteColors=[...D.colors])}this._reducedMotionQuery=window.matchMedia?.("(prefers-reduced-motion: reduce)"),this.reducedMotion=!!this._reducedMotionQuery?.matches,this.profile=sr(this.options.tier,this.reducedMotion),this.input={contentBounds:{left:.5,right:.5},heroViewportHeight:null,reducedMotion:this.reducedMotion,progress:1,scatterProgress:1,tiltProgress:1,starsOpacity:1,scrolling:!1,returning:!1,rotation:{x:0,y:0},pointer:{active:!1,pressed:!1,reset:!1,x:0,y:0},shape:{centerNdc:{x:0,y:0},id:null,samples:null,sizeNdc:{x:0,y:0},strength:0}},this.size={width:1,height:1},this.renderer=null,this.animation=null,this.status="loading",this._raf=null,this._lastTime=null,this._needsFrame=!0,this._sizeDirty=!0,this._lastDpr=0,this._shapeDirty=!0,this._shapeVersion=0,this._sample=null,this._visible=!1,this._gathered=!1,this._frames=0,this._disposed=!1,this._lastScrollY=NaN,this._cachedRect=null,this._buildDom(),this._bindEvents(),this.setShape(this.options.shape),this._buildRenderer(),kr.instances.add(this)}_buildDom(){let y=this.host;y.classList.add("astra-cue"),y.dataset.astraCue="",getComputedStyle(y).position==="static"&&(y.style.position="relative"),y.style.setProperty("--astra-cue-background",this.options.background),this.canvas=document.createElement("canvas"),this.canvas.className="astra-cue-canvas",this.canvas.setAttribute("aria-hidden","true"),this.ambient=document.createElement("div"),this.ambient.className="astra-cue-ambient",this.ambient.setAttribute("aria-hidden","true"),this.ambient.style.setProperty("--astra-ambient-color",g.background.ambientColor),this.ambient.style.setProperty("--astra-ambient-fade-duration",`${this.config.convergeDuration}s`),this.ambient.style.setProperty("--astra-ambient-opacity",String(g.background.ambientOpacity)),this.ambient.hidden=!this.options.ambient,this.vignette=document.createElement("div"),this.vignette.className="astra-cue-vignette",this.vignette.setAttribute("aria-hidden","true"),this.vignette.hidden=!this.options.ambient,this.target=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.target.setAttribute("class","astra-shapeTarget"),this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("fill","none"),this.button=document.createElement("button"),this.button.type="button",this.button.className="astra-dragSurface",this.button.dataset.dragging="false",y.replaceChildren(this.canvas,this.ambient,this.vignette,this.target,this.button),this._unbindDrag=mt(this.button,y)}_renderTarget(y,_){let D="http://www.w3.org/2000/svg";this.target.setAttribute("viewBox",`0 0 ${_.width} ${_.height}`),_.markup?this.target.innerHTML=_.markup:this.target.replaceChildren(..._.paths.map(k=>{let z=document.createElementNS(D,"path");return z.setAttribute("d",k),z.setAttribute("stroke","currentColor"),z.setAttribute("stroke-width",String(_.strokeWidth??1)),z})),this.button.setAttribute("aria-label",this.options.interactionLabel??`Drag or use arrow keys to rotate the ${(_.label??"shape").toLowerCase()}`),this.host.dataset.astraPathShape=y}setShape(y){let{id:_,def:D}=fn(y);return this.shapeId=_,this.shapeDef=D,this._renderTarget(_,D),this._shapeVersion+=1,this._shapeDirty=!0,this.invalidate(),this}setTransform(y){if(!["scroll","load","off"].includes(y))throw new Error(`transform must be scroll | load | off (got ${y})`);return this.options.transform=y,this._gathered=!1,this.invalidate(),this}replay(){return this._gathered=!1,this._replayUntil=performance.now()+250,this.host.dispatchEvent(new Event(li.replay)),this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate(),this}rotate(y,_){return this.host.dispatchEvent(new CustomEvent(li.rotate,{detail:{x:y,y:_}})),this}set(y,_){let D=y.split("."),k=D.pop(),z=D.reduce((J,Y)=>J[Y],this.config);return z[k]=_,kr.FIELD_KEYS.has(y)?this.rebuild():this.invalidate(),this}setPalette(y){let _=m.find(D=>D.id===y);if(!_)throw new Error(`Unknown palette ${y}`);return this.options.palette=y,this.config.colorPalette=_.id,this.config.colorPaletteColors=[..._.colors],this.rebuild(),this}setBackground(y){let _=this.options.background==="transparent";return this.options.background=y,this.host.style.setProperty("--astra-cue-background",y),_!==(y==="transparent")&&this.rebuild(),this}setAmbient(y){return this.options.ambient=y,this.ambient.hidden=!y,this.vignette.hidden=!y,this}rebuild(){return clearTimeout(this._rebuildTimer),this._rebuildTimer=setTimeout(()=>this._buildRenderer(),60),this}invalidate(){this._needsFrame=!0,this._schedule()}dispose(){this._disposed||(this._disposed=!0,this._raf!==null&&cancelAnimationFrame(this._raf),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._unbind?.(),this._unbindDrag?.(),clearTimeout(this._rebuildTimer),this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null,this.host.replaceChildren(),this.host.classList.remove("astra-cue"),kr.instances.delete(this))}_buildRenderer(){if(!this._disposed){this.animation?.dispose(),this.animation=null,this.renderer?.dispose(),this.renderer=null;try{this.renderer=hu(this.canvas,this.config,this.profile,{invalidate:()=>this.invalidate(),transparent:this.options.background==="transparent"}),this.animation=Hf(this.config,1),this.status="ready",this._sizeDirty=!0,this._frames=0,this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="ready"}catch(y){console.error(y),this.status="error",this.host.dataset.astraStatic="false",this.host.dataset.astraStatus="error"}this.invalidate()}}_bindEvents(){let y=this.host,_=()=>{let ye=this.input.pointer;ye.active=!1,ye.pressed=!1,ye.reset=!0},D=(ye,ze,st)=>{if(this.reducedMotion){_(),this.invalidate();return}let ht=this._cachedRect??(()=>{let en=this.canvas.getBoundingClientRect();return en.width>0&&en.height>0?en:null})();if(!ht)return;this._cachedRect=ht;let Tt=Le((ye-ht.left)/ht.width*2-1),It=Le(-((ze-ht.top)/ht.height*2-1)),Et=this.input.pointer;(!Et.active||Et.pressed!==st||Et.reset||Et.x!==Tt||Et.y!==It)&&(Et.active=!0,Et.pressed=st,Et.reset=!1,Et.x=Tt,Et.y=It,this.invalidate())},k=(ye=!1)=>{let ze=this.input.pointer,st=ze.reset||ye;(ze.active||ze.pressed||ze.reset!==st)&&(ze.active=!1,ze.pressed=!1,ze.reset=st,this.invalidate())},z=ye=>{let ze=ye.detail;if(ze){if(!ze.active||this.reducedMotion){k(this.reducedMotion);return}D(ze.clientX,ze.clientY,ze.pressed===!0)}},J=ye=>{if(this.reducedMotion)return;let ze=ye.detail;ze&&(this.input.rotation.x=ie(this.input.rotation.x+ze.y),this.input.rotation.y=ie(this.input.rotation.y+ze.x),this.input.returning=!1,this.invalidate())},Y=()=>{this.config.faceForward&&(this.input.rotation.x=0,this.input.rotation.y=0,this.input.returning=!0,this.invalidate())},ge=ye=>ye.isPrimary&&(ye.pointerType==="mouse"||ye.pointerType==="pen"),Ee=ye=>{ge(ye)&&ye.buttons===0&&D(ye.clientX,ye.clientY,!1)},_e=ye=>{ge(ye)&&k()},Xe=()=>k(!0),Re=()=>{(this.options.transform==="scroll"||this.options.transform==="load")&&(this._cachedRect=null,this.invalidate())},ce=()=>{this._sizeDirty=!0,this._cachedRect=null,this._shapeDirty=!0,this.invalidate()},Ne=()=>{document.visibilityState==="hidden"?_():(this._lastTime=null,this.invalidate())},we=ye=>{this.reducedMotion=ye.matches,this.input.reducedMotion=ye.matches,ye.matches&&_(),this.invalidate()};y.addEventListener(li.pointer,z),y.addEventListener(li.rotate,J),y.addEventListener(li.return,Y),y.addEventListener("pointermove",Ee,{capture:!0,passive:!0}),y.addEventListener("pointerleave",_e,{passive:!0}),window.addEventListener("blur",Xe),window.addEventListener("scroll",Re,{passive:!0}),window.addEventListener("resize",ce,{passive:!0}),document.addEventListener("visibilitychange",Ne),this._reducedMotionQuery?.addEventListener?.("change",we),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(ce),this._resizeObserver.observe(y)),typeof IntersectionObserver<"u"?(this._intersection=new IntersectionObserver(ye=>{for(let ze of ye)this._visible=ze.isIntersecting,this._visibleRatio=ze.intersectionRatio;this._visible&&(this._lastTime=null,this.invalidate())},{rootMargin:"120px",threshold:[0,.2,.5]}),this._intersection.observe(y)):this._visible=!0,this._unbind=()=>{y.removeEventListener(li.pointer,z),y.removeEventListener(li.rotate,J),y.removeEventListener(li.return,Y),y.removeEventListener("pointermove",Ee,{capture:!0}),y.removeEventListener("pointerleave",_e),window.removeEventListener("blur",Xe),window.removeEventListener("scroll",Re),window.removeEventListener("resize",ce),document.removeEventListener("visibilitychange",Ne),this._reducedMotionQuery?.removeEventListener?.("change",we)}}_updateShape(){let y=this.input.shape;if(this.shapeDef?.native){this._sample=null,this._shapeDirty=!1,y.id=null,y.samples=null,y.strength=0,this.input.progress=0,this.input.scatterProgress=0,this.input.tiltProgress=0,this.input.starsOpacity=1;return}this._shapeDirty&&(this._sample=nt(this.target,`${this.shapeId}:${this._shapeVersion}`),this._shapeDirty=!1);let _=this.host.getBoundingClientRect(),D=Math.max(window.innerHeight||1,1),k=window.scrollY||0;this.input.scrolling=k!==this._lastScrollY,this._lastScrollY=k,this.input.progress=this.options.transform==="scroll"&&this.options.parallax?1+Math.max(0,k)/Math.max(1,this.config.scrollDisperseDistance):1;let z=0,J=this.options.transform;if(this.reducedMotion)z=1;else if(J==="off")z=this._replayUntil&&performance.now()<this._replayUntil?0:1;else if(J==="load")!this._gathered&&this._frames>1&&(this._visibleRatio??0)>=.2&&!(this._replayUntil&&performance.now()<this._replayUntil)&&(this._gathered=!0),z=this._gathered?1:0;else{let ce=this._scrollProgress??(k+D-(_.top+k))/Math.max(D+_.height,1),Ne=this.options.scroll?.gather??[0,.36],we=this.options.scroll?.disperse??[.5,.86],ye=this.options.holdAtEnd?1:1-ee(ce,...we);z=ee(ce,...Ne)*ye}if(y.strength=this._sample?z:0,!this._sample)return;let Y=t(this.options.padding,0,.45),ge=Math.max(_.width*(1-2*Y),1),Ee=Math.max(_.height*(1-2*Y),1),_e=this._sample.aspectRatio,Xe=ge/Math.max(Ee,1)>_e?Ee*_e:ge,Re=Xe/_e;y.centerNdc.x=0,y.centerNdc.y=0,y.sizeNdc.x=Xe/Math.max(_.width,1)*2,y.sizeNdc.y=Re/Math.max(_.height,1)*2,y.id=this._sample.id,y.samples=this._sample.samples}_schedule(){this._raf===null&&!this._disposed&&document.visibilityState!=="hidden"&&(this._raf=requestAnimationFrame(y=>this._tick(y)))}_tick(y){this._raf=null;let _=this._lastTime===null?0:t((y-this._lastTime)/1e3,0,.05);this._lastTime=y,this.step(_),this._visible&&!this.reducedMotion&&this.config.animationPlaying||this._needsFrame?this._schedule():this._lastTime=null}step(y){if(this._needsFrame=!1,!this.renderer||!this.animation)return!1;if(this._sizeDirty){let k=this.canvas.getBoundingClientRect();if(k.width>0&&k.height>0){let z=Math.max(1,Math.floor(k.width)),J=Math.max(1,Math.floor(k.height)),Y=window.devicePixelRatio;(this.size.width!==z||this.size.height!==J||this._lastDpr!==Y)&&(this.size.width=z,this.size.height=J,this._lastDpr=Y,this.renderer.resize(z,J,Y),this.input.pointer.reset=!0),this._sizeDirty=!1}else return!1}this._updateShape(),this._frames+=1;let _=this.reducedMotion||!this.config.animationPlaying?0:y,D=Vf({state:this.animation,config:this.config,input:this.input,camera:this.renderer.camera,animationRoot:this.renderer.animationRoot,spinRoot:this.renderer.spinRoot,field:this.renderer.field,viewport:this.size},_,this.reducedMotion?0:y);return this.renderer.render(_,this.animation,this.config,this.reducedMotion),(D||this._replayUntil&&performance.now()<this._replayUntil+50)&&(this._needsFrame=!0),D}};Mu(kr,"shapes",S),Mu(kr,"palettes",m),Mu(kr,"instances",new Set);let ot=kr;ot.FIELD_KEYS=new Set(["stars.density","stars.size","stars.scatter","stars.densityFalloff","rotationDepth","orbitalDust.enabled","orbitalDust.density","showCenterCluster","colorMode","animationPreset"]);let on={shape:"shape",transform:"transform",interaction:"interaction",palette:"palette",background:"background",label:"interactionLabel"},kt={"auto-rotate":"autoRotate",ambient:"ambient","hold-at-end":"holdAtEnd",parallax:"parallax"};class Ln extends HTMLElement{static get observedAttributes(){return[...Object.keys(on),...Object.keys(kt),"padding"]}connectedCallback(){if(this.cue)return;let y={};for(let[D,k]of Object.entries(on))this.hasAttribute(D)&&(y[k]=this.getAttribute(D));for(let[D,k]of Object.entries(kt))this.hasAttribute(D)&&(y[k]=this.getAttribute(D)!=="false");this.hasAttribute("padding")&&(y.padding=Number(this.getAttribute("padding")));let _=this.querySelector(":scope > svg");_&&!y.shape&&(y.shape=_.outerHTML),this.cue=new ra(this,vv(this,y))}disconnectedCallback(){this.cue?.dispose(),this.cue=null}attributeChangedCallback(y,_,D){!this.cue||_===D||(y==="shape"?this.cue.setShape(D):y==="transform"?this.cue.setTransform(D):y==="palette"?this.cue.setPalette(D):y==="background"?this.cue.setBackground(D):y==="interaction"?(this.cue.config.interactionMode=D,this.cue.invalidate()):y==="auto-rotate"?(this.cue.config.pathShapeAutoRotate=D!=="false",this.cue.invalidate()):y==="ambient"?this.cue.setAmbient(D!=="false"):y==="hold-at-end"?(this.cue.options.holdAtEnd=D!=="false",this.cue.invalidate()):y==="parallax"?(this.cue.options.parallax=D!=="false",this.cue.invalidate()):y==="padding"&&(this.cue.options.padding=Number(D),this.cue.invalidate()))}}function Or(v,y){let _=v.config,D=(z,J,Y,ge,Ee,_e)=>`<label class="astra-range">${J} <span data-out="${z}">${_e}</span><input type="range" data-key="${z}" min="${Y}" max="${ge}" step="${Ee}" value="${_e}"></label>`,k=(z,J,Y)=>`<label class="astra-check"><input type="checkbox" data-key="${z}"${Y?" checked":""}> ${J}</label>`;y.innerHTML=`
4847
4847
  <header><strong>Shape Cue by UX Pilot</strong><button type="button" class="astra-panel-toggle" aria-expanded="true" aria-label="Collapse panel">\u2013</button></header>
4848
4848
  <div class="astra-panel-body">
4849
4849
  <label>Shape <select data-key="shape">${Object.entries(S).map(([z,J])=>`<option value="${z}"${z===v.shapeId?" selected":""}>${J.label}</option>`).join("")}</select></label>
@@ -4873,4 +4873,4 @@ astra-shape-cue { display: block; }
4873
4873
  ${k("orbitalDust.enabled","Orbital dust",_.orbitalDust.enabled)}
4874
4874
  ${k("showCenterCluster","Center cluster",_.showCenterCluster)}
4875
4875
  <div class="astra-actions"><button type="button" data-action="replay">Replay gather</button></div>
4876
- </div>`,y.addEventListener("input",z=>{let J=z.target,Y=J.dataset.key;if(!Y||Y==="customSvgFile")return;let ge=y.querySelector(`[data-out="${Y}"]`);Y==="shape"?J.value!=="custom"&&v.setShape(J.value):Y==="transform"?v.setTransform(J.value):Y==="palette"?v.setPalette(J.value):Y==="background"?v.setBackground(J.value):Y==="interactionMode"?v.update({interaction:J.value}):Y==="ambient"?v.setAmbient(J.checked):Y==="holdAtEnd"||Y==="parallax"?v.update({[Y]:J.checked}):Y==="padding"?v.update({padding:Number(J.value)}):J.type==="checkbox"?v.set(Y,J.checked):(v.set(Y,Number(J.value)),ge&&(ge.textContent=J.value))}),y.addEventListener("change",async z=>{let J=z.target;if(J?.dataset.key!=="customSvgFile")return;let Y=y.querySelector('[data-key="customError"]'),ge=J.files?.[0];if(ge){if(!ge.name.toLowerCase().endsWith(".svg")&&ge.type!=="image/svg+xml"){Y.textContent="Choose an SVG file.",J.value="";return}if(ge.size>2*1024*1024){Y.textContent="SVG files must be 2 MB or smaller.",J.value="";return}try{await v.loadSVG(ge),y.querySelector('select[data-key="shape"]').value="custom",Y.textContent=""}catch(Ee){Y.textContent=Ee.message}}}),y.addEventListener("click",z=>{z.target.closest("[data-action]")?.dataset.action==="replay"&&v.replay(),z.target.closest("[data-upload-svg]")&&y.querySelector('input[data-key="customSvgFile"]').click();let Y=z.target.closest(".astra-panel-toggle");if(Y){let ge=y.querySelector(".astra-panel-body");ge.hidden=!ge.hidden,Y.textContent=ge.hidden?"+":"\u2013",Y.setAttribute("aria-expanded",String(!ge.hidden))}})}let Un=(v,y)=>Object.prototype.hasOwnProperty.call(v,y),or=(v,y)=>JSON.stringify(v)===JSON.stringify(y),$t=(v,y)=>{if(!v||typeof v!="object"||Array.isArray(v))throw new TypeError(`${y} must be an object.`)},wn=(v,y,_,D)=>{if(typeof v!="number"||!Number.isFinite(v)||v<y||v>_)throw new RangeError(`${D} must be a number from ${y} to ${_}.`);return v};function jn(v){if(!Array.isArray(v)||v.length<1||v.length>8||v.some(y=>typeof y!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{6})$/i.test(y)))throw new TypeError('colors must contain 1\u20138 hex colors, such as ["#9b87ff", "#47e2c2"].');return v.slice()}function Bn(v,y=x(),_="config"){$t(v,_);let D={};for(let[k,z]of Object.entries(v)){if(!Un(y,k)||["__proto__","prototype","constructor"].includes(k))throw new TypeError(`Unknown setting: ${_}.${k}`);let J=y[k];if(Array.isArray(J))D[k]=jn(z);else if(J&&typeof J=="object")D[k]=Bn(z,J,`${_}.${k}`);else{if(typeof z!=typeof J||typeof z=="number"&&!Number.isFinite(z))throw new TypeError(`Invalid value for ${_}.${k}`);D[k]=z}let Y=_==="config"?k:_.slice(7)+"."+k,ge=lm.find(_e=>_e.optionPath==="config."+Y&&_e.kind==="range");ge&&wn(z,ge.min,ge.max,_+"."+k);let Ee={animationPreset:["none","converge-tilt","legacy-zoom","grow","accretion-exhale"],interactionMode:["rotate","depth-lens","none"],colorPalette:[...m.map(_e=>_e.id),"custom"]};if(Un(Ee,Y)&&!Ee[Y].includes(z))throw new TypeError(`Unknown ${Y}: ${z}`)}return D}function qn(v){$t(v,"options");let y={},_=v.config===void 0?{}:Bn(v.config),D=new Set([...Object.keys(Mt),"colors","particles","animation","bloom","scroll"]);for(let k of Object.keys(v))if(!D.has(k))throw new TypeError(`Unknown option: ${k}`);for(let k of Object.keys(Mt)){if(k==="config"||v[k]===void 0)continue;let z=v[k];if(typeof Mt[k]=="boolean"&&typeof z!="boolean")throw new TypeError(`${k} must be true or false.`);y[k]=z}y.shape!==void 0&&fn(y.shape);for(let[k,z]of Object.entries({transform:["load","scroll","off"],interaction:["rotate","depth-lens","none"],palette:m.map(J=>J.id)}))if(y[k]!==void 0&&!z.includes(y[k]))throw new TypeError(`${k} must be one of: ${z.join(", ")}.`);if(y.padding!==void 0&&wn(y.padding,0,.45,"padding"),y.tier!==void 0&&![0,1,2,3].includes(y.tier))throw new RangeError("tier must be 0, 1, 2, or 3.");if(y.background!==void 0&&(typeof y.background!="string"||!CSS.supports("color",y.background)))throw new TypeError("background must be a CSS color or transparent.");if(v.scroll!==void 0){$t(v.scroll,"scroll"),y.scroll={};for(let[k,z]of Object.entries(v.scroll)){if(!["gather","disperse"].includes(k)||!Array.isArray(z)||z.length!==2)throw new TypeError("scroll ranges must be gather/disperse: [start, end].");if(z.forEach(J=>wn(J,0,1,"scroll."+k)),z[0]>=z[1])throw new RangeError("Scroll range start must be less than its end.");y.scroll[k]=z.slice()}}if(v.particles!==void 0){$t(v.particles,"particles");let k={density:[.25,4],size:[.25,3],intensity:[.1,3],scatter:[0,.45],twinkle:[0,2]};_.stars={..._.stars};for(let[z,J]of Object.entries(v.particles)){if(!Un(k,z))throw new TypeError(`Unknown particle setting: ${z}`);_.stars[z==="twinkle"?"twinkleSpeed":z]=wn(J,...k[z],`particles.${z}`)}}if(v.animation!==void 0){$t(v.animation,"animation");for(let Y of Object.keys(v.animation))if(!["speed","duration","playing"].includes(Y))throw new TypeError(`Unknown animation setting: ${Y}`);let{speed:k,duration:z,playing:J}=v.animation;if(k!==void 0&&(_.stars={..._.stars,flowSpeed:wn(k,0,3,"animation.speed")}),z!==void 0&&(_.convergeDuration=wn(z,1,10,"animation.duration")),J!==void 0){if(typeof J!="boolean")throw new TypeError("animation.playing must be true or false.");_.animationPlaying=J}}return v.bloom!==void 0&&(_.bloomIntensity=wn(v.bloom,0,2,"bloom")),v.colors!==void 0&&(v.colors===null?y.palette=y.palette??Mt.palette:(_.colorMode=!0,_.colorPalette="custom",_.colorPaletteColors=jn(v.colors))),y.interaction!==void 0&&(_.interactionMode=y.interaction),y.autoRotate!==void 0&&(_.pathShapeAutoRotate=y.autoRotate),y.palette!==void 0&&v.colors==null&&(_.colorPalette=y.palette,_.colorPaletteColors=m.find(k=>k.id===y.palette).colors.slice()),Object.keys(_).length&&(y.config=_),y}class ra extends ot{constructor(y,_={}){let D=qn(_);D.interaction===void 0&&D.config?.interactionMode!==void 0&&(D.interaction=D.config.interactionMode),D.autoRotate===void 0&&D.config?.pathShapeAutoRotate!==void 0&&(D.autoRotate=D.config.pathShapeAutoRotate),D.config?.colorPalette==="custom"?D.palette="custom":D.palette===void 0&&D.config?.colorPalette!==void 0&&(D.palette=D.config.colorPalette),super(y,D),this._lastSettingsHash=JSON.stringify(this.getOptions())}update(y={}){if(this._disposed)throw new Error("Cannot update a disposed cue.");let _=qn(y);_.shape!==void 0&&!or(_.shape,this.options.shape)&&this.setShape(_.shape),_.transform!==void 0&&_.transform!==this.options.transform&&this.setTransform(_.transform),_.palette!==void 0&&_.config?.colorPalette!=="custom"&&(this.config.colorPalette!==_.palette||!or(this.config.colorPaletteColors,m.find(k=>k.id===_.palette).colors))&&this.setPalette(_.palette),_.background!==void 0&&_.background!==this.options.background&&this.setBackground(_.background),_.ambient!==void 0&&_.ambient!==this.options.ambient&&this.setAmbient(_.ambient);for(let k of["padding","parallax","holdAtEnd","autoRotate","interaction","interactionLabel"])_[k]===void 0||or(_[k],this.options[k])||(this.options[k]=_[k],k==="autoRotate"&&(this.config.pathShapeAutoRotate=_[k]),k==="interaction"&&(this.config.interactionMode=_[k]),k==="interactionLabel"&&this.button.setAttribute("aria-label",_[k]),this.invalidate());_.tier!==void 0&&_.tier!==this.options.tier&&(this.options.tier=_.tier,this.profile=sr(_.tier,this.reducedMotion),this.rebuild());let D=(k,z="")=>{for(let[J,Y]of Object.entries(k)){let ge=z?`${z}.${J}`:J;if(Y&&typeof Y=="object"&&!Array.isArray(Y))D(Y,ge);else{let Ee=ge.split(".").reduce((_e,Xe)=>_e[Xe],this.config);or(Ee,Y)||this.set(ge,Y)}}};return _.config&&D(_.config),_.scroll&&(this.options.scroll={...this.options.scroll,..._.scroll},this.invalidate()),this._notify(),this}setShape(y){return super.setShape(y),this._svgRequest=(this._svgRequest??0)+1,this.options.shape=y,this._notify(),this}set(y,_){let D=y.split("."),k=x();for(let J of D){if(!k||!Un(k,J)||["__proto__","prototype","constructor"].includes(J))throw new TypeError(`Unknown setting: ${y}`);k=k[J]}if(Array.isArray(k))jn(_);else if(typeof k!=typeof _||typeof _=="object"||typeof _=="number"&&!Number.isFinite(_))throw new TypeError(`Invalid value for ${y}`);let z=D.reduceRight((J,Y)=>({[Y]:J}),_);return Bn(z),super.set(y,Array.isArray(_)?_.slice():_),["colorPalette","colorPaletteColors"].includes(y)&&this.rebuild(),this._notify(),this}getOptions(){let y={};for(let _ of Object.keys(Mt))_!=="config"&&(y[_]=this.options[_]);return y.interaction=this.config.interactionMode,y.autoRotate=this.config.pathShapeAutoRotate,y.palette=m.some(_=>_.id===this.config.colorPalette)?this.config.colorPalette:Mt.palette,this.config.colorPalette==="custom"&&(y.colors=this.config.colorPaletteColors),y.config=this.config,y.scroll={gather:[0,.36],disperse:[.5,.86],...this.options.scroll},JSON.parse(JSON.stringify(y))}onChange(y){if(typeof y!="function")throw new TypeError("onChange expects a function.");let _=()=>y(this.getOptions());return this.host.addEventListener("shape-cue:change",_),()=>this.host.removeEventListener("shape-cue:change",_)}_notify(){this._disposed||!this.host||this._notifyQueued||(this._notifyQueued=!0,queueMicrotask(()=>{if(this._notifyQueued=!1,this._disposed)return;let y=this.getOptions(),_=JSON.stringify(y);_!==this._lastSettingsHash&&(this._lastSettingsHash=_,this.host.dispatchEvent(new CustomEvent("shape-cue:change",{detail:y})))}))}setTransform(y){return super.setTransform(y),this._notify(),this}setPalette(y){return super.setPalette(y),this._notify(),this}setBackground(y){return super.setBackground(y),this._notify(),this}setAmbient(y){return super.setAmbient(y),this._notify(),this}setScrollProgress(y){return y!==null&&wn(y,0,1,"scroll progress"),this._scrollProgress=y,this.input.pointer.reset=!0,this.invalidate(),this}async loadSVG(y){let _=(this._svgRequest??0)+1;this._svgRequest=_;let D;if(typeof y=="string"){if(!y.trim().startsWith("<"))throw new TypeError("loadSVG expects SVG markup or a File, not a URL.");if(new TextEncoder().encode(y).length>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=y}else if(y instanceof Blob){if(y.size>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=await y.text()}else throw new TypeError("loadSVG expects SVG markup, a File, or a Blob.");return this._disposed||_!==this._svgRequest?this:(this.setShape(D),this)}setColors(y){return this.update({colors:y})}pause(){return this.update({animation:{playing:!1}})}play(){return this.update({animation:{playing:!0}})}}let Ii={colors:v=>({colors:v===null?null:v.trim().split(/[\s,]+/)}),speed:v=>({animation:{speed:v===null?.8:Number(v)}}),"gather-duration":v=>({animation:{duration:v===null?5.5:Number(v)}}),paused:v=>({animation:{playing:v===null||v==="false"}}),bloom:v=>({bloom:v===null?.7:Number(v)}),"particle-density":v=>({particles:{density:v===null?4:Number(v)}}),"particle-size":v=>({particles:{size:v===null?2.05:Number(v)}})};function vv(v,y){let _={...y};for(let[D,k]of Object.entries(Ii)){if(!v.hasAttribute(D))continue;let z=k(v.getAttribute(D));for(let[J,Y]of Object.entries(z))_[J]=Y&&typeof Y=="object"&&!Array.isArray(Y)?{..._[J],...Y}:Y}return _}let xv=Ln.observedAttributes;Object.defineProperty(Ln,"observedAttributes",{get:()=>[...xv,...Object.keys(Ii)]});let yv=Ln.prototype.attributeChangedCallback;return Ln.prototype.attributeChangedCallback=function(v,y,_){Un(Ii,v)?this.cue&&y!==_&&this.cue.update(Ii[v](_)):(yv.call(this,v,y,_),this.cue&&y!==_&&this.cue._notify())},window[r]={AstraShapeCue:ra,AstraShapeCueElement:Ln,createComponentPanel:Or}}function BT(){let r=cm();customElements.get("astra-shape-cue")||customElements.define("astra-shape-cue",r.AstraShapeCueElement)}function FT(r,e={}){let t=cm();return new t.AstraShapeCue(r,e)}function NT(r,e){let t=cm();if(!(e instanceof HTMLElement))throw new Error("Controls require a host element.");let n=document.createElement("aside");n.className="astra-panel",n.setAttribute("aria-label","Shape Cue controls"),e.appendChild(n),t.createComponentPanel(r,n);let i=()=>{let a=r.getOptions();for(let o of lm){let l=[...n.querySelectorAll("[data-key]")].find(h=>h.dataset.key===o.key);if(!l)continue;let c=o.optionPath.split(".").reduce((h,f)=>h?.[f],a);if(o.key==="shape"&&(c=r.shapeId),o.key==="palette"&&a.colors&&(c="custom"),l.tagName==="SELECT"&&![...l.options].some(h=>h.value===String(c))){let h=document.createElement("option");h.value=String(c),h.textContent=c==="custom"?"Custom":String(c),h.disabled=!0,l.appendChild(h)}o.kind==="checkbox"?l.checked=!!c:l.value=String(c);let u=[...n.querySelectorAll("[data-out]")].find(h=>h.dataset.out===o.key);u&&(u.textContent=String(c))}};i();let s=r.onChange(i);return()=>{s(),n.remove()}}export{FT as createShapeCue,UT as getControlDefinitions,NT as mountControls,BT as registerShapeCue,mE as version};
4876
+ </div>`,y.addEventListener("input",z=>{let J=z.target,Y=J.dataset.key;if(!Y||Y==="customSvgFile")return;let ge=y.querySelector(`[data-out="${Y}"]`);Y==="shape"?J.value!=="custom"&&v.setShape(J.value):Y==="transform"?v.setTransform(J.value):Y==="palette"?v.setPalette(J.value):Y==="background"?v.setBackground(J.value):Y==="interactionMode"?v.update({interaction:J.value}):Y==="ambient"?v.setAmbient(J.checked):Y==="holdAtEnd"||Y==="parallax"?v.update({[Y]:J.checked}):Y==="padding"?v.update({padding:Number(J.value)}):J.type==="checkbox"?v.set(Y,J.checked):(v.set(Y,Number(J.value)),ge&&(ge.textContent=J.value))}),y.addEventListener("change",async z=>{let J=z.target;if(J?.dataset.key!=="customSvgFile")return;let Y=y.querySelector('[data-key="customError"]'),ge=J.files?.[0];if(ge){if(!ge.name.toLowerCase().endsWith(".svg")&&ge.type!=="image/svg+xml"){Y.textContent="Choose an SVG file.",J.value="";return}if(ge.size>2*1024*1024){Y.textContent="SVG files must be 2 MB or smaller.",J.value="";return}try{await v.loadSVG(ge),y.querySelector('select[data-key="shape"]').value="custom",Y.textContent=""}catch(Ee){Y.textContent=Ee.message}}}),y.addEventListener("click",z=>{z.target.closest("[data-action]")?.dataset.action==="replay"&&v.replay(),z.target.closest("[data-upload-svg]")&&y.querySelector('input[data-key="customSvgFile"]').click();let Y=z.target.closest(".astra-panel-toggle");if(Y){let ge=y.querySelector(".astra-panel-body");ge.hidden=!ge.hidden,Y.textContent=ge.hidden?"+":"\u2013",Y.setAttribute("aria-expanded",String(!ge.hidden))}})}let Un=(v,y)=>Object.prototype.hasOwnProperty.call(v,y),or=(v,y)=>JSON.stringify(v)===JSON.stringify(y),$t=(v,y)=>{if(!v||typeof v!="object"||Array.isArray(v))throw new TypeError(`${y} must be an object.`)},wn=(v,y,_,D)=>{if(typeof v!="number"||!Number.isFinite(v)||v<y||v>_)throw new RangeError(`${D} must be a number from ${y} to ${_}.`);return v};function jn(v){if(!Array.isArray(v)||v.length<1||v.length>8||v.some(y=>typeof y!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{6})$/i.test(y)))throw new TypeError('colors must contain 1\u20138 hex colors, such as ["#9b87ff", "#47e2c2"].');return v.slice()}function Bn(v,y=x(),_="config"){$t(v,_);let D={};for(let[k,z]of Object.entries(v)){if(!Un(y,k)||["__proto__","prototype","constructor"].includes(k))throw new TypeError(`Unknown setting: ${_}.${k}`);let J=y[k];if(Array.isArray(J))D[k]=jn(z);else if(J&&typeof J=="object")D[k]=Bn(z,J,`${_}.${k}`);else{if(typeof z!=typeof J||typeof z=="number"&&!Number.isFinite(z))throw new TypeError(`Invalid value for ${_}.${k}`);D[k]=z}let Y=_==="config"?k:_.slice(7)+"."+k,ge=lm.find(_e=>_e.optionPath==="config."+Y&&_e.kind==="range");ge&&wn(z,ge.min,ge.max,_+"."+k);let Ee={animationPreset:["none","converge-tilt","legacy-zoom","grow","accretion-exhale"],interactionMode:["rotate","depth-lens","none"],colorPalette:[...m.map(_e=>_e.id),"custom"]};if(Un(Ee,Y)&&!Ee[Y].includes(z))throw new TypeError(`Unknown ${Y}: ${z}`)}return D}function qn(v){$t(v,"options");let y={},_=v.config===void 0?{}:Bn(v.config),D=new Set([...Object.keys(Mt),"colors","particles","animation","bloom","scroll"]);for(let k of Object.keys(v))if(!D.has(k))throw new TypeError(`Unknown option: ${k}`);for(let k of Object.keys(Mt)){if(k==="config"||v[k]===void 0)continue;let z=v[k];if(typeof Mt[k]=="boolean"&&typeof z!="boolean")throw new TypeError(`${k} must be true or false.`);y[k]=z}y.shape!==void 0&&fn(y.shape);for(let[k,z]of Object.entries({transform:["load","scroll","off"],interaction:["rotate","depth-lens","none"],palette:m.map(J=>J.id)}))if(y[k]!==void 0&&!z.includes(y[k]))throw new TypeError(`${k} must be one of: ${z.join(", ")}.`);if(y.padding!==void 0&&wn(y.padding,0,.45,"padding"),y.tier!==void 0&&![0,1,2,3].includes(y.tier))throw new RangeError("tier must be 0, 1, 2, or 3.");if(y.background!==void 0&&(typeof y.background!="string"||!CSS.supports("color",y.background)))throw new TypeError("background must be a CSS color or transparent.");if(v.scroll!==void 0){$t(v.scroll,"scroll"),y.scroll={};for(let[k,z]of Object.entries(v.scroll)){if(!["gather","disperse"].includes(k)||!Array.isArray(z)||z.length!==2)throw new TypeError("scroll ranges must be gather/disperse: [start, end].");if(z.forEach(J=>wn(J,0,1,"scroll."+k)),z[0]>=z[1])throw new RangeError("Scroll range start must be less than its end.");y.scroll[k]=z.slice()}}if(v.particles!==void 0){$t(v.particles,"particles");let k={density:[.25,4],size:[.25,3],intensity:[.1,3],scatter:[0,.45],twinkle:[0,2]};_.stars={..._.stars};for(let[z,J]of Object.entries(v.particles)){if(!Un(k,z))throw new TypeError(`Unknown particle setting: ${z}`);_.stars[z==="twinkle"?"twinkleSpeed":z]=wn(J,...k[z],`particles.${z}`)}}if(v.animation!==void 0){$t(v.animation,"animation");for(let Y of Object.keys(v.animation))if(!["speed","duration","playing"].includes(Y))throw new TypeError(`Unknown animation setting: ${Y}`);let{speed:k,duration:z,playing:J}=v.animation;if(k!==void 0&&(_.stars={..._.stars,flowSpeed:wn(k,0,3,"animation.speed")}),z!==void 0&&(_.convergeDuration=wn(z,1,10,"animation.duration")),J!==void 0){if(typeof J!="boolean")throw new TypeError("animation.playing must be true or false.");_.animationPlaying=J}}return v.bloom!==void 0&&(_.bloomIntensity=wn(v.bloom,0,2,"bloom")),v.colors!==void 0&&(v.colors===null?y.palette=y.palette??Mt.palette:(_.colorMode=!0,_.colorPalette="custom",_.colorPaletteColors=jn(v.colors))),y.interaction!==void 0&&(_.interactionMode=y.interaction),y.autoRotate!==void 0&&(_.pathShapeAutoRotate=y.autoRotate),y.palette!==void 0&&v.colors==null&&(_.colorPalette=y.palette,_.colorPaletteColors=m.find(k=>k.id===y.palette).colors.slice()),Object.keys(_).length&&(y.config=_),y}class ra extends ot{constructor(y,_={}){let D=qn(_);D.interaction===void 0&&D.config?.interactionMode!==void 0&&(D.interaction=D.config.interactionMode),D.autoRotate===void 0&&D.config?.pathShapeAutoRotate!==void 0&&(D.autoRotate=D.config.pathShapeAutoRotate),D.config?.colorPalette==="custom"?D.palette="custom":D.palette===void 0&&D.config?.colorPalette!==void 0&&(D.palette=D.config.colorPalette),super(y,D),this._lastSettingsHash=JSON.stringify(this.getOptions())}update(y={}){if(this._disposed)throw new Error("Cannot update a disposed cue.");let _=qn(y);_.shape!==void 0&&!or(_.shape,this.options.shape)&&this.setShape(_.shape),_.transform!==void 0&&_.transform!==this.options.transform&&this.setTransform(_.transform),_.palette!==void 0&&_.config?.colorPalette!=="custom"&&(this.config.colorPalette!==_.palette||!or(this.config.colorPaletteColors,m.find(k=>k.id===_.palette).colors))&&this.setPalette(_.palette),_.background!==void 0&&_.background!==this.options.background&&this.setBackground(_.background),_.ambient!==void 0&&_.ambient!==this.options.ambient&&this.setAmbient(_.ambient);for(let k of["padding","parallax","holdAtEnd","autoRotate","interaction","interactionLabel"])_[k]===void 0||or(_[k],this.options[k])||(this.options[k]=_[k],k==="autoRotate"&&(this.config.pathShapeAutoRotate=_[k]),k==="interaction"&&(this.config.interactionMode=_[k]),k==="interactionLabel"&&this.button.setAttribute("aria-label",_[k]),this.invalidate());_.tier!==void 0&&_.tier!==this.options.tier&&(this.options.tier=_.tier,this.profile=sr(_.tier,this.reducedMotion),this.rebuild());let D=(k,z="")=>{for(let[J,Y]of Object.entries(k)){let ge=z?`${z}.${J}`:J;if(Y&&typeof Y=="object"&&!Array.isArray(Y))D(Y,ge);else{let Ee=ge.split(".").reduce((_e,Xe)=>_e[Xe],this.config);or(Ee,Y)||this.set(ge,Y)}}};return _.config&&D(_.config),_.scroll&&(this.options.scroll={...this.options.scroll,..._.scroll},this.invalidate()),this._notify(),this}setShape(y){return super.setShape(y),this._svgRequest=(this._svgRequest??0)+1,this.options.shape=y,this._notify(),this}set(y,_){let D=y.split("."),k=x();for(let J of D){if(!k||!Un(k,J)||["__proto__","prototype","constructor"].includes(J))throw new TypeError(`Unknown setting: ${y}`);k=k[J]}if(Array.isArray(k))jn(_);else if(typeof k!=typeof _||typeof _=="object"||typeof _=="number"&&!Number.isFinite(_))throw new TypeError(`Invalid value for ${y}`);let z=D.reduceRight((J,Y)=>({[Y]:J}),_);return Bn(z),super.set(y,Array.isArray(_)?_.slice():_),["colorPalette","colorPaletteColors"].includes(y)&&this.rebuild(),this._notify(),this}getOptions(){let y={};for(let _ of Object.keys(Mt))_!=="config"&&(y[_]=this.options[_]);return y.interaction=this.config.interactionMode,y.autoRotate=this.config.pathShapeAutoRotate,y.palette=m.some(_=>_.id===this.config.colorPalette)?this.config.colorPalette:Mt.palette,this.config.colorPalette==="custom"&&(y.colors=this.config.colorPaletteColors),y.config=this.config,y.scroll={gather:[0,.36],disperse:[.5,.86],...this.options.scroll},JSON.parse(JSON.stringify(y))}onChange(y){if(typeof y!="function")throw new TypeError("onChange expects a function.");let _=()=>y(this.getOptions());return this.host.addEventListener("shape-cue:change",_),()=>this.host.removeEventListener("shape-cue:change",_)}_notify(){this._disposed||!this.host||this._notifyQueued||(this._notifyQueued=!0,queueMicrotask(()=>{if(this._notifyQueued=!1,this._disposed)return;let y=this.getOptions(),_=JSON.stringify(y);_!==this._lastSettingsHash&&(this._lastSettingsHash=_,this.host.dispatchEvent(new CustomEvent("shape-cue:change",{detail:y})))}))}setTransform(y){return super.setTransform(y),this._notify(),this}setPalette(y){return super.setPalette(y),this._notify(),this}setBackground(y){return super.setBackground(y),this._notify(),this}setAmbient(y){return super.setAmbient(y),this._notify(),this}setScrollProgress(y){return y!==null&&wn(y,0,1,"scroll progress"),this._scrollProgress=y,this.input.pointer.reset=!0,this.invalidate(),this}async loadSVG(y){let _=(this._svgRequest??0)+1;this._svgRequest=_;let D;if(typeof y=="string"){if(!y.trim().startsWith("<"))throw new TypeError("loadSVG expects SVG markup or a File, not a URL.");if(new TextEncoder().encode(y).length>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=y}else if(y&&typeof y=="object"&&typeof y.text=="function"&&typeof y.size=="number"){if(y.size>2*1024*1024)throw new RangeError("SVG files must be 2 MB or smaller.");D=await y.text()}else throw new TypeError("loadSVG expects SVG markup, a File, or a Blob.");return this._disposed||_!==this._svgRequest?this:(this.setShape(D),this)}setColors(y){return this.update({colors:y})}pause(){return this.update({animation:{playing:!1}})}play(){return this.update({animation:{playing:!0}})}}let Ii={colors:v=>({colors:v===null?null:v.trim().split(/[\s,]+/)}),speed:v=>({animation:{speed:v===null?.8:Number(v)}}),"gather-duration":v=>({animation:{duration:v===null?5.5:Number(v)}}),paused:v=>({animation:{playing:v===null||v==="false"}}),bloom:v=>({bloom:v===null?.7:Number(v)}),"particle-density":v=>({particles:{density:v===null?4:Number(v)}}),"particle-size":v=>({particles:{size:v===null?2.05:Number(v)}})};function vv(v,y){let _={...y};for(let[D,k]of Object.entries(Ii)){if(!v.hasAttribute(D))continue;let z=k(v.getAttribute(D));for(let[J,Y]of Object.entries(z))_[J]=Y&&typeof Y=="object"&&!Array.isArray(Y)?{..._[J],...Y}:Y}return _}let xv=Ln.observedAttributes;Object.defineProperty(Ln,"observedAttributes",{get:()=>[...xv,...Object.keys(Ii)]});let yv=Ln.prototype.attributeChangedCallback;return Ln.prototype.attributeChangedCallback=function(v,y,_){Un(Ii,v)?this.cue&&y!==_&&this.cue.update(Ii[v](_)):(yv.call(this,v,y,_),this.cue&&y!==_&&this.cue._notify())},window[r]={AstraShapeCue:ra,AstraShapeCueElement:Ln,createComponentPanel:Or}}function BT(){let r=cm();customElements.get("astra-shape-cue")||customElements.define("astra-shape-cue",r.AstraShapeCueElement)}function FT(r,e={}){let t=cm();return new t.AstraShapeCue(r,e)}function NT(r,e){let t=cm();if(!e||e.nodeType!==1||typeof e.appendChild!="function")throw new Error("Controls require a host element.");let n=document.createElement("aside");n.className="astra-panel",n.setAttribute("aria-label","Shape Cue controls"),e.appendChild(n),t.createComponentPanel(r,n);let i=()=>{let a=r.getOptions();for(let o of lm){let l=[...n.querySelectorAll("[data-key]")].find(h=>h.dataset.key===o.key);if(!l)continue;let c=o.optionPath.split(".").reduce((h,f)=>h?.[f],a);if(o.key==="shape"&&(c=r.shapeId),o.key==="palette"&&a.colors&&(c="custom"),l.tagName==="SELECT"&&![...l.options].some(h=>h.value===String(c))){let h=document.createElement("option");h.value=String(c),h.textContent=c==="custom"?"Custom":String(c),h.disabled=!0,l.appendChild(h)}o.kind==="checkbox"?l.checked=!!c:l.value=String(c);let u=[...n.querySelectorAll("[data-out]")].find(h=>h.dataset.out===o.key);u&&(u.textContent=String(c))}};i();let s=r.onChange(i);return()=>{s(),n.remove()}}export{FT as createShapeCue,UT as getControlDefinitions,NT as mountControls,BT as registerShapeCue,mE as version};
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- /*! @uxpilot/openai-astra-shape-cue v1.0.0 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
2
+ /*! @uxpilot/openai-astra-shape-cue v1.0.1 | Copyright 2026 UX Pilot Inc., original contributions. | UX Pilot Creative Use License 1.0. See LICENSE.md.
3
3
 
4
4
  three
5
5
  The MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxpilot/openai-astra-shape-cue",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Interactive WebGL particle shapes for HTML and React, with custom SVG support.",
5
5
  "type": "module",
6
6
  "author": "UX Pilot Inc.",