1import{r as p,j as h,a as tt}from"./client-CUTvk0f7.js";function vt(t){const n=t.trim().toLowerCase();if(n==="white")return[1,1,1];if(n==="black")return[0,0,0];if(n.startsWith("#")){let e=n.slice(1);return e.length===3&&(e=e.split("").map(o=>o+o).join("")),e.length!==6?null:[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255]}const r=n.match(/^hsla?\(\s*([\d.]+)(?:deg)?\s*,?\s*([\d.]+)%\s*,?\s*([\d.]+)%/);if(r){const e=parseFloat(r[1])/360,o=parseFloat(r[2])/100,c=parseFloat(r[3])/100;if(o===0)return[c,c,c];const i=c<.5?c*(1+o):c+o-c*o,a=2*c-i,u=l=>(l<0&&(l+=1),l>1&&(l-=1),l<1/6?a+(i-a)*6*l:l<1/2?i:l<2/3?a+(i-a)*(2/3-l)*6:a);return[u(e+1/3),u(e),u(e-1/3)]}const s=n.match(/^rgba?\(\s*([\d.]+)\s*,?\s*([\d.]+)\s*,?\s*([\d.]+)/);return s?[parseFloat(s[1])/255,parseFloat(s[2])/255,parseFloat(s[3])/255]:null}const rt=[250/255,247/255,242/255];function Ht(t){const n=vt(t);if(!n)return 1;const r=n[0]-rt[0],s=n[1]-rt[1],e=n[2]-rt[2];return Math.sqrt(2*r*r+4*s*s+3*e*e)}function Gt(t,n,r){const s=Math.max(t,n,r),e=Math.min(t,n,r),o=(s+e)/2;if(s===e)return{h:0,s:0,l:o};const c=s-e,i=o>.5?c/(2-s-e):c/(s+e);let a;switch(s){case t:a=((n-r)/c+(n<r?6:0))/6;break;case n:a=((r-t)/c+2)/6;break;default:a=((t-n)/c+4)/6}return{h:a,s:i,l:o}}function Vt(t,n){const r=vt(t);if(!r)return null;const{h:s,s:e,l:o}=Gt(r[0],r[1],r[2]);if(o>.98)return null;const i=.6+Math.min(1,n/Et)*(o-.6),a=e;return`hsl(${(s*360).toFixed(1)}, ${(a*100).toFixed(1)}%, ${(i*100).toFixed(1)}%)`}const Et=.16,Nt=1.3,qt=.35,it=new WeakMap;function F(t,n,r){let s=it.get(t);if(s||(s={},it.set(t,s)),s[n]===r)return;const e=n==="strokeWidth"?"stroke-width":n;t.setAttribute(e,r),s[n]=r}function Bt(t,n){const r=it.get(t);if(r?.[n]===void 0)return;const s=n;t.removeAttribute(s),r[n]=void 0}function Ut(t){switch(t){case"pointer":return{fill:"#fff",stroke:"#000",strokeWidth:1,opacity:.7};case"text":return{fill:"none",stroke:"#000",strokeWidth:1.5,opacity:.5};case"grab":case"grabbing":case"move":return{fill:"#fff",stroke:"#000",strokeWidth:1,opacity:.9};case"wait":case"progress":return{fill:"#888",stroke:"none",strokeWidth:0,opacity:.4};case"crosshair":return{fill:"none",stroke:"#000",strokeWidth:1,opacity:.6};default:return{fill:"#000",stroke:"none",strokeWidth:0,opacity:.8}}}const It={id:"color",name:"Color",getStrokeSize(t){return t},updatePath({pathEl:t,haloEl:n,pathData:r,trailOpacity:s,strokeWidth:e,trailColor:o}){if(F(t,"d",r),F(t,"fill",o),F(t,"opacity",String(s)),Bt(t,"filter"),t.style.display="",n){const c=Ht(o),i=c<Et?Vt(o,c):null;i?(F(n,"d",r),F(n,"fill",i),F(n,"stroke",i),F(n,"opacity",String(s*qt)),F(n,"strokeWidth",String(e*(Nt-1))),n.style.display=""):n.style.display="none"}},getCursorColor(t){return t},getClickColor(t){return t}},Yt={id:"monochrome",name:"Monochrome Ink",svgDefs:`<filter id="ink-texture" x="-10%" y="-10%" width="120%" height="120%"> 2 <feTurbulence type="fractalNoise" baseFrequency="0.04" numOctaves="4" result="noise" /> 3 <feDisplacementMap in="SourceGraphic" in2="noise" scale="2" xChannelSelector="R" yChannelSelector="G" /> 4 </filter>`,getStrokeSize(t,n){return n},updatePath({pathEl:t,haloEl:n,pathData:r,trailOpacity:s}){F(t,"d",r),F(t,"fill","#000"),F(t,"opacity",String(.8*s)),F(t,"filter","url(#ink-texture)"),t.style.display="",n&&(n.style.display="none")},getCursorColor(t,n){const r=Ut(n);return r.fill!=="none"?r.fill:r.stroke},getClickColor(){return"#000"}},Xt=[It,Yt];function On(t){return Xt.find(n=>n.id===t)??It}const J=new Set;let U;function Ot(){const t=Date.now();for(const n of J)n(t)||J.delete(n);U=void 0,J.size>0&&(U=requestAnimationFrame(Ot))}function Zt(t){return J.add(t),U===void 0&&(U=requestAnimationFrame(Ot)),()=>{J.delete(t),J.size===0&&U!==void 0&&(cancelAnimationFrame(U),U=void 0)}}const Jt=3;function Qt(t,n,r){const s=t.holdDuration?Math.min(Jt,1+t.holdDuration/1e3):1,o=(n.clickMinDuration+t.durationFactor*(n.clickMaxDuration-n.clickMinDuration))*s,c=n.clickExpansionDuration*s,i=Math.max(0,n.clickNumRings-1)*n.clickRingDelayMs,a=t.startTime+Math.max(o,i+c);return{holdMultiplier:s,effectTotalDuration:o,expansionDuration:c,opacity:n.clickOpacity,completedAt:a,complete:r>=a}}
4function Kt(t,n){const r=Qt(t,n,t.startTime),{holdMultiplier:s,expansionDuration:e}=r,c=(n.clickMinRadius+t.radiusFactor*(n.clickMaxRadius-n.clickMinRadius))*s,i=n.clickRingDelayMs,a=Math.max(1,n.clickNumRings),u=c*n.clickAnimationStopPoint,l=(t.radiusFactor-.5)*4,k=Math.max(1,Math.min(n.clickCoreRadius+l,u)),f=u/e;return{rings:Array.from({length:a},(d,M)=>{const x=t.startTime+M*i,R=a===1?u:k+(u-k)*(M/(a-1)),P=Math.max(1,R/f);return{ringStartTime:x,ringTargetRadius:R,ringDuration:P}}),lifecycle:r}}const Wn=p.memo(({effect:t,settings:n,onComplete:r})=>{const s=p.useRef([]),e=p.useRef(null),o=p.useRef(r);p.useEffect(()=>{o.current=r},[r]);const c=p.useMemo(()=>Kt(t,n),[t,n]);p.useEffect(()=>{const a=new Array(c.rings.length),u=new Array(c.rings.length),l=k=>{c.rings.forEach((g,d)=>{const M=k-g.ringStartTime,x=M>=0,R=s.current[d];R&&u[d]!==x&&(R.style.display=x?"":"none",u[d]=x);const P=Math.max(0,Math.min(1,M/g.ringDuration)),b=g.ringTargetRadius*(1-Math.pow(1-P,3));a[d]!==b&&(s.current[d]?.setAttribute("r",String(b)),a[d]=b)});const f=k>=c.lifecycle.completedAt;return f&&e.current!==t.id&&(e.current=t.id,o.current?.(t.id)),!f};if(l(Date.now()))return Zt(l)},[t,n,c]);const i=c.rings.map((a,u)=>h.jsx("circle",{ref:l=>{s.current[u]=l},cx:t.x,cy:t.y,r:0,fill:"none",stroke:t.color,strokeWidth:n.clickStrokeWidth,opacity:Math.max(0,c.lifecycle.opacity),style:{mixBlendMode:"multiply",display:"none"}},u));return h.jsx("g",{children:i})},(t,n)=>t.effect===n.effect&&t.onComplete===n.onComplete&&t.settings.clickMinRadius===n.settings.clickMinRadius&&t.settings.clickMaxRadius===n.settings.clickMaxRadius&&t.settings.clickCoreRadius===n.settings.clickCoreRadius&&t.settings.clickMinDuration===n.settings.clickMinDuration&&t.settings.clickMaxDuration===n.settings.clickMaxDuration&&t.settings.clickExpansionDuration===n.settings.clickExpansionDuration&&t.settings.clickStrokeWidth===n.settings.clickStrokeWidth&&t.settings.clickOpacity===n.settings.clickOpacity&&t.settings.clickNumRings===n.settings.clickNumRings&&t.settings.clickRingDelayMs===n.settings.clickRingDelayMs&&t.settings.clickAnimationStopPoint===n.settings.clickAnimationStopPoint);function tn(t){return{...t,radiusFactor:Math.random(),durationFactor:Math.random()}}function $n(t,n,r,s,e,o){const c=[];return t.clicksWithProgress.forEach((i,a)=>{if(i.progress>n)return;const u=`${t.trail.id}|${i.ts}|${a}`;r.has(u)||(r.add(u),c.push({...tn({id:u,x:s.x,y:s.y,color:e,startTime:o,trailIndex:0,holdDuration:i.duration}),trailId:t.trail.id}))}),c}function _n(t,n){const r=t.filter(s=>!n.has(s.trailId));return r.length===t.length?t:r}function nn(t){let n=0;for(let r=1;r<t.length;r++)n+=Math.hypot(t[r].x-t[r-1].x,t[r].y-t[r-1].y);return n}function Sn(t,n){let r=0,s=0;return{trailStates:t.map(o=>{const c=nn(o.variedPoints),i=Math.min(n.maxDurationMs,Math.max(n.minDurationMs,c/n.pxPerSecond*1e3)),a=r;return r=a+i*(1-n.overlap)+n.gapMs,s=Math.max(s,a+i),{trail:o.trail,startOffsetMs:a,durationMs:i,variedPoints:o.variedPoints,clicksWithProgress:o.clicksWithProgress}}),totalDurationMs:s+n.restMs}}const pt={default:{x:12,y:4},pointer:{x:12.3,y:8.4},text:{x:12,y:12},grab:{x:15.9,y:8.7},grabbing:{x:15.9,y:8.7},move:{x:9,y:9}},rn=t=>pt[t??"default"]??pt.default,en={default:1,pointer:24/32,text:1,grab:24/32,grabbing:24/32,move:24/18},sn=t=>en[t??"default"]??1,cn=({color:t,size:n=24})=>{const r=n/24,s="M12 4 L12 16.5 L14.7 14 L16.7 18.5 L18.3 17.8 L16.3 13.4 L20 13.4 Z";return h.jsxs("g",{transform:`scale(${r})`,children:[h.jsx("path",{d:s,fill:"white",stroke:"none"}),h.jsx("path",{d:s,fill:t,stroke:"white",strokeWidth:"0.5",strokeLinejoin:"round",transform:"translate(-0.4, -0.4)"})]})},on=({color:t,size:n=24})=>{const r=n/32;return h.jsxs("g",{transform:`scale(${r})`,children:[h.jsx("path",{d:"M11.3,20.4c-0.3-0.4-0.6-1.1-1.2-2c-0.3-0.5-1.2-1.5-1.5-1.9c-0.2-0.4-0.2-0.6-0.1-1c0.1-0.6,0.7-1.1,1.4-1.1c0.5,0,1,0.4,1.4,0.7c0.2,0.2,0.5,0.6,0.7,0.8c0.2,0.2,0.2,0.3,0.4,0.5c0.2,0.3,0.3,0.5,0.2,0.1c-0.1-0.5-0.2-1.3-0.4-2.1c-0.1-0.6-0.2-0.7-0.3-1.1c-0.1-0.5-0.2-0.8-0.3-1.3c-0.1-0.3-0.2-1.1-0.3-1.5c-0.1-0.5-0.1-1.4,0.3-1.8c0.3-0.3,0.9-0.4,1.3-0.2c0.5,0.3,0.8,1,0.9,1.3c0.2,0.5,0.4,1.2,0.5,2c0.2,1,0.5,2.5,
40.5,2.8c0-0.4-0.1-1.1,0-1.5c0.1-0.3,0.3-0.7,0.7-0.8c0.3-0.1,0.6-0.1,0.9-0.1c0.3,0.1,0.6,0.3,0.8,0.5c0.4,0.6,0.4,1.9,0.4,1.8c0.1-0.4,0.1-1.2,0.3-1.6c0.1-0.2,0.5-0.4,0.7-0.5c0.3-0.1,0.7-0.1,1,0c0.2,0,0.6,0.3,0.7,0.5c0.2,0.3,0.3,1.3,0.4,1.7c0,0.1,0.1-0.4,0.3-0.7c0.4-0.6,1.8-0.8,1.9,0.6c0,0.7,0,0.6,0,1.1c0,0.5,0,0.8,0,1.2c0,0.4-0.1,1.3-0.2,1.7c-0.1,0.3-0.4,1-0.7,1.4c0,0-1.1,1.2-1.2,1.8c-0.1,0.6-0.1,0.6-0.1,1c0,0.4,0.1,0.9,0.1,0.9s-0.8,0.1-1.2,0c-0.4-0.1-0.9-0.8-1-1.1c-0.2-0.3-0.5-0.3-0.7,0c-0.2,0.4-0.7,1.1-1.1,1.1c-0.7,0.1-2.1,0-3.1,0c0,0,0.2-1-0.2-1.4c-0.3-0.3-0.8-0.8-1.1-1.1L11.3,20.4z",fill:t,fillOpacity:"0.85",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("line",{x1:"19.6",y1:"20.7",x2:"19.6",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"17.6",y1:"20.7",x2:"17.5",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"15.6",y1:"17.3",x2:"15.6",y2:"20.7",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"})]})},an=({color:t,size:n=24})=>{const r=n/24;return h.jsx("g",{transform:`scale(${r})`,children:h.jsx("path",{d:"M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1M7 22h1a4 4 0 0 0 4-4v-1M7 2h1a4 4 0 0 1 4 4v1",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fillOpacity:"0.85"})})},un=({color:t,size:n=24})=>{const r=n/32;return h.jsxs("g",{transform:`scale(${r})`,children:[h.jsx("path",{d:"M12.6,16.6c-0.1-0.4-0.2-0.8-0.4-1.6c-0.2-0.6-0.3-0.9-0.5-1.2c-0.2-0.5-0.3-0.7-0.5-1.2c-0.1-0.3-0.4-1-0.5-1.4c-0.1-0.5,0-0.9,0.2-1.2c0.3-0.3,1-0.5,1.4-0.4c0.4,0.1,0.7,0.5,0.9,0.8c0.3,0.5,0.4,0.6,0.7,1.5c0.4,1,0.6,1.9,0.6,2.2l0.1,0.5c0,0,0-1.1,0-1.2c0-1-0.1-1.8,0-2.9c0-0.1,0.1-0.6,0.1-0.7c0.1-0.5,0.3-0.8,0.7-1c0.4-0.2,0.9-0.2,1.4,0c0.4,0.2,0.6,0.5,0.7,1c0,0.1,0.1,1,0.1,1.1c0,1,0,1.6,0,2.2c0,0.2,0,1.6,0,1.5c0.1-0.7,0.1-3.2,0.3-3.9c0.1-0.4,0.4-0.7,0.8-0.9c0.4-0.2,1.1-0.1,1.4,0.2c0.3,0.3,0.4,0.7,0.5,1.2c0,0.4,0,0.9,0,1.2c0,0.9,0,1.3,0,2.1c0,0,0,0.3,0,0.2c0.1-0.3,0.2-0.5,0.3-0.7c0-0.1,0.2-0.6,0.4-0.9c0.1-0.2,0.2-0.4,0.4-0.7c0.2-0.3,0.4-0.4,0.7-0.6c0.5-0.2,1.1,0.1,1.3,0.6c0.1,0.2,0,0.7,0,1.1c-0.1,0.6-0.3,1.3-0.4,1.6c-0.1,0.4-0.3,1.2-0.3,1.6c-0.1,0.4-0.2,1.4-0.4,1.8c-0.1,0.3-0.4,1-0.7,1.4c0,0-1.1,1.2-1.2,1.8c-0.1,0.6-0.1,0.6-0.1,1c0,0.4,0.1,0.9,0.1,0.9s-0.8,0.1-1.2,0c-0.4-0.1-0.9-0.8-1-1.1c-0.2-0.3-0.5-0.3-0.7,0c-0.2,0.4-0.7,1.1-1.1,1.1c-0.7,0.1-2.1,0-3.1,0c0,0,0.2-1-0.2-1.4c-0.3-0.3-0.8-0.8-1.1-1.1l-0.8-0.9c-0.3-0.4-0.6-1.1-1.2-2c-0.3-0.5-1-1.1-1.3-1.6c-0.2-0.4-0.3-1-0.2-1.3c0.2-0.6,0.7-0.9,1.4-0.8c0.5,0,0.8,0.2,1.2,0.5c0.2,0.2,0.6,0.5,0.8,0.7c0.2,0.2,0.2,0.3,0.4,0.5C12.6,16.8,12.6,16.9,12.6,16.6",fill:t,fillOpacity:"0.7",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("line",{x1:"19.6",y1:"20.7",x2:"19.6",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"17.6",y1:"20.7",x2:"17.5",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"15.6",y1:"17.3",x2:"15.6",y2:"20.7",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"})]})},ln=({color:t,size:n=24})=>{const r=n/32;return h.jsxs("g",{transform:`scale(${r})`,children:[h.jsx("path",{d:"M12.6,13c0.5-0.2,1.4-0.1,1.7,0.5c0.2,0.5,0.4,1.2,0.4,1.1c0-0.4,0-1.2,0.1-1.6c0.1-0.3,0.3-0.6,0.7-0.7c0.3-0.1,0.6-0.1,0.9-0.1c0.3,0.1,0.6,0.3,0.8,0.5c0.4,0.6,0.4,1.9,0.4,1.8c0.1-0.3,0.1-1.2,0.3-1.6c0.1-0.2,0.5-0.4,0.7-0.5c0.3-0.1,0.7-0.1,1,0c0.2,0,0.6,0.3,0.7,0.5c0.2,0.3,0.3,1.3,0.4,1.7c0,0.1,0.1-0.4,0.3-0.7c0.4-0.6,1.8-0.8,1.9,0.6c0,0.7,0,0.6,0,1.1c0,0.5,0,0.8,0,1.2c0,0.4-0.1,1.3-0.2,1.7c-0.1,0.3-0.4,1-0.7,1.4c0,0-1.1,1.2-1.2,1.8c-0.1,0.6-0.1,0.6-0.1,1c0,0.4,0.1,0.9,0.1,0.9s-0.8,0.1-1.2,0c-0.4-0.1-0.9-0.8-1-1.1c-0.2-0.3-0.5-0.3-0.7,0c-0.2,0.4-0.7,1.1-1,1.1c-0.7,0.1-2.1,0-3.1,0c0,0,0.2-1-0.2-1.4c-0.3-0.3-0.8-0.8-1.1-1.1l-0.8-0.9c-0.3-0.4-1-0.9-1.2-2c-0.2-0.9-0.2-1.4,0-1.8c0.2-0.4,0.7-0.6,0.9-0.6c0.2,0,0.7,0,0.9,0.1c0.2,0.1,0.3,0.2,0.5,0.4c0.2,0.3,0.3,0.5,0.2,0.1c-0.1-0.3-0.3-0.6-0.4-1c-0.1-0.4-0.4-0.9-0.4-1.5C11.7,13.9,11.8,13.3,12.6,13",fill:t,fillOpacity:"0.7",stroke:"black",strokeWidth:"0.75",strokeLinejoin:"round"}),h.jsx("line",{x1:"19.6",y1:"20.7",x2:"19.6",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"17.6",y1:"20.7",x2:"17.5",y2:"17.3",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"}),h.jsx("line",{x1:"15.6",y1:"17.3",x2:"15.6",y2:"20.7",stroke:"black",strokeWidth:"0.75",strokeLinecap:"round"})]})},fn=({color:t,size:n=24})=>{const r=n/18;return h.jsxs("g",{transform:`scale(${r})`,children:[h.jsx("path",{d:"M9,1L1,9l5.2,5.2L9,17l8-8L9,1z M7,12H6v-1h1V12z M7,7H6V6h1V7z M12,12h-1v-1h1V12z M11,6h1v1h-1V6z",fill:"white",fillOpacity:"0.85"}),h.jsx("polygon",{points:"15.6,9 13,6.2 13,8 9,8 5,8 5,6.2 2.4,9 5,11.8 5,10 9,10 13,10 13,11.8",fill:t}),h.jsx("polygon",{points:"10,9 10,9 10,5 11.8,5 9,2.4 6.2,5 8,5 8,9 8,9 8,13 6.2,13 9,15.6 11.8,13 10,13",fill:t})]})},hn=t=>{switch(t){case"pointer":return on;case"text":return an;case"grab":return un;case"grabbing":return ln;case"move":case"all-scroll":return fn;case"default":case void 0:default:return cn}},{PI:dn}=Math,Q=dn+1e-4,gt=.5,yt=[1,1];function kt(t,n,r,s=e=>e){return t*s(.5-n*(.5-r))}const{min:et}=Math;function Wt(t,n,r){let s=et(1,n/r);return et(1,t+(et(1,1-s)-t)*(s*.275))}function pn(t){return[-t[0],-t[1]]}function _(t,n){return[t[0]+n[0],t[1]+n[1]]}function mt(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t}function q(t,n){return[t[0]-n[0],t[1]-n[1]]}function at(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t}function N(t,n){return[t[0]*n,t[1]*n]}function st(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t}function gn(t,n){return[t[0]/n,t[1]/n]}function $t(t){return[t[1],-t[0]]}function ct(t,n){let r=n[0];return t[0]=n[1],t[1]=-r,t}function xt(t,n){return t[0]*n[0]+t[1]*n[1]}function yn(t,n){return t[0]===n[0]&&t[1]===n[1]}function kn(t){return Math.hypot(t[0],t[1])}function Mt(t,n){let r=t[0]-n[0],s=t[1]-n[1];return r*r+s*s}function _t(t){return gn(t,kn(t))}function mn(t,n){return Math.hypot(t[1]-n[1],t[0]-n[0])}function lt(t,n,r){let s=Math.sin(r),e=Math.cos(r),o=t[0]-n[0],c=t[1]-n[1],i=o*e-c*s,a=o*s+c*e;return[i+n[0],a+n[1]]}function Rt(t,n,r,s){let e=Math.sin(s),o=Math.cos(s),c=n[0]-r[0],i=n[1]-r[1],a=c*o-i*e,u=c*e+i*o;return t[0]=a+r[0],t[1]=u+r[1],t}function Pt(t,n,r){return _(t,N(q(n,t),r))}function xn(t,n,r,s){let e=r[0]-n[0],o=r[1]-n[1];return t[0]=n[0]+e*s,t[1]=n[1]+o*s,t}function St(t,n,r){return _(t,N(n,r))}const C=[0,0],G=[0,0],V=[0,0];function Mn(t,n){let r=St(t,_t($t(q(t,_(t,[1,1])))),-n),s=[],e=1/13;for(let o=e;o<=1;o+=e)s.push(lt(r,t,Q*2*o));return s}function Rn(t,n,r){let s=[],e=1/r;
4for(let o=e;o<=1;o+=e)s.push(lt(n,t,Q*o));return s}function Pn(t,n,r){let s=q(n,r),e=N(s,.5),o=N(s,.51);return[q(t,e),q(t,o),_(t,o),_(t,e)]}function bn(t,n,r,s){let e=[],o=St(t,n,r),c=1/s;for(let i=c;i<1;i+=c)e.push(lt(o,t,Q*3*i));return e}function Cn(t,n,r){return[_(t,N(n,r)),_(t,N(n,r*.99)),q(t,N(n,r*.99)),q(t,N(n,r))]}function bt(t,n,r){return t===!1||t===void 0?0:t===!0?Math.max(n,r):t}function Tn(t,n,r){return t.slice(0,10).reduce((s,e)=>{let o=e.pressure;return n&&(o=Wt(s,e.distance,r)),(s+o)/2},t[0].pressure)}function Ln(t,n={}){let{size:r=16,smoothing:s=.5,thinning:e=.5,simulatePressure:o=!0,easing:c=m=>m,start:i={},end:a={},last:u=!1}=n,{cap:l=!0,easing:k=m=>m*(2-m)}=i,{cap:f=!0,easing:g=m=>--m*m*m+1}=a;if(t.length===0||r<=0)return[];let d=t[t.length-1].runningLength,M=bt(i.taper,r,d),x=bt(a.taper,r,d),R=(r*s)**2,P=[],b=[],I=Tn(t,o,r),y=kt(r,e,t[t.length-1].pressure,c),A,L=t[0].vector,S=t[0].point,j=S,O=S,v=j,D=!1;for(let m=0;m<t.length;m++){let{pressure:z}=t[m],{point:W,vector:E,distance:ft,runningLength:$}=t[m],H=m===t.length-1;if(!H&&d-$<3)continue;e?(o&&(z=Wt(I,ft,r)),y=kt(r,e,z,c)):y=r/2,A===void 0&&(A=y);let B=$<M?k($/M):1,Z=d-$<x?g((d-$)/x):1;y=Math.max(.01,y*Math.min(B,Z));let ht=(H?t[m]:t[m+1]).vector,nt=H?1:xt(E,ht),zt=xt(E,L)<0&&!D,dt=nt!==null&&nt<0;if(zt||dt){ct(C,L),st(C,C,y);for(let K=0;K<=1;K+=.07692307692307693)at(G,W,C),Rt(G,G,W,Q*K),O=[G[0],G[1]],P.push(O),mt(V,W,C),Rt(V,V,W,Q*-K),v=[V[0],V[1]],b.push(v);S=O,j=v,dt&&(D=!0);continue}if(D=!1,H){ct(C,E),st(C,C,y),P.push(q(W,C)),b.push(_(W,C));continue}xn(C,ht,E,nt),ct(C,C),st(C,C,y),at(G,W,C),O=[G[0],G[1]],(m<=1||Mt(S,O)>R)&&(P.push(O),S=O),mt(V,W,C),v=[V[0],V[1]],(m<=1||Mt(j,v)>R)&&(b.push(v),j=v),I=z,L=E}let Y=[t[0].point[0],t[0].point[1]],w=t.length>1?[t[t.length-1].point[0],t[t.length-1].point[1]]:_(t[0].point,[1,1]),X=[],T=[];if(t.length===1){if(!(M||x)||u)return Mn(Y,A||y)}else{M||x&&t.length===1||(l?X.push(...Rn(Y,b[0],13)):X.push(...Pn(Y,P[0],b[0])));let m=$t(pn(t[t.length-1].vector));x||M&&t.length===1?T.push(w):f?T.push(...bn(w,m,y,29)):T.push(...Cn(w,m,y))}return P.concat(T,b.reverse(),X)}const Ct=[0,0];function Tt(t){return t!=null&&t>=0}function An(t,n={}){let{streamline:r=.5,size:s=16,last:e=!1}=n;if(t.length===0)return[];let o=.15+(1-r)*.85,c=Array.isArray(t[0])?t:t.map(({x:f,y:g,pressure:d=gt})=>[f,g,d]);if(c.length===2){let f=c[1];c=c.slice(0,-1);for(let g=1;g<5;g++)c.push(Pt(c[0],f,g/4))}c.length===1&&(c=[...c,[..._(c[0],yt),...c[0].slice(2)]]);let i=[{point:[c[0][0],c[0][1]],pressure:Tt(c[0][2])?c[0][2]:.25,vector:[...yt],distance:0,runningLength:0}],a=!1,u=0,l=i[0],k=c.length-1;for(let f=1;f<c.length;f++){let g=e&&f===k?[c[f][0],c[f][1]]:Pt(l.point,c[f],o);if(yn(l.point,g))continue;let d=mn(g,l.point);if(u+=d,f<k&&!a){if(u<s)continue;a=!0}at(Ct,l.point,g),l={point:g,pressure:Tt(c[f][2])?c[f][2]:gt,vector:_t(Ct),distance:d,runningLength:u},i.push(l)}return i[0].vector=i[1]?.vector||[0,0],i}function Dn(t,n={}){return Ln(An(t,n),n)}function wn(t,n){return n<t}function zn(t,n,r,s){if(t.length===0||n>r)return"";const e=Math.max(0,n),o=Math.min(r,t.length-1);if(e>o)return"";let c=`M ${t[e].x} ${t[e].y}`;for(let i=e+1;i<=o;i++)c+=` L ${t[i].x} ${t[i].y}`;return c}const ot={thinning:0,smoothing:.5,streamline:.05,simulatePressure:!1},Lt=20,ut=new WeakMap;function Fn(t,n){if(t.length<3)return"";const r=ut.get(n),s=new Array(t.length),e=(o,c,i,a,u)=>{if(!r||o<0||o>=r.outline.length)return!1;const l=r.outline[o],k=r.outline[(o+1)%r.outline.length];return l[0]===c&&l[1]===i&&k[0]===a&&k[1]===u};for(let o=0;o<t.length;o++){const[c,i]=t[o],[a,u]=t[(o+1)%t.length],l=o+(r?.outline.length??0)-t.length;r&&e(o,c,i,a,u)?s[o]=r.curves[o]:r&&e(l,c,i,a,u)?s[o]=r.curves[l]:s[o]=` ${c.toFixed(2)} ${i.toFixed(2)} ${((c+a)/2).toFixed(2)} ${((i+u)/2).toFixed(2)}`}return ut.set(n,{outline:t,curves:s}),`M ${t[0][0].toFixed(2)} ${t[0][1].toFixed(2)} Q${s.join("")} Z`}function wt(t,n,r,s,e,o,c){if(t.length===0||n>r)return"";const i=[];for(let l=n;l<=r;l++)i.push(t[l]);o&&i.push(o);const a=Dn(i,{...ot,size:s,thinning:ot.thinning,simulatePressure:ot.simulatePressure,last:e,start:{taper:Lt},end:e?{taper:Lt}:{taper:0,cap:!0}}),u=Fn(a,t);return e&&ut.delete(t),u}function Hn(t,n,r,s){const e=At(t,n);if(e===0)return{start:0,end:0,finishedCount:e};const o=Math.max(0,e-r);if(o===0)return{start:0,end:e,finishedCount:e};const c=n-s;return{start:Math.min(o,Math.max(0,At(t,c)-r)),end:e,finishedCount:e}}function At(t,n){let r=0,s=t.length;for(;r<s;){const e=Math.floor((r+s)/2);t[e].finishedAtMs<=n?r=e+1:s=e}return r}const jn=3e3,Dt=.5,vn=3e3,Ft=1e3;function jt(t,n,r,s){const{trail:e,startOffsetMs:o,durationMs:c,variedPoints:i}=t;if(e.points.length<2||i.length<2)return null;let a;if(s!==void 0)a=Math.min(1,Math.max(0,s));else{const y=n-o;if(y<0)return null;a=Math.min(1,y/c)}const u=a>=1,l=i.length,k=(l-1)*a,f=Math.floor(k),g=k-f,d=u?Math.max(0,l-Ft):Math.max(0,f-Ft+1),M=Math.min(f,l-1);let x;if(!u&&f<l-1&&g>0){const y=i[f],A=i[f+1];x={x:y.x+(A.x-y.x)*g,y:y.y+(A.y-y.y)*g}}const R=x??i[M],b=M-d+1+(x?1:0)>=2?wt(i,d,M,r,u,x):"",I=Math.min(Math.floor((e.points.length-1)*a),e.points.length-1);return{trailProgress:a,isFinished:u,cursorPosition:R,pathData:b,cursorType:e.points[I]?.cursor}}function En(t,n,r,s){const e=t.variedPoints;if(e.length<2||r<=n)return"";const o=e.length-1,c=Math.min(1,Math.max(0,n)),i=Math.min(1,Math.max(0,r)),a=o*i,u=Math.floor(a),l=a-u,k=Math.max(0,Math.floor(o*c)-1),f=u<o&&l>
40?{x:e[u].x+(e[u+1].x-e[u].x)*l,y:e[u].y+(e[u+1].y-e[u].y)*l}:void 0;return wt(e,k,Math.min(u,o),s,i>=1,f)}const Gn=tt.forwardRef(({trailState:t,fixedMonoStrokeWidth:n,renderer:r},s)=>{const e=p.useRef(null),o=p.useRef(null),c=p.useRef(null),i=p.useRef(null),a=p.useRef(null),u=p.useRef(""),l=p.useRef(""),k=p.useRef(""),f=p.useRef(null),g=p.useRef(null),d=p.useRef(void 0),M=p.useRef(""),x=p.useRef(""),R=p.useRef(""),P=p.useRef(null),b=p.useRef(null),I=p.useRef(null);p.useEffect(()=>{b.current=null,I.current=null,l.current="",k.current="",f.current=null,g.current=null,d.current=void 0,M.current="",x.current="",R.current="",P.current=null},[t]);const y=p.useCallback(()=>{const L=e.current;L&&u.current!=="0"&&(L.setAttribute("opacity","0"),u.current="0")},[]);tt.useImperativeHandle(s,()=>({hide:y,getGroup(){return e.current},update(L,S,j,O,v,D){const Y=e.current;if(!Y)return null;if(O<=0)return y(),null;const w=r.getStrokeSize(j,n),X=v!==void 0?v>=1:L-t.startOffsetMs>=t.durationMs;let T=X&&!D&&I.current===w?b.current:null;if(T||(T=jt(t,L,w,v),X&&(b.current=T,I.current=w)),!T)return y(),null;const m=String(O);u.current!==m&&(Y.setAttribute("opacity",m),u.current=m);const{trailProgress:z,cursorPosition:W}=T,E=t.trail.color,$=(D?jt(t,L,w,D.baseProgress):T)?.pathData??"",H=o.current;H&&($?(l.current!==$||k.current!==r.id||f.current!==S||g.current!==j||d.current!==T.cursorType||M.current!==E)&&(r.updatePath({pathEl:H,haloEl:c.current,pathData:$,trailOpacity:S,strokeWidth:j,cursorType:T.cursorType,trailProgress:z,trailColor:E,fixedMonoStrokeWidth:n}),l.current=$,k.current=r.id,f.current=S,g.current=j,d.current=T.cursorType,M.current=E):(H.style.display="none",c.current&&(c.current.style.display="none"),l.current=""));const B=i.current;if(B&&D){const Z=En(t,D.startProgress,z,w);Z?(x.current!==Z||R.current!==r.id||P.current!==D.opacity||g.current!==j||d.current!==T.cursorType||M.current!==E)&&(r.updatePath({pathEl:B,haloEl:a.current,pathData:Z,trailOpacity:D.opacity,strokeWidth:j,cursorType:T.cursorType,trailProgress:z,trailColor:E,fixedMonoStrokeWidth:n}),x.current=Z,R.current=r.id,P.current=D.opacity):(B.style.display="none",a.current&&(a.current.style.display="none"),x.current="")}else B&&(B.style.display="none",a.current&&(a.current.style.display="none"),x.current="",P.current=null);return{trailProgress:z,cursorPosition:W}}}),[n,y,r,t]);const A=t.trail.color;return h.jsxs("g",{ref:e,opacity:"0",children:[h.jsx("path",{ref:c,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"none"}}),h.jsx("path",{ref:o,fill:A,style:{display:"none"}}),h.jsx("path",{ref:a,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"none"}}),h.jsx("path",{ref:i,fill:A,style:{display:"none"}})]})}),Vn=tt.forwardRef(({trailState:t,renderer:n},r)=>{const s=p.useRef(null),e=p.useRef(!1),o=p.useRef(""),[c,i]=p.useState(t.trail.points[0]?.cursor),a=hn(c),u=32,l=p.useCallback(()=>{const R=s.current;R&&e.current&&(R.style.display="none",e.current=!1)},[]);tt.useImperativeHandle(r,()=>({hide:l,update(R,P,b,I,y){const A=s.current;if(!A)return;if(y<=0||b||I<=0){l();return}e.current||(A.style.display="",e.current=!0);const L=`translate(${R.x}, ${R.y})`;o.current!==L&&(A.setAttribute("transform",L),o.current=L),P!==c&&i(P)}}),[c,l]);const k=n.getCursorColor(t.trail.color,c),f=rn(c),g=sn(c),d=u/24*g,M=-f.x*d,x=-f.y*d;return h.jsx("g",{ref:s,style:{display:"none"},children:h.jsx("g",{transform:`translate(${M}, ${x})`,children:h.jsx(a,{color:k,size:u})})})});function Nn(t,n,r,s,e,o){const c=s-t.startOffsetMs;if(c<0)return 0;if(Math.min(1,c/t.durationMs)<1)return 1;const a=Math.max(0,o-e);if(n<a){const f=n+e,g=f<o?r[f].finishedAtMs:s,d=s-g;return Math.max(0,Dt*(1-d/jn))}const u=t.startOffsetMs+t.durationMs,l=s-u;return 1-Math.min(1,l/vn)*(1-Dt)}export{vn as C,jn as E,Wn as R,Xt as T,On as a,Gn as b,Vn as c,$n as d,Dt as e,zn as f,Kt as g,wn as h,Hn as i,Nn as j,tn as k,nn as p,_n as r,Sn as s};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.