shieldcortex 2.4.9 → 2.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/dashboard/.next/standalone/dashboard/.next/prerender-manifest.json +3 -3
- package/dashboard/.next/standalone/dashboard/.next/required-server-files.json +4 -4
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +3 -3
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_25b1b286._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{5ca8c5117c4d363e.js → 94e08a439fb35905.js} +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/c7a714fde87e48c5.css +3 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/README.md +2 -2
- package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/glib-2.0/include/glibconfig.h +9 -8
- package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
- package/dashboard/.next/standalone/dashboard/server.js +1 -1
- package/dashboard/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
- package/dashboard/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
- package/dashboard/.next/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
- package/dashboard/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/hooks/openclaw/cortex-memory/HOOK.md +30 -2
- package/hooks/openclaw/cortex-memory/handler.js +110 -24
- package/package.json +2 -1
- package/scripts/postinstall.mjs +24 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/99b25a4cac7ef899.css +0 -3
- package/dashboard/.next/standalone/dashboard/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
- package/dist/setup/clawdbot.d.ts +0 -15
- package/dist/setup/clawdbot.d.ts.map +0 -1
- package/dist/setup/clawdbot.js +0 -118
- package/dist/setup/clawdbot.js.map +0 -1
- /package/dashboard/.next/standalone/dashboard/.next/static/{BHzSynfe_Q0NJ0oavG8FJ → j3yGjZ6Ts_LmQ9u4uPtD1}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{BHzSynfe_Q0NJ0oavG8FJ → j3yGjZ6Ts_LmQ9u4uPtD1}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{BHzSynfe_Q0NJ0oavG8FJ → j3yGjZ6Ts_LmQ9u4uPtD1}/_ssgManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
- /package/dashboard/.next/standalone/dashboard/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
${p}px !important;
|
|
7
7
|
${f}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{g.contains(x)&&g.removeChild(x)}},[t]),(0,h.jsx)(N,{isPresent:t,childRef:a,sizeRef:o,children:j.cloneElement(e,{ref:c})})}let C=({children:e,initial:t,isPresent:s,onExitComplete:i,custom:r,presenceAffectsLayout:n,mode:a,anchorX:o,anchorY:l,root:c})=>{let d=x(P),u=(0,m.useId)(),p=!0,f=(0,m.useMemo)(()=>(p=!1,{id:u,initial:t,isPresent:s,custom:r,onExitComplete:e=>{for(let t of(d.set(e,!0),d.values()))if(!t)return;i&&i()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[s,d,i]);return n&&p&&(f={...f}),(0,m.useMemo)(()=>{d.forEach((e,t)=>d.set(t,!1))},[s]),m.useEffect(()=>{s||d.size||!i||i()},[s]),"popLayout"===a&&(e=(0,h.jsx)(T,{isPresent:s,anchorX:o,anchorY:l,root:c,children:e})),(0,h.jsx)(v.Provider,{value:f,children:e})};function P(){return new Map}function M(e=!0){let t=(0,m.useContext)(v);if(null===t)return[!0,null];let{isPresent:s,onExitComplete:i,register:r}=t,n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return r(n)},[e]);let a=(0,m.useCallback)(()=>e&&i&&i(n),[n,i,e]);return!s&&i?[!1,a]:[!0]}let A=e=>e.key||"";function E(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}let R=({children:e,custom:t,initial:s=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:n="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:c})=>{let[d,u]=M(a),p=(0,m.useMemo)(()=>E(e),[e]),g=a&&!d?[]:p.map(A),v=(0,m.useRef)(!0),b=(0,m.useRef)(p),w=x(()=>new Map),j=(0,m.useRef)(new Set),[k,S]=(0,m.useState)(p),[N,T]=(0,m.useState)(p);y(()=>{v.current=!1,b.current=p;for(let e=0;e<N.length;e++){let t=A(N[e]);g.includes(t)?(w.delete(t),j.current.delete(t)):!0!==w.get(t)&&w.set(t,!1)}},[N,g.length,g.join("-")]);let P=[];if(p!==k){let e=[...p];for(let t=0;t<N.length;t++){let s=N[t],i=A(s);g.includes(i)||(e.splice(t,0,s),P.push(s))}return"wait"===n&&P.length&&(e=P),T(E(e)),S(p),null}let{forceRender:R}=(0,m.useContext)(f);return(0,h.jsx)(h.Fragment,{children:N.map(e=>{let m=A(e),f=(!a||!!d)&&(p===N||g.includes(m));return(0,h.jsx)(C,{isPresent:f,initial:(!v.current||!!s)&&void 0,custom:t,presenceAffectsLayout:r,mode:n,root:c,onExitComplete:f?void 0:()=>{if(j.current.has(m)||(j.current.add(m),!w.has(m)))return;w.set(m,!0);let e=!0;w.forEach(t=>{t||(e=!1)}),e&&(R?.(),T(b.current),a&&u?.(),i&&i())},anchorX:o,anchorY:l,children:e},m)})})},D=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],L=new Set(D),V=(e,t,s)=>s>t?t:s<e?e:s,F={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},O={...F,transform:e=>V(0,1,e)},I={...F,default:1},$=e=>Math.round(1e5*e)/1e5,_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,z=(e,t)=>s=>!!("string"==typeof s&&B.test(s)&&s.startsWith(e)||t&&null!=s&&Object.prototype.hasOwnProperty.call(s,t)),U=(e,t,s)=>i=>{if("string"!=typeof i)return i;let[r,n,a,o]=i.match(_);return{[e]:parseFloat(r),[t]:parseFloat(n),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},q={...F,transform:e=>Math.round(V(0,255,e))},W={test:z("rgb","red"),parse:U("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+q.transform(e)+", "+q.transform(t)+", "+q.transform(s)+", "+$(O.transform(i))+")"},Q={test:z("#"),parse:function(e){let t="",s="",i="",r="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,s+=s,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:W.transform},K=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),H=K("deg"),X=K("%"),Y=K("px"),G=K("vh"),Z=K("vw"),J={...X,parse:e=>X.parse(e)/100,transform:e=>X.transform(100*e)},ee={test:z("hsl","hue"),parse:U("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+X.transform($(t))+", "+X.transform($(s))+", "+$(O.transform(i))+")"},et={test:e=>W.test(e)||Q.test(e)||ee.test(e),parse:e=>W.test(e)?W.parse(e):ee.test(e)?ee.parse(e):Q.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?W.transform(e):ee.transform(e),getAnimatableNone:e=>{let t=et.parse(e);return t.alpha=0,et.transform(t)}},es=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ei="number",er="color",en=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ea(e){let t=e.toString(),s=[],i={color:[],number:[],var:[]},r=[],n=0,a=t.replace(en,e=>(et.test(e)?(i.color.push(n),r.push(er),s.push(et.parse(e))):e.startsWith("var(")?(i.var.push(n),r.push("var"),s.push(e)):(i.number.push(n),r.push(ei),s.push(parseFloat(e))),++n,"${}")).split("${}");return{values:s,split:a,indexes:i,types:r}}function eo(e){return ea(e).values}function el(e){let{split:t,types:s}=ea(e),i=t.length;return e=>{let r="";for(let n=0;n<i;n++)if(r+=t[n],void 0!==e[n]){let t=s[n];t===ei?r+=$(e[n]):t===er?r+=et.transform(e[n]):r+=e[n]}return r}}let ec=e=>"number"==typeof e?0:et.test(e)?et.getAnimatableNone(e):e,ed={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(_)?.length||0)+(e.match(es)?.length||0)>0},parse:eo,createTransformer:el,getAnimatableNone:function(e){let t=eo(e);return el(e)(t.map(ec))}},eu=new Set(["brightness","contrast","saturate","opacity"]);function eh(e){let[t,s]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[i]=s.match(_)||[];if(!i)return e;let r=s.replace(i,""),n=+!!eu.has(t);return i!==s&&(n*=100),t+"("+n+r+")"}let em=/\b([a-z-]*)\(.*?\)/gu,ep={...ed,getAnimatableNone:e=>{let t=e.match(em);return t?t.map(eh).join(" "):e}},ef={...F,transform:Math.round},ex={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:I,scaleX:I,scaleY:I,scaleZ:I,skew:H,skewX:H,skewY:H,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:O,originX:J,originY:J,originZ:Y,zIndex:ef,fillOpacity:O,strokeOpacity:O,numOctaves:ef},eg={...ex,color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,filter:ep,WebkitFilter:ep},ey=e=>eg[e],ev=()=>({translate:0,scale:1,origin:0,originPoint:0}),eb=()=>({x:ev(),y:ev()}),ew=()=>({min:0,max:0}),ej=()=>({x:ew(),y:ew()}),ek=e=>!!(e&&e.getVelocity),eS=new Set(["width","height","top","left","right","bottom",...D]),eN=e=>t=>t.test(e),eT=[F,Y,X,H,Z,G,{test:e=>"auto"===e,parse:e=>e}],eC=e=>eT.find(eN(e)),eP=()=>{},eM=()=>{};p.default;let eA=e=>t=>"string"==typeof t&&t.startsWith(e),eE=eA("--"),eR=eA("var(--"),eD=e=>!!eR(e)&&eL.test(e.split("/*")[0].trim()),eL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function eV(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let eF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,eO=e=>180*e/Math.PI,eI=e=>e_(eO(Math.atan2(e[1],e[0]))),e$={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eI,rotateZ:eI,skewX:e=>eO(Math.atan(e[1])),skewY:e=>eO(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},e_=e=>((e%=360)<0&&(e+=360),e),eB=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ez=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eB,scaleY:ez,scale:e=>(eB(e)+ez(e))/2,rotateX:e=>e_(eO(Math.atan2(e[6],e[5]))),rotateY:e=>e_(eO(Math.atan2(-e[2],e[0]))),rotateZ:eI,rotate:eI,skewX:e=>eO(Math.atan(e[4])),skewY:e=>eO(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eq(e){return+!!e.includes("scale")}function eW(e,t){let s,i;if(!e||"none"===e)return eq(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(r)s=eU,i=r;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=e$,i=t}if(!i)return eq(t);let n=s[t],a=i[1].split(",").map(eQ);return"function"==typeof n?n(a):a[n]}function eQ(e){return parseFloat(e.trim())}let eK=e=>e===F||e===Y,eH=new Set(["x","y","z"]),eX=D.filter(e=>!eH.has(e)),eY={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>eW(t,"x"),y:(e,{transform:t})=>eW(t,"y")};eY.translateX=eY.x,eY.translateY=eY.y;let eG=e=>e,eZ={},eJ=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function e0(e,t){let s=!1,i=!0,r={delta:0,timestamp:0,isProcessing:!1},n=()=>s=!0,a=eJ.reduce((e,s)=>(e[s]=function(e,t){let s=new Set,i=new Set,r=!1,n=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){a.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:(e,t=!1,n=!1)=>{let o=n&&r?s:i;return t&&a.add(e),o.has(e)||o.add(e),e},cancel:e=>{i.delete(e),a.delete(e)},process:e=>{if(o=e,r){n=!0;return}r=!0,[s,i]=[i,s],s.forEach(c),t,l=0,s.clear(),r=!1,n&&(n=!1,d.process(e))}};return d}(n,t?s:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:m,postRender:p}=a,f=()=>{let n=eZ.useManualTiming?r.timestamp:performance.now();s=!1,eZ.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(n-r.timestamp,40),1)),r.timestamp=n,r.isProcessing=!0,o.process(r),l.process(r),c.process(r),d.process(r),u.process(r),h.process(r),m.process(r),p.process(r),r.isProcessing=!1,s&&t&&(i=!1,e(f))};return{schedule:eJ.reduce((t,n)=>{let o=a[n];return t[n]=(t,n=!1,a=!1)=>(!s&&(s=!0,i=!0,r.isProcessing||e(f)),o.schedule(t,n,a)),t},{}),cancel:e=>{for(let t=0;t<eJ.length;t++)a[eJ[t]].cancel(e)},state:r,steps:a}}let{schedule:e1,cancel:e2,state:e4,steps:e5}=e0("u">typeof requestAnimationFrame?requestAnimationFrame:eG,!0),e3=new Set,e6=!1,e8=!1,e7=!1;function e9(){if(e8){let e=Array.from(e3).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),s=new Map;t.forEach(e=>{let t,i=(t=[],eX.forEach(s=>{let i=e.getValue(s);void 0!==i&&(t.push([s,i.get()]),i.set(+!!s.startsWith("scale")))}),t);i.length&&(s.set(e,i),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=s.get(e);t&&t.forEach(([t,s])=>{e.getValue(t)?.set(s)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}e8=!1,e6=!1,e3.forEach(e=>e.complete(e7)),e3.clear()}function te(){e3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e8=!0)})}class tt{constructor(e,t,s,i,r,n=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=i,this.element=r,this.isAsync=n}scheduleResolve(){this.state="scheduled",this.isAsync?(e3.add(this),e6||(e6=!0,e1.read(te),e1.resolveKeyframes(e9))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:s,motionValue:i}=this;if(null===e[0]){let r=i?.get(),n=e[e.length-1];if(void 0!==r)e[0]=r;else if(s&&t){let i=s.readValue(t,n);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=n),i&&void 0===r&&i.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),e3.delete(this)}cancel(){"scheduled"===this.state&&(e3.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function ts(e,t){let s=ey(e);return s!==ep&&(s=ed),s.getAnimatableNone?s.getAnimatableNone(t):void 0}let ti=new Set(["auto","none","0"]);class tr extends tt{constructor(e,t,s,i,r){super(e,t,s,i,r,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let i=e[s];if("string"==typeof i&&eD(i=i.trim())){let r=function e(t,s,i=1){eM(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[r,n]=function(e){let t=eF.exec(e);if(!t)return[,];let[,s,i,r]=t;return[`--${s??i}`,r]}(t);if(!r)return;let a=window.getComputedStyle(s).getPropertyValue(r);if(a){let e=a.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return eD(n)?e(n,s,i+1):n}(i,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!eS.has(s)||2!==e.length)return;let[i,r]=e,n=eC(i),a=eC(r);if(eV(i)!==eV(r)&&eY[s]){this.needsMeasurement=!0;return}if(n!==a)if(eK(n)&&eK(a))for(let t=0;t<e.length;t++){let s=e[t];"string"==typeof s&&(e[t]=parseFloat(s))}else eY[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,s=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&s.push(t);s.length&&function(e,t,s){let i,r=0;for(;r<e.length&&!i;){let t=e[r];"string"==typeof t&&!ti.has(t)&&ea(t).values.length&&(i=e[r]),r++}if(i&&s)for(let r of t)e[r]=ts(s,i)}(e,s,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=eY[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let i=t[t.length-1];void 0!==i&&e.getValue(s,i).jump(i,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;let i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);let r=s.length-1,n=s[r];s[r]=eY[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==n&&void 0===this.finalKeyframe&&(this.finalKeyframe=n),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,s])=>{e.getValue(t).set(s)}),this.resolveNoneKeyframes()}}function tn(e,t){-1===e.indexOf(t)&&e.push(t)}function ta(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}class to{constructor(){this.subscriptions=[]}add(e){return tn(this.subscriptions,e),()=>ta(this.subscriptions,e)}notify(e,t,s){let i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,s);else for(let r=0;r<i;r++){let i=this.subscriptions[r];i&&i(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let{schedule:tl}=e0(queueMicrotask,!1);function tc(){t=void 0}let td={now:()=>(void 0===t&&td.set(e4.isProcessing||eZ.useManualTiming?e4.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tc)}};class tu{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=td.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=td.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new to);let s=this.events[e].add(t);return"change"===e?()=>{s(),e1.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return c&&c.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=td.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let s=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),s?1e3/s*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function th(e,t){return new tu(e,t)}let tm=[...eT,et,ed],tp={current:null},tf={current:!1},tx="u">typeof window,tg=new WeakMap;function ty(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tv(e){return"string"==typeof e||Array.isArray(e)}let tb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tw=["initial",...tb];function tj(e){return ty(e.animate)||tw.some(t=>tv(e[t]))}function tk(e){return!!(tj(e)||e.variants)}function tS(e){let t=[{},{}];return e?.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function tN(e,t,s,i){if("function"==typeof t){let[r,n]=tS(i);t=t(void 0!==s?s:e.custom,r,n)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[r,n]=tS(i);t=t(void 0!==s?s:e.custom,r,n)}return t}let tT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],tC={};class tP{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=td.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,e1.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=n;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=tj(t),this.isVariantNode=tk(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==o[e]&&ek(t)&&t.set(o[e])}}mount(e){this.current=e,tg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tf.current||function(){if(tf.current=!0,tx)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tp.current=e.matches;e.addEventListener("change",t),t()}else tp.current=!1}(),this.shouldReduceMotion=tp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),e2(this.notifyUpdate),e2(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let s;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=L.has(e);i&&this.onBindTransform&&this.onBindTransform();let r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&e1.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in tC){let t=tC[e];if(!t)continue;let{isEnabled:s,Feature:i}=t;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ej()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<tT.length;t++){let s=tT[t];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let i=e["on"+s];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=function(e,t,s){for(let i in t){let r=t[i],n=s[i];if(ek(r))e.addValue(i,r);else if(ek(n))e.addValue(i,th(r,{owner:e}));else if(n!==r)if(e.hasValue(i)){let t=e.getValue(i);!0===t.liveStyle?t.jump(r):t.hasAnimated||t.set(r)}else{let t=e.getStaticValue(i);e.addValue(i,th(void 0!==t?t:r,{owner:e}))}}for(let i in s)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return void 0===s&&void 0!==t&&(s=th(null===t?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=s){let i,r;if("string"==typeof s&&(i=s,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i)||(r=s,/^0[^.\s]+$/u.test(r))))s=parseFloat(s);else{let i;i=s,!tm.find(eN(i))&&ed.test(t)&&(s=ts(e,t))}this.setBaseTarget(e,ek(s)?s.get():s)}return ek(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let i=tN(this.props,s,this.presenceContext?.custom);i&&(t=i[e])}if(s&&void 0!==t)return t;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ek(i)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new to),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){tl.render(this.render)}}class tM extends tP{constructor(){super(...arguments),this.KeyframeResolver=tr}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ek(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function tA(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let tE=(e,t)=>t&&"number"==typeof e?t.transform(e):e,tR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tD=D.length;function tL(e,t,s){let{style:i,vars:r,transformOrigin:n}=e,a=!1,o=!1;for(let e in t){let s=t[e];if(L.has(e)){a=!0;continue}if(eE(e)){r[e]=s;continue}{let t=tE(s,ex[e]);e.startsWith("origin")?(o=!0,n[e]=t):i[e]=t}}if(!t.transform&&(a||s?i.transform=function(e,t,s){let i="",r=!0;for(let n=0;n<tD;n++){let a=D[n],o=e[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===+!!a.startsWith("scale");else{let e=parseFloat(o);l=a.startsWith("scale")?1===e:0===e}if(!l||s){let e=tE(o,ex[a]);if(!l){r=!1;let t=tR[a]||a;i+=`${t}(${e}) `}s&&(t[a]=e)}}return i=i.trim(),s?i=s(t,r?"":i):r&&(i="none"),i}(t,e.transform,s):i.transform&&(i.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:s=0}=n;i.transformOrigin=`${e} ${t} ${s}`}}let tV={offset:"stroke-dashoffset",array:"stroke-dasharray"},tF={offset:"strokeDashoffset",array:"strokeDasharray"},tO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function tI(e,{attrX:t,attrY:s,attrScale:i,pathLength:r,pathSpacing:n=1,pathOffset:a=0,...o},l,c,d){if(tL(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:u,style:h}=e;for(let e of(u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox),tO))void 0!==u[e]&&(h[e]=u[e],delete u[e]);void 0!==t&&(u.x=t),void 0!==s&&(u.y=s),void 0!==i&&(u.scale=i),void 0!==r&&function(e,t,s=1,i=0,r=!0){e.pathLength=1;let n=r?tV:tF;e[n.offset]=`${-i}`,e[n.array]=`${t} ${s}`}(u,r,n,a,!1)}let t$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),t_=e=>"string"==typeof e&&"svg"===e.toLowerCase();function tB(e,{style:t,vars:s},i,r){let n,a=e.style;for(n in t)a[n]=t[n];for(n in r?.applyProjectionStyles(a,i),s)a.setProperty(n,s[n])}function tz(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let tU={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!Y.test(e))return e;else e=parseFloat(e);let s=tz(e,t.target.x),i=tz(e,t.target.y);return`${s}% ${i}%`}},tq=(e,t,s)=>e+(t-e)*s,tW={borderRadius:{...tU,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tU,borderTopRightRadius:tU,borderBottomLeftRadius:tU,borderBottomRightRadius:tU,boxShadow:{correct:(e,{treeScale:t,projectionDelta:s})=>{let i=ed.parse(e);if(i.length>5)return e;let r=ed.createTransformer(e),n=+("number"!=typeof i[0]),a=s.x.scale*t.x,o=s.y.scale*t.y;i[0+n]/=a,i[1+n]/=o;let l=tq(a,o,.5);return"number"==typeof i[2+n]&&(i[2+n]/=l),"number"==typeof i[3+n]&&(i[3+n]/=l),r(i)}}};function tQ(e,{layout:t,layoutId:s}){return L.has(e)||e.startsWith("origin")||(t||void 0!==s)&&(!!tW[e]||"opacity"===e)}function tK(e,t,s){let i=e.style,r=t?.style,n={};if(!i)return n;for(let t in i)(ek(i[t])||r&&ek(r[t])||tQ(t,e)||s?.getValue(t)?.liveStyle!==void 0)&&(n[t]=i[t]);return n}function tH(e,t,s){let i=tK(e,t,s);for(let s in e)(ek(e[s])||ek(t[s]))&&(i[-1!==D.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=e[s]);return i}class tX extends tM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ej}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(L.has(t)){let e=ey(t);return e&&e.default||0}return t=t$.has(t)?t:tA(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return tH(e,t,s)}build(e,t,s){tI(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,i){for(let s in tB(e,t,void 0,i),t.attrs)e.setAttribute(t$.has(s)?s:tA(s),t.attrs[s])}mount(e){this.isSVGTag=t_(e.tagName),super.mount(e)}}function tY({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}function tG(e){return void 0===e||1===e}function tZ({scale:e,scaleX:t,scaleY:s}){return!tG(e)||!tG(t)||!tG(s)}function tJ(e){return tZ(e)||t0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t0(e){var t,s;return(t=e.x)&&"0%"!==t||(s=e.y)&&"0%"!==s}function t1(e,t,s,i,r){return void 0!==r&&(e=i+r*(e-i)),i+s*(e-i)+t}function t2(e,t=0,s=1,i,r){e.min=t1(e.min,t,s,i,r),e.max=t1(e.max,t,s,i,r)}function t4(e,{x:t,y:s}){t2(e.x,t.translate,t.scale,t.originPoint),t2(e.y,s.translate,s.scale,s.originPoint)}function t5(e,t){e.min=e.min+t,e.max=e.max+t}function t3(e,t,s,i,r=.5){let n=tq(e.min,e.max,r);t2(e,t,s,n,i)}function t6(e,t){t3(e.x,t.x,t.scaleX,t.scale,t.originX),t3(e.y,t.y,t.scaleY,t.scale,t.originY)}function t8(e,t){return tY(function(e,t){if(!t)return e;let s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class t7 extends tM{constructor(){super(...arguments),this.type="html",this.renderInstance=tB}readValueFromInstance(e,t){if(L.has(t))return this.projection?.isProjecting?eq(t):((e,t)=>{let{transform:s="none"}=getComputedStyle(e);return eW(s,t)})(e,t);{let s=window.getComputedStyle(e),i=(eE(t)?s.getPropertyValue(t):s[t])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:t}){return t8(e,t)}build(e,t,s){tL(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return tK(e,t,s)}}let t9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function se(e){if("string"!=typeof e||e.includes("-"));else if(t9.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let st=(0,m.createContext)({strict:!1}),ss=(0,m.createContext)({});function si(e){return Array.isArray(e)?e.join(" "):e}let sr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sn(e,t,s){for(let i in t)ek(t[i])||tQ(i,s)||(e[i]=t[i])}let sa=()=>({...sr(),attrs:{}}),so=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sl(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||so.has(e)}let sc=e=>!sl(e);try{u=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof u&&(sc=e=>e.startsWith("on")?!sl(e):u(e))}catch{}function sd(e){return ek(e)?e.get():e}let su=e=>(t,s)=>{let i=(0,m.useContext)(ss),r=(0,m.useContext)(v),n=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},s,i,r){return{latestValues:function(e,t,s,i){let r={},n=i(e,{});for(let e in n)r[e]=sd(n[e]);let{initial:a,animate:o}=e,l=tj(e),c=tk(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===o&&(o=t.animate));let d=!!s&&!1===s.initial,u=(d=d||!1===a)?o:a;if(u&&"boolean"!=typeof u&&!ty(u)){let t=Array.isArray(u)?u:[u];for(let s=0;s<t.length;s++){let i=tN(e,t[s]);if(i){let{transitionEnd:e,transition:t,...s}=i;for(let e in s){let t=s[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(r[e]=t)}for(let t in e)r[t]=e[t]}}}return r}(s,i,r,e),renderState:t()}})(e,t,i,r);return s?n():x(n)},sh=su({scrapeMotionValuesFromProps:tK,createRenderState:sr}),sm=su({scrapeMotionValuesFromProps:tH,createRenderState:sa}),sp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},sf=!1;function sx(){return!function(){if(sf)return;let e={};for(let t in sp)e[t]={isEnabled:e=>sp[t].some(t=>!!e[t])};tC=e,sf=!0}(),tC}let sg=Symbol.for("motionComponentSymbol"),sy="data-"+tA("framerAppearId"),sv=(0,m.createContext)({});function sb(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function sw(e,{forwardMotionProps:t=!1,type:s}={},i,r){i&&function(e){let t=sx();for(let s in e)t[s]={...t[s],...e[s]};tC=t}(i);let n=s?"svg"===s:se(e),a=n?sm:sh;function o(s,i){var o;let l,c,d,u={...(0,m.useContext)(k),...s,layoutId:function({layoutId:e}){let t=(0,m.useContext)(f).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:p}=u,x=function(e){let{initial:t,animate:s}=function(e,t){if(tj(e)){let{initial:t,animate:s}=e;return{initial:!1===t||tv(t)?t:void 0,animate:tv(s)?s:void 0}}return!1!==e.inherit?t:{}}(e,(0,m.useContext)(ss));return(0,m.useMemo)(()=>({initial:t,animate:s}),[si(t),si(s)])}(s),b=a(s,p);if(!p&&g){(0,m.useContext)(st).strict;let t=function(e){let{drag:t,layout:s}=sx();if(!t&&!s)return{};let i={...t,...s};return{MeasureLayout:t?.isEnabled(e)||s?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);l=t.MeasureLayout,x.visualElement=function(e,t,s,i,r,n){let{visualElement:a}=(0,m.useContext)(ss),o=(0,m.useContext)(st),l=(0,m.useContext)(v),c=(0,m.useContext)(k).reducedMotion,d=(0,m.useRef)(null),u=(0,m.useRef)(!1);i=i||o.renderer,!d.current&&i&&(d.current=i(e,{visualState:t,parent:a,props:s,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,isSVG:n}),u.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let h=d.current,p=(0,m.useContext)(sv);h&&!h.projection&&r&&("html"===h.type||"svg"===h.type)&&function(e,t,s,i){let{layoutId:r,layout:n,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:r,layout:n,alwaysMeasureLayout:!!a||o&&sb(o),visualElement:e,animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c})}(d.current,s,r,p);let f=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&f.current&&h.update(s,l)});let x=s[sy],g=(0,m.useRef)(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return y(()=>{u.current=!0,h&&(f.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),g.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!g.current&&h.animationState&&h.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),g.current=!1),h.enteringChildren=void 0)}),h}(e,b,u,r,t.ProjectionNode,n)}return(0,h.jsxs)(ss.Provider,{value:x,children:[l&&x.visualElement?(0,h.jsx)(l,{visualElement:x.visualElement,...u}):null,function(e,t,s,{latestValues:i},r,n=!1,a){let o=(a??se(e)?function(e,t,s,i){let r=(0,m.useMemo)(()=>{let s=sa();return tI(s,t,t_(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let t={};sn(t,e.style,e),r.style={...t,...r.style}}return r}:function(e,t){let s,i,r={},n=(s=e.style||{},sn(i={},s,e),Object.assign(i,function({transformTemplate:e},t){return(0,m.useMemo)(()=>{let s=sr();return tL(s,t,e),Object.assign({},s.vars,s.style)},[t])}(e,t)),i);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r})(t,i,r,e),l=function(e,t,s){let i={};for(let r in e)("values"!==r||"object"!=typeof e.values)&&(sc(r)||!0===s&&sl(r)||!t&&!sl(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}(t,"string"==typeof e,n),c=e!==m.Fragment?{...l,...o,ref:s}:{},{children:d}=t,u=(0,m.useMemo)(()=>ek(d)?d.get():d,[d]);return(0,m.createElement)(e,{...c,children:u})}(e,s,(o=x.visualElement,c=(0,m.useRef)(i),(0,m.useInsertionEffect)(()=>{c.current=i}),d=(0,m.useRef)(null),(0,m.useCallback)(e=>{e&&b.onMount?.(e),o&&(e?o.mount(e):o.unmount());let t=c.current;if("function"==typeof t)if(e){let s=t(e);"function"==typeof s&&(d.current=s)}else d.current?(d.current(),d.current=null):t(e);else t&&(t.current=e)},[o])),b,p,t,n)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,m.forwardRef)(o);return l[sg]=e,l}class sj{constructor(e){this.isMounted=!1,this.node=e}update(){}}function sk(e,t,s){let i=e.getProps();return tN(i,t,void 0!==s?s:i.custom,e)}function sS(e,t){return e?.[t]??e?.default??e}let sN=e=>Array.isArray(e);function sT(e,t){let s=e.getValue("willChange");if(ek(s)&&s.add)return s.add(t);if(!s&&eZ.WillChange){let s=new eZ.WillChange("auto");e.addValue("willChange",s),s.add(t)}}let sC=e=>1e3*e,sP=(e,t)=>s=>t(e(s)),sM=(...e)=>e.reduce(sP),sA={layout:0,mainThread:0,waapi:0};function sE(e,t,s){return(s<0&&(s+=1),s>1&&(s-=1),s<1/6)?e+(t-e)*6*s:s<.5?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function sR(e,t){return s=>s>0?t:e}let sD=(e,t,s)=>{let i=e*e,r=s*(t*t-i)+i;return r<0?0:Math.sqrt(r)},sL=[Q,W,ee];function sV(e){let t=sL.find(t=>t.test(e));if(eP(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===ee&&(s=function({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,s/=100;let r=0,n=0,a=0;if(t/=100){let i=s<.5?s*(1+t):s+t-s*t,o=2*s-i;r=sE(o,i,e+1/3),n=sE(o,i,e),a=sE(o,i,e-1/3)}else r=n=a=s;return{red:Math.round(255*r),green:Math.round(255*n),blue:Math.round(255*a),alpha:i}}(s)),s}let sF=(e,t)=>{let s=sV(e),i=sV(t);if(!s||!i)return sR(e,t);let r={...s};return e=>(r.red=sD(s.red,i.red,e),r.green=sD(s.green,i.green,e),r.blue=sD(s.blue,i.blue,e),r.alpha=tq(s.alpha,i.alpha,e),W.transform(r))},sO=new Set(["none","hidden"]);function sI(e,t){return s=>tq(e,t,s)}function s$(e){return"number"==typeof e?sI:"string"==typeof e?eD(e)?sR:et.test(e)?sF:sz:Array.isArray(e)?s_:"object"==typeof e?et.test(e)?sF:sB:sR}function s_(e,t){let s=[...e],i=s.length,r=e.map((e,s)=>s$(e)(e,t[s]));return e=>{for(let t=0;t<i;t++)s[t]=r[t](e);return s}}function sB(e,t){let s={...e,...t},i={};for(let r in s)void 0!==e[r]&&void 0!==t[r]&&(i[r]=s$(e[r])(e[r],t[r]));return e=>{for(let t in i)s[t]=i[t](e);return s}}let sz=(e,t)=>{let s=ed.createTransformer(t),i=ea(e),r=ea(t);if(!(i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length))return eP(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),sR(e,t);if(sO.has(e)&&!r.values.length||sO.has(t)&&!i.values.length)return sO.has(e)?s=>s<=0?e:t:s=>s>=1?t:e;return sM(s_(function(e,t){let s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){let n=t.types[r],a=e.indexes[n][i[n]],o=e.values[a]??0;s[r]=o,i[n]++}return s}(i,r),r.values),s)};function sU(e,t,s){return"number"==typeof e&&"number"==typeof t&&"number"==typeof s?tq(e,t,s):s$(e)(e,t)}let sq=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>e1.update(t,e),stop:()=>e2(t),now:()=>e4.isProcessing?e4.timestamp:td.now()}},sW=(e,t,s=10)=>{let i="",r=Math.max(Math.round(t/s),2);for(let t=0;t<r;t++)i+=Math.round(1e4*e(t/(r-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`};function sQ(e){let t=0,s=e.next(t);for(;!s.done&&t<2e4;)t+=50,s=e.next(t);return t>=2e4?1/0:t}function sK(e,t,s){var i,r;let n=Math.max(t-5,0);return i=s-e(n),(r=t-n)?1e3/r*i:0}let sH=.01,sX=2,sY=.005,sG=.5;function sZ(e,t){return e*Math.sqrt(1-t*t)}let sJ=["duration","bounce"],s0=["stiffness","damping","mass"];function s1(e,t){return t.some(t=>void 0!==e[t])}function s2(e=.3,t=.3){let s,i="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:n}=i,a=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:d,mass:u,duration:h,velocity:m,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!s1(e,s0)&&s1(e,sJ))if(e.visualDuration){let s=2*Math.PI/(1.2*e.visualDuration),i=s*s,r=2*V(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:r}}else{let s=function({duration:e=800,bounce:t=.3,velocity:s=0,mass:i=1}){let r,n;eP(e<=sC(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=V(.05,1,a),e=V(.01,10,e/1e3),a<1?(r=t=>{let i=t*a,r=i*e;return .001-(i-s)/sZ(t,a)*Math.exp(-r)},n=t=>{let i=t*a*e,n=Math.pow(a,2)*Math.pow(t,2)*e,o=Math.exp(-i),l=sZ(Math.pow(t,2),a);return(i*s+s-n)*o*(-r(t)+.001>0?-1:1)/l}):(r=t=>-.001+Math.exp(-t*e)*((t-s)*e+1),n=t=>e*e*(s-t)*Math.exp(-t*e));let o=function(e,t,s){let i=s;for(let s=1;s<12;s++)i-=e(i)/t(i);return i}(r,n,5/e);if(e=sC(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}(e);(t={...t,...s,mass:1}).isResolvedFromDuration=!0}return t}({...i,velocity:-((i.velocity||0)/1e3)}),f=m||0,x=d/(2*Math.sqrt(c*u)),g=o-a,y=Math.sqrt(c/u)/1e3,v=5>Math.abs(g);if(r||(r=v?sH:sX),n||(n=v?sY:sG),x<1){let e=sZ(y,x);s=t=>o-Math.exp(-x*y*t)*((f+x*y*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(1===x)s=e=>o-Math.exp(-y*e)*(g+(f+y*g)*e);else{let e=y*Math.sqrt(x*x-1);s=t=>{let s=Math.exp(-x*y*t),i=Math.min(e*t,300);return o-s*((f+x*y*g)*Math.sinh(i)+e*g*Math.cosh(i))/e}}let b={calculatedDuration:p&&h||null,next:e=>{let t=s(e);if(p)l.done=e>=h;else{let i=0===e?f:0;x<1&&(i=0===e?sC(f):sK(s,e,t));let a=Math.abs(o-t)<=n;l.done=Math.abs(i)<=r&&a}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(sQ(b),2e4),t=sW(t=>b.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return b}function s4({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:d}){let u,h,m=e[0],p={done:!1,value:m},f=s*t,x=m+f,g=void 0===a?x:a(x);g!==x&&(f=g-m);let y=e=>-f*Math.exp(-e/i),v=e=>g+y(e),b=e=>{let t=y(e),s=v(e);p.done=Math.abs(t)<=c,p.value=p.done?g:s},w=e=>{let t;if(t=p.value,void 0!==o&&t<o||void 0!==l&&t>l){var s;u=e,h=s2({keyframes:[p.value,(s=p.value,void 0===o?l:void 0===l||Math.abs(o-s)<Math.abs(l-s)?o:l)],velocity:sK(v,e,p.value),damping:r,stiffness:n,restDelta:c,restSpeed:d})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==u||(t=!0,b(e),w(e)),void 0!==u&&e>=u)?h.next(e-u):(t||b(e),p)}}}s2.applyToOptions=e=>{let t=function(e,t=100,s){let i=s({...e,keyframes:[0,t]}),r=Math.min(sQ(i),2e4);return{type:"keyframes",ease:e=>i.next(r*e).value/t,duration:r/1e3}}(e,100,s2);return e.ease=t.ease,e.duration=sC(t.duration),e.type="keyframes",e};let s5=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e;function s3(e,t,s,i){return e===t&&s===i?eG:r=>0===r||1===r?r:s5(function(e,t,s,i,r){let n,a,o=0;do(n=s5(a=t+(s-t)/2,i,r)-e)>0?s=a:t=a;while(Math.abs(n)>1e-7&&++o<12)return a}(r,0,1,e,s),t,i)}let s6=s3(.42,0,1,1),s8=s3(0,0,.58,1),s7=s3(.42,0,.58,1),s9=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ie=e=>t=>1-e(1-t),it=s3(.33,1.53,.69,.99),is=ie(it),ii=s9(is),ir=e=>(e*=2)<1?.5*is(e):.5*(2-Math.pow(2,-10*(e-1))),ia=e=>1-Math.sin(Math.acos(e)),io=ie(ia),il=s9(ia),ic=e=>Array.isArray(e)&&"number"==typeof e[0],id={linear:eG,easeIn:s6,easeInOut:s7,easeOut:s8,circIn:ia,circInOut:il,circOut:io,backIn:is,backInOut:ii,backOut:it,anticipate:ir},iu=e=>{if(ic(e)){eM(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,s,i,r]=e;return s3(t,s,i,r)}return"string"==typeof e?(eM(void 0!==id[e],`Invalid easing type '${e}'`,"invalid-easing-type"),id[e]):e},ih=(e,t,s)=>{let i=t-e;return 0===i?1:(s-e)/i};function im({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){var r;let n,a=Array.isArray(i)&&"number"!=typeof i[0]?i.map(iu):iu(i),o={done:!1,value:t[0]},l=function(e,t,{clamp:s=!0,ease:i,mixer:r}={}){let n=e.length;if(eM(n===t.length,"Both input and output ranges must be the same length","range-length"),1===n)return()=>t[0];if(2===n&&t[0]===t[1])return()=>t[1];let a=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,s){let i=[],r=s||eZ.mix||sU,n=e.length-1;for(let s=0;s<n;s++){let n=r(e[s],e[s+1]);t&&(n=sM(Array.isArray(t)?t[s]||eG:t,n)),i.push(n)}return i}(t,i,r),l=o.length,c=s=>{if(a&&s<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(s<e[i+1]);i++);let r=ih(e[i],e[i+1],s);return o[i](r)};return s?t=>c(V(e[0],e[n-1],t)):c}((r=s&&s.length===t.length?s:(!function(e,t){let s=e[e.length-1];for(let i=1;i<=t;i++){let r=ih(0,t,i);e.push(tq(s,1,r))}}(n=[0],t.length-1),n),r.map(t=>t*e)),t,{ease:Array.isArray(a)?a:t.map(()=>a||s7).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}let ip=e=>null!==e;function ix(e,{repeat:t,repeatType:s="loop"},i,r=1){let n=e.filter(ip),a=r<0||t&&"loop"!==s&&t%2==1?0:n.length-1;return a&&void 0!==i?i:n[a]}let ig={decay:s4,inertia:s4,tween:im,keyframes:im,spring:s2};function iy(e){"string"==typeof e.type&&(e.type=ig[e.type])}class iv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let ib=e=>e/100;class iw extends iv{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==td.now()&&this.tick(td.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},sA.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iy(e);let{type:t=im,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:n=0}=e,{keyframes:a}=e,o=t||im;o!==im&&"number"!=typeof a[0]&&(this.mixKeyframes=sM(ib,sU(a[0],a[1])),a=[0,100]);let l=o({...e,keyframes:a});"mirror"===r&&(this.mirroredGenerator=o({...e,keyframes:[...a].reverse(),velocity:-n})),null===l.calculatedDuration&&(l.calculatedDuration=sQ(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:n,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return s.next(0);let{delay:l=0,keyframes:c,repeat:d,repeatType:u,repeatDelay:h,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?x<0:x>i;this.currentTime=Math.max(x,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let y=this.currentTime,v=s;if(d){let e=Math.min(this.currentTime,i)/a,t=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&t--,(t=Math.min(t,d+1))%2&&("reverse"===u?(s=1-s,h&&(s-=h/a)):"mirror"===u&&(v=n)),y=V(0,1,s)*a}let b=g?{done:!1,value:c[0]}:v.next(y);r&&(b.value=r(b.value));let{done:w}=b;g||null===o||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&m!==s4&&(b.value=ix(c,this.options,f,this.speed)),p&&p(b.value),j&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=sC(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(td.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=sq,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(td.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,sA.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function ij(e){let t;return()=>(void 0===t&&(t=e()),t)}let ik=ij(()=>void 0!==window.ScrollTimeline),iS={},iN=(s=ij(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>iS.linearEasing??s()),iT=([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,iC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:iT([0,.65,.55,1]),circOut:iT([.55,0,1,.45]),backIn:iT([.31,.01,.66,-.59]),backOut:iT([.33,1.53,.69,.99])};function iP(e){return"function"==typeof e&&"applyToOptions"in e}class iM extends iv{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:i,pseudoElement:r,allowFlatten:n=!1,finalKeyframe:a,onComplete:o}=e;this.isPseudoElement=!!r,this.allowFlatten=n,this.options=e,eM("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return iP(e)&&iN()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,s,{delay:i=0,duration:r=300,repeat:n=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c){let d={[t]:s};l&&(d.offset=l);let u=function e(t,s){if(t)return"function"==typeof t?iN()?sW(t,s):"ease-out":ic(t)?iT(t):Array.isArray(t)?t.map(t=>e(t,s)||iC.easeOut):iC[t]}(o,r);Array.isArray(u)&&(d.easing=u);let h={delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:n+1,direction:"reverse"===a?"alternate":"normal"};c&&(h.pseudoElement=c);let m=e.animate(d,h);return m}(t,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){let e=ix(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(e):s.startsWith("--")?t.style.setProperty(s,e):t.style[s]=e,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sC(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&ik())?(this.animation.timeline=e,eG):t(this)}}let iA={anticipate:ir,backInOut:ii,circInOut:il};class iE extends iM{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iA&&(e.ease=iA[e.ease])}(e),iy(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:s,onComplete:i,element:r,...n}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let a=new iw({...n,autoplay:!1}),o=Math.max(10,td.now()-this.startTime),l=V(0,10,o-10);t.setWithVelocity(a.sample(Math.max(0,o-l)).value,a.sample(o).value,l),a.stop()}}let iR=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(ed.test(e)||"0"===e)&&!e.startsWith("url("));function iD(e){e.duration=0,e.type="keyframes"}let iL=new Set(["opacity","clipPath","filter","transform"]),iV=ij(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class iF extends iv{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:n="loop",keyframes:a,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=td.now();const u={autoplay:e,delay:t,type:s,repeat:i,repeatDelay:r,repeatType:n,name:o,motionValue:l,element:c,...d},h=c?.KeyframeResolver||tt;this.keyframeResolver=new h(a,(e,t,s)=>this.onKeyframesResolved(e,t,u,!s),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,i){this.keyframeResolver=void 0;let{name:r,type:n,velocity:a,delay:o,isHandoff:l,onUpdate:c}=s;this.resolvedAt=td.now(),!function(e,t,s,i){let r=e[0];if(null===r)return!1;if("display"===t||"visibility"===t)return!0;let n=e[e.length-1],a=iR(r,t),o=iR(n,t);return eP(a===o,`You are trying to animate ${t} from "${r}" to "${n}". "${a?n:r}" is not an animatable value.`,"value-not-animatable"),!!a&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}(e)||("spring"===s||iP(s))&&i)}(e,r,n,a)&&((eZ.instantAnimations||!o)&&c?.(ix(e,s,t)),e[0]=e[e.length-1],iD(s),s.repeat=0);let d={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},u=!l&&function(e){let{motionValue:t,name:s,repeatDelay:i,repeatType:r,damping:n,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return iV()&&s&&iL.has(s)&&("transform"!==s||!l)&&!o&&!i&&"mirror"!==r&&0!==n&&"inertia"!==a}(d),h=d.motionValue?.owner?.current,m=u?new iE({...d,element:h}):new iw(d);m.finished.then(()=>{this.notifyFinished()}).catch(eG),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),e7=!0,te(),e9(),e7=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let iO={type:"spring",stiffness:500,damping:25,restSpeed:10},iI={type:"keyframes",duration:.8},i$={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},i_=e=>null!==e,iB=(e,t,s,i={},r,n)=>a=>{let o=sS(i,e)||{},l=o.delay||i.delay||0,{elapsed:c=0}=i;c-=sC(l);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:n?void 0:r};!function({when:e,delay:t,delayChildren:s,staggerChildren:i,staggerDirection:r,repeat:n,repeatType:a,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}(o)&&Object.assign(d,((e,{keyframes:t})=>t.length>2?iI:L.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:iO:i$)(e,d)),d.duration&&(d.duration=sC(d.duration)),d.repeatDelay&&(d.repeatDelay=sC(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(iD(d),0===d.delay&&(u=!0)),(eZ.instantAnimations||eZ.skipAnimations)&&(u=!0,iD(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!n&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:s="loop"},i){let r=e.filter(i_),n=t&&"loop"!==s&&t%2==1?0:r.length-1;return r[n]}(d.keyframes,o);if(void 0!==e)return void e1.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iw(d):new iF(d)};function iz(e,t,{delay:s=0,transitionOverride:i,type:r}={}){let{transition:n=e.getDefaultTransition(),transitionEnd:a,...o}=t;i&&(n=i);let l=[],c=r&&e.animationState&&e.animationState.getState()[r];for(let t in o){let i=e.getValue(t,e.latestValues[t]??null),r=o[t];if(void 0===r||c&&function({protectedKeys:e,needsAnimating:t},s){let i=e.hasOwnProperty(s)&&!0!==t[s];return t[s]=!1,i}(c,t))continue;let a={delay:s,...sS(n||{},t)},d=i.get();if(void 0!==d&&!i.isAnimating&&!Array.isArray(r)&&r===d&&!a.velocity)continue;let u=!1;if(window.MotionHandoffAnimation){let s=e.props[sy];if(s){let e=window.MotionHandoffAnimation(s,t,e1);null!==e&&(a.startTime=e,u=!0)}}sT(e,t),i.start(iB(t,i,r,e.shouldReduceMotion&&eS.has(t)?{type:!1}:a,e,u));let h=i.animation;h&&l.push(h)}return a&&Promise.all(l).then(()=>{e1.update(()=>{a&&function(e,t){let{transitionEnd:s={},transition:i={},...r}=sk(e,t)||{};for(let t in r={...r,...s}){var n;let s=sN(n=r[t])?n[n.length-1]||0:n;e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,th(s))}}(e,a)})}),l}function iU(e,t,s,i=0,r=1){let n=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),a=e.size,o=(a-1)*i;return"function"==typeof s?s(n,a):1===r?n*i:o-n*i}function iq(e,t,s={}){let i=sk(e,t,"exit"===s.type?e.presenceContext?.custom:void 0),{transition:r=e.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(r=s.transitionOverride);let n=i?()=>Promise.all(iz(e,i,s)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(i=0)=>{let{delayChildren:n=0,staggerChildren:a,staggerDirection:o}=r;return function(e,t,s=0,i=0,r=0,n=1,a){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(iq(l,t,{...a,delay:s+("function"==typeof i?0:i)+iU(e.variantChildren,l,i,r,n)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,i,n,a,o,s)}:()=>Promise.resolve(),{when:o}=r;if(!o)return Promise.all([n(),a(s.delay)]);{let[e,t]="beforeChildren"===o?[n,a]:[a,n];return e().then(()=>t())}}let iW=tw.length;function iQ(e,t){if(!Array.isArray(t))return!1;let s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}let iK=[...tb].reverse(),iH=tb.length;function iX(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iY(){return{animate:iX(!0),whileInView:iX(),whileHover:iX(),whileTap:iX(),whileDrag:iX(),whileFocus:iX(),exit:iX()}}let iG=0;function iZ(e){return[e("x"),e("y")]}let iJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function i0(e){return iJ.has(e.tagName)||!0===e.isContentEditable}function i1(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s)}let i2={x:!1,y:!1};function i4(e){return e.max-e.min}function i5(e,t,s,i=.5){e.origin=i,e.originPoint=tq(t.min,t.max,e.origin),e.scale=i4(s)/i4(t),e.translate=tq(s.min,s.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function i3(e,t,s,i){i5(e.x,t.x,s.x,i?i.originX:void 0),i5(e.y,t.y,s.y,i?i.originY:void 0)}function i6(e,t,s){e.min=s.min+t.min,e.max=e.min+i4(t)}function i8(e,t,s){e.min=t.min-s.min,e.max=e.min+i4(t)}function i7(e,t,s){i8(e.x,t.x,s.x),i8(e.y,t.y,s.y)}let i9=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function re(e){return{point:{x:e.pageX,y:e.pageY}}}function rt(e,t,s,i){return i1(e,t,e=>i9(e)&&s(e,re(e)),i)}let rs=({current:e})=>e?e.ownerDocument.defaultView:null,ri=(e,t)=>Math.abs(e-t),rr=new Set(["auto","scroll"]);class rn{constructor(e,t,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:n=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=rl(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,r=(e=s.offset,t={x:0,y:0},Math.sqrt(ri(e.x,t.x)**2+ri(e.y,t.y)**2)>=this.distanceThreshold);if(!i&&!r)return;let{point:n}=s,{timestamp:a}=e4;this.history.push({...n,timestamp:a});let{onStart:o,onMove:l}=this.handlers;i||(o&&o(this.lastMoveEvent,s),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,s)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ra(t,this.transformPagePoint),e1.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:s,onSessionEnd:i,resumeAnimation:r}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&r&&r(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=rl("pointercancel"===e.type?this.lastMoveEventInfo:ra(t,this.transformPagePoint),this.history);this.startEvent&&s&&s(e,n),i&&i(e,n)},!i9(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=s,this.distanceThreshold=n,this.contextWindow=i||window;const o=ra(re(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=e4;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,rl(o,this.history)),this.removeListeners=sM(rt(this.contextWindow,"pointermove",this.handlePointerMove),rt(this.contextWindow,"pointerup",this.handlePointerUp),rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(rr.has(e.overflowX)||rr.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-t.x,y:i.y-t.y};(0!==r.x||0!==r.y)&&(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),e1.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),e2(this.updatePoint)}}function ra(e,t){return t?{point:t(e.point)}:e}function ro(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rl({point:e},t){return{point:e,delta:ro(e,rc(t)),offset:ro(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null,r=rc(e);for(;s>=0&&(i=e[s],!(r.timestamp-i.timestamp>sC(.1)));)s--;if(!i)return{x:0,y:0};let n=(r.timestamp-i.timestamp)/1e3;if(0===n)return{x:0,y:0};let a={x:(r.x-i.x)/n,y:(r.y-i.y)/n};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t,.1)}}function rc(e){return e[e.length-1]}function rd(e,t,s){return{min:void 0!==t?e.min+t:void 0,max:void 0!==s?e.max+s-(e.max-e.min):void 0}}function ru(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function rh(e,t,s){return{min:rm(e,t),max:rm(e,s)}}function rm(e,t){return"number"==typeof e?e:e[t]||0}let rp=new WeakMap;class rf{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ej(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:s}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let r=e=>{t?(this.stopAnimation(),this.snapToCursor(re(e).point)):this.pauseAnimation()},n=(e,t)=>{this.stopAnimation();let{drag:s,dragPropagation:i,onDragStart:r}=this.getProps();if(s&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(i2[e])return null;else return i2[e]=!0,()=>{i2[e]=!1};return i2.x||i2.y?null:(i2.x=i2.y=!0,()=>{i2.x=i2.y=!1})}(s),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iZ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(X.test(t)){let{projection:s}=this.visualElement;if(s&&s.layout){let i=s.layout.layoutBox[e];i&&(t=i4(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),r&&e1.postRender(()=>r(e,t)),sT(this.visualElement,"transform");let{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:s,dragDirectionLock:i,onDirectionLock:r,onDrag:n}=this.getProps();if(!s&&!this.openDragLock)return;let{offset:a}=t;if(i&&null===this.currentDirection){this.currentDirection=function(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}(a),null!==this.currentDirection&&r&&r(this.currentDirection);return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),n&&n(e,t)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>iZ(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new rn(e,{onSessionStart:r,onStart:n,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:rs(this.visualElement),element:this.visualElement.current})}stop(e,t){let s=e||this.latestPointerEvent,i=t||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;let{velocity:n}=i;this.startAnimation(n);let{onDragEnd:a}=this.getProps();a&&e1.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,s){let{drag:i}=this.getProps();if(!s||!rx(e,i,this.currentDirection))return;let r=this.getAxisMotionValue(e),n=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(n=function(e,{min:t,max:s},i){return void 0!==t&&e<t?e=i?tq(t,e,i.min):Math.max(e,t):void 0!==s&&e>s&&(e=i?tq(s,e,i.max):Math.min(e,s)),e}(n,this.constraints[e],this.elastic[e])),r.set(n)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&sb(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(e,{top:t,left:s,bottom:i,right:r}){return{x:rd(e.x,s,r),y:rd(e.y,t,i)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:rh(e,"left","right"),y:rh(e,"top","bottom")}}(t),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&iZ(e=>{var t,i;let r;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=s.layoutBox[e],i=this.constraints[e],r={},void 0!==i.min&&(r.min=i.min-t.min),void 0!==i.max&&(r.max=i.max-t.min),r))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!sb(t))return!1;let i=t.current;eM(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let n=function(e,t,s){let i=t8(e,s),{scroll:r}=t;return r&&(t5(i.x,r.offset.x),t5(i.y,r.offset.y)),i}(i,r.root,this.visualElement.getTransformPagePoint()),a=(e=r.layout.layoutBox,{x:ru(e.x,n.x),y:ru(e.y,n.y)});if(s){let e=s(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=tY(e))}return a}startAnimation(e){let{drag:t,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{};return Promise.all(iZ(a=>{if(!rx(a,t,this.currentDirection))return;let l=o&&o[a]||{};n&&(l={min:0,max:0});let c={type:"inertia",velocity:s?e[a]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(a,c)})).then(a)}startAxisValueAnimation(e,t){let s=this.getAxisMotionValue(e);return sT(this.visualElement,e),s.start(iB(e,s,0,t,this.visualElement,!1))}stopAnimation(){iZ(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iZ(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps();return s[t]||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){iZ(t=>{let{drag:s}=this.getProps();if(!rx(t,s,this.currentDirection))return;let{projection:i}=this.visualElement,r=this.getAxisMotionValue(t);if(i&&i.layout){let{min:s,max:n}=i.layout.layoutBox[t],a=r.get()||0;r.set(e[t]-tq(s,n,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:s}=this.visualElement;if(!sb(t)||!s||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};iZ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var s,r;let n,a,o,l=t.get();i[e]=(s={min:l,max:l},r=this.constraints[e],n=.5,a=i4(s),(o=i4(r))>a?n=ih(r.min,r.max-a,s.min):a>o&&(n=ih(s.min,s.max-o,r.min)),V(0,1,n))}});let{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),iZ(t=>{if(!rx(t,e,null))return;let s=this.getAxisMotionValue(t),{min:r,max:n}=this.constraints[t];s.set(tq(r,n,i[t]))})}addListeners(){if(!this.visualElement.current)return;rp.set(this.visualElement,this);let e=this.visualElement.current,t=rt(e,"pointerdown",t=>{let{drag:s,dragListener:i=!0}=this.getProps(),r=t.target,n=r!==e&&i0(r);s&&i&&!n&&this.start(t)}),s=()=>{let{dragConstraints:e}=this.getProps();sb(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),e1.read(s);let n=i1(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iZ(t=>{let s=this.getAxisMotionValue(t);s&&(this.originPoint[t]+=e[t].translate,s.set(s.get()+e[t].translate))}),this.visualElement.render())});return()=>{n(),t(),r(),a&&a()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:n=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:n,dragMomentum:a}}}function rx(e,t,s){return(!0===t||t===e)&&(null===s||s===e)}let rg=e=>(t,s)=>{e&&e1.postRender(()=>e(t,s))},ry={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var rv=m;let rb=!1;class rw extends rv.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(t.group&&t.group.add(r),s&&s.register&&i&&s.register(r),rb&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ry.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:s,drag:i,isPresent:r}=this.props,{projection:n}=s;return n&&(n.isPresent=r,e.layoutDependency!==t&&n.setOptions({...n.options,layoutDependency:t}),rb=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==r?n.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?n.promote():n.relegate()||e1.postRender(()=>{let e=n.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tl.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s}=this.props,{projection:i}=e;rb=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function rj(e){let[t,s]=M(),i=(0,rv.useContext)(f);return(0,h.jsx)(rw,{...e,layoutGroup:i,switchLayoutGroup:(0,rv.useContext)(sv),isPresent:t,safeToRemove:s})}function rk(e,t,s,i,r){return e-=t,e=i+1/s*(e-i),void 0!==r&&(e=i+1/r*(e-i)),e}function rS(e,t,[s,i,r],n,a){!function(e,t=0,s=1,i=.5,r,n=e,a=e){if(X.test(t)&&(t=parseFloat(t),t=tq(a.min,a.max,t/100)-a.min),"number"!=typeof t)return;let o=tq(n.min,n.max,i);e===n&&(o-=t),e.min=rk(e.min,t,s,o,r),e.max=rk(e.max,t,s,o,r)}(e,t[s],t[i],t[r],t.scale,n,a)}let rN=["x","scaleX","originX"],rT=["y","scaleY","originY"];function rC(e,t,s,i){rS(e.x,t,rN,s?s.x:void 0,i?i.x:void 0),rS(e.y,t,rT,s?s.y:void 0,i?i.y:void 0)}function rP(e,t){e.min=t.min,e.max=t.max}function rM(e,t){rP(e.x,t.x),rP(e.y,t.y)}function rA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rE(e){return 0===e.translate&&1===e.scale}function rR(e){return rE(e.x)&&rE(e.y)}function rD(e,t){return e.min===t.min&&e.max===t.max}function rL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rV(e,t){return rL(e.x,t.x)&&rL(e.y,t.y)}function rF(e){return i4(e.x)/i4(e.y)}function rO(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let rI=["TopLeft","TopRight","BottomLeft","BottomRight"],r$=rI.length,r_=e=>"string"==typeof e?parseFloat(e):e,rB=e=>"number"==typeof e||Y.test(e);function rz(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let rU=rW(0,.5,io),rq=rW(.5,.95,eG);function rW(e,t,s){return i=>i<e?0:i>t?1:s(ih(e,t,i))}function rQ(e){return b(e)&&"ownerSVGElement"in e}let rK=(e,t)=>e.depth-t.depth;class rH{constructor(){this.children=[],this.isDirty=!1}add(e){tn(this.children,e),this.isDirty=!0}remove(e){ta(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rK),this.isDirty=!1,this.children.forEach(e)}}class rX{constructor(){this.members=[]}add(e){tn(this.members,e),e.scheduleRender()}remove(e){if(ta(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,s=this.members.findIndex(t=>e===t);if(0===s)return!1;for(let e=s;e>=0;e--){let s=this.members[e];if(!1!==s.isPresent){t=s;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();let i=s.options.layoutDependency,r=e.options.layoutDependency;(void 0===i||void 0===r||i!==r)&&(e.resumeFrom=s,t&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));let{crossfade:n}=e.options;!1===n&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:s}=e;t.onExitComplete&&t.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let rY=["","X","Y","Z"],rG=0;function rZ(e,t,s,i){let{latestValues:r}=t;r[e]&&(s[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function rJ({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(e={},s=t?.()){this.id=rG++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(r2),this.nodes.forEach(r9),this.nodes.forEach(ne),this.nodes.forEach(r4)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new rH)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new to),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let s=this.eventHandlers.get(e);s&&s.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=rQ(t)&&!(rQ(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:s,layout:i,visualElement:r}=this.options;if(r&&!r.current&&r.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||s)&&(this.isLayoutDirty=!0),e){let s,i=0,r=()=>this.root.updateBlockedByResize=!1;e1.read(()=>{i=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==i){let t,n;i=e,this.root.updateBlockedByResize=!0,s&&s(),t=td.now(),n=({timestamp:e})=>{let s=e-t;s>=250&&(e2(n),r(s-250))},e1.setup(n,!0),s=()=>e2(n),ry.hasAnimatedSinceResize&&(ry.hasAnimatedSinceResize=!1,this.nodes.forEach(r7))}})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:s,layout:i})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||r.getDefaultTransition()||na,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=r.getProps(),l=!this.targetLayout||!rV(this.targetLayout,i),c=!t&&s;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...sS(n,"layout"),onPlay:a,onComplete:o};(r.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||r7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),e2(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nt),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:s}=t.options;if(!s)return;let i=s.props[sy];if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",e1,!(e||s))}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&e(r)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:s}=this.options;if(void 0===t&&!s)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r3);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(r6);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(r8),this.nodes.forEach(r0),this.nodes.forEach(r1)):this.nodes.forEach(r6),this.clearAllSnapshots();let e=td.now();e4.delta=V(0,1e3/60,e-e4.timestamp),e4.timestamp=e,e4.isProcessing=!0,e5.update.process(e4),e5.preRender.process(e4),e5.render.process(e4),e4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(r5),this.sharedNodes.forEach(ns)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,e1.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){e1.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||i4(this.snapshot.measuredBox.x)||i4(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ej(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!rR(this.projectionDelta),s=this.getTransformTemplate(),i=s?s(this.latestValues,""):void 0,n=i!==this.prevTransformTemplateValue;e&&this.instance&&(t||tJ(this.latestValues)||n)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let s=this.measurePageBox(),i=this.removeElementScroll(s);return e&&(i=this.removeTransform(i)),nc((t=i).x),nc(t.y),{animationId:this.root.animationId,measuredBox:s,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ej();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nu))){let{scroll:e}=this.root;e&&(t5(t.x,e.offset.x),t5(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ej();if(rM(t,e),this.scroll?.wasRoot)return t;for(let s=0;s<this.path.length;s++){let i=this.path[s],{scroll:r,options:n}=i;i!==this.root&&r&&n.layoutScroll&&(r.wasRoot&&rM(t,e),t5(t.x,r.offset.x),t5(t.y,r.offset.y))}return t}applyTransform(e,t=!1){let s=ej();rM(s,e);for(let e=0;e<this.path.length;e++){let i=this.path[e];!t&&i.options.layoutScroll&&i.scroll&&i!==i.root&&t6(s,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),tJ(i.latestValues)&&t6(s,i.latestValues)}return tJ(this.latestValues)&&t6(s,this.latestValues),s}removeTransform(e){let t=ej();rM(t,e);for(let e=0;e<this.path.length;e++){let s=this.path[e];if(!s.instance||!tJ(s.latestValues))continue;tZ(s.latestValues)&&s.updateSnapshot();let i=ej();rM(i,s.measurePageBox()),rC(t,s.latestValues,s.snapshot?s.snapshot.layoutBox:void 0,i)}return tJ(this.latestValues)&&rC(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==e4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==t;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:i,layoutId:r}=this.options;if(!this.layout||!(i||r))return;this.resolvedRelativeTargetAt=e4.timestamp;let n=this.getClosestProjectingParent();if(n&&this.linkedParentVersion!==n.layoutVersion&&!n.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(n&&n.layout?this.createRelativeTarget(n,this.layout.layoutBox,n.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=ej(),this.targetWithTransforms=ej()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var a,o,l;this.forceRelativeParentToResolveTarget(),a=this.target,o=this.relativeTarget,l=this.relativeParent.target,i6(a.x,o.x,l.x),i6(a.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rM(this.target,this.layout.layoutBox),t4(this.target,this.targetDelta)):rM(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,n&&!!n.resumingFrom==!!this.resumingFrom&&!n.options.layoutScroll&&n.target&&1!==this.animationProgress?this.createRelativeTarget(n,this.target,n.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||tZ(this.parent.latestValues)||t0(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,s){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ej(),this.relativeTargetOrigin=ej(),i7(this.relativeTargetOrigin,t,s),rM(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===e4.timestamp&&(s=!1),s)return;let{layout:i,layoutId:r}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||r))return;rM(this.layoutCorrected,this.layout.layoutBox);let n=this.treeScale.x,a=this.treeScale.y;!function(e,t,s,i=!1){let r,n,a=s.length;if(a){t.x=t.y=1;for(let o=0;o<a;o++){n=(r=s[o]).projectionDelta;let{visualElement:a}=r.options;(!a||!a.props.style||"contents"!==a.props.style.display)&&(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&t6(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),n&&(t.x*=n.x.scale,t.y*=n.y.scale,t4(e,n)),i&&tJ(r.latestValues)&&t6(e,r.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ej());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(rA(this.prevProjectionDelta.x,this.projectionDelta.x),rA(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),i3(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===n&&this.treeScale.y===a&&rO(this.projectionDelta.x,this.prevProjectionDelta.x)&&rO(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=eb(),this.projectionDelta=eb(),this.projectionDeltaWithTransform=eb()}setAnimationOrigin(e,t=!1){let s,i=this.snapshot,r=i?i.latestValues:{},n={...this.latestValues},a=eb();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=ej(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(nn));this.animationProgress=0,this.mixTargetDelta=t=>{let i=t/1e3;if(ni(a.x,e.x,i),ni(a.y,e.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,m,p,f,x;i7(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=o,x=i,nr(m.x,p.x,f.x,x),nr(m.y,p.y,f.y,x),s&&(c=this.relativeTarget,h=s,rD(c.x,h.x)&&rD(c.y,h.y))&&(this.isProjectionDirty=!1),s||(s=ej()),rM(s,this.relativeTarget)}l&&(this.animationValues=n,function(e,t,s,i,r,n){r?(e.opacity=tq(0,s.opacity??1,rU(i)),e.opacityExit=tq(t.opacity??1,0,rq(i))):n&&(e.opacity=tq(t.opacity??1,s.opacity??1,i));for(let r=0;r<r$;r++){let n=`border${rI[r]}Radius`,a=rz(t,n),o=rz(s,n);(void 0!==a||void 0!==o)&&(a||(a=0),o||(o=0),0===a||0===o||rB(a)===rB(o)?(e[n]=Math.max(tq(r_(a),r_(o),i),0),(X.test(o)||X.test(a))&&(e[n]+="%")):e[n]=o)}(t.rotate||s.rotate)&&(e.rotate=tq(t.rotate||0,s.rotate||0,i))}(n,r,this.latestValues,i,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(e2(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=e1.update(()=>{var t,s,i;let r;ry.hasAnimatedSinceResize=!0,sA.layout++,this.motionValue||(this.motionValue=th(0)),this.currentAnimation=(t=this.motionValue,s=[0,1e3],i={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{sA.layout--},onComplete:()=>{sA.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(r=ek(t)?t:th(t)).start(iB("",r,s,i)),r.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:s,layout:i,latestValues:r}=e;if(t&&s&&i){if(this!==e&&this.layout&&i&&nd(this.options.animationType,this.layout.layoutBox,i.layoutBox)){s=this.target||ej();let t=i4(this.layout.layoutBox.x);s.x.min=e.target.x.min,s.x.max=s.x.min+t;let i=i4(this.layout.layoutBox.y);s.y.min=e.target.y.min,s.y.max=s.y.min+i}rM(t,s),t6(t,r),i3(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rX),this.sharedNodes.get(e).add(t);let s=t.options.initialPromotionConfig;t.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:s}={}){let i=this.getStack();i&&i.promote(this,s),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:s}=e;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(t=!0),!t)return;let i={};s.z&&rZ("z",e,i,this.animationValues);for(let t=0;t<rY.length;t++)rZ(`rotate${rY[t]}`,e,i,this.animationValues),rZ(`skew${rY[t]}`,e,i,this.animationValues);for(let t in e.render(),i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=sd(t?.pointerEvents)||"",e.transform=s?s(this.latestValues,""):"none";return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=sd(t?.pointerEvents)||""),this.hasProjected&&!tJ(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1);return}e.visibility="";let r=i.animationValues||i.latestValues;this.applyTransformsToTarget();let n=function(e,t,s){let i="",r=e.x.translate/t.x,n=e.y.translate/t.y,a=s?.z||0;if((r||n||a)&&(i=`translate3d(${r}px, ${n}px, ${a}px) `),(1!==t.x||1!==t.y)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){let{transformPerspective:e,rotate:t,rotateX:r,rotateY:n,skewX:a,skewY:o}=s;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),r&&(i+=`rotateX(${r}deg) `),n&&(i+=`rotateY(${n}deg) `),a&&(i+=`skewX(${a}deg) `),o&&(i+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r);s&&(n=s(r,n)),e.transform=n;let{x:a,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*a.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?r.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:e.opacity=i===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0,tW){if(void 0===r[t])continue;let{correct:s,applyTo:a,isCSSVariable:o}=tW[t],l="none"===n?r[t]:s(r[t],i);if(a){let t=a.length;for(let s=0;s<t;s++)e[a[s]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=i===this?sd(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(r3),this.root.sharedNodes.clear()}}}function r0(e){e.updateLayout()}function r1(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:s,measuredBox:i}=e.layout,{animationType:r}=e.options,n=t.source!==e.layout.source;"size"===r?iZ(e=>{let i=n?t.measuredBox[e]:t.layoutBox[e],r=i4(i);i.min=s[e].min,i.max=i.min+r}):nd(r,t.layoutBox,s)&&iZ(i=>{let r=n?t.measuredBox[i]:t.layoutBox[i],a=i4(s[i]);r.max=r.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+a)});let a=eb();i3(a,s,t.layoutBox);let o=eb();n?i3(o,e.applyTransform(i,!0),t.measuredBox):i3(o,s,t.layoutBox);let l=!rR(a),c=!1;if(!e.resumeFrom){let i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:r,layout:n}=i;if(r&&n){let a=ej();i7(a,t.layoutBox,r.layoutBox);let o=ej();i7(o,s,n.layoutBox),rV(a,o)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=a,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function r2(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function r4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function r5(e){e.clearSnapshot()}function r3(e){e.clearMeasurements()}function r6(e){e.isLayoutDirty=!1}function r8(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function r7(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function r9(e){e.resolveTargetDelta()}function ne(e){e.calcProjection()}function nt(e){e.resetSkewAndRotation()}function ns(e){e.removeLeadSnapshot()}function ni(e,t,s){e.translate=tq(t.translate,0,s),e.scale=tq(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function nr(e,t,s,i){e.min=tq(t.min,s.min,i),e.max=tq(t.max,s.max,i)}function nn(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let na={duration:.45,ease:[.4,0,.1,1]},no=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nl=no("applewebkit/")&&!no("chrome/")?Math.round:eG;function nc(e){e.min=nl(e.min),e.max=nl(e.max)}function nd(e,t,s){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(rF(t)-rF(s)))}function nu(e){return e!==e.root&&e.scroll?.wasRoot}let nh=rJ({attachResizeListener:(e,t)=>i1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),nm={current:void 0},np=rJ({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nm.current){let e=new nh({});e.mount(window),e.setOptions({layoutScroll:!0}),nm.current=e}return nm.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function nf(e,t){let s=function(e,t,s){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,s=(void 0)??t.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(e=>null!=e)}(e),i=new AbortController;return[s,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function nx(e){return!("touch"===e.pointerType||i2.x||i2.y)}function ng(e,t,s){let{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===s);let r=i["onHover"+s];r&&e1.postRender(()=>r(t,re(t)))}let ny=(e,t)=>!!t&&(e===t||ny(e,t.parentElement)),nv=new WeakSet;function nb(e){return t=>{"Enter"===t.key&&e(t)}}function nw(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function nj(e){return i9(e)&&!(i2.x||i2.y)}function nk(e,t,s){let{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===s);let r=i["onTap"+("End"===s?"":s)];r&&e1.postRender(()=>r(t,re(t)))}let nS=new WeakMap,nN=new WeakMap,nT=e=>{let t=nS.get(e.target);t&&t(e)},nC=e=>{e.forEach(nT)},nP={some:0,all:1},nM=function(e,t){if("u"<typeof Proxy)return sw;let s=new Map,i=(s,i)=>sw(s,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(r,n)=>"create"===n?i:(s.has(n)||s.set(n,sw(n,void 0,e,t)),s.get(n))})}({animation:{Feature:class extends sj{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:s})=>(function(e,t,s={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t))i=Promise.all(t.map(t=>iq(e,t,s)));else if("string"==typeof t)i=iq(e,t,s);else{let r="function"==typeof t?sk(e,t,s.custom):t;i=Promise.all(iz(e,r,s))}return i.then(()=>{e.notify("AnimationComplete",t)})})(e,t,s))),s=iY(),i=!0,r=t=>(s,i)=>{let r=sk(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(r){let{transition:e,transitionEnd:t,...i}=r;s={...s,...i,...t}}return s};function n(n){let{props:a}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let s=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(s.initial=t.props.initial),s}let s={};for(let e=0;e<iW;e++){let i=tw[e],r=t.props[i];(tv(r)||!1===r)&&(s[i]=r)}return s}(e.parent)||{},l=[],c=new Set,d={},u=1/0;for(let t=0;t<iH;t++){var h,m;let p=iK[t],f=s[p],x=void 0!==a[p]?a[p]:o[p],g=tv(x),y=p===n?f.isActive:null;!1===y&&(u=t);let v=x===o[p]&&x!==a[p]&&g;if(v&&i&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...d},!f.isActive&&null===y||!x&&!f.prevProp||ty(x)||"boolean"==typeof x)continue;let b=(h=f.prevProp,"string"==typeof(m=x)?m!==h:!!Array.isArray(m)&&!iQ(m,h)),w=b||p===n&&f.isActive&&!v&&g||t>u&&g,j=!1,k=Array.isArray(x)?x:[x],S=k.reduce(r(p),{});!1===y&&(S={});let{prevResolvedValues:N={}}=f,T={...N,...S},C=t=>{w=!0,c.has(t)&&(j=!0,c.delete(t)),f.needsAnimating[t]=!0;let s=e.getValue(t);s&&(s.liveStyle=!1)};for(let e in T){let t=S[e],s=N[e];if(!d.hasOwnProperty(e))(sN(t)&&sN(s)?iQ(t,s):t===s)?void 0!==t&&c.has(e)?C(e):f.protectedKeys[e]=!0:null!=t?C(e):c.add(e)}f.prevProp=x,f.prevResolvedValues=S,f.isActive&&(d={...d,...S}),i&&e.blockInitialAnimation&&(w=!1);let P=v&&b,M=!P||j;w&&M&&l.push(...k.map(t=>{let s={type:p};if("string"==typeof t&&i&&!P&&e.manuallyAnimateOnMount&&e.parent){let{parent:i}=e,r=sk(i,t);if(i.enteringChildren&&r){let{delayChildren:t}=r.transition||{};s.delay=iU(i.enteringChildren,e,t)}}return{animation:t,options:s}}))}if(c.size){let t={};if("boolean"!=typeof a.initial){let s=sk(e,Array.isArray(a.initial)?a.initial[0]:a.initial);s&&s.transition&&(t.transition=s.transition)}c.forEach(s=>{let i=e.getBaseTarget(s),r=e.getValue(s);r&&(r.liveStyle=!0),t[s]=i??null}),l.push({animation:t})}let p=!!l.length;return i&&(!1===a.initial||a.initial===a.animate)&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?t(l):Promise.resolve()}return{animateChanges:n,setActive:function(t,i){if(s[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),s[t].isActive=i;let r=n(t);for(let e in s)s[e].protectedKeys={};return r},setAnimateFunction:function(s){t=s(e)},getState:()=>s,reset:()=>{s=iY()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ty(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends sj{constructor(){super(...arguments),this.id=iG++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;let i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends sj{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:s={}}=this.node.getProps(),{root:i,margin:r,amount:n="some",once:a}=s,o={root:i?i.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:nP[n]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,a&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:s,onViewportLeave:i}=this.node.getProps(),r=t?s:i;r&&r(e)};return e=this.node.current,t=function({root:e,...t}){let s=e||document;nN.has(s)||nN.set(s,{});let i=nN.get(s),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(nC,{root:e,...t})),i[r]}(o),nS.set(e,l),t.observe(e),()=>{nS.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends sj{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[i,r,n]=nf(e,s),a=e=>{let i=e.currentTarget;if(!nj(e))return;nv.add(i);let n=t(i,e),a=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),nv.has(i)&&nv.delete(i),nj(e)&&"function"==typeof n&&n(e,{success:t})},o=e=>{a(e,i===window||i===document||s.useGlobalTarget||ny(i,e.target))},l=e=>{a(e,!1)};window.addEventListener("pointerup",o,r),window.addEventListener("pointercancel",l,r)};return i.forEach(e=>{(s.useGlobalTarget?window:e).addEventListener("pointerdown",a,r),w(e)&&(e.addEventListener("focus",e=>((e,t)=>{let s=e.currentTarget;if(!s)return;let i=nb(()=>{if(nv.has(s))return;nw(s,"down");let e=nb(()=>{nw(s,"up")});s.addEventListener("keyup",e,t),s.addEventListener("blur",()=>nw(s,"cancel"),t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)})(e,r)),i0(e)||e.hasAttribute("tabindex")||(e.tabIndex=0))}),n}(e,(e,t)=>(nk(this.node,t,"Start"),(e,{success:t})=>nk(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends sj{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sM(i1(this.node.current,"focus",()=>this.onFocus()),i1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends sj{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[i,r,n]=nf(e,s),a=e=>{if(!nx(e))return;let{target:s}=e,i=t(s,e);if("function"!=typeof i||!s)return;let n=e=>{nx(e)&&(i(e),s.removeEventListener("pointerleave",n))};s.addEventListener("pointerleave",n,r)};return i.forEach(e=>{e.addEventListener("pointerenter",a,r)}),n}(e,(e,t)=>(ng(this.node,t,"Start"),e=>ng(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends sj{constructor(){super(...arguments),this.removePointerDownListener=eG}onPointerDown(e){this.session=new rn(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rs(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:rg(e),onStart:rg(t),onMove:s,onEnd:(e,t)=>{delete this.session,i&&e1.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends sj{constructor(e){super(e),this.removeGroupControls=eG,this.removeListeners=eG,this.controls=new rf(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||eG}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:np,MeasureLayout:rj},layout:{ProjectionNode:np,MeasureLayout:rj}},(e,t)=>t.isSVG??se(e)?new tX(t):new t7(t,{allowProjection:e!==m.Fragment}));var nA=e.i(74133),nE=e.i(11919),nR=e.i(79736),nD=e.i(96099),nL=e.i(70207),nV=e.i(32446),nF=e.i(60904),nO=e.i(62422),nI=class extends nL.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,nV.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#i=void 0;#r=void 0;#n=void 0;#a;#o;#s;#t;#l;#c;#d;#u;#h;#m;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),n$(this.#i,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return n_(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return n_(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#y(),this.#i.removeObserver(this)}setOptions(e){let t=this.options,s=this.#i;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,nF.resolveEnabled)(this.options.enabled,this.#i))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#v(),this.#i.setOptions(this.options),t._defaulted&&!(0,nF.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#i,observer:this});let i=this.hasListeners();i&&nB(this.#i,s,this.options,t)&&this.#f(),this.updateResult(),i&&(this.#i!==s||(0,nF.resolveEnabled)(this.options.enabled,this.#i)!==(0,nF.resolveEnabled)(t.enabled,this.#i)||(0,nF.resolveStaleTime)(this.options.staleTime,this.#i)!==(0,nF.resolveStaleTime)(t.staleTime,this.#i))&&this.#b();let r=this.#w();i&&(this.#i!==s||(0,nF.resolveEnabled)(this.options.enabled,this.#i)!==(0,nF.resolveEnabled)(t.enabled,this.#i)||r!==this.#m)&&this.#j(r)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(i,e);return t=this,s=r,(0,nF.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#n=r,this.#o=this.options,this.#a=this.#i.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#i}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#v();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(nF.noop)),t}#b(){this.#g();let e=(0,nF.resolveStaleTime)(this.options.staleTime,this.#i);if(nF.isServer||this.#n.isStale||!(0,nF.isValidTimeout)(e))return;let t=(0,nF.timeUntilStale)(this.#n.dataUpdatedAt,e);this.#u=nO.timeoutManager.setTimeout(()=>{this.#n.isStale||this.updateResult()},t+1)}#w(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#j(e){this.#y(),this.#m=e,!nF.isServer&&!1!==(0,nF.resolveEnabled)(this.options.enabled,this.#i)&&(0,nF.isValidTimeout)(this.#m)&&0!==this.#m&&(this.#h=nO.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||nE.focusManager.isFocused())&&this.#f()},this.#m))}#x(){this.#b(),this.#j(this.#w())}#g(){this.#u&&(nO.timeoutManager.clearTimeout(this.#u),this.#u=void 0)}#y(){this.#h&&(nO.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,i=this.#i,r=this.options,n=this.#n,a=this.#a,o=this.#o,l=e!==i?e.state:this.#r,{state:c}=e,d={...c},u=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&n$(e,t),a=s&&nB(e,i,t,r);(n||a)&&(d={...d,...(0,nD.fetchState)(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:p}=d;s=d.data;let f=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===p){let e;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=n.data,f=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#d?.state.data,this.#d):t.placeholderData,void 0!==e&&(p="success",s=(0,nF.replaceData)(n?.data,e,t),u=!0)}if(t.select&&void 0!==s&&!f)if(n&&s===a?.data&&t.select===this.#l)s=this.#c;else try{this.#l=t.select,s=t.select(s),s=(0,nF.replaceData)(n?.data,s,t),this.#c=s,this.#t=null}catch(e){this.#t=e}this.#t&&(h=this.#t,s=this.#c,m=Date.now(),p="error");let x="fetching"===d.fetchStatus,g="pending"===p,y="error"===p,v=g&&x,b=void 0!==s,w={status:p,fetchStatus:d.fetchStatus,isPending:g,isSuccess:"success"===p,isError:y,isInitialLoading:v,isLoading:v,data:s,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!g,isLoadingError:y&&!b,isPaused:"paused"===d.fetchStatus,isPlaceholderData:u,isRefetchError:y&&b,isStale:nz(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,nF.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,s="error"===w.status&&!t,r=e=>{s?e.reject(w.error):t&&e.resolve(w.data)},n=()=>{r(this.#s=w.promise=(0,nV.pendingThenable)())},a=this.#s;switch(a.status){case"pending":e.queryHash===i.queryHash&&r(a);break;case"fulfilled":(s||w.data!==a.value)&&n();break;case"rejected":s&&w.error===a.reason||n()}}return w}updateResult(){let e=this.#n,t=this.createResult(this.#i,this.options);if(this.#a=this.#i.state,this.#o=this.options,void 0!==this.#a.data&&(this.#d=this.#i),(0,nF.shallowEqualObjects)(t,e))return;this.#n=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#p.size)return!0;let i=new Set(s??this.#p);return this.options.throwOnError&&i.add("error"),Object.keys(this.#n).some(t=>this.#n[t]!==e[t]&&i.has(t))};this.#k({listeners:s()})}#v(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#k(e){nR.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#i,type:"observerResultsUpdated"})})}};function n$(e,t){return!1!==(0,nF.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&n_(e,t,t.refetchOnMount)}function n_(e,t,s){if(!1!==(0,nF.resolveEnabled)(t.enabled,e)&&"static"!==(0,nF.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&nz(e,t)}return!1}function nB(e,t,s,i){return(e!==t||!1===(0,nF.resolveEnabled)(i.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&nz(e,s)}function nz(e,t){return!1!==(0,nF.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,nF.resolveStaleTime)(t.staleTime,e))}var nU=e.i(1235),nq=m.createContext((i=!1,{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i})),nW=m.createContext(!1);nW.Provider;var nQ=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function nK(e,t){return function(e,t,s){let i,r=m.useContext(nW),n=m.useContext(nq),a=(0,nU.useQueryClient)(s),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let l=a.getQueryCache().get(o.queryHash);if(o._optimisticResults=r?"isRestoring":"optimistic",o.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=o.staleTime;o.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}i=l?.state.error&&"function"==typeof o.throwOnError?(0,nF.shouldThrowError)(o.throwOnError,[l.state.error,l]):o.throwOnError,(o.suspense||o.experimental_prefetchInRender||i)&&!n.isReset()&&(o.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let c=!a.getQueryCache().get(o.queryHash),[d]=m.useState(()=>new t(a,o)),u=d.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=h?d.subscribe(nR.notifyManager.batchCalls(e)):nF.noop;return d.updateResult(),t},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),o?.suspense&&u.isPending)throw nQ(o,d,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&void 0===e.data||(0,nF.shouldThrowError)(s,[e.error,i])))({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw u.error;if(a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!nF.isServer&&u.isLoading&&u.isFetching&&!r){let e=c?nQ(o,d,n):l?.promise;e?.catch(nF.noop).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?u:d.trackResult(u)}(e,nI,t)}var nH=e.i(21230),nX=nL,nY=class extends nX.Subscribable{#e;#n=void 0;#S;#N;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#T()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,nF.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#S,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,nF.hashKey)(t.mutationKey)!==(0,nF.hashKey)(this.options.mutationKey)?this.reset():this.#S?.state.status==="pending"&&this.#S.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#S?.removeObserver(this)}onMutationUpdate(e){this.#T(),this.#k(e)}getCurrentResult(){return this.#n}reset(){this.#S?.removeObserver(this),this.#S=void 0,this.#T(),this.#k()}mutate(e,t){return this.#N=t,this.#S?.removeObserver(this),this.#S=this.#e.getMutationCache().build(this.#e,this.options),this.#S.addObserver(this),this.#S.execute(e)}#T(){let e=this.#S?.state??(0,nH.getDefaultState)();this.#n={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#k(e){nR.notifyManager.batch(()=>{if(this.#N&&this.hasListeners()){let t=this.#n.variables,s=this.#n.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#N.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#N.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#N.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#N.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#n)})})}};function nG(e,t){let s=(0,nU.useQueryClient)(t),[i]=m.useState(()=>new nY(s,e));m.useEffect(()=>{i.setOptions(e)},[i,e]);let r=m.useSyncExternalStore(m.useCallback(e=>i.subscribe(nR.notifyManager.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),n=m.useCallback((e,t)=>{i.mutate(e,t).catch(nF.noop)},[i]);if(r.error&&(0,nF.shouldThrowError)(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}var nZ=e.i(94156);let nJ=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function n0(e){let t=new URLSearchParams;e?.project&&t.set("project",e.project),e?.type&&t.set("type",e.type),e?.category&&t.set("category",e.category),e?.limit&&t.set("limit",e.limit.toString()),e?.offset&&t.set("offset",e.offset.toString()),e?.mode&&t.set("mode",e.mode),e?.query&&t.set("query",e.query);let s=await fetch(`${nJ}/api/memories?${t}`);if(!s.ok)throw Error("Failed to fetch memories");return s.json()}async function n1(e){let t=e?`?project=${e}`:"",s=await fetch(`${nJ}/api/stats${t}`);if(!s.ok)throw Error("Failed to fetch stats");return s.json()}async function n2(e){let t=e?`?project=${e}`:"",s=await fetch(`${nJ}/api/links${t}`);if(!s.ok)throw Error("Failed to fetch links");return s.json()}async function n4(){let e=await fetch(`${nJ}/api/projects`);if(!e.ok)throw Error("Failed to fetch projects");return e.json()}async function n5(e){let t=await fetch(`${nJ}/api/memories/${e}/access`,{method:"POST"});if(!t.ok)throw Error("Failed to access memory");return t.json()}async function n3(){let e=await fetch(`${nJ}/api/consolidate`,{method:"POST"});if(!e.ok)throw Error("Failed to consolidate");return e.json()}function n6(e){return nK({queryKey:["stats",e],queryFn:()=>n1(e),refetchInterval:3e4})}async function n8(){let e=await fetch(`${nJ}/api/control/status`);if(!e.ok)throw Error("Failed to fetch control status");return e.json()}async function n7(){let e=await fetch(`${nJ}/api/control/pause`,{method:"POST"});if(!e.ok)throw Error("Failed to pause");return e.json()}async function n9(){let e=await fetch(`${nJ}/api/control/resume`,{method:"POST"});if(!e.ok)throw Error("Failed to resume");return e.json()}var ae=e.i(92618);let at=e=>{let t=(0,ae.createStore)(e),s=e=>(function(e,t=e=>e){let s=m.default.useSyncExternalStore(e.subscribe,m.default.useCallback(()=>t(e.getState()),[e,t]),m.default.useCallback(()=>t(e.getInitialState()),[e,t]));return m.default.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},as=(r=e=>({selectedMemory:null,setSelectedMemory:t=>e({selectedMemory:t}),viewMode:"shield",setViewMode:t=>e({viewMode:t}),typeFilter:null,categoryFilter:null,projectFilter:null,setTypeFilter:t=>e({typeFilter:t}),setCategoryFilter:t=>e({categoryFilter:t}),setProjectFilter:t=>e({projectFilter:t}),recentEvents:[],addEvent:t=>e(e=>({recentEvents:[t,...e.recentEvents].slice(0,50)})),clearEvents:()=>e({recentEvents:[]}),cameraPosition:[0,0,12],setCameraPosition:t=>e({cameraPosition:t}),showLeftSidebar:!0,showRightSidebar:!0,toggleLeftSidebar:()=>e(e=>({showLeftSidebar:!e.showLeftSidebar})),toggleRightSidebar:()=>e(e=>({showRightSidebar:!e.showRightSidebar})),searchQuery:"",setSearchQuery:t=>e({searchQuery:t})}))?at(r):at;function ai(e,t=300){let[s,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>{let s=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(s)}},[e,t]),s}let ar=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function an(e){if(!e||e.length<2)return[];let t=await fetch(`${ar}/api/suggestions?q=${encodeURIComponent(e)}&limit=8`);if(!t.ok)throw Error("Failed to fetch suggestions");return(await t.json()).suggestions}function aa(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=function e(t){var s,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(s=0;s<n;s++)t[s]&&(i=e(t[s]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}(e))&&(i&&(i+=" "),i+=t);return i}let ao=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),al=[],ac=(e,t,s)=>{if(0==e.length-t)return s.classGroupId;let i=e[t],r=s.nextPart.get(i);if(r){let s=ac(e,t+1,r);if(s)return s}let n=s.validators;if(null===n)return;let a=0===t?e.join("-"):e.slice(t).join("-"),o=n.length;for(let e=0;e<o;e++){let t=n[e];if(t.validator(a))return t.classGroupId}},ad=(e,t)=>{let s=ao();for(let i in e)au(e[i],s,i,t);return s},au=(e,t,s,i)=>{let r=e.length;for(let n=0;n<r;n++)ah(e[n],t,s,i)},ah=(e,t,s,i)=>{"string"==typeof e?am(e,t,s):"function"==typeof e?ap(e,t,s,i):af(e,t,s,i)},am=(e,t,s)=>{(""===e?t:ax(t,e)).classGroupId=s},ap=(e,t,s,i)=>{ag(e)?au(e(i),t,s,i):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:s,validator:e}))},af=(e,t,s,i)=>{let r=Object.entries(e),n=r.length;for(let e=0;e<n;e++){let[n,a]=r[e];au(a,ax(t,n),s,i)}},ax=(e,t)=>{let s=e,i=t.split("-"),r=i.length;for(let e=0;e<r;e++){let t=i[e],r=s.nextPart.get(t);r||(r=ao(),s.nextPart.set(t,r)),s=r}return s},ag=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ay=[],av=(e,t,s,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:i,isExternal:r}),ab=/\s+/,aw=e=>{let t;if("string"==typeof e)return e;let s="";for(let i=0;i<e.length;i++)e[i]&&(t=aw(e[i]))&&(s&&(s+=" "),s+=t);return s},aj=[],ak=e=>{let t=t=>t[e]||aj;return t.isThemeGetter=!0,t},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aT=/^\d+\/\d+$/,aC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aP=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aR=e=>aT.test(e),aD=e=>!!e&&!Number.isNaN(Number(e)),aL=e=>!!e&&Number.isInteger(Number(e)),aV=e=>e.endsWith("%")&&aD(e.slice(0,-1)),aF=e=>aC.test(e),aO=()=>!0,aI=e=>aP.test(e)&&!aM.test(e),a$=()=>!1,a_=e=>aA.test(e),aB=e=>aE.test(e),az=e=>!aq(e)&&!aY(e),aU=e=>a4(e,a8,a$),aq=e=>aS.test(e),aW=e=>a4(e,a7,aI),aQ=e=>a4(e,a9,aD),aK=e=>a4(e,a3,a$),aH=e=>a4(e,a6,aB),aX=e=>a4(e,ot,a_),aY=e=>aN.test(e),aG=e=>a5(e,a7),aZ=e=>a5(e,oe),aJ=e=>a5(e,a3),a0=e=>a5(e,a8),a1=e=>a5(e,a6),a2=e=>a5(e,ot,!0),a4=(e,t,s)=>{let i=aS.exec(e);return!!i&&(i[1]?t(i[1]):s(i[2]))},a5=(e,t,s=!1)=>{let i=aN.exec(e);return!!i&&(i[1]?t(i[1]):s)},a3=e=>"position"===e||"percentage"===e,a6=e=>"image"===e||"url"===e,a8=e=>"length"===e||"size"===e||"bg-size"===e,a7=e=>"length"===e,a9=e=>"number"===e,oe=e=>"family-name"===e,ot=e=>"shadow"===e,os=((e,...t)=>{let s,i,r,n,a=e=>{let t=i(e);if(t)return t;let n=((e,t)=>{let{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:n}=t,a=[],o=e.trim().split(ab),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:c,modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=s(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!m,f=i(p?h.substring(0,m):h);if(!f){if(!p||!(f=i(h))){l=t+(l.length>0?" "+l:l);continue}p=!1}let x=0===d.length?"":1===d.length?d[0]:n(d).join(":"),g=u?x+"!":x,y=g+f;if(a.indexOf(y)>-1)continue;a.push(y);let v=r(f,p);for(let e=0;e<v.length;++e){let t=v[e];a.push(g+t)}l=t+(l.length>0?" "+l:l)}return l})(e,s);return r(e,n),n};return n=o=>{var l;let c;return i=(s={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,s=Object.create(null),i=Object.create(null),r=(r,n)=>{s[r]=n,++t>e&&(t=0,i=s,s=Object.create(null))};return{get(e){let t=s[e];return void 0!==t?t:void 0!==(t=i[e])?(r(e,t),t):void 0},set(e,t){e in s?s[e]=t:r(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:s}=e,i=e=>{let t,s=[],i=0,r=0,n=0,a=e.length;for(let o=0;o<a;o++){let a=e[o];if(0===i&&0===r){if(":"===a){s.push(e.slice(n,o)),n=o+1;continue}if("/"===a){t=o;continue}}"["===a?i++:"]"===a?i--:"("===a?r++:")"===a&&r--}let o=0===s.length?e:e.slice(n),l=o,c=!1;return o.endsWith("!")?(l=o.slice(0,-1),c=!0):o.startsWith("!")&&(l=o.slice(1),c=!0),av(s,c,l,t&&t>n?t-n:void 0)};if(t){let e=t+":",s=i;i=t=>t.startsWith(e)?s(t.slice(e.length)):av(ay,!1,t,void 0,!0)}if(s){let e=i;i=t=>s({className:t,parseClassName:e})}return i})(l),sortModifiers:(c=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],s=[];for(let i=0;i<e.length;i++){let r=e[i],n="["===r[0],a=c.has(r);n||a?(s.length>0&&(s.sort(),t.push(...s),s=[]),t.push(r)):s.push(r)}return s.length>0&&(s.sort(),t.push(...s)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:s}=e;return ad(s,t)})(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var s;let t,i,r;return -1===(s=e).slice(1,-1).indexOf(":")?void 0:(i=(t=s.slice(1,-1)).indexOf(":"),(r=t.slice(0,i))?"arbitrary.."+r:void 0)}let i=e.split("-"),r=+(""===i[0]&&i.length>1);return ac(i,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],r=s[e];if(t){if(r){let e=Array(r.length+t.length);for(let t=0;t<r.length;t++)e[t]=r[t];for(let s=0;s<t.length;s++)e[r.length+s]=t[s];return e}return t}return r||al}return s[e]||al}}})(l)}).cache.get,r=s.cache.set,n=a,a(o)},(...e)=>n(((...e)=>{let t,s,i=0,r="";for(;i<e.length;)(t=e[i++])&&(s=aw(t))&&(r&&(r+=" "),r+=s);return r})(...e))})(()=>{let e=ak("color"),t=ak("font"),s=ak("text"),i=ak("font-weight"),r=ak("tracking"),n=ak("leading"),a=ak("breakpoint"),o=ak("container"),l=ak("spacing"),c=ak("radius"),d=ak("shadow"),u=ak("inset-shadow"),h=ak("text-shadow"),m=ak("drop-shadow"),p=ak("blur"),f=ak("perspective"),x=ak("aspect"),g=ak("ease"),y=ak("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...b(),aY,aq],j=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],S=()=>[aY,aq,l],N=()=>[aR,"full","auto",...S()],T=()=>[aL,"none","subgrid",aY,aq],C=()=>["auto",{span:["full",aL,aY,aq]},aL,aY,aq],P=()=>[aL,"auto",aY,aq],M=()=>["auto","min","max","fr",aY,aq],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],E=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...S()],D=()=>[aR,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],L=()=>[e,aY,aq],V=()=>[...b(),aJ,aK,{position:[aY,aq]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",a0,aU,{size:[aY,aq]}],I=()=>[aV,aG,aW],$=()=>["","none","full",c,aY,aq],_=()=>["",aD,aG,aW],B=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[aD,aV,aJ,aK],q=()=>["","none",p,aY,aq],W=()=>["none",aD,aY,aq],Q=()=>["none",aD,aY,aq],K=()=>[aD,aY,aq],H=()=>[aR,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[aF],breakpoint:[aF],color:[aO],container:[aF],"drop-shadow":[aF],ease:["in","out","in-out"],font:[az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[aF],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[aF],shadow:[aF],spacing:["px",aD],text:[aF],"text-shadow":[aF],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",aR,aq,aY,x]}],container:["container"],columns:[{columns:[aD,aq,aY,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[aL,"auto",aY,aq]}],basis:[{basis:[aR,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[aD,aR,"auto","initial","none",aq]}],grow:[{grow:["",aD,aY,aq]}],shrink:[{shrink:["",aD,aY,aq]}],order:[{order:[aL,"first","last","none",aY,aq]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...E(),"normal"]}],"justify-self":[{"justify-self":["auto",...E()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...E(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...E(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...E(),"baseline"]}],"place-self":[{"place-self":["auto",...E()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[o,"screen",...D()]}],"min-w":[{"min-w":[o,"screen","none",...D()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",s,aG,aW]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,aY,aQ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",aV,aq]}],"font-family":[{font:[aZ,aq,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,aY,aq]}],"line-clamp":[{"line-clamp":[aD,"none",aY,aQ]}],leading:[{leading:[n,...S()]}],"list-image":[{"list-image":["none",aY,aq]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",aY,aq]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[aD,"from-font","auto",aY,aW]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[aD,"auto",aY,aq]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",aY,aq]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",aY,aq]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},aL,aY,aq],radial:["",aY,aq],conic:[aL,aY,aq]},a1,aH]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[aD,aY,aq]}],"outline-w":[{outline:["",aD,aG,aW]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,a2,aX]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,a2,aX]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[aD,aW]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,a2,aX]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[aD,aY,aq]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[aD]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[aY,aq]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[aD]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",aY,aq]}],filter:[{filter:["","none",aY,aq]}],blur:[{blur:q()}],brightness:[{brightness:[aD,aY,aq]}],contrast:[{contrast:[aD,aY,aq]}],"drop-shadow":[{"drop-shadow":["","none",m,a2,aX]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",aD,aY,aq]}],"hue-rotate":[{"hue-rotate":[aD,aY,aq]}],invert:[{invert:["",aD,aY,aq]}],saturate:[{saturate:[aD,aY,aq]}],sepia:[{sepia:["",aD,aY,aq]}],"backdrop-filter":[{"backdrop-filter":["","none",aY,aq]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[aD,aY,aq]}],"backdrop-contrast":[{"backdrop-contrast":[aD,aY,aq]}],"backdrop-grayscale":[{"backdrop-grayscale":["",aD,aY,aq]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[aD,aY,aq]}],"backdrop-invert":[{"backdrop-invert":["",aD,aY,aq]}],"backdrop-opacity":[{"backdrop-opacity":[aD,aY,aq]}],"backdrop-saturate":[{"backdrop-saturate":[aD,aY,aq]}],"backdrop-sepia":[{"backdrop-sepia":["",aD,aY,aq]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",aY,aq]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[aD,"initial",aY,aq]}],ease:[{ease:["linear","initial",g,aY,aq]}],delay:[{delay:[aD,aY,aq]}],animate:[{animate:["none",y,aY,aq]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,aY,aq]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[aY,aq,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",aY,aq]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",aY,aq]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[aD,aG,aW,aQ]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function oi(...e){return os(aa(e))}function or({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card",className:oi("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function on({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-header",className:oi("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function oa({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-title",className:oi("leading-none font-semibold",e),...t})}function oo({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-content",className:oi("px-6",e),...t})}function ol(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var oc=Symbol.for("react.lazy"),od=m[" use ".trim().toString()];function ou(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===oc&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var oh=((d=m.forwardRef((e,t)=>{let{children:s,...i}=e;if(ou(s)&&"function"==typeof od&&(s=od(s._payload)),m.isValidElement(s)){var r;let e,n,a=(r=s,(n=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.ref:(n=(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.props.ref:r.props.ref||r.ref),o=function(e,t){let s={...t};for(let i in t){let r=e[i],n=t[i];/^on[A-Z]/.test(i)?r&&n?s[i]=(...e)=>{let t=n(...e);return r(...e),t}:r&&(s[i]=r):"style"===i?s[i]={...r,...n}:"className"===i&&(s[i]=[r,n].filter(Boolean).join(" "))}return{...e,...s}}(i,s.props);return s.type!==m.Fragment&&(o.ref=t?function(...e){return t=>{let s=!1,i=e.map(e=>{let i=ol(e,t);return s||"function"!=typeof i||(s=!0),i});if(s)return()=>{for(let t=0;t<i.length;t++){let s=i[t];"function"==typeof s?s():ol(e[t],null)}}}}(t,a):a),m.cloneElement(s,o)}return m.Children.count(s)>1?m.Children.only(null):null})).displayName="Slot.SlotClone",n=d,(a=m.forwardRef((e,t)=>{let{children:s,...i}=e;ou(s)&&"function"==typeof od&&(s=od(s._payload));let r=m.Children.toArray(s),a=r.find(op);if(a){let e=a.props.children,s=r.map(t=>t!==a?t:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,h.jsx)(n,{...i,ref:t,children:m.isValidElement(e)?m.cloneElement(e,void 0,s):null})}return(0,h.jsx)(n,{...i,ref:t,children:s})})).displayName="Slot.Slot",a),om=Symbol("radix.slottable");function op(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===om}let of=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ox=(o="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",l={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==l?void 0:l.variants)==null)return aa(o,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:s,defaultVariants:i}=l,r=Object.keys(s).map(t=>{let r=null==e?void 0:e[t],n=null==i?void 0:i[t];if(null===r)return null;let a=of(r)||of(n);return s[t][a]}),n=e&&Object.entries(e).reduce((e,t)=>{let[s,i]=t;return void 0===i||(e[s]=i),e},{});return aa(o,r,null==l||null==(t=l.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:s,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,s]=e;return Array.isArray(s)?s.includes({...i,...n}[t]):({...i,...n})[t]===s})?[...e,s,r]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});function og({className:e,variant:t="default",size:s="default",asChild:i=!1,...r}){return(0,h.jsx)(i?oh:"button",{"data-slot":"button","data-variant":t,"data-size":s,className:oi(ox({variant:t,size:s,className:e})),...r})}var oy=e.i(97358),ov=e.i(33368);let ob={references:{color:"#60a5fa",label:"References",icon:"→"},extends:{color:"#34d399",label:"Extends",icon:"⊃"},contradicts:{color:"#f87171",label:"Contradicts",icon:"⊗"},related:{color:"#a78bfa",label:"Related",icon:"~"}};function ow({memory:e,links:t=[],memories:s=[],onClose:i,onReinforce:r,onSelectMemory:n}){let a=(0,ov.calculateDecayFactor)(e),o=(0,oy.getCategoryColor)(e.category),l=(0,oy.getTypeColor)(e.type),c=a>.7?{label:"Healthy",color:"#22C55E",bgColor:"rgba(34, 197, 94, 0.15)"}:a>.4?{label:"Fading",color:"#EAB308",bgColor:"rgba(234, 179, 8, 0.15)"}:{label:"Critical",color:"#EF4444",bgColor:"rgba(239, 68, 68, 0.15)"},d=(0,m.useMemo)(()=>{let i=[];for(let r of t)if(r.source_id===e.id){let e=s.find(e=>e.id===r.target_id);e&&i.push({memory:e,relationship:r.relationship,strength:r.strength,direction:"to"})}else if(r.target_id===e.id){let e=s.find(e=>e.id===r.source_id);e&&i.push({memory:e,relationship:r.relationship,strength:r.strength,direction:"from"})}return i.sort((e,t)=>t.strength-e.strength)},[e.id,t,s]);return(0,h.jsxs)(or,{className:"bg-slate-900 border-slate-700 h-full overflow-auto",children:[(0,h.jsxs)(on,{className:"border-b border-slate-700 pb-3",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,h.jsx)(oa,{className:"text-lg font-semibold text-white leading-tight",children:e.title}),(0,h.jsx)(og,{variant:"ghost",size:"sm",onClick:i,className:"text-slate-400 hover:text-white -mt-1",children:"✕"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,h.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:o+"20",color:o},children:e.category}),(0,h.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:l+"20",color:l},children:e.type.replace("_","-")})]})]}),(0,h.jsxs)(oo,{className:"p-4 space-y-4",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-1",children:"Content"}),(0,h.jsx)("p",{className:"text-sm text-slate-200 whitespace-pre-wrap leading-relaxed",children:e.content})]}),(0,h.jsxs)("div",{className:"rounded-lg p-3 flex items-center gap-3",style:{backgroundColor:c.bgColor},children:[(0,h.jsx)("div",{className:"w-3 h-3 rounded-full animate-pulse",style:{backgroundColor:c.color}}),(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"text-sm font-medium",style:{color:c.color},children:c.label}),(0,h.jsx)("div",{className:"text-xs text-slate-400",children:a>.7?"Memory is strong and stable":a>.4?"Memory is fading - reinforce to preserve":"Memory at risk of deletion - reinforce now"})]})]}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,h.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,h.jsx)("div",{className:"text-xs text-slate-400",children:"Salience"}),(0,h.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*e.salience).toFixed(0),"%"]}),(0,h.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,h.jsx)("div",{className:"h-full bg-gradient-to-r from-red-500 via-yellow-500 to-green-500 rounded-full transition-all",style:{width:`${100*e.salience}%`}})})]}),(0,h.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,h.jsx)("div",{className:"text-xs text-slate-400",children:"Decay Factor"}),(0,h.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*a).toFixed(0),"%"]}),(0,h.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,h.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${100*a}%`,backgroundColor:c.color}})})]})]}),(0,h.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3 space-y-2",children:[(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Access Count"}),(0,h.jsxs)("span",{className:"text-sm font-medium text-white",children:[e.accessCount," times"]})]}),(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Last Accessed"}),(0,h.jsx)("span",{className:"text-sm text-white",children:(e=>{let t=new Date(e),s=Math.floor((new Date().getTime()-t.getTime())/36e5);if(s<1)return"Just now";if(s<24)return`${s}h ago`;let i=Math.floor(s/24);return i<7?`${i}d ago`:`${Math.floor(i/7)}w ago`})(e.lastAccessed)})]}),(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Created"}),(0,h.jsx)("span",{className:"text-sm text-white",children:new Date(e.createdAt).toLocaleString()})]})]}),d.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsxs)("h4",{className:"text-xs font-medium text-slate-400 mb-2 flex items-center gap-2",children:[(0,h.jsx)("span",{className:"inline-block w-4 h-4",children:"🔗"}),"Related Memories (",d.length,")"]}),(0,h.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:d.map(({memory:e,relationship:t,strength:s,direction:i})=>{let r=ob[t]||ob.related,a=(0,oy.getCategoryColor)(e.category);return(0,h.jsxs)("button",{onClick:()=>n?.(e.id),className:"w-full text-left p-2 bg-slate-800 hover:bg-slate-750 rounded-lg transition-colors group",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,h.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:r.color}}),(0,h.jsx)("span",{className:"text-[10px] font-medium",style:{color:r.color},children:"to"===i?`${r.icon} ${r.label}`:`${r.label} ${r.icon}`}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500 ml-auto",children:[(100*s).toFixed(0),"%"]})]}),(0,h.jsx)("div",{className:"text-sm text-white truncate group-hover:text-blue-400 transition-colors",children:e.title}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,h.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{backgroundColor:a+"20",color:a},children:e.category}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:[(100*e.salience).toFixed(0),"% salience"]})]})]},`${e.id}-${i}`)})})]}),e.tags&&e.tags.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Tags"}),(0,h.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map((e,t)=>(0,h.jsx)("span",{className:"px-2 py-0.5 bg-slate-700 text-slate-300 rounded text-xs",children:e},t))})]}),(0,h.jsx)("div",{className:"flex gap-2 pt-2",children:r&&(0,h.jsx)(og,{variant:"default",size:"sm",onClick:()=>r(e.id),className:"flex-1 bg-blue-600 hover:bg-blue-700",children:"⚡ Reinforce Memory"})})]})]})}function oj(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let i=Math.floor(s/24);if(i<7)return`${i}d ago`;let r=Math.floor(i/7);return`${r}w ago`}function ok({memory:e,isSelected:t,onSelect:s,isChecked:i,onCheck:r}){let n=(0,oy.getCategoryColor)(e.category),a=(0,oy.getTypeColor)(e.type);return(0,h.jsxs)("div",{onClick:()=>s(e),className:`bg-slate-900 border rounded-lg p-3 hover:border-slate-600 cursor-pointer transition-colors relative ${t?"border-cyan-500":"border-slate-800"}`,children:[(0,h.jsx)("div",{className:"h-0.5 rounded-full bg-slate-800 mb-2 overflow-hidden",children:(0,h.jsx)("div",{className:"h-full rounded-full",style:{width:`${100*e.salience}%`,backgroundColor:n}})}),r&&(0,h.jsx)("input",{type:"checkbox",checked:i??!1,onChange:t=>{t.stopPropagation(),r(e.id,t.target.checked)},onClick:e=>e.stopPropagation(),className:"absolute top-3 right-3 w-4 h-4 accent-blue-500"}),(0,h.jsx)("h3",{className:"text-sm font-semibold text-white truncate pr-6",children:e.title}),(0,h.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:n+"22",color:n},children:e.category}),(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a},children:e.type.replace("_","-")})]}),(0,h.jsx)("p",{className:"text-[13px] text-slate-400 mt-1.5 line-clamp-3 leading-snug",children:e.content}),e.tags.length>0&&(0,h.jsxs)("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[e.tags.slice(0,3).map(e=>(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-slate-800 text-slate-400",children:e},e)),e.tags.length>3&&(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:["+",e.tags.length-3," more"]})]}),(0,h.jsxs)("div",{className:"flex items-center justify-between mt-2 text-[11px] text-slate-500",children:[(0,h.jsxs)("span",{children:["Created ",oj(e.createdAt)]}),(0,h.jsxs)("span",{children:["Accessed ",oj(e.lastAccessed)]})]})]})}let oS=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function oN({memories:e,selectedMemory:t,onSelectMemory:s}){let[i,r]=(0,m.useState)("salience"),[n,a]=(0,m.useState)("grid"),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(new Set),[u,p]=(0,m.useState)(!1),f=(0,nU.useQueryClient)(),x=(0,m.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(i){case"salience":return t.salience-e.salience;case"createdAt":return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();case"lastAccessed":return new Date(t.lastAccessed).getTime()-new Date(e.lastAccessed).getTime();case"decayedScore":return(t.decayedScore??t.salience)-(e.decayedScore??e.salience);default:return 0}}),t},[e,i]),g=(0,m.useCallback)((e,t)=>{d(s=>{let i=new Set(s);return t?i.add(e):i.delete(e),i})},[]),y=async()=>{if(0!==c.size){p(!0);try{await Promise.all(Array.from(c).map(e=>fetch(`${oS}/api/memories/${e}`,{method:"DELETE"}))),d(new Set),f.invalidateQueries({queryKey:["memories"]})}finally{p(!1)}}};return(0,h.jsxs)("div",{className:"flex flex-col h-full",children:[(0,h.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-slate-800 shrink-0",children:[(0,h.jsxs)("span",{className:"text-xs text-slate-400",children:[e.length," memories"]}),(0,h.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,h.jsxs)("select",{value:i,onChange:e=>r(e.target.value),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded px-2 py-1",children:[(0,h.jsx)("option",{value:"salience",children:"Salience"}),(0,h.jsx)("option",{value:"createdAt",children:"Created"}),(0,h.jsx)("option",{value:"lastAccessed",children:"Last Accessed"}),(0,h.jsx)("option",{value:"decayedScore",children:"Decay Score"})]}),(0,h.jsxs)("div",{className:"flex items-center border border-slate-700 rounded overflow-hidden",children:[(0,h.jsx)("button",{onClick:()=>a("grid"),className:`px-2 py-1 text-xs ${"grid"===n?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"Grid"}),(0,h.jsx)("button",{onClick:()=>a("list"),className:`px-2 py-1 text-xs ${"list"===n?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"List"})]}),(0,h.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,h.jsx)("button",{onClick:()=>{l(!o),d(new Set)},className:`px-2 py-1 text-xs rounded ${o?"bg-blue-600 text-white":"bg-slate-800 text-slate-400 hover:text-white"}`,children:"Select"}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("button",{onClick:()=>d(new Set(x.map(e=>e.id))),className:"px-2 py-1 text-xs text-slate-400 hover:text-white",children:"Select all"}),(0,h.jsx)("button",{onClick:y,disabled:0===c.size||u,className:"px-2 py-1 text-xs rounded bg-red-600/20 text-red-400 hover:bg-red-600/40 disabled:opacity-40",children:u?"Deleting...":`Delete (${c.size})`})]})]}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,h.jsx)("div",{className:"grid"===n?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3":"flex flex-col gap-3 max-w-2xl",children:x.map(e=>(0,h.jsx)(ok,{memory:e,isSelected:t?.id===e.id,onSelect:s,isChecked:o?c.has(e.id):void 0,onCheck:o?g:void 0},e.id))})})]})}let oT=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function oC(e){let t=new URLSearchParams;e?.startTime&&t.set("startTime",e.startTime),e?.endTime&&t.set("endTime",e.endTime),e?.source&&t.set("source",e.source),e?.firewallResult&&t.set("firewallResult",e.firewallResult),e?.project&&t.set("project",e.project),e?.limit&&t.set("limit",e.limit.toString());let s=await fetch(`${oT}/api/v1/audit?${t}`);if(!s.ok)throw Error("Failed to fetch audit logs");return s.json()}async function oP(e,t){let s=new URLSearchParams({timeRange:e});t&&s.set("project",t);let i=await fetch(`${oT}/api/v1/audit/stats?${s}`);if(!i.ok)throw Error("Failed to fetch audit stats");return i.json()}async function oM(e="pending",t=50,s){let i=new URLSearchParams({status:e,limit:t.toString()});s&&i.set("project",s);let r=await fetch(`${oT}/api/v1/quarantine?${i}`);if(!r.ok)throw Error("Failed to fetch quarantine");return r.json()}async function oA(e){let t=await fetch(`${oT}/api/v1/quarantine/${e}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:"dashboard"})});if(!t.ok)throw Error("Failed to approve");return t.json()}async function oE(e,t){let s=await fetch(`${oT}/api/v1/quarantine/${e}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:"dashboard",notes:t})});if(!s.ok)throw Error("Failed to reject");return s.json()}function oR(e){return nK({queryKey:["audit-logs",e],queryFn:()=>oC(e),refetchInterval:3e4,retry:2})}function oD(e="24h",t){return nK({queryKey:["audit-stats",e,t],queryFn:()=>oP(e,t),refetchInterval:3e4,retry:2})}function oL(e="pending",t=50,s){return nK({queryKey:["quarantine",e,t,s],queryFn:()=>oM(e,t,s),refetchInterval:3e4,retry:2})}let oV=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},oF=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim();var oO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let oI=(0,m.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:r="",children:n,iconNode:a,...o},l)=>(0,m.createElement)("svg",{ref:l,...oO,width:t,height:t,stroke:e,strokeWidth:i?24*Number(s)/Number(t):s,className:oF("lucide",r),...!n&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(o)&&{"aria-hidden":"true"},...o},[...a.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(n)?n:[n]])),o$=(e,t)=>{let s=(0,m.forwardRef)(({className:s,...i},r)=>(0,m.createElement)(oI,{ref:r,iconNode:t,className:oF(`lucide-${oV(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...i}));return s.displayName=oV(e),s},o_=o$("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),oB=o$("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),oz=o$("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),oU=o$("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),oq=o$("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),oW=o$("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),oQ=o$("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),oK=[{id:"shield",label:"Shield",icon:o_},{id:"audit",label:"Audit",icon:oB},{id:"quarantine",label:"Queue",icon:oz},{id:"agents",label:"Agents",icon:oQ},{id:"memories",label:"Memories",icon:oU},{id:"brain",label:"Brain",icon:oq},{id:"graph",label:"Graph",icon:oW}];function oH(){let{viewMode:e,setViewMode:t}=as(),{data:s}=n6(),{data:i}=oD("24h"),r=s?.decayDistribution?Math.round(s.decayDistribution.healthy/Math.max(1,s.total)*100):null,n=i?.blockedCount??0;return(0,h.jsxs)("nav",{className:"w-14 border-r border-slate-800 bg-slate-900/50 flex flex-col items-center py-3 shrink-0",children:[(0,h.jsx)("div",{className:"flex-1 flex flex-col items-center gap-1",children:oK.map(({id:s,label:i,icon:r})=>(0,h.jsxs)("button",{onClick:()=>t(s),className:`relative w-10 h-10 rounded-lg flex flex-col items-center justify-center gap-0.5 transition-colors ${e===s?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"}`,title:i,children:[(0,h.jsx)(r,{size:18}),(0,h.jsx)("span",{className:"text-[9px] leading-none",children:i}),"shield"===s&&n>0&&(0,h.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] rounded-full bg-red-500 text-white text-[8px] flex items-center justify-center px-0.5",children:n>99?"99+":n})]},s))}),(0,h.jsxs)("div",{className:"flex flex-col items-center gap-1 text-[10px] text-slate-500",children:[s&&(0,h.jsx)("span",{children:s.total}),null!==r&&(0,h.jsxs)("span",{children:[r,"%"]})]})]})}let oX=[{key:"trust",label:"Trust",icon:o_,color:"text-blue-400",bg:"bg-blue-400/10"},{key:"firewall",label:"Firewall",icon:o$("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]),color:"text-orange-400",bg:"bg-orange-400/10"},{key:"sensitivity",label:"Sensitivity",icon:o$("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),color:"text-purple-400",bg:"bg-purple-400/10"},{key:"fragmentation",label:"Fragment",icon:o$("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),color:"text-cyan-400",bg:"bg-cyan-400/10"},{key:"audit",label:"Audit",icon:oB,color:"text-green-400",bg:"bg-green-400/10"}];function oY({timeRange:e}){let{projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oD(e,t||void 0);return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Defence Pipeline"}),(0,h.jsx)("div",{className:"flex items-center gap-1 mb-4",children:oX.map(({key:e,label:t,icon:s,color:i,bg:r},n)=>(0,h.jsxs)("div",{className:"flex items-center",children:[(0,h.jsxs)("div",{className:`flex items-center gap-1.5 px-3 py-2 rounded-lg ${r}`,children:[(0,h.jsx)(s,{size:14,className:i}),(0,h.jsx)("span",{className:`text-xs font-medium ${i}`,children:t})]}),n<oX.length-1&&(0,h.jsx)("div",{className:"w-4 h-px bg-slate-700 mx-0.5"})]},e))}),i?(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading stats..."}):r?(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"}):s?(0,h.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-green-400",children:s.allowedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Allowed"})]}),(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-red-400",children:s.blockedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Blocked"})]}),(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-yellow-400",children:s.quarantinedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Quarantined"})]})]}):(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No data"}),(0,h.jsxs)("div",{className:"mt-4 pt-3 border-t border-slate-800 flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-500",children:"Firewall Mode"}),(0,h.jsx)("span",{className:"text-xs font-medium text-cyan-400 bg-cyan-400/10 px-2 py-0.5 rounded",children:"balanced"})]})]})}function oG(){let{setViewMode:e,projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oL("pending",3,t||void 0),n=s?.total??0,a=s?.items??[];return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Quarantine Queue"}),n>0&&(0,h.jsxs)("span",{className:"text-xs font-medium text-yellow-400 bg-yellow-400/10 px-2 py-0.5 rounded-full",children:[n," pending"]})]}),i?(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."}):r?(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load quarantine"}):0===a.length?(0,h.jsxs)("div",{className:"flex flex-col items-center py-6 text-slate-500",children:[(0,h.jsx)(oz,{size:24,className:"mb-2 text-slate-600"}),(0,h.jsx)("span",{className:"text-xs",children:"No items in quarantine"})]}):(0,h.jsx)("div",{className:"space-y-2",children:a.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,h.jsxs)("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-3",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between",children:[(0,h.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,h.jsx)("div",{className:"text-xs font-medium text-white truncate",children:e.title||"Untitled"}),(0,h.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleTimeString()]})]}),(0,h.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-1.5 py-0.5 rounded shrink-0 ml-2",children:e.reason?.slice(0,30)||"Threat detected"})]}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mt-1.5 flex-wrap",children:t.slice(0,3).map((e,t)=>(0,h.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1 py-0.5 rounded",children:e},t))})]},e.id)})}),n>0&&(0,h.jsxs)("button",{onClick:()=>e("quarantine"),className:"w-full mt-3 text-xs text-cyan-400 hover:text-cyan-300 transition-colors",children:["Review all ",n," items →"]})]})}function oZ({timeRange:e}){let{projectFilter:t}=as(),s={"24h":24,"7d":168,"30d":720},{data:i,isLoading:r,isError:n}=oR({startTime:(0,m.useMemo)(()=>new Date(6e4*Math.floor((Date.now()-36e5*s[e])/6e4)).toISOString(),[e]),project:t||void 0,limit:500}),a=(0,m.useMemo)(()=>{if(!i?.logs.length)return[];let t="24h"===e?36e5:"7d"===e?216e5:864e5,s="24h"===e?24:"7d"===e?28:30,r=Date.now(),n=Array.from({length:s},(e,i)=>({time:r-(s-1-i)*t,allowed:0,blocked:0,quarantined:0}));for(let e of i.logs){let i=Math.floor((new Date(e.timestamp).getTime()-(r-s*t))/t),a=Math.min(Math.max(i,0),s-1);i>=0&&i<=s&&("ALLOW"===e.firewall_result?n[a].allowed++:"BLOCK"===e.firewall_result?n[a].blocked++:"QUARANTINE"===e.firewall_result&&n[a].quarantined++)}return n},[i,e]),o=Math.max(1,...a.map(e=>e.allowed+e.blocked+e.quarantined));return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Threat Timeline"}),r?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading timeline..."})}):n?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load timeline"})}):0===a.length?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No audit data"})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"flex gap-px h-32",children:a.map((e,t)=>{let s=e.allowed+e.blocked+e.quarantined,i=s>0?e.blocked/s*100:0,r=s>0?e.quarantined/s*100:0;return(0,h.jsx)("div",{className:"flex-1 flex flex-col justify-end",title:`${new Date(e.time).toLocaleString()}: ${e.allowed} allowed, ${e.blocked} blocked, ${e.quarantined} quarantined`,children:(0,h.jsx)("div",{className:"w-full rounded-t-sm overflow-hidden",style:{height:`${Math.max(s/o*100,2*(s>0))}%`},children:(0,h.jsxs)("div",{className:"w-full h-full flex flex-col-reverse",children:[e.blocked>0&&(0,h.jsx)("div",{className:"bg-red-500",style:{height:`${i}%`}}),e.quarantined>0&&(0,h.jsx)("div",{className:"bg-yellow-500",style:{height:`${r}%`}}),(0,h.jsx)("div",{className:"bg-emerald-500/60 flex-1"})]})})},t)})}),(0,h.jsxs)("div",{className:"flex gap-4 mt-3 justify-center",children:[(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-emerald-500/60"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Allowed"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-red-500"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Blocked"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-yellow-500"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Quarantined"})]})]})]})]})}function oJ({timeRange:e}){let{projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oD(e,t||void 0);if(i)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."})]});if(r)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"})]});if(!s)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No data"})]});let n=s.totalOperations||1,a=(s.blockedCount/n*100).toFixed(1),o=Object.entries(s.threatBreakdown||{}).sort((e,t)=>t[1]-e[1]).slice(0,5);return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,h.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-white",children:s.totalOperations}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Total Scans"})]}),(0,h.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,h.jsxs)("div",{className:`text-2xl font-bold ${parseFloat(a)>10?"text-red-400":"text-green-400"}`,children:[a,"%"]}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Block Rate"})]})]}),s.topSources.length>0&&(0,h.jsxs)("div",{className:"mb-4",children:[(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Top Sources"}),(0,h.jsx)("div",{className:"space-y-1",children:s.topSources.slice(0,3).map(e=>(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:e.source}),(0,h.jsx)("span",{className:"text-xs text-slate-500",children:e.count})]},e.source))})]}),o.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Threat Types"}),(0,h.jsx)("div",{className:"space-y-1",children:o.map(([e,t])=>(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:e}),(0,h.jsx)("span",{className:"text-xs font-medium text-red-400",children:t})]},e))})]})]})}function o0(){let[e,t]=(0,m.useState)("24h");return(0,h.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Defence Overview"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(s=>(0,h.jsx)("button",{onClick:()=>t(s),className:`px-3 py-1 text-xs rounded-md transition-colors ${e===s?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:s},s))})]}),(0,h.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,h.jsx)(oY,{timeRange:e}),(0,h.jsx)(oG,{}),(0,h.jsx)(oZ,{timeRange:e}),(0,h.jsx)(oJ,{timeRange:e})]})]})}let o1={ALLOW:"bg-green-500/10 text-green-400",BLOCK:"bg-red-500/10 text-red-400",QUARANTINE:"bg-yellow-500/10 text-yellow-400"};function o2(){let{projectFilter:e}=as(),[t,s]=(0,m.useState)("24h"),[i,r]=(0,m.useState)(void 0),[n,a]=(0,m.useState)(void 0),o={"24h":24,"7d":168,"30d":720},{data:l,isLoading:c}=oR({startTime:(0,m.useMemo)(()=>new Date(6e4*Math.floor((Date.now()-36e5*o[t])/6e4)).toISOString(),[t]),source:i,firewallResult:n,project:e||void 0,limit:200}),d=l?.logs??[];return(0,h.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,h.jsxs)("div",{className:"p-4 border-b border-slate-800 shrink-0",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Audit Log"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(e=>(0,h.jsx)("button",{onClick:()=>s(e),className:`px-3 py-1 text-xs rounded-md transition-colors ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsxs)("select",{value:n||"",onChange:e=>a(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,h.jsx)("option",{value:"",children:"All Results"}),(0,h.jsx)("option",{value:"ALLOW",children:"Allowed"}),(0,h.jsx)("option",{value:"BLOCK",children:"Blocked"}),(0,h.jsx)("option",{value:"QUARANTINE",children:"Quarantined"})]}),(0,h.jsxs)("select",{value:i||"",onChange:e=>r(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,h.jsx)("option",{value:"",children:"All Sources"}),(0,h.jsx)("option",{value:"hook",children:"Hook"}),(0,h.jsx)("option",{value:"api",children:"API"}),(0,h.jsx)("option",{value:"agent",children:"Agent"}),(0,h.jsx)("option",{value:"user",children:"User"}),(0,h.jsx)("option",{value:"cli",children:"CLI"})]}),(0,h.jsxs)("span",{className:"text-xs text-slate-500 self-center ml-auto",children:[d.length," entries"]})]})]}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto",children:c?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading audit logs..."})}):0===d.length?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No audit entries for this period"})}):(0,h.jsxs)("table",{className:"w-full text-xs",children:[(0,h.jsx)("thead",{className:"sticky top-0 bg-slate-900",children:(0,h.jsxs)("tr",{className:"border-b border-slate-800",children:[(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Time"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Source"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Result"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Trust"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Anomaly"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Reason"})]})}),(0,h.jsx)("tbody",{children:d.map(e=>(0,h.jsxs)("tr",{className:"border-b border-slate-800/50 hover:bg-slate-800/30",children:[(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400 whitespace-nowrap",children:new Date(e.timestamp).toLocaleString()}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-300",children:e.source_type}),(0,h.jsx)("td",{className:"px-4 py-2",children:(0,h.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${o1[e.firewall_result]||"text-slate-400"}`,children:e.firewall_result})}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400",children:e.trust_score.toFixed(1)}),(0,h.jsx)("td",{className:"px-4 py-2",children:(0,h.jsx)("span",{className:e.anomaly_score>.5?"text-red-400":e.anomaly_score>.2?"text-yellow-400":"text-slate-400",children:e.anomaly_score.toFixed(2)})}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400 max-w-xs truncate",children:e.reason||"—"})]},e.id))})]})})]})}let o4=o$("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),o5=o$("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function o3({action:e,item:t,onConfirm:s,onCancel:i}){let[r,n]=(0,m.useState)(""),a="yes"===r.trim().toLowerCase();return(0,h.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-700 rounded-xl p-6 max-w-md w-full mx-4",children:[(0,h.jsxs)("h3",{className:"text-sm font-semibold text-white mb-2",children:["approve"===e?"Approve":"Reject"," quarantined item?"]}),(0,h.jsx)("p",{className:"text-xs text-slate-400 mb-1",children:(0,h.jsx)("strong",{children:t.title||"Untitled"})}),(0,h.jsx)("p",{className:"text-xs text-slate-500 mb-4",children:"approve"===e?"This will store the memory in the database.":"This will permanently discard the memory."}),(0,h.jsxs)("div",{className:"mb-4",children:[(0,h.jsxs)("label",{className:"text-xs text-slate-400 block mb-1",children:["Type ",(0,h.jsx)("strong",{className:"text-white",children:"YES"})," to confirm:"]}),(0,h.jsx)("input",{type:"text",value:r,onChange:e=>n(e.target.value),className:"w-full bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-2 focus:ring-cyan-500 focus:border-cyan-500",autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&a&&s(),"Escape"===e.key&&i()}})]}),(0,h.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,h.jsx)("button",{onClick:i,className:"px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:"Cancel"}),(0,h.jsx)("button",{onClick:s,disabled:!a,className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${a?"approve"===e?"bg-green-600 text-white hover:bg-green-500":"bg-red-600 text-white hover:bg-red-500":"bg-slate-700 text-slate-500 cursor-not-allowed"}`,children:"approve"===e?"Approve":"Reject"})]})]})})}function o6(){let e,t,{projectFilter:s}=as(),[i,r]=(0,m.useState)("pending"),{data:n,isLoading:a}=oL(i,100,s||void 0),o=(e=(0,nU.useQueryClient)(),nG({mutationFn:oA,onSuccess:()=>{e.invalidateQueries({queryKey:["quarantine"]}),e.invalidateQueries({queryKey:["audit-stats"]})}})),l=(t=(0,nU.useQueryClient)(),nG({mutationFn:({id:e,notes:t})=>oE(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["quarantine"]}),t.invalidateQueries({queryKey:["audit-stats"]})}})),[c,d]=(0,m.useState)(null),u=n?.items??[];return(0,h.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[c&&(0,h.jsx)(o3,{action:c.action,item:c.item,onConfirm:()=>{c&&("approve"===c.action?o.mutate(c.item.id):l.mutate({id:c.item.id}),d(null))},onCancel:()=>d(null)}),(0,h.jsx)("div",{className:"p-4 border-b border-slate-800 shrink-0",children:(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Quarantine Review"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["pending","approved","rejected"].map(e=>(0,h.jsx)("button",{onClick:()=>r(e),className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${i===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]})}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:a?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading quarantine items..."})}):0===u.length?(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-slate-500",children:[(0,h.jsx)(oz,{size:24,className:"mb-2 text-slate-600"}),(0,h.jsxs)("span",{className:"text-xs",children:["No ",i," items"]})]}):(0,h.jsx)("div",{className:"space-y-3",children:u.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-sm font-medium text-white",children:e.title||"Untitled"}),(0,h.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleString(),e.anomaly_score>0&&(0,h.jsxs)("span",{className:`ml-2 ${e.anomaly_score>.5?"text-red-400":"text-yellow-400"}`,children:["Anomaly: ",e.anomaly_score.toFixed(2)]})]})]}),(0,h.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-2 py-0.5 rounded",children:e.reason?.slice(0,50)||"Threat detected"})]}),(0,h.jsx)("div",{className:"bg-slate-800/50 rounded-lg p-3 mb-3 text-xs text-slate-300 max-h-24 overflow-y-auto whitespace-pre-wrap",children:e.content?.slice(0,500)||"No content"}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mb-3 flex-wrap",children:t.map((e,t)=>(0,h.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1.5 py-0.5 rounded",children:e},t))}),"pending"===e.status&&(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsxs)("button",{onClick:()=>d({action:"approve",item:e}),className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-green-600/10 text-green-400 rounded-lg hover:bg-green-600/20 transition-colors",children:[(0,h.jsx)(o4,{size:12})," Approve"]}),(0,h.jsxs)("button",{onClick:()=>d({action:"reject",item:e}),className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-red-600/10 text-red-400 rounded-lg hover:bg-red-600/20 transition-colors",children:[(0,h.jsx)(o5,{size:12})," Reject"]})]}),e.reviewed_at&&(0,h.jsxs)("div",{className:"text-[10px] text-slate-500",children:["approved"===e.status?"Approved":"Rejected"," by ",e.reviewed_by," at ",new Date(e.reviewed_at).toLocaleString()]})]},e.id)})})})]})}let o8=o$("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),o7=o$("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),o9=o$("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),le=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lt(e,t){let s=new URLSearchParams({timeRange:e});t&&s.set("project",t);let i=await fetch(`${le}/api/v1/agents?${s}`);if(!i.ok)throw Error("Failed to fetch agent registry");return i.json()}async function ls(e,t,s){let i=encodeURIComponent(e),r=new URLSearchParams({timeRange:t});s&&r.set("project",s);let n=await fetch(`${le}/api/v1/agents/${i}/timeline?${r}`);if(!n.ok)throw Error("Failed to fetch agent timeline");return n.json()}async function li(e,t){let s=encodeURIComponent(e),i=new URLSearchParams;t?.limit&&i.set("limit",t.limit.toString()),t?.offset&&i.set("offset",t.offset.toString()),t?.firewallResult&&i.set("firewallResult",t.firewallResult),t?.project&&i.set("project",t.project);let r=await fetch(`${le}/api/v1/agents/${s}/operations?${i}`);if(!r.ok)throw Error("Failed to fetch agent operations");return r.json()}function lr(e,t){return nK({queryKey:["agent-operations",e,t],queryFn:()=>li(e,t),enabled:!!e,refetchInterval:3e4,retry:2})}function ln(e){return e>=.7?"full":e>=.5?"limited":"restricted"}let la={full:"text-green-400",limited:"text-yellow-400",restricted:"text-red-400"},lo={full:"bg-green-500/10",limited:"bg-yellow-500/10",restricted:"bg-red-500/10"},ll={full:"Full Access",limited:"Limited",restricted:"Restricted"},lc=460,ld=90;function lu({identifier:e,timeRange:t}){let{data:s,isLoading:i}=function(e,t="24h",s){return nK({queryKey:["agent-timeline",e,t,void 0],queryFn:()=>ls(e,t,void 0),enabled:!!e,refetchInterval:3e4,retry:2})}(e,t),r=s?.points??[],{linePath:n,dots:a,xLabels:o}=(0,m.useMemo)(()=>{if(0===r.length)return{linePath:"",dots:[],xLabels:[]};let e=r.map(e=>new Date(e.timestamp).getTime()),s=Math.min(...e),i=Math.max(...e)-s||1,n=e=>30+(e-s)/i*lc,a=e=>10+(1-e)*ld,o=r.map((t,s)=>{let i=n(e[s]),r=a(t.trust_score);return`${0===s?"M":"L"} ${i} ${r}`}),l=r.map((t,s)=>({x:n(e[s]),y:a(t.trust_score),result:t.firewall_result,score:t.trust_score,time:t.timestamp})).filter(e=>"ALLOW"!==e.result),c=Math.min(5,r.length),d=[];for(let e=0;e<c;e++){let r=s+i*e/(c-1||1),a=new Date(r);d.push({x:n(r),label:"24h"===t?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString([],{month:"short",day:"numeric"})})}return{linePath:o.join(" "),dots:l,xLabels:d}},[r,t]);return i?(0,h.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"Loading timeline..."}):0===r.length?(0,h.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"No data for this time range."}):(0,h.jsxs)("svg",{viewBox:"0 0 500 120",className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[(0,h.jsx)("line",{x1:30,y1:10+(1-.7)*ld,x2:30+lc,y2:10+(1-.7)*ld,stroke:"#22c55e",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,h.jsx)("line",{x1:30,y1:10+.5*ld,x2:30+lc,y2:10+.5*ld,stroke:"#eab308",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,h.jsx)("text",{x:26,y:10+(1-.7)*ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.7"}),(0,h.jsx)("text",{x:26,y:10+.5*ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.5"}),(0,h.jsx)("text",{x:26,y:13,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"1.0"}),(0,h.jsx)("text",{x:26,y:10+ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.0"}),(0,h.jsx)("path",{d:n,fill:"none",stroke:"#06b6d4",strokeWidth:"1.5"}),a.map((e,t)=>(0,h.jsx)("circle",{cx:e.x,cy:e.y,r:"3",fill:"BLOCK"===e.result?"#ef4444":"#eab308",stroke:"#0f172a",strokeWidth:"1",children:(0,h.jsx)("title",{children:`${e.result} — trust: ${e.score.toFixed(2)} — ${new Date(e.time).toLocaleString()}`})},t)),o.map((e,t)=>(0,h.jsx)("text",{x:e.x,y:116,fill:"#64748b",fontSize:"8",textAnchor:"middle",children:e.label},t))]})}let lh={BLOCK:"text-red-400 bg-red-500/10",QUARANTINE:"text-yellow-400 bg-yellow-500/10"};function lm({identifier:e}){let{data:t,isLoading:s}=lr(e,{firewallResult:"BLOCK",limit:20}),{data:i}=lr(e,{firewallResult:"QUARANTINE",limit:20}),r=[...t?.entries??[],...i?.entries??[]].sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime());return s?(0,h.jsx)("div",{className:"text-slate-500 text-xs",children:"Loading..."}):0===r.length?(0,h.jsx)("div",{className:"text-slate-500 text-xs",children:"No flagged operations."}):(0,h.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto",children:r.map(e=>{let t=[];try{t=JSON.parse(e.threat_indicators)}catch{}return(0,h.jsxs)("div",{className:"px-2 py-1.5 rounded bg-slate-800/50 border border-slate-800",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:`px-1 py-0.5 rounded text-[10px] font-medium ${lh[e.firewall_result]??"text-slate-400"}`,children:e.firewall_result}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),e.reason&&(0,h.jsx)("p",{className:"text-[11px] text-slate-400 mt-0.5 truncate",children:e.reason}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mt-1 flex-wrap",children:t.map((e,t)=>(0,h.jsx)("span",{className:"px-1 py-0.5 rounded text-[9px] bg-red-500/10 text-red-400",children:e},t))}),(0,h.jsxs)("div",{className:"flex gap-3 mt-1 text-[10px] text-slate-500",children:[(0,h.jsxs)("span",{children:["Trust: ",e.trust_score.toFixed(2)]}),(0,h.jsxs)("span",{children:["Anomaly: ",e.anomaly_score.toFixed(2)]}),null!==e.pipeline_duration_ms&&(0,h.jsxs)("span",{children:[e.pipeline_duration_ms,"ms"]})]})]},e.id)})})}let lp=o$("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),lf=p.default.env.NEXT_PUBLIC_WS_URL||"ws://localhost:3001/ws/events";function lx({agentFilter:e}){let[t,s]=(0,m.useState)([]),i=(0,m.useRef)(0),r=(0,m.useRef)(null),n=(0,m.useCallback)(t=>{try{let r=JSON.parse(t.data);if("defence_event"!==r.type)return;let n=r.data;if(e&&n.source_identifier!==e)return;s(e=>[{...n,id:++i.current},...e].slice(0,50))}catch{}},[e]);return((0,m.useEffect)(()=>{try{let e=new WebSocket(lf);return r.current=e,e.onmessage=n,e.onerror=()=>{},()=>{e.close(),r.current=null}}catch{return}},[n]),0===t.length)?(0,h.jsxs)("div",{className:"flex items-center gap-2 text-slate-500 text-xs py-2",children:[(0,h.jsx)(lp,{size:12}),(0,h.jsx)("span",{children:"Listening for defence events..."})]}):(0,h.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:(0,h.jsx)(R,{initial:!1,children:t.map(e=>(0,h.jsxs)(nM.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},className:`px-2 py-1.5 rounded border text-xs ${"BLOCK"===e.firewall_result?"bg-red-500/5 border-red-500/20":"bg-yellow-500/5 border-yellow-500/20"}`,children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:`font-medium ${"BLOCK"===e.firewall_result?"text-red-400":"text-yellow-400"}`,children:e.firewall_result}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleTimeString()})]}),(0,h.jsxs)("p",{className:"text-slate-400 text-[11px] truncate mt-0.5",children:[e.source_identifier," — ",e.reason??"No reason"]})]},e.id))})})}function lg({identifier:e,compact:t}){let s=e.split(">").map(e=>e.trim());return 1===s.length?(0,h.jsx)("span",{className:"font-mono text-sm text-white",children:e}):t?(0,h.jsxs)("span",{className:"font-mono text-sm",children:[(0,h.jsxs)("span",{className:"text-slate-500",children:[s.slice(0,-1).join(" › ")," › "]}),(0,h.jsx)("span",{className:"text-white",children:s[s.length-1]})]}):(0,h.jsx)("div",{className:"font-mono text-sm",children:s.map((e,t)=>(0,h.jsxs)("span",{children:[t>0&&(0,h.jsx)(o9,{size:12,className:"inline text-slate-600 mx-0.5"}),(0,h.jsx)("span",{className:t===s.length-1?"text-white":"text-slate-500",children:e})]},t))})}function ly({score:e}){let t=ln(e);return(0,h.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium ${la[t]} ${lo[t]}`,children:[e.toFixed(2)," · ",ll[t]]})}function lv({type:e}){let t={agent:"text-purple-400 bg-purple-500/10",cli:"text-cyan-400 bg-cyan-500/10",user:"text-green-400 bg-green-500/10",hook:"text-blue-400 bg-blue-500/10",api:"text-orange-400 bg-orange-500/10",web:"text-red-400 bg-red-500/10",file:"text-slate-400 bg-slate-500/10",email:"text-yellow-400 bg-yellow-500/10"}[e]??"text-slate-400 bg-slate-500/10";return(0,h.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${t}`,children:e})}function lb(){let{projectFilter:e}=as(),[t,s]=(0,m.useState)("24h"),[i,r]=(0,m.useState)(null),[n,a]=(0,m.useState)("operation_count"),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),[u,p]=(0,m.useState)(null),[f,x]=(0,m.useState)(!1),{data:g,isLoading:y}=function(e="24h",t){return nK({queryKey:["agents",e,t],queryFn:()=>lt(e,t),refetchInterval:3e4,retry:2})}(t,e??void 0),v=g?.agents??[],b=(0,m.useMemo)(()=>{let e=v;return c&&(e=e.filter(e=>e.source_type===c)),u&&(e=e.filter(e=>ln(e.avg_trust_score)===u)),f&&(e=e.filter(e=>e.flagged_count>0)),e},[v,c,u,f]),w=(0,m.useMemo)(()=>{let e=[...b];return e.sort((e,t)=>{let s=e[n],i=t[n];return"string"==typeof s&&"string"==typeof i?o?s.localeCompare(i):i.localeCompare(s):o?s-i:i-s}),e},[b,n,o]),j=(0,m.useMemo)(()=>[...new Set(v.map(e=>e.source_type))],[v]),k=e=>{n===e?l(!o):(a(e),l(!1))};return(0,h.jsxs)("div",{className:"flex h-full",children:[(0,h.jsxs)("div",{className:`${i?"w-1/2":"w-full"} border-r border-slate-800 flex flex-col`,children:[(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800 flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(oQ,{size:16,className:"text-cyan-400"}),(0,h.jsx)("h2",{className:"text-sm font-medium text-white",children:"Agent Registry"}),(0,h.jsxs)("span",{className:"text-xs text-slate-500",children:[w.length," agents"]})]}),(0,h.jsx)("div",{className:"flex gap-1",children:["24h","7d","30d"].map(e=>(0,h.jsx)("button",{onClick:()=>s(e),className:`px-2 py-0.5 text-[10px] rounded transition-colors ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,h.jsxs)("div",{className:"px-3 py-2 border-b border-slate-800 flex items-center gap-2 flex-wrap",children:[(0,h.jsx)(o8,{size:12,className:"text-slate-500"}),j.map(e=>(0,h.jsx)("button",{onClick:()=>d(c===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${c===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,h.jsx)("span",{className:"text-slate-700",children:"|"}),["full","limited","restricted"].map(e=>(0,h.jsx)("button",{onClick:()=>p(u===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${u===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,h.jsx)("span",{className:"text-slate-700",children:"|"}),(0,h.jsxs)("button",{onClick:()=>x(!f),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors flex items-center gap-0.5 ${f?"bg-red-600/20 text-red-400":"text-slate-500 hover:text-slate-300"}`,children:[(0,h.jsx)(oz,{size:10})," flagged"]})]}),(0,h.jsxs)("div",{className:"px-3 py-1.5 border-b border-slate-800 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 text-[10px] text-slate-500",children:[(0,h.jsx)("span",{children:"Agent"}),(0,h.jsxs)("button",{onClick:()=>k("avg_trust_score"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Trust ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("operation_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Ops ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("flagged_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Flagged ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("last_seen"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Last seen ",(0,h.jsx)(o7,{size:8})]})]}),(0,h.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[y&&(0,h.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"Loading agents..."}),!y&&0===w.length&&(0,h.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"No agents found in this time range."}),w.map(e=>{var t;let s,n=i?.source_identifier===e.source_identifier&&i?.source_type===e.source_type;return(0,h.jsxs)("button",{onClick:()=>r(n?null:e),className:`w-full px-3 py-2 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 items-center text-left transition-colors border-b border-slate-800/50 ${n?"bg-cyan-600/10":"hover:bg-slate-800/50"}`,children:[(0,h.jsxs)("div",{className:"min-w-0",children:[(0,h.jsx)(lg,{identifier:e.source_identifier,compact:!0}),(0,h.jsx)("div",{className:"mt-0.5",children:(0,h.jsx)(lv,{type:e.source_type})})]}),(0,h.jsx)(ly,{score:e.avg_trust_score}),(0,h.jsx)("span",{className:"text-xs text-slate-300 tabular-nums",children:e.operation_count}),(0,h.jsx)("span",{className:`text-xs tabular-nums ${e.flagged_count>0?"text-red-400":"text-slate-500"}`,children:e.flagged_count}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:(t=e.last_seen,(s=Date.now()-new Date(t).getTime())<6e4?"just now":s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`)})]},`${e.source_type}:${e.source_identifier}`)})]})]}),(0,h.jsx)(R,{children:i&&(0,h.jsxs)(nM.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"w-1/2 flex flex-col overflow-y-auto",children:[(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)(lg,{identifier:i.source_identifier}),(0,h.jsx)("button",{onClick:()=>r(null),className:"text-slate-500 hover:text-white text-xs",children:"Close"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,h.jsx)(lv,{type:i.source_type}),(0,h.jsx)(ly,{score:i.avg_trust_score}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:[i.operation_count," ops · ",i.flagged_count," flagged"]})]})]}),(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Trust Score Timeline"}),(0,h.jsx)(lu,{identifier:i.source_identifier,timeRange:t})]}),(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsxs)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:["Flagged Operations",i.flagged_count>0&&(0,h.jsxs)("span",{className:"ml-1 text-red-400",children:["(",i.flagged_count,")"]})]}),(0,h.jsx)(lm,{identifier:i.source_identifier})]}),(0,h.jsxs)("div",{className:"p-3",children:[(0,h.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Live Alerts"}),(0,h.jsx)(lx,{agentFilter:i.source_identifier})]})]})})]})}function lw({className:e,type:t,...s}){return(0,h.jsx)("input",{type:t,"data-slot":"input",className:oi("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}let lj=(0,nA.default)(()=>e.A(1369),{loadableGenerated:{modules:[11570]},ssr:!1,loading:()=>(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading Graph..."})})}),lk=(0,nA.default)(()=>e.A(94049).then(e=>e.BrainScene),{loadableGenerated:{modules:[57754]},ssr:!1,loading:()=>(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading 3D Brain..."})})});function lS(){var e,t;let s,i,r,n,a,o,l,[c,d]=(0,m.useState)(""),[u,p]=(0,m.useState)(!1),[f,x]=(0,m.useState)(!1),[g,y]=(0,m.useState)(void 0),[v,b]=(0,m.useState)(void 0),w=(0,m.useRef)(null),j=(0,m.useRef)(null),k=ai(c,300),{viewMode:S,selectedMemory:N,setSelectedMemory:T,projectFilter:C,setProjectFilter:P}=as(),{data:M=[]}=nK({queryKey:["suggestions",s=ai(c,200)],queryFn:()=>an(s),enabled:s.length>=2,staleTime:3e4,refetchOnWindowFocus:!1}),{data:A}=nK({queryKey:["projects"],queryFn:n4,refetchInterval:6e4});(0,m.useEffect)(()=>{let e=e=>{j.current&&!j.current.contains(e.target)&&w.current&&!w.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let{data:E=[],isLoading:D,isConnected:L}=(e={limit:200,query:k||void 0,mode:k?"search":"recent",project:C||void 0,type:g,category:v},i=(0,nZ.useMemoryWebSocket)(),{...{...r=nK({queryKey:["memories",e],queryFn:()=>n0(e),refetchInterval:3e4}),data:r.data?.memories,pagination:r.data?.pagination},isConnected:i.isConnected,lastEvent:i.lastEvent}),{data:V,isLoading:F}=n6(C||void 0),{data:O=[]}=nK({queryKey:["links",t=C||void 0],queryFn:()=>n2(t),refetchInterval:6e4}),I=(n=(0,nU.useQueryClient)(),nG({mutationFn:n5,onSuccess:()=>{n.invalidateQueries({queryKey:["memories"]}),n.invalidateQueries({queryKey:["stats"]})}}));a=(0,nU.useQueryClient)(),nG({mutationFn:n3,onSuccess:()=>{a.invalidateQueries({queryKey:["memories"]}),a.invalidateQueries({queryKey:["stats"]})}});let{data:$}=nK({queryKey:["control-status"],queryFn:n8,refetchInterval:1e4});o=(0,nU.useQueryClient)(),nG({mutationFn:n7,onSuccess:()=>{o.invalidateQueries({queryKey:["control-status"]})}}),l=(0,nU.useQueryClient)(),nG({mutationFn:n9,onSuccess:()=>{l.invalidateQueries({queryKey:["control-status"]})}});let _=$?.paused??!1,B=e=>{T(e)},z="shield"===S||"audit"===S||"quarantine"===S||"agents"===S;return(0,h.jsxs)("div",{className:"h-screen w-screen bg-slate-950 text-white overflow-hidden flex flex-col",children:[(0,h.jsxs)("header",{className:"h-14 border-b border-slate-800 flex items-center justify-between px-4 bg-slate-900/50 backdrop-blur-sm shrink-0",children:[(0,h.jsxs)("div",{className:"flex items-center gap-4",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(o_,{size:20,className:"text-cyan-400"}),(0,h.jsx)("h1",{className:"text-xl font-bold bg-gradient-to-r from-cyan-400 via-blue-400 to-emerald-400 bg-clip-text text-transparent",children:"ShieldCortex"})]}),(0,h.jsx)("select",{value:C||"",onChange:e=>P(e.target.value||null),className:"bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-1.5 focus:ring-cyan-500 focus:border-cyan-500",children:A?.projects.map(e=>(0,h.jsxs)("option",{value:e.project||"",children:[e.label," (",e.memory_count,")"]},e.project||"all"))}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)(lw,{ref:w,type:"text",placeholder:"Search memories...",value:c,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:e=>{"Escape"===e.key&&p(!1)},className:"w-64 bg-slate-800 border-slate-700 text-white placeholder:text-slate-400 focus:ring-cyan-500"}),u&&M.length>0&&(0,h.jsx)("div",{ref:j,className:"absolute top-full left-0 right-0 mt-1 bg-slate-800 border border-slate-700 rounded-lg shadow-xl overflow-hidden z-50",children:M.map((e,t)=>(0,h.jsxs)("button",{onClick:()=>{d(e.text),p(!1),w.current?.focus()},className:"w-full px-3 py-2 text-left hover:bg-slate-700 transition-colors flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-white text-sm truncate flex-1",children:e.text}),(0,h.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-slate-600 text-slate-300",children:e.type})]},`${e.type}-${e.text}-${t}`))})]}),(0,h.jsxs)(og,{variant:"outline",size:"sm",onClick:()=>x(!f),className:`border-slate-600 text-slate-300 hover:text-white hover:bg-slate-700 ${f?"bg-slate-700":""}`,title:"Filter memories by type and category",children:["Filters ",(g||v)&&"•"]})]}),(0,h.jsx)("div",{className:"flex items-center gap-2",children:(0,h.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-400 px-2",children:[(0,h.jsx)("span",{className:`w-2 h-2 rounded-full ${_?"bg-orange-500 animate-pulse":L?"bg-green-500":"bg-yellow-500"}`,title:_?"Memory creation paused":L?"Real-time connected":"Polling mode"}),V?.total??E.length," memories"]})})]}),f&&(0,h.jsxs)("div",{className:"h-12 border-b border-slate-800 flex items-center gap-4 px-4 bg-slate-900/30",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Type:"}),["short_term","long_term","episodic"].map(e=>(0,h.jsx)("button",{onClick:()=>y(g===e?void 0:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${g===e?"bg-blue-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e.replace("_","-")},e))]}),(0,h.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Category:"}),["architecture","pattern","error","learning","preference","context"].map(e=>(0,h.jsx)("button",{onClick:()=>b(v===e?void 0:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${v===e?"bg-purple-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e},e))]}),(g||v)&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,h.jsx)("button",{onClick:()=>{y(void 0),b(void 0)},className:"px-2 py-1 text-xs text-red-400 hover:text-red-300",children:"Clear all"})]})]}),(0,h.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,h.jsx)(oH,{}),(0,h.jsx)(R,{mode:"wait",children:(0,h.jsxs)(nM.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"flex-1 relative overflow-hidden",children:["shield"===S&&(0,h.jsx)(o0,{}),"audit"===S&&(0,h.jsx)(o2,{}),"quarantine"===S&&(0,h.jsx)(o6,{}),"brain"===S&&(D?(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading memories..."})}):(0,h.jsx)(lk,{memories:E,links:O,selectedMemory:N,onSelectMemory:B})),"graph"===S&&(0,h.jsx)(lj,{memories:E,links:O,selectedMemory:N,onSelectMemory:B}),"agents"===S&&(0,h.jsx)(lb,{}),"memories"===S&&(0,h.jsx)(oN,{memories:E,selectedMemory:N,onSelectMemory:B})]},S)}),N&&!z&&(0,h.jsx)("div",{className:"w-80 border-l border-slate-800 overflow-y-auto shrink-0",children:(0,h.jsx)(ow,{memory:N,links:O,memories:E,onClose:()=>T(null),onReinforce:e=>{I.mutate(e)},onSelectMemory:e=>{let t=E.find(t=>t.id===e);t&&T(t)}})})]})]})}e.s(["default",()=>lS],23733)}]);
|
|
9
|
+
`),()=>{g.contains(x)&&g.removeChild(x)}},[t]),(0,h.jsx)(N,{isPresent:t,childRef:a,sizeRef:o,children:j.cloneElement(e,{ref:c})})}let C=({children:e,initial:t,isPresent:s,onExitComplete:i,custom:r,presenceAffectsLayout:n,mode:a,anchorX:o,anchorY:l,root:c})=>{let d=x(P),u=(0,m.useId)(),p=!0,f=(0,m.useMemo)(()=>(p=!1,{id:u,initial:t,isPresent:s,custom:r,onExitComplete:e=>{for(let t of(d.set(e,!0),d.values()))if(!t)return;i&&i()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[s,d,i]);return n&&p&&(f={...f}),(0,m.useMemo)(()=>{d.forEach((e,t)=>d.set(t,!1))},[s]),m.useEffect(()=>{s||d.size||!i||i()},[s]),"popLayout"===a&&(e=(0,h.jsx)(T,{isPresent:s,anchorX:o,anchorY:l,root:c,children:e})),(0,h.jsx)(v.Provider,{value:f,children:e})};function P(){return new Map}function M(e=!0){let t=(0,m.useContext)(v);if(null===t)return[!0,null];let{isPresent:s,onExitComplete:i,register:r}=t,n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return r(n)},[e]);let a=(0,m.useCallback)(()=>e&&i&&i(n),[n,i,e]);return!s&&i?[!1,a]:[!0]}let A=e=>e.key||"";function E(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}let R=({children:e,custom:t,initial:s=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:n="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:c})=>{let[d,u]=M(a),p=(0,m.useMemo)(()=>E(e),[e]),g=a&&!d?[]:p.map(A),v=(0,m.useRef)(!0),b=(0,m.useRef)(p),w=x(()=>new Map),j=(0,m.useRef)(new Set),[k,S]=(0,m.useState)(p),[N,T]=(0,m.useState)(p);y(()=>{v.current=!1,b.current=p;for(let e=0;e<N.length;e++){let t=A(N[e]);g.includes(t)?(w.delete(t),j.current.delete(t)):!0!==w.get(t)&&w.set(t,!1)}},[N,g.length,g.join("-")]);let P=[];if(p!==k){let e=[...p];for(let t=0;t<N.length;t++){let s=N[t],i=A(s);g.includes(i)||(e.splice(t,0,s),P.push(s))}return"wait"===n&&P.length&&(e=P),T(E(e)),S(p),null}let{forceRender:R}=(0,m.useContext)(f);return(0,h.jsx)(h.Fragment,{children:N.map(e=>{let m=A(e),f=(!a||!!d)&&(p===N||g.includes(m));return(0,h.jsx)(C,{isPresent:f,initial:(!v.current||!!s)&&void 0,custom:t,presenceAffectsLayout:r,mode:n,root:c,onExitComplete:f?void 0:()=>{if(j.current.has(m)||(j.current.add(m),!w.has(m)))return;w.set(m,!0);let e=!0;w.forEach(t=>{t||(e=!1)}),e&&(R?.(),T(b.current),a&&u?.(),i&&i())},anchorX:o,anchorY:l,children:e},m)})})},D=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],L=new Set(D),V=(e,t,s)=>s>t?t:s<e?e:s,F={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},O={...F,transform:e=>V(0,1,e)},I={...F,default:1},$=e=>Math.round(1e5*e)/1e5,_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,z=(e,t)=>s=>!!("string"==typeof s&&B.test(s)&&s.startsWith(e)||t&&null!=s&&Object.prototype.hasOwnProperty.call(s,t)),U=(e,t,s)=>i=>{if("string"!=typeof i)return i;let[r,n,a,o]=i.match(_);return{[e]:parseFloat(r),[t]:parseFloat(n),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},q={...F,transform:e=>Math.round(V(0,255,e))},W={test:z("rgb","red"),parse:U("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+q.transform(e)+", "+q.transform(t)+", "+q.transform(s)+", "+$(O.transform(i))+")"},Q={test:z("#"),parse:function(e){let t="",s="",i="",r="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,s+=s,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:W.transform},K=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),H=K("deg"),X=K("%"),Y=K("px"),G=K("vh"),Z=K("vw"),J={...X,parse:e=>X.parse(e)/100,transform:e=>X.transform(100*e)},ee={test:z("hsl","hue"),parse:U("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+X.transform($(t))+", "+X.transform($(s))+", "+$(O.transform(i))+")"},et={test:e=>W.test(e)||Q.test(e)||ee.test(e),parse:e=>W.test(e)?W.parse(e):ee.test(e)?ee.parse(e):Q.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?W.transform(e):ee.transform(e),getAnimatableNone:e=>{let t=et.parse(e);return t.alpha=0,et.transform(t)}},es=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ei="number",er="color",en=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ea(e){let t=e.toString(),s=[],i={color:[],number:[],var:[]},r=[],n=0,a=t.replace(en,e=>(et.test(e)?(i.color.push(n),r.push(er),s.push(et.parse(e))):e.startsWith("var(")?(i.var.push(n),r.push("var"),s.push(e)):(i.number.push(n),r.push(ei),s.push(parseFloat(e))),++n,"${}")).split("${}");return{values:s,split:a,indexes:i,types:r}}function eo(e){return ea(e).values}function el(e){let{split:t,types:s}=ea(e),i=t.length;return e=>{let r="";for(let n=0;n<i;n++)if(r+=t[n],void 0!==e[n]){let t=s[n];t===ei?r+=$(e[n]):t===er?r+=et.transform(e[n]):r+=e[n]}return r}}let ec=e=>"number"==typeof e?0:et.test(e)?et.getAnimatableNone(e):e,ed={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(_)?.length||0)+(e.match(es)?.length||0)>0},parse:eo,createTransformer:el,getAnimatableNone:function(e){let t=eo(e);return el(e)(t.map(ec))}},eu=new Set(["brightness","contrast","saturate","opacity"]);function eh(e){let[t,s]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[i]=s.match(_)||[];if(!i)return e;let r=s.replace(i,""),n=+!!eu.has(t);return i!==s&&(n*=100),t+"("+n+r+")"}let em=/\b([a-z-]*)\(.*?\)/gu,ep={...ed,getAnimatableNone:e=>{let t=e.match(em);return t?t.map(eh).join(" "):e}},ef={...F,transform:Math.round},ex={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:I,scaleX:I,scaleY:I,scaleZ:I,skew:H,skewX:H,skewY:H,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:O,originX:J,originY:J,originZ:Y,zIndex:ef,fillOpacity:O,strokeOpacity:O,numOctaves:ef},eg={...ex,color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,filter:ep,WebkitFilter:ep},ey=e=>eg[e],ev=()=>({translate:0,scale:1,origin:0,originPoint:0}),eb=()=>({x:ev(),y:ev()}),ew=()=>({min:0,max:0}),ej=()=>({x:ew(),y:ew()}),ek=e=>!!(e&&e.getVelocity),eS=new Set(["width","height","top","left","right","bottom",...D]),eN=e=>t=>t.test(e),eT=[F,Y,X,H,Z,G,{test:e=>"auto"===e,parse:e=>e}],eC=e=>eT.find(eN(e)),eP=()=>{},eM=()=>{};p.default;let eA=e=>t=>"string"==typeof t&&t.startsWith(e),eE=eA("--"),eR=eA("var(--"),eD=e=>!!eR(e)&&eL.test(e.split("/*")[0].trim()),eL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function eV(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let eF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,eO=e=>180*e/Math.PI,eI=e=>e_(eO(Math.atan2(e[1],e[0]))),e$={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eI,rotateZ:eI,skewX:e=>eO(Math.atan(e[1])),skewY:e=>eO(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},e_=e=>((e%=360)<0&&(e+=360),e),eB=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ez=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eB,scaleY:ez,scale:e=>(eB(e)+ez(e))/2,rotateX:e=>e_(eO(Math.atan2(e[6],e[5]))),rotateY:e=>e_(eO(Math.atan2(-e[2],e[0]))),rotateZ:eI,rotate:eI,skewX:e=>eO(Math.atan(e[4])),skewY:e=>eO(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eq(e){return+!!e.includes("scale")}function eW(e,t){let s,i;if(!e||"none"===e)return eq(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(r)s=eU,i=r;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=e$,i=t}if(!i)return eq(t);let n=s[t],a=i[1].split(",").map(eQ);return"function"==typeof n?n(a):a[n]}function eQ(e){return parseFloat(e.trim())}let eK=e=>e===F||e===Y,eH=new Set(["x","y","z"]),eX=D.filter(e=>!eH.has(e)),eY={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>eW(t,"x"),y:(e,{transform:t})=>eW(t,"y")};eY.translateX=eY.x,eY.translateY=eY.y;let eG=e=>e,eZ={},eJ=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function e0(e,t){let s=!1,i=!0,r={delta:0,timestamp:0,isProcessing:!1},n=()=>s=!0,a=eJ.reduce((e,s)=>(e[s]=function(e,t){let s=new Set,i=new Set,r=!1,n=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){a.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:(e,t=!1,n=!1)=>{let o=n&&r?s:i;return t&&a.add(e),o.has(e)||o.add(e),e},cancel:e=>{i.delete(e),a.delete(e)},process:e=>{if(o=e,r){n=!0;return}r=!0,[s,i]=[i,s],s.forEach(c),t,l=0,s.clear(),r=!1,n&&(n=!1,d.process(e))}};return d}(n,t?s:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:m,postRender:p}=a,f=()=>{let n=eZ.useManualTiming?r.timestamp:performance.now();s=!1,eZ.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(n-r.timestamp,40),1)),r.timestamp=n,r.isProcessing=!0,o.process(r),l.process(r),c.process(r),d.process(r),u.process(r),h.process(r),m.process(r),p.process(r),r.isProcessing=!1,s&&t&&(i=!1,e(f))};return{schedule:eJ.reduce((t,n)=>{let o=a[n];return t[n]=(t,n=!1,a=!1)=>(!s&&(s=!0,i=!0,r.isProcessing||e(f)),o.schedule(t,n,a)),t},{}),cancel:e=>{for(let t=0;t<eJ.length;t++)a[eJ[t]].cancel(e)},state:r,steps:a}}let{schedule:e1,cancel:e2,state:e4,steps:e5}=e0("u">typeof requestAnimationFrame?requestAnimationFrame:eG,!0),e3=new Set,e6=!1,e8=!1,e7=!1;function e9(){if(e8){let e=Array.from(e3).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),s=new Map;t.forEach(e=>{let t,i=(t=[],eX.forEach(s=>{let i=e.getValue(s);void 0!==i&&(t.push([s,i.get()]),i.set(+!!s.startsWith("scale")))}),t);i.length&&(s.set(e,i),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=s.get(e);t&&t.forEach(([t,s])=>{e.getValue(t)?.set(s)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}e8=!1,e6=!1,e3.forEach(e=>e.complete(e7)),e3.clear()}function te(){e3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e8=!0)})}class tt{constructor(e,t,s,i,r,n=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=i,this.element=r,this.isAsync=n}scheduleResolve(){this.state="scheduled",this.isAsync?(e3.add(this),e6||(e6=!0,e1.read(te),e1.resolveKeyframes(e9))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:s,motionValue:i}=this;if(null===e[0]){let r=i?.get(),n=e[e.length-1];if(void 0!==r)e[0]=r;else if(s&&t){let i=s.readValue(t,n);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=n),i&&void 0===r&&i.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),e3.delete(this)}cancel(){"scheduled"===this.state&&(e3.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function ts(e,t){let s=ey(e);return s!==ep&&(s=ed),s.getAnimatableNone?s.getAnimatableNone(t):void 0}let ti=new Set(["auto","none","0"]);class tr extends tt{constructor(e,t,s,i,r){super(e,t,s,i,r,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let i=e[s];if("string"==typeof i&&eD(i=i.trim())){let r=function e(t,s,i=1){eM(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[r,n]=function(e){let t=eF.exec(e);if(!t)return[,];let[,s,i,r]=t;return[`--${s??i}`,r]}(t);if(!r)return;let a=window.getComputedStyle(s).getPropertyValue(r);if(a){let e=a.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return eD(n)?e(n,s,i+1):n}(i,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!eS.has(s)||2!==e.length)return;let[i,r]=e,n=eC(i),a=eC(r);if(eV(i)!==eV(r)&&eY[s]){this.needsMeasurement=!0;return}if(n!==a)if(eK(n)&&eK(a))for(let t=0;t<e.length;t++){let s=e[t];"string"==typeof s&&(e[t]=parseFloat(s))}else eY[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,s=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&s.push(t);s.length&&function(e,t,s){let i,r=0;for(;r<e.length&&!i;){let t=e[r];"string"==typeof t&&!ti.has(t)&&ea(t).values.length&&(i=e[r]),r++}if(i&&s)for(let r of t)e[r]=ts(s,i)}(e,s,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=eY[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let i=t[t.length-1];void 0!==i&&e.getValue(s,i).jump(i,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;let i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);let r=s.length-1,n=s[r];s[r]=eY[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==n&&void 0===this.finalKeyframe&&(this.finalKeyframe=n),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,s])=>{e.getValue(t).set(s)}),this.resolveNoneKeyframes()}}function tn(e,t){-1===e.indexOf(t)&&e.push(t)}function ta(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}class to{constructor(){this.subscriptions=[]}add(e){return tn(this.subscriptions,e),()=>ta(this.subscriptions,e)}notify(e,t,s){let i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,s);else for(let r=0;r<i;r++){let i=this.subscriptions[r];i&&i(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let{schedule:tl}=e0(queueMicrotask,!1);function tc(){t=void 0}let td={now:()=>(void 0===t&&td.set(e4.isProcessing||eZ.useManualTiming?e4.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tc)}};class tu{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=td.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=td.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new to);let s=this.events[e].add(t);return"change"===e?()=>{s(),e1.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return c&&c.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=td.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let s=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),s?1e3/s*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function th(e,t){return new tu(e,t)}let tm=[...eT,et,ed],tp={current:null},tf={current:!1},tx="u">typeof window,tg=new WeakMap;function ty(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tv(e){return"string"==typeof e||Array.isArray(e)}let tb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tw=["initial",...tb];function tj(e){return ty(e.animate)||tw.some(t=>tv(e[t]))}function tk(e){return!!(tj(e)||e.variants)}function tS(e){let t=[{},{}];return e?.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function tN(e,t,s,i){if("function"==typeof t){let[r,n]=tS(i);t=t(void 0!==s?s:e.custom,r,n)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[r,n]=tS(i);t=t(void 0!==s?s:e.custom,r,n)}return t}let tT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],tC={};class tP{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=td.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,e1.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=n;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=tj(t),this.isVariantNode=tk(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==o[e]&&ek(t)&&t.set(o[e])}}mount(e){this.current=e,tg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tf.current||function(){if(tf.current=!0,tx)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tp.current=e.matches;e.addEventListener("change",t),t()}else tp.current=!1}(),this.shouldReduceMotion=tp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),e2(this.notifyUpdate),e2(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let s;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=L.has(e);i&&this.onBindTransform&&this.onBindTransform();let r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&e1.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in tC){let t=tC[e];if(!t)continue;let{isEnabled:s,Feature:i}=t;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ej()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<tT.length;t++){let s=tT[t];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let i=e["on"+s];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=function(e,t,s){for(let i in t){let r=t[i],n=s[i];if(ek(r))e.addValue(i,r);else if(ek(n))e.addValue(i,th(r,{owner:e}));else if(n!==r)if(e.hasValue(i)){let t=e.getValue(i);!0===t.liveStyle?t.jump(r):t.hasAnimated||t.set(r)}else{let t=e.getStaticValue(i);e.addValue(i,th(void 0!==t?t:r,{owner:e}))}}for(let i in s)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return void 0===s&&void 0!==t&&(s=th(null===t?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=s){let i,r;if("string"==typeof s&&(i=s,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i)||(r=s,/^0[^.\s]+$/u.test(r))))s=parseFloat(s);else{let i;i=s,!tm.find(eN(i))&&ed.test(t)&&(s=ts(e,t))}this.setBaseTarget(e,ek(s)?s.get():s)}return ek(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let i=tN(this.props,s,this.presenceContext?.custom);i&&(t=i[e])}if(s&&void 0!==t)return t;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ek(i)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new to),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){tl.render(this.render)}}class tM extends tP{constructor(){super(...arguments),this.KeyframeResolver=tr}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ek(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function tA(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let tE=(e,t)=>t&&"number"==typeof e?t.transform(e):e,tR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tD=D.length;function tL(e,t,s){let{style:i,vars:r,transformOrigin:n}=e,a=!1,o=!1;for(let e in t){let s=t[e];if(L.has(e)){a=!0;continue}if(eE(e)){r[e]=s;continue}{let t=tE(s,ex[e]);e.startsWith("origin")?(o=!0,n[e]=t):i[e]=t}}if(!t.transform&&(a||s?i.transform=function(e,t,s){let i="",r=!0;for(let n=0;n<tD;n++){let a=D[n],o=e[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===+!!a.startsWith("scale");else{let e=parseFloat(o);l=a.startsWith("scale")?1===e:0===e}if(!l||s){let e=tE(o,ex[a]);if(!l){r=!1;let t=tR[a]||a;i+=`${t}(${e}) `}s&&(t[a]=e)}}return i=i.trim(),s?i=s(t,r?"":i):r&&(i="none"),i}(t,e.transform,s):i.transform&&(i.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:s=0}=n;i.transformOrigin=`${e} ${t} ${s}`}}let tV={offset:"stroke-dashoffset",array:"stroke-dasharray"},tF={offset:"strokeDashoffset",array:"strokeDasharray"},tO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function tI(e,{attrX:t,attrY:s,attrScale:i,pathLength:r,pathSpacing:n=1,pathOffset:a=0,...o},l,c,d){if(tL(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:u,style:h}=e;for(let e of(u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox),tO))void 0!==u[e]&&(h[e]=u[e],delete u[e]);void 0!==t&&(u.x=t),void 0!==s&&(u.y=s),void 0!==i&&(u.scale=i),void 0!==r&&function(e,t,s=1,i=0,r=!0){e.pathLength=1;let n=r?tV:tF;e[n.offset]=`${-i}`,e[n.array]=`${t} ${s}`}(u,r,n,a,!1)}let t$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),t_=e=>"string"==typeof e&&"svg"===e.toLowerCase();function tB(e,{style:t,vars:s},i,r){let n,a=e.style;for(n in t)a[n]=t[n];for(n in r?.applyProjectionStyles(a,i),s)a.setProperty(n,s[n])}function tz(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let tU={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!Y.test(e))return e;else e=parseFloat(e);let s=tz(e,t.target.x),i=tz(e,t.target.y);return`${s}% ${i}%`}},tq=(e,t,s)=>e+(t-e)*s,tW={borderRadius:{...tU,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tU,borderTopRightRadius:tU,borderBottomLeftRadius:tU,borderBottomRightRadius:tU,boxShadow:{correct:(e,{treeScale:t,projectionDelta:s})=>{let i=ed.parse(e);if(i.length>5)return e;let r=ed.createTransformer(e),n=+("number"!=typeof i[0]),a=s.x.scale*t.x,o=s.y.scale*t.y;i[0+n]/=a,i[1+n]/=o;let l=tq(a,o,.5);return"number"==typeof i[2+n]&&(i[2+n]/=l),"number"==typeof i[3+n]&&(i[3+n]/=l),r(i)}}};function tQ(e,{layout:t,layoutId:s}){return L.has(e)||e.startsWith("origin")||(t||void 0!==s)&&(!!tW[e]||"opacity"===e)}function tK(e,t,s){let i=e.style,r=t?.style,n={};if(!i)return n;for(let t in i)(ek(i[t])||r&&ek(r[t])||tQ(t,e)||s?.getValue(t)?.liveStyle!==void 0)&&(n[t]=i[t]);return n}function tH(e,t,s){let i=tK(e,t,s);for(let s in e)(ek(e[s])||ek(t[s]))&&(i[-1!==D.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=e[s]);return i}class tX extends tM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ej}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(L.has(t)){let e=ey(t);return e&&e.default||0}return t=t$.has(t)?t:tA(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return tH(e,t,s)}build(e,t,s){tI(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,i){for(let s in tB(e,t,void 0,i),t.attrs)e.setAttribute(t$.has(s)?s:tA(s),t.attrs[s])}mount(e){this.isSVGTag=t_(e.tagName),super.mount(e)}}function tY({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}function tG(e){return void 0===e||1===e}function tZ({scale:e,scaleX:t,scaleY:s}){return!tG(e)||!tG(t)||!tG(s)}function tJ(e){return tZ(e)||t0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t0(e){var t,s;return(t=e.x)&&"0%"!==t||(s=e.y)&&"0%"!==s}function t1(e,t,s,i,r){return void 0!==r&&(e=i+r*(e-i)),i+s*(e-i)+t}function t2(e,t=0,s=1,i,r){e.min=t1(e.min,t,s,i,r),e.max=t1(e.max,t,s,i,r)}function t4(e,{x:t,y:s}){t2(e.x,t.translate,t.scale,t.originPoint),t2(e.y,s.translate,s.scale,s.originPoint)}function t5(e,t){e.min=e.min+t,e.max=e.max+t}function t3(e,t,s,i,r=.5){let n=tq(e.min,e.max,r);t2(e,t,s,n,i)}function t6(e,t){t3(e.x,t.x,t.scaleX,t.scale,t.originX),t3(e.y,t.y,t.scaleY,t.scale,t.originY)}function t8(e,t){return tY(function(e,t){if(!t)return e;let s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class t7 extends tM{constructor(){super(...arguments),this.type="html",this.renderInstance=tB}readValueFromInstance(e,t){if(L.has(t))return this.projection?.isProjecting?eq(t):((e,t)=>{let{transform:s="none"}=getComputedStyle(e);return eW(s,t)})(e,t);{let s=window.getComputedStyle(e),i=(eE(t)?s.getPropertyValue(t):s[t])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:t}){return t8(e,t)}build(e,t,s){tL(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return tK(e,t,s)}}let t9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function se(e){if("string"!=typeof e||e.includes("-"));else if(t9.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let st=(0,m.createContext)({strict:!1}),ss=(0,m.createContext)({});function si(e){return Array.isArray(e)?e.join(" "):e}let sr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sn(e,t,s){for(let i in t)ek(t[i])||tQ(i,s)||(e[i]=t[i])}let sa=()=>({...sr(),attrs:{}}),so=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sl(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||so.has(e)}let sc=e=>!sl(e);try{u=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof u&&(sc=e=>e.startsWith("on")?!sl(e):u(e))}catch{}function sd(e){return ek(e)?e.get():e}let su=e=>(t,s)=>{let i=(0,m.useContext)(ss),r=(0,m.useContext)(v),n=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},s,i,r){return{latestValues:function(e,t,s,i){let r={},n=i(e,{});for(let e in n)r[e]=sd(n[e]);let{initial:a,animate:o}=e,l=tj(e),c=tk(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===o&&(o=t.animate));let d=!!s&&!1===s.initial,u=(d=d||!1===a)?o:a;if(u&&"boolean"!=typeof u&&!ty(u)){let t=Array.isArray(u)?u:[u];for(let s=0;s<t.length;s++){let i=tN(e,t[s]);if(i){let{transitionEnd:e,transition:t,...s}=i;for(let e in s){let t=s[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(r[e]=t)}for(let t in e)r[t]=e[t]}}}return r}(s,i,r,e),renderState:t()}})(e,t,i,r);return s?n():x(n)},sh=su({scrapeMotionValuesFromProps:tK,createRenderState:sr}),sm=su({scrapeMotionValuesFromProps:tH,createRenderState:sa}),sp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},sf=!1;function sx(){return!function(){if(sf)return;let e={};for(let t in sp)e[t]={isEnabled:e=>sp[t].some(t=>!!e[t])};tC=e,sf=!0}(),tC}let sg=Symbol.for("motionComponentSymbol"),sy="data-"+tA("framerAppearId"),sv=(0,m.createContext)({});function sb(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function sw(e,{forwardMotionProps:t=!1,type:s}={},i,r){i&&function(e){let t=sx();for(let s in e)t[s]={...t[s],...e[s]};tC=t}(i);let n=s?"svg"===s:se(e),a=n?sm:sh;function o(s,i){var o;let l,c,d,u={...(0,m.useContext)(k),...s,layoutId:function({layoutId:e}){let t=(0,m.useContext)(f).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:p}=u,x=function(e){let{initial:t,animate:s}=function(e,t){if(tj(e)){let{initial:t,animate:s}=e;return{initial:!1===t||tv(t)?t:void 0,animate:tv(s)?s:void 0}}return!1!==e.inherit?t:{}}(e,(0,m.useContext)(ss));return(0,m.useMemo)(()=>({initial:t,animate:s}),[si(t),si(s)])}(s),b=a(s,p);if(!p&&g){(0,m.useContext)(st).strict;let t=function(e){let{drag:t,layout:s}=sx();if(!t&&!s)return{};let i={...t,...s};return{MeasureLayout:t?.isEnabled(e)||s?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);l=t.MeasureLayout,x.visualElement=function(e,t,s,i,r,n){let{visualElement:a}=(0,m.useContext)(ss),o=(0,m.useContext)(st),l=(0,m.useContext)(v),c=(0,m.useContext)(k).reducedMotion,d=(0,m.useRef)(null),u=(0,m.useRef)(!1);i=i||o.renderer,!d.current&&i&&(d.current=i(e,{visualState:t,parent:a,props:s,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,isSVG:n}),u.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let h=d.current,p=(0,m.useContext)(sv);h&&!h.projection&&r&&("html"===h.type||"svg"===h.type)&&function(e,t,s,i){let{layoutId:r,layout:n,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:r,layout:n,alwaysMeasureLayout:!!a||o&&sb(o),visualElement:e,animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c})}(d.current,s,r,p);let f=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&f.current&&h.update(s,l)});let x=s[sy],g=(0,m.useRef)(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return y(()=>{u.current=!0,h&&(f.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),g.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!g.current&&h.animationState&&h.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),g.current=!1),h.enteringChildren=void 0)}),h}(e,b,u,r,t.ProjectionNode,n)}return(0,h.jsxs)(ss.Provider,{value:x,children:[l&&x.visualElement?(0,h.jsx)(l,{visualElement:x.visualElement,...u}):null,function(e,t,s,{latestValues:i},r,n=!1,a){let o=(a??se(e)?function(e,t,s,i){let r=(0,m.useMemo)(()=>{let s=sa();return tI(s,t,t_(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let t={};sn(t,e.style,e),r.style={...t,...r.style}}return r}:function(e,t){let s,i,r={},n=(s=e.style||{},sn(i={},s,e),Object.assign(i,function({transformTemplate:e},t){return(0,m.useMemo)(()=>{let s=sr();return tL(s,t,e),Object.assign({},s.vars,s.style)},[t])}(e,t)),i);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r})(t,i,r,e),l=function(e,t,s){let i={};for(let r in e)("values"!==r||"object"!=typeof e.values)&&(sc(r)||!0===s&&sl(r)||!t&&!sl(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}(t,"string"==typeof e,n),c=e!==m.Fragment?{...l,...o,ref:s}:{},{children:d}=t,u=(0,m.useMemo)(()=>ek(d)?d.get():d,[d]);return(0,m.createElement)(e,{...c,children:u})}(e,s,(o=x.visualElement,c=(0,m.useRef)(i),(0,m.useInsertionEffect)(()=>{c.current=i}),d=(0,m.useRef)(null),(0,m.useCallback)(e=>{e&&b.onMount?.(e),o&&(e?o.mount(e):o.unmount());let t=c.current;if("function"==typeof t)if(e){let s=t(e);"function"==typeof s&&(d.current=s)}else d.current?(d.current(),d.current=null):t(e);else t&&(t.current=e)},[o])),b,p,t,n)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,m.forwardRef)(o);return l[sg]=e,l}class sj{constructor(e){this.isMounted=!1,this.node=e}update(){}}function sk(e,t,s){let i=e.getProps();return tN(i,t,void 0!==s?s:i.custom,e)}function sS(e,t){return e?.[t]??e?.default??e}let sN=e=>Array.isArray(e);function sT(e,t){let s=e.getValue("willChange");if(ek(s)&&s.add)return s.add(t);if(!s&&eZ.WillChange){let s=new eZ.WillChange("auto");e.addValue("willChange",s),s.add(t)}}let sC=e=>1e3*e,sP=(e,t)=>s=>t(e(s)),sM=(...e)=>e.reduce(sP),sA={layout:0,mainThread:0,waapi:0};function sE(e,t,s){return(s<0&&(s+=1),s>1&&(s-=1),s<1/6)?e+(t-e)*6*s:s<.5?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function sR(e,t){return s=>s>0?t:e}let sD=(e,t,s)=>{let i=e*e,r=s*(t*t-i)+i;return r<0?0:Math.sqrt(r)},sL=[Q,W,ee];function sV(e){let t=sL.find(t=>t.test(e));if(eP(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===ee&&(s=function({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,s/=100;let r=0,n=0,a=0;if(t/=100){let i=s<.5?s*(1+t):s+t-s*t,o=2*s-i;r=sE(o,i,e+1/3),n=sE(o,i,e),a=sE(o,i,e-1/3)}else r=n=a=s;return{red:Math.round(255*r),green:Math.round(255*n),blue:Math.round(255*a),alpha:i}}(s)),s}let sF=(e,t)=>{let s=sV(e),i=sV(t);if(!s||!i)return sR(e,t);let r={...s};return e=>(r.red=sD(s.red,i.red,e),r.green=sD(s.green,i.green,e),r.blue=sD(s.blue,i.blue,e),r.alpha=tq(s.alpha,i.alpha,e),W.transform(r))},sO=new Set(["none","hidden"]);function sI(e,t){return s=>tq(e,t,s)}function s$(e){return"number"==typeof e?sI:"string"==typeof e?eD(e)?sR:et.test(e)?sF:sz:Array.isArray(e)?s_:"object"==typeof e?et.test(e)?sF:sB:sR}function s_(e,t){let s=[...e],i=s.length,r=e.map((e,s)=>s$(e)(e,t[s]));return e=>{for(let t=0;t<i;t++)s[t]=r[t](e);return s}}function sB(e,t){let s={...e,...t},i={};for(let r in s)void 0!==e[r]&&void 0!==t[r]&&(i[r]=s$(e[r])(e[r],t[r]));return e=>{for(let t in i)s[t]=i[t](e);return s}}let sz=(e,t)=>{let s=ed.createTransformer(t),i=ea(e),r=ea(t);if(!(i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length))return eP(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),sR(e,t);if(sO.has(e)&&!r.values.length||sO.has(t)&&!i.values.length)return sO.has(e)?s=>s<=0?e:t:s=>s>=1?t:e;return sM(s_(function(e,t){let s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){let n=t.types[r],a=e.indexes[n][i[n]],o=e.values[a]??0;s[r]=o,i[n]++}return s}(i,r),r.values),s)};function sU(e,t,s){return"number"==typeof e&&"number"==typeof t&&"number"==typeof s?tq(e,t,s):s$(e)(e,t)}let sq=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>e1.update(t,e),stop:()=>e2(t),now:()=>e4.isProcessing?e4.timestamp:td.now()}},sW=(e,t,s=10)=>{let i="",r=Math.max(Math.round(t/s),2);for(let t=0;t<r;t++)i+=Math.round(1e4*e(t/(r-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`};function sQ(e){let t=0,s=e.next(t);for(;!s.done&&t<2e4;)t+=50,s=e.next(t);return t>=2e4?1/0:t}function sK(e,t,s){var i,r;let n=Math.max(t-5,0);return i=s-e(n),(r=t-n)?1e3/r*i:0}let sH=.01,sX=2,sY=.005,sG=.5;function sZ(e,t){return e*Math.sqrt(1-t*t)}let sJ=["duration","bounce"],s0=["stiffness","damping","mass"];function s1(e,t){return t.some(t=>void 0!==e[t])}function s2(e=.3,t=.3){let s,i="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:n}=i,a=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:d,mass:u,duration:h,velocity:m,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!s1(e,s0)&&s1(e,sJ))if(e.visualDuration){let s=2*Math.PI/(1.2*e.visualDuration),i=s*s,r=2*V(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:r}}else{let s=function({duration:e=800,bounce:t=.3,velocity:s=0,mass:i=1}){let r,n;eP(e<=sC(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=V(.05,1,a),e=V(.01,10,e/1e3),a<1?(r=t=>{let i=t*a,r=i*e;return .001-(i-s)/sZ(t,a)*Math.exp(-r)},n=t=>{let i=t*a*e,n=Math.pow(a,2)*Math.pow(t,2)*e,o=Math.exp(-i),l=sZ(Math.pow(t,2),a);return(i*s+s-n)*o*(-r(t)+.001>0?-1:1)/l}):(r=t=>-.001+Math.exp(-t*e)*((t-s)*e+1),n=t=>e*e*(s-t)*Math.exp(-t*e));let o=function(e,t,s){let i=s;for(let s=1;s<12;s++)i-=e(i)/t(i);return i}(r,n,5/e);if(e=sC(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}(e);(t={...t,...s,mass:1}).isResolvedFromDuration=!0}return t}({...i,velocity:-((i.velocity||0)/1e3)}),f=m||0,x=d/(2*Math.sqrt(c*u)),g=o-a,y=Math.sqrt(c/u)/1e3,v=5>Math.abs(g);if(r||(r=v?sH:sX),n||(n=v?sY:sG),x<1){let e=sZ(y,x);s=t=>o-Math.exp(-x*y*t)*((f+x*y*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(1===x)s=e=>o-Math.exp(-y*e)*(g+(f+y*g)*e);else{let e=y*Math.sqrt(x*x-1);s=t=>{let s=Math.exp(-x*y*t),i=Math.min(e*t,300);return o-s*((f+x*y*g)*Math.sinh(i)+e*g*Math.cosh(i))/e}}let b={calculatedDuration:p&&h||null,next:e=>{let t=s(e);if(p)l.done=e>=h;else{let i=0===e?f:0;x<1&&(i=0===e?sC(f):sK(s,e,t));let a=Math.abs(o-t)<=n;l.done=Math.abs(i)<=r&&a}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(sQ(b),2e4),t=sW(t=>b.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return b}function s4({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:d}){let u,h,m=e[0],p={done:!1,value:m},f=s*t,x=m+f,g=void 0===a?x:a(x);g!==x&&(f=g-m);let y=e=>-f*Math.exp(-e/i),v=e=>g+y(e),b=e=>{let t=y(e),s=v(e);p.done=Math.abs(t)<=c,p.value=p.done?g:s},w=e=>{let t;if(t=p.value,void 0!==o&&t<o||void 0!==l&&t>l){var s;u=e,h=s2({keyframes:[p.value,(s=p.value,void 0===o?l:void 0===l||Math.abs(o-s)<Math.abs(l-s)?o:l)],velocity:sK(v,e,p.value),damping:r,stiffness:n,restDelta:c,restSpeed:d})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==u||(t=!0,b(e),w(e)),void 0!==u&&e>=u)?h.next(e-u):(t||b(e),p)}}}s2.applyToOptions=e=>{let t=function(e,t=100,s){let i=s({...e,keyframes:[0,t]}),r=Math.min(sQ(i),2e4);return{type:"keyframes",ease:e=>i.next(r*e).value/t,duration:r/1e3}}(e,100,s2);return e.ease=t.ease,e.duration=sC(t.duration),e.type="keyframes",e};let s5=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e;function s3(e,t,s,i){return e===t&&s===i?eG:r=>0===r||1===r?r:s5(function(e,t,s,i,r){let n,a,o=0;do(n=s5(a=t+(s-t)/2,i,r)-e)>0?s=a:t=a;while(Math.abs(n)>1e-7&&++o<12)return a}(r,0,1,e,s),t,i)}let s6=s3(.42,0,1,1),s8=s3(0,0,.58,1),s7=s3(.42,0,.58,1),s9=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ie=e=>t=>1-e(1-t),it=s3(.33,1.53,.69,.99),is=ie(it),ii=s9(is),ir=e=>(e*=2)<1?.5*is(e):.5*(2-Math.pow(2,-10*(e-1))),ia=e=>1-Math.sin(Math.acos(e)),io=ie(ia),il=s9(ia),ic=e=>Array.isArray(e)&&"number"==typeof e[0],id={linear:eG,easeIn:s6,easeInOut:s7,easeOut:s8,circIn:ia,circInOut:il,circOut:io,backIn:is,backInOut:ii,backOut:it,anticipate:ir},iu=e=>{if(ic(e)){eM(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,s,i,r]=e;return s3(t,s,i,r)}return"string"==typeof e?(eM(void 0!==id[e],`Invalid easing type '${e}'`,"invalid-easing-type"),id[e]):e},ih=(e,t,s)=>{let i=t-e;return 0===i?1:(s-e)/i};function im({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){var r;let n,a=Array.isArray(i)&&"number"!=typeof i[0]?i.map(iu):iu(i),o={done:!1,value:t[0]},l=function(e,t,{clamp:s=!0,ease:i,mixer:r}={}){let n=e.length;if(eM(n===t.length,"Both input and output ranges must be the same length","range-length"),1===n)return()=>t[0];if(2===n&&t[0]===t[1])return()=>t[1];let a=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,s){let i=[],r=s||eZ.mix||sU,n=e.length-1;for(let s=0;s<n;s++){let n=r(e[s],e[s+1]);t&&(n=sM(Array.isArray(t)?t[s]||eG:t,n)),i.push(n)}return i}(t,i,r),l=o.length,c=s=>{if(a&&s<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(s<e[i+1]);i++);let r=ih(e[i],e[i+1],s);return o[i](r)};return s?t=>c(V(e[0],e[n-1],t)):c}((r=s&&s.length===t.length?s:(!function(e,t){let s=e[e.length-1];for(let i=1;i<=t;i++){let r=ih(0,t,i);e.push(tq(s,1,r))}}(n=[0],t.length-1),n),r.map(t=>t*e)),t,{ease:Array.isArray(a)?a:t.map(()=>a||s7).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}let ip=e=>null!==e;function ix(e,{repeat:t,repeatType:s="loop"},i,r=1){let n=e.filter(ip),a=r<0||t&&"loop"!==s&&t%2==1?0:n.length-1;return a&&void 0!==i?i:n[a]}let ig={decay:s4,inertia:s4,tween:im,keyframes:im,spring:s2};function iy(e){"string"==typeof e.type&&(e.type=ig[e.type])}class iv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let ib=e=>e/100;class iw extends iv{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==td.now()&&this.tick(td.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},sA.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iy(e);let{type:t=im,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:n=0}=e,{keyframes:a}=e,o=t||im;o!==im&&"number"!=typeof a[0]&&(this.mixKeyframes=sM(ib,sU(a[0],a[1])),a=[0,100]);let l=o({...e,keyframes:a});"mirror"===r&&(this.mirroredGenerator=o({...e,keyframes:[...a].reverse(),velocity:-n})),null===l.calculatedDuration&&(l.calculatedDuration=sQ(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:n,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return s.next(0);let{delay:l=0,keyframes:c,repeat:d,repeatType:u,repeatDelay:h,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?x<0:x>i;this.currentTime=Math.max(x,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let y=this.currentTime,v=s;if(d){let e=Math.min(this.currentTime,i)/a,t=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&t--,(t=Math.min(t,d+1))%2&&("reverse"===u?(s=1-s,h&&(s-=h/a)):"mirror"===u&&(v=n)),y=V(0,1,s)*a}let b=g?{done:!1,value:c[0]}:v.next(y);r&&(b.value=r(b.value));let{done:w}=b;g||null===o||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&m!==s4&&(b.value=ix(c,this.options,f,this.speed)),p&&p(b.value),j&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=sC(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(td.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=sq,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(td.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,sA.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function ij(e){let t;return()=>(void 0===t&&(t=e()),t)}let ik=ij(()=>void 0!==window.ScrollTimeline),iS={},iN=(s=ij(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>iS.linearEasing??s()),iT=([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,iC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:iT([0,.65,.55,1]),circOut:iT([.55,0,1,.45]),backIn:iT([.31,.01,.66,-.59]),backOut:iT([.33,1.53,.69,.99])};function iP(e){return"function"==typeof e&&"applyToOptions"in e}class iM extends iv{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:i,pseudoElement:r,allowFlatten:n=!1,finalKeyframe:a,onComplete:o}=e;this.isPseudoElement=!!r,this.allowFlatten=n,this.options=e,eM("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return iP(e)&&iN()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,s,{delay:i=0,duration:r=300,repeat:n=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c){let d={[t]:s};l&&(d.offset=l);let u=function e(t,s){if(t)return"function"==typeof t?iN()?sW(t,s):"ease-out":ic(t)?iT(t):Array.isArray(t)?t.map(t=>e(t,s)||iC.easeOut):iC[t]}(o,r);Array.isArray(u)&&(d.easing=u);let h={delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:n+1,direction:"reverse"===a?"alternate":"normal"};c&&(h.pseudoElement=c);let m=e.animate(d,h);return m}(t,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){let e=ix(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(e):s.startsWith("--")?t.style.setProperty(s,e):t.style[s]=e,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sC(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&ik())?(this.animation.timeline=e,eG):t(this)}}let iA={anticipate:ir,backInOut:ii,circInOut:il};class iE extends iM{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iA&&(e.ease=iA[e.ease])}(e),iy(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:s,onComplete:i,element:r,...n}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let a=new iw({...n,autoplay:!1}),o=Math.max(10,td.now()-this.startTime),l=V(0,10,o-10);t.setWithVelocity(a.sample(Math.max(0,o-l)).value,a.sample(o).value,l),a.stop()}}let iR=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(ed.test(e)||"0"===e)&&!e.startsWith("url("));function iD(e){e.duration=0,e.type="keyframes"}let iL=new Set(["opacity","clipPath","filter","transform"]),iV=ij(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class iF extends iv{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:n="loop",keyframes:a,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=td.now();const u={autoplay:e,delay:t,type:s,repeat:i,repeatDelay:r,repeatType:n,name:o,motionValue:l,element:c,...d},h=c?.KeyframeResolver||tt;this.keyframeResolver=new h(a,(e,t,s)=>this.onKeyframesResolved(e,t,u,!s),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,i){this.keyframeResolver=void 0;let{name:r,type:n,velocity:a,delay:o,isHandoff:l,onUpdate:c}=s;this.resolvedAt=td.now(),!function(e,t,s,i){let r=e[0];if(null===r)return!1;if("display"===t||"visibility"===t)return!0;let n=e[e.length-1],a=iR(r,t),o=iR(n,t);return eP(a===o,`You are trying to animate ${t} from "${r}" to "${n}". "${a?n:r}" is not an animatable value.`,"value-not-animatable"),!!a&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}(e)||("spring"===s||iP(s))&&i)}(e,r,n,a)&&((eZ.instantAnimations||!o)&&c?.(ix(e,s,t)),e[0]=e[e.length-1],iD(s),s.repeat=0);let d={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},u=!l&&function(e){let{motionValue:t,name:s,repeatDelay:i,repeatType:r,damping:n,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return iV()&&s&&iL.has(s)&&("transform"!==s||!l)&&!o&&!i&&"mirror"!==r&&0!==n&&"inertia"!==a}(d),h=d.motionValue?.owner?.current,m=u?new iE({...d,element:h}):new iw(d);m.finished.then(()=>{this.notifyFinished()}).catch(eG),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),e7=!0,te(),e9(),e7=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let iO={type:"spring",stiffness:500,damping:25,restSpeed:10},iI={type:"keyframes",duration:.8},i$={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},i_=e=>null!==e,iB=(e,t,s,i={},r,n)=>a=>{let o=sS(i,e)||{},l=o.delay||i.delay||0,{elapsed:c=0}=i;c-=sC(l);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:n?void 0:r};!function({when:e,delay:t,delayChildren:s,staggerChildren:i,staggerDirection:r,repeat:n,repeatType:a,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}(o)&&Object.assign(d,((e,{keyframes:t})=>t.length>2?iI:L.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:iO:i$)(e,d)),d.duration&&(d.duration=sC(d.duration)),d.repeatDelay&&(d.repeatDelay=sC(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(iD(d),0===d.delay&&(u=!0)),(eZ.instantAnimations||eZ.skipAnimations)&&(u=!0,iD(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!n&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:s="loop"},i){let r=e.filter(i_),n=t&&"loop"!==s&&t%2==1?0:r.length-1;return r[n]}(d.keyframes,o);if(void 0!==e)return void e1.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iw(d):new iF(d)};function iz(e,t,{delay:s=0,transitionOverride:i,type:r}={}){let{transition:n=e.getDefaultTransition(),transitionEnd:a,...o}=t;i&&(n=i);let l=[],c=r&&e.animationState&&e.animationState.getState()[r];for(let t in o){let i=e.getValue(t,e.latestValues[t]??null),r=o[t];if(void 0===r||c&&function({protectedKeys:e,needsAnimating:t},s){let i=e.hasOwnProperty(s)&&!0!==t[s];return t[s]=!1,i}(c,t))continue;let a={delay:s,...sS(n||{},t)},d=i.get();if(void 0!==d&&!i.isAnimating&&!Array.isArray(r)&&r===d&&!a.velocity)continue;let u=!1;if(window.MotionHandoffAnimation){let s=e.props[sy];if(s){let e=window.MotionHandoffAnimation(s,t,e1);null!==e&&(a.startTime=e,u=!0)}}sT(e,t),i.start(iB(t,i,r,e.shouldReduceMotion&&eS.has(t)?{type:!1}:a,e,u));let h=i.animation;h&&l.push(h)}return a&&Promise.all(l).then(()=>{e1.update(()=>{a&&function(e,t){let{transitionEnd:s={},transition:i={},...r}=sk(e,t)||{};for(let t in r={...r,...s}){var n;let s=sN(n=r[t])?n[n.length-1]||0:n;e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,th(s))}}(e,a)})}),l}function iU(e,t,s,i=0,r=1){let n=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),a=e.size,o=(a-1)*i;return"function"==typeof s?s(n,a):1===r?n*i:o-n*i}function iq(e,t,s={}){let i=sk(e,t,"exit"===s.type?e.presenceContext?.custom:void 0),{transition:r=e.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(r=s.transitionOverride);let n=i?()=>Promise.all(iz(e,i,s)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(i=0)=>{let{delayChildren:n=0,staggerChildren:a,staggerDirection:o}=r;return function(e,t,s=0,i=0,r=0,n=1,a){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(iq(l,t,{...a,delay:s+("function"==typeof i?0:i)+iU(e.variantChildren,l,i,r,n)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,i,n,a,o,s)}:()=>Promise.resolve(),{when:o}=r;if(!o)return Promise.all([n(),a(s.delay)]);{let[e,t]="beforeChildren"===o?[n,a]:[a,n];return e().then(()=>t())}}let iW=tw.length;function iQ(e,t){if(!Array.isArray(t))return!1;let s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}let iK=[...tb].reverse(),iH=tb.length;function iX(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iY(){return{animate:iX(!0),whileInView:iX(),whileHover:iX(),whileTap:iX(),whileDrag:iX(),whileFocus:iX(),exit:iX()}}let iG=0;function iZ(e){return[e("x"),e("y")]}let iJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function i0(e){return iJ.has(e.tagName)||!0===e.isContentEditable}function i1(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s)}let i2={x:!1,y:!1};function i4(e){return e.max-e.min}function i5(e,t,s,i=.5){e.origin=i,e.originPoint=tq(t.min,t.max,e.origin),e.scale=i4(s)/i4(t),e.translate=tq(s.min,s.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function i3(e,t,s,i){i5(e.x,t.x,s.x,i?i.originX:void 0),i5(e.y,t.y,s.y,i?i.originY:void 0)}function i6(e,t,s){e.min=s.min+t.min,e.max=e.min+i4(t)}function i8(e,t,s){e.min=t.min-s.min,e.max=e.min+i4(t)}function i7(e,t,s){i8(e.x,t.x,s.x),i8(e.y,t.y,s.y)}let i9=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function re(e){return{point:{x:e.pageX,y:e.pageY}}}function rt(e,t,s,i){return i1(e,t,e=>i9(e)&&s(e,re(e)),i)}let rs=({current:e})=>e?e.ownerDocument.defaultView:null,ri=(e,t)=>Math.abs(e-t),rr=new Set(["auto","scroll"]);class rn{constructor(e,t,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:n=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=rl(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,r=(e=s.offset,t={x:0,y:0},Math.sqrt(ri(e.x,t.x)**2+ri(e.y,t.y)**2)>=this.distanceThreshold);if(!i&&!r)return;let{point:n}=s,{timestamp:a}=e4;this.history.push({...n,timestamp:a});let{onStart:o,onMove:l}=this.handlers;i||(o&&o(this.lastMoveEvent,s),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,s)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ra(t,this.transformPagePoint),e1.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:s,onSessionEnd:i,resumeAnimation:r}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&r&&r(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=rl("pointercancel"===e.type?this.lastMoveEventInfo:ra(t,this.transformPagePoint),this.history);this.startEvent&&s&&s(e,n),i&&i(e,n)},!i9(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=s,this.distanceThreshold=n,this.contextWindow=i||window;const o=ra(re(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=e4;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,rl(o,this.history)),this.removeListeners=sM(rt(this.contextWindow,"pointermove",this.handlePointerMove),rt(this.contextWindow,"pointerup",this.handlePointerUp),rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(rr.has(e.overflowX)||rr.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-t.x,y:i.y-t.y};(0!==r.x||0!==r.y)&&(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),e1.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),e2(this.updatePoint)}}function ra(e,t){return t?{point:t(e.point)}:e}function ro(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rl({point:e},t){return{point:e,delta:ro(e,rc(t)),offset:ro(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null,r=rc(e);for(;s>=0&&(i=e[s],!(r.timestamp-i.timestamp>sC(.1)));)s--;if(!i)return{x:0,y:0};let n=(r.timestamp-i.timestamp)/1e3;if(0===n)return{x:0,y:0};let a={x:(r.x-i.x)/n,y:(r.y-i.y)/n};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t,.1)}}function rc(e){return e[e.length-1]}function rd(e,t,s){return{min:void 0!==t?e.min+t:void 0,max:void 0!==s?e.max+s-(e.max-e.min):void 0}}function ru(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function rh(e,t,s){return{min:rm(e,t),max:rm(e,s)}}function rm(e,t){return"number"==typeof e?e:e[t]||0}let rp=new WeakMap;class rf{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ej(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:s}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let r=e=>{t?(this.stopAnimation(),this.snapToCursor(re(e).point)):this.pauseAnimation()},n=(e,t)=>{this.stopAnimation();let{drag:s,dragPropagation:i,onDragStart:r}=this.getProps();if(s&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(i2[e])return null;else return i2[e]=!0,()=>{i2[e]=!1};return i2.x||i2.y?null:(i2.x=i2.y=!0,()=>{i2.x=i2.y=!1})}(s),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iZ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(X.test(t)){let{projection:s}=this.visualElement;if(s&&s.layout){let i=s.layout.layoutBox[e];i&&(t=i4(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),r&&e1.postRender(()=>r(e,t)),sT(this.visualElement,"transform");let{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:s,dragDirectionLock:i,onDirectionLock:r,onDrag:n}=this.getProps();if(!s&&!this.openDragLock)return;let{offset:a}=t;if(i&&null===this.currentDirection){this.currentDirection=function(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}(a),null!==this.currentDirection&&r&&r(this.currentDirection);return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),n&&n(e,t)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>iZ(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new rn(e,{onSessionStart:r,onStart:n,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:rs(this.visualElement),element:this.visualElement.current})}stop(e,t){let s=e||this.latestPointerEvent,i=t||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;let{velocity:n}=i;this.startAnimation(n);let{onDragEnd:a}=this.getProps();a&&e1.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,s){let{drag:i}=this.getProps();if(!s||!rx(e,i,this.currentDirection))return;let r=this.getAxisMotionValue(e),n=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(n=function(e,{min:t,max:s},i){return void 0!==t&&e<t?e=i?tq(t,e,i.min):Math.max(e,t):void 0!==s&&e>s&&(e=i?tq(s,e,i.max):Math.min(e,s)),e}(n,this.constraints[e],this.elastic[e])),r.set(n)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&sb(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(e,{top:t,left:s,bottom:i,right:r}){return{x:rd(e.x,s,r),y:rd(e.y,t,i)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:rh(e,"left","right"),y:rh(e,"top","bottom")}}(t),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&iZ(e=>{var t,i;let r;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=s.layoutBox[e],i=this.constraints[e],r={},void 0!==i.min&&(r.min=i.min-t.min),void 0!==i.max&&(r.max=i.max-t.min),r))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!sb(t))return!1;let i=t.current;eM(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let n=function(e,t,s){let i=t8(e,s),{scroll:r}=t;return r&&(t5(i.x,r.offset.x),t5(i.y,r.offset.y)),i}(i,r.root,this.visualElement.getTransformPagePoint()),a=(e=r.layout.layoutBox,{x:ru(e.x,n.x),y:ru(e.y,n.y)});if(s){let e=s(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=tY(e))}return a}startAnimation(e){let{drag:t,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{};return Promise.all(iZ(a=>{if(!rx(a,t,this.currentDirection))return;let l=o&&o[a]||{};n&&(l={min:0,max:0});let c={type:"inertia",velocity:s?e[a]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(a,c)})).then(a)}startAxisValueAnimation(e,t){let s=this.getAxisMotionValue(e);return sT(this.visualElement,e),s.start(iB(e,s,0,t,this.visualElement,!1))}stopAnimation(){iZ(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iZ(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps();return s[t]||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){iZ(t=>{let{drag:s}=this.getProps();if(!rx(t,s,this.currentDirection))return;let{projection:i}=this.visualElement,r=this.getAxisMotionValue(t);if(i&&i.layout){let{min:s,max:n}=i.layout.layoutBox[t],a=r.get()||0;r.set(e[t]-tq(s,n,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:s}=this.visualElement;if(!sb(t)||!s||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};iZ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var s,r;let n,a,o,l=t.get();i[e]=(s={min:l,max:l},r=this.constraints[e],n=.5,a=i4(s),(o=i4(r))>a?n=ih(r.min,r.max-a,s.min):a>o&&(n=ih(s.min,s.max-o,r.min)),V(0,1,n))}});let{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),iZ(t=>{if(!rx(t,e,null))return;let s=this.getAxisMotionValue(t),{min:r,max:n}=this.constraints[t];s.set(tq(r,n,i[t]))})}addListeners(){if(!this.visualElement.current)return;rp.set(this.visualElement,this);let e=this.visualElement.current,t=rt(e,"pointerdown",t=>{let{drag:s,dragListener:i=!0}=this.getProps(),r=t.target,n=r!==e&&i0(r);s&&i&&!n&&this.start(t)}),s=()=>{let{dragConstraints:e}=this.getProps();sb(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),e1.read(s);let n=i1(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iZ(t=>{let s=this.getAxisMotionValue(t);s&&(this.originPoint[t]+=e[t].translate,s.set(s.get()+e[t].translate))}),this.visualElement.render())});return()=>{n(),t(),r(),a&&a()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:n=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:n,dragMomentum:a}}}function rx(e,t,s){return(!0===t||t===e)&&(null===s||s===e)}let rg=e=>(t,s)=>{e&&e1.postRender(()=>e(t,s))},ry={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var rv=m;let rb=!1;class rw extends rv.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(t.group&&t.group.add(r),s&&s.register&&i&&s.register(r),rb&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ry.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:s,drag:i,isPresent:r}=this.props,{projection:n}=s;return n&&(n.isPresent=r,e.layoutDependency!==t&&n.setOptions({...n.options,layoutDependency:t}),rb=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==r?n.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?n.promote():n.relegate()||e1.postRender(()=>{let e=n.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tl.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s}=this.props,{projection:i}=e;rb=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function rj(e){let[t,s]=M(),i=(0,rv.useContext)(f);return(0,h.jsx)(rw,{...e,layoutGroup:i,switchLayoutGroup:(0,rv.useContext)(sv),isPresent:t,safeToRemove:s})}function rk(e,t,s,i,r){return e-=t,e=i+1/s*(e-i),void 0!==r&&(e=i+1/r*(e-i)),e}function rS(e,t,[s,i,r],n,a){!function(e,t=0,s=1,i=.5,r,n=e,a=e){if(X.test(t)&&(t=parseFloat(t),t=tq(a.min,a.max,t/100)-a.min),"number"!=typeof t)return;let o=tq(n.min,n.max,i);e===n&&(o-=t),e.min=rk(e.min,t,s,o,r),e.max=rk(e.max,t,s,o,r)}(e,t[s],t[i],t[r],t.scale,n,a)}let rN=["x","scaleX","originX"],rT=["y","scaleY","originY"];function rC(e,t,s,i){rS(e.x,t,rN,s?s.x:void 0,i?i.x:void 0),rS(e.y,t,rT,s?s.y:void 0,i?i.y:void 0)}function rP(e,t){e.min=t.min,e.max=t.max}function rM(e,t){rP(e.x,t.x),rP(e.y,t.y)}function rA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rE(e){return 0===e.translate&&1===e.scale}function rR(e){return rE(e.x)&&rE(e.y)}function rD(e,t){return e.min===t.min&&e.max===t.max}function rL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rV(e,t){return rL(e.x,t.x)&&rL(e.y,t.y)}function rF(e){return i4(e.x)/i4(e.y)}function rO(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let rI=["TopLeft","TopRight","BottomLeft","BottomRight"],r$=rI.length,r_=e=>"string"==typeof e?parseFloat(e):e,rB=e=>"number"==typeof e||Y.test(e);function rz(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let rU=rW(0,.5,io),rq=rW(.5,.95,eG);function rW(e,t,s){return i=>i<e?0:i>t?1:s(ih(e,t,i))}function rQ(e){return b(e)&&"ownerSVGElement"in e}let rK=(e,t)=>e.depth-t.depth;class rH{constructor(){this.children=[],this.isDirty=!1}add(e){tn(this.children,e),this.isDirty=!0}remove(e){ta(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rK),this.isDirty=!1,this.children.forEach(e)}}class rX{constructor(){this.members=[]}add(e){tn(this.members,e),e.scheduleRender()}remove(e){if(ta(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,s=this.members.findIndex(t=>e===t);if(0===s)return!1;for(let e=s;e>=0;e--){let s=this.members[e];if(!1!==s.isPresent){t=s;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();let i=s.options.layoutDependency,r=e.options.layoutDependency;(void 0===i||void 0===r||i!==r)&&(e.resumeFrom=s,t&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));let{crossfade:n}=e.options;!1===n&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:s}=e;t.onExitComplete&&t.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let rY=["","X","Y","Z"],rG=0;function rZ(e,t,s,i){let{latestValues:r}=t;r[e]&&(s[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function rJ({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(e={},s=t?.()){this.id=rG++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(r2),this.nodes.forEach(r9),this.nodes.forEach(ne),this.nodes.forEach(r4)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new rH)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new to),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let s=this.eventHandlers.get(e);s&&s.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=rQ(t)&&!(rQ(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:s,layout:i,visualElement:r}=this.options;if(r&&!r.current&&r.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||s)&&(this.isLayoutDirty=!0),e){let s,i=0,r=()=>this.root.updateBlockedByResize=!1;e1.read(()=>{i=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==i){let t,n;i=e,this.root.updateBlockedByResize=!0,s&&s(),t=td.now(),n=({timestamp:e})=>{let s=e-t;s>=250&&(e2(n),r(s-250))},e1.setup(n,!0),s=()=>e2(n),ry.hasAnimatedSinceResize&&(ry.hasAnimatedSinceResize=!1,this.nodes.forEach(r7))}})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:s,layout:i})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||r.getDefaultTransition()||na,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=r.getProps(),l=!this.targetLayout||!rV(this.targetLayout,i),c=!t&&s;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...sS(n,"layout"),onPlay:a,onComplete:o};(r.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||r7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),e2(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nt),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:s}=t.options;if(!s)return;let i=s.props[sy];if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",e1,!(e||s))}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&e(r)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:s}=this.options;if(void 0===t&&!s)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r3);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(r6);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(r8),this.nodes.forEach(r0),this.nodes.forEach(r1)):this.nodes.forEach(r6),this.clearAllSnapshots();let e=td.now();e4.delta=V(0,1e3/60,e-e4.timestamp),e4.timestamp=e,e4.isProcessing=!0,e5.update.process(e4),e5.preRender.process(e4),e5.render.process(e4),e4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(r5),this.sharedNodes.forEach(ns)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,e1.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){e1.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||i4(this.snapshot.measuredBox.x)||i4(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ej(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!rR(this.projectionDelta),s=this.getTransformTemplate(),i=s?s(this.latestValues,""):void 0,n=i!==this.prevTransformTemplateValue;e&&this.instance&&(t||tJ(this.latestValues)||n)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let s=this.measurePageBox(),i=this.removeElementScroll(s);return e&&(i=this.removeTransform(i)),nc((t=i).x),nc(t.y),{animationId:this.root.animationId,measuredBox:s,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ej();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nu))){let{scroll:e}=this.root;e&&(t5(t.x,e.offset.x),t5(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ej();if(rM(t,e),this.scroll?.wasRoot)return t;for(let s=0;s<this.path.length;s++){let i=this.path[s],{scroll:r,options:n}=i;i!==this.root&&r&&n.layoutScroll&&(r.wasRoot&&rM(t,e),t5(t.x,r.offset.x),t5(t.y,r.offset.y))}return t}applyTransform(e,t=!1){let s=ej();rM(s,e);for(let e=0;e<this.path.length;e++){let i=this.path[e];!t&&i.options.layoutScroll&&i.scroll&&i!==i.root&&t6(s,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),tJ(i.latestValues)&&t6(s,i.latestValues)}return tJ(this.latestValues)&&t6(s,this.latestValues),s}removeTransform(e){let t=ej();rM(t,e);for(let e=0;e<this.path.length;e++){let s=this.path[e];if(!s.instance||!tJ(s.latestValues))continue;tZ(s.latestValues)&&s.updateSnapshot();let i=ej();rM(i,s.measurePageBox()),rC(t,s.latestValues,s.snapshot?s.snapshot.layoutBox:void 0,i)}return tJ(this.latestValues)&&rC(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==e4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==t;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:i,layoutId:r}=this.options;if(!this.layout||!(i||r))return;this.resolvedRelativeTargetAt=e4.timestamp;let n=this.getClosestProjectingParent();if(n&&this.linkedParentVersion!==n.layoutVersion&&!n.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(n&&n.layout?this.createRelativeTarget(n,this.layout.layoutBox,n.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=ej(),this.targetWithTransforms=ej()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var a,o,l;this.forceRelativeParentToResolveTarget(),a=this.target,o=this.relativeTarget,l=this.relativeParent.target,i6(a.x,o.x,l.x),i6(a.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rM(this.target,this.layout.layoutBox),t4(this.target,this.targetDelta)):rM(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,n&&!!n.resumingFrom==!!this.resumingFrom&&!n.options.layoutScroll&&n.target&&1!==this.animationProgress?this.createRelativeTarget(n,this.target,n.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||tZ(this.parent.latestValues)||t0(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,s){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ej(),this.relativeTargetOrigin=ej(),i7(this.relativeTargetOrigin,t,s),rM(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===e4.timestamp&&(s=!1),s)return;let{layout:i,layoutId:r}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||r))return;rM(this.layoutCorrected,this.layout.layoutBox);let n=this.treeScale.x,a=this.treeScale.y;!function(e,t,s,i=!1){let r,n,a=s.length;if(a){t.x=t.y=1;for(let o=0;o<a;o++){n=(r=s[o]).projectionDelta;let{visualElement:a}=r.options;(!a||!a.props.style||"contents"!==a.props.style.display)&&(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&t6(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),n&&(t.x*=n.x.scale,t.y*=n.y.scale,t4(e,n)),i&&tJ(r.latestValues)&&t6(e,r.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ej());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(rA(this.prevProjectionDelta.x,this.projectionDelta.x),rA(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),i3(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===n&&this.treeScale.y===a&&rO(this.projectionDelta.x,this.prevProjectionDelta.x)&&rO(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=eb(),this.projectionDelta=eb(),this.projectionDeltaWithTransform=eb()}setAnimationOrigin(e,t=!1){let s,i=this.snapshot,r=i?i.latestValues:{},n={...this.latestValues},a=eb();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=ej(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(nn));this.animationProgress=0,this.mixTargetDelta=t=>{let i=t/1e3;if(ni(a.x,e.x,i),ni(a.y,e.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,m,p,f,x;i7(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=o,x=i,nr(m.x,p.x,f.x,x),nr(m.y,p.y,f.y,x),s&&(c=this.relativeTarget,h=s,rD(c.x,h.x)&&rD(c.y,h.y))&&(this.isProjectionDirty=!1),s||(s=ej()),rM(s,this.relativeTarget)}l&&(this.animationValues=n,function(e,t,s,i,r,n){r?(e.opacity=tq(0,s.opacity??1,rU(i)),e.opacityExit=tq(t.opacity??1,0,rq(i))):n&&(e.opacity=tq(t.opacity??1,s.opacity??1,i));for(let r=0;r<r$;r++){let n=`border${rI[r]}Radius`,a=rz(t,n),o=rz(s,n);(void 0!==a||void 0!==o)&&(a||(a=0),o||(o=0),0===a||0===o||rB(a)===rB(o)?(e[n]=Math.max(tq(r_(a),r_(o),i),0),(X.test(o)||X.test(a))&&(e[n]+="%")):e[n]=o)}(t.rotate||s.rotate)&&(e.rotate=tq(t.rotate||0,s.rotate||0,i))}(n,r,this.latestValues,i,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(e2(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=e1.update(()=>{var t,s,i;let r;ry.hasAnimatedSinceResize=!0,sA.layout++,this.motionValue||(this.motionValue=th(0)),this.currentAnimation=(t=this.motionValue,s=[0,1e3],i={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{sA.layout--},onComplete:()=>{sA.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(r=ek(t)?t:th(t)).start(iB("",r,s,i)),r.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:s,layout:i,latestValues:r}=e;if(t&&s&&i){if(this!==e&&this.layout&&i&&nd(this.options.animationType,this.layout.layoutBox,i.layoutBox)){s=this.target||ej();let t=i4(this.layout.layoutBox.x);s.x.min=e.target.x.min,s.x.max=s.x.min+t;let i=i4(this.layout.layoutBox.y);s.y.min=e.target.y.min,s.y.max=s.y.min+i}rM(t,s),t6(t,r),i3(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rX),this.sharedNodes.get(e).add(t);let s=t.options.initialPromotionConfig;t.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:s}={}){let i=this.getStack();i&&i.promote(this,s),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:s}=e;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(t=!0),!t)return;let i={};s.z&&rZ("z",e,i,this.animationValues);for(let t=0;t<rY.length;t++)rZ(`rotate${rY[t]}`,e,i,this.animationValues),rZ(`skew${rY[t]}`,e,i,this.animationValues);for(let t in e.render(),i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=sd(t?.pointerEvents)||"",e.transform=s?s(this.latestValues,""):"none";return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=sd(t?.pointerEvents)||""),this.hasProjected&&!tJ(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1);return}e.visibility="";let r=i.animationValues||i.latestValues;this.applyTransformsToTarget();let n=function(e,t,s){let i="",r=e.x.translate/t.x,n=e.y.translate/t.y,a=s?.z||0;if((r||n||a)&&(i=`translate3d(${r}px, ${n}px, ${a}px) `),(1!==t.x||1!==t.y)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){let{transformPerspective:e,rotate:t,rotateX:r,rotateY:n,skewX:a,skewY:o}=s;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),r&&(i+=`rotateX(${r}deg) `),n&&(i+=`rotateY(${n}deg) `),a&&(i+=`skewX(${a}deg) `),o&&(i+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r);s&&(n=s(r,n)),e.transform=n;let{x:a,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*a.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?r.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:e.opacity=i===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0,tW){if(void 0===r[t])continue;let{correct:s,applyTo:a,isCSSVariable:o}=tW[t],l="none"===n?r[t]:s(r[t],i);if(a){let t=a.length;for(let s=0;s<t;s++)e[a[s]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=i===this?sd(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(r3),this.root.sharedNodes.clear()}}}function r0(e){e.updateLayout()}function r1(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:s,measuredBox:i}=e.layout,{animationType:r}=e.options,n=t.source!==e.layout.source;"size"===r?iZ(e=>{let i=n?t.measuredBox[e]:t.layoutBox[e],r=i4(i);i.min=s[e].min,i.max=i.min+r}):nd(r,t.layoutBox,s)&&iZ(i=>{let r=n?t.measuredBox[i]:t.layoutBox[i],a=i4(s[i]);r.max=r.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+a)});let a=eb();i3(a,s,t.layoutBox);let o=eb();n?i3(o,e.applyTransform(i,!0),t.measuredBox):i3(o,s,t.layoutBox);let l=!rR(a),c=!1;if(!e.resumeFrom){let i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:r,layout:n}=i;if(r&&n){let a=ej();i7(a,t.layoutBox,r.layoutBox);let o=ej();i7(o,s,n.layoutBox),rV(a,o)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=a,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function r2(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function r4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function r5(e){e.clearSnapshot()}function r3(e){e.clearMeasurements()}function r6(e){e.isLayoutDirty=!1}function r8(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function r7(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function r9(e){e.resolveTargetDelta()}function ne(e){e.calcProjection()}function nt(e){e.resetSkewAndRotation()}function ns(e){e.removeLeadSnapshot()}function ni(e,t,s){e.translate=tq(t.translate,0,s),e.scale=tq(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function nr(e,t,s,i){e.min=tq(t.min,s.min,i),e.max=tq(t.max,s.max,i)}function nn(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let na={duration:.45,ease:[.4,0,.1,1]},no=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nl=no("applewebkit/")&&!no("chrome/")?Math.round:eG;function nc(e){e.min=nl(e.min),e.max=nl(e.max)}function nd(e,t,s){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(rF(t)-rF(s)))}function nu(e){return e!==e.root&&e.scroll?.wasRoot}let nh=rJ({attachResizeListener:(e,t)=>i1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),nm={current:void 0},np=rJ({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nm.current){let e=new nh({});e.mount(window),e.setOptions({layoutScroll:!0}),nm.current=e}return nm.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function nf(e,t){let s=function(e,t,s){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,s=(void 0)??t.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(e=>null!=e)}(e),i=new AbortController;return[s,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function nx(e){return!("touch"===e.pointerType||i2.x||i2.y)}function ng(e,t,s){let{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===s);let r=i["onHover"+s];r&&e1.postRender(()=>r(t,re(t)))}let ny=(e,t)=>!!t&&(e===t||ny(e,t.parentElement)),nv=new WeakSet;function nb(e){return t=>{"Enter"===t.key&&e(t)}}function nw(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function nj(e){return i9(e)&&!(i2.x||i2.y)}function nk(e,t,s){let{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===s);let r=i["onTap"+("End"===s?"":s)];r&&e1.postRender(()=>r(t,re(t)))}let nS=new WeakMap,nN=new WeakMap,nT=e=>{let t=nS.get(e.target);t&&t(e)},nC=e=>{e.forEach(nT)},nP={some:0,all:1},nM=function(e,t){if("u"<typeof Proxy)return sw;let s=new Map,i=(s,i)=>sw(s,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(r,n)=>"create"===n?i:(s.has(n)||s.set(n,sw(n,void 0,e,t)),s.get(n))})}({animation:{Feature:class extends sj{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:s})=>(function(e,t,s={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t))i=Promise.all(t.map(t=>iq(e,t,s)));else if("string"==typeof t)i=iq(e,t,s);else{let r="function"==typeof t?sk(e,t,s.custom):t;i=Promise.all(iz(e,r,s))}return i.then(()=>{e.notify("AnimationComplete",t)})})(e,t,s))),s=iY(),i=!0,r=t=>(s,i)=>{let r=sk(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(r){let{transition:e,transitionEnd:t,...i}=r;s={...s,...i,...t}}return s};function n(n){let{props:a}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let s=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(s.initial=t.props.initial),s}let s={};for(let e=0;e<iW;e++){let i=tw[e],r=t.props[i];(tv(r)||!1===r)&&(s[i]=r)}return s}(e.parent)||{},l=[],c=new Set,d={},u=1/0;for(let t=0;t<iH;t++){var h,m;let p=iK[t],f=s[p],x=void 0!==a[p]?a[p]:o[p],g=tv(x),y=p===n?f.isActive:null;!1===y&&(u=t);let v=x===o[p]&&x!==a[p]&&g;if(v&&i&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...d},!f.isActive&&null===y||!x&&!f.prevProp||ty(x)||"boolean"==typeof x)continue;let b=(h=f.prevProp,"string"==typeof(m=x)?m!==h:!!Array.isArray(m)&&!iQ(m,h)),w=b||p===n&&f.isActive&&!v&&g||t>u&&g,j=!1,k=Array.isArray(x)?x:[x],S=k.reduce(r(p),{});!1===y&&(S={});let{prevResolvedValues:N={}}=f,T={...N,...S},C=t=>{w=!0,c.has(t)&&(j=!0,c.delete(t)),f.needsAnimating[t]=!0;let s=e.getValue(t);s&&(s.liveStyle=!1)};for(let e in T){let t=S[e],s=N[e];if(!d.hasOwnProperty(e))(sN(t)&&sN(s)?iQ(t,s):t===s)?void 0!==t&&c.has(e)?C(e):f.protectedKeys[e]=!0:null!=t?C(e):c.add(e)}f.prevProp=x,f.prevResolvedValues=S,f.isActive&&(d={...d,...S}),i&&e.blockInitialAnimation&&(w=!1);let P=v&&b,M=!P||j;w&&M&&l.push(...k.map(t=>{let s={type:p};if("string"==typeof t&&i&&!P&&e.manuallyAnimateOnMount&&e.parent){let{parent:i}=e,r=sk(i,t);if(i.enteringChildren&&r){let{delayChildren:t}=r.transition||{};s.delay=iU(i.enteringChildren,e,t)}}return{animation:t,options:s}}))}if(c.size){let t={};if("boolean"!=typeof a.initial){let s=sk(e,Array.isArray(a.initial)?a.initial[0]:a.initial);s&&s.transition&&(t.transition=s.transition)}c.forEach(s=>{let i=e.getBaseTarget(s),r=e.getValue(s);r&&(r.liveStyle=!0),t[s]=i??null}),l.push({animation:t})}let p=!!l.length;return i&&(!1===a.initial||a.initial===a.animate)&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?t(l):Promise.resolve()}return{animateChanges:n,setActive:function(t,i){if(s[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),s[t].isActive=i;let r=n(t);for(let e in s)s[e].protectedKeys={};return r},setAnimateFunction:function(s){t=s(e)},getState:()=>s,reset:()=>{s=iY()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ty(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends sj{constructor(){super(...arguments),this.id=iG++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;let i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends sj{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:s={}}=this.node.getProps(),{root:i,margin:r,amount:n="some",once:a}=s,o={root:i?i.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:nP[n]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,a&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:s,onViewportLeave:i}=this.node.getProps(),r=t?s:i;r&&r(e)};return e=this.node.current,t=function({root:e,...t}){let s=e||document;nN.has(s)||nN.set(s,{});let i=nN.get(s),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(nC,{root:e,...t})),i[r]}(o),nS.set(e,l),t.observe(e),()=>{nS.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends sj{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[i,r,n]=nf(e,s),a=e=>{let i=e.currentTarget;if(!nj(e))return;nv.add(i);let n=t(i,e),a=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),nv.has(i)&&nv.delete(i),nj(e)&&"function"==typeof n&&n(e,{success:t})},o=e=>{a(e,i===window||i===document||s.useGlobalTarget||ny(i,e.target))},l=e=>{a(e,!1)};window.addEventListener("pointerup",o,r),window.addEventListener("pointercancel",l,r)};return i.forEach(e=>{(s.useGlobalTarget?window:e).addEventListener("pointerdown",a,r),w(e)&&(e.addEventListener("focus",e=>((e,t)=>{let s=e.currentTarget;if(!s)return;let i=nb(()=>{if(nv.has(s))return;nw(s,"down");let e=nb(()=>{nw(s,"up")});s.addEventListener("keyup",e,t),s.addEventListener("blur",()=>nw(s,"cancel"),t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)})(e,r)),i0(e)||e.hasAttribute("tabindex")||(e.tabIndex=0))}),n}(e,(e,t)=>(nk(this.node,t,"Start"),(e,{success:t})=>nk(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends sj{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sM(i1(this.node.current,"focus",()=>this.onFocus()),i1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends sj{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[i,r,n]=nf(e,s),a=e=>{if(!nx(e))return;let{target:s}=e,i=t(s,e);if("function"!=typeof i||!s)return;let n=e=>{nx(e)&&(i(e),s.removeEventListener("pointerleave",n))};s.addEventListener("pointerleave",n,r)};return i.forEach(e=>{e.addEventListener("pointerenter",a,r)}),n}(e,(e,t)=>(ng(this.node,t,"Start"),e=>ng(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends sj{constructor(){super(...arguments),this.removePointerDownListener=eG}onPointerDown(e){this.session=new rn(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rs(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:rg(e),onStart:rg(t),onMove:s,onEnd:(e,t)=>{delete this.session,i&&e1.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends sj{constructor(e){super(e),this.removeGroupControls=eG,this.removeListeners=eG,this.controls=new rf(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||eG}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:np,MeasureLayout:rj},layout:{ProjectionNode:np,MeasureLayout:rj}},(e,t)=>t.isSVG??se(e)?new tX(t):new t7(t,{allowProjection:e!==m.Fragment}));var nA=e.i(74133),nE=e.i(11919),nR=e.i(79736),nD=e.i(96099),nL=e.i(70207),nV=e.i(32446),nF=e.i(60904),nO=e.i(62422),nI=class extends nL.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,nV.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#i=void 0;#r=void 0;#n=void 0;#a;#o;#s;#t;#l;#c;#d;#u;#h;#m;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),n$(this.#i,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return n_(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return n_(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#y(),this.#i.removeObserver(this)}setOptions(e){let t=this.options,s=this.#i;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,nF.resolveEnabled)(this.options.enabled,this.#i))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#v(),this.#i.setOptions(this.options),t._defaulted&&!(0,nF.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#i,observer:this});let i=this.hasListeners();i&&nB(this.#i,s,this.options,t)&&this.#f(),this.updateResult(),i&&(this.#i!==s||(0,nF.resolveEnabled)(this.options.enabled,this.#i)!==(0,nF.resolveEnabled)(t.enabled,this.#i)||(0,nF.resolveStaleTime)(this.options.staleTime,this.#i)!==(0,nF.resolveStaleTime)(t.staleTime,this.#i))&&this.#b();let r=this.#w();i&&(this.#i!==s||(0,nF.resolveEnabled)(this.options.enabled,this.#i)!==(0,nF.resolveEnabled)(t.enabled,this.#i)||r!==this.#m)&&this.#j(r)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(i,e);return t=this,s=r,(0,nF.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#n=r,this.#o=this.options,this.#a=this.#i.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#i}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#v();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(nF.noop)),t}#b(){this.#g();let e=(0,nF.resolveStaleTime)(this.options.staleTime,this.#i);if(nF.isServer||this.#n.isStale||!(0,nF.isValidTimeout)(e))return;let t=(0,nF.timeUntilStale)(this.#n.dataUpdatedAt,e);this.#u=nO.timeoutManager.setTimeout(()=>{this.#n.isStale||this.updateResult()},t+1)}#w(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#j(e){this.#y(),this.#m=e,!nF.isServer&&!1!==(0,nF.resolveEnabled)(this.options.enabled,this.#i)&&(0,nF.isValidTimeout)(this.#m)&&0!==this.#m&&(this.#h=nO.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||nE.focusManager.isFocused())&&this.#f()},this.#m))}#x(){this.#b(),this.#j(this.#w())}#g(){this.#u&&(nO.timeoutManager.clearTimeout(this.#u),this.#u=void 0)}#y(){this.#h&&(nO.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,i=this.#i,r=this.options,n=this.#n,a=this.#a,o=this.#o,l=e!==i?e.state:this.#r,{state:c}=e,d={...c},u=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&n$(e,t),a=s&&nB(e,i,t,r);(n||a)&&(d={...d,...(0,nD.fetchState)(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:p}=d;s=d.data;let f=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===p){let e;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=n.data,f=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#d?.state.data,this.#d):t.placeholderData,void 0!==e&&(p="success",s=(0,nF.replaceData)(n?.data,e,t),u=!0)}if(t.select&&void 0!==s&&!f)if(n&&s===a?.data&&t.select===this.#l)s=this.#c;else try{this.#l=t.select,s=t.select(s),s=(0,nF.replaceData)(n?.data,s,t),this.#c=s,this.#t=null}catch(e){this.#t=e}this.#t&&(h=this.#t,s=this.#c,m=Date.now(),p="error");let x="fetching"===d.fetchStatus,g="pending"===p,y="error"===p,v=g&&x,b=void 0!==s,w={status:p,fetchStatus:d.fetchStatus,isPending:g,isSuccess:"success"===p,isError:y,isInitialLoading:v,isLoading:v,data:s,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!g,isLoadingError:y&&!b,isPaused:"paused"===d.fetchStatus,isPlaceholderData:u,isRefetchError:y&&b,isStale:nz(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,nF.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,s="error"===w.status&&!t,r=e=>{s?e.reject(w.error):t&&e.resolve(w.data)},n=()=>{r(this.#s=w.promise=(0,nV.pendingThenable)())},a=this.#s;switch(a.status){case"pending":e.queryHash===i.queryHash&&r(a);break;case"fulfilled":(s||w.data!==a.value)&&n();break;case"rejected":s&&w.error===a.reason||n()}}return w}updateResult(){let e=this.#n,t=this.createResult(this.#i,this.options);if(this.#a=this.#i.state,this.#o=this.options,void 0!==this.#a.data&&(this.#d=this.#i),(0,nF.shallowEqualObjects)(t,e))return;this.#n=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#p.size)return!0;let i=new Set(s??this.#p);return this.options.throwOnError&&i.add("error"),Object.keys(this.#n).some(t=>this.#n[t]!==e[t]&&i.has(t))};this.#k({listeners:s()})}#v(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#k(e){nR.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#i,type:"observerResultsUpdated"})})}};function n$(e,t){return!1!==(0,nF.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&n_(e,t,t.refetchOnMount)}function n_(e,t,s){if(!1!==(0,nF.resolveEnabled)(t.enabled,e)&&"static"!==(0,nF.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&nz(e,t)}return!1}function nB(e,t,s,i){return(e!==t||!1===(0,nF.resolveEnabled)(i.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&nz(e,s)}function nz(e,t){return!1!==(0,nF.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,nF.resolveStaleTime)(t.staleTime,e))}var nU=e.i(1235),nq=m.createContext((i=!1,{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i})),nW=m.createContext(!1);nW.Provider;var nQ=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function nK(e,t){return function(e,t,s){let i,r=m.useContext(nW),n=m.useContext(nq),a=(0,nU.useQueryClient)(s),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let l=a.getQueryCache().get(o.queryHash);if(o._optimisticResults=r?"isRestoring":"optimistic",o.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=o.staleTime;o.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}i=l?.state.error&&"function"==typeof o.throwOnError?(0,nF.shouldThrowError)(o.throwOnError,[l.state.error,l]):o.throwOnError,(o.suspense||o.experimental_prefetchInRender||i)&&!n.isReset()&&(o.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let c=!a.getQueryCache().get(o.queryHash),[d]=m.useState(()=>new t(a,o)),u=d.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=h?d.subscribe(nR.notifyManager.batchCalls(e)):nF.noop;return d.updateResult(),t},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),o?.suspense&&u.isPending)throw nQ(o,d,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&void 0===e.data||(0,nF.shouldThrowError)(s,[e.error,i])))({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw u.error;if(a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!nF.isServer&&u.isLoading&&u.isFetching&&!r){let e=c?nQ(o,d,n):l?.promise;e?.catch(nF.noop).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?u:d.trackResult(u)}(e,nI,t)}var nH=e.i(21230),nX=nL,nY=class extends nX.Subscribable{#e;#n=void 0;#S;#N;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#T()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,nF.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#S,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,nF.hashKey)(t.mutationKey)!==(0,nF.hashKey)(this.options.mutationKey)?this.reset():this.#S?.state.status==="pending"&&this.#S.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#S?.removeObserver(this)}onMutationUpdate(e){this.#T(),this.#k(e)}getCurrentResult(){return this.#n}reset(){this.#S?.removeObserver(this),this.#S=void 0,this.#T(),this.#k()}mutate(e,t){return this.#N=t,this.#S?.removeObserver(this),this.#S=this.#e.getMutationCache().build(this.#e,this.options),this.#S.addObserver(this),this.#S.execute(e)}#T(){let e=this.#S?.state??(0,nH.getDefaultState)();this.#n={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#k(e){nR.notifyManager.batch(()=>{if(this.#N&&this.hasListeners()){let t=this.#n.variables,s=this.#n.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#N.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#N.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#N.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#N.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#n)})})}};function nG(e,t){let s=(0,nU.useQueryClient)(t),[i]=m.useState(()=>new nY(s,e));m.useEffect(()=>{i.setOptions(e)},[i,e]);let r=m.useSyncExternalStore(m.useCallback(e=>i.subscribe(nR.notifyManager.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),n=m.useCallback((e,t)=>{i.mutate(e,t).catch(nF.noop)},[i]);if(r.error&&(0,nF.shouldThrowError)(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}var nZ=e.i(94156);let nJ=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function n0(e){let t=new URLSearchParams;e?.project&&t.set("project",e.project),e?.type&&t.set("type",e.type),e?.category&&t.set("category",e.category),e?.limit&&t.set("limit",e.limit.toString()),e?.offset&&t.set("offset",e.offset.toString()),e?.mode&&t.set("mode",e.mode),e?.query&&t.set("query",e.query);let s=await fetch(`${nJ}/api/memories?${t}`);if(!s.ok)throw Error("Failed to fetch memories");return s.json()}async function n1(e){let t=e?`?project=${e}`:"",s=await fetch(`${nJ}/api/stats${t}`);if(!s.ok)throw Error("Failed to fetch stats");return s.json()}async function n2(e){let t=e?`?project=${e}`:"",s=await fetch(`${nJ}/api/links${t}`);if(!s.ok)throw Error("Failed to fetch links");return s.json()}async function n4(){let e=await fetch(`${nJ}/api/projects`);if(!e.ok)throw Error("Failed to fetch projects");return e.json()}async function n5(e){let t=await fetch(`${nJ}/api/memories/${e}/access`,{method:"POST"});if(!t.ok)throw Error("Failed to access memory");return t.json()}async function n3(){let e=await fetch(`${nJ}/api/consolidate`,{method:"POST"});if(!e.ok)throw Error("Failed to consolidate");return e.json()}function n6(e){return nK({queryKey:["stats",e],queryFn:()=>n1(e),refetchInterval:3e4})}async function n8(){let e=await fetch(`${nJ}/api/control/status`);if(!e.ok)throw Error("Failed to fetch control status");return e.json()}async function n7(){let e=await fetch(`${nJ}/api/control/pause`,{method:"POST"});if(!e.ok)throw Error("Failed to pause");return e.json()}async function n9(){let e=await fetch(`${nJ}/api/control/resume`,{method:"POST"});if(!e.ok)throw Error("Failed to resume");return e.json()}var ae=e.i(92618);let at=e=>{let t=(0,ae.createStore)(e),s=e=>(function(e,t=e=>e){let s=m.default.useSyncExternalStore(e.subscribe,m.default.useCallback(()=>t(e.getState()),[e,t]),m.default.useCallback(()=>t(e.getInitialState()),[e,t]));return m.default.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},as=(r=e=>({selectedMemory:null,setSelectedMemory:t=>e({selectedMemory:t}),viewMode:"shield",setViewMode:t=>e({viewMode:t}),typeFilter:null,categoryFilter:null,projectFilter:null,setTypeFilter:t=>e({typeFilter:t}),setCategoryFilter:t=>e({categoryFilter:t}),setProjectFilter:t=>e({projectFilter:t}),recentEvents:[],addEvent:t=>e(e=>({recentEvents:[t,...e.recentEvents].slice(0,50)})),clearEvents:()=>e({recentEvents:[]}),cameraPosition:[0,0,12],setCameraPosition:t=>e({cameraPosition:t}),showLeftSidebar:!0,showRightSidebar:!0,toggleLeftSidebar:()=>e(e=>({showLeftSidebar:!e.showLeftSidebar})),toggleRightSidebar:()=>e(e=>({showRightSidebar:!e.showRightSidebar})),searchQuery:"",setSearchQuery:t=>e({searchQuery:t})}))?at(r):at;function ai(e,t=300){let[s,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>{let s=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(s)}},[e,t]),s}let ar=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function an(e){if(!e||e.length<2)return[];let t=await fetch(`${ar}/api/suggestions?q=${encodeURIComponent(e)}&limit=8`);if(!t.ok)throw Error("Failed to fetch suggestions");return(await t.json()).suggestions}function aa(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=function e(t){var s,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(s=0;s<n;s++)t[s]&&(i=e(t[s]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}(e))&&(i&&(i+=" "),i+=t);return i}let ao=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),al=[],ac=(e,t,s)=>{if(0==e.length-t)return s.classGroupId;let i=e[t],r=s.nextPart.get(i);if(r){let s=ac(e,t+1,r);if(s)return s}let n=s.validators;if(null===n)return;let a=0===t?e.join("-"):e.slice(t).join("-"),o=n.length;for(let e=0;e<o;e++){let t=n[e];if(t.validator(a))return t.classGroupId}},ad=(e,t)=>{let s=ao();for(let i in e)au(e[i],s,i,t);return s},au=(e,t,s,i)=>{let r=e.length;for(let n=0;n<r;n++)ah(e[n],t,s,i)},ah=(e,t,s,i)=>{"string"==typeof e?am(e,t,s):"function"==typeof e?ap(e,t,s,i):af(e,t,s,i)},am=(e,t,s)=>{(""===e?t:ax(t,e)).classGroupId=s},ap=(e,t,s,i)=>{ag(e)?au(e(i),t,s,i):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:s,validator:e}))},af=(e,t,s,i)=>{let r=Object.entries(e),n=r.length;for(let e=0;e<n;e++){let[n,a]=r[e];au(a,ax(t,n),s,i)}},ax=(e,t)=>{let s=e,i=t.split("-"),r=i.length;for(let e=0;e<r;e++){let t=i[e],r=s.nextPart.get(t);r||(r=ao(),s.nextPart.set(t,r)),s=r}return s},ag=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ay=[],av=(e,t,s,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:i,isExternal:r}),ab=/\s+/,aw=e=>{let t;if("string"==typeof e)return e;let s="";for(let i=0;i<e.length;i++)e[i]&&(t=aw(e[i]))&&(s&&(s+=" "),s+=t);return s},aj=[],ak=e=>{let t=t=>t[e]||aj;return t.isThemeGetter=!0,t},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aT=/^\d+\/\d+$/,aC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aP=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aR=e=>aT.test(e),aD=e=>!!e&&!Number.isNaN(Number(e)),aL=e=>!!e&&Number.isInteger(Number(e)),aV=e=>e.endsWith("%")&&aD(e.slice(0,-1)),aF=e=>aC.test(e),aO=()=>!0,aI=e=>aP.test(e)&&!aM.test(e),a$=()=>!1,a_=e=>aA.test(e),aB=e=>aE.test(e),az=e=>!aq(e)&&!aY(e),aU=e=>a4(e,a8,a$),aq=e=>aS.test(e),aW=e=>a4(e,a7,aI),aQ=e=>a4(e,a9,aD),aK=e=>a4(e,a3,a$),aH=e=>a4(e,a6,aB),aX=e=>a4(e,ot,a_),aY=e=>aN.test(e),aG=e=>a5(e,a7),aZ=e=>a5(e,oe),aJ=e=>a5(e,a3),a0=e=>a5(e,a8),a1=e=>a5(e,a6),a2=e=>a5(e,ot,!0),a4=(e,t,s)=>{let i=aS.exec(e);return!!i&&(i[1]?t(i[1]):s(i[2]))},a5=(e,t,s=!1)=>{let i=aN.exec(e);return!!i&&(i[1]?t(i[1]):s)},a3=e=>"position"===e||"percentage"===e,a6=e=>"image"===e||"url"===e,a8=e=>"length"===e||"size"===e||"bg-size"===e,a7=e=>"length"===e,a9=e=>"number"===e,oe=e=>"family-name"===e,ot=e=>"shadow"===e,os=((e,...t)=>{let s,i,r,n,a=e=>{let t=i(e);if(t)return t;let n=((e,t)=>{let{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:n}=t,a=[],o=e.trim().split(ab),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:c,modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=s(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!m,f=i(p?h.substring(0,m):h);if(!f){if(!p||!(f=i(h))){l=t+(l.length>0?" "+l:l);continue}p=!1}let x=0===d.length?"":1===d.length?d[0]:n(d).join(":"),g=u?x+"!":x,y=g+f;if(a.indexOf(y)>-1)continue;a.push(y);let v=r(f,p);for(let e=0;e<v.length;++e){let t=v[e];a.push(g+t)}l=t+(l.length>0?" "+l:l)}return l})(e,s);return r(e,n),n};return n=o=>{var l;let c;return i=(s={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,s=Object.create(null),i=Object.create(null),r=(r,n)=>{s[r]=n,++t>e&&(t=0,i=s,s=Object.create(null))};return{get(e){let t=s[e];return void 0!==t?t:void 0!==(t=i[e])?(r(e,t),t):void 0},set(e,t){e in s?s[e]=t:r(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:s}=e,i=e=>{let t,s=[],i=0,r=0,n=0,a=e.length;for(let o=0;o<a;o++){let a=e[o];if(0===i&&0===r){if(":"===a){s.push(e.slice(n,o)),n=o+1;continue}if("/"===a){t=o;continue}}"["===a?i++:"]"===a?i--:"("===a?r++:")"===a&&r--}let o=0===s.length?e:e.slice(n),l=o,c=!1;return o.endsWith("!")?(l=o.slice(0,-1),c=!0):o.startsWith("!")&&(l=o.slice(1),c=!0),av(s,c,l,t&&t>n?t-n:void 0)};if(t){let e=t+":",s=i;i=t=>t.startsWith(e)?s(t.slice(e.length)):av(ay,!1,t,void 0,!0)}if(s){let e=i;i=t=>s({className:t,parseClassName:e})}return i})(l),sortModifiers:(c=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],s=[];for(let i=0;i<e.length;i++){let r=e[i],n="["===r[0],a=c.has(r);n||a?(s.length>0&&(s.sort(),t.push(...s),s=[]),t.push(r)):s.push(r)}return s.length>0&&(s.sort(),t.push(...s)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:s}=e;return ad(s,t)})(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var s;let t,i,r;return -1===(s=e).slice(1,-1).indexOf(":")?void 0:(i=(t=s.slice(1,-1)).indexOf(":"),(r=t.slice(0,i))?"arbitrary.."+r:void 0)}let i=e.split("-"),r=+(""===i[0]&&i.length>1);return ac(i,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],r=s[e];if(t){if(r){let e=Array(r.length+t.length);for(let t=0;t<r.length;t++)e[t]=r[t];for(let s=0;s<t.length;s++)e[r.length+s]=t[s];return e}return t}return r||al}return s[e]||al}}})(l)}).cache.get,r=s.cache.set,n=a,a(o)},(...e)=>n(((...e)=>{let t,s,i=0,r="";for(;i<e.length;)(t=e[i++])&&(s=aw(t))&&(r&&(r+=" "),r+=s);return r})(...e))})(()=>{let e=ak("color"),t=ak("font"),s=ak("text"),i=ak("font-weight"),r=ak("tracking"),n=ak("leading"),a=ak("breakpoint"),o=ak("container"),l=ak("spacing"),c=ak("radius"),d=ak("shadow"),u=ak("inset-shadow"),h=ak("text-shadow"),m=ak("drop-shadow"),p=ak("blur"),f=ak("perspective"),x=ak("aspect"),g=ak("ease"),y=ak("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...b(),aY,aq],j=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],S=()=>[aY,aq,l],N=()=>[aR,"full","auto",...S()],T=()=>[aL,"none","subgrid",aY,aq],C=()=>["auto",{span:["full",aL,aY,aq]},aL,aY,aq],P=()=>[aL,"auto",aY,aq],M=()=>["auto","min","max","fr",aY,aq],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],E=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...S()],D=()=>[aR,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],L=()=>[e,aY,aq],V=()=>[...b(),aJ,aK,{position:[aY,aq]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",a0,aU,{size:[aY,aq]}],I=()=>[aV,aG,aW],$=()=>["","none","full",c,aY,aq],_=()=>["",aD,aG,aW],B=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[aD,aV,aJ,aK],q=()=>["","none",p,aY,aq],W=()=>["none",aD,aY,aq],Q=()=>["none",aD,aY,aq],K=()=>[aD,aY,aq],H=()=>[aR,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[aF],breakpoint:[aF],color:[aO],container:[aF],"drop-shadow":[aF],ease:["in","out","in-out"],font:[az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[aF],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[aF],shadow:[aF],spacing:["px",aD],text:[aF],"text-shadow":[aF],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",aR,aq,aY,x]}],container:["container"],columns:[{columns:[aD,aq,aY,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[aL,"auto",aY,aq]}],basis:[{basis:[aR,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[aD,aR,"auto","initial","none",aq]}],grow:[{grow:["",aD,aY,aq]}],shrink:[{shrink:["",aD,aY,aq]}],order:[{order:[aL,"first","last","none",aY,aq]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...E(),"normal"]}],"justify-self":[{"justify-self":["auto",...E()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...E(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...E(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...E(),"baseline"]}],"place-self":[{"place-self":["auto",...E()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[o,"screen",...D()]}],"min-w":[{"min-w":[o,"screen","none",...D()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",s,aG,aW]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,aY,aQ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",aV,aq]}],"font-family":[{font:[aZ,aq,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,aY,aq]}],"line-clamp":[{"line-clamp":[aD,"none",aY,aQ]}],leading:[{leading:[n,...S()]}],"list-image":[{"list-image":["none",aY,aq]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",aY,aq]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[aD,"from-font","auto",aY,aW]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[aD,"auto",aY,aq]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",aY,aq]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",aY,aq]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},aL,aY,aq],radial:["",aY,aq],conic:[aL,aY,aq]},a1,aH]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[aD,aY,aq]}],"outline-w":[{outline:["",aD,aG,aW]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,a2,aX]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,a2,aX]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[aD,aW]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,a2,aX]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[aD,aY,aq]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[aD]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[aY,aq]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[aD]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",aY,aq]}],filter:[{filter:["","none",aY,aq]}],blur:[{blur:q()}],brightness:[{brightness:[aD,aY,aq]}],contrast:[{contrast:[aD,aY,aq]}],"drop-shadow":[{"drop-shadow":["","none",m,a2,aX]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",aD,aY,aq]}],"hue-rotate":[{"hue-rotate":[aD,aY,aq]}],invert:[{invert:["",aD,aY,aq]}],saturate:[{saturate:[aD,aY,aq]}],sepia:[{sepia:["",aD,aY,aq]}],"backdrop-filter":[{"backdrop-filter":["","none",aY,aq]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[aD,aY,aq]}],"backdrop-contrast":[{"backdrop-contrast":[aD,aY,aq]}],"backdrop-grayscale":[{"backdrop-grayscale":["",aD,aY,aq]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[aD,aY,aq]}],"backdrop-invert":[{"backdrop-invert":["",aD,aY,aq]}],"backdrop-opacity":[{"backdrop-opacity":[aD,aY,aq]}],"backdrop-saturate":[{"backdrop-saturate":[aD,aY,aq]}],"backdrop-sepia":[{"backdrop-sepia":["",aD,aY,aq]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",aY,aq]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[aD,"initial",aY,aq]}],ease:[{ease:["linear","initial",g,aY,aq]}],delay:[{delay:[aD,aY,aq]}],animate:[{animate:["none",y,aY,aq]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,aY,aq]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[aY,aq,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",aY,aq]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",aY,aq]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[aD,aG,aW,aQ]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function oi(...e){return os(aa(e))}function or({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card",className:oi("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function on({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-header",className:oi("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function oa({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-title",className:oi("leading-none font-semibold",e),...t})}function oo({className:e,...t}){return(0,h.jsx)("div",{"data-slot":"card-content",className:oi("px-6",e),...t})}function ol(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var oc=Symbol.for("react.lazy"),od=m[" use ".trim().toString()];function ou(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===oc&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var oh=((d=m.forwardRef((e,t)=>{let{children:s,...i}=e;if(ou(s)&&"function"==typeof od&&(s=od(s._payload)),m.isValidElement(s)){var r;let e,n,a=(r=s,(n=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.ref:(n=(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.props.ref:r.props.ref||r.ref),o=function(e,t){let s={...t};for(let i in t){let r=e[i],n=t[i];/^on[A-Z]/.test(i)?r&&n?s[i]=(...e)=>{let t=n(...e);return r(...e),t}:r&&(s[i]=r):"style"===i?s[i]={...r,...n}:"className"===i&&(s[i]=[r,n].filter(Boolean).join(" "))}return{...e,...s}}(i,s.props);return s.type!==m.Fragment&&(o.ref=t?function(...e){return t=>{let s=!1,i=e.map(e=>{let i=ol(e,t);return s||"function"!=typeof i||(s=!0),i});if(s)return()=>{for(let t=0;t<i.length;t++){let s=i[t];"function"==typeof s?s():ol(e[t],null)}}}}(t,a):a),m.cloneElement(s,o)}return m.Children.count(s)>1?m.Children.only(null):null})).displayName="Slot.SlotClone",n=d,(a=m.forwardRef((e,t)=>{let{children:s,...i}=e;ou(s)&&"function"==typeof od&&(s=od(s._payload));let r=m.Children.toArray(s),a=r.find(op);if(a){let e=a.props.children,s=r.map(t=>t!==a?t:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,h.jsx)(n,{...i,ref:t,children:m.isValidElement(e)?m.cloneElement(e,void 0,s):null})}return(0,h.jsx)(n,{...i,ref:t,children:s})})).displayName="Slot.Slot",a),om=Symbol("radix.slottable");function op(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===om}let of=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ox=(o="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",l={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==l?void 0:l.variants)==null)return aa(o,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:s,defaultVariants:i}=l,r=Object.keys(s).map(t=>{let r=null==e?void 0:e[t],n=null==i?void 0:i[t];if(null===r)return null;let a=of(r)||of(n);return s[t][a]}),n=e&&Object.entries(e).reduce((e,t)=>{let[s,i]=t;return void 0===i||(e[s]=i),e},{});return aa(o,r,null==l||null==(t=l.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:s,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,s]=e;return Array.isArray(s)?s.includes({...i,...n}[t]):({...i,...n})[t]===s})?[...e,s,r]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});function og({className:e,variant:t="default",size:s="default",asChild:i=!1,...r}){return(0,h.jsx)(i?oh:"button",{"data-slot":"button","data-variant":t,"data-size":s,className:oi(ox({variant:t,size:s,className:e})),...r})}var oy=e.i(97358),ov=e.i(33368);let ob={references:{color:"#60a5fa",label:"References",icon:"→"},extends:{color:"#34d399",label:"Extends",icon:"⊃"},contradicts:{color:"#f87171",label:"Contradicts",icon:"⊗"},related:{color:"#a78bfa",label:"Related",icon:"~"}};function ow({memory:e,links:t=[],memories:s=[],onClose:i,onReinforce:r,onSelectMemory:n,isReinforcing:a=!1,reinforceSuccess:o=!1}){let[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(o&&d===e.id){c(!0);let e=setTimeout(()=>c(!1),1500);return()=>clearTimeout(e)}},[o,d,e.id]);let p=(0,ov.calculateDecayFactor)(e),f=(0,oy.getCategoryColor)(e.category),x=(0,oy.getTypeColor)(e.type),g=p>.7?{label:"Healthy",color:"#22C55E",bgColor:"rgba(34, 197, 94, 0.15)"}:p>.4?{label:"Fading",color:"#EAB308",bgColor:"rgba(234, 179, 8, 0.15)"}:{label:"Critical",color:"#EF4444",bgColor:"rgba(239, 68, 68, 0.15)"},y=(0,m.useMemo)(()=>{let i=[];for(let r of t)if(r.source_id===e.id){let e=s.find(e=>e.id===r.target_id);e&&i.push({memory:e,relationship:r.relationship,strength:r.strength,direction:"to"})}else if(r.target_id===e.id){let e=s.find(e=>e.id===r.source_id);e&&i.push({memory:e,relationship:r.relationship,strength:r.strength,direction:"from"})}return i.sort((e,t)=>t.strength-e.strength)},[e.id,t,s]);return(0,h.jsxs)(or,{className:`bg-slate-900 border-slate-700 h-full overflow-auto transition-all duration-300 ${l?"ring-2 ring-green-500 ring-opacity-75":""}`,children:[(0,h.jsxs)(on,{className:"border-b border-slate-700 pb-3",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,h.jsx)(oa,{className:"text-lg font-semibold text-white leading-tight",children:e.title}),(0,h.jsx)(og,{variant:"ghost",size:"sm",onClick:i,className:"text-slate-400 hover:text-white -mt-1",children:"✕"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,h.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:f+"20",color:f},children:e.category}),(0,h.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:x+"20",color:x},children:e.type.replace("_","-")})]})]}),(0,h.jsxs)(oo,{className:"p-4 space-y-4",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-1",children:"Content"}),(0,h.jsx)("p",{className:"text-sm text-slate-200 whitespace-pre-wrap leading-relaxed",children:e.content})]}),(0,h.jsxs)("div",{className:"rounded-lg p-3 flex items-center gap-3",style:{backgroundColor:g.bgColor},children:[(0,h.jsx)("div",{className:"w-3 h-3 rounded-full animate-pulse",style:{backgroundColor:g.color}}),(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"text-sm font-medium",style:{color:g.color},children:g.label}),(0,h.jsx)("div",{className:"text-xs text-slate-400",children:p>.7?"Memory is strong and stable":p>.4?"Memory is fading - reinforce to preserve":"Memory at risk of deletion - reinforce now"})]})]}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,h.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,h.jsx)("div",{className:"text-xs text-slate-400",children:"Salience"}),(0,h.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*e.salience).toFixed(0),"%"]}),(0,h.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,h.jsx)("div",{className:"h-full bg-gradient-to-r from-red-500 via-yellow-500 to-green-500 rounded-full transition-all",style:{width:`${100*e.salience}%`}})})]}),(0,h.jsxs)("div",{className:"bg-slate-800 rounded-lg p-3",children:[(0,h.jsx)("div",{className:"text-xs text-slate-400",children:"Decay Factor"}),(0,h.jsxs)("div",{className:"text-lg font-bold text-white",children:[(100*p).toFixed(0),"%"]}),(0,h.jsx)("div",{className:"mt-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:(0,h.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${100*p}%`,backgroundColor:g.color}})})]})]}),(0,h.jsxs)("div",{className:`bg-slate-800 rounded-lg p-3 space-y-2 transition-all duration-300 ${l?"ring-1 ring-green-500/50":""}`,children:[(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Access Count"}),(0,h.jsxs)("span",{className:`text-sm font-medium transition-all duration-300 ${l?"text-green-400 scale-110":"text-white"}`,children:[e.accessCount," times"]})]}),(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Last Accessed"}),(0,h.jsx)("span",{className:`text-sm transition-all duration-300 ${l?"text-green-400":"text-white"}`,children:l?"Just now":(e=>{let t=new Date(e),s=Math.floor((new Date().getTime()-t.getTime())/36e5);if(s<1)return"Just now";if(s<24)return`${s}h ago`;let i=Math.floor(s/24);return i<7?`${i}d ago`:`${Math.floor(i/7)}w ago`})(e.lastAccessed)})]}),(0,h.jsxs)("div",{className:"flex justify-between items-center",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Created"}),(0,h.jsx)("span",{className:"text-sm text-white",children:new Date(e.createdAt).toLocaleString()})]})]}),y.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsxs)("h4",{className:"text-xs font-medium text-slate-400 mb-2 flex items-center gap-2",children:[(0,h.jsx)("span",{className:"inline-block w-4 h-4",children:"🔗"}),"Related Memories (",y.length,")"]}),(0,h.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:y.map(({memory:e,relationship:t,strength:s,direction:i})=>{let r=ob[t]||ob.related,a=(0,oy.getCategoryColor)(e.category);return(0,h.jsxs)("button",{onClick:()=>n?.(e.id),className:"w-full text-left p-2 bg-slate-800 hover:bg-slate-750 rounded-lg transition-colors group",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,h.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:r.color}}),(0,h.jsx)("span",{className:"text-[10px] font-medium",style:{color:r.color},children:"to"===i?`${r.icon} ${r.label}`:`${r.label} ${r.icon}`}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500 ml-auto",children:[(100*s).toFixed(0),"%"]})]}),(0,h.jsx)("div",{className:"text-sm text-white truncate group-hover:text-blue-400 transition-colors",children:e.title}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,h.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{backgroundColor:a+"20",color:a},children:e.category}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:[(100*e.salience).toFixed(0),"% salience"]})]})]},`${e.id}-${i}`)})})]}),e.tags&&e.tags.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Tags"}),(0,h.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map((e,t)=>(0,h.jsx)("span",{className:"px-2 py-0.5 bg-slate-700 text-slate-300 rounded text-xs",children:e},t))})]}),(0,h.jsx)("div",{className:"flex gap-2 pt-2",children:r&&(0,h.jsx)(og,{variant:"default",size:"sm",onClick:()=>{u(e.id),r?.(e.id)},disabled:a,className:`flex-1 transition-all duration-300 ${l?"bg-green-600 hover:bg-green-600":"bg-blue-600 hover:bg-blue-700"}`,children:a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{className:"animate-spin mr-2",children:"⟳"}),"Reinforcing..."]}):l?(0,h.jsx)(h.Fragment,{children:"✓ Reinforced!"}):(0,h.jsx)(h.Fragment,{children:"⚡ Reinforce Memory"})})})]})]})}function oj(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let i=Math.floor(s/24);if(i<7)return`${i}d ago`;let r=Math.floor(i/7);return`${r}w ago`}function ok({memory:e,isSelected:t,onSelect:s,isChecked:i,onCheck:r}){let n=(0,oy.getCategoryColor)(e.category),a=(0,oy.getTypeColor)(e.type);return(0,h.jsxs)("div",{onClick:()=>s(e),className:`bg-slate-900 border rounded-lg p-3 hover:border-slate-600 cursor-pointer transition-colors relative ${t?"border-cyan-500":"border-slate-800"}`,children:[(0,h.jsx)("div",{className:"h-0.5 rounded-full bg-slate-800 mb-2 overflow-hidden",children:(0,h.jsx)("div",{className:"h-full rounded-full",style:{width:`${100*e.salience}%`,backgroundColor:n}})}),r&&(0,h.jsx)("input",{type:"checkbox",checked:i??!1,onChange:t=>{t.stopPropagation(),r(e.id,t.target.checked)},onClick:e=>e.stopPropagation(),className:"absolute top-3 right-3 w-4 h-4 accent-blue-500"}),(0,h.jsx)("h3",{className:"text-sm font-semibold text-white truncate pr-6",children:e.title}),(0,h.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:n+"22",color:n},children:e.category}),(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a},children:e.type.replace("_","-")})]}),(0,h.jsx)("p",{className:"text-[13px] text-slate-400 mt-1.5 line-clamp-3 leading-snug",children:e.content}),e.tags.length>0&&(0,h.jsxs)("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[e.tags.slice(0,3).map(e=>(0,h.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-slate-800 text-slate-400",children:e},e)),e.tags.length>3&&(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:["+",e.tags.length-3," more"]})]}),(0,h.jsxs)("div",{className:"flex items-center justify-between mt-2 text-[11px] text-slate-500",children:[(0,h.jsxs)("span",{children:["Created ",oj(e.createdAt)]}),(0,h.jsxs)("span",{children:["Accessed ",oj(e.lastAccessed)]})]})]})}let oS=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";function oN({memories:e,selectedMemory:t,onSelectMemory:s}){let[i,r]=(0,m.useState)("salience"),[n,a]=(0,m.useState)("grid"),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(new Set),[u,p]=(0,m.useState)(!1),f=(0,nU.useQueryClient)(),x=(0,m.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(i){case"salience":return t.salience-e.salience;case"createdAt":return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();case"lastAccessed":return new Date(t.lastAccessed).getTime()-new Date(e.lastAccessed).getTime();case"decayedScore":return(t.decayedScore??t.salience)-(e.decayedScore??e.salience);default:return 0}}),t},[e,i]),g=(0,m.useCallback)((e,t)=>{d(s=>{let i=new Set(s);return t?i.add(e):i.delete(e),i})},[]),y=async()=>{if(0!==c.size){p(!0);try{await Promise.all(Array.from(c).map(e=>fetch(`${oS}/api/memories/${e}`,{method:"DELETE"}))),d(new Set),f.invalidateQueries({queryKey:["memories"]})}finally{p(!1)}}};return(0,h.jsxs)("div",{className:"flex flex-col h-full",children:[(0,h.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-slate-800 shrink-0",children:[(0,h.jsxs)("span",{className:"text-xs text-slate-400",children:[e.length," memories"]}),(0,h.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,h.jsxs)("select",{value:i,onChange:e=>r(e.target.value),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded px-2 py-1",children:[(0,h.jsx)("option",{value:"salience",children:"Salience"}),(0,h.jsx)("option",{value:"createdAt",children:"Created"}),(0,h.jsx)("option",{value:"lastAccessed",children:"Last Accessed"}),(0,h.jsx)("option",{value:"decayedScore",children:"Decay Score"})]}),(0,h.jsxs)("div",{className:"flex items-center border border-slate-700 rounded overflow-hidden",children:[(0,h.jsx)("button",{onClick:()=>a("grid"),className:`px-2 py-1 text-xs ${"grid"===n?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"Grid"}),(0,h.jsx)("button",{onClick:()=>a("list"),className:`px-2 py-1 text-xs ${"list"===n?"bg-slate-700 text-white":"text-slate-400 hover:text-white"}`,children:"List"})]}),(0,h.jsx)("div",{className:"w-px h-5 bg-slate-700"}),(0,h.jsx)("button",{onClick:()=>{l(!o),d(new Set)},className:`px-2 py-1 text-xs rounded ${o?"bg-blue-600 text-white":"bg-slate-800 text-slate-400 hover:text-white"}`,children:"Select"}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("button",{onClick:()=>d(new Set(x.map(e=>e.id))),className:"px-2 py-1 text-xs text-slate-400 hover:text-white",children:"Select all"}),(0,h.jsx)("button",{onClick:y,disabled:0===c.size||u,className:"px-2 py-1 text-xs rounded bg-red-600/20 text-red-400 hover:bg-red-600/40 disabled:opacity-40",children:u?"Deleting...":`Delete (${c.size})`})]})]}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,h.jsx)("div",{className:"grid"===n?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3":"flex flex-col gap-3 max-w-2xl",children:x.map(e=>(0,h.jsx)(ok,{memory:e,isSelected:t?.id===e.id,onSelect:s,isChecked:o?c.has(e.id):void 0,onCheck:o?g:void 0},e.id))})})]})}let oT=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function oC(e){let t=new URLSearchParams;e?.startTime&&t.set("startTime",e.startTime),e?.endTime&&t.set("endTime",e.endTime),e?.source&&t.set("source",e.source),e?.firewallResult&&t.set("firewallResult",e.firewallResult),e?.project&&t.set("project",e.project),e?.limit&&t.set("limit",e.limit.toString());let s=await fetch(`${oT}/api/v1/audit?${t}`);if(!s.ok)throw Error("Failed to fetch audit logs");return s.json()}async function oP(e,t){let s=new URLSearchParams({timeRange:e});t&&s.set("project",t);let i=await fetch(`${oT}/api/v1/audit/stats?${s}`);if(!i.ok)throw Error("Failed to fetch audit stats");return i.json()}async function oM(e="pending",t=50,s){let i=new URLSearchParams({status:e,limit:t.toString()});s&&i.set("project",s);let r=await fetch(`${oT}/api/v1/quarantine?${i}`);if(!r.ok)throw Error("Failed to fetch quarantine");return r.json()}async function oA(e){let t=await fetch(`${oT}/api/v1/quarantine/${e}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:"dashboard"})});if(!t.ok)throw Error("Failed to approve");return t.json()}async function oE(e,t){let s=await fetch(`${oT}/api/v1/quarantine/${e}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:"dashboard",notes:t})});if(!s.ok)throw Error("Failed to reject");return s.json()}function oR(e){return nK({queryKey:["audit-logs",e],queryFn:()=>oC(e),refetchInterval:3e4,retry:2})}function oD(e="24h",t){return nK({queryKey:["audit-stats",e,t],queryFn:()=>oP(e,t),refetchInterval:3e4,retry:2})}function oL(e="pending",t=50,s){return nK({queryKey:["quarantine",e,t,s],queryFn:()=>oM(e,t,s),refetchInterval:3e4,retry:2})}let oV=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},oF=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim();var oO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let oI=(0,m.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:r="",children:n,iconNode:a,...o},l)=>(0,m.createElement)("svg",{ref:l,...oO,width:t,height:t,stroke:e,strokeWidth:i?24*Number(s)/Number(t):s,className:oF("lucide",r),...!n&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(o)&&{"aria-hidden":"true"},...o},[...a.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(n)?n:[n]])),o$=(e,t)=>{let s=(0,m.forwardRef)(({className:s,...i},r)=>(0,m.createElement)(oI,{ref:r,iconNode:t,className:oF(`lucide-${oV(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...i}));return s.displayName=oV(e),s},o_=o$("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),oB=o$("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),oz=o$("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),oU=o$("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),oq=o$("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),oW=o$("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),oQ=o$("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),oK=[{id:"shield",label:"Shield",icon:o_},{id:"audit",label:"Audit",icon:oB},{id:"quarantine",label:"Queue",icon:oz},{id:"agents",label:"Agents",icon:oQ},{id:"memories",label:"Memories",icon:oU},{id:"brain",label:"Brain",icon:oq},{id:"graph",label:"Graph",icon:oW}];function oH(){let{viewMode:e,setViewMode:t}=as(),{data:s}=n6(),{data:i}=oD("24h"),r=s?.decayDistribution?Math.round(s.decayDistribution.healthy/Math.max(1,s.total)*100):null,n=i?.blockedCount??0;return(0,h.jsxs)("nav",{className:"w-14 border-r border-slate-800 bg-slate-900/50 flex flex-col items-center py-3 shrink-0",children:[(0,h.jsx)("div",{className:"flex-1 flex flex-col items-center gap-1",children:oK.map(({id:s,label:i,icon:r})=>(0,h.jsxs)("button",{onClick:()=>t(s),className:`relative w-10 h-10 rounded-lg flex flex-col items-center justify-center gap-0.5 transition-colors ${e===s?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"}`,title:i,children:[(0,h.jsx)(r,{size:18}),(0,h.jsx)("span",{className:"text-[9px] leading-none",children:i}),"shield"===s&&n>0&&(0,h.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] rounded-full bg-red-500 text-white text-[8px] flex items-center justify-center px-0.5",children:n>99?"99+":n})]},s))}),(0,h.jsxs)("div",{className:"flex flex-col items-center gap-1 text-[10px] text-slate-500",children:[s&&(0,h.jsx)("span",{children:s.total}),null!==r&&(0,h.jsxs)("span",{children:[r,"%"]})]})]})}let oX=[{key:"trust",label:"Trust",icon:o_,color:"text-blue-400",bg:"bg-blue-400/10"},{key:"firewall",label:"Firewall",icon:o$("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]),color:"text-orange-400",bg:"bg-orange-400/10"},{key:"sensitivity",label:"Sensitivity",icon:o$("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),color:"text-purple-400",bg:"bg-purple-400/10"},{key:"fragmentation",label:"Fragment",icon:o$("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),color:"text-cyan-400",bg:"bg-cyan-400/10"},{key:"audit",label:"Audit",icon:oB,color:"text-green-400",bg:"bg-green-400/10"}];function oY({timeRange:e}){let{projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oD(e,t||void 0);return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Defence Pipeline"}),(0,h.jsx)("div",{className:"flex items-center gap-1 mb-4",children:oX.map(({key:e,label:t,icon:s,color:i,bg:r},n)=>(0,h.jsxs)("div",{className:"flex items-center",children:[(0,h.jsxs)("div",{className:`flex items-center gap-1.5 px-3 py-2 rounded-lg ${r}`,children:[(0,h.jsx)(s,{size:14,className:i}),(0,h.jsx)("span",{className:`text-xs font-medium ${i}`,children:t})]}),n<oX.length-1&&(0,h.jsx)("div",{className:"w-4 h-px bg-slate-700 mx-0.5"})]},e))}),i?(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading stats..."}):r?(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"}):s?(0,h.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-green-400",children:s.allowedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Allowed"})]}),(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-red-400",children:s.blockedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Blocked"})]}),(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-yellow-400",children:s.quarantinedCount}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Quarantined"})]})]}):(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No data"}),(0,h.jsxs)("div",{className:"mt-4 pt-3 border-t border-slate-800 flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-500",children:"Firewall Mode"}),(0,h.jsx)("span",{className:"text-xs font-medium text-cyan-400 bg-cyan-400/10 px-2 py-0.5 rounded",children:"balanced"})]})]})}function oG(){let{setViewMode:e,projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oL("pending",3,t||void 0),n=s?.total??0,a=s?.items??[];return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300",children:"Quarantine Queue"}),n>0&&(0,h.jsxs)("span",{className:"text-xs font-medium text-yellow-400 bg-yellow-400/10 px-2 py-0.5 rounded-full",children:[n," pending"]})]}),i?(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."}):r?(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load quarantine"}):0===a.length?(0,h.jsxs)("div",{className:"flex flex-col items-center py-6 text-slate-500",children:[(0,h.jsx)(oz,{size:24,className:"mb-2 text-slate-600"}),(0,h.jsx)("span",{className:"text-xs",children:"No items in quarantine"})]}):(0,h.jsx)("div",{className:"space-y-2",children:a.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,h.jsxs)("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-3",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between",children:[(0,h.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,h.jsx)("div",{className:"text-xs font-medium text-white truncate",children:e.title||"Untitled"}),(0,h.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleTimeString()]})]}),(0,h.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-1.5 py-0.5 rounded shrink-0 ml-2",children:e.reason?.slice(0,30)||"Threat detected"})]}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mt-1.5 flex-wrap",children:t.slice(0,3).map((e,t)=>(0,h.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1 py-0.5 rounded",children:e},t))})]},e.id)})}),n>0&&(0,h.jsxs)("button",{onClick:()=>e("quarantine"),className:"w-full mt-3 text-xs text-cyan-400 hover:text-cyan-300 transition-colors",children:["Review all ",n," items →"]})]})}function oZ({timeRange:e}){let{projectFilter:t}=as(),s={"24h":24,"7d":168,"30d":720},{data:i,isLoading:r,isError:n}=oR({startTime:(0,m.useMemo)(()=>new Date(6e4*Math.floor((Date.now()-36e5*s[e])/6e4)).toISOString(),[e]),project:t||void 0,limit:500}),a=(0,m.useMemo)(()=>{if(!i?.logs.length)return[];let t="24h"===e?36e5:"7d"===e?216e5:864e5,s="24h"===e?24:"7d"===e?28:30,r=Date.now(),n=Array.from({length:s},(e,i)=>({time:r-(s-1-i)*t,allowed:0,blocked:0,quarantined:0}));for(let e of i.logs){let i=Math.floor((new Date(e.timestamp).getTime()-(r-s*t))/t),a=Math.min(Math.max(i,0),s-1);i>=0&&i<=s&&("ALLOW"===e.firewall_result?n[a].allowed++:"BLOCK"===e.firewall_result?n[a].blocked++:"QUARANTINE"===e.firewall_result&&n[a].quarantined++)}return n},[i,e]),o=Math.max(1,...a.map(e=>e.allowed+e.blocked+e.quarantined));return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Threat Timeline"}),r?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading timeline..."})}):n?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load timeline"})}):0===a.length?(0,h.jsx)("div",{className:"h-32 flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No audit data"})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"flex gap-px h-32",children:a.map((e,t)=>{let s=e.allowed+e.blocked+e.quarantined,i=s>0?e.blocked/s*100:0,r=s>0?e.quarantined/s*100:0;return(0,h.jsx)("div",{className:"flex-1 flex flex-col justify-end",title:`${new Date(e.time).toLocaleString()}: ${e.allowed} allowed, ${e.blocked} blocked, ${e.quarantined} quarantined`,children:(0,h.jsx)("div",{className:"w-full rounded-t-sm overflow-hidden",style:{height:`${Math.max(s/o*100,2*(s>0))}%`},children:(0,h.jsxs)("div",{className:"w-full h-full flex flex-col-reverse",children:[e.blocked>0&&(0,h.jsx)("div",{className:"bg-red-500",style:{height:`${i}%`}}),e.quarantined>0&&(0,h.jsx)("div",{className:"bg-yellow-500",style:{height:`${r}%`}}),(0,h.jsx)("div",{className:"bg-emerald-500/60 flex-1"})]})})},t)})}),(0,h.jsxs)("div",{className:"flex gap-4 mt-3 justify-center",children:[(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-emerald-500/60"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Allowed"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-red-500"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Blocked"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-yellow-500"}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:"Quarantined"})]})]})]})]})}function oJ({timeRange:e}){let{projectFilter:t}=as(),{data:s,isLoading:i,isError:r}=oD(e,t||void 0);if(i)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading..."})]});if(r)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-red-400",children:"Failed to load stats"})]});if(!s)return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No data"})]});let n=s.totalOperations||1,a=(s.blockedCount/n*100).toFixed(1),o=Object.entries(s.threatBreakdown||{}).sort((e,t)=>t[1]-e[1]).slice(0,5);return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsx)("h3",{className:"text-sm font-medium text-slate-300 mb-4",children:"Stats Summary"}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,h.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,h.jsx)("div",{className:"text-2xl font-bold text-white",children:s.totalOperations}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Total Scans"})]}),(0,h.jsxs)("div",{className:"bg-slate-800/50 rounded-lg p-3 text-center",children:[(0,h.jsxs)("div",{className:`text-2xl font-bold ${parseFloat(a)>10?"text-red-400":"text-green-400"}`,children:[a,"%"]}),(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase",children:"Block Rate"})]})]}),s.topSources.length>0&&(0,h.jsxs)("div",{className:"mb-4",children:[(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Top Sources"}),(0,h.jsx)("div",{className:"space-y-1",children:s.topSources.slice(0,3).map(e=>(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:e.source}),(0,h.jsx)("span",{className:"text-xs text-slate-500",children:e.count})]},e.source))})]}),o.length>0&&(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"text-[10px] text-slate-500 uppercase mb-2",children:"Threat Types"}),(0,h.jsx)("div",{className:"space-y-1",children:o.map(([e,t])=>(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:e}),(0,h.jsx)("span",{className:"text-xs font-medium text-red-400",children:t})]},e))})]})]})}function o0(){let[e,t]=(0,m.useState)("24h");return(0,h.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Defence Overview"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(s=>(0,h.jsx)("button",{onClick:()=>t(s),className:`px-3 py-1 text-xs rounded-md transition-colors ${e===s?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:s},s))})]}),(0,h.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,h.jsx)(oY,{timeRange:e}),(0,h.jsx)(oG,{}),(0,h.jsx)(oZ,{timeRange:e}),(0,h.jsx)(oJ,{timeRange:e})]})]})}let o1={ALLOW:"bg-green-500/10 text-green-400",BLOCK:"bg-red-500/10 text-red-400",QUARANTINE:"bg-yellow-500/10 text-yellow-400"};function o2(){let{projectFilter:e}=as(),[t,s]=(0,m.useState)("24h"),[i,r]=(0,m.useState)(void 0),[n,a]=(0,m.useState)(void 0),o={"24h":24,"7d":168,"30d":720},{data:l,isLoading:c}=oR({startTime:(0,m.useMemo)(()=>new Date(6e4*Math.floor((Date.now()-36e5*o[t])/6e4)).toISOString(),[t]),source:i,firewallResult:n,project:e||void 0,limit:200}),d=l?.logs??[];return(0,h.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,h.jsxs)("div",{className:"p-4 border-b border-slate-800 shrink-0",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Audit Log"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(e=>(0,h.jsx)("button",{onClick:()=>s(e),className:`px-3 py-1 text-xs rounded-md transition-colors ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsxs)("select",{value:n||"",onChange:e=>a(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,h.jsx)("option",{value:"",children:"All Results"}),(0,h.jsx)("option",{value:"ALLOW",children:"Allowed"}),(0,h.jsx)("option",{value:"BLOCK",children:"Blocked"}),(0,h.jsx)("option",{value:"QUARANTINE",children:"Quarantined"})]}),(0,h.jsxs)("select",{value:i||"",onChange:e=>r(e.target.value||void 0),className:"bg-slate-800 border border-slate-700 text-white text-xs rounded-lg px-2 py-1",children:[(0,h.jsx)("option",{value:"",children:"All Sources"}),(0,h.jsx)("option",{value:"hook",children:"Hook"}),(0,h.jsx)("option",{value:"api",children:"API"}),(0,h.jsx)("option",{value:"agent",children:"Agent"}),(0,h.jsx)("option",{value:"user",children:"User"}),(0,h.jsx)("option",{value:"cli",children:"CLI"})]}),(0,h.jsxs)("span",{className:"text-xs text-slate-500 self-center ml-auto",children:[d.length," entries"]})]})]}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto",children:c?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading audit logs..."})}):0===d.length?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500",children:"No audit entries for this period"})}):(0,h.jsxs)("table",{className:"w-full text-xs",children:[(0,h.jsx)("thead",{className:"sticky top-0 bg-slate-900",children:(0,h.jsxs)("tr",{className:"border-b border-slate-800",children:[(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Time"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Source"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Result"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Trust"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Anomaly"}),(0,h.jsx)("th",{className:"text-left text-slate-500 font-medium px-4 py-2",children:"Reason"})]})}),(0,h.jsx)("tbody",{children:d.map(e=>(0,h.jsxs)("tr",{className:"border-b border-slate-800/50 hover:bg-slate-800/30",children:[(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400 whitespace-nowrap",children:new Date(e.timestamp).toLocaleString()}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-300",children:e.source_type}),(0,h.jsx)("td",{className:"px-4 py-2",children:(0,h.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${o1[e.firewall_result]||"text-slate-400"}`,children:e.firewall_result})}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400",children:e.trust_score.toFixed(1)}),(0,h.jsx)("td",{className:"px-4 py-2",children:(0,h.jsx)("span",{className:e.anomaly_score>.5?"text-red-400":e.anomaly_score>.2?"text-yellow-400":"text-slate-400",children:e.anomaly_score.toFixed(2)})}),(0,h.jsx)("td",{className:"px-4 py-2 text-slate-400 max-w-xs truncate",children:e.reason||"—"})]},e.id))})]})})]})}let o4=o$("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),o5=o$("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function o3({action:e,item:t,onConfirm:s,onCancel:i}){let[r,n]=(0,m.useState)(""),a="yes"===r.trim().toLowerCase();return(0,h.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-700 rounded-xl p-6 max-w-md w-full mx-4",children:[(0,h.jsxs)("h3",{className:"text-sm font-semibold text-white mb-2",children:["approve"===e?"Approve":"Reject"," quarantined item?"]}),(0,h.jsx)("p",{className:"text-xs text-slate-400 mb-1",children:(0,h.jsx)("strong",{children:t.title||"Untitled"})}),(0,h.jsx)("p",{className:"text-xs text-slate-500 mb-4",children:"approve"===e?"This will store the memory in the database.":"This will permanently discard the memory."}),(0,h.jsxs)("div",{className:"mb-4",children:[(0,h.jsxs)("label",{className:"text-xs text-slate-400 block mb-1",children:["Type ",(0,h.jsx)("strong",{className:"text-white",children:"YES"})," to confirm:"]}),(0,h.jsx)("input",{type:"text",value:r,onChange:e=>n(e.target.value),className:"w-full bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-2 focus:ring-cyan-500 focus:border-cyan-500",autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&a&&s(),"Escape"===e.key&&i()}})]}),(0,h.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,h.jsx)("button",{onClick:i,className:"px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors",children:"Cancel"}),(0,h.jsx)("button",{onClick:s,disabled:!a,className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${a?"approve"===e?"bg-green-600 text-white hover:bg-green-500":"bg-red-600 text-white hover:bg-red-500":"bg-slate-700 text-slate-500 cursor-not-allowed"}`,children:"approve"===e?"Approve":"Reject"})]})]})})}function o6(){let e,t,{projectFilter:s}=as(),[i,r]=(0,m.useState)("pending"),{data:n,isLoading:a}=oL(i,100,s||void 0),o=(e=(0,nU.useQueryClient)(),nG({mutationFn:oA,onSuccess:()=>{e.invalidateQueries({queryKey:["quarantine"]}),e.invalidateQueries({queryKey:["audit-stats"]})}})),l=(t=(0,nU.useQueryClient)(),nG({mutationFn:({id:e,notes:t})=>oE(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["quarantine"]}),t.invalidateQueries({queryKey:["audit-stats"]})}})),[c,d]=(0,m.useState)(null),u=n?.items??[];return(0,h.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[c&&(0,h.jsx)(o3,{action:c.action,item:c.item,onConfirm:()=>{c&&("approve"===c.action?o.mutate(c.item.id):l.mutate({id:c.item.id}),d(null))},onCancel:()=>d(null)}),(0,h.jsx)("div",{className:"p-4 border-b border-slate-800 shrink-0",children:(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Quarantine Review"}),(0,h.jsx)("div",{className:"flex gap-1 bg-slate-800 rounded-lg p-0.5",children:["pending","approved","rejected"].map(e=>(0,h.jsx)("button",{onClick:()=>r(e),className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${i===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]})}),(0,h.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:a?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"text-xs text-slate-500 animate-pulse",children:"Loading quarantine items..."})}):0===u.length?(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-slate-500",children:[(0,h.jsx)(oz,{size:24,className:"mb-2 text-slate-600"}),(0,h.jsxs)("span",{className:"text-xs",children:["No ",i," items"]})]}):(0,h.jsx)("div",{className:"space-y-3",children:u.map(e=>{let t=(()=>{try{return JSON.parse(e.threat_indicators)}catch{return[]}})();return(0,h.jsxs)("div",{className:"bg-slate-900 border border-slate-800 rounded-xl p-4",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h4",{className:"text-sm font-medium text-white",children:e.title||"Untitled"}),(0,h.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0.5",children:[e.source_type," · ",new Date(e.created_at).toLocaleString(),e.anomaly_score>0&&(0,h.jsxs)("span",{className:`ml-2 ${e.anomaly_score>.5?"text-red-400":"text-yellow-400"}`,children:["Anomaly: ",e.anomaly_score.toFixed(2)]})]})]}),(0,h.jsx)("span",{className:"text-[10px] text-red-400 bg-red-400/10 px-2 py-0.5 rounded",children:e.reason?.slice(0,50)||"Threat detected"})]}),(0,h.jsx)("div",{className:"bg-slate-800/50 rounded-lg p-3 mb-3 text-xs text-slate-300 max-h-24 overflow-y-auto whitespace-pre-wrap",children:e.content?.slice(0,500)||"No content"}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mb-3 flex-wrap",children:t.map((e,t)=>(0,h.jsx)("span",{className:"text-[9px] text-yellow-400 bg-yellow-400/10 px-1.5 py-0.5 rounded",children:e},t))}),"pending"===e.status&&(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsxs)("button",{onClick:()=>d({action:"approve",item:e}),className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-green-600/10 text-green-400 rounded-lg hover:bg-green-600/20 transition-colors",children:[(0,h.jsx)(o4,{size:12})," Approve"]}),(0,h.jsxs)("button",{onClick:()=>d({action:"reject",item:e}),className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-red-600/10 text-red-400 rounded-lg hover:bg-red-600/20 transition-colors",children:[(0,h.jsx)(o5,{size:12})," Reject"]})]}),e.reviewed_at&&(0,h.jsxs)("div",{className:"text-[10px] text-slate-500",children:["approved"===e.status?"Approved":"Rejected"," by ",e.reviewed_by," at ",new Date(e.reviewed_at).toLocaleString()]})]},e.id)})})})]})}let o8=o$("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),o7=o$("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),o9=o$("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),le=p.default.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function lt(e,t){let s=new URLSearchParams({timeRange:e});t&&s.set("project",t);let i=await fetch(`${le}/api/v1/agents?${s}`);if(!i.ok)throw Error("Failed to fetch agent registry");return i.json()}async function ls(e,t,s){let i=encodeURIComponent(e),r=new URLSearchParams({timeRange:t});s&&r.set("project",s);let n=await fetch(`${le}/api/v1/agents/${i}/timeline?${r}`);if(!n.ok)throw Error("Failed to fetch agent timeline");return n.json()}async function li(e,t){let s=encodeURIComponent(e),i=new URLSearchParams;t?.limit&&i.set("limit",t.limit.toString()),t?.offset&&i.set("offset",t.offset.toString()),t?.firewallResult&&i.set("firewallResult",t.firewallResult),t?.project&&i.set("project",t.project);let r=await fetch(`${le}/api/v1/agents/${s}/operations?${i}`);if(!r.ok)throw Error("Failed to fetch agent operations");return r.json()}function lr(e,t){return nK({queryKey:["agent-operations",e,t],queryFn:()=>li(e,t),enabled:!!e,refetchInterval:3e4,retry:2})}function ln(e){return e>=.7?"full":e>=.5?"limited":"restricted"}let la={full:"text-green-400",limited:"text-yellow-400",restricted:"text-red-400"},lo={full:"bg-green-500/10",limited:"bg-yellow-500/10",restricted:"bg-red-500/10"},ll={full:"Full Access",limited:"Limited",restricted:"Restricted"},lc=460,ld=90;function lu({identifier:e,timeRange:t}){let{data:s,isLoading:i}=function(e,t="24h",s){return nK({queryKey:["agent-timeline",e,t,void 0],queryFn:()=>ls(e,t,void 0),enabled:!!e,refetchInterval:3e4,retry:2})}(e,t),r=s?.points??[],{linePath:n,dots:a,xLabels:o}=(0,m.useMemo)(()=>{if(0===r.length)return{linePath:"",dots:[],xLabels:[]};let e=r.map(e=>new Date(e.timestamp).getTime()),s=Math.min(...e),i=Math.max(...e)-s||1,n=e=>30+(e-s)/i*lc,a=e=>10+(1-e)*ld,o=r.map((t,s)=>{let i=n(e[s]),r=a(t.trust_score);return`${0===s?"M":"L"} ${i} ${r}`}),l=r.map((t,s)=>({x:n(e[s]),y:a(t.trust_score),result:t.firewall_result,score:t.trust_score,time:t.timestamp})).filter(e=>"ALLOW"!==e.result),c=Math.min(5,r.length),d=[];for(let e=0;e<c;e++){let r=s+i*e/(c-1||1),a=new Date(r);d.push({x:n(r),label:"24h"===t?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString([],{month:"short",day:"numeric"})})}return{linePath:o.join(" "),dots:l,xLabels:d}},[r,t]);return i?(0,h.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"Loading timeline..."}):0===r.length?(0,h.jsx)("div",{className:"h-[120px] flex items-center justify-center text-slate-500 text-xs",children:"No data for this time range."}):(0,h.jsxs)("svg",{viewBox:"0 0 500 120",className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[(0,h.jsx)("line",{x1:30,y1:10+(1-.7)*ld,x2:30+lc,y2:10+(1-.7)*ld,stroke:"#22c55e",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,h.jsx)("line",{x1:30,y1:10+.5*ld,x2:30+lc,y2:10+.5*ld,stroke:"#eab308",strokeWidth:"0.5",strokeDasharray:"4 2",opacity:"0.3"}),(0,h.jsx)("text",{x:26,y:10+(1-.7)*ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.7"}),(0,h.jsx)("text",{x:26,y:10+.5*ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.5"}),(0,h.jsx)("text",{x:26,y:13,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"1.0"}),(0,h.jsx)("text",{x:26,y:10+ld+3,fill:"#64748b",fontSize:"8",textAnchor:"end",children:"0.0"}),(0,h.jsx)("path",{d:n,fill:"none",stroke:"#06b6d4",strokeWidth:"1.5"}),a.map((e,t)=>(0,h.jsx)("circle",{cx:e.x,cy:e.y,r:"3",fill:"BLOCK"===e.result?"#ef4444":"#eab308",stroke:"#0f172a",strokeWidth:"1",children:(0,h.jsx)("title",{children:`${e.result} — trust: ${e.score.toFixed(2)} — ${new Date(e.time).toLocaleString()}`})},t)),o.map((e,t)=>(0,h.jsx)("text",{x:e.x,y:116,fill:"#64748b",fontSize:"8",textAnchor:"middle",children:e.label},t))]})}let lh={BLOCK:"text-red-400 bg-red-500/10",QUARANTINE:"text-yellow-400 bg-yellow-500/10"};function lm({identifier:e}){let{data:t,isLoading:s}=lr(e,{firewallResult:"BLOCK",limit:20}),{data:i}=lr(e,{firewallResult:"QUARANTINE",limit:20}),r=[...t?.entries??[],...i?.entries??[]].sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime());return s?(0,h.jsx)("div",{className:"text-slate-500 text-xs",children:"Loading..."}):0===r.length?(0,h.jsx)("div",{className:"text-slate-500 text-xs",children:"No flagged operations."}):(0,h.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto",children:r.map(e=>{let t=[];try{t=JSON.parse(e.threat_indicators)}catch{}return(0,h.jsxs)("div",{className:"px-2 py-1.5 rounded bg-slate-800/50 border border-slate-800",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:`px-1 py-0.5 rounded text-[10px] font-medium ${lh[e.firewall_result]??"text-slate-400"}`,children:e.firewall_result}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),e.reason&&(0,h.jsx)("p",{className:"text-[11px] text-slate-400 mt-0.5 truncate",children:e.reason}),t.length>0&&(0,h.jsx)("div",{className:"flex gap-1 mt-1 flex-wrap",children:t.map((e,t)=>(0,h.jsx)("span",{className:"px-1 py-0.5 rounded text-[9px] bg-red-500/10 text-red-400",children:e},t))}),(0,h.jsxs)("div",{className:"flex gap-3 mt-1 text-[10px] text-slate-500",children:[(0,h.jsxs)("span",{children:["Trust: ",e.trust_score.toFixed(2)]}),(0,h.jsxs)("span",{children:["Anomaly: ",e.anomaly_score.toFixed(2)]}),null!==e.pipeline_duration_ms&&(0,h.jsxs)("span",{children:[e.pipeline_duration_ms,"ms"]})]})]},e.id)})})}let lp=o$("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),lf=p.default.env.NEXT_PUBLIC_WS_URL||"ws://localhost:3001/ws/events";function lx({agentFilter:e}){let[t,s]=(0,m.useState)([]),i=(0,m.useRef)(0),r=(0,m.useRef)(null),n=(0,m.useCallback)(t=>{try{let r=JSON.parse(t.data);if("defence_event"!==r.type)return;let n=r.data;if(e&&n.source_identifier!==e)return;s(e=>[{...n,id:++i.current},...e].slice(0,50))}catch{}},[e]);return((0,m.useEffect)(()=>{try{let e=new WebSocket(lf);return r.current=e,e.onmessage=n,e.onerror=()=>{},()=>{e.close(),r.current=null}}catch{return}},[n]),0===t.length)?(0,h.jsxs)("div",{className:"flex items-center gap-2 text-slate-500 text-xs py-2",children:[(0,h.jsx)(lp,{size:12}),(0,h.jsx)("span",{children:"Listening for defence events..."})]}):(0,h.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:(0,h.jsx)(R,{initial:!1,children:t.map(e=>(0,h.jsxs)(nM.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},className:`px-2 py-1.5 rounded border text-xs ${"BLOCK"===e.firewall_result?"bg-red-500/5 border-red-500/20":"bg-yellow-500/5 border-yellow-500/20"}`,children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("span",{className:`font-medium ${"BLOCK"===e.firewall_result?"text-red-400":"text-yellow-400"}`,children:e.firewall_result}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:new Date(e.timestamp).toLocaleTimeString()})]}),(0,h.jsxs)("p",{className:"text-slate-400 text-[11px] truncate mt-0.5",children:[e.source_identifier," — ",e.reason??"No reason"]})]},e.id))})})}function lg({identifier:e,compact:t}){let s=e.split(">").map(e=>e.trim());return 1===s.length?(0,h.jsx)("span",{className:"font-mono text-sm text-white",children:e}):t?(0,h.jsxs)("span",{className:"font-mono text-sm",children:[(0,h.jsxs)("span",{className:"text-slate-500",children:[s.slice(0,-1).join(" › ")," › "]}),(0,h.jsx)("span",{className:"text-white",children:s[s.length-1]})]}):(0,h.jsx)("div",{className:"font-mono text-sm",children:s.map((e,t)=>(0,h.jsxs)("span",{children:[t>0&&(0,h.jsx)(o9,{size:12,className:"inline text-slate-600 mx-0.5"}),(0,h.jsx)("span",{className:t===s.length-1?"text-white":"text-slate-500",children:e})]},t))})}function ly({score:e}){let t=ln(e);return(0,h.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium ${la[t]} ${lo[t]}`,children:[e.toFixed(2)," · ",ll[t]]})}function lv({type:e}){let t={agent:"text-purple-400 bg-purple-500/10",cli:"text-cyan-400 bg-cyan-500/10",user:"text-green-400 bg-green-500/10",hook:"text-blue-400 bg-blue-500/10",api:"text-orange-400 bg-orange-500/10",web:"text-red-400 bg-red-500/10",file:"text-slate-400 bg-slate-500/10",email:"text-yellow-400 bg-yellow-500/10"}[e]??"text-slate-400 bg-slate-500/10";return(0,h.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${t}`,children:e})}function lb(){let{projectFilter:e}=as(),[t,s]=(0,m.useState)("24h"),[i,r]=(0,m.useState)(null),[n,a]=(0,m.useState)("operation_count"),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),[u,p]=(0,m.useState)(null),[f,x]=(0,m.useState)(!1),{data:g,isLoading:y}=function(e="24h",t){return nK({queryKey:["agents",e,t],queryFn:()=>lt(e,t),refetchInterval:3e4,retry:2})}(t,e??void 0),v=g?.agents??[],b=(0,m.useMemo)(()=>{let e=v;return c&&(e=e.filter(e=>e.source_type===c)),u&&(e=e.filter(e=>ln(e.avg_trust_score)===u)),f&&(e=e.filter(e=>e.flagged_count>0)),e},[v,c,u,f]),w=(0,m.useMemo)(()=>{let e=[...b];return e.sort((e,t)=>{let s=e[n],i=t[n];return"string"==typeof s&&"string"==typeof i?o?s.localeCompare(i):i.localeCompare(s):o?s-i:i-s}),e},[b,n,o]),j=(0,m.useMemo)(()=>[...new Set(v.map(e=>e.source_type))],[v]),k=e=>{n===e?l(!o):(a(e),l(!1))};return(0,h.jsxs)("div",{className:"flex h-full",children:[(0,h.jsxs)("div",{className:`${i?"w-1/2":"w-full"} border-r border-slate-800 flex flex-col`,children:[(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800 flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(oQ,{size:16,className:"text-cyan-400"}),(0,h.jsx)("h2",{className:"text-sm font-medium text-white",children:"Agent Registry"}),(0,h.jsxs)("span",{className:"text-xs text-slate-500",children:[w.length," agents"]})]}),(0,h.jsx)("div",{className:"flex gap-1",children:["24h","7d","30d"].map(e=>(0,h.jsx)("button",{onClick:()=>s(e),className:`px-2 py-0.5 text-[10px] rounded transition-colors ${t===e?"bg-cyan-600 text-white":"text-slate-400 hover:text-white"}`,children:e},e))})]}),(0,h.jsxs)("div",{className:"px-3 py-2 border-b border-slate-800 flex items-center gap-2 flex-wrap",children:[(0,h.jsx)(o8,{size:12,className:"text-slate-500"}),j.map(e=>(0,h.jsx)("button",{onClick:()=>d(c===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${c===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,h.jsx)("span",{className:"text-slate-700",children:"|"}),["full","limited","restricted"].map(e=>(0,h.jsx)("button",{onClick:()=>p(u===e?null:e),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors ${u===e?"bg-cyan-600/20 text-cyan-400":"text-slate-500 hover:text-slate-300"}`,children:e},e)),(0,h.jsx)("span",{className:"text-slate-700",children:"|"}),(0,h.jsxs)("button",{onClick:()=>x(!f),className:`px-1.5 py-0.5 text-[10px] rounded transition-colors flex items-center gap-0.5 ${f?"bg-red-600/20 text-red-400":"text-slate-500 hover:text-slate-300"}`,children:[(0,h.jsx)(oz,{size:10})," flagged"]})]}),(0,h.jsxs)("div",{className:"px-3 py-1.5 border-b border-slate-800 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 text-[10px] text-slate-500",children:[(0,h.jsx)("span",{children:"Agent"}),(0,h.jsxs)("button",{onClick:()=>k("avg_trust_score"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Trust ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("operation_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Ops ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("flagged_count"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Flagged ",(0,h.jsx)(o7,{size:8})]}),(0,h.jsxs)("button",{onClick:()=>k("last_seen"),className:"flex items-center gap-0.5 hover:text-slate-300",children:["Last seen ",(0,h.jsx)(o7,{size:8})]})]}),(0,h.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[y&&(0,h.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"Loading agents..."}),!y&&0===w.length&&(0,h.jsx)("div",{className:"p-4 text-center text-slate-500 text-xs",children:"No agents found in this time range."}),w.map(e=>{var t;let s,n=i?.source_identifier===e.source_identifier&&i?.source_type===e.source_type;return(0,h.jsxs)("button",{onClick:()=>r(n?null:e),className:`w-full px-3 py-2 grid grid-cols-[1fr_80px_60px_60px_70px] gap-2 items-center text-left transition-colors border-b border-slate-800/50 ${n?"bg-cyan-600/10":"hover:bg-slate-800/50"}`,children:[(0,h.jsxs)("div",{className:"min-w-0",children:[(0,h.jsx)(lg,{identifier:e.source_identifier,compact:!0}),(0,h.jsx)("div",{className:"mt-0.5",children:(0,h.jsx)(lv,{type:e.source_type})})]}),(0,h.jsx)(ly,{score:e.avg_trust_score}),(0,h.jsx)("span",{className:"text-xs text-slate-300 tabular-nums",children:e.operation_count}),(0,h.jsx)("span",{className:`text-xs tabular-nums ${e.flagged_count>0?"text-red-400":"text-slate-500"}`,children:e.flagged_count}),(0,h.jsx)("span",{className:"text-[10px] text-slate-500",children:(t=e.last_seen,(s=Date.now()-new Date(t).getTime())<6e4?"just now":s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`)})]},`${e.source_type}:${e.source_identifier}`)})]})]}),(0,h.jsx)(R,{children:i&&(0,h.jsxs)(nM.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"w-1/2 flex flex-col overflow-y-auto",children:[(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)(lg,{identifier:i.source_identifier}),(0,h.jsx)("button",{onClick:()=>r(null),className:"text-slate-500 hover:text-white text-xs",children:"Close"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,h.jsx)(lv,{type:i.source_type}),(0,h.jsx)(ly,{score:i.avg_trust_score}),(0,h.jsxs)("span",{className:"text-[10px] text-slate-500",children:[i.operation_count," ops · ",i.flagged_count," flagged"]})]})]}),(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Trust Score Timeline"}),(0,h.jsx)(lu,{identifier:i.source_identifier,timeRange:t})]}),(0,h.jsxs)("div",{className:"p-3 border-b border-slate-800",children:[(0,h.jsxs)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:["Flagged Operations",i.flagged_count>0&&(0,h.jsxs)("span",{className:"ml-1 text-red-400",children:["(",i.flagged_count,")"]})]}),(0,h.jsx)(lm,{identifier:i.source_identifier})]}),(0,h.jsxs)("div",{className:"p-3",children:[(0,h.jsx)("h3",{className:"text-xs font-medium text-slate-400 mb-2",children:"Live Alerts"}),(0,h.jsx)(lx,{agentFilter:i.source_identifier})]})]})})]})}function lw({className:e,type:t,...s}){return(0,h.jsx)("input",{type:t,"data-slot":"input",className:oi("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}let lj=(0,nA.default)(()=>e.A(1369),{loadableGenerated:{modules:[11570]},ssr:!1,loading:()=>(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading Graph..."})})}),lk=(0,nA.default)(()=>e.A(94049).then(e=>e.BrainScene),{loadableGenerated:{modules:[57754]},ssr:!1,loading:()=>(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-950",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading 3D Brain..."})})});function lS(){var e,t;let s,i,r,n,a,o,l,[c,d]=(0,m.useState)(""),[u,p]=(0,m.useState)(!1),[f,x]=(0,m.useState)(!1),[g,y]=(0,m.useState)(void 0),[v,b]=(0,m.useState)(void 0),w=(0,m.useRef)(null),j=(0,m.useRef)(null),k=ai(c,300),{viewMode:S,selectedMemory:N,setSelectedMemory:T,projectFilter:C,setProjectFilter:P}=as(),{data:M=[]}=nK({queryKey:["suggestions",s=ai(c,200)],queryFn:()=>an(s),enabled:s.length>=2,staleTime:3e4,refetchOnWindowFocus:!1}),{data:A}=nK({queryKey:["projects"],queryFn:n4,refetchInterval:6e4});(0,m.useEffect)(()=>{let e=e=>{j.current&&!j.current.contains(e.target)&&w.current&&!w.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let{data:E=[],isLoading:D,isConnected:L}=(e={limit:200,query:k||void 0,mode:k?"search":"recent",project:C||void 0,type:g,category:v},i=(0,nZ.useMemoryWebSocket)(),{...{...r=nK({queryKey:["memories",e],queryFn:()=>n0(e),refetchInterval:3e4}),data:r.data?.memories,pagination:r.data?.pagination},isConnected:i.isConnected,lastEvent:i.lastEvent}),{data:V,isLoading:F}=n6(C||void 0),{data:O=[]}=nK({queryKey:["links",t=C||void 0],queryFn:()=>n2(t),refetchInterval:6e4}),I=(n=(0,nU.useQueryClient)(),nG({mutationFn:n5,onSuccess:()=>{n.invalidateQueries({queryKey:["memories"]}),n.invalidateQueries({queryKey:["stats"]})}}));a=(0,nU.useQueryClient)(),nG({mutationFn:n3,onSuccess:()=>{a.invalidateQueries({queryKey:["memories"]}),a.invalidateQueries({queryKey:["stats"]})}});let{data:$}=nK({queryKey:["control-status"],queryFn:n8,refetchInterval:1e4});o=(0,nU.useQueryClient)(),nG({mutationFn:n7,onSuccess:()=>{o.invalidateQueries({queryKey:["control-status"]})}}),l=(0,nU.useQueryClient)(),nG({mutationFn:n9,onSuccess:()=>{l.invalidateQueries({queryKey:["control-status"]})}});let _=$?.paused??!1,B=e=>{T(e)},z="shield"===S||"audit"===S||"quarantine"===S||"agents"===S;return(0,h.jsxs)("div",{className:"h-screen w-screen bg-slate-950 text-white overflow-hidden flex flex-col",children:[(0,h.jsxs)("header",{className:"h-14 border-b border-slate-800 flex items-center justify-between px-4 bg-slate-900/50 backdrop-blur-sm shrink-0",children:[(0,h.jsxs)("div",{className:"flex items-center gap-4",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(o_,{size:20,className:"text-cyan-400"}),(0,h.jsx)("h1",{className:"text-xl font-bold bg-gradient-to-r from-cyan-400 via-blue-400 to-emerald-400 bg-clip-text text-transparent",children:"ShieldCortex"})]}),(0,h.jsx)("select",{value:C||"",onChange:e=>P(e.target.value||null),className:"bg-slate-800 border border-slate-700 text-white text-sm rounded-lg px-3 py-1.5 focus:ring-cyan-500 focus:border-cyan-500",children:A?.projects.map(e=>(0,h.jsxs)("option",{value:e.project||"",children:[e.label," (",e.memory_count,")"]},e.project||"all"))}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)(lw,{ref:w,type:"text",placeholder:"Search memories...",value:c,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:e=>{"Escape"===e.key&&p(!1)},className:"w-64 bg-slate-800 border-slate-700 text-white placeholder:text-slate-400 focus:ring-cyan-500"}),u&&M.length>0&&(0,h.jsx)("div",{ref:j,className:"absolute top-full left-0 right-0 mt-1 bg-slate-800 border border-slate-700 rounded-lg shadow-xl overflow-hidden z-50",children:M.map((e,t)=>(0,h.jsxs)("button",{onClick:()=>{d(e.text),p(!1),w.current?.focus()},className:"w-full px-3 py-2 text-left hover:bg-slate-700 transition-colors flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-white text-sm truncate flex-1",children:e.text}),(0,h.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-slate-600 text-slate-300",children:e.type})]},`${e.type}-${e.text}-${t}`))})]}),(0,h.jsxs)(og,{variant:"outline",size:"sm",onClick:()=>x(!f),className:`border-slate-600 text-slate-300 hover:text-white hover:bg-slate-700 ${f?"bg-slate-700":""}`,title:"Filter memories by type and category",children:["Filters ",(g||v)&&"•"]})]}),(0,h.jsx)("div",{className:"flex items-center gap-2",children:(0,h.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-400 px-2",children:[(0,h.jsx)("span",{className:`w-2 h-2 rounded-full ${_?"bg-orange-500 animate-pulse":L?"bg-green-500":"bg-yellow-500"}`,title:_?"Memory creation paused":L?"Real-time connected":"Polling mode"}),V?.total??E.length," memories"]})})]}),f&&(0,h.jsxs)("div",{className:"h-12 border-b border-slate-800 flex items-center gap-4 px-4 bg-slate-900/30",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Type:"}),["short_term","long_term","episodic"].map(e=>(0,h.jsx)("button",{onClick:()=>y(g===e?void 0:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${g===e?"bg-blue-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e.replace("_","-")},e))]}),(0,h.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("span",{className:"text-xs text-slate-400",children:"Category:"}),["architecture","pattern","error","learning","preference","context"].map(e=>(0,h.jsx)("button",{onClick:()=>b(v===e?void 0:e),className:`px-2 py-1 text-xs rounded-full transition-colors ${v===e?"bg-purple-600 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:e},e))]}),(g||v)&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"w-px h-6 bg-slate-700"}),(0,h.jsx)("button",{onClick:()=>{y(void 0),b(void 0)},className:"px-2 py-1 text-xs text-red-400 hover:text-red-300",children:"Clear all"})]})]}),(0,h.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,h.jsx)(oH,{}),(0,h.jsx)(R,{mode:"wait",children:(0,h.jsxs)(nM.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"flex-1 relative overflow-hidden",children:["shield"===S&&(0,h.jsx)(o0,{}),"audit"===S&&(0,h.jsx)(o2,{}),"quarantine"===S&&(0,h.jsx)(o6,{}),"brain"===S&&(D?(0,h.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,h.jsx)("div",{className:"text-slate-400 animate-pulse",children:"Loading memories..."})}):(0,h.jsx)(lk,{memories:E,links:O,selectedMemory:N,onSelectMemory:B})),"graph"===S&&(0,h.jsx)(lj,{memories:E,links:O,selectedMemory:N,onSelectMemory:B}),"agents"===S&&(0,h.jsx)(lb,{}),"memories"===S&&(0,h.jsx)(oN,{memories:E,selectedMemory:N,onSelectMemory:B})]},S)}),N&&!z&&(0,h.jsx)("div",{className:"w-80 border-l border-slate-800 overflow-y-auto shrink-0",children:(0,h.jsx)(ow,{memory:N,links:O,memories:E,onClose:()=>T(null),onReinforce:e=>{I.mutate(e)},onSelectMemory:e=>{let t=E.find(t=>t.id===e);t&&T(t)},isReinforcing:I.isPending,reinforceSuccess:I.isSuccess})})]})]})}e.s(["default",()=>lS],23733)}]);
|