@cuongtran001/kanna 1.71.0 → 1.71.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{BoardsPage-CwmfG7r7.js → BoardsPage-DudYbDyu.js} +1 -1
- package/dist/client/assets/{BoardsRoutePage-CEqcmgEs.js → BoardsRoutePage-DUvJAyzh.js} +1 -1
- package/dist/client/assets/{ChatPage-CDYlmvTh.js → ChatPage-ChFKw7nK.js} +6 -6
- package/dist/client/assets/{CronJobRow-Clz1CMaP.js → CronJobRow-DU1RtrCs.js} +1 -1
- package/dist/client/assets/{CronJobsPage-Cp2ljuzG.js → CronJobsPage-cjH7p3lh.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-Dz2nMmpT.js → FilePreviewSheet-wcpWIb90.js} +1 -1
- package/dist/client/assets/{FlowSurface-D8jEIDTL.js → FlowSurface-Doyyct0h.js} +1 -1
- package/dist/client/assets/{GenUIBlock-wR_ASBOI.js → GenUIBlock-D-TBN4Um.js} +2 -2
- package/dist/client/assets/{KannaSocketProvider-CjyunR2e.js → KannaSocketProvider-uWU6WkNo.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-BSEd-eik.js → LocalProjectsPage-D8V8a3WM.js} +1 -1
- package/dist/client/assets/{SettingsPage-lO0j29v6.js → SettingsPage-CiCU3nka.js} +1 -1
- package/dist/client/assets/{StackBoardsRoutePage-Bln20SrZ.js → StackBoardsRoutePage-DDvdmA3Y.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-BU_kRKSX.js → ToolCallMessage-CHJSiauG.js} +1 -1
- package/dist/client/assets/{VChartSurface-DGt2rY1C.js → VChartSurface-DVRoAi5e.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-5x1x5lh7.js → WorkflowsPage-LwL034ZP.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-qmqlEagS.js → WorkflowsSection-HlGaR0pJ.js} +1 -1
- package/dist/client/assets/{chart-renderer-B4RB_Vl1.js → chart-renderer-BZXJQWtw.js} +1 -1
- package/dist/client/assets/{chatSounds-o52bjGQP.js → chatSounds-BNvUSPAi.js} +1 -1
- package/dist/client/assets/chevron-left-FnMbL2tA.js +1 -0
- package/dist/client/assets/{clipboard.adapter-BvGCjfPV.js → clipboard.adapter-CIRv1YNb.js} +1 -1
- package/dist/client/assets/{columnStyle-Drcf36na.js → columnStyle-mS8DKLCV.js} +1 -1
- package/dist/client/assets/{copyFeedbackStore-FlVcAL_c.js → copyFeedbackStore-DHAfKV4i.js} +1 -1
- package/dist/client/assets/{createScopedStore-D5Oag_wd.js → createScopedStore-or82_bxr.js} +1 -1
- package/dist/client/assets/{dist-u3-1WIv4.js → dist-Cvh6FEf5.js} +1 -1
- package/dist/client/assets/{ellipsis-EuMuTlhJ.js → ellipsis-CWiRFysC.js} +1 -1
- package/dist/client/assets/{flow-kinds-BzdVFTwx.js → flow-kinds-Digyo6AB.js} +1 -1
- package/dist/client/assets/{folder-ByOaA11q.js → folder-CnSb5m9v.js} +1 -1
- package/dist/client/assets/{formatDuration-B6E9KTDu.js → formatDuration-DsrNkArK.js} +1 -1
- package/dist/client/assets/{genui-BnrsDpVz.js → genui-BagNQVNI.js} +1 -1
- package/dist/client/assets/{globe-BqmhnccZ.js → globe-tc_9UiU3.js} +1 -1
- package/dist/client/assets/{host-2KzofXms.js → host-C7I7nFuH.js} +1 -1
- package/dist/client/assets/index-D9OYZjb7.js +26 -0
- package/dist/client/assets/{info-BcTChXV5.js → info-CgLDBnLR.js} +1 -1
- package/dist/client/assets/{input-Pqq9209u.js → input-BaAZ4OHy.js} +1 -1
- package/dist/client/assets/{lexicalToReact-w1LjYOTM.js → lexicalToReact-ClgTGbzM.js} +3 -3
- package/dist/client/assets/{log-OCZfBFFe.js → log-Ch_SNBXH.js} +1 -1
- package/dist/client/assets/{monitor-fn5oGNs1.js → monitor-fFRMWd1S.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-2ldF8rQh.js → pendingActionsStore-CWNaCyjS.js} +1 -1
- package/dist/client/assets/{play-BP4EBjZw.js → play-DD0bVaYg.js} +1 -1
- package/dist/client/assets/{plus-WDHArJ5z.js → plus-By3sppx5.js} +1 -1
- package/dist/client/assets/{popover-DkE_RkoX.js → popover-CJNN95M0.js} +1 -1
- package/dist/client/assets/{pushClient-BOEoH4vb.js → pushClient-DbwI0iz1.js} +1 -1
- package/dist/client/assets/runDetached-CQOu05LK.js +1 -0
- package/dist/client/assets/{segmented-control-B2_6WsRn.js → segmented-control-DYmNRyQy.js} +1 -1
- package/dist/client/assets/{select-Dq6C29O9.js → select-Dam9e0mi.js} +1 -1
- package/dist/client/assets/{settings-header-button-D76GLmVM.js → settings-header-button-DaCbsV31.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-CZXv60kH.js → sidebarPendingActions-DxI6ubAL.js} +1 -1
- package/dist/client/assets/{square-pen-BjyjvjOJ.js → square-pen-DKZvXh3R.js} +1 -1
- package/dist/client/assets/{state-mark-BAeEZoKQ.js → state-mark-DxzVQsVa.js} +1 -1
- package/dist/client/assets/{status-pill-bp46I9cx.js → status-pill-BFLy7eN9.js} +1 -1
- package/dist/client/assets/{terminal-DjwzMh1O.js → terminal-DRYQ5avJ.js} +1 -1
- package/dist/client/assets/{timer.adapter-LKIP589r.js → timer.adapter-BDh0KX9G.js} +1 -1
- package/dist/client/assets/{tools-wno-tGL1.js → tools-toomKvSw.js} +1 -1
- package/dist/client/assets/{triangle-alert-whYeOlEg.js → triangle-alert-CM5uh-kq.js} +1 -1
- package/dist/client/assets/{useAppGlobalState-DXhTq0lh.js → useAppGlobalState-BCUZEZEi.js} +1 -1
- package/dist/client/assets/useKannaState-BvJAZTpL.js +5 -0
- package/dist/client/assets/{useTheme-B-LhXBrA.js → useTheme-B6cYOPpe.js} +1 -1
- package/dist/client/icon.svg +11 -3
- package/dist/client/index.html +34 -33
- package/package.json +1 -1
- package/src/server/read-models.test.ts +59 -0
- package/src/server/read-models.ts +26 -1
- package/src/shared/stack-activity.ts +10 -0
- package/dist/client/assets/chevron-left-skoFcSB-.js +0 -1
- package/dist/client/assets/index-DfVAvdFs.js +0 -26
- package/dist/client/assets/runDetached-C-0G41cV.js +0 -1
- package/dist/client/assets/useKannaState-D7y1UZxg.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{c as r,d as i,m as a,p as o,t as s}from"./log-OCZfBFFe.js";import{a as c,f as l,n as u}from"./pendingActionsStore-2ldF8rQh.js";import{zt as d}from"./lexicalToReact-w1LjYOTM.js";import{l as f,n as p,r as m,s as h,u as g}from"./pushClient-BOEoH4vb.js";import{a as _,i as v,n as y,o as b,r as x,t as S,u as C}from"./timer.adapter-LKIP589r.js";import{t as w}from"./input-Pqq9209u.js";import{C as T,E as ee,_ as te,c as ne,g as re,l as E,u as D,w as ie}from"./useTheme-B-LhXBrA.js";import{t as ae}from"./runDetached-C-0G41cV.js";import{i as oe,r as se}from"./status-pill-bp46I9cx.js";import{a as ce}from"./formatters-BGORekd-.js";var O=e(n(),1),k=e(t(),1),le=(0,k.createContext)({});function ue(e){let t=(0,k.useRef)(null);return t.current===null&&(t.current=e()),t.current}var de=typeof window<`u`?k.useLayoutEffect:k.useEffect,fe=(0,k.createContext)(null);function pe(e,t){e.indexOf(t)===-1&&e.push(t)}function me(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var A=(e,t,n)=>n>t?t:n<e?e:n,he={},ge=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_e=e=>typeof e==`object`&&!!e,ve=e=>/^0[^.\s]+$/u.test(e);function ye(e){let t;return()=>(t===void 0&&(t=e()),t)}var be=e=>e,j=(...e)=>e.reduce((e,t)=>n=>t(e(n))),xe=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Se=class{constructor(){this.subscriptions=[]}add(e){return pe(this.subscriptions,e),()=>this.remove(e)}remove(e){me(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ce=e=>e*1e3,we=e=>e/1e3,Te=(e,t)=>t?1e3/t*e:0,Ee=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,De=1e-7,Oe=12;function ke(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ee(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>De&&++s<Oe);return o}function Ae(e,t,n,r){if(e===t&&n===r)return be;let i=t=>ke(t,0,1,e,n);return e=>e===0||e===1?e:Ee(i(e),t,r)}var je=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Me=e=>t=>1-e(1-t),Ne=Ae(.33,1.53,.69,.99),Pe=Me(Ne),Fe=je(Pe),Ie=e=>e>=1?1:(e*=2)<1?.5*Pe(e):.5*(2-2**(-10*(e-1))),Le=e=>1-Math.sin(Math.acos(e)),Re=Me(Le),ze=je(Le),Be=Ae(.42,0,1,1),Ve=Ae(0,0,.58,1),He=Ae(.42,0,.58,1),Ue=e=>Array.isArray(e)&&typeof e[0]!=`number`,We=e=>Array.isArray(e)&&typeof e[0]==`number`,Ge={linear:be,easeIn:Be,easeInOut:He,easeOut:Ve,circIn:Le,circInOut:ze,circOut:Re,backIn:Pe,backInOut:Fe,backOut:Ne,anticipate:Ie},Ke=e=>typeof e==`string`,qe=e=>{if(We(e)){e.length;let[t,n,r,i]=e;return Ae(t,n,r,i)}return Ke(e)?(Ge[e],`${e}`,Ge[e]):e},M={delta:0,timestamp:0,isProcessing:!1},Je;function Ye(){Je=void 0}var N={now:()=>(Je===void 0&&N.set(M.isProcessing||he.useManualTiming?M.timestamp:performance.now()),Je),set:e=>{Je=e,queueMicrotask(Ye)}},Xe=e=>Math.round(e*1e5)/1e5,Ze=e=>t=>typeof t==`string`&&t.startsWith(e),Qe=Ze(`--`),$e=Ze(`var(--`),et=e=>$e(e)?tt.test(e.split(`/*`)[0].trim()):!1,tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function nt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var rt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},it={...rt,transform:e=>A(0,1,e)},at={...rt,default:1},ot=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function st(e){return e==null}var ct=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(e,t)=>n=>!!(typeof n==`string`&&ct.test(n)&&n.startsWith(e)||t&&!st(n)&&Object.prototype.hasOwnProperty.call(n,t)),ut=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ot);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dt=e=>A(0,255,e),ft={...rt,transform:e=>Math.round(dt(e))},pt={test:lt(`rgb`,`red`),parse:ut(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ft.transform(e)+`, `+ft.transform(t)+`, `+ft.transform(n)+`, `+Xe(it.transform(r))+`)`};function mt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ht={test:lt(`#`),parse:mt,transform:pt.transform},gt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),_t=gt(`deg`),vt=gt(`%`),P=gt(`px`),yt=gt(`vh`),bt=gt(`vw`),xt={...vt,parse:e=>vt.parse(e)/100,transform:e=>vt.transform(e*100)},St={test:lt(`hsl`,`hue`),parse:ut(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+vt.transform(Xe(t))+`, `+vt.transform(Xe(n))+`, `+Xe(it.transform(r))+`)`},F={test:e=>pt.test(e)||ht.test(e)||St.test(e),parse:e=>pt.test(e)?pt.parse(e):St.test(e)?St.parse(e):ht.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?pt.transform(e):St.transform(e),getAnimatableNone:e=>{let t=F.parse(e);return t.alpha=0,F.transform(t)}},Ct=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,wt=new RegExp(ot.source),Tt=new RegExp(Ct.source,`i`);function Et(e){return isNaN(e)&&typeof e==`string`&&(wt.test(e)||Tt.test(e))}var Dt=`number`,Ot=`color`,kt=`var`,At=`var(`,jt="${}",Mt=/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 Nt(e){let t=e.toString();return wt.test(t)||Tt.test(t)}function Pt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Mt,e=>(F.test(e)?(r.color.push(a),i.push(Ot),n.push(F.parse(e))):e.startsWith(At)?(r.var.push(a),i.push(kt),n.push(e)):(r.number.push(a),i.push(Dt),n.push(parseFloat(e))),++a,jt)).split(jt),indexes:r,types:i}}function Ft(e){return Pt(e).values}function It({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Dt?Xe(r[a]):e===Ot?F.transform(r[a]):r[a]}return i}}function Lt(e){return It(Pt(e))}var Rt=e=>typeof e==`number`?0:F.test(e)?F.getAnimatableNone(e):e,zt=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Rt(e);function Bt(e){let t=Pt(e);return It(t)(t.values.map((e,n)=>zt(e,t.split[n])))}var Vt={test:Et,parse:Ft,createTransformer:Lt,getAnimatableNone:Bt};function Ht(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ut({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Ht(s,r,e+1/3),a=Ht(s,r,e),o=Ht(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Wt(e,t){return n=>n>0?t:e}var I=(e,t,n)=>e+(t-e)*n,Gt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Kt=[ht,pt,St],qt=e=>Kt.find(t=>t.test(e));function Jt(e){let t=qt(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===St&&(n=Ut(n)),n}var Yt=(e,t)=>{let n=Jt(e),r=Jt(t);if(!n||!r)return Wt(e,t);let i={...n};return e=>(i.red=Gt(n.red,r.red,e),i.green=Gt(n.green,r.green,e),i.blue=Gt(n.blue,r.blue,e),i.alpha=I(n.alpha,r.alpha,e),pt.transform(i))},Xt=new Set([`none`,`hidden`]);function Zt(e,t){return Xt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Qt(e,t){return n=>I(e,t,n)}function $t(e){return typeof e==`number`?Qt:typeof e==`string`?et(e)?Wt:F.test(e)?Yt:rn:Array.isArray(e)?en:typeof e==`object`?F.test(e)?Yt:tn:Wt}function en(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>$t(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function tn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=$t(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function nn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var rn=(e,t)=>{let n=Vt.createTransformer(t),r=Pt(e),i=Pt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Xt.has(e)&&!i.values.length||Xt.has(t)&&!r.values.length?Zt(e,t):j(en(nn(r,i),i.values),n):(`${e}${t}`,Wt(e,t))},an=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function on(e,t){let n=an.exec(e);if(!n)return;let r=an.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Xe(I(a,o,e))+i}function sn(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return I(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=on(e,t);if(n)return n}return $t(e)(e,t)}var cn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ln(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var un=40;function dn(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=cn.reduce((e,t)=>(e[t]=ln(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=he.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,un),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:cn.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<cn.length;t++)o[cn[t]].cancel(e)},state:n,steps:o}}var{schedule:L,cancel:fn,steps:pn}=dn(typeof requestAnimationFrame<`u`?requestAnimationFrame:be,!0,M),mn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>L.update(t,e),stop:()=>fn(t),now:()=>M.isProcessing?M.timestamp:N.now()}},hn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},gn=2e4;function _n(e,t=50,n=gn,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function vn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(_n(r),gn);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:we(i)}}var R={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},yn=e=>e<0?1/Math.max(1+e,R.minDamping):Math.max(1-e,R.minDamping);function bn(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cn(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xn(e,t){return e*Math.sqrt(1-t*t)}var Sn=12;function Cn(e,t,n){let r=n;for(let n=1;n<Sn;n++)r-=e(r)/t(r);return r}var wn=.001;function Tn({duration:e=R.duration,bounce:t=R.bounce}){let n,r;R.maxDuration;let i=yn(t);e=A(R.minDuration,R.maxDuration,we(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xn(t,i),o=Math.exp(-r);return wn-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xn(t*t,i);return(-n(t)+wn>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cn(n,r,a),s=o*bn(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Ce(e)}}var En=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dn(e,t){if(En(e,t))return e}function On(e){let t=Dn(e.stiffness),n=Dn(e.damping,!0),r=Dn(e.mass),i={...e,stiffness:t??R.stiffness,damping:n??R.damping,mass:r??R.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yn(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bn(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Tn(i)),i.isResolvedFromDuration=!0;(!En(i.stiffness)||!En(i.damping,!0))&&(i.stiffness=R.stiffness,i.damping=R.damping)}return i}function kn(e=R.visualDuration,t=R.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=On({...n}),f=e=>d?0:-we(e),p=s/(2*Math.sqrt(o*c)),m=we(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?R.restSpeed.granular:R.restSpeed.default),g.restDelta=n.restDelta||(e?R.restDelta.granular:R.restDelta.default)};_();let v,y,b;if(p<1){let e=xn(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Ce(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Ce(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(_n(S),gn),t=hn(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}kn.applyToOptions=e=>{let t=vn(e,100,kn);return e.ease=t.ease,e.duration=Ce(t.duration),e.type=`keyframes`,e};function An({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=kn({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function jn(e,t,n){let r=[],i=n||he.mix||sn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=j(Array.isArray(t)?t[n]||be:t,a)),r.push(a)}return r}function Mn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=jn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=xe(e[r],e[r+1],n);return s[r](i)};return n?t=>l(A(e[0],e[a-1],t)):l}function Nn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=xe(0,t,r);e.push(I(n,1,i))}}function Pn(e){let t=[0];return Nn(t,e.length-1),t}function Fn(e,t){return e.map(e=>e*t)}function In(e,t){return e.map(()=>t||He).splice(0,e.length-1)}function Ln({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ue(r)?r.map(qe):qe(r)||He,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(he.mix||sn)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?A(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Mn(Fn(n&&n.length===t.length?n:Pn(t),e),t,{ease:Array.isArray(i)?i:In(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Rn=5;function zn(e,t,n){let r=Math.max(t-Rn,0);return Te(n-e(r),t-r)}function Bn(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):zn(t=>e.next(t).value,t,e.next(t).value)}var Vn=e=>e!==null;function Hn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Vn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Un={decay:An,inertia:An,tween:Ln,keyframes:Ln,spring:kn};function Wn(e){typeof e.type==`string`&&(e.type=Un[e.type])}function Gn(e,t){return{kind:e,animation:t,timestamp:N.now(),frameTimestamp:M.timestamp,frameIsProcessing:M.isProcessing}}function Kn(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Gn(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function qn(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Gn(`layout-animation-start`,e),node:t})}catch{}}var Jn=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Yn=e=>e/100,Xn=class extends Jn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Kn(this,this.options)}initAnimation(){let{options:e}=this;Wn(e);let{type:t=Ln,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ln;s!==Ln&&typeof o[0]!=`number`&&(this.mixKeyframes=j(Yn,sn(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=_n(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=A(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==An&&(b.value=Hn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return we(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+we(e)}get time(){return we(this.currentTime)}set time(e){e=Ce(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Bn(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=we(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=mn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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}stopDriver(){this.driver&&=(this.driver.stop(),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)}},Zn=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Qn(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ot)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Zn.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var $n=/\b([a-z-]*)\(.*?\)/gu,er={...Vt,getAnimatableNone:e=>{let t=e.match($n);return t?t.map(Qn).join(` `):e}},tr={...Vt,getAnimatableNone:e=>{let t=Vt.parse(e);return Vt.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},nr={...rt,transform:Math.round},rr={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,rotate:_t,pathRotation:_t,rotateX:_t,rotateY:_t,rotateZ:_t,scale:at,scaleX:at,scaleY:at,scaleZ:at,skew:_t,skewX:_t,skewY:_t,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:it,originX:xt,originY:xt,originZ:P,zIndex:nr,fillOpacity:it,strokeOpacity:it,numOctaves:nr},ir={...rr,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:er,WebkitFilter:er,mask:tr,WebkitMask:tr},ar=e=>ir[e],or=new Set([er,tr]);function sr(e,t){let n=ar(e);return or.has(n)||(n=Vt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function cr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var lr=e=>e*180/Math.PI,ur=e=>fr(lr(Math.atan2(e[1],e[0]))),dr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ur,rotateZ:ur,skewX:e=>lr(Math.atan(e[1])),skewY:e=>lr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fr=e=>(e%=360,e<0&&(e+=360),e),pr=ur,mr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),hr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mr,scaleY:hr,scale:e=>(mr(e)+hr(e))/2,rotateX:e=>fr(lr(Math.atan2(e[6],e[5]))),rotateY:e=>fr(lr(Math.atan2(-e[2],e[0]))),rotateZ:pr,rotate:pr,skewX:e=>lr(Math.atan(e[4])),skewY:e=>lr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _r(e){return+!!e.includes(`scale`)}function vr(e,t){if(!e||e===`none`)return _r(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=gr,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=dr,i=t}if(!i)return _r(t);let a=r[t],o=i[1].split(`,`).map(br);return typeof a==`function`?a(o):o[a]}var yr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return vr(n,t)};function br(e){return parseFloat(e.trim())}var xr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Sr=new Set([...xr,`pathRotation`]),Cr=e=>e===rt||e===P,wr=new Set([`x`,`y`,`z`]),Tr=xr.filter(e=>!wr.has(e));function Er(e){let t=[];return Tr.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Dr=new Set([`bottom`,`right`]);function Or(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var kr={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Or(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Or(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>vr(e,`x`),y:({transform:e})=>vr(e,`y`)};kr.translateX=kr.x,kr.translateY=kr.y;var Ar=new Set,jr=!1,Mr=!1,Nr=!1;function Pr(){if(Mr){let e=[],t=new Set,n=new Set;Ar.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Dr.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Er(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Mr=!1,jr=!1,Ar.forEach(e=>e.complete(Nr)),Ar.clear()}function Fr(){Ar.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mr=!0)})}function Ir(){Nr=!0,Fr(),Pr(),Nr=!1}function Lr(e,t,n){if(typeof e==`string`){if(ge(e)||ve(e))return parseFloat(e);if(!Vt.test(e)&&Vt.test(n))return sr(t,n)}return e??void 0}var Rr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Ar.add(this),jr||(jr=!0,L.read(Fr),L.resolveKeyframes(Pr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Lr(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}cr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ar.delete(this)}cancel(){this.state===`scheduled`&&(Ar.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},zr=e=>e.startsWith(`--`);function Br(e,t,n){zr(t)?e.style.setProperty(t,n):e.style[t]=n}var Vr={};function Hr(e,t){let n=ye(e);return()=>Vr[t]??n()}var Ur=Hr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Wr=Hr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Gr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Kr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Gr([0,.65,.55,1]),circOut:Gr([.55,0,1,.45]),backIn:Gr([.31,.01,.66,-.59]),backOut:Gr([.33,1.53,.69,.99])};function qr(e,t){if(e)return typeof e==`function`?Wr()?hn(e,t):`ease-out`:We(e)?Gr(e):Array.isArray(e)?e.map(e=>qr(e,t)||Kr.easeOut):Kr[e]}function Jr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=qr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Yr(e){return typeof e==`function`&&`applyToOptions`in e}function Xr({type:e,...t}){return Yr(e)&&Wr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Zr=class extends Jn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Xr(e);this.animation=Jr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Hn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Br(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Kn(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return we(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+we(e)}get time(){return we(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ur()?(this.animation.timeline=e,t?.(this.animation),be):n(this)}},Qr={anticipate:Ie,backInOut:Fe,circInOut:ze};function $r(e){return e in Qr}function ei(e){typeof e.ease==`string`&&$r(e.ease)&&(e.ease=Qr[e.ease])}var ti=10,ni=class extends Zr{constructor(e){ei(e),Wn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Xn({...a,autoplay:!1}),s=Math.max(ti,N.now()-this.startTime),c=A(0,ti,s-ti),l=o.sample(s).value,{name:u}=this.options;i&&u&&Br(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},ri=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Vt.test(e)||e===`0`)&&!e.startsWith(`url(`));function ii(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ai(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ri(i,t),s=ri(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ii(e)||(n===`spring`||Yr(n))&&r}function oi(e){e.duration=0,e.type=`keyframes`}var si=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ci=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function li(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ci.test(e[t]))return!0;return!1}var ui=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),di=ye(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function fi(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(si.has(n)||ui.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return di()&&(si.has(n)||ui.has(n)&&li(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var pi=40,mi=class extends Jn{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Rr;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=!0;ai(e,i,a,o)||(u=!1,(he.instantAnimations||!s)&&l?.(Hn(e,n,t)),e[0]=e[e.length-1],oi(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>pi?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&fi(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new ni(n)}catch{m=new Xn(n)}}else m=new Xn(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ir()),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()}};function hi(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var gi=30,_i=e=>!isNaN(parseFloat(e)),vi={current:void 0},yi=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=N.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_i(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Se)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Se,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){L.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;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,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}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.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return vi.current&&vi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gi)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,gi);return Te(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function bi(e,t){return new yi(e,t)}function xi(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Si(e,t){let n=e?.[t]??e?.default??e;return n===e?n:xi(n,e)}var Ci={type:`spring`,stiffness:500,damping:25,restSpeed:10},wi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ti={type:`keyframes`,duration:.8},Ei={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Di=(e,{keyframes:t})=>t.length>2?Ti:Sr.has(e)?e.startsWith(`scale`)?wi(t[1]):Ci:Ei,Oi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ki(e){for(let t in e)if(!Oi.has(t))return!0;return!1}var Ai=(e,t,n,r={},i,a)=>o=>{let s=Si(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ce(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ki(s)||Object.assign(u,Di(e,u)),u.duration&&=Ce(u.duration),u.repeatDelay&&=Ce(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(oi(u),u.delay===0&&(d=!0)),(he.instantAnimations||he.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,oi(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Hn(u.keyframes,s);if(e!==void 0){L.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Xn(u):new mi(u)},ji=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mi(e){let t=ji.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ni(e,t,n=1){`${e}`;let[r,i]=Mi(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ge(e)?parseFloat(e):e}return et(i)?Ni(i,t,n+1):i}function Pi(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Fi(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Pi(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ii(e,t,n){return Fi(e.getProps(),t,n,e)}var Li=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Ri=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...xr]),zi=e=>Array.isArray(e);function Bi(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,bi(n))}function Vi(e){return zi(e)?e[e.length-1]||0:e}function Hi(e,t){let{transitionEnd:n={},transition:r={},...i}=Ii(e,t)||{};i={...i,...n};for(let t in i)Bi(e,t,Vi(i[t]))}var z=e=>!!(e&&e.getVelocity);function Ui(e){return!!(z(e)&&e.add)}function Wi(e,t){let n=e.getValue(`willChange`);if(Ui(n))return n.add(t);if(!n&&he.WillChange){let n=new he.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Gi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ki=`data-`+Gi(`framerAppearId`);function qi(e){return e.props[Ki]}var Ji=typeof window<`u`;function Yi({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Xi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?xi(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Yi(f,t))continue;let o={delay:n,...Si(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){L.update(()=>r.set(i));continue}let p=!1;if(Ji&&window.MotionHandoffAnimation){let n=qi(e);if(n){let e=window.MotionHandoffAnimation(n,t,L);e!==null&&(o.startTime=e,p=!0)}}Wi(e,t);let m=l??e.shouldReduceMotion;r.start(Ai(t,r,i,m&&Ri.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>L.update(()=>{o&&Hi(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Zi(e,t,n={}){let r=Ii(e,t,Li(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Xi(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Zi(e,t,{...n,delay:r+(typeof o==`function`?0:o)+hi(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Qi(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Zi(e,t,n))):typeof t==`string`?Zi(e,t,n):Promise.all(Xi(e,Ii(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var $i={test:e=>e===`auto`,parse:e=>e},ea=e=>t=>t.test(e),ta=[rt,P,vt,_t,bt,yt,$i],na=e=>ta.find(ea(e));function ra(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ve(e)}var ia=new Set([`auto`,`none`,`0`]);function aa(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ia.has(t)&&Nt(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=sr(n,i))}var oa=class extends Rr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),et(r))){let i=Ni(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ri.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=na(r),o=na(i);if(nt(r)!==nt(i)&&kr[n]){this.needsMeasurement=!0;return}if(a!==o){if(Cr(a)&&Cr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else kr[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ra(e[t]))&&n.push(t);n.length&&aa(e,n,t)}measure(){let{element:e,name:t}=this;return kr[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},sa=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function ca(e){return _e(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function la(e){return _e(e)&&`ownerSVGElement`in e}var ua=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function da(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var fa={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},pa=xr.length;function ma(e,t,n){let r=``,i=!0;for(let a=0;a<pa;a++){let o=xr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ua(s,rr[o]);if(!c){i=!1;let t=fa[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ua(a,rr.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function ha(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Sr.has(e)){o=!0;continue}if(Qe(e)){i[e]=n;continue}{let t=ua(n,rr[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ma(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ga={offset:`stroke-dashoffset`,array:`stroke-dasharray`},_a={offset:`strokeDashoffset`,array:`strokeDasharray`};function va(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ga:_a;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ya=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ba(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(ha(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of ya)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&va(d,i,a,o,!1)}function xa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ca(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function wa(e){return e===void 0||e===1}function Ta({scale:e,scaleX:t,scaleY:n}){return!wa(e)||!wa(t)||!wa(n)}function Ea(e){return Ta(e)||Da(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Da(e){return Oa(e.x)||Oa(e.y)}function Oa(e){return e&&e!==`0%`}function ka(e,t,n){return n+t*(e-n)}function Aa(e,t,n,r,i){return i!==void 0&&(e=ka(e,i,r)),ka(e,n,r)+t}function ja(e,t=0,n=1,r,i){e.min=Aa(e.min,t,n,r,i),e.max=Aa(e.max,t,n,r,i)}function Ma(e,{x:t,y:n}){ja(e.x,t.translate,t.scale,t.originPoint),ja(e.y,n.translate,n.scale,n.originPoint)}var Na=.999999999999,Pa=1.0000000000001;function Fa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Ia(e.x,-a.scroll.offset.x),Ia(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ma(e,o)),r&&Ea(a.latestValues)&&za(e,a.latestValues,a.layout?.layoutBox))}t.x<Pa&&t.x>Na&&(t.x=1),t.y<Pa&&t.y>Na&&(t.y=1)}function Ia(e,t){e.min+=t,e.max+=t}function La(e,t,n,r,i=.5){ja(e,t,n,I(e.min,e.max,i),r)}function Ra(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function za(e,t,n){let r=n??e;La(e.x,Ra(t.x,r.x),t.scaleX,t.scale,t.originX),La(e.y,Ra(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ba(e,t){return xa(Ca(e.getBoundingClientRect(),t))}function Va(e,t,n){let r=Ba(e,n),{scroll:i}=t;return i&&(Ia(r.x,i.offset.x),Ia(r.y,i.offset.y)),r}var{schedule:Ha,cancel:Ua}=dn(queueMicrotask,!1),Wa={x:!1,y:!1};function Ga(){return Wa.x||Wa.y}function Ka(e){return e===`x`||e===`y`?Wa[e]?null:(Wa[e]=!0,()=>{Wa[e]=!1}):Wa.x||Wa.y?null:(Wa.x=Wa.y=!0,()=>{Wa.x=Wa.y=!1})}function qa(e,t){let n=da(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ja(e){return!(e.pointerType===`touch`||Ga())}function Ya(e,t,n={}){let[r,i,a]=qa(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Ja(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Xa=(e,t)=>t?e===t||Xa(e,t.parentElement):!1,Za=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Qa=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function $a(e){return Qa.has(e.tagName)||e.isContentEditable===!0}var eo=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function to(e){return eo.has(e.tagName)||e.isContentEditable===!0}var no=new WeakSet;function ro(e){return t=>{t.key===`Enter`&&e(t)}}function io(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ao=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ro(()=>{if(no.has(n))return;io(n,`down`);let e=ro(()=>{io(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>io(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function oo(e){return Za(e)&&!Ga()}var so=new WeakSet;function co(e,t,n={}){let[r,i,a]=qa(e,n),o=e=>{let r=e.currentTarget;if(!oo(e)||so.has(e))return;no.add(r),n.stopPropagation&&so.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),no.has(r)&&no.delete(r),oo(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Xa(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ca(e)&&(e.addEventListener(`focus`,e=>ao(e,i)),!$a(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var lo=new WeakMap,uo,fo=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:la(r)&&`getBBox`in r?r.getBBox()[t]:r[n],po=fo(`inline`,`width`,`offsetWidth`),mo=fo(`block`,`height`,`offsetHeight`);function ho({target:e,borderBoxSize:t}){lo.get(e)?.forEach(n=>{n(e,{get width(){return po(e,t)},get height(){return mo(e,t)}})})}function go(e){e.forEach(ho)}function _o(){typeof ResizeObserver<`u`&&(uo=new ResizeObserver(go))}function vo(e,t){uo||_o();let n=da(e);return n.forEach(e=>{let n=lo.get(e);n||(n=new Set,lo.set(e,n)),n.add(t),uo?.observe(e)}),()=>{n.forEach(e=>{let n=lo.get(e);n?.delete(t),n?.size||uo?.unobserve(e)})}}var yo=new Set,bo;function xo(){bo=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};yo.forEach(t=>t(e))},window.addEventListener(`resize`,bo)}function So(e){return yo.add(e),bo||xo(),()=>{yo.delete(e),!yo.size&&typeof bo==`function`&&(window.removeEventListener(`resize`,bo),bo=void 0)}}function Co(e,t){return typeof e==`function`?So(e):vo(e,t)}var wo={value:null,addProjectionMetrics:null};function To(e){return la(e)&&e.tagName===`svg`}var Eo=e=>typeof e==`number`?e:parseFloat(e),Do=()=>({translate:0,scale:1,origin:0,originPoint:0}),Oo=()=>({x:Do(),y:Do()}),ko=()=>({min:0,max:0}),B=()=>({x:ko(),y:ko()}),Ao=new WeakMap;function jo(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Mo(e){return typeof e==`string`||Array.isArray(e)}var No=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Po=[`initial`,...No];function Fo(e){if(jo(e.animate))return!0;for(let t=0;t<Po.length;t++)if(Mo(e[Po[t]]))return!0;return!1}function Io(e){return!!(Fo(e)||e.variants)}function Lo(e,t,n){for(let r in t){let i=t[r],a=n[r];if(z(i))e.addValue(r,i);else if(z(a))e.addValue(r,bi(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,bi(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ro={current:null},zo={current:!1},Bo=typeof window<`u`;function Vo(){if(zo.current=!0,Bo){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ro.current=e.matches;e.addEventListener(`change`,t),t()}else Ro.current=!1}}var Ho=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Uo={};function Wo(e){Uo=e}function Go(){return Uo}var Ko=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Rr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=N.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,L.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Fo(t),this.isVariantNode=Io(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&z(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(zo.current||Vo(),this.shouldReduceMotion=Ro.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),fn(this.notifyUpdate),fn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in 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??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&si.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Zr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ce(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Sr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&L.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Uo){let t=Uo[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(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):B()}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<Ho.length;t++){let n=Ho[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Lo(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}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}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 n=this.values.get(e);return n===void 0&&t!==void 0&&(n=bi(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ge(n)||ve(n))?n=parseFloat(n):typeof n!=`number`&&!Vt.test(n)&&Vt.test(t)&&(n=sr(e,t)),this.setBaseTarget(e,z(n)?n.get():n)),z(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Se),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ha.render(this.render)}},qo=class extends Ko{constructor(){super(...arguments),this.KeyframeResolver=oa}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;z(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Jo=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Yo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Xo={};function Zo(e,{layout:t,layoutId:n}){return Sr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Xo[e]||e===`opacity`)}function Qo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(z(r[t])||i&&z(i[t])||Zo(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function $o(e){return window.getComputedStyle(e)}var es=class extends qo{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Yo}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Sr.has(t))return this.projection?.isProjecting?_r(t):yr(e,t);{let n=$o(e),r=(Qe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ba(e,t)}build(e,t,n){ha(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Qo(e,t,n)}},ts=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`]),ns=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function rs(e,t,n,r){Yo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ts.has(n)?n:Gi(n),t.attrs[n])}function is(e,t,n){let r=Qo(e,t,n);for(let n in e)if(z(e[n])||z(t[n])){let t=xr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var as=class extends qo{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,t){return Sr.has(t)?super.getBaseTargetFromProps(e,t)??_r(t):e[t]}getDefaultValue(e){return Sr.has(e)?this.latestValues[e]??_r(e):void 0}readValueFromInstance(e,t){if(Sr.has(t)){let e=ar(t);return e&&e.default||0}if(ya.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ts.has(t)?t:Gi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return is(e,t,n)}build(e,t,n){ba(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){rs(e,t,n,r)}mount(e){this.isSVGTag=ns(e.tagName),super.mount(e)}};function os(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ss=[...No].reverse();function cs(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Qi(e,t,n))),n=us(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(ss.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Mo(g)||g===!1?g:void 0:h,v=Mo(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||jo(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=ls(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Ii(e,n,Li(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:ee}=i;for(let t in{...ee,...T}){if(t in f)continue;let n=T[t],r=ee[t],a=Array.isArray(n)&&Array.isArray(r)?!os(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Ii(s,n)?.transition?.delayChildren;r.delay=hi(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ii(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!z(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=us(),i=!0}}}function ls(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!os(t,e):!1}function us(){let e={};for(let t of No)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ds(e,t){e.min=t.min,e.max=t.max}function fs(e,t){ds(e.x,t.x),ds(e.y,t.y)}function ps(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var ms=.9999,hs=1.0001,gs=-.01,_s=.01;function vs(e){return e.max-e.min}function ys(e,t,n){return Math.abs(e-t)<=n}function bs(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=vs(n)/vs(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ms&&e.scale<=hs||isNaN(e.scale))&&(e.scale=1),(e.translate>=gs&&e.translate<=_s||isNaN(e.translate))&&(e.translate=0)}function xs(e,t,n,r){bs(e.x,t.x,n.x,r?r.originX:void 0),bs(e.y,t.y,n.y,r?r.originY:void 0)}function Ss(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+vs(t)}function Cs(e,t,n,r){Ss(e.x,t.x,n.x,r?.x),Ss(e.y,t.y,n.y,r?.y)}function ws(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+vs(t)}function Ts(e,t,n,r){ws(e.x,t.x,n.x,r?.x),ws(e.y,t.y,n.y,r?.y)}function Es(e,t,n,r,i){return e-=t,e=ka(e,1/n,r),i!==void 0&&(e=ka(e,1/i,r)),e}function Ds(e,t=0,n=1,r=.5,i,a=e,o=e){if(vt.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=Es(e.min,t,n,s,i),e.max=Es(e.max,t,n,s,i)}function Os(e,t,[n,r,i],a,o){Ds(e,t[n],t[r],t[i],t.scale,a,o)}var ks=[`x`,`scaleX`,`originX`],As=[`y`,`scaleY`,`originY`];function js(e,t,n,r){Os(e.x,t,ks,n?n.x:void 0,r?r.x:void 0),Os(e.y,t,As,n?n.y:void 0,r?r.y:void 0)}function Ms(e){return e.translate===0&&e.scale===1}function Ns(e){return Ms(e.x)&&Ms(e.y)}function Ps(e,t){return e.min===t.min&&e.max===t.max}function Fs(e,t){return Ps(e.x,t.x)&&Ps(e.y,t.y)}function Is(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ls(e,t){return Is(e.x,t.x)&&Is(e.y,t.y)}function Rs(e){return vs(e.x)/vs(e.y)}function zs(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Bs(e){return[e(`x`),e(`y`)]}function Vs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Hs={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(P.test(e))e=parseFloat(e);else return e}return`${Vs(e,t.target.x)}% ${Vs(e,t.target.y)}%`}},Us={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Vt.parse(e);if(i.length>5)return r;let a=Vt.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Ws(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Gs=sa.length,Ks=e=>typeof e==`number`||P.test(e);function qs(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,Ys(r)),e.opacityExit=I(t.opacity??1,0,Xs(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gs;i++){let a=sa[i],o=Js(t,a),s=Js(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ks(o)===Ks(s)?(e[a]=Math.max(I(Eo(o),Eo(s),r),0),(vt.test(s)||vt.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=I(t.rotate||0,n.rotate||0,r))}function Js(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ys=Zs(0,.5,Re),Xs=Zs(.5,.95,be);function Zs(e,t,n){return r=>r<e?0:r>t?1:n(xe(e,t,r))}function Qs(e,t,n){let r=z(e)?e:bi(e);return r.start(Ai(``,r,t,n)),r.animation}function $s(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ec=(e,t)=>e.depth-t.depth,tc=class{constructor(){this.children=[],this.isDirty=!1}add(e){pe(this.children,e),this.isDirty=!0}remove(e){me(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ec),this.isDirty=!1,this.children.forEach(e)}};function nc(e,t){let n=N.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(fn(r),e(a-t))};return L.setup(r,!0),()=>fn(r)}function rc(e){return z(e)?e.get():e}var ic=class{constructor(){this.members=[]}add(e){pe(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(me(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(me(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){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},ac={borderRadius:{...Hs,applyTo:[...sa]},borderTopLeftRadius:Hs,borderTopRightRadius:Hs,borderBottomLeftRadius:Hs,borderBottomRightRadius:Hs,boxShadow:Us},oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Xo,{...ac,...Xo});var sc={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cc=[``,`X`,`Y`,`Z`],lc=1e3,uc=0;function dc(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function fc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=qi(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,L,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fc(r)}function pc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=uc++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,wo.value&&(sc.nodes=sc.calculatedTargetDeltas=sc.calculatedProjections=0),this.nodes.forEach(gc),this.nodes.forEach(Ec),this.nodes.forEach(Dc),this.nodes.forEach(_c),wo.addProjectionMetrics&&wo.addProjectionMetrics(sc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new tc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Se),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=la(t)&&!To(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;L.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=nc(i,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Tc)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Pc,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ls(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Si(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Tc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}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(),fn(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(Oc),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&&fc(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,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(bc),this.nodes.forEach(yc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sc),this.nodes.forEach(Cc),this.nodes.forEach(wc),this.nodes.forEach(mc),this.nodes.forEach(hc)):this.nodes.forEach(xc),this.clearAllSnapshots();let e=N.now();M.delta=A(0,1e3/60,e-M.timestamp),M.timestamp=e,M.isProcessing=!0,pn.update.process(M),pn.preRender.process(M),pn.render.process(M),M.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ha.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vc),this.sharedNodes.forEach(kc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!vs(this.snapshot.measuredBox.x)&&!vs(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.layoutCorrected||=B(),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=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ns(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ea(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Rc(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return B();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bc))){let{scroll:e}=this.root;e&&(Ia(t.x,e.offset.x),Ia(t.y,e.offset.y))}return t}removeElementScroll(e){let t=B();if(fs(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&fs(t,e),Ia(t.x,i.offset.x),Ia(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||B();fs(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Ia(r.x,-n.scroll.offset.x),Ia(r.y,-n.scroll.offset.y)),Ea(n.latestValues)&&za(r,n.latestValues,n.layout?.layoutBox)}return Ea(this.latestValues)&&za(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=B();fs(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ea(n.latestValues))continue;let r;n.instance&&(Ta(n.latestValues)&&n.updateSnapshot(),r=B(),fs(r,n.measurePageBox())),js(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ea(this.latestValues)&&js(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||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!==M.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=M.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fs(this.target,this.layout.layoutBox),Ma(this.target,this.targetDelta)):fs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),wo.value&&sc.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ta(this.parent.latestValues)||Da(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),Ts(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),fs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===M.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;fs(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Fa(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=B());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ps(this.prevProjectionDelta.x,this.projectionDelta.x),ps(this.prevProjectionDelta.y,this.projectionDelta.y)),xs(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!zs(this.projectionDelta.x,this.prevProjectionDelta.x)||!zs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),wo.value&&sc.calculatedProjections++}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=Oo(),this.projectionDelta=Oo(),this.projectionDeltaWithTransform=Oo()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Oo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=B(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Nc));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=I(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=I(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ac(o.x,e.x,n),Ac(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ts(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Mc(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Fs(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=B(),fs(f,this.relativeTarget)),c&&(this.animationValues=a,qs(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(fn(this.pendingAnimation),void 0),this.pendingAnimation=L.update(()=>{oc.hasAnimatedSinceResize=!0,this.motionValue||=bi(0),this.motionValue.jump(0,!1),this.currentAnimation=Qs(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),qn(this.currentAnimation,this),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(lc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&zc(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||B();let t=vs(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=vs(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}fs(t,i),za(t,r),xs(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ic),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.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:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&dc(`z`,e,r,this.animationValues);for(let t=0;t<cc.length;t++)dc(`rotate${cc[t]}`,e,r,this.animationValues),dc(`skew${cc[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=rc(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=rc(t?.pointerEvents)||``),this.hasProjected&&!Ea(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Ws(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Xo){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Xo[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?rc(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(yc),this.root.sharedNodes.clear()}}}function mc(e){e.updateLayout()}function hc(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Bs(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=vs(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ds(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else zc(i,t.layoutBox,n)&&Bs(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=vs(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Oo();xs(o,n,t.layoutBox);let s=Oo();a?xs(s,e.applyTransform(r,!0),t.measuredBox):xs(s,n,t.layoutBox);let c=!Ns(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=B();Ts(s,t.layoutBox,i.layoutBox,o);let c=B();Ts(c,n,a.layoutBox,o),Ls(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function gc(e){wo.value&&sc.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function _c(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vc(e){e.clearSnapshot()}function yc(e){e.clearMeasurements()}function bc(e){e.isLayoutDirty=!0,e.updateLayout()}function xc(e){e.isLayoutDirty=!1}function Sc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Cc(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function wc(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Tc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ec(e){e.resolveTargetDelta()}function Dc(e){e.calcProjection()}function Oc(e){e.resetSkewAndRotation()}function kc(e){e.removeLeadSnapshot()}function Ac(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jc(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Mc(e,t,n,r){jc(e.x,t.x,n.x,r),jc(e.y,t.y,n.y,r)}function Nc(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Pc={duration:.45,ease:[.4,0,.1,1]},Fc=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ic=Fc(`applewebkit/`)&&!Fc(`chrome/`)?Math.round:be;function Lc(e){e.min=Ic(e.min),e.max=Ic(e.max)}function Rc(e){Lc(e.x),Lc(e.y)}function zc(e,t,n){return e===`position`||e===`preserve-aspect`&&!ys(Rs(t),Rs(n),.2)}function Bc(e){return e!==e.root&&e.scroll?.wasRoot}var Vc=pc({attachResizeListener:(e,t)=>$s(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hc={current:void 0},Uc=pc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hc.current){let e=new Vc({});e.mount(window),e.setOptions({layoutScroll:!0}),Hc.current=e}return Hc.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Wc=(0,k.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Gc(e=!0){let t=(0,k.useContext)(fe);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,k.useId)();(0,k.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,k.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Kc=(0,k.createContext)({strict:!1}),qc={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`]},Jc=!1;function Yc(){if(Jc)return;let e={};for(let t in qc)e[t]={isEnabled:e=>qc[t].some(t=>!!e[t])};Wo(e),Jc=!0}function Xc(){return Yc(),Go()}function Zc(e){let t=Xc();for(let n in e)t[n]={...t[n],...e[n]};Wo(t)}var Qc=(0,k.createContext)({});function $c(e,t){if(Fo(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Mo(t)?t:void 0,animate:Mo(n)?n:void 0}}return e.inherit===!1?{}:t}function el(e){let{initial:t,animate:n}=$c(e,(0,k.useContext)(Qc));return(0,k.useMemo)(()=>({initial:t,animate:n}),[tl(t),tl(n)])}function tl(e){return Array.isArray(e)?e.join(` `):e}var nl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rl(e,t,n){for(let r in t)!z(t[r])&&!Zo(r,n)&&(e[r]=t[r])}function il({transformTemplate:e},t){return(0,k.useMemo)(()=>{let n=nl();return ha(n,t,e),Object.assign({},n.vars,n.style)},[t])}function al(e,t){let n=e.style||{},r={};return rl(r,n,e),Object.assign(r,il(e,t)),r}function ol(e,t){let n={},r=al(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var sl=()=>({...nl(),attrs:{}});function cl(e,t,n,r){let i=(0,k.useMemo)(()=>{let n=sl();return ba(n,t,ns(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};rl(t,e.style,e),i.style={...t,...i.style}}return i}var ll=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function ul(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||ll.has(e)}function dl(e,t){return e.startsWith(`on`)?!ul(e):t?.(e)??!ul(e)}function fl(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(z(e[a])||(dl(a,r)||n===!0&&ul(a)||!t&&!ul(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var pl=[`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 ml(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(pl.indexOf(e)>-1||/[A-Z]/u.test(e))}function hl(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ml(e)?cl:ol)(t,r,i,e),l=fl(t,typeof e==`string`,a,s),u=e===k.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,k.useMemo)(()=>z(d)?d.get():d,[d]);return(0,k.createElement)(e,{...u,children:f})}function gl({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:_l(n,r,i,e),renderState:t()}}function _l(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rc(a[e]);let{initial:o,animate:s}=e,c=Fo(e),l=Io(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!jo(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Fi(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var vl=e=>(t,n)=>{let r=(0,k.useContext)(Qc),i=(0,k.useContext)(fe),a=()=>gl(e,t,r,i);return n?a():ue(a)},yl=vl({scrapeMotionValuesFromProps:Qo,createRenderState:nl}),bl=vl({scrapeMotionValuesFromProps:is,createRenderState:sl}),xl=Symbol.for(`motionComponentSymbol`);function Sl(e,t,n){let r=(0,k.useRef)(n);(0,k.useInsertionEffect)(()=>{r.current=n});let i=(0,k.useRef)(null);return(0,k.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Cl=(0,k.createContext)({});function wl(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Tl(e,t,n,r,i,a){let{visualElement:o}=(0,k.useContext)(Qc),s=(0,k.useContext)(Kc),c=(0,k.useContext)(fe),l=(0,k.useContext)(Wc),u=l.reducedMotion,d=l.skipAnimations,f=(0,k.useRef)(null),p=(0,k.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,k.useContext)(Cl);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&El(f.current,n,i,h);let g=(0,k.useRef)(!1);(0,k.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ki],v=(0,k.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return de(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),de(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,k.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function El(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Dl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&wl(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Dl(e){if(e)return e.options.allowProjection===!1?Dl(e.parent):e.projection}function Ol(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Zc(r);let a=n?n===`svg`:ml(e),o=a?bl:yl;function s(n,s){let c,l={...(0,k.useContext)(Wc),...n,layoutId:kl(n)},{isStatic:u,isValidProp:d}=l,f=el(n),p=o(n,u);if(!u&&typeof window<`u`){Al(l,r);let t=jl(l);c=t.MeasureLayout,f.visualElement=Tl(e,p,l,i,t.ProjectionNode,a)}return(0,O.jsxs)(Qc.Provider,{value:f,children:[c&&f.visualElement?(0,O.jsx)(c,{visualElement:f.visualElement,...l}):null,hl(e,n,Sl(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,k.forwardRef)(s);return c[xl]=e,c}function kl({layoutId:e}){let t=(0,k.useContext)(le).id;return t&&e!==void 0?t+`-`+e:e}function Al(e,t){(0,k.useContext)(Kc).strict}function jl(e){let{drag:t,layout:n}=Xc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ml(e,t){if(typeof Proxy>`u`)return Ol;let n=new Map,r=(n,r)=>Ol(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ol(a,void 0,e,t)),n.get(a))})}var Nl=(e,t)=>t.isSVG??ml(e)?new as(t):new es(t,{allowProjection:e!==k.Fragment}),Pl=class extends Jo{constructor(e){super(e),e.animationState||=cs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();jo(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?.()}},Fl=0,Il={animation:{Feature:Pl},exit:{Feature:class extends Jo{constructor(){super(...arguments),this.id=Fl++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ii(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Ll(e){return{point:{x:e.pageX,y:e.pageY}}}var Rl=e=>t=>Za(t)&&e(t,Ll(t));function zl(e,t,n,r){return $s(e,t,Rl(n),r)}var Bl=({current:e})=>e?e.ownerDocument.defaultView:null,Vl=(e,t)=>Math.abs(e-t);function Hl(e,t){let n=Vl(e.x,t.x),r=Vl(e.y,t.y);return Math.sqrt(n**2+r**2)}var Ul=new Set([`auto`,`scroll`]),Wl=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=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=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Gl(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ql(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Hl(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:N.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Gl(t,this.transformPagePoint),this.hasPendingMove=!0,L.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ql(e.type===`pointercancel`?this.lastMoveEventInfo:Gl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Za(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Gl(Ll(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=M;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ql(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=j(zl(this.contextWindow,`pointermove`,this.handlePointerMove,d),zl(this.contextWindow,`pointerup`,this.handlePointerUp,d),zl(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Ul.has(e.overflowX)||Ul.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}),window.addEventListener(`scroll`,this.onWindowScroll),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 n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fn(this.updatePoint)}};function Gl(e,t){return t?{point:t(e.point)}:e}function Kl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ql({point:e},t){return{point:e,delta:Kl(e,Yl(t)),offset:Kl(e,Jl(t)),velocity:Xl(t,.1)}}function Jl(e){return e[0]}function Yl(e){return e[e.length-1]}function Xl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Yl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ce(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ce(t)*2&&(r=e[1]);let a=we(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Zl(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?I(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function Ql(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function $l(e,{top:t,left:n,bottom:r,right:i}){return{x:Ql(e.x,n,i),y:Ql(e.y,t,r)}}function eu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function tu(e,t){return{x:eu(e.x,t.x),y:eu(e.y,t.y)}}function nu(e,t){let n=.5,r=vs(e),i=vs(t);return i>r?n=xe(t.min,t.max-r,e.min):r>i&&(n=xe(e.min,e.max-i,t.min)),A(0,1,n)}function ru(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var iu=.35;function au(e=iu){return e===!1?e=0:e===!0&&(e=iu),{x:ou(e,`left`,`right`),y:ou(e,`top`,`bottom`)}}function ou(e,t,n){return{min:su(e,t),max:su(e,n)}}function su(e,t){return typeof e==`number`?e:e[t]||0}var cu=new WeakMap,lu=class{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=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ka(n),!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),Bs(e=>{let t=this.getAxisMotionValue(e).get()||0;if(vt.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=vs(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&L.update(()=>i(e,t),!1,!0),Wi(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=pu(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&L.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Wl(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Bl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&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,n){let{drag:r}=this.getProps();if(!n||!fu(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Zl(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&wl(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?$l(n.layoutBox,e):!1,this.elastic=au(t),r!==this.constraints&&!wl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bs(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ru(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!wl(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Va(n,r.root,this.visualElement.getTransformPagePoint()),a=tu(r.layout.layoutBox,i);if(t){let e=t(Sa(a));this.hasMutatedConstraints=!!e,e&&(a=xa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bs(o=>{if(!fu(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Wi(this.visualElement,e),n.start(Ai(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Bs(e=>{if(!fu(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-I(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!wl(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Bs(e=>{let t=this.getAxisMotionValue(e).get();i[e]=nu({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bs(t=>{let n=this.getAxisMotionValue(t);if(!fu(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(I(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cu.set(this.visualElement,this);let e=this.visualElement.current,t=zl(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&to(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();wl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=du(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(r);let o=$s(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bs(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=iu,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function uu(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function du(e,t,n){let r=Co(e,uu(n)),i=Co(t,uu(n));return()=>{r(),i()}}function fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pu(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var mu=class extends Jo{constructor(e){super(e),this.removeGroupControls=be,this.removeListeners=be,this.controls=new lu(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}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()}},hu=e=>(t,n)=>{e&&L.update(()=>e(t,n),!1,!0)},gu=class extends Jo{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(e){this.session=new Wl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:hu(e),onStart:hu(t),onMove:hu(n),onEnd:(e,t)=>{delete this.session,r&&L.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=zl(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_u=!1,vu=class extends k.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_u&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_u=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||L.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Ha.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_u=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function yu(e){let[t,n]=Gc(),r=(0,k.useContext)(le);return(0,O.jsx)(vu,{...e,layoutGroup:r,switchLayoutGroup:(0,k.useContext)(Cl),isPresent:t,safeToRemove:n})}var bu={pan:{Feature:gu},drag:{Feature:mu,ProjectionNode:Uc,MeasureLayout:yu}};function xu(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&L.postRender(()=>i(t,Ll(t)))}var Su=class extends Jo{mount(){let{current:e}=this.node;e&&(this.unmount=Ya(e,(e,t)=>(xu(this.node,t,`Start`),e=>xu(this.node,e,`End`))))}unmount(){}},Cu=class extends Jo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{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=j($s(this.node.current,`focus`,()=>this.onFocus()),$s(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function wu(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&L.postRender(()=>i(t,Ll(t)))}var Tu=class extends Jo{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=co(e,(e,t)=>(wu(this.node,t,`Start`),(e,{success:t})=>wu(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Eu=new WeakMap,Du=new WeakMap,Ou=e=>{let t=Eu.get(e.target);t&&t(e)},ku=e=>{e.forEach(Ou)};function Au({root:e,...t}){let n=e||document;Du.has(n)||Du.set(n,{});let r=Du.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ku,{root:e,...t})),r[i]}function ju(e,t,n){let r=Au(t);return Eu.set(e,n),r.observe(e),()=>{Eu.delete(e),r.unobserve(e)}}var Mu={some:0,all:1},Nu=class extends Jo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Mu[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=ju(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Pu(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Pu({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Fu={inView:{Feature:Nu},tap:{Feature:Tu},focus:{Feature:Cu},hover:{Feature:Su}},Iu={layout:{ProjectionNode:Uc,MeasureLayout:yu}},Lu=Ml({...Il,...Fu,...bu,...Iu},Nl),Ru={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Ru.node;var zu=l(Ru),Bu={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Bu.node;var Vu=l(Bu),Hu={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Hu.node;var Uu=l(Hu),Wu={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Wu.node;var Gu=l(Wu),Ku={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ku.node;var qu=l(Ku),Ju=(0,k.createContext)(null);function Yu({children:e,ports:t={}}){let n=t.timer??S,[r,i]=(0,k.useState)(null),[a,o]=(0,k.useState)(``),s=(0,k.useRef)(null);(0,k.useEffect)(()=>{r?.kind===`prompt`&&(o(r.options.initialValue??``),n.setTimeout(()=>{s.current?.focus(),s.current?.select()},0))},[r,n]);let l=(0,k.useCallback)(()=>{i(null),o(``)},[]),u=(0,k.useCallback)(()=>{r&&(r.kind===`confirm`?r.resolve(!1):r.kind===`prompt`?r.resolve(null):r.resolve(),l())},[l,r]),d=(0,k.useCallback)(()=>{r&&(r.kind===`confirm`?r.resolve(!0):r.kind===`prompt`?r.resolve(a.trim()||null):r.resolve(),l())},[l,r,a]),f=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`confirm`,options:e,resolve:t})}),[]),p=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`prompt`,options:e,resolve:t})}),[]),m=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`alert`,options:e,resolve:t})}),[]),h=(0,k.useMemo)(()=>({confirm:f,prompt:p,alert:m}),[m,f,p]),g=`Confirm`;return r&&(r.kind===`alert`?g=r.options.closeLabel??`OK`:`confirmLabel`in r.options&&(g=r.options.confirmLabel??`Confirm`)),(0,O.jsxs)(Ju.Provider,{value:h,children:[e,(0,O.jsx)(y,{open:r!==null,onOpenChange:e=>{!e&&r&&u()},children:(0,O.jsx)(v,{size:`sm`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&r&&r.kind===`confirm`&&(e.preventDefault(),d())},children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(x,{className:`space-y-4`,children:[(0,O.jsx)(C,{children:r.options.title}),r.options.description?(0,O.jsx)(_,{children:r.options.description}):null,r.kind===`prompt`?(0,O.jsx)(w,{ref:s,type:`text`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())},placeholder:r.options.placeholder}):null]}),(0,O.jsxs)(b,{children:[(0,O.jsx)(c,{variant:`ghost`,size:`sm`,onClick:u,className:r.kind===`alert`?`hidden`:void 0,children:`cancelLabel`in r.options?r.options.cancelLabel??`Cancel`:`Cancel`}),(0,O.jsx)(c,{variant:r.kind===`confirm`?r.options.confirmVariant??`default`:`secondary`,size:`sm`,onClick:d,disabled:r.kind===`prompt`&&!a.trim(),children:g})]})]}):null})})]})}function Xu(){let e=(0,k.useContext)(Ju);if(!e)throw Error(`useAppDialog must be used within AppDialogProvider`);return e}var Zu=typeof window<`u`,Qu=Zu?window:null,$u=Zu?document:null,V={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},H={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},ed={NONE:0,AUTO:1,FORCE:2},td={replace:0,none:1,blend:2},nd=Symbol(),rd=Symbol(),id=Symbol(),ad=Symbol(),od=Symbol(),U=1e-11,sd=0xe8d4a51000,cd=1e3,ld=[],ud=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),dd=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],fd=dd.reduce((e,t)=>({...e,[t]:t+`(`}),{}),pd=()=>{},md=e=>e,hd=/\)\s*[-.\d]/,gd=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,_d=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,vd=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,yd=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,bd=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,xd=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Sd=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Cd=/([a-z])([A-Z])/g,wd=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Td={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:cd,delay:0,loopDelay:0,ease:`out(2)`,composition:td.replace,modifier:md,onBegin:pd,onBeforeUpdate:pd,onUpdate:pd,onLoop:pd,onPause:pd,onComplete:pd,onRender:pd},Ed={current:null,root:$u},W={defaults:Td,precision:4,timeScale:1,tickThreshold:200,editor:null},Dd={version:`4.5.0`,engine:null};Zu&&(Qu.AnimeJS||=[],Qu.AnimeJS.push(Dd));var Od=e=>e.replace(Cd,`$1-$2`).toLowerCase(),kd=(e,t)=>e.indexOf(t)===0,Ad=Date.now,jd=Array.isArray,Md=e=>e&&e.constructor===Object,Nd=e=>typeof e==`number`&&!isNaN(e),Pd=e=>typeof e==`string`,Fd=e=>typeof e==`function`,G=e=>e===void 0,Id=e=>G(e)||e===null,Ld=e=>Zu&&e instanceof SVGElement,Rd=e=>gd.test(e),zd=e=>kd(e,`rgb`),Bd=e=>kd(e,`hsl`),Vd=e=>Rd(e)||(zd(e)||Bd(e))&&(e[e.length-1]===`)`||!hd.test(e)),Hd=e=>!W.defaults.hasOwnProperty(e),Ud=[`opacity`,`rotate`,`overflow`,`color`],Wd=(e,t)=>{if(Ud.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},Gd=Math.pow,Kd=Math.sqrt,qd=Math.sin,Jd=Math.cos,Yd=Math.abs,Xd=Math.exp,Zd=Math.floor,Qd=Math.asin,$d=Math.PI,ef=Math.round,tf=(e,t,n)=>e<t?t:e>n?n:e,K=(e,t)=>{if(t<0)return e;if(!t)return ef(e);let n=10**t;return ef(e*n)/n},nf=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,rf=e=>e===1/0?sd:e===-1/0?-sd:e,af=e=>e<=1e-11?U:rf(K(e,11)),q=e=>jd(e)?[...e]:e,of=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=G(i)?t[r]:i}return n},J=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},sf=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},cf=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},lf=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[ad],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!G(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:kd(t,`scale`)?`1`:kd(t,`rotate`)||kd(t,`skew`)?`0deg`:`0px`},uf=e=>{let t=``;for(let n=0,r=dd.length;n<r;n++){let r=dd[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${fd[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},df=[];function ff(e,t){if(!e)return null;let n=df.length;outer:for(let r=0;r<n;r++){let n=df[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=df[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var pf=e=>{let t=_d.exec(e)||vd.exec(e),n=G(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},mf=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},hf=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),gf=e=>{let t=yd.exec(e)||bd.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=G(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=K(hf(t,e,n+1/3)*255,0),s=K(hf(t,e,n)*255,0),c=K(hf(t,e,n-1/3)*255,0)}return[o,s,c,a]},_f=e=>zd(e)?pf(e):Rd(e)?mf(e):Bd(e)?gf(e):[0,0,0,1],Y=(e,t)=>G(e)?t:e,vf=(e,t)=>{let n=e.match(wd),r=t[rd]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},yf=(e,t,n,r,i,a)=>{if(Fd(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(Pd(e)&&kd(e,`var(`)){if(!i)return vf(e,t);let n=()=>vf(e,t);return i.func=n,n()}return e},bf=(e,t)=>e[rd]?e[id]&&Wd(e,t)?V.ATTRIBUTE:dd.includes(t)||ud.get(t)?V.TRANSFORM:kd(t,`--`)?V.CSS_VAR:t in e.style?V.CSS:t in e?V.OBJECT:V.ATTRIBUTE:V.OBJECT,xf=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[od]||e).getPropertyValue(t);return i===`auto`?`0`:i},Sf=(e,t,n,r)=>{let i=G(n)?bf(e,t):n,a=ff(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===V.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===V.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===V.TRANSFORM?lf(e,t,r):i===V.CSS_VAR?xf(e,t,r).trimStart():xf(e,t,r)},Cf=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,wf=()=>({t:H.NUMBER,n:0,u:null,o:null,d:null,s:null}),Tf=(e,t)=>{if(t.t=H.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&Sd.exec(r);if(i)return t.t=H.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Vd(r))return t.t=H.COLOR,t.d=_f(r),t;{let e=r.match(xd);return t.t=H.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(xd)||[],t}},Ef=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=q(e._toNumbers),t.s=q(e._strings),t),Df=wf(),Of=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(K(nf(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},kf=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=tf(g,-h,o),b=tf(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=U,T=i===ed.FORCE,ee=0,te=v,ne=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=tf(n,0,l),C&&e._currentIteration--,ee=e._currentIteration%2,te=b-n*t||0}let re=f^(p&&ee),E=e._ease,D=C?re?0:o:re?c-te:te;E&&(D=c*E(D/c)||0);let ie=(a?a.backwards:v<g)?!re:!!re;if(e._currentTime=v,e._iterationTime=D,e.backwards=ie,S&&!e.began?(e.began=!0,!n&&(!a||!ie&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===ed.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||D>=_&&y!==o||D<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(ie?x*-1:x)>=W.tickThreshold,i=K(e._offset+(a?a._offset:0)+h+D,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==td.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&D<p._startTime))&&(!m||_||D>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=tf(D-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===V.OBJECT,g=f===H.NUMBER,_=g&&m||n===0||n===1?-1:W.precision,v,y;if(g)v=y=i(K(nf(o._fromNumber,o._toNumber,n),_));else if(f===H.UNIT)y=i(K(nf(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===H.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(nf(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${K(e[0],0)},${K(e[1],0)},${K(e[2],0)},${e[3]})`)}else f===H.COMPLEX&&(v=Of(o,n,_));if(h&&(o._number=y),!r&&e!==td.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===V.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===V.TRANSFORM?(s!==l&&(l=s,u=s[ad]),u[e]=v,d=1):p===V.CSS?c[e]=v:p===V.CSS_VAR&&c.setProperty(e,v)),S&&(ne=1)}else o._value=v}else n&&m&&!_&&D<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=uf(u),d=0),o=o._next}!n&&ne&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!ie&&v>0&&!s||ie&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!ie):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!ie&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,ne},Af=(e,t,n,r,i)=>{let a=e._currentIteration;if(kf(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Ad(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;J(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&kf(t,e,n,1,ed.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}J(o,e=>{let t=K((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=kf(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},jf={},Mf=(e,t,n)=>{if(n===V.TRANSFORM)return ud.get(e)||e;if(n===V.CSS||n===V.ATTRIBUTE&&Ld(t)&&e in t.style){let t=jf[e];if(t)return t;{let t=e&&Od(e);return jf[e]=t,t}}return e},Nf=(e,t=!1)=>{if(e._hasChildren)J(e,e=>Nf(e,t),!0);else{let n=e;n.pause(),J(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=Id(o)||o===``;if(e._setter){if(!t&&!s){if(Tf(o,Df),Df.d){let t=Df.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Df.n;e._setter(e.target,e._number,e)}}else if(a===V.OBJECT)!t&&!s&&(i[r]=o);else if(i[rd]){if(a===V.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===V.TRANSFORM){let n=i[ad];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=uf(n):t.removeProperty(`transform`))}else s?t.removeProperty(Od(r)):t[r]=o}}i[rd]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Pf=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=cd/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?U:t,r=cd/n;n>Td.frameRate&&(Td.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?U:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?ed.NONE:(this._lastTickTime=n>=t?e-n%t:e,ed.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ff={animation:null,update:pd},If=e=>{let t=Ff.animation;return t||(t={duration:U,computeDeltaTime:pd,_offset:0,_delay:0,_head:null,_tail:null},Ff.animation=t,Ff.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===H.COMPLEX||e===H.COLOR?q(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),kf(t,1,1,0,ed.FORCE)}),t},Lf=Zu?requestAnimationFrame:setImmediate,Rf=Zu?cancelAnimationFrame:clearImmediate,zf=class extends Pf{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Td,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Ad();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(sf(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Af(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):ed.AUTO),r=i}Ff.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Ad()),this.reqId=Lf(Bf)),this}pause(){if(this.reqId)return this.paused=!0,Vf()}resume(){if(this.paused)return this.paused=!1,J(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(W.timeScale===1?1:cd)}set speed(e){let t=e*W.timeScale;this._speed!==t&&(this._speed=t,J(this,e=>e.speed=e._speed))}get timeUnit(){return W.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(W.timeScale!==r){W.timeScale=r,W.tickThreshold=200*r;let e=n?t:cd;this.defaults.duration*=e,this._speed*=e}}get precision(){return W.precision}set precision(e){W.precision=e}},X=(()=>{let e=new zf(Ad());return Zu&&(Dd.engine=e,$u.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&($u.hidden?e.pause():e.resume())})),e})(),Bf=()=>{X._head?(X.reqId=Lf(Bf),X.update()):X.reqId=0},Vf=()=>(Rf(X.reqId),X.reqId=0,X),Hf={_rep:new WeakMap,_add:new Map},Uf=(e,t,n=`_rep`)=>{let r=Hf[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Wf=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Gf=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=U,e._currentTime=U},Kf=(e,t)=>{let n=e._composition;if(n===td.replace){let n=e._absoluteStartTime;cf(t,e,Wf,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Gf(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Gf(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=K(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Gf(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(J(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;J(e,e=>{e!==t&&J(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===td.blend){let t=Uf(e.target,e.property,`_add`),n=If(Hf._add),r=t._head;r||(r={...e},r._composition=td.replace,r._updateDuration=U,r._startTime=0,r._numbers=q(e._fromNumbers),r._number=0,r._next=null,r._prev=null,cf(t,r),cf(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=q(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=q(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}cf(t,e,null,`_prevAdd`,`_nextAdd`)}return e},qf=e=>{let t=e._composition;if(t!==td.none){let n=e.target,r=e.property,i=Hf._rep.get(n)[r];if(sf(i,e,`_prevRep`,`_nextRep`),t===td.blend){let t=Hf._add,i=t.get(n);if(!i)return;let a=i[r],o=Ff.animation;sf(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){sf(a,s,`_prevAdd`,`_nextAdd`),sf(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},Jf=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Yf=e=>e._cancelled?(e._hasChildren?J(e,Yf):J(e,e=>{e._composition!==td.none&&Kf(e,Uf(e.target,e.property))}),e._cancelled=0,e):e,Xf=0,Zf=(e,t)=>e._priority>t._priority,Qf=class extends Pf{constructor(e={},t=null,n=0){super(0),++Xf;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Ed.current&&Ed.current.register(this);let b=t?0:X._lastTickTime,x=t?t.defaults:W.defaults,S=Fd(i)||G(i)?x.delay:+i,C=Fd(a)||G(a)?1/0:+a,w=Y(c,x.loop),T=Y(l,x.loopDelay),ee=w===!0||w===1/0||w<0?1/0:w+1,te=0;t?te=n:(X.reqId||X.requestTick(Ad()),te=(X._lastTickTime-X._startTime)*W.timeScale),this.id=G(r)?Xf:r,this.parent=t,this.duration=rf((C+T)*ee-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=ee,this._autoplay=!t&&Y(u,x.autoplay),this._offset=te,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=pd,this._running=!1,this._reversed=+Y(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Y(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=Y(d,x.frameRate),this._speed=Y(f,x.playbackRate),this._priority=+Y(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return tf(K(this._currentTime,W.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return tf(K(this._iterationTime,W.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return tf(K(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return tf(K(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*tf(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Yf(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Af(this,0,1,~~e,ed.FORCE),Jf(this),this._hasChildren&&J(this,Jf),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Af(this,this.duration,1,~~e,ed.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!G(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*X._speed);return this._startTime=Ad()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Af(this,U,0,0,ed.FORCE):(this._running||=(cf(X,this,Zf),X._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,X.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Yf(this),this.completed=!1;let r=this.paused;return this.paused=!0,Af(this,e+this._delay,~~t,~~n,ed.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?Zd(sd/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?J(this,e=>e.cancel(),!0):J(this,qf),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=af(e);if(t===n)return this;let r=e/t,i=e<=U;return this.duration=i?U:n,this.iterationDuration=i?U:af(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Af(this,0,1,0,ed.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=pd){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=pd};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function $f(e){let t=Pd(e)?Ed.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function ep(e){if(Id(e))return[];if(!Zu)return jd(e)&&e.flat(1/0)||[e];if(jd(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!Id(r)){let e=$f(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!Id(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=$f(e);return t?Array.from(t):[e]}function tp(e){let t=ep(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[nd]){n[nd]=!0;let e=Ld(n);(n.nodeType||e)&&(n[rd]=!0,n[id]=e,n[ad]={})}}return t}var np={deg:1,rad:180/$d,turn:360},rp={},ip=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===H.UNIT&&i===n)return t;let o=a+i+n,s=rp[o];if(!G(s)&&!r)t.n=s;else{let r;if(i in np)r=a*np[i]/np[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==$u?o:$u.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,rp[o]=r}return t.t,H.UNIT,t.u=n,t},ap=e=>e,op=(e=1.68)=>t=>Gd(t,+e),sp={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},cp=$d/2,lp=$d*2,up={"":op,Quad:op(2),Cubic:op(3),Quart:op(4),Quint:op(5),Sine:e=>1-Jd(e*cp),Circ:e=>1-Kd(1-e*e),Expo:e=>e?Gd(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=Gd(2,--n))-1)/11;);return 1/Gd(4,3-n)-7.5625*Gd((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=tf(+e,1,10),r=tf(+t,U,2),i=r/lp*Qd(1/n),a=lp/r;return e=>e===0||e===1?e:-n*Gd(2,-10*(1-e))*qd((1-e-i)*a)}},dp=(()=>{let e={linear:ap,none:ap};for(let t in sp)for(let n in up){let r=up[n],i=sp[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),fp={linear:ap,none:ap},pp=e=>{if(fp[e])return fp[e];if(e.indexOf(`(`)<=-1){let t=sp[e]||e.includes(`Back`)||e.includes(`Elastic`)?dp[e]():dp[e];return t?fp[e]=t:ap}{let t=e.slice(0,-1).split(`(`),n=dp[t[0]];return n?fp[e]=n(...t[1].split(`,`)):ap}},mp=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],hp=e=>{if(Pd(e)){for(let t=0,n=mp.length;t<n;t++)if(kd(e,mp[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),ap}return Fd(e)?e:Pd(e)?pp(e):ap},Z=wf(),Q=wf(),gp={},_p={func:null},vp={func:null},yp=[null],bp=[null,null],xp={to:null},Sp=0,Cp=0,wp,Tp,Ep=(e,t)=>{let n={};if(jd(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Hd);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Hd(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=Y(t.duration,W.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Hd(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Dp=class extends Qf{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Cp;let s=tp(e),c=s.length,l=t.keyframes,u=l?of(Ep(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:W.defaults,b=Y(m,y.ease),x=Y(h,y.playbackEase),S=x?hp(x):null,C=!G(b.ease),w=C?b.ease:Y(m,S?`linear`:y.ease),T=C?b.settlingDuration:Y(p,y.duration),ee=Y(f,y.delay),te=g||y.modifier,ne=G(_)&&c>=1e3?td.none:G(_)?y.composition:_,re=this._offset+(n?n._offset:0);C&&(b.parent=this);let E=NaN,D=NaN,ie=0,ae=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Hd(e)){let a=bf(t,e),o=ff(t,e),s=Mf(e,t,a),f=u[e],p=jd(f);if(i&&!p&&(bp[0]=f,bp[1]=f,f=bp),p){let e=f.length,t=!Md(f[0]);e===2&&t?(xp.to=f,yp[0]=xp,wp=yp):e>2&&t?(wp=[],f.forEach((e,t)=>{t?t===1?(bp[1]=e,wp.push(bp)):wp.push(e):bp[0]=e})):wp=f}else yp[0]=f,wp=yp;let m=null,h=null,g=NaN,_=0,v=0;for(let e=wp.length;v<e;v++){let i=wp[v];Md(i)?Tp=i:(xp.to=i,Tp=xp),_p.func=null,vp.func=null;let l=yf(Y(Tp.composition,ne),t,r,c,null,null),u=Nd(l)?l:td[l];!m&&u!==td.none&&(m=Uf(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=yf(Tp.to,t,r,c,_p,f),y;Md(p)&&!G(p.to)?(Tp=p,y=p.to):y=p;let b=yf(Tp.from,t,r,c,vp,f),x=Tp.ease||w,S=yf(x,t,r,c,null,f),C=Fd(S)||Pd(S)?S:x,E=!G(C)&&!G(C.ease),D=E?C.ease:C,oe=E?C.settlingDuration:yf(Y(Tp.duration,e>1?yf(T,t,r,c,null,f)/e:T),t,r,c,null,f),se=yf(Y(Tp.delay,v?0:ee),t,r,c,null,f),ce=Tp.modifier||te,O=!G(b),k=!G(y),le=jd(y),ue=le||O&&k,de=h?_:0,fe=h?_+se:se,pe=K(re+fe,12),me=K(re+de,12);!ae&&(O||le)&&(ae=1);let A=h;if(u!==td.none){let e=m._head;for(;e&&e._absoluteStartTime<=pe;)if(e._isOverridden||(A=e),e=e._nextRep,e&&e._absoluteStartTime>=pe)for(;e;)Gf(e),e=e._nextRep}if(ue){Tf(le?yf(y[0],t,r,c,vp,f):b,Z),Tf(le?yf(y[1],t,r,c,_p,f):y,Q);let e=Sf(t,s,a,gp);Z.t===H.NUMBER&&(A?A._valueType===H.UNIT&&(Z.t=H.UNIT,Z.u=A._unit):(Tf(e,Df),Df.t===H.UNIT&&(Z.t=H.UNIT,Z.u=Df.u)))}else k?Tf(y,Q):h?Ef(h,Q):Tf(n&&A&&A.parent.parent===n?A._value:Sf(t,s,a,gp),Q),O?Tf(b,Z):h?Ef(h,Z):Tf(n&&A&&A.parent.parent===n?A._value:Sf(t,s,a,gp),Z);if(Z.o&&(Z.n=Cf(A?A._toNumber:Tf(Sf(t,s,a,gp),Df).n,Z.n,Z.o)),Q.o&&(Q.n=Cf(Z.n,Q.n,Q.o)),Z.t!==Q.t){if(Z.t===H.COMPLEX||Q.t===H.COMPLEX){let e=Z.t===H.COMPLEX?Z:Q,t=Z.t===H.COMPLEX?Q:Z;t.t=H.COMPLEX,t.s=q(e.s),t.d=e.d.map(()=>t.n)}else if(Z.t===H.UNIT||Q.t===H.UNIT){let e=Z.t===H.UNIT?Z:Q,t=Z.t===H.UNIT?Q:Z;t.t=H.UNIT,t.u=e.u}else if(Z.t===H.COLOR||Q.t===H.COLOR){let e=Z.t===H.COLOR?Z:Q,t=Z.t===H.COLOR?Q:Z;t.t=H.COLOR,t.d=e.d.map(()=>0)}}if(Z.u!==Q.u){let e=Q.u?Z:Q;e=ip(t,e,Q.u?Q.u:Z.u,!1)}if(Q.d&&Z.d&&Q.d.length!==Z.d.length){let e=Z.d.length>Q.d.length?Z:Q,t=e===Z?Q:Z;t.d=e.d.map((e,n)=>G(t.d[n])?0:t.d[n]),t.s=q(e.s)}let he=K(+oe||1e-11,12),ge=gp[s];Id(ge)||(gp[s]=null);let _e=o?o.set:null;_=K(fe+he,12);let ve=Z.d,ye=Q.d,be=Q.s,j={parent:this,id:Sp++,property:s,target:t,_value:null,_toFunc:_p.func,_fromFunc:vp.func,_ease:hp(D),_fromNumbers:ve?q(ve):ld,_toNumbers:ye?q(ye):ld,_strings:be?q(be):ld,_fromNumber:Z.n,_toNumber:Q.n,_numbers:ve?q(ve):ld,_number:Z.n,_unit:Q.u,_modifier:ce,_currentTime:0,_startTime:fe,_delay:+se,_updateDuration:he,_changeDuration:he,_absoluteStartTime:pe,_absoluteUpdateStartTime:me,_absoluteEndTime:K(re+_,12),_hasFromValue:O||le?1:0,_tweenType:a,_setter:_e,_valueType:Q.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ge,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==td.none&&Kf(j,m);let xe=j._valueType;if(xe===H.COMPLEX)j._value=Of(j,1,-1);else if(xe===H.UNIT)j._value=`${ce(j._toNumber)}${j._unit}`;else if(xe===H.COLOR){let e=Q.d;j._value=`rgba(${K(e[0],0)},${K(e[1],0)},${K(e[2],0)},${e[3]})`}else j._value=ce(j._toNumber);isNaN(g)&&(g=j._startTime),h=j,ie++,cf(this,j)}(isNaN(D)||g<D)&&(D=g),(isNaN(E)||_>E)&&(E=_),a===V.TRANSFORM&&(l=ie-v,d=ie)}if(!isNaN(l)){let e=0;J(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===td.blend&&J(Ff.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),D?(J(this,e=>{e._startTime-e._delay||(e._delay-=D),e._startTime-=D}),E-=D):D=0,E||(E=U,this.iterationCount=0),this.targets=s,this.id=G(d)?Cp:d,this.duration=E===1e-11?U:rf((E+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=D,this.iterationDuration=E,!this._autoplay&&ae&&this.onRender(this)}stretch(e){let t=this.duration;if(t===af(e))return this;let n=e/t;return J(this,e=>{e._updateDuration=af(e._updateDuration*n),e._changeDuration=af(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return J(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Tf(n(),Z),Z.u!==e._unit&&e.target[rd]&&ip(e.target,Z,e._unit,!0),e._fromNumbers=q(Z.d),e._fromNumber=Z.n):t&&(Tf(Sf(e.target,e.property,e._tweenType),Df),e._fromNumbers=q(Df.d),e._fromNumber=Df.n),t&&(Tf(t(),Q),e._toNumbers=q(Q.d),e._strings=q(Q.s),e._toNumber=Q.o?Cf(e._fromNumber,Q.n,Q.o):Q.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Nf(this)}then(e){return super.then(e)}},Op=(e,t)=>W.editor?W.editor.addAnimation(e,t):new Dp(e,t,null,0,!1).init(),kp={instant:80,quick:160,row:180,carry:240,panel:280,staggerTight:14,staggerRow:26,staggerLoose:40,sequence:860},Ap={arriving:`out(3)`,born:`outBack(1.6)`,panel:`cubicBezier(0.22, 1, 0.36, 1)`},jp={arriving:`cubic-bezier(0.22, 0.61, 0.36, 1)`,panel:`cubic-bezier(0.22, 1, 0.36, 1)`},Mp={landing:{stiffness:190,damping:17},indicator:{stiffness:240,damping:26},cardTravel:{stiffness:210,damping:24},drawer:{stiffness:210,damping:22},sheet:{stiffness:200,damping:21}};function Np(e,t){return Math.min(e,7)*t}var Pp=`(prefers-reduced-motion: reduce)`;function Fp(e=i){return e.matchesMediaQuery(Pp)}function Ip(){X.pauseOnDocumentHidden=!1,X.resume()}var Lp=r((e,t)=>{let n=null;return{spawnedChatId:null,markSpawned:(r,i=S)=>{n!==null&&i.clearTimeout(n),e({spawnedChatId:r}),n=i.setTimeout(()=>{n=null,t().clearSpawned(r)},kp.sequence)},clearSpawned:n=>{t().spawnedChatId===n&&e({spawnedChatId:null})}}});function Rp(e){return t=>e!==null&&t.spawnedChatId===e}function zp(e){return e.spawnedChatId!==null}var Bp={sm:.875,md:1,lg:1.125,xl:1.25,xxl:1.5};function Vp(e){return typeof e==`string`&&Object.hasOwn(Bp,e)}function Hp(e){return typeof e!=`string`||!Vp(e)?Bp.md:Bp[e]}function Up(e,t){return Vp(e)?e:Vp(t)?t:`md`}function Wp(e){let t=e&&Vp(e.scale)?e.scale:`md`;return{"--kanna-font-scale":String(Bp[t])}}function Gp(e){return Number.isFinite(e)?Math.max(1,Math.round(e)):1}function Kp(e){let t=e.trim().slice(0,512);return!t||!/^https?:\/\/\S+$/.test(t)?null:t.replace(/\/+$/,``)}var qp=8e3,Jp={idleTimeoutMs:6e5,maxConcurrent:4},Yp=6e4,Xp=36e5;({...Jp});var Zp={toggleEmbeddedTerminal:[`cmd+j`,"ctrl+`"],toggleRightSidebar:[`cmd+b`,`ctrl+b`],openInFinder:[`cmd+alt+f`,`ctrl+alt+f`],openInEditor:[`cmd+shift+o`,`ctrl+shift+o`],addSplitTerminal:[`cmd+/`,`ctrl+/`],jumpToSidebarChat:[`cmd+alt`],openProjectSwitcher:[`cmd+k`,`ctrl+k`],openTabSwitcher:["alt+`"],jumpToPaneTab:[`cmd+ctrl`,`ctrl+alt`],createChatInCurrentProject:[`cmd+alt+n`],openAddProject:[`cmd+alt+o`],newStack:[`cmd+alt+w`],newStackChat:[`cmd+alt+shift+n`],jumpToStacks:[`g s`],focusPaneLeft:[`cmd+ctrl+arrowleft`,`ctrl+alt+arrowleft`],focusPaneRight:[`cmd+ctrl+arrowright`,`ctrl+alt+arrowright`],focusPaneUp:[`cmd+ctrl+arrowup`,`ctrl+alt+arrowup`],focusPaneDown:[`cmd+ctrl+arrowdown`,`ctrl+alt+arrowdown`],splitPaneRight:[`cmd+ctrl+d`,`ctrl+alt+d`],splitPaneDown:[`cmd+ctrl+e`,`ctrl+alt+e`],closePaneTab:[`cmd+ctrl+w`,`ctrl+alt+q`],nextPaneTab:[`cmd+ctrl+j`,`ctrl+alt+j`],previousPaneTab:[`cmd+ctrl+k`,`ctrl+alt+k`],resizePaneLeft:[`cmd+ctrl+shift+arrowleft`,`ctrl+alt+shift+arrowleft`],resizePaneRight:[`cmd+ctrl+shift+arrowright`,`ctrl+alt+shift+arrowright`],resizePaneUp:[`cmd+ctrl+shift+arrowup`,`ctrl+alt+shift+arrowup`],resizePaneDown:[`cmd+ctrl+shift+arrowdown`,`ctrl+alt+shift+arrowdown`]},Qp=`toggleEmbeddedTerminal.toggleRightSidebar.openInFinder.openInEditor.addSplitTerminal.jumpToSidebarChat.openProjectSwitcher.openTabSwitcher.jumpToPaneTab.createChatInCurrentProject.openAddProject.newStack.newStackChat.jumpToStacks.focusPaneLeft.focusPaneRight.focusPaneUp.focusPaneDown.splitPaneRight.splitPaneDown.closePaneTab.nextPaneTab.previousPaneTab.resizePaneLeft.resizePaneRight.resizePaneUp.resizePaneDown`.split(`.`);function $p(e){return e===`cursor`||e===`vscode`||e===`xcode`||e===`windsurf`||e===`custom`}function em(e){return e===`never`||e===`unfocused`||e===`always`}function tm(e){return e===`blow`||e===`bottle`||e===`frog`||e===`funk`||e===`glass`||e===`ping`||e===`pop`||e===`purr`||e===`tink`}function nm(e){return e===`openai`||e===`openrouter`||e===`custom`}var rm=`moonshotai/kimi-k2.5:nitro`,im=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`xhigh`,label:`XHigh`},{id:`max`,label:`Max`}],am=[{id:`minimal`,label:`Minimal`},{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`xhigh`,label:`XHigh`}],om={reasoningEffort:`high`,contextWindow:`200k`},sm={reasoningEffort:`high`,fastMode:!1};function cm(e){return im.some(t=>t.id===e)}function lm(e){return am.some(t=>t.id===e)}var um=[{id:`200k`,label:`200k`},{id:`1m`,label:`1M`}];function dm(e){return um.some(t=>t.id===e)}var fm=[`low`,`medium`,`high`,`xhigh`,`max`],pm=[{id:`claude`,label:`Claude`,defaultModel:`claude-sonnet-4-6`,defaultEffort:`high`,supportsPlanMode:!0,models:[{id:`claude-fable-5`,label:`Fable 5`,supportedEfforts:fm,aliases:[`fable`],contextWindowOptions:[...um]},{id:`claude-opus-5`,label:`Opus 5`,supportedEfforts:fm,aliases:[`opus-5`],contextWindowOptions:[...um]},{id:`claude-sonnet-5`,label:`Sonnet 5`,supportedEfforts:fm,aliases:[`sonnet-5`],contextWindowOptions:[...um]},{id:`claude-opus-4-8`,label:`Opus 4.8`,supportedEfforts:fm,aliases:[`opus-4-8`],contextWindowOptions:[...um]},{id:`claude-opus-4-7`,label:`Opus 4.7`,supportedEfforts:fm,aliases:[`opus`],contextWindowOptions:[...um]},{id:`claude-sonnet-4-6`,label:`Sonnet 4.6`,supportedEfforts:[`low`,`medium`,`high`,`max`],aliases:[`sonnet`],contextWindowOptions:[...um]},{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`,supportedEfforts:[`low`,`medium`,`high`],aliases:[`haiku`]}],efforts:[...im]},{id:`codex`,label:`Codex`,defaultModel:`gpt-5.5`,supportsPlanMode:!0,models:[{id:`gpt-5.5`,label:`GPT-5.5`},{id:`gpt-5.4`,label:`GPT-5.4`},{id:`gpt-5.3-codex`,label:`GPT-5.3 Codex`,aliases:[`gpt-5-codex`]},{id:`gpt-5.3-codex-spark`,label:`GPT-5.3 Codex Spark`}],efforts:[]},{id:`openrouter`,label:`OpenRouter`,defaultModel:rm,supportsPlanMode:!0,models:[],efforts:[]}];function mm(e){let t=pm.find(t=>t.id===e);if(!t)throw Error(`Unknown provider: ${e}`);return t}function hm(e){return{id:e.id,label:e.label,...e.supportedEfforts?{supportedEfforts:e.supportedEfforts}:{},...e.aliases?{aliases:e.aliases}:{},...e.contextWindowOptions?{contextWindowOptions:e.contextWindowOptions}:{}}}function gm(e,t){return e.map(e=>{if(e.id!==`claude`&&e.id!==`codex`)return{...e,models:[...e.models]};let n=t.filter(t=>t.provider===e.id);if(n.length===0)return{...e,models:[...e.models]};let r=n.map(t=>{let n=hm(t),r=e.models.find(e=>e.id===n.id);return r?{...r,...n}:n}),i=r.some(t=>t.id===e.defaultModel)?e.defaultModel:r[0]?.id??e.defaultModel;return{...e,defaultModel:i,models:r}})}function _m(e,t){let n=mm(e);if(!t||t.length===0)return n;let[r]=gm([{...n,models:[...n.models]}],t);return r??n}function vm(e,t){return _m(e,t).models}function ym(e,t,n){if(!t)return;let r=vm(e,n);return r.find(e=>e.id===t)??r.find(e=>e.aliases?.includes(t))}function bm(e,t,n,r){let i=ym(e,t,r);if(i)return i.id;let a=_m(e,r),o=n??a.defaultModel;return!(r?.some(t=>t.provider===e)??!1)||a.models.some(e=>e.id===o)?o:a.defaultModel}function xm(e,t=`claude-opus-4-7`,n){return bm(`claude`,e,t,n)}function Sm(e,t=`gpt-5.5`,n){return bm(`codex`,e,t,n)}function Cm(e,t,n){let r=bm(e,t,void 0,n);return vm(e,n).find(e=>e.id===r)}function wm(e,t){return Cm(`claude`,e,t)}function Tm(e,t){let n=wm(e,t)?.supportedEfforts;return!n||n.length===0?[]:im.filter(e=>n.includes(e.id))}function Em(e,t,n){let r=wm(e,n)?.supportedEfforts;if(!r||r.length===0||r.includes(t))return t;for(let e of[`max`,`xhigh`,`high`,`medium`,`low`])if(r.includes(e))return e;return om.reasoningEffort}function Dm(e,t){return wm(e,t)?.contextWindowOptions??[]}function Om(e,t,n){let r=Dm(e,n);return r.length===0?om.contextWindow:dm(t)&&r.some(e=>e.id===t)?t:om.contextWindow}function km(e,t,n){return n||(pm.find(t=>t.id===e)?.models.find(e=>e.id===t)?.contextWindowOptions??[])}function Am(e){switch(e){case`1m`:return 1e6;default:return 2e5}}function jm(e){return e===`claude`||e===`codex`||e===`openrouter`}var Mm={toggleEmbeddedTerminal:`Toggle Embedded Terminal`,toggleRightSidebar:`Toggle Right Sidebar`,openInFinder:`Open In Finder`,openInEditor:`Open In Editor`,addSplitTerminal:`Add Split Terminal`,jumpToSidebarChat:`Jump To Sidebar Chat`,openProjectSwitcher:`Open Project Switcher`,openTabSwitcher:`Switch To Recent Tab`,jumpToPaneTab:`Jump To Tab By Number`,createChatInCurrentProject:`New Chat In Current Project`,openAddProject:`Open Add Project`,newStack:`New Stack`,newStackChat:`New Stack Chat`,jumpToStacks:`Jump To Stacks`,focusPaneLeft:`Focus Pane Left`,focusPaneRight:`Focus Pane Right`,focusPaneUp:`Focus Pane Up`,focusPaneDown:`Focus Pane Down`,splitPaneRight:`Split Pane Right`,splitPaneDown:`Split Pane Down`,closePaneTab:`Close Tab`,nextPaneTab:`Next Tab`,previousPaneTab:`Previous Tab`,resizePaneLeft:`Resize Pane Left`,resizePaneRight:`Resize Pane Right`,resizePaneUp:`Resize Pane Up`,resizePaneDown:`Resize Pane Down`};function Nm(e){return(e??[]).join(`, `)}function Pm(e){return e.split(`,`).map(e=>e.trim()).map(e=>e.toLowerCase()).filter(Boolean)}var Fm=new Map([[`cmd`,`meta`],[`meta`,`meta`],[`ctrl`,`ctrl`],[`control`,`ctrl`],[`alt`,`alt`],[`option`,`alt`],[`shift`,`shift`]]);function Im(e,t){let n=Qm(e);return n?$m(t,n.key)&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Lm(e,t,n){return zm(e,t).some(e=>Im(e,n))}function Rm(e,t,n){return zm(e,t).find(e=>Im(e,n))??null}function zm(e,t){return e?.bindings[t]??Zp[t]}function Bm(e){return Object.hasOwn(Zp,e)}function Vm(){return Object.keys(Zp).filter(Bm)}function Hm(e){let t={...Zp};for(let n of Vm())t[n]=e?.bindings[n]??Zp[n];return{bindings:t,warning:e?.warning??null,filePathDisplay:e?.filePathDisplay??``}}function Um(e,t){let n=Zm(e);return t.metaKey===n.meta&&t.altKey===n.alt&&t.ctrlKey===n.ctrl&&t.shiftKey===n.shift}function Wm(e,t){let n=Qm(e);return n?$m(t,n.key)&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&(!n.shift||t.shiftKey):!1}function Gm(e,t){let n=Zm(e),r=[[n.meta,t.metaKey],[n.ctrl,t.ctrlKey],[n.alt,t.altKey]].filter(([e])=>e);return r.length!==0&&r.some(([,e])=>!e)}function Km(e,t){let n=e=>Zm(e).meta;return e.find(e=>n(e)===t)??(t?e[0]:void 0)??null}var qm={meta:`⌘`,ctrl:`⌃`,alt:`⌥`,shift:`⇧`},Jm={meta:`Win`,ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`},Ym={arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,enter:`↵`,escape:`Esc`,tab:`Tab`};function Xm(e,t){let n=t?qm:Jm;return e.split(`+`).map(e=>e.trim().toLowerCase()).filter(Boolean).map(e=>{let t=Fm.get(e);return t===`ctrl`||t===`meta`||t===`alt`||t===`shift`?n[t]:Ym[e]??(e.length===1?e.toUpperCase():e)})}function Zm(e){let t={ctrl:!1,meta:!1,alt:!1,shift:!1};for(let n of e.split(`+`)){let e=Fm.get(n.trim().toLowerCase());(e===`ctrl`||e===`meta`||e===`alt`||e===`shift`)&&(t[e]=!0)}return t}function Qm(e){let t=e.split(`+`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return null;let n={key:``,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let e of t){let t=e.toLowerCase(),r=Fm.get(t);if(r===`ctrl`){n.ctrl=!0;continue}if(r===`meta`){n.meta=!0;continue}if(r===`alt`){n.alt=!0;continue}if(r===`shift`){n.shift=!0;continue}if(n.key)return null;n.key=t}return n.key?n:null}function $m(e,t){if(e.key.toLowerCase()===t)return!0;let n=eh(t);return n?e.code===n:!1}function eh(e){if(e.length===1&&e>=`a`&&e<=`z`)return`Key${e.toUpperCase()}`;if(e.length===1&&e>=`0`&&e<=`9`)return`Digit${e}`;switch(e){case`/`:return`Slash`;case"`":return`Backquote`;default:return null}}var th=[],nh=r()(e=>({rows:th,setRows:t=>e({rows:t.length>0?t:th})})),rh=e=>e.rows,ih=e=>t=>t.rows.find(t=>t.id===e)??null;function ah(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var oh=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return oh(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return oh(t)(e)}}}},sh=(e,t)=>(n,r,i)=>{let a={storage:ah(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return oh(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p};function ch(e){let t={},n=e.reasoningEffort;cm(n)&&(t.reasoningEffort=n);let r=e.contextWindow;return dm(r)&&(t.contextWindow=r),t}function lh(e){let t={},n=e.reasoningEffort;lm(n)&&(t.reasoningEffort=n);let r=e.fastMode;return typeof r==`boolean`&&(t.fastMode=r),t}function uh(e,t){return e.reasoningEffort===t.reasoningEffort&&e.contextWindow===t.contextWindow}function dh(e,t){return e.reasoningEffort===t.reasoningEffort&&e.fastMode===t.fastMode}function fh(e,t){return e.claude.model===t.claude.model&&e.claude.planMode===t.claude.planMode&&uh(e.claude.modelOptions,t.claude.modelOptions)&&e.codex.model===t.codex.model&&e.codex.planMode===t.codex.planMode&&dh(e.codex.modelOptions,t.codex.modelOptions)&&e.openrouter.model===t.openrouter.model&&e.openrouter.planMode===t.openrouter.planMode}function ph(){return T.getState().settings?.customModels??[]}var mh=`__new__`;function hh(e,t){let n=e?.modelOptions?.reasoningEffort,r;r=cm(n)?n:cm(e?.effort)?e.effort:om.reasoningEffort;let i=xm(e?.model,void 0,t),a=Om(i,e?.modelOptions?.contextWindow,t);return{model:i,modelOptions:{reasoningEffort:Em(i,r,t),contextWindow:a},planMode:!!e?.planMode}}function gh(e,t){let n=e?.modelOptions?.reasoningEffort,r;return r=lm(n)?n:lm(e?.effort)?e.effort:sm.reasoningEffort,{model:Sm(e?.model,void 0,t),modelOptions:{reasoningEffort:r,fastMode:typeof e?.modelOptions?.fastMode==`boolean`?e.modelOptions.fastMode:sm.fastMode},planMode:!!e?.planMode}}function _h(){return{claude:{model:`claude-opus-4-7`,modelOptions:{...om},planMode:!1},codex:{model:`gpt-5.5`,modelOptions:{...sm},planMode:!1},openrouter:{model:rm,modelOptions:{},planMode:!1}}}function vh(e,t){if(t===void 0){s.info(`[chat-preferences] ${e}`);return}s.info(`[chat-preferences] ${e}`,t)}function yh(e,t){if(e===`claude`){let e=t.claude;return{provider:`claude`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}if(e===`openrouter`){let e=t.openrouter;return{provider:`openrouter`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}let n=t.codex;return{provider:`codex`,model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function bh(e){return e.provider===`claude`?{provider:`claude`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}:e.provider===`openrouter`?{provider:`openrouter`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}:{provider:`codex`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}function xh(e){return e.providerHint?yh(e.providerHint,e.providerDefaults):e.defaultProvider===`last_used`?e.sourceState?bh(e.sourceState):yh(`claude`,e.providerDefaults):yh(e.defaultProvider,e.providerDefaults)}function Sh(e,t){return e.chatStates[t]||xh({defaultProvider:e.defaultProvider,providerDefaults:e.providerDefaults,legacyComposerState:e.legacyComposerState})}function Ch(e,t,n){let r=Sh(e,t);return{chatStates:{...e.chatStates,[t]:n(r)}}}var wh=r()(sh((e,t)=>({defaultProvider:`last_used`,providerDefaults:_h(),chatStates:{},pendingProviderSyncChatIds:new Set,legacyComposerState:{provider:`claude`,model:`claude-opus-4-7`,modelOptions:{...om},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),applyServerDefaults:(t,n)=>e(e=>{if(e.defaultProvider===t&&fh(e.providerDefaults,n))return{defaultProvider:t,providerDefaults:n};let{[mh]:r,...i}=e.chatStates;return{defaultProvider:t,providerDefaults:n,chatStates:i}}),setProviderDefaultModel:(t,n)=>e(e=>{let r=ph();return t===`claude`?{providerDefaults:{...e.providerDefaults,[t]:hh({...e.providerDefaults.claude,model:n},r)}}:t===`openrouter`?{providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults.openrouter,model:n}}}:{providerDefaults:{...e.providerDefaults,[t]:gh({...e.providerDefaults.codex,model:n},r)}}}),setProviderDefaultModelOptions:(t,n)=>e(e=>{let r=ph();if(t===`claude`){let i=ch(n);return{providerDefaults:{...e.providerDefaults,[t]:hh({...e.providerDefaults.claude,modelOptions:{...e.providerDefaults.claude.modelOptions,...i}},r)}}}if(t===`openrouter`)return{providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults.openrouter,modelOptions:{}}}};let i=lh(n);return{providerDefaults:{...e.providerDefaults,[t]:gh({...e.providerDefaults.codex,modelOptions:{...e.providerDefaults.codex.modelOptions,...i}},r)}}}),setProviderDefaultPlanMode:(t,n)=>e(e=>({providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults[t],planMode:n}}})),getComposerState:e=>bh(Sh(t(),e)),initializeComposerForChat:(t,n)=>e(e=>{let r=e.chatStates[t],i=n?.providerHint;if(r){if(i&&e.pendingProviderSyncChatIds.has(t)){let n=new Set(e.pendingProviderSyncChatIds);if(n.delete(t),r.provider===i)return vh(`initializeComposerForChat sync skipped`,{chatId:t,provider:i}),{pendingProviderSyncChatIds:n};let a={...yh(i,e.providerDefaults),planMode:r.planMode};return vh(`initializeComposerForChat sync`,{chatId:t,provider:i}),{chatStates:{...e.chatStates,[t]:a},pendingProviderSyncChatIds:n}}return e}let a=xh({defaultProvider:e.defaultProvider,providerDefaults:e.providerDefaults,sourceState:n?.sourceState,legacyComposerState:e.legacyComposerState,providerHint:i});vh(`initializeComposerForChat`,{chatId:t,composerState:a});let o=i?e.pendingProviderSyncChatIds:new Set([...e.pendingProviderSyncChatIds,t]);return{chatStates:{...e.chatStates,[t]:a},pendingProviderSyncChatIds:o}}),setComposerState:(t,n)=>e(e=>{let r=ph();return{chatStates:{...e.chatStates,[t]:n.provider===`claude`?{provider:`claude`,model:hh(n,r).model,modelOptions:hh(n,r).modelOptions,planMode:n.planMode}:bh(n)}}}),setChatComposerProvider:(t,n)=>e(e=>Ch(e,t,()=>yh(n,e.providerDefaults))),setChatComposerModel:(t,n)=>e(e=>Ch(e,t,e=>{let t=ph();if(e.provider===`claude`){let r=hh({...e,model:n},t);return{provider:`claude`,model:r.model,modelOptions:r.modelOptions,planMode:e.planMode}}return e.provider===`openrouter`?{provider:`openrouter`,model:n,modelOptions:{},planMode:e.planMode}:{provider:`codex`,model:n,modelOptions:gh({...e,model:n},t).modelOptions,planMode:e.planMode}})),setChatComposerModelOptions:(t,n)=>e(e=>Ch(e,t,e=>{let t=ph();if(e.provider===`claude`){let r=ch(n);return{provider:`claude`,model:e.model,modelOptions:hh({...e,modelOptions:{...e.modelOptions,...r}},t).modelOptions,planMode:e.planMode}}if(e.provider===`openrouter`)return{provider:`openrouter`,model:e.model,modelOptions:{},planMode:e.planMode};let r=lh(n);return{provider:`codex`,model:e.model,modelOptions:gh({...e,modelOptions:{...e.modelOptions,...r}},t).modelOptions,planMode:e.planMode}})),setChatComposerPlanMode:(t,n)=>e(e=>Ch(e,t,e=>({...e,planMode:n}))),resetChatComposerFromProvider:(t,n)=>e(e=>{let r=new Set(e.pendingProviderSyncChatIds);return r.delete(t),{chatStates:{...e.chatStates,[t]:yh(n,e.providerDefaults)},pendingProviderSyncChatIds:r}}),forgetChats:t=>e(e=>({chatStates:Object.fromEntries(Object.entries(e.chatStates).filter(([e])=>!t.includes(e))),pendingProviderSyncChatIds:new Set([...e.pendingProviderSyncChatIds].filter(e=>!t.includes(e)))}))}),{name:`chat-preferences-state`,version:1,partialize:e=>({chatStates:e.chatStates,legacyComposerState:e.legacyComposerState})})),Th=`cursor`;function Eh(e){switch(e){case`vscode`:return`code {path}`;case`xcode`:return`xed {path}`;case`windsurf`:return`windsurf {path}`;case`custom`:return`cursor {path}`;default:return`cursor {path}`}}function Dh(e){switch(e){case`vscode`:return`VS Code`;case`xcode`:return`Xcode`;case`windsurf`:return`Windsurf`;case`custom`:return`Custom`;default:return`Cursor`}}function Oh(e){return Number.isFinite(e)?Math.min(900,Math.max(250,Math.round(e))):450}function kh(e){switch(e){case`vscode`:case`xcode`:case`windsurf`:case`custom`:case`cursor`:return e;default:return Th}}function Ah(e,t){let n=e?.trim();return n&&n.length>0?n:Eh(t)}var jh=r()(e=>({scrollbackLines:ie,minColumnWidth:450,editorPreset:Th,editorCommandTemplate:Eh(Th),setScrollbackLines:t=>e({scrollbackLines:ee(t)}),setMinColumnWidth:t=>e({minColumnWidth:Oh(t)}),setEditorPreset:t=>e(e=>{let n=kh(t);return{editorPreset:n,editorCommandTemplate:n===`custom`?Ah(e.editorCommandTemplate,n):Eh(n)}}),setEditorCommandTemplate:t=>e(e=>({editorCommandTemplate:Ah(t,e.editorPreset)}))}));function Mh(e){return e===void 0?null:typeof e==`string`?e?{text:e}:null:e.text||e.lexicalState?e:null}var Nh=r()(sh((e,t)=>({drafts:{},attachmentDrafts:{},setDraft:(t,n,r)=>e(e=>{let i;if(typeof n==`string`){if(!n){let{[t]:n,...r}=e.drafts;return{drafts:r}}i={text:n}}else{let a=r??``;if(!a){let{[t]:n,...r}=e.drafts;return{drafts:r}}i={text:a,lexicalState:n}}return{drafts:{...e.drafts,[t]:i}}}),clearDraft:t=>e(e=>{let{[t]:n,...r}=e.drafts;return{drafts:r}}),getDraft:e=>Mh(t().drafts[e]),setAttachmentDrafts:(t,n)=>e(e=>{if(n.length===0){let{[t]:n,...r}=e.attachmentDrafts;return{attachmentDrafts:r}}return{attachmentDrafts:{...e.attachmentDrafts,[t]:n}}}),clearAttachmentDrafts:t=>e(e=>{let{[t]:n,...r}=e.attachmentDrafts;return{attachmentDrafts:r}}),getAttachmentDrafts:e=>t().attachmentDrafts[e]??[],forgetChats:t=>e(e=>({drafts:Object.fromEntries(Object.entries(e.drafts).filter(([e])=>!t.includes(e))),attachmentDrafts:Object.fromEntries(Object.entries(e.attachmentDrafts).filter(([e])=>!t.includes(e)))}))}),{name:`chat-input-drafts`})),Ph=r()(e=>({byProjectId:{},setForProject:(t,n)=>e(e=>({byProjectId:{...e.byProjectId,[t]:n}})),clear:t=>e(e=>{if(!(t in e.byProjectId))return e;let{[t]:n,...r}=e.byProjectId;return{byProjectId:r}})}));function Fh(e){let t=E(e)?e:null,n=Ih(t?.typographyOverride),r=Ih(t?.typographyServerDefaultCache);return{autoResumeOnRateLimit:!!t?.autoResumeOnRateLimit,typographyOverride:n,typographyServerDefaultCache:r}}function Ih(e){if(typeof e==`string`)return Vp(e)?e:void 0}var Lh=r()(sh(e=>({autoResumeOnRateLimit:!1,setAutoResumeOnRateLimit:t=>e({autoResumeOnRateLimit:t}),typographyOverride:void 0,typographyServerDefaultCache:void 0,setTypographyOverride:t=>e({typographyOverride:t}),clearTypographyOverride:()=>e({typographyOverride:void 0}),cacheTypographyServerDefault:t=>e({typographyServerDefaultCache:t})}),{name:`kanna-preferences`,version:2,migrate:e=>Fh(se(e))})),Rh=[],zh=r()(e=>({models:Rh,status:`idle`,error:null,setLoading:()=>e({status:`loading`,error:null}),setModels:t=>e({models:t,status:`ready`,error:null}),setError:t=>e({status:`error`,error:t})})),Bh=400,Vh=800;function Hh(e,t,n){for(let r of e.querySelectorAll(`[${t}]`))if(r.getAttribute(t)===n)return r.querySelector(`span.truncate`);return null}async function Uh(e,t={}){try{await Wh(e,t)}catch{}}async function Wh(e,t){let n=t.root??globalThis.document;if(!n?.body||Fp())return;let r=await Gh(n,e,t);if(!r)return;let{from:i,to:a,text:o}=r,s=n.createElement(`span`);s.textContent=o,s.setAttribute(`aria-hidden`,`true`),s.style.cssText=[`position:fixed`,`left:${i.left}px`,`top:${i.top}px`,`margin:0`,`white-space:nowrap`,`pointer-events:none`,`z-index:60`].join(`;`);let c=n.defaultView?.getComputedStyle(r.fromElement);c&&(s.style.font=c.font,s.style.color=c.color),n.body.appendChild(s);let l=!1,u=()=>{l||(l=!0,s.remove())},d=setTimeout(u,Vh);try{await Op(s,{x:a.left-i.left,y:a.top-i.top,opacity:[1,0],duration:kp.carry,ease:Ap.arriving})}finally{clearTimeout(d),u()}}async function Gh(e,t,n){let r=n.now??(()=>Date.now()),i=n.raf??(e=>{requestAnimationFrame(e)}),a=r()+Bh;for(;;){let n=Hh(e,`data-chat-id`,t),o=Hh(e,`data-tab-id`,t);if(n&&o){let e=n.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0)return{from:e,to:t,fromElement:n,text:n.textContent??``}}if(r()>=a)return null;await new Promise(e=>{i(e)})}}function Kh(e){return Number.isFinite(e)?Math.max(20,e):33}function qh(){return{isVisible:!1}}function Jh(){return{viewMode:`history`,collapsedPaths:{},summary:``,description:``}}function Yh(e,t){return e[t]??qh()}function Xh(e){for(let t of Object.values(e))if(E(t)&&typeof t.size==`number`&&Number.isFinite(t.size))return t.size;return null}function Zh(e){if(!E(e))return null;let t={};if(E(e.collapsedPaths))for(let[n,r]of Object.entries(e.collapsedPaths))typeof r==`boolean`&&(t[n]=r);return{viewMode:e.viewMode===`changes`?`changes`:`history`,collapsedPaths:t,summary:typeof e.summary==`string`?e.summary:``,description:typeof e.description==`string`?e.description:``}}function Qh(e){if(!E(e))return{size:33,projects:{},projectUi:{}};let t=E(e.projects)?e.projects:{},n=e.size,r=Kh(typeof n==`number`&&Number.isFinite(n)?n:Xh(t)??33),i={};for(let[e,n]of Object.entries(t))i[e]={isVisible:E(n)&&n.isVisible===!0};let a={};if(E(e.projectUi))for(let[t,n]of Object.entries(e.projectUi)){let e=Zh(n);e&&(a[t]=e)}return{size:r,projects:i,projectUi:a}}var $h=r()(sh(e=>({size:33,projects:{},projectUi:{},toggleVisibility:t=>e(e=>({projects:{...e.projects,[t]:{...Yh(e.projects,t),isVisible:!Yh(e.projects,t).isVisible}}})),setSize:t=>e({size:Kh(t)}),reconcileCollapsedPaths:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh(),i=Object.fromEntries(n.map(e=>[e,r.collapsedPaths[e]??!0]));return Object.keys(r.collapsedPaths).length===Object.keys(i).length&&Object.entries(i).every(([e,t])=>r.collapsedPaths[e]===t)?e:{projectUi:{...e.projectUi,[t]:{...r,collapsedPaths:i}}}}),toggleCollapsedPath:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return{projectUi:{...e.projectUi,[t]:{...r,collapsedPaths:{...r.collapsedPaths,[n]:!(r.collapsedPaths[n]??!0)}}}}}),setViewMode:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.viewMode===n?e:{projectUi:{...e.projectUi,[t]:{...r,viewMode:n}}}}),setCommitDraft:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.summary===n.summary&&r.description===n.description?e:{projectUi:{...e.projectUi,[t]:{...r,summary:n.summary,description:n.description}}}}),setCommitSummary:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.summary===n?e:{projectUi:{...e.projectUi,[t]:{...r,summary:n}}}}),setCommitDescription:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.description===n?e:{projectUi:{...e.projectUi,[t]:{...r,description:n}}}}),clearCommitDraft:t=>e(e=>{let n=e.projectUi[t]??Jh();return!n.summary&&!n.description?e:{projectUi:{...e.projectUi,[t]:{...n,summary:``,description:``}}}}),clearProject:t=>e(e=>{let{[t]:n,...r}=e.projects,{[t]:i,...a}=e.projectUi;return{projects:r,projectUi:a}})}),{name:`right-sidebar-layouts`,version:4,migrate:e=>Qh(se(e))})),eg={isVisible:!1},tg=[68,32];function ng(){return{isVisible:!1,mainSizes:[...tg],terminals:[],nextTerminalIndex:0}}function rg(e,t){return e[t]??ng()}function ig(e,t){for(let[n,r]of Object.entries(e)){let e=r.terminals.find(e=>e.id===t);if(e)return{projectId:n,terminal:e}}return null}function ag(e){if(e.length===0)return[];let t=e.reduce((e,t)=>e+Math.max(t,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(e=>Math.max(e,0)/t*100)}function og(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function sg(e){if(e.length===0)return e;let t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function cg(e,t,n){return{...e,[t]:n(rg(e,t))}}var lg=r()(sh(e=>({projects:{},addTerminal:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{let t=sg(e.terminals),r={id:globalThis.crypto?.randomUUID?.()??`terminal-${Date.now()}-${e.nextTerminalIndex}`,title:og(e.nextTerminalIndex),size:100/(t.length+1)},i=n?Math.max(t.findIndex(e=>e.id===n)+1,0):t.length;return{...e,isVisible:!0,nextTerminalIndex:e.nextTerminalIndex+1,terminals:[...t.slice(0,i),r,...t.slice(i)]}})})),removeTerminal:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{let t=e.terminals.filter(e=>e.id!==n);if(t.length===0)return{...e,isVisible:!1,terminals:[]};let r=ag(t.map(e=>e.size));return{...e,terminals:t.map((e,n)=>({...e,size:r[n]??100/t.length}))}})})),toggleVisibility:t=>e(e=>({projects:cg(e.projects,t,e=>({...e,isVisible:e.terminals.length>0&&!e.isVisible}))})),resetMainSizes:t=>e(e=>({projects:cg(e.projects,t,e=>({...e,mainSizes:[...tg]}))})),setMainSizes:(t,n)=>e(e=>{if(n.length!==2)return e;let[r=50,i=50]=ag(n),a=[r,i];return{projects:cg(e.projects,t,e=>({...e,mainSizes:a}))}}),setTerminalSizes:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{if(n.length!==e.terminals.length)return e;let t=ag(n);return{...e,terminals:e.terminals.map((e,n)=>({...e,size:t[n]??e.size}))}})})),clearProject:t=>e(e=>{let{[t]:n,...r}=e.projects;return{projects:r}})}),{name:`terminal-layouts`,version:1})),ug={isVisible:!1,mainSizes:[...tg],terminals:[],nextTerminalIndex:0};function dg(e){return e===void 0||!ne(e)?[]:e.filter(e=>typeof e==`string`)}function fg(e){let t=E(e)?e:{};return{deletedBoardIds:dg(t.deletedBoardIds),failures:dg(t.failures)}}var pg=[],mg=r()(e=>({chatIds:pg,setFollowed:t=>e({chatIds:t})}));function hg(e){return t=>e?t.chatIds.includes(e):!1}function gg(e){if(!E(e))return{ok:!1,error:`Unexpected response from the server`};let{ok:t,code:n,expiresAt:r,error:i}=e;return t===!0&&typeof n==`string`&&typeof r==`number`?{ok:!0,code:n,expiresAt:r}:{ok:!1,error:typeof i==`string`?i:`Could not create a pairing code`}}function _g(e){return E(e)?e.ok===!0?{ok:!0}:{ok:!1,error:typeof e.error==`string`?e.error:`Could not start the update`}:{ok:!1,error:`Unexpected response from the server`}}var vg=[],yg=[],bg=[],xg={},Sg={},Cg=r()((e,t)=>({changelogPendingAction:null,skillQuery:``,skillResults:vg,skillSearchLoading:!1,skillSearchError:null,installedSkills:yg,installedSkillIds:new Set,installedLoading:!1,installedError:null,skillOperationError:null,installingSkillId:null,uninstallingSkillId:null,installMessages:Sg,packageUpdateSnapshot:null,pluginInventory:null,pluginInventoryLoading:!1,pluginInventoryError:null,globalInstructionsDraft:``,globalInstructionsPersistedAtMount:``,globalInstructionsSaving:!1,globalInstructionsError:null,changelogStatus:`idle`,signingOut:!1,authEnabled:!1,releases:bg,changelogError:null,pushPermissionState:p().state,pushDeviceId:m(),scrollbackDraft:``,minColumnWidthDraft:``,tabMinWidthDraft:``,uploadMaxFileSizeDraft:``,claudeIdleMinutesDraft:``,claudeMaxConcurrentDraft:``,editorCommandDraft:``,keybindingDrafts:xg,keybindingsError:null,appSettingsError:null,analyticsDialogOpen:!1,tunnelError:null,cloudflaredPathDraft:``,pushContactSubjectDraft:``,shareDefaultTtlDraft:``,llmProviderDraft:{provider:`openai`,apiKey:``,model:``,baseUrl:``},llmProviderError:null,llmValidationStatus:`idle`,llmValidationError:null,llmValidationDialogOpen:!1,setChangelogPendingAction:t=>e({changelogPendingAction:t}),setSkillQuery:t=>e({skillQuery:t}),setSkillResults:t=>e({skillResults:t}),setSkillSearchLoading:t=>e({skillSearchLoading:t}),setSkillSearchError:t=>e({skillSearchError:t}),setInstalledSkills:t=>e({installedSkills:t}),setInstalledSkillIds:t=>e({installedSkillIds:t}),addInstalledSkillId:n=>{let r=t().installedSkillIds,i=new Set(r);i.add(n),e({installedSkillIds:i})},removeInstalledSkillId:n=>{let r=t().installedSkillIds,i=new Set(r);i.delete(n),e({installedSkillIds:i})},setInstalledLoading:t=>e({installedLoading:t}),setInstalledError:t=>e({installedError:t}),setSkillOperationError:t=>e({skillOperationError:t}),setInstallingSkillId:t=>e({installingSkillId:t}),setUninstallingSkillId:t=>e({uninstallingSkillId:t}),setInstallMessages:t=>e({installMessages:t}),setInstallMessage:(n,r)=>{let i=t().installMessages;e({installMessages:{...i,[n]:r}})},clearInstallMessage:n=>{let r={...t().installMessages};delete r[n],e({installMessages:r})},clearInstallMessagesForSkill:n=>{let r={...t().installMessages};for(let e of Object.keys(r))(e.endsWith(`/${n}`)||e===n)&&delete r[e];e({installMessages:r})},setPackageUpdateSnapshot:t=>e({packageUpdateSnapshot:t}),setPluginInventory:t=>e({pluginInventory:t}),setPluginInventoryLoading:t=>e({pluginInventoryLoading:t}),setPluginInventoryError:t=>e({pluginInventoryError:t}),setGlobalInstructionsDraft:t=>e({globalInstructionsDraft:t}),setGlobalInstructionsPersistedAtMount:t=>e({globalInstructionsPersistedAtMount:t}),setGlobalInstructionsSaving:t=>e({globalInstructionsSaving:t}),setGlobalInstructionsError:t=>e({globalInstructionsError:t}),setChangelogStatus:t=>e({changelogStatus:t}),setSigningOut:t=>e({signingOut:t}),setAuthEnabled:t=>e({authEnabled:t}),setReleases:t=>e({releases:t}),setChangelogError:t=>e({changelogError:t}),setPushPermissionState:t=>e({pushPermissionState:t}),setPushDeviceId:t=>e({pushDeviceId:t}),setScrollbackDraft:t=>e({scrollbackDraft:t}),setMinColumnWidthDraft:t=>e({minColumnWidthDraft:t}),setTabMinWidthDraft:t=>e({tabMinWidthDraft:t}),setUploadMaxFileSizeDraft:t=>e({uploadMaxFileSizeDraft:t}),setClaudeIdleMinutesDraft:t=>e({claudeIdleMinutesDraft:t}),setClaudeMaxConcurrentDraft:t=>e({claudeMaxConcurrentDraft:t}),setEditorCommandDraft:t=>e({editorCommandDraft:t}),setKeybindingDrafts:t=>e({keybindingDrafts:t}),setKeybindingDraft:(t,n)=>e(e=>e.keybindingDrafts[t]===n?e:{keybindingDrafts:{...e.keybindingDrafts,[t]:n}}),setKeybindingsError:t=>e({keybindingsError:t}),setAppSettingsError:t=>e({appSettingsError:t}),setAnalyticsDialogOpen:t=>e({analyticsDialogOpen:t}),setTunnelError:t=>e({tunnelError:t}),setCloudflaredPathDraft:t=>e({cloudflaredPathDraft:t}),setPushContactSubjectDraft:t=>e({pushContactSubjectDraft:t}),setShareDefaultTtlDraft:t=>e({shareDefaultTtlDraft:t}),setLlmProviderDraft:t=>e({llmProviderDraft:t}),setLlmProviderError:t=>e({llmProviderError:t}),setLlmValidationStatus:t=>e({llmValidationStatus:t}),setLlmValidationError:t=>e({llmValidationError:t}),setLlmValidationDialogOpen:t=>e({llmValidationDialogOpen:t})})),wg=`main`;function Tg(e){return e.kind===`pane`}function Eg(e){return e.kind===`group`}var Dg=.1;function Og(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function kg(e){return Array.from({length:e},()=>1/e)}function Ag(e,t){if(t<=0)return[];if(t===1)return[1];let n=Array.from({length:t},(t,n)=>{let r=e?.[n];return Og(r)?r:1}),r=n.reduce((e,t)=>e+t,0);return r<=0?kg(t):n.map(e=>e/r)}function jg(e){let t=e.length;if(t===0)return[];if(t===1)return[1];if(t*.1>1)return kg(t);let n=Ag(e,t),r=Array(t).fill(0),i=new Set(n.map((e,t)=>t)),a=1;for(;i.size>0;){let e=0;for(let t of i)e+=n[t]??0;if(e<=0){let e=a/i.size;for(let t of i)r[t]=e;break}let t=[];for(let r of i)(n[r]??0)/e*a<.1&&t.push(r);if(t.length===0){for(let t of i)r[t]=(n[t]??0)/e*a;break}for(let e of t)r[e]=Dg,i.delete(e),a-=Dg}return Ag(r,t)}function Mg(e,t,n){let r=e[t],i=e[t+1];if(r===void 0||i===void 0||!Number.isFinite(n))return[...e];let a=r+i;if(a<=0)return[...e];let o=Math.min(Dg,a/2),s=Math.min(a-o,Math.max(o,r+n)),c=[...e];return c[t]=s,c[t+1]=a-s,c}function Ng(e){return`${e.length}_${e}`}function Pg(e){switch(e.kind){case`chat`:return`chat_${Ng(e.chatId)}`;case`changes`:return`changes`;case`terminal`:return`terminal_${Ng(e.terminalId)}`;case`board`:return`board_${Ng(e.boardId)}`}}function Fg(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Ig(e){if(e===void 0||!E(e))return null;switch(e.kind){case`chat`:{let t=Fg(e.chatId);return t?{kind:`chat`,chatId:t}:null}case`changes`:return{kind:`changes`};case`terminal`:{let t=Fg(e.terminalId);return t?{kind:`terminal`,terminalId:t}:null}case`board`:{let t=Fg(e.boardId);return t?{kind:`board`,boardId:t}:null}default:return null}}function Lg(e,t){return{tabId:Pg(e),target:e,createdAt:t}}function Rg(e,t=[],n){let r=new Set,i=[];for(let e of t)r.has(e.tabId)||(r.add(e.tabId),i.push(e));return{kind:`pane`,id:e,tabs:i,focusedTabId:n&&r.has(n)?n:i[0]?.tabId??null}}function zg(e,t,n,r){return n.length===0?Rg(e):n.length===1?n[0]:{kind:`group`,id:e,direction:t,children:[...n],sizes:Ag(r,n.length)}}function Bg(){return{root:Rg(wg),focusedPaneId:wg}}function Vg(e){return Tg(e)?1:1+Math.max(...e.children.map(Vg))}function Hg(e){return Tg(e)?[e]:e.children.flatMap(Hg)}function Ug(e,t){if(Tg(e))return e.id===t?[]:null;for(let[n,r]of e.children.entries()){let e=Ug(r,t);if(e)return[n,...e]}return null}function Wg(e,t){if(Tg(e))return e.tabs.some(e=>e.tabId===t)?{pane:e,path:[]}:null;for(let[n,r]of e.children.entries()){let e=Wg(r,t);if(e)return{pane:e.pane,path:[n,...e.path]}}return null}function Gg(e,t){let n=e;for(let e of t){if(!n||!Eg(n))return null;n=n.children[e]}return n??null}function Kg(e,t){let n=Ug(e,t);if(!n)return null;for(let t=n.length-1;t>=0;t--){let r=Gg(e,n.slice(0,t));if(!r||!Eg(r))continue;let i=n[t];for(let e=i-1;e>=0;e--){let t=Hg(r.children[e]).at(-1);if(t)return t.id}for(let e=i+1;e<r.children.length;e++){let t=Hg(r.children[e])[0];if(t)return t.id}}return null}function qg(e,t,n){if(t.length===0)return n;let[r,...i]=t;if(!Eg(e))return e;let a=e.children[r];if(!a)return e;let o=[...e.children];return o[r]=qg(a,i,n),zg(e.id,e.direction,o,e.sizes)}function Jg(e,t){if(t.length===0)return Rg(e.id);let n=t.slice(0,-1),r=t.at(-1),i=Gg(e,n);if(!i||!Eg(i))return e;let a=i.children.filter((e,t)=>t!==r),o=i.sizes.filter((e,t)=>t!==r);return qg(e,n,zg(i.id,i.direction,a,jg(o)))}function Yg(e,t,n={}){let r=Wg(e,t);if(!r)return{root:e,tab:null,sourcePaneId:null};let{pane:i,path:a}=r,o=i.tabs.find(e=>e.tabId===t)??null,s=i.tabs.filter(e=>e.tabId!==t);if(s.length>0||i.id===n.preserveEmptyPaneId){let n=i.focusedTabId===t?void 0:i.focusedTabId;return{root:qg(e,a,Rg(i.id,s,n)),tab:o,sourcePaneId:i.id}}return{root:Jg(e,a),tab:o,sourcePaneId:i.id}}function Xg(e,t,n,r={}){let i=Ug(e,t);if(!i)return null;let a=Gg(e,i);if(!a||!Tg(a))return null;let o=a.tabs.filter(e=>e.tabId!==n.tabId),s=r.index??o.length;o.splice(Math.max(0,Math.min(s,o.length)),0,n);let c=r.focus??!0?n.tabId:a.focusedTabId??n.tabId;return qg(e,i,Rg(a.id,o,c))}function Zg(e){return e===`left`||e===`right`?`horizontal`:`vertical`}function Qg(e){return e===`right`||e===`bottom`}function $g(e){return Hg(e)[0]?.id??null}function e_(e,t){let{tabId:n,targetPaneId:r,position:i,ids:a}=t;if(!Ug(e.root,r))return null;let o=Wg(e.root,n);if(!o||o.pane.id===r&&o.pane.tabs.length<=1)return null;let s=Yg(e.root,n,{preserveEmptyPaneId:r});if(!s.tab)return null;let c=Ug(s.root,r);if(!c)return null;let l=Zg(i),u=Qg(i),d=Rg(a.paneId,[s.tab],s.tab.tabId),f=c.slice(0,-1),p=f.length>0||c.length>0?Gg(s.root,f):null,m;if(p&&Eg(p)&&p.direction===l){let e=c.at(-1),t=[...p.children],n=[...p.sizes],r=n[e]??1/t.length,i=u?e+1:e;t.splice(i,0,d),n.splice(i,0,r/2),n[u?e:e+1]=r/2,m=qg(s.root,f,zg(p.id,p.direction,t,n))}else{let e=Gg(s.root,c);if(!e)return null;let t=u?[e,d]:[d,e];m=qg(s.root,c,zg(a.groupId,l,t,[.5,.5]))}return Vg(m)>4?null:{root:m,focusedPaneId:a.paneId}}function t_(e,t){let n=e.indexOf(t);return n<0?null:e[n+1]??(n>0?e[n-1]??null:null)}function n_(e,t){let n=Wg(e.root,t);if(!n)return null;let{pane:r}=n,i=r.focusedTabId===t?t_(r.tabs.map(e=>e.tabId),t):null,a=Kg(e.root,r.id),o=Yg(e.root,t).root,s={root:o,focusedPaneId:e.focusedPaneId===null?null:(Ug(o,e.focusedPaneId)?e.focusedPaneId:null)??(a&&Ug(o,a)?a:null)??$g(o)??`main`};return i?i_(s,i)??s:s}function r_(e,t,n,r){let i=Wg(e.root,t);if(!i||!Ug(e.root,n))return null;let a=i.pane.id===n,o=Yg(e.root,t,{preserveEmptyPaneId:a?n:void 0});if(!o.tab)return null;let s=Xg(o.root,n,o.tab,{index:r});return s?{root:s,focusedPaneId:n}:null}function i_(e,t){let n=Wg(e.root,t);if(!n)return null;let{pane:r,path:i}=n;return r.focusedTabId===t&&e.focusedPaneId===r.id?null:{root:qg(e.root,i,Rg(r.id,r.tabs,t)),focusedPaneId:r.id}}function a_(e,t){return e.focusedPaneId===t||!Ug(e.root,t)?null:{...e,focusedPaneId:t}}function o_(e,t,n){let r=Ug(e.root,t);if(!r)return null;let i=Gg(e.root,r);if(!i||!Tg(i))return null;let a=new Map(i.tabs.map(e=>[e.tabId,e])),o=new Set,s=[];for(let e of n){let t=a.get(e);t&&!o.has(e)&&(o.add(e),s.push(t))}for(let e of i.tabs)o.has(e.tabId)||s.push(e);if(s.every((e,t)=>e.tabId===i.tabs[t]?.tabId))return null;let c=qg(e.root,r,Rg(i.id,s,i.focusedTabId));return{...e,root:c}}function s_(e,t,n={createdAt:0}){let r=Pg(t),i=n.focus??!0;if(Wg(e.root,r))return i?{layout:i_(e,r)??e,tabId:r}:{layout:e,tabId:r};let a=(e.focusedPaneId&&Ug(e.root,e.focusedPaneId)?e.focusedPaneId:null)??$g(e.root);if(!a)return null;let o=Xg(e.root,a,Lg(t,n.createdAt),{focus:i});return o?{layout:{root:o,focusedPaneId:i?a:e.focusedPaneId},tabId:r}:null}function c_(e,t,n=[]){if(Eg(e)){if(e.id===t)return n;for(let[r,i]of e.children.entries()){let e=c_(i,t,[...n,r]);if(e)return e}}return null}function l_(e,t,n){let r=c_(e.root,t);if(!r)return null;let i=Gg(e.root,r);if(!i||!Eg(i)||n.length!==i.children.length)return null;let a=jg(Ag(n,i.children.length));if(a.every((e,t)=>Math.abs(e-(i.sizes[t]??0))<1e-6))return null;let o=qg(e.root,r,zg(i.id,i.direction,i.children,a));return{...e,root:o}}function u_(e,t,n,r){if(r===0||!Number.isFinite(r))return null;let i=c_(e.root,t);if(!i)return null;let a=Gg(e.root,i);if(!a||!Eg(a))return null;let o=Mg(a.sizes,n,r);if(o.every((e,t)=>Math.abs(e-(a.sizes[t]??0))<1e-9))return null;let s=qg(e.root,i,zg(a.id,a.direction,a.children,o));return{...e,root:s}}var d_={left:0,top:0,right:1,bottom:1};function f_(e,t=d_){if(Tg(e))return[{paneId:e.id,rect:t}];let n=e.direction===`horizontal`,r=n?t.right-t.left:t.bottom-t.top,i=[],a=n?t.left:t.top;for(let[o,s]of e.children.entries()){let c=(e.sizes[o]??0)*r,l=n?{...t,left:a,right:a+c}:{...t,top:a,bottom:a+c};i.push(...f_(s,l)),a+=c}return i}function p_(e,t,n,r){return t<=n?n-t:r<=e?e-r:0}function m_(e,t,n,r){return Math.max(0,Math.min(t,r)-Math.max(e,n))}function h_(e,t,n){switch(e){case`left`:return t.left-n.right;case`right`:return n.left-t.right;case`up`:return t.top-n.bottom;case`down`:return n.top-t.bottom}}function g_(e,t,n){let r=f_(e),i=r.find(e=>e.paneId===t);if(!i)return null;let a=r.filter(e=>e.paneId!==t).map(e=>{let{rect:t}=e,r=i.rect,a=h_(n,r,t),o=n===`left`||n===`right`,s=o?r.top:r.left,c=o?r.bottom:r.right,l=o?t.top:t.left,u=o?t.bottom:t.right,d=p_(s,c,l,u),f=m_(s,c,l,u),p=Math.abs((s+c)/2-(l+u)/2);return{paneId:e.paneId,primary:a,perpendicular:d,shared:f,centreDistance:p}}).filter(e=>e.primary>=-1e-6);return a.length===0?null:(a.sort((e,t)=>e.primary-t.primary||e.perpendicular-t.perpendicular||t.shared-e.shared||e.centreDistance-t.centreDistance||e.paneId.localeCompare(t.paneId)),a[0]?.paneId??null)}var __=.05,v_={left:`horizontal`,right:`horizontal`,up:`vertical`,down:`vertical`},y_={left:-1,right:1,up:-1,down:1};function b_(e,t,n,r=__){let i=Ug(e,t);if(!i)return null;let a=v_[n];for(let t=i.length-1;t>=0;t--){let o=Gg(e,i.slice(0,t));if(!o||!Eg(o)||o.direction!==a)continue;let s=i[t],c=s<o.children.length-1?s:s-1;if(!(c<0))return{groupId:o.id,index:c,deltaRatio:y_[n]*r}}return null}function x_(e,t){return`${e}-recovered-${t||`root`}`}function S_(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function C_(e){return e===`vertical`?`vertical`:`horizontal`}function w_(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function T_(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!E(n))continue;let e=Ig(n.target);e&&t.push(Lg(e,w_(n.createdAt)??0))}return t}function E_(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=w_(n);e!==null&&t.push(e)}return t}function D_(e,t,n){if(e===void 0||!E(e))return null;let r=S_(e.id);if(e.kind===`pane`)return Rg(r??x_(`pane`,n),T_(e.tabs),S_(e.focusedTabId));if(e.kind!==`group`||!Array.isArray(e.children))return null;if(t>=4){let r=e.children.map((e,r)=>D_(e,t,`${n}.${r}`)).filter(e=>e!==null).flatMap(Hg),i=r[0];return i?Rg(i.id,r.flatMap(e=>e.tabs)):null}let i=e.children.map((e,r)=>D_(e,t+1,`${n}.${r}`)).filter(e=>e!==null);return i.length===0?null:zg(r??x_(`group`,n),C_(e.direction),i,E_(e.sizes))}function O_(e,t){if(e===null)return null;let n=S_(e);return n&&t.some(e=>e.id===n)?n:t[0]?.id??`main`}function k_(e){if(e===void 0||!E(e))return Bg();let t=D_(e.root,1,``);if(!t)return Bg();let n=Hg(t);return n.length===0?Bg():{root:t,focusedPaneId:O_(e.focusedPaneId,n)}}var A_=`main`,j_=`changes`,M_=`workspace`,N_=`terminals`,P_=`root`;function F_(e,t){return!Number.isFinite(e)||e<=0||e>=100?t:e/100}function I_(e){let t=Rg(A_,[]),n=e.terminals.filter(e=>e.id.trim().length>0).map((e,t)=>Rg(`terminal-${e.id}`,[Lg({kind:`terminal`,terminalId:e.id.trim()},t)])),r=n.length>0?zg(N_,`horizontal`,n,[...e.terminalSizes]):null,i=F_(e.mainSizes[0],.68),a=r?zg(M_,`vertical`,[t,r],[i,1-i]):t;if(!e.changesVisible)return{root:a,focusedPaneId:A_};let o=F_(e.changesSizePercent,.33);return{root:zg(P_,`horizontal`,[a,Rg(j_,[Lg({kind:`changes`},0)])],[1-o,o]),focusedPaneId:A_}}function L_(e){return Hg(e.root).find(t=>t.id===e.focusedPaneId)??null}function R_(e){return L_(e)?.focusedTabId??null}function z_(e,t){let n=R_(t);return!n||e[0]===n?e:[n,...e.filter(e=>e!==n)].slice(0,50)}function B_(e,t){let n=Hg(e.root).flatMap((e,t)=>e.tabs.map(e=>({tab:e,paneOrdinal:t+1}))),r=new Map,i=R_(e);i&&r.set(i,-1),t.forEach((e,t)=>{r.has(e)||r.set(e,t)});let a=2**53-1;return n.map((e,t)=>({entry:e,layoutIndex:t,rank:r.get(e.tab.tabId)??a})).sort((e,t)=>e.rank-t.rank||e.layoutIndex-t.layoutIndex).map(({entry:e})=>e)}function V_(e,t){return!e||e.tabs.length===0?null:t===9?e.tabs[e.tabs.length-1].tabId:e.tabs[t-1]?.tabId??null}function H_(e,t){return e<8?String(e+1):e===t-1?`9`:null}function U_(e,t){let n=zm(e,`openTabSwitcher`).find(e=>Wm(e,t));if(!n)return null;let r=n.split(`+`).some(e=>e.trim().toLowerCase()===`shift`);return{binding:n,reverse:t.shiftKey&&!r}}function W_(e,t){return zm(e,`jumpToPaneTab`).some(e=>Um(e,t))}function G_(e,t){if(!W_(e,t)||!t.code.startsWith(`Digit`))return null;let n=Number(t.code.slice(5));return n>=1&&n<=9?n:null}function K_(e){return Hg(e.root).some(e=>e.tabs.length>0)}var q_=r()(sh((e,t)=>{function n(t){e(e=>{let n=t(e.layout);return n?{...e,layout:n,recentTabIds:z_(e.recentTabIds,n)}:e})}function r(){let n=t().nodeSequence+1;return e({nodeSequence:n}),{paneId:`pane-${n}`,groupId:`group-${n}`}}return{layout:Bg(),nodeSequence:0,recentTabIds:[],getLayout:()=>t().layout,openTab:e=>n(t=>s_(t,e,{createdAt:0})?.layout??null),closeTab:e=>n(t=>n_(t,e)),closeTabsFor:({chatIds:e,boardIds:t})=>n(n=>{let r=Hg(n.root).flatMap(e=>e.tabs).filter(({target:n})=>n.kind===`chat`&&e.includes(n.chatId)||n.kind===`board`&&t.includes(n.boardId));return r.length===0?null:r.reduce((e,t)=>n_(e,t.tabId)??e,n)}),focusTab:e=>n(t=>i_(t,e)),focusPane:e=>n(t=>a_(t,e)),splitPane:e=>{let t=r();n(n=>e_(n,{...e,ids:t}))},moveTabToPane:(e,t,r)=>n(n=>r_(n,e,t,r)),focusAdjacentPane:e=>n(t=>{if(!t.focusedPaneId)return null;let n=g_(t.root,t.focusedPaneId,e);return n?a_(t,n):null}),resizeFocusedPane:e=>n(t=>{if(!t.focusedPaneId)return null;let n=b_(t.root,t.focusedPaneId,e);return n?u_(t,n.groupId,n.index,n.deltaRatio):null}),cycleFocusedPaneTab:e=>n(t=>{let n=Hg(t.root).find(e=>e.id===t.focusedPaneId);if(!n||n.tabs.length===0)return null;let r=n.tabs.findIndex(e=>e.tabId===n.focusedTabId),i=(((r===-1?0:r)+e)%n.tabs.length+n.tabs.length)%n.tabs.length;return i_(t,n.tabs[i].tabId)}),closeFocusedTab:()=>n(e=>{let t=Hg(e.root).find(t=>t.id===e.focusedPaneId),n=t?.focusedTabId??t?.tabs[0]?.tabId;return n?n_(e,n):null}),splitFocusedPane:e=>{let i=t().layout,a=Hg(i.root).find(e=>e.id===i.focusedPaneId),o=a?.focusedTabId??a?.tabs[0]?.tabId;if(!a||!o)return;let s=r();n(t=>e_(t,{tabId:o,targetPaneId:a.id,position:e,ids:s}))},reorderPaneTabs:(e,t)=>n(n=>o_(n,e,t)),resizeGroup:(e,t,r)=>n(n=>u_(n,e,t,r)),setGroupSizes:(e,t)=>n(n=>l_(n,e,t)),seedFromLegacy:t=>e(e=>{if(K_(e.layout))return e;let n=I_(t);return{...e,layout:n,recentTabIds:z_(e.recentTabIds,n)}})}},{name:`pane-layouts`,version:2,migrate:(e,t)=>{if(t>=2)return e;let n=o(e)?e.nodeSequence:void 0;return{nodeSequence:typeof n==`number`?n:0}},merge:(e,t)=>{if(!o(e))return t;let n=k_(se(e.layout)),r=K_(n)?n:t.layout,i=e.nodeSequence,a=typeof i==`number`&&Number.isFinite(i)?i:0,s=e.recentTabIds,c=Array.isArray(s)?s.filter(e=>typeof e==`string`):t.recentTabIds;return{...t,layout:r,nodeSequence:a,recentTabIds:c}},partialize:e=>({layout:e.layout,nodeSequence:e.nodeSequence,recentTabIds:e.recentTabIds})})),J_=r()(sh(e=>({checkedPathsByProjectId:{},reconcileProject:(t,n)=>e(e=>{let r=e.checkedPathsByProjectId[t]??{},i=Object.fromEntries(n.map(e=>[e,r[e]??!0]));return Object.keys(r).length===Object.keys(i).length&&Object.entries(i).every(([e,t])=>r[e]===t)?e:{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:i}}}),toggleChecked:(t,n)=>e(e=>{let r=e.checkedPathsByProjectId[t]??{};return{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:{...r,[n]:!(r[n]??!0)}}}}),toggleAllChecked:(t,n)=>e(e=>{if(n.length===0)return e;let r=e.checkedPathsByProjectId[t]??{},i=!n.every(e=>r[e]??!0);return{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:{...r,...Object.fromEntries(n.map(e=>[e,i]))}}}}),clearProject:t=>e(e=>{let{[t]:n,...r}=e.checkedPathsByProjectId;return{checkedPathsByProjectId:r}})}),{name:`diff-commit-selections`,version:2}));function Y_(e){Nh.getState().forgetChats(e.chatIds),wh.getState().forgetChats(e.chatIds),q_.getState().closeTabsFor({chatIds:e.chatIds,boardIds:e.boardIds??[]}),e.projectId&&J_.getState().clearProject(e.projectId)}function X_(e,t){let n=t.getItem(e);if(!n)return null;let r=D(n);return r===null||!E(r)?null:E(r.state)?r.state:null}function Z_(e){if(!E(e))return;let t={};if(E(e.claude)){let n=Q_(e.claude),r=e.claude.modelOptions;if(E(r)){let e=$_(r.reasoningEffort),t=$_(r.contextWindow);cm(e)&&dm(t)&&(n.modelOptions={reasoningEffort:e,contextWindow:t})}t.claude=n}if(E(e.codex)){let n=Q_(e.codex),r=e.codex.modelOptions;if(E(r)){let e=$_(r.reasoningEffort);lm(e)&&typeof r.fastMode==`boolean`&&(n.modelOptions={reasoningEffort:e,fastMode:r.fastMode})}t.codex=n}return E(e.openrouter)&&(t.openrouter=Q_(e.openrouter)),Object.keys(t).length>0?t:void 0}function Q_(e){let t={};return typeof e.model==`string`&&(t.model=e.model),typeof e.planMode==`boolean`&&(t.planMode=e.planMode),t}function $_(e){return typeof e==`string`?e:void 0}async function ev(e,t=d){let n=await t.getJson(`/auth/status`,{cache:`no-store`,signal:e});return n.ok?n.data:{}}async function tv(e,t=d){let n={password:e.password};return e.next&&(n.next=e.next),(await t.postJson(`/auth/login`,n)).ok}async function nv(e=d){await e.postJson(`/auth/logout`,{})}function rv(e){let t=(0,k.useCallback)(async t=>{try{await e.command(t),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]);return{handleCreateStack:(0,k.useCallback)((e,n,r)=>t({type:`stack.create`,title:e,projectIds:n,...r?{instructions:r}:{}}),[t]),handleRenameStack:(0,k.useCallback)((e,n)=>t({type:`stack.rename`,stackId:e,title:n}),[t]),handleRemoveStack:(0,k.useCallback)(e=>t({type:`stack.remove`,stackId:e}),[t]),handleAddProjectToStack:(0,k.useCallback)((e,n)=>t({type:`stack.addProject`,stackId:e,projectId:n}),[t]),handleRemoveProjectFromStack:(0,k.useCallback)((e,n)=>t({type:`stack.removeProject`,stackId:e,projectId:n}),[t]),handleSetProjectInstructions:(0,k.useCallback)((e,n)=>t({type:`project.setInstructions`,projectId:e,instructions:n}),[t]),handleSetStackInstructions:(0,k.useCallback)((e,n)=>t({type:`stack.setInstructions`,stackId:e,instructions:n}),[t])}}function $(e,t){return e===t}function iv(e,t){for(let n of[`claude`,`codex`,`openrouter`])if(e[n]!==t[n])return!1;return!0}function av(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.id===r.id&&e.taskType===r.taskType&&e.description===r.description&&e.startedAt===r.startedAt})}var ov={chatId:$,projectId:$,localPath:$,title:$,status:$,isDraining:$,provider:$,planMode:$,sessionTokensByProvider:iv,timings:()=>!0,policyOverride:()=>!0,sessionState:()=>!0,backgroundTasks:av};function sv(e,t){return e===t?!0:!e||!t?!1:ov.chatId(e.chatId,t.chatId)&&ov.projectId(e.projectId,t.projectId)&&ov.localPath(e.localPath,t.localPath)&&ov.title(e.title,t.title)&&ov.status(e.status,t.status)&&ov.isDraining(e.isDraining,t.isDraining)&&ov.provider(e.provider,t.provider)&&ov.planMode(e.planMode,t.planMode)&&ov.sessionTokensByProvider(e.sessionTokensByProvider,t.sessionTokensByProvider)&&ov.timings(e.timings,t.timings)&&ov.policyOverride(e.policyOverride,t.policyOverride)&&ov.sessionState(e.sessionState,t.sessionState)&&ov.backgroundTasks(e.backgroundTasks,t.backgroundTasks)}function cv(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return!!r&&e.path===r.path&&e.changeType===r.changeType&&e.isUntracked===r.isUntracked&&e.additions===r.additions&&e.deletions===r.deletions&&e.patchDigest===r.patchDigest&&e.mimeType===r.mimeType&&e.size===r.size})}function lv(e,t){let n=e?.entries??[],r=t?.entries??[];return n.length===r.length&&n.every((e,t)=>{let n=r[t];return!!n&&e.sha===n.sha&&e.summary===n.summary&&e.description===n.description&&e.authorName===n.authorName&&e.authoredAt===n.authoredAt&&e.githubUrl===n.githubUrl&&e.tags.length===n.tags.length&&e.tags.every((e,t)=>e===n.tags[t])})}var uv={status:$,files:cv,branchHistory:lv,branchName:$,defaultBranchName:$,hasOriginRemote:$,originRepoSlug:$,hasUpstream:$,aheadCount:$,behindCount:$,lastFetchedAt:$};function dv(e,t){return e===t?!0:!e||!t?!1:uv.status(e.status,t.status)&&uv.files(e.files,t.files)&&uv.branchHistory(e.branchHistory,t.branchHistory)&&uv.branchName(e.branchName,t.branchName)&&uv.defaultBranchName(e.defaultBranchName,t.defaultBranchName)&&uv.hasOriginRemote(e.hasOriginRemote,t.hasOriginRemote)&&uv.originRepoSlug(e.originRepoSlug,t.originRepoSlug)&&uv.hasUpstream(e.hasUpstream,t.hasUpstream)&&uv.aheadCount(e.aheadCount,t.aheadCount)&&uv.behindCount(e.behindCount,t.behindCount)&&uv.lastFetchedAt(e.lastFetchedAt,t.lastFetchedAt)}function fv(e,t){return!!(e&&e.status!==`unknown`&&t&&t.status===`unknown`&&t.files.length===0)}var pv=`kanna:ui-update-restart`,mv=`kanna:last-update-reload-request`;function hv(e,t){return t===`updating`||t===`restart_pending`?{active:!0,label:`Installing update`}:e===`awaiting_disconnect`||e===`awaiting_server_ready`?{active:!0,label:`Re-deploying Kanna`}:{active:!1,label:``}}function gv(e,t){switch(t.kind){case`reload_requested`:return String(t.reloadRequestedAt)===t.lastHandled?e:`awaiting_disconnect`;case`update_initiated`:return`awaiting_disconnect`;case`connection_status_changed`:return t.connectionStatus===`disconnected`&&e===`awaiting_disconnect`?`awaiting_server_ready`:e;case`server_ready`:return`idle`;case`aborted`:return`idle`;case`update_status_changed`:return e}}var _v=class{deps;phase;updateStatus=null;pollCancelled=!1;pollTimeoutId=null;isServerReady;constructor(e,t){this.deps=e,this.isServerReady=t.isServerReady;let n=e.storage.getItem(pv);this.phase=n===`awaiting_disconnect`||n===`awaiting_server_ready`?n:`idle`,this.phase===`awaiting_server_ready`&&this.startPolling()}getSnapshot(){return{phase:this.phase,activity:hv(this.phase,this.updateStatus)}}emit(){this.deps.onSnapshot(this.getSnapshot())}setPhase(e){e!==this.phase&&(this.phase=e,e===`idle`?this.deps.storage.removeItem(pv):this.deps.storage.setItem(pv,e),this.emit())}dispatch(e){if(e.kind===`update_status_changed`){let t=this.updateStatus;this.updateStatus=e.updateStatus,t!==this.updateStatus&&this.emit();return}let t=gv(this.phase,e);e.kind===`reload_requested`&&t===`awaiting_disconnect`&&this.deps.storage.setItem(mv,String(e.reloadRequestedAt)),this.setPhase(t),t===`awaiting_server_ready`&&this.startPolling()}startPolling(){this.pollCancelled=!1,ae(`appRuntime.poll`,this.poll())}async poll(){try{if(await this.isServerReady()){if(this.pollCancelled)return;this.setPhase(`idle`),this.deps.dom.reload();return}}catch{}this.pollCancelled||(this.pollTimeoutId=this.deps.timer.setTimeout(()=>{ae(`appRuntime.poll`,this.poll())},500))}close(){this.pollCancelled=!0,this.pollTimeoutId!==null&&(this.deps.timer.clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}static getLastHandledReloadRequest(e){return e.getItem(mv)}},vv=`settings.readLlmProvider`,yv=`chat.compose`,bv=`lever-theme`,xv=`chat-sound-preferences`,Sv=`terminal-preferences`,Cv=`chat-preferences`;function wv(e,t){t&&t.projectId===e&&Ph.getState().setForProject(t.projectId,t.commands)}function Tv(e){let t={},n=e.getItem(bv);(n===`light`||n===`dark`||n===`system`)&&(t.theme=n);let r=X_(xv,e);(r?.chatSoundPreference===`never`||r?.chatSoundPreference===`unfocused`||r?.chatSoundPreference===`always`)&&(t.chatSoundPreference=r.chatSoundPreference),(r?.chatSoundId===`blow`||r?.chatSoundId===`bottle`||r?.chatSoundId===`frog`||r?.chatSoundId===`funk`||r?.chatSoundId===`glass`||r?.chatSoundId===`ping`||r?.chatSoundId===`pop`||r?.chatSoundId===`purr`||r?.chatSoundId===`tink`)&&(t.chatSoundId=r.chatSoundId);let i=X_(Sv,e);if(i){t.terminal={},typeof i.scrollbackLines==`number`&&(t.terminal.scrollbackLines=i.scrollbackLines),typeof i.minColumnWidth==`number`&&(t.terminal.minColumnWidth=i.minColumnWidth);let e={};(i.editorPreset===`cursor`||i.editorPreset===`vscode`||i.editorPreset===`xcode`||i.editorPreset===`windsurf`||i.editorPreset===`custom`)&&(e.preset=i.editorPreset),typeof i.editorCommandTemplate==`string`&&(e.commandTemplate=i.editorCommandTemplate),Object.keys(e).length>0&&(t.editor=e)}let a=X_(Cv,e);(a?.defaultProvider===`last_used`||a?.defaultProvider===`claude`||a?.defaultProvider===`codex`)&&(t.defaultProvider=a.defaultProvider);let o=a?Z_(a.providerDefaults):null;return o&&(t.providerDefaults=o),t.browserSettingsMigrated=!0,Object.keys(t).length>1?t:null}function Ev(e){e.removeItem(bv),e.removeItem(xv),e.removeItem(Sv),e.removeItem(Cv)}function Dv(e,t){if(!t?.length||e.length<=1)return e;let n=new Map(e.map((e,t)=>[e.groupKey,t])),r=new Set,i=t.map(t=>{if(r.has(t))return null;r.add(t);let i=n.get(t);return i===void 0?null:e[i]}).filter(e=>!!e);if(i.length===0)return e;let a=[...i,...e.filter(e=>!r.has(e.groupKey))];return a.every((t,n)=>t===e[n])?e:a}function Ov(e,t){let n=e.find(e=>e.chats.some(e=>e.chatId===t));return n?n.chats.find(e=>e.chatId!==t)?.chatId??null:null}function kv(e,t){return t?e.find(e=>e.chats.some(e=>e.chatId===t))?.groupKey??null:null}function Av(e,t){let n=e.find(e=>e.groupKey===t);return n?n.chats.find(e=>e.provider!=null)?.provider??null??n.sourceProvider??null:null}function jv(e,t){return t===`updating`||t===`restart_pending`?{active:!0,label:`Installing update`}:e===`awaiting_disconnect`||e===`awaiting_server_ready`?{active:!0,label:`Re-deploying Kanna`}:{active:!1,label:``}}function Mv(e){let t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:`project_id`,projectId:t}:e.fallbackLocalProjectPath?{kind:`local_path`,localPath:e.fallbackLocalProjectPath}:null}function Nv(e,t,n,r,i,o,s,c,l){let d=Xu(),p=g(e=>e.sidebarData),m=g(e=>e.optimisticSidebarProjectOrder),_=g(e=>e.localProjects),v=g(e=>e.updateSnapshot),y=g(e=>e.uiRestartPhase),b=g(e=>e.keybindings),x=T(e=>e.settings),S=g(e=>e.pushConfig),C=g(e=>e.llmProvider),w=g(e=>e.connectionStatus),ee=g(e=>e.sidebarReady),ne=g(e=>e.localProjectsReady),E=g(e=>e.sidebarOpen),D=g(e=>e.sidebarCollapsed),ie=g(e=>e.addProjectModalOpen),se=g(e=>e.commandError),O=g(e=>e.startingLocalPath),le=g(e=>e.selectedProjectId),ue=q_(oe(e=>Hg(e.layout.root).flatMap(e=>e.tabs).flatMap(e=>e.target.kind===`chat`?[e.target.chatId]:[]))),de=c?.projectId??null,fe=(0,k.useRef)(null);(0,k.useEffect)(()=>{let e=new _v({storage:n,dom:r,timer:i,onSnapshot:e=>{g.getState().setUiRestartPhase(e.phase===`idle`?null:e.phase)}},{isServerReady:async()=>{let e=await ev();return Object.keys(e).length>0}});return fe.current=e,()=>{e.close(),fe.current=null}},[r,n,i]),(0,k.useEffect)(()=>{fe.current?.dispatch({kind:`update_status_changed`,updateStatus:v?.status})},[v?.status]),(0,k.useEffect)(()=>{let e=fe.current;e&&v?.reloadRequestedAt&&e.dispatch({kind:`reload_requested`,reloadRequestedAt:v.reloadRequestedAt,lastHandled:_v.getLastHandledReloadRequest(n)})},[n,v?.reloadRequestedAt]),(0,k.useEffect)(()=>{fe.current?.dispatch({kind:`connection_status_changed`,connectionStatus:w})},[w]);let pe=(0,k.useCallback)(e=>{fe.current?.dispatch({kind:`update_initiated`})},[]),me=(0,k.useCallback)(()=>{fe.current?.dispatch({kind:`aborted`})},[]),A=(0,k.useMemo)(()=>Dv(p.projectGroups,m),[m,p.projectGroups]),he=(0,k.useMemo)(()=>A===p.projectGroups?p:{...p,projectGroups:A},[p,A]),ge=_?.projects[0]?.localPath??null;(0,k.useEffect)(()=>e.onStatus(e=>g.getState().setConnectionStatus(e)),[e]),(0,k.useEffect)(()=>e.subscribe({type:`sidebar`},e=>{let t=g.getState();t.setSidebarData(e),t.setOptimisticSidebarProjectOrder(t=>t&&Dv(e.projectGroups,t)===e.projectGroups?null:t),t.setSidebarReady(!0),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`local-projects`},e=>{let t=g.getState();t.setLocalProjects(e),t.setLocalProjectsReady(!0),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`update`},e=>{let t=g.getState();t.setUpdateSnapshot(e),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`keybindings`},e=>{let t=g.getState();t.setKeybindings(e),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`app-settings`},e=>{let t=g.getState();T.getState().setFromServer(e),wh.getState().applyServerDefaults(e.defaultProvider,e.providerDefaults),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`push-config`},e=>{g.getState().setPushConfig(e)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`followed-sessions`},e=>{mg.getState().setFollowed(e.chatIds)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`cron-jobs`},e=>{h.getState().setRows(e.rows)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`beacons`},e=>{nh.getState().setRows(e.beacons)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`package-updates`},e=>{Cg.getState().setPackageUpdateSnapshot(e)}),[e]),(0,k.useEffect)(()=>{let t=new Set,n=new Map;for(let e of ue){let r=kv(A,e);r&&(t.add(r),n.set(f(r,e),{projectId:r,chatId:e}))}le&&t.add(le),de&&t.add(de);for(let e of t)n.has(e)||n.set(e,{projectId:e});if(t.size===0)return;let r=[];return n.forEach(({projectId:t,chatId:n},i)=>{r.push(e.subscribe({type:`project-git`,projectId:t,...n===void 0?{}:{chatId:n}},e=>{g.getState().setDiffSnapshotsByKey(t=>{let n=e??null;return fv(t[i]??null,n)||dv(t[i]??null,n)?t:{...t,[i]:n}}),g.getState().setCommandError(null)}))}),t.forEach(t=>{r.push(e.subscribe({type:`project-commands`,projectId:t},e=>{wv(t,e)}))}),()=>{r.forEach(e=>e())}},[ue,A,de,le,e]),(0,k.useEffect)(()=>{w===`connected`&&e.command({type:`update.check`,force:!0}).catch(e=>{g.getState().setCommandError(e instanceof Error?e.message:String(e))})},[w,e]),(0,k.useEffect)(()=>{function t(){v?.lastCheckedAt&&(Date.now()-v.lastCheckedAt<=36e5||e.command({type:`update.check`}).catch(e=>{g.getState().setCommandError(e instanceof Error?e.message:String(e))}))}return r.addWindowListener(`focus`,t)},[r,e,v?.lastCheckedAt]),(0,k.useEffect)(()=>{function e(){g.getState().incrementFocusEpoch()}let t=r.addWindowListener(`focus`,e),n=r.addDocumentListener(`visibilitychange`,e);return()=>{t(),n()}},[r]);let _e=(0,k.useCallback)(async()=>{try{T.getState().setHydrationStatus(`loading`);let t=await e.command({type:`settings.readAppSettings`}),n=g.getState();T.getState().setFromServer(t),wh.getState().applyServerDefaults(t.defaultProvider,t.providerDefaults),n.setCommandError(null)}catch(e){T.getState().setHydrationStatus(`error`),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),ve=(0,k.useCallback)(async()=>{try{let t=await e.command({type:`settings.readLlmProvider`}),n=g.getState();n.setLlmProvider(t),n.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]);(0,k.useEffect)(()=>{w===`connected`&&ae(`read app settings`,_e())},[w,_e]),(0,k.useEffect)(()=>{w===`connected`&&(zh.getState().setLoading(),e.command({type:`settings.listOpenRouterModels`}).then(e=>{zh.getState().setModels(e)}).catch(a(e=>{let t=e.message;zh.getState().setError(t)})))},[w,e]);let ye=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch(t);let n=await e.command({type:`settings.writeAppSettingsPatch`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]);(0,k.useEffect)(()=>{if(w!==`connected`||x?.browserSettingsMigrated!==!1)return;let e=Tv(t);e&&ae(`migrate legacy browser settings`,ye(e).then(()=>Ev(t)))},[x?.browserSettingsMigrated,w,ye,t]),(0,k.useEffect)(()=>{w===`connected`&&u(vv,ve)},[w,ve]),(0,k.useEffect)(()=>{if(le)return;let e=A[0];e&&g.getState().setSelectedProjectId(e.groupKey)},[le,A]);let be=(0,k.useCallback)(async t=>{try{await e.command({type:`settings.testMcpServer`,id:t}),g.getState().setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),j=(0,k.useCallback)(async()=>{try{return gg(await e.command({type:`beacons.mintPairingCode`}))}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},[e]),xe=(0,k.useCallback)(async t=>{try{return _g(await e.command({type:`beacons.update`,beaconId:t}))}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},[e]),Se=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`settings.startMcpOAuth`,id:t});return g.getState().setCommandError(null),n}catch(e){let t=e instanceof Error?e.message:String(e);return g.getState().setCommandError(t),{ok:!1,error:t}}},[e]),Ce=(0,k.useCallback)(async(t,n)=>{try{let r=await e.command({type:`settings.completeMcpOAuth`,id:t,callbackUrl:n});return g.getState().setCommandError(null),r}catch(e){let t=e instanceof Error?e.message:String(e);return g.getState().setCommandError(t),{ok:!1,error:t}}},[e]),we=(0,k.useCallback)(async(t,n)=>{try{await e.command({type:`chat.setPolicyOverride`,chatId:t,policyOverride:n}),g.getState().setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),Te=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch({cloudflareTunnel:t});let n=await e.command({type:`appSettings.setCloudflareTunnel`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]),Ee=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch({claudeAuth:t});let n=await e.command({type:`appSettings.setClaudeAuth`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]),De=(0,k.useCallback)(async(t,n)=>await e.command({type:`appSettings.testOAuthToken`,token:t,baseUrl:n}),[e]),Oe=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`settings.writeLlmProvider`,provider:t.provider,apiKey:t.apiKey,model:t.model,baseUrl:t.baseUrl}),r=g.getState();r.setLlmProvider(n),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),ke=(0,k.useCallback)(async t=>await e.command({type:`settings.validateLlmProvider`,provider:t.provider,apiKey:t.apiKey,model:t.model,baseUrl:t.baseUrl}),[e]),Ae=(0,k.useCallback)(async()=>{try{await nv(),g.getState().setCommandError(null),r.reload()}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[r]),je=(0,k.useCallback)(async t=>{try{await e.command({type:`update.check`,force:t?.force}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),Me=(0,k.useCallback)(async t=>{pe(`awaiting_disconnect`);try{let n=await e.command({type:`update.install`,version:t});if(!n.ok){me(),g.getState().setCommandError(null),await d.alert({title:n.userTitle??`Update failed`,description:n.userMessage??`Kanna could not install the update. Try again later.`,closeLabel:`OK`});return}if(n.ok&&n.action===`reload`){r.reload();return}g.getState().setCommandError(null)}catch(e){me(),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[me,d,r,pe,e]),Ne=(0,k.useCallback)(async()=>{pe(`awaiting_disconnect`);try{let t=await e.command({type:`update.reload`});if(!t.ok){me(),g.getState().setCommandError(null),await d.alert({title:t.userTitle??`Re-deploy failed`,description:t.userMessage??`Kanna could not re-deploy. Try again later.`,closeLabel:`OK`});return}if(t.action===`reload`){r.reload();return}g.getState().setCommandError(null)}catch(e){me(),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[me,d,r,pe,e]),Pe=(0,k.useCallback)(async t=>{let n=wh.getState(),r=s?n.getComposerState(s):n.getComposerState(mh),i=n.defaultProvider===`last_used`?Av(A,t):null,a=await e.command({type:`chat.create`,projectId:t});n.initializeComposerForChat(a.chatId,{sourceState:r,providerHint:i}),Lp.getState().markSpawned(a.chatId),ae(`fly chat title to tab`,Uh(a.chatId));let o=g.getState();o.setSelectedProjectId(t),o.setPendingChatId(a.chatId),l.openChat(a.chatId),o.setSidebarOpen(!1),o.setCommandError(null)},[s,l,A,e]),Fe=(0,k.useCallback)(async t=>t.kind===`project_id`?{projectId:t.projectId}:t.kind===`local_path`?{projectId:(await e.command({type:`project.open`,localPath:t.localPath})).projectId,localPath:t.localPath}:{projectId:(await e.command(t.project.mode===`new`?{type:`project.create`,localPath:t.project.localPath,title:t.project.title}:{type:`project.open`,localPath:t.project.localPath})).projectId,localPath:t.project.localPath},[e]),Ie=(0,k.useCallback)(async e=>{try{let t;t=e.kind===`project_id`?null:e.kind===`local_path`?e.localPath:e.project.localPath,t&&g.getState().setStartingLocalPath(t);let{projectId:n}=await Fe(e);await Pe(n)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}finally{g.getState().setStartingLocalPath(null)}},[Pe,Fe]),Le=(0,k.useCallback)(async e=>{await Ie({kind:`project_id`,projectId:e})},[Ie]),Re=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`chat.fork`,chatId:t.chatId}),r=wh.getState();r.initializeComposerForChat(n.chatId,{sourceState:r.getComposerState(t.chatId)});let i=g.getState();i.setPendingChatId(n.chatId),l.openChat(n.chatId),i.setSidebarOpen(!1),i.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[l,e]),ze=(0,k.useCallback)(async e=>{await Ie({kind:`local_path`,localPath:e})},[Ie]),Be=(0,k.useCallback)(async e=>{await Ie({kind:`project_request`,project:e})},[Ie]),Ve=(0,k.useCallback)(async t=>{let n=await d.prompt({title:`Rename Chat`,initialValue:t.title,confirmLabel:`Rename`});if(n&&n!==t.title)try{await e.command({type:`chat.rename`,chatId:t.chatId,title:n}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[d,e]),He=(0,k.useCallback)(async t=>{if(await d.confirm({title:`Delete Chat`,description:`Delete "${t.title}"? This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))try{if(await e.command({type:`chat.delete`,chatId:t.chatId}),Y_({chatIds:[t.chatId]}),t.chatId===s){let e=Ov(A,t.chatId);e?l.openChat(e):l.closeChat()}}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,d,A,e]),Ue=(0,k.useCallback)(async t=>{if(!t.length)return;let n=t.length;if(!await d.confirm({title:`Delete Chats`,description:`Delete ${n} chat${n===1?``:`s`}? This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))return;let r=s!=null&&t.includes(s);try{for(let n of t)await e.command({type:`chat.delete`,chatId:n}),Y_({chatIds:[n]});if(r){let e=Ov(A,s);e?l.openChat(e):l.closeChat()}}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,d,A,e]),We=(0,k.useCallback)(async t=>{try{if(await e.command({type:`chat.archive`,chatId:t.chatId}),t.chatId===s){let e=Ov(A,t.chatId);e?l.openChat(e):l.closeChat()}g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,A,e]),Ge=(0,k.useCallback)(async t=>{try{g.getState().setPendingChatId(t),await e.command({type:`chat.unarchive`,chatId:t}),l.openChat(t),g.getState().setCommandError(null)}catch(e){g.getState().setPendingChatId(null),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[l,e]),Ke=(0,k.useCallback)(e=>{lg.getState().clearProject(e),$h.getState().clearProject(e),c?.projectId===e&&l.closeChat()},[l,c]),qe=(0,k.useCallback)(async t=>{try{await e.command({type:`project.remove`,projectId:t}),Ke(t),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[Ke,e]),M=(0,k.useCallback)(async t=>{let n=A.find(e=>e.groupKey===t),r=n?ce(n.localPath):`this project`,i=[...n?.chats??[],...n?.archivedChats??[]].map(e=>e.chatId);if(await d.confirm({title:`Delete Project`,description:`Delete "${r}" and everything Kanna stored for it: ${i.length} chat${i.length===1?``:`s`} (archived included), boards and their worktrees, share links, and the attachments in .kanna inside the folder. Your own files in the folder are not touched. This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))try{let n=fg(await e.command({type:`project.delete`,projectId:t}));Ke(t),Y_({chatIds:i,boardIds:n.deletedBoardIds,projectId:t}),g.getState().setCommandError(n.failures.length>0?`Project deleted, but some data could not be removed: ${n.failures.join(`; `)}`:null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[d,Ke,A,e]),Je=(0,k.useCallback)(async(t,n)=>{try{await e.command({type:`project.setStar`,projectId:t,starred:n}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),Ye=(0,k.useCallback)(async t=>{g.getState().setOptimisticSidebarProjectOrder(t);try{await e.command({type:`sidebar.reorderProjectGroups`,projectIds:t}),g.getState().setCommandError(null)}catch(e){g.getState().setOptimisticSidebarProjectOrder(null),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),N=rv(e),Xe=(0,k.useCallback)(async(t,n,r)=>{try{let i=wh.getState(),a=s?i.getComposerState(s):i.getComposerState(mh),o=await e.command({type:`chat.create`,projectId:t,stackId:n,stackBindings:r});i.initializeComposerForChat(o.chatId,{sourceState:a});let c=g.getState();c.setSelectedProjectId(t),c.setPendingChatId(o.chatId),l.openChat(o.chatId),c.setSidebarOpen(!1),c.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,e]),Ze=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`stack.listWorktrees`,projectId:t});return g.getState().setCommandError(null),n.worktrees}catch(e){return g.getState().setCommandError(e instanceof Error?e.message:String(e)),[]}},[e]),Qe=(0,k.useCallback)(async()=>await e.command({type:`sessions.importClaude`}),[e]),$e=(0,k.useCallback)(async t=>await e.command({type:`sessions.importClaudeSession`,sessionIds:t}),[e]),et=(0,k.useCallback)(async t=>{let n=T.getState();g.getState().setCommandError(null),await e.command({type:`system.openExternal`,...t,editor:t.action===`open_editor`?t.editor??{preset:te(n),commandTemplate:re(n)}:void 0})},[e]),tt=(0,k.useCallback)(async(e,t)=>{let n=c?.localPath??_?.projects[0]?.localPath??A[0]?.localPath;if(n)try{await et({action:e,localPath:n,editor:t})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[_?.projects,et,c?.localPath,A]),nt=(0,k.useCallback)(async e=>{try{await o.writeText(e),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[o]),rt=(0,k.useCallback)(async(e,t=`open_editor`,n)=>{try{await et({action:t,localPath:e.path,line:e.line,column:e.column,editor:n})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[et]),it=(0,k.useCallback)(async(e,t)=>{try{await et({action:e,localPath:t})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[et]),at=(0,k.useCallback)(()=>g.getState().setSidebarOpen(!0),[]),ot=(0,k.useCallback)(()=>g.getState().setSidebarOpen(!1),[]),st=(0,k.useCallback)(()=>g.getState().setSidebarCollapsed(!0),[]),ct=(0,k.useCallback)(()=>g.getState().setSidebarCollapsed(!1),[]),lt=(0,k.useCallback)(()=>g.getState().setAddProjectModalOpen(!0),[]),ut=(0,k.useCallback)(()=>g.getState().setAddProjectModalOpen(!1),[]),dt=(0,k.useCallback)(()=>{let e=Mv({selectedProjectId:le,sidebarProjectId:A[0]?.groupKey,fallbackLocalProjectPath:ge});if(e){u(yv,()=>Ie(e));return}l.goHome()},[l,ge,le,A,Ie]),ft=jv(y,v?.status);return{socket:e,routeChatId:s,sidebarData:he,localProjects:_,updateSnapshot:v,keybindings:b,pushConfig:S,llmProvider:C,connectionStatus:w,sidebarReady:ee,uiRestartActive:ft.active,uiRestartLabel:ft.label,localProjectsReady:ne,commandError:se,startingLocalPath:O,sidebarOpen:E,sidebarCollapsed:D,addProjectModalOpen:ie,stacks:he.stacks,openSidebar:at,closeSidebar:ot,collapseSidebar:st,expandSidebar:ct,openAddProjectModal:lt,closeAddProjectModal:ut,handleCreateChat:Le,handleForkChat:Re,handleOpenLocalProject:ze,handleCreateProject:Be,handleCheckForUpdates:je,handleInstallUpdate:Me,handleForceReload:Ne,handleReadAppSettings:_e,handleWriteAppSettings:ye,handleTestMcpServer:be,handleMintBeaconPairingCode:j,handleUpdateBeacon:xe,handleStartMcpOAuth:Se,handleCompleteMcpOAuth:Ce,handleSetChatPolicyOverride:we,handleWriteCloudflareTunnel:Te,handleWriteClaudeAuth:Ee,handleTestOAuthToken:De,handleReadLlmProvider:ve,handleWriteLlmProvider:Oe,handleValidateLlmProvider:ke,handleSignOut:Ae,handleRenameChat:Ve,handleArchiveChat:We,handleOpenArchivedChat:Ge,handleDeleteChat:He,handleDeleteBulkChats:Ue,handleHideProject:qe,handleDeleteProject:M,handleToggleProjectStar:Je,handleReorderProjectGroups:Ye,...N,handleCreateStackChat:Xe,handleListStackWorktrees:Ze,importClaudeSessions:Qe,importClaudeSession:$e,handleCopyPath:nt,handleOpenExternal:tt,handleOpenExternalPath:it,handleOpenLocalLink:rt,handleCompose:dt,chatNavigator:l}}export{um as $,cd as $t,Ph as A,Wp as At,nh as B,Op as Bt,ug as C,em as Ct,$h as D,Vp as Dt,eg as E,Kp as Et,jh as F,Fp as Ft,Rm as G,Jd as Gt,Lm as H,$d as Ht,mh as I,kp as It,zm as J,Gd as Jt,Xm as K,Xd as Kt,wh as L,jp as Lt,Th as M,Rp as Mt,Eh as N,Lp as Nt,zh as O,Up as Ot,Dh as P,Ip as Pt,jm as Q,W as Qt,ih as R,Mp as Rt,mg as S,tm as St,lg as T,nm as Tt,Um as U,Yd as Ut,Mm as V,Y as Vt,Gm as W,tf as Wt,Pm as X,qd as Xt,Hm as Y,K as Yt,Km as Z,Kd as Zt,f_ as _,le as _n,Jp as _t,sv as a,Gu as an,pm as at,Cg as b,Qp as bt,J_ as c,zu as cn,mm as ct,U_ as d,Wc as dn,lm as dt,U as en,im as et,B_ as f,ca as fn,gm as ft,V_ as g,ue as gn,Yp as gt,H_ as h,de as hn,Xp as ht,Nv as i,qu as in,rm as it,Nh as j,zp as jt,Lh as k,Hp as kt,q_ as l,Lu as ln,dm as lt,G_ as m,fe as mn,Am as mt,vv as n,Yu as nn,om as nt,ev as o,Uu as on,km as ot,W_ as p,xi as pn,Om as pt,Nm as q,G as qt,kv as r,Xu as rn,sm as rt,tv as s,Vu as sn,Tm as st,yv as t,pd as tn,am as tt,L_ as u,Gc as un,cm as ut,Hg as v,Zp as vt,ig as w,$p as wt,hg as x,Gp as xt,Eg as y,qp as yt,rh as z,Np as zt};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{c as r,d as i,m as a,p as o,t as s}from"./log-Ch_SNBXH.js";import{a as c,f as l,n as u}from"./pendingActionsStore-CWNaCyjS.js";import{zt as d}from"./lexicalToReact-ClgTGbzM.js";import{l as f,n as p,r as m,s as h,u as g}from"./pushClient-DbwI0iz1.js";import{a as _,i as v,n as y,o as b,r as x,t as S,u as C}from"./timer.adapter-BDh0KX9G.js";import{t as w}from"./input-BaAZ4OHy.js";import{C as T,E as ee,_ as te,c as ne,g as re,l as E,u as D,w as ie}from"./useTheme-B6cYOPpe.js";import{t as ae}from"./runDetached-CQOu05LK.js";import{i as oe,r as se}from"./status-pill-BFLy7eN9.js";import{a as ce}from"./formatters-BGORekd-.js";var O=e(n(),1),k=e(t(),1),le=(0,k.createContext)({});function ue(e){let t=(0,k.useRef)(null);return t.current===null&&(t.current=e()),t.current}var de=typeof window<`u`?k.useLayoutEffect:k.useEffect,fe=(0,k.createContext)(null);function pe(e,t){e.indexOf(t)===-1&&e.push(t)}function me(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var A=(e,t,n)=>n>t?t:n<e?e:n,he={},ge=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_e=e=>typeof e==`object`&&!!e,ve=e=>/^0[^.\s]+$/u.test(e);function ye(e){let t;return()=>(t===void 0&&(t=e()),t)}var be=e=>e,j=(...e)=>e.reduce((e,t)=>n=>t(e(n))),xe=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Se=class{constructor(){this.subscriptions=[]}add(e){return pe(this.subscriptions,e),()=>this.remove(e)}remove(e){me(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ce=e=>e*1e3,we=e=>e/1e3,Te=(e,t)=>t?1e3/t*e:0,Ee=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,De=1e-7,Oe=12;function ke(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ee(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>De&&++s<Oe);return o}function Ae(e,t,n,r){if(e===t&&n===r)return be;let i=t=>ke(t,0,1,e,n);return e=>e===0||e===1?e:Ee(i(e),t,r)}var je=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Me=e=>t=>1-e(1-t),Ne=Ae(.33,1.53,.69,.99),Pe=Me(Ne),Fe=je(Pe),Ie=e=>e>=1?1:(e*=2)<1?.5*Pe(e):.5*(2-2**(-10*(e-1))),Le=e=>1-Math.sin(Math.acos(e)),Re=Me(Le),ze=je(Le),Be=Ae(.42,0,1,1),Ve=Ae(0,0,.58,1),He=Ae(.42,0,.58,1),Ue=e=>Array.isArray(e)&&typeof e[0]!=`number`,We=e=>Array.isArray(e)&&typeof e[0]==`number`,Ge={linear:be,easeIn:Be,easeInOut:He,easeOut:Ve,circIn:Le,circInOut:ze,circOut:Re,backIn:Pe,backInOut:Fe,backOut:Ne,anticipate:Ie},Ke=e=>typeof e==`string`,qe=e=>{if(We(e)){e.length;let[t,n,r,i]=e;return Ae(t,n,r,i)}return Ke(e)?(Ge[e],`${e}`,Ge[e]):e},M={delta:0,timestamp:0,isProcessing:!1},Je;function Ye(){Je=void 0}var N={now:()=>(Je===void 0&&N.set(M.isProcessing||he.useManualTiming?M.timestamp:performance.now()),Je),set:e=>{Je=e,queueMicrotask(Ye)}},Xe=e=>Math.round(e*1e5)/1e5,Ze=e=>t=>typeof t==`string`&&t.startsWith(e),Qe=Ze(`--`),$e=Ze(`var(--`),et=e=>$e(e)?tt.test(e.split(`/*`)[0].trim()):!1,tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function nt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var rt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},it={...rt,transform:e=>A(0,1,e)},at={...rt,default:1},ot=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function st(e){return e==null}var ct=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(e,t)=>n=>!!(typeof n==`string`&&ct.test(n)&&n.startsWith(e)||t&&!st(n)&&Object.prototype.hasOwnProperty.call(n,t)),ut=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ot);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dt=e=>A(0,255,e),ft={...rt,transform:e=>Math.round(dt(e))},pt={test:lt(`rgb`,`red`),parse:ut(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ft.transform(e)+`, `+ft.transform(t)+`, `+ft.transform(n)+`, `+Xe(it.transform(r))+`)`};function mt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ht={test:lt(`#`),parse:mt,transform:pt.transform},gt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),_t=gt(`deg`),vt=gt(`%`),P=gt(`px`),yt=gt(`vh`),bt=gt(`vw`),xt={...vt,parse:e=>vt.parse(e)/100,transform:e=>vt.transform(e*100)},St={test:lt(`hsl`,`hue`),parse:ut(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+vt.transform(Xe(t))+`, `+vt.transform(Xe(n))+`, `+Xe(it.transform(r))+`)`},F={test:e=>pt.test(e)||ht.test(e)||St.test(e),parse:e=>pt.test(e)?pt.parse(e):St.test(e)?St.parse(e):ht.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?pt.transform(e):St.transform(e),getAnimatableNone:e=>{let t=F.parse(e);return t.alpha=0,F.transform(t)}},Ct=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,wt=new RegExp(ot.source),Tt=new RegExp(Ct.source,`i`);function Et(e){return isNaN(e)&&typeof e==`string`&&(wt.test(e)||Tt.test(e))}var Dt=`number`,Ot=`color`,kt=`var`,At=`var(`,jt="${}",Mt=/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 Nt(e){let t=e.toString();return wt.test(t)||Tt.test(t)}function Pt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Mt,e=>(F.test(e)?(r.color.push(a),i.push(Ot),n.push(F.parse(e))):e.startsWith(At)?(r.var.push(a),i.push(kt),n.push(e)):(r.number.push(a),i.push(Dt),n.push(parseFloat(e))),++a,jt)).split(jt),indexes:r,types:i}}function Ft(e){return Pt(e).values}function It({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Dt?Xe(r[a]):e===Ot?F.transform(r[a]):r[a]}return i}}function Lt(e){return It(Pt(e))}var Rt=e=>typeof e==`number`?0:F.test(e)?F.getAnimatableNone(e):e,zt=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Rt(e);function Bt(e){let t=Pt(e);return It(t)(t.values.map((e,n)=>zt(e,t.split[n])))}var Vt={test:Et,parse:Ft,createTransformer:Lt,getAnimatableNone:Bt};function Ht(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ut({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Ht(s,r,e+1/3),a=Ht(s,r,e),o=Ht(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Wt(e,t){return n=>n>0?t:e}var I=(e,t,n)=>e+(t-e)*n,Gt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Kt=[ht,pt,St],qt=e=>Kt.find(t=>t.test(e));function Jt(e){let t=qt(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===St&&(n=Ut(n)),n}var Yt=(e,t)=>{let n=Jt(e),r=Jt(t);if(!n||!r)return Wt(e,t);let i={...n};return e=>(i.red=Gt(n.red,r.red,e),i.green=Gt(n.green,r.green,e),i.blue=Gt(n.blue,r.blue,e),i.alpha=I(n.alpha,r.alpha,e),pt.transform(i))},Xt=new Set([`none`,`hidden`]);function Zt(e,t){return Xt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Qt(e,t){return n=>I(e,t,n)}function $t(e){return typeof e==`number`?Qt:typeof e==`string`?et(e)?Wt:F.test(e)?Yt:rn:Array.isArray(e)?en:typeof e==`object`?F.test(e)?Yt:tn:Wt}function en(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>$t(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function tn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=$t(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function nn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var rn=(e,t)=>{let n=Vt.createTransformer(t),r=Pt(e),i=Pt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Xt.has(e)&&!i.values.length||Xt.has(t)&&!r.values.length?Zt(e,t):j(en(nn(r,i),i.values),n):(`${e}${t}`,Wt(e,t))},an=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function on(e,t){let n=an.exec(e);if(!n)return;let r=an.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Xe(I(a,o,e))+i}function sn(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return I(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=on(e,t);if(n)return n}return $t(e)(e,t)}var cn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ln(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var un=40;function dn(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=cn.reduce((e,t)=>(e[t]=ln(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=he.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,un),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:cn.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<cn.length;t++)o[cn[t]].cancel(e)},state:n,steps:o}}var{schedule:L,cancel:fn,steps:pn}=dn(typeof requestAnimationFrame<`u`?requestAnimationFrame:be,!0,M),mn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>L.update(t,e),stop:()=>fn(t),now:()=>M.isProcessing?M.timestamp:N.now()}},hn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},gn=2e4;function _n(e,t=50,n=gn,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function vn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(_n(r),gn);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:we(i)}}var R={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},yn=e=>e<0?1/Math.max(1+e,R.minDamping):Math.max(1-e,R.minDamping);function bn(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cn(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xn(e,t){return e*Math.sqrt(1-t*t)}var Sn=12;function Cn(e,t,n){let r=n;for(let n=1;n<Sn;n++)r-=e(r)/t(r);return r}var wn=.001;function Tn({duration:e=R.duration,bounce:t=R.bounce}){let n,r;R.maxDuration;let i=yn(t);e=A(R.minDuration,R.maxDuration,we(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xn(t,i),o=Math.exp(-r);return wn-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xn(t*t,i);return(-n(t)+wn>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cn(n,r,a),s=o*bn(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Ce(e)}}var En=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dn(e,t){if(En(e,t))return e}function On(e){let t=Dn(e.stiffness),n=Dn(e.damping,!0),r=Dn(e.mass),i={...e,stiffness:t??R.stiffness,damping:n??R.damping,mass:r??R.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yn(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bn(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Tn(i)),i.isResolvedFromDuration=!0;(!En(i.stiffness)||!En(i.damping,!0))&&(i.stiffness=R.stiffness,i.damping=R.damping)}return i}function kn(e=R.visualDuration,t=R.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=On({...n}),f=e=>d?0:-we(e),p=s/(2*Math.sqrt(o*c)),m=we(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?R.restSpeed.granular:R.restSpeed.default),g.restDelta=n.restDelta||(e?R.restDelta.granular:R.restDelta.default)};_();let v,y,b;if(p<1){let e=xn(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Ce(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Ce(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(_n(S),gn),t=hn(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}kn.applyToOptions=e=>{let t=vn(e,100,kn);return e.ease=t.ease,e.duration=Ce(t.duration),e.type=`keyframes`,e};function An({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=kn({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function jn(e,t,n){let r=[],i=n||he.mix||sn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=j(Array.isArray(t)?t[n]||be:t,a)),r.push(a)}return r}function Mn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=jn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=xe(e[r],e[r+1],n);return s[r](i)};return n?t=>l(A(e[0],e[a-1],t)):l}function Nn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=xe(0,t,r);e.push(I(n,1,i))}}function Pn(e){let t=[0];return Nn(t,e.length-1),t}function Fn(e,t){return e.map(e=>e*t)}function In(e,t){return e.map(()=>t||He).splice(0,e.length-1)}function Ln({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ue(r)?r.map(qe):qe(r)||He,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(he.mix||sn)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?A(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Mn(Fn(n&&n.length===t.length?n:Pn(t),e),t,{ease:Array.isArray(i)?i:In(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Rn=5;function zn(e,t,n){let r=Math.max(t-Rn,0);return Te(n-e(r),t-r)}function Bn(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):zn(t=>e.next(t).value,t,e.next(t).value)}var Vn=e=>e!==null;function Hn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Vn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Un={decay:An,inertia:An,tween:Ln,keyframes:Ln,spring:kn};function Wn(e){typeof e.type==`string`&&(e.type=Un[e.type])}function Gn(e,t){return{kind:e,animation:t,timestamp:N.now(),frameTimestamp:M.timestamp,frameIsProcessing:M.isProcessing}}function Kn(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Gn(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function qn(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Gn(`layout-animation-start`,e),node:t})}catch{}}var Jn=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Yn=e=>e/100,Xn=class extends Jn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Kn(this,this.options)}initAnimation(){let{options:e}=this;Wn(e);let{type:t=Ln,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ln;s!==Ln&&typeof o[0]!=`number`&&(this.mixKeyframes=j(Yn,sn(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=_n(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=A(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==An&&(b.value=Hn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return we(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+we(e)}get time(){return we(this.currentTime)}set time(e){e=Ce(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Bn(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=we(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=mn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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}stopDriver(){this.driver&&=(this.driver.stop(),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)}},Zn=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Qn(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ot)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Zn.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var $n=/\b([a-z-]*)\(.*?\)/gu,er={...Vt,getAnimatableNone:e=>{let t=e.match($n);return t?t.map(Qn).join(` `):e}},tr={...Vt,getAnimatableNone:e=>{let t=Vt.parse(e);return Vt.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},nr={...rt,transform:Math.round},rr={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,rotate:_t,pathRotation:_t,rotateX:_t,rotateY:_t,rotateZ:_t,scale:at,scaleX:at,scaleY:at,scaleZ:at,skew:_t,skewX:_t,skewY:_t,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:it,originX:xt,originY:xt,originZ:P,zIndex:nr,fillOpacity:it,strokeOpacity:it,numOctaves:nr},ir={...rr,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:er,WebkitFilter:er,mask:tr,WebkitMask:tr},ar=e=>ir[e],or=new Set([er,tr]);function sr(e,t){let n=ar(e);return or.has(n)||(n=Vt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function cr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var lr=e=>e*180/Math.PI,ur=e=>fr(lr(Math.atan2(e[1],e[0]))),dr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ur,rotateZ:ur,skewX:e=>lr(Math.atan(e[1])),skewY:e=>lr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fr=e=>(e%=360,e<0&&(e+=360),e),pr=ur,mr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),hr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mr,scaleY:hr,scale:e=>(mr(e)+hr(e))/2,rotateX:e=>fr(lr(Math.atan2(e[6],e[5]))),rotateY:e=>fr(lr(Math.atan2(-e[2],e[0]))),rotateZ:pr,rotate:pr,skewX:e=>lr(Math.atan(e[4])),skewY:e=>lr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _r(e){return+!!e.includes(`scale`)}function vr(e,t){if(!e||e===`none`)return _r(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=gr,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=dr,i=t}if(!i)return _r(t);let a=r[t],o=i[1].split(`,`).map(br);return typeof a==`function`?a(o):o[a]}var yr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return vr(n,t)};function br(e){return parseFloat(e.trim())}var xr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Sr=new Set([...xr,`pathRotation`]),Cr=e=>e===rt||e===P,wr=new Set([`x`,`y`,`z`]),Tr=xr.filter(e=>!wr.has(e));function Er(e){let t=[];return Tr.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Dr=new Set([`bottom`,`right`]);function Or(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var kr={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Or(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Or(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>vr(e,`x`),y:({transform:e})=>vr(e,`y`)};kr.translateX=kr.x,kr.translateY=kr.y;var Ar=new Set,jr=!1,Mr=!1,Nr=!1;function Pr(){if(Mr){let e=[],t=new Set,n=new Set;Ar.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Dr.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Er(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Mr=!1,jr=!1,Ar.forEach(e=>e.complete(Nr)),Ar.clear()}function Fr(){Ar.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mr=!0)})}function Ir(){Nr=!0,Fr(),Pr(),Nr=!1}function Lr(e,t,n){if(typeof e==`string`){if(ge(e)||ve(e))return parseFloat(e);if(!Vt.test(e)&&Vt.test(n))return sr(t,n)}return e??void 0}var Rr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Ar.add(this),jr||(jr=!0,L.read(Fr),L.resolveKeyframes(Pr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Lr(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}cr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ar.delete(this)}cancel(){this.state===`scheduled`&&(Ar.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},zr=e=>e.startsWith(`--`);function Br(e,t,n){zr(t)?e.style.setProperty(t,n):e.style[t]=n}var Vr={};function Hr(e,t){let n=ye(e);return()=>Vr[t]??n()}var Ur=Hr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Wr=Hr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Gr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Kr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Gr([0,.65,.55,1]),circOut:Gr([.55,0,1,.45]),backIn:Gr([.31,.01,.66,-.59]),backOut:Gr([.33,1.53,.69,.99])};function qr(e,t){if(e)return typeof e==`function`?Wr()?hn(e,t):`ease-out`:We(e)?Gr(e):Array.isArray(e)?e.map(e=>qr(e,t)||Kr.easeOut):Kr[e]}function Jr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=qr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Yr(e){return typeof e==`function`&&`applyToOptions`in e}function Xr({type:e,...t}){return Yr(e)&&Wr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Zr=class extends Jn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Xr(e);this.animation=Jr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Hn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Br(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Kn(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return we(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+we(e)}get time(){return we(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ur()?(this.animation.timeline=e,t?.(this.animation),be):n(this)}},Qr={anticipate:Ie,backInOut:Fe,circInOut:ze};function $r(e){return e in Qr}function ei(e){typeof e.ease==`string`&&$r(e.ease)&&(e.ease=Qr[e.ease])}var ti=10,ni=class extends Zr{constructor(e){ei(e),Wn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Xn({...a,autoplay:!1}),s=Math.max(ti,N.now()-this.startTime),c=A(0,ti,s-ti),l=o.sample(s).value,{name:u}=this.options;i&&u&&Br(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},ri=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Vt.test(e)||e===`0`)&&!e.startsWith(`url(`));function ii(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ai(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ri(i,t),s=ri(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ii(e)||(n===`spring`||Yr(n))&&r}function oi(e){e.duration=0,e.type=`keyframes`}var si=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ci=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function li(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ci.test(e[t]))return!0;return!1}var ui=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),di=ye(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function fi(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(si.has(n)||ui.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return di()&&(si.has(n)||ui.has(n)&&li(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var pi=40,mi=class extends Jn{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Rr;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=!0;ai(e,i,a,o)||(u=!1,(he.instantAnimations||!s)&&l?.(Hn(e,n,t)),e[0]=e[e.length-1],oi(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>pi?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&fi(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new ni(n)}catch{m=new Xn(n)}}else m=new Xn(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ir()),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()}};function hi(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var gi=30,_i=e=>!isNaN(parseFloat(e)),vi={current:void 0},yi=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=N.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_i(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Se)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Se,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){L.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;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,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}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.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return vi.current&&vi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gi)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,gi);return Te(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function bi(e,t){return new yi(e,t)}function xi(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Si(e,t){let n=e?.[t]??e?.default??e;return n===e?n:xi(n,e)}var Ci={type:`spring`,stiffness:500,damping:25,restSpeed:10},wi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ti={type:`keyframes`,duration:.8},Ei={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Di=(e,{keyframes:t})=>t.length>2?Ti:Sr.has(e)?e.startsWith(`scale`)?wi(t[1]):Ci:Ei,Oi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ki(e){for(let t in e)if(!Oi.has(t))return!0;return!1}var Ai=(e,t,n,r={},i,a)=>o=>{let s=Si(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ce(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ki(s)||Object.assign(u,Di(e,u)),u.duration&&=Ce(u.duration),u.repeatDelay&&=Ce(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(oi(u),u.delay===0&&(d=!0)),(he.instantAnimations||he.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,oi(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Hn(u.keyframes,s);if(e!==void 0){L.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Xn(u):new mi(u)},ji=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mi(e){let t=ji.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ni(e,t,n=1){`${e}`;let[r,i]=Mi(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ge(e)?parseFloat(e):e}return et(i)?Ni(i,t,n+1):i}function Pi(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Fi(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Pi(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ii(e,t,n){return Fi(e.getProps(),t,n,e)}var Li=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Ri=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...xr]),zi=e=>Array.isArray(e);function Bi(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,bi(n))}function Vi(e){return zi(e)?e[e.length-1]||0:e}function Hi(e,t){let{transitionEnd:n={},transition:r={},...i}=Ii(e,t)||{};i={...i,...n};for(let t in i)Bi(e,t,Vi(i[t]))}var z=e=>!!(e&&e.getVelocity);function Ui(e){return!!(z(e)&&e.add)}function Wi(e,t){let n=e.getValue(`willChange`);if(Ui(n))return n.add(t);if(!n&&he.WillChange){let n=new he.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Gi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ki=`data-`+Gi(`framerAppearId`);function qi(e){return e.props[Ki]}var Ji=typeof window<`u`;function Yi({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Xi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?xi(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Yi(f,t))continue;let o={delay:n,...Si(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){L.update(()=>r.set(i));continue}let p=!1;if(Ji&&window.MotionHandoffAnimation){let n=qi(e);if(n){let e=window.MotionHandoffAnimation(n,t,L);e!==null&&(o.startTime=e,p=!0)}}Wi(e,t);let m=l??e.shouldReduceMotion;r.start(Ai(t,r,i,m&&Ri.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>L.update(()=>{o&&Hi(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Zi(e,t,n={}){let r=Ii(e,t,Li(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Xi(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Zi(e,t,{...n,delay:r+(typeof o==`function`?0:o)+hi(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Qi(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Zi(e,t,n))):typeof t==`string`?Zi(e,t,n):Promise.all(Xi(e,Ii(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var $i={test:e=>e===`auto`,parse:e=>e},ea=e=>t=>t.test(e),ta=[rt,P,vt,_t,bt,yt,$i],na=e=>ta.find(ea(e));function ra(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ve(e)}var ia=new Set([`auto`,`none`,`0`]);function aa(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ia.has(t)&&Nt(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=sr(n,i))}var oa=class extends Rr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),et(r))){let i=Ni(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ri.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=na(r),o=na(i);if(nt(r)!==nt(i)&&kr[n]){this.needsMeasurement=!0;return}if(a!==o){if(Cr(a)&&Cr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else kr[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ra(e[t]))&&n.push(t);n.length&&aa(e,n,t)}measure(){let{element:e,name:t}=this;return kr[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},sa=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function ca(e){return _e(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function la(e){return _e(e)&&`ownerSVGElement`in e}var ua=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function da(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var fa={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},pa=xr.length;function ma(e,t,n){let r=``,i=!0;for(let a=0;a<pa;a++){let o=xr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ua(s,rr[o]);if(!c){i=!1;let t=fa[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ua(a,rr.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function ha(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Sr.has(e)){o=!0;continue}if(Qe(e)){i[e]=n;continue}{let t=ua(n,rr[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ma(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ga={offset:`stroke-dashoffset`,array:`stroke-dasharray`},_a={offset:`strokeDashoffset`,array:`strokeDasharray`};function va(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ga:_a;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ya=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ba(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(ha(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of ya)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&va(d,i,a,o,!1)}function xa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ca(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function wa(e){return e===void 0||e===1}function Ta({scale:e,scaleX:t,scaleY:n}){return!wa(e)||!wa(t)||!wa(n)}function Ea(e){return Ta(e)||Da(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Da(e){return Oa(e.x)||Oa(e.y)}function Oa(e){return e&&e!==`0%`}function ka(e,t,n){return n+t*(e-n)}function Aa(e,t,n,r,i){return i!==void 0&&(e=ka(e,i,r)),ka(e,n,r)+t}function ja(e,t=0,n=1,r,i){e.min=Aa(e.min,t,n,r,i),e.max=Aa(e.max,t,n,r,i)}function Ma(e,{x:t,y:n}){ja(e.x,t.translate,t.scale,t.originPoint),ja(e.y,n.translate,n.scale,n.originPoint)}var Na=.999999999999,Pa=1.0000000000001;function Fa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Ia(e.x,-a.scroll.offset.x),Ia(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ma(e,o)),r&&Ea(a.latestValues)&&za(e,a.latestValues,a.layout?.layoutBox))}t.x<Pa&&t.x>Na&&(t.x=1),t.y<Pa&&t.y>Na&&(t.y=1)}function Ia(e,t){e.min+=t,e.max+=t}function La(e,t,n,r,i=.5){ja(e,t,n,I(e.min,e.max,i),r)}function Ra(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function za(e,t,n){let r=n??e;La(e.x,Ra(t.x,r.x),t.scaleX,t.scale,t.originX),La(e.y,Ra(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ba(e,t){return xa(Ca(e.getBoundingClientRect(),t))}function Va(e,t,n){let r=Ba(e,n),{scroll:i}=t;return i&&(Ia(r.x,i.offset.x),Ia(r.y,i.offset.y)),r}var{schedule:Ha,cancel:Ua}=dn(queueMicrotask,!1),Wa={x:!1,y:!1};function Ga(){return Wa.x||Wa.y}function Ka(e){return e===`x`||e===`y`?Wa[e]?null:(Wa[e]=!0,()=>{Wa[e]=!1}):Wa.x||Wa.y?null:(Wa.x=Wa.y=!0,()=>{Wa.x=Wa.y=!1})}function qa(e,t){let n=da(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ja(e){return!(e.pointerType===`touch`||Ga())}function Ya(e,t,n={}){let[r,i,a]=qa(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Ja(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Xa=(e,t)=>t?e===t||Xa(e,t.parentElement):!1,Za=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Qa=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function $a(e){return Qa.has(e.tagName)||e.isContentEditable===!0}var eo=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function to(e){return eo.has(e.tagName)||e.isContentEditable===!0}var no=new WeakSet;function ro(e){return t=>{t.key===`Enter`&&e(t)}}function io(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ao=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ro(()=>{if(no.has(n))return;io(n,`down`);let e=ro(()=>{io(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>io(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function oo(e){return Za(e)&&!Ga()}var so=new WeakSet;function co(e,t,n={}){let[r,i,a]=qa(e,n),o=e=>{let r=e.currentTarget;if(!oo(e)||so.has(e))return;no.add(r),n.stopPropagation&&so.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),no.has(r)&&no.delete(r),oo(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Xa(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ca(e)&&(e.addEventListener(`focus`,e=>ao(e,i)),!$a(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var lo=new WeakMap,uo,fo=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:la(r)&&`getBBox`in r?r.getBBox()[t]:r[n],po=fo(`inline`,`width`,`offsetWidth`),mo=fo(`block`,`height`,`offsetHeight`);function ho({target:e,borderBoxSize:t}){lo.get(e)?.forEach(n=>{n(e,{get width(){return po(e,t)},get height(){return mo(e,t)}})})}function go(e){e.forEach(ho)}function _o(){typeof ResizeObserver<`u`&&(uo=new ResizeObserver(go))}function vo(e,t){uo||_o();let n=da(e);return n.forEach(e=>{let n=lo.get(e);n||(n=new Set,lo.set(e,n)),n.add(t),uo?.observe(e)}),()=>{n.forEach(e=>{let n=lo.get(e);n?.delete(t),n?.size||uo?.unobserve(e)})}}var yo=new Set,bo;function xo(){bo=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};yo.forEach(t=>t(e))},window.addEventListener(`resize`,bo)}function So(e){return yo.add(e),bo||xo(),()=>{yo.delete(e),!yo.size&&typeof bo==`function`&&(window.removeEventListener(`resize`,bo),bo=void 0)}}function Co(e,t){return typeof e==`function`?So(e):vo(e,t)}var wo={value:null,addProjectionMetrics:null};function To(e){return la(e)&&e.tagName===`svg`}var Eo=e=>typeof e==`number`?e:parseFloat(e),Do=()=>({translate:0,scale:1,origin:0,originPoint:0}),Oo=()=>({x:Do(),y:Do()}),ko=()=>({min:0,max:0}),B=()=>({x:ko(),y:ko()}),Ao=new WeakMap;function jo(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Mo(e){return typeof e==`string`||Array.isArray(e)}var No=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Po=[`initial`,...No];function Fo(e){if(jo(e.animate))return!0;for(let t=0;t<Po.length;t++)if(Mo(e[Po[t]]))return!0;return!1}function Io(e){return!!(Fo(e)||e.variants)}function Lo(e,t,n){for(let r in t){let i=t[r],a=n[r];if(z(i))e.addValue(r,i);else if(z(a))e.addValue(r,bi(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,bi(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ro={current:null},zo={current:!1},Bo=typeof window<`u`;function Vo(){if(zo.current=!0,Bo){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ro.current=e.matches;e.addEventListener(`change`,t),t()}else Ro.current=!1}}var Ho=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Uo={};function Wo(e){Uo=e}function Go(){return Uo}var Ko=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Rr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=N.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,L.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Fo(t),this.isVariantNode=Io(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&z(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(zo.current||Vo(),this.shouldReduceMotion=Ro.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),fn(this.notifyUpdate),fn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in 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??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&si.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Zr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ce(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Sr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&L.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Uo){let t=Uo[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(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):B()}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<Ho.length;t++){let n=Ho[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Lo(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}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}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 n=this.values.get(e);return n===void 0&&t!==void 0&&(n=bi(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ge(n)||ve(n))?n=parseFloat(n):typeof n!=`number`&&!Vt.test(n)&&Vt.test(t)&&(n=sr(e,t)),this.setBaseTarget(e,z(n)?n.get():n)),z(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Se),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ha.render(this.render)}},qo=class extends Ko{constructor(){super(...arguments),this.KeyframeResolver=oa}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;z(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Jo=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Yo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Xo={};function Zo(e,{layout:t,layoutId:n}){return Sr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Xo[e]||e===`opacity`)}function Qo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(z(r[t])||i&&z(i[t])||Zo(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function $o(e){return window.getComputedStyle(e)}var es=class extends qo{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Yo}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Sr.has(t))return this.projection?.isProjecting?_r(t):yr(e,t);{let n=$o(e),r=(Qe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ba(e,t)}build(e,t,n){ha(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Qo(e,t,n)}},ts=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`]),ns=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function rs(e,t,n,r){Yo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ts.has(n)?n:Gi(n),t.attrs[n])}function is(e,t,n){let r=Qo(e,t,n);for(let n in e)if(z(e[n])||z(t[n])){let t=xr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var as=class extends qo{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,t){return Sr.has(t)?super.getBaseTargetFromProps(e,t)??_r(t):e[t]}getDefaultValue(e){return Sr.has(e)?this.latestValues[e]??_r(e):void 0}readValueFromInstance(e,t){if(Sr.has(t)){let e=ar(t);return e&&e.default||0}if(ya.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ts.has(t)?t:Gi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return is(e,t,n)}build(e,t,n){ba(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){rs(e,t,n,r)}mount(e){this.isSVGTag=ns(e.tagName),super.mount(e)}};function os(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ss=[...No].reverse();function cs(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Qi(e,t,n))),n=us(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(ss.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Mo(g)||g===!1?g:void 0:h,v=Mo(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||jo(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=ls(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Ii(e,n,Li(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:ee}=i;for(let t in{...ee,...T}){if(t in f)continue;let n=T[t],r=ee[t],a=Array.isArray(n)&&Array.isArray(r)?!os(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Ii(s,n)?.transition?.delayChildren;r.delay=hi(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ii(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!z(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=us(),i=!0}}}function ls(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!os(t,e):!1}function us(){let e={};for(let t of No)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ds(e,t){e.min=t.min,e.max=t.max}function fs(e,t){ds(e.x,t.x),ds(e.y,t.y)}function ps(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var ms=.9999,hs=1.0001,gs=-.01,_s=.01;function vs(e){return e.max-e.min}function ys(e,t,n){return Math.abs(e-t)<=n}function bs(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=vs(n)/vs(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ms&&e.scale<=hs||isNaN(e.scale))&&(e.scale=1),(e.translate>=gs&&e.translate<=_s||isNaN(e.translate))&&(e.translate=0)}function xs(e,t,n,r){bs(e.x,t.x,n.x,r?r.originX:void 0),bs(e.y,t.y,n.y,r?r.originY:void 0)}function Ss(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+vs(t)}function Cs(e,t,n,r){Ss(e.x,t.x,n.x,r?.x),Ss(e.y,t.y,n.y,r?.y)}function ws(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+vs(t)}function Ts(e,t,n,r){ws(e.x,t.x,n.x,r?.x),ws(e.y,t.y,n.y,r?.y)}function Es(e,t,n,r,i){return e-=t,e=ka(e,1/n,r),i!==void 0&&(e=ka(e,1/i,r)),e}function Ds(e,t=0,n=1,r=.5,i,a=e,o=e){if(vt.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=Es(e.min,t,n,s,i),e.max=Es(e.max,t,n,s,i)}function Os(e,t,[n,r,i],a,o){Ds(e,t[n],t[r],t[i],t.scale,a,o)}var ks=[`x`,`scaleX`,`originX`],As=[`y`,`scaleY`,`originY`];function js(e,t,n,r){Os(e.x,t,ks,n?n.x:void 0,r?r.x:void 0),Os(e.y,t,As,n?n.y:void 0,r?r.y:void 0)}function Ms(e){return e.translate===0&&e.scale===1}function Ns(e){return Ms(e.x)&&Ms(e.y)}function Ps(e,t){return e.min===t.min&&e.max===t.max}function Fs(e,t){return Ps(e.x,t.x)&&Ps(e.y,t.y)}function Is(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ls(e,t){return Is(e.x,t.x)&&Is(e.y,t.y)}function Rs(e){return vs(e.x)/vs(e.y)}function zs(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Bs(e){return[e(`x`),e(`y`)]}function Vs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Hs={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(P.test(e))e=parseFloat(e);else return e}return`${Vs(e,t.target.x)}% ${Vs(e,t.target.y)}%`}},Us={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Vt.parse(e);if(i.length>5)return r;let a=Vt.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Ws(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Gs=sa.length,Ks=e=>typeof e==`number`||P.test(e);function qs(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,Ys(r)),e.opacityExit=I(t.opacity??1,0,Xs(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gs;i++){let a=sa[i],o=Js(t,a),s=Js(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ks(o)===Ks(s)?(e[a]=Math.max(I(Eo(o),Eo(s),r),0),(vt.test(s)||vt.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=I(t.rotate||0,n.rotate||0,r))}function Js(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ys=Zs(0,.5,Re),Xs=Zs(.5,.95,be);function Zs(e,t,n){return r=>r<e?0:r>t?1:n(xe(e,t,r))}function Qs(e,t,n){let r=z(e)?e:bi(e);return r.start(Ai(``,r,t,n)),r.animation}function $s(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ec=(e,t)=>e.depth-t.depth,tc=class{constructor(){this.children=[],this.isDirty=!1}add(e){pe(this.children,e),this.isDirty=!0}remove(e){me(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ec),this.isDirty=!1,this.children.forEach(e)}};function nc(e,t){let n=N.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(fn(r),e(a-t))};return L.setup(r,!0),()=>fn(r)}function rc(e){return z(e)?e.get():e}var ic=class{constructor(){this.members=[]}add(e){pe(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(me(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(me(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){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},ac={borderRadius:{...Hs,applyTo:[...sa]},borderTopLeftRadius:Hs,borderTopRightRadius:Hs,borderBottomLeftRadius:Hs,borderBottomRightRadius:Hs,boxShadow:Us},oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Xo,{...ac,...Xo});var sc={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cc=[``,`X`,`Y`,`Z`],lc=1e3,uc=0;function dc(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function fc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=qi(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,L,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fc(r)}function pc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=uc++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,wo.value&&(sc.nodes=sc.calculatedTargetDeltas=sc.calculatedProjections=0),this.nodes.forEach(gc),this.nodes.forEach(Ec),this.nodes.forEach(Dc),this.nodes.forEach(_c),wo.addProjectionMetrics&&wo.addProjectionMetrics(sc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new tc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Se),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=la(t)&&!To(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;L.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=nc(i,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Tc)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Pc,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ls(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Si(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Tc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}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(),fn(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(Oc),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&&fc(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,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(bc),this.nodes.forEach(yc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sc),this.nodes.forEach(Cc),this.nodes.forEach(wc),this.nodes.forEach(mc),this.nodes.forEach(hc)):this.nodes.forEach(xc),this.clearAllSnapshots();let e=N.now();M.delta=A(0,1e3/60,e-M.timestamp),M.timestamp=e,M.isProcessing=!0,pn.update.process(M),pn.preRender.process(M),pn.render.process(M),M.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ha.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vc),this.sharedNodes.forEach(kc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!vs(this.snapshot.measuredBox.x)&&!vs(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.layoutCorrected||=B(),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=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ns(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ea(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Rc(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return B();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bc))){let{scroll:e}=this.root;e&&(Ia(t.x,e.offset.x),Ia(t.y,e.offset.y))}return t}removeElementScroll(e){let t=B();if(fs(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&fs(t,e),Ia(t.x,i.offset.x),Ia(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||B();fs(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Ia(r.x,-n.scroll.offset.x),Ia(r.y,-n.scroll.offset.y)),Ea(n.latestValues)&&za(r,n.latestValues,n.layout?.layoutBox)}return Ea(this.latestValues)&&za(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=B();fs(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ea(n.latestValues))continue;let r;n.instance&&(Ta(n.latestValues)&&n.updateSnapshot(),r=B(),fs(r,n.measurePageBox())),js(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ea(this.latestValues)&&js(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||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!==M.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=M.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fs(this.target,this.layout.layoutBox),Ma(this.target,this.targetDelta)):fs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),wo.value&&sc.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ta(this.parent.latestValues)||Da(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),Ts(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),fs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===M.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;fs(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Fa(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=B());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ps(this.prevProjectionDelta.x,this.projectionDelta.x),ps(this.prevProjectionDelta.y,this.projectionDelta.y)),xs(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!zs(this.projectionDelta.x,this.prevProjectionDelta.x)||!zs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),wo.value&&sc.calculatedProjections++}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=Oo(),this.projectionDelta=Oo(),this.projectionDeltaWithTransform=Oo()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Oo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=B(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Nc));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=I(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=I(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ac(o.x,e.x,n),Ac(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ts(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Mc(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Fs(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=B(),fs(f,this.relativeTarget)),c&&(this.animationValues=a,qs(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(fn(this.pendingAnimation),void 0),this.pendingAnimation=L.update(()=>{oc.hasAnimatedSinceResize=!0,this.motionValue||=bi(0),this.motionValue.jump(0,!1),this.currentAnimation=Qs(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),qn(this.currentAnimation,this),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(lc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&zc(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||B();let t=vs(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=vs(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}fs(t,i),za(t,r),xs(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ic),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.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:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&dc(`z`,e,r,this.animationValues);for(let t=0;t<cc.length;t++)dc(`rotate${cc[t]}`,e,r,this.animationValues),dc(`skew${cc[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=rc(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=rc(t?.pointerEvents)||``),this.hasProjected&&!Ea(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Ws(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Xo){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Xo[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?rc(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(yc),this.root.sharedNodes.clear()}}}function mc(e){e.updateLayout()}function hc(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Bs(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=vs(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ds(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else zc(i,t.layoutBox,n)&&Bs(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=vs(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Oo();xs(o,n,t.layoutBox);let s=Oo();a?xs(s,e.applyTransform(r,!0),t.measuredBox):xs(s,n,t.layoutBox);let c=!Ns(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=B();Ts(s,t.layoutBox,i.layoutBox,o);let c=B();Ts(c,n,a.layoutBox,o),Ls(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function gc(e){wo.value&&sc.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function _c(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vc(e){e.clearSnapshot()}function yc(e){e.clearMeasurements()}function bc(e){e.isLayoutDirty=!0,e.updateLayout()}function xc(e){e.isLayoutDirty=!1}function Sc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Cc(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function wc(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Tc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ec(e){e.resolveTargetDelta()}function Dc(e){e.calcProjection()}function Oc(e){e.resetSkewAndRotation()}function kc(e){e.removeLeadSnapshot()}function Ac(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jc(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Mc(e,t,n,r){jc(e.x,t.x,n.x,r),jc(e.y,t.y,n.y,r)}function Nc(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Pc={duration:.45,ease:[.4,0,.1,1]},Fc=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ic=Fc(`applewebkit/`)&&!Fc(`chrome/`)?Math.round:be;function Lc(e){e.min=Ic(e.min),e.max=Ic(e.max)}function Rc(e){Lc(e.x),Lc(e.y)}function zc(e,t,n){return e===`position`||e===`preserve-aspect`&&!ys(Rs(t),Rs(n),.2)}function Bc(e){return e!==e.root&&e.scroll?.wasRoot}var Vc=pc({attachResizeListener:(e,t)=>$s(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hc={current:void 0},Uc=pc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hc.current){let e=new Vc({});e.mount(window),e.setOptions({layoutScroll:!0}),Hc.current=e}return Hc.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Wc=(0,k.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Gc(e=!0){let t=(0,k.useContext)(fe);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,k.useId)();(0,k.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,k.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Kc=(0,k.createContext)({strict:!1}),qc={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`]},Jc=!1;function Yc(){if(Jc)return;let e={};for(let t in qc)e[t]={isEnabled:e=>qc[t].some(t=>!!e[t])};Wo(e),Jc=!0}function Xc(){return Yc(),Go()}function Zc(e){let t=Xc();for(let n in e)t[n]={...t[n],...e[n]};Wo(t)}var Qc=(0,k.createContext)({});function $c(e,t){if(Fo(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Mo(t)?t:void 0,animate:Mo(n)?n:void 0}}return e.inherit===!1?{}:t}function el(e){let{initial:t,animate:n}=$c(e,(0,k.useContext)(Qc));return(0,k.useMemo)(()=>({initial:t,animate:n}),[tl(t),tl(n)])}function tl(e){return Array.isArray(e)?e.join(` `):e}var nl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rl(e,t,n){for(let r in t)!z(t[r])&&!Zo(r,n)&&(e[r]=t[r])}function il({transformTemplate:e},t){return(0,k.useMemo)(()=>{let n=nl();return ha(n,t,e),Object.assign({},n.vars,n.style)},[t])}function al(e,t){let n=e.style||{},r={};return rl(r,n,e),Object.assign(r,il(e,t)),r}function ol(e,t){let n={},r=al(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var sl=()=>({...nl(),attrs:{}});function cl(e,t,n,r){let i=(0,k.useMemo)(()=>{let n=sl();return ba(n,t,ns(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};rl(t,e.style,e),i.style={...t,...i.style}}return i}var ll=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function ul(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||ll.has(e)}function dl(e,t){return e.startsWith(`on`)?!ul(e):t?.(e)??!ul(e)}function fl(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(z(e[a])||(dl(a,r)||n===!0&&ul(a)||!t&&!ul(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var pl=[`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 ml(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(pl.indexOf(e)>-1||/[A-Z]/u.test(e))}function hl(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ml(e)?cl:ol)(t,r,i,e),l=fl(t,typeof e==`string`,a,s),u=e===k.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,k.useMemo)(()=>z(d)?d.get():d,[d]);return(0,k.createElement)(e,{...u,children:f})}function gl({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:_l(n,r,i,e),renderState:t()}}function _l(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rc(a[e]);let{initial:o,animate:s}=e,c=Fo(e),l=Io(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!jo(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Fi(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var vl=e=>(t,n)=>{let r=(0,k.useContext)(Qc),i=(0,k.useContext)(fe),a=()=>gl(e,t,r,i);return n?a():ue(a)},yl=vl({scrapeMotionValuesFromProps:Qo,createRenderState:nl}),bl=vl({scrapeMotionValuesFromProps:is,createRenderState:sl}),xl=Symbol.for(`motionComponentSymbol`);function Sl(e,t,n){let r=(0,k.useRef)(n);(0,k.useInsertionEffect)(()=>{r.current=n});let i=(0,k.useRef)(null);return(0,k.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Cl=(0,k.createContext)({});function wl(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Tl(e,t,n,r,i,a){let{visualElement:o}=(0,k.useContext)(Qc),s=(0,k.useContext)(Kc),c=(0,k.useContext)(fe),l=(0,k.useContext)(Wc),u=l.reducedMotion,d=l.skipAnimations,f=(0,k.useRef)(null),p=(0,k.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,k.useContext)(Cl);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&El(f.current,n,i,h);let g=(0,k.useRef)(!1);(0,k.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ki],v=(0,k.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return de(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),de(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,k.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function El(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Dl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&wl(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Dl(e){if(e)return e.options.allowProjection===!1?Dl(e.parent):e.projection}function Ol(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Zc(r);let a=n?n===`svg`:ml(e),o=a?bl:yl;function s(n,s){let c,l={...(0,k.useContext)(Wc),...n,layoutId:kl(n)},{isStatic:u,isValidProp:d}=l,f=el(n),p=o(n,u);if(!u&&typeof window<`u`){Al(l,r);let t=jl(l);c=t.MeasureLayout,f.visualElement=Tl(e,p,l,i,t.ProjectionNode,a)}return(0,O.jsxs)(Qc.Provider,{value:f,children:[c&&f.visualElement?(0,O.jsx)(c,{visualElement:f.visualElement,...l}):null,hl(e,n,Sl(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,k.forwardRef)(s);return c[xl]=e,c}function kl({layoutId:e}){let t=(0,k.useContext)(le).id;return t&&e!==void 0?t+`-`+e:e}function Al(e,t){(0,k.useContext)(Kc).strict}function jl(e){let{drag:t,layout:n}=Xc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ml(e,t){if(typeof Proxy>`u`)return Ol;let n=new Map,r=(n,r)=>Ol(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ol(a,void 0,e,t)),n.get(a))})}var Nl=(e,t)=>t.isSVG??ml(e)?new as(t):new es(t,{allowProjection:e!==k.Fragment}),Pl=class extends Jo{constructor(e){super(e),e.animationState||=cs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();jo(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?.()}},Fl=0,Il={animation:{Feature:Pl},exit:{Feature:class extends Jo{constructor(){super(...arguments),this.id=Fl++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ii(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Ll(e){return{point:{x:e.pageX,y:e.pageY}}}var Rl=e=>t=>Za(t)&&e(t,Ll(t));function zl(e,t,n,r){return $s(e,t,Rl(n),r)}var Bl=({current:e})=>e?e.ownerDocument.defaultView:null,Vl=(e,t)=>Math.abs(e-t);function Hl(e,t){let n=Vl(e.x,t.x),r=Vl(e.y,t.y);return Math.sqrt(n**2+r**2)}var Ul=new Set([`auto`,`scroll`]),Wl=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=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=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Gl(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ql(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Hl(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:N.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Gl(t,this.transformPagePoint),this.hasPendingMove=!0,L.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ql(e.type===`pointercancel`?this.lastMoveEventInfo:Gl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Za(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Gl(Ll(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=M;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ql(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=j(zl(this.contextWindow,`pointermove`,this.handlePointerMove,d),zl(this.contextWindow,`pointerup`,this.handlePointerUp,d),zl(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Ul.has(e.overflowX)||Ul.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}),window.addEventListener(`scroll`,this.onWindowScroll),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 n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fn(this.updatePoint)}};function Gl(e,t){return t?{point:t(e.point)}:e}function Kl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ql({point:e},t){return{point:e,delta:Kl(e,Yl(t)),offset:Kl(e,Jl(t)),velocity:Xl(t,.1)}}function Jl(e){return e[0]}function Yl(e){return e[e.length-1]}function Xl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Yl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ce(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ce(t)*2&&(r=e[1]);let a=we(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Zl(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?I(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function Ql(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function $l(e,{top:t,left:n,bottom:r,right:i}){return{x:Ql(e.x,n,i),y:Ql(e.y,t,r)}}function eu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function tu(e,t){return{x:eu(e.x,t.x),y:eu(e.y,t.y)}}function nu(e,t){let n=.5,r=vs(e),i=vs(t);return i>r?n=xe(t.min,t.max-r,e.min):r>i&&(n=xe(e.min,e.max-i,t.min)),A(0,1,n)}function ru(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var iu=.35;function au(e=iu){return e===!1?e=0:e===!0&&(e=iu),{x:ou(e,`left`,`right`),y:ou(e,`top`,`bottom`)}}function ou(e,t,n){return{min:su(e,t),max:su(e,n)}}function su(e,t){return typeof e==`number`?e:e[t]||0}var cu=new WeakMap,lu=class{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=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ka(n),!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),Bs(e=>{let t=this.getAxisMotionValue(e).get()||0;if(vt.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=vs(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&L.update(()=>i(e,t),!1,!0),Wi(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=pu(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&L.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Wl(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Bl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&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,n){let{drag:r}=this.getProps();if(!n||!fu(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Zl(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&wl(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?$l(n.layoutBox,e):!1,this.elastic=au(t),r!==this.constraints&&!wl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bs(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ru(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!wl(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Va(n,r.root,this.visualElement.getTransformPagePoint()),a=tu(r.layout.layoutBox,i);if(t){let e=t(Sa(a));this.hasMutatedConstraints=!!e,e&&(a=xa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bs(o=>{if(!fu(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Wi(this.visualElement,e),n.start(Ai(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Bs(e=>{if(!fu(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-I(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!wl(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Bs(e=>{let t=this.getAxisMotionValue(e).get();i[e]=nu({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bs(t=>{let n=this.getAxisMotionValue(t);if(!fu(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(I(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cu.set(this.visualElement,this);let e=this.visualElement.current,t=zl(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&to(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();wl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=du(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(r);let o=$s(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bs(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=iu,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function uu(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function du(e,t,n){let r=Co(e,uu(n)),i=Co(t,uu(n));return()=>{r(),i()}}function fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pu(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var mu=class extends Jo{constructor(e){super(e),this.removeGroupControls=be,this.removeListeners=be,this.controls=new lu(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}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()}},hu=e=>(t,n)=>{e&&L.update(()=>e(t,n),!1,!0)},gu=class extends Jo{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(e){this.session=new Wl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:hu(e),onStart:hu(t),onMove:hu(n),onEnd:(e,t)=>{delete this.session,r&&L.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=zl(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_u=!1,vu=class extends k.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_u&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_u=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||L.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Ha.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_u=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function yu(e){let[t,n]=Gc(),r=(0,k.useContext)(le);return(0,O.jsx)(vu,{...e,layoutGroup:r,switchLayoutGroup:(0,k.useContext)(Cl),isPresent:t,safeToRemove:n})}var bu={pan:{Feature:gu},drag:{Feature:mu,ProjectionNode:Uc,MeasureLayout:yu}};function xu(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&L.postRender(()=>i(t,Ll(t)))}var Su=class extends Jo{mount(){let{current:e}=this.node;e&&(this.unmount=Ya(e,(e,t)=>(xu(this.node,t,`Start`),e=>xu(this.node,e,`End`))))}unmount(){}},Cu=class extends Jo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{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=j($s(this.node.current,`focus`,()=>this.onFocus()),$s(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function wu(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&L.postRender(()=>i(t,Ll(t)))}var Tu=class extends Jo{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=co(e,(e,t)=>(wu(this.node,t,`Start`),(e,{success:t})=>wu(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Eu=new WeakMap,Du=new WeakMap,Ou=e=>{let t=Eu.get(e.target);t&&t(e)},ku=e=>{e.forEach(Ou)};function Au({root:e,...t}){let n=e||document;Du.has(n)||Du.set(n,{});let r=Du.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ku,{root:e,...t})),r[i]}function ju(e,t,n){let r=Au(t);return Eu.set(e,n),r.observe(e),()=>{Eu.delete(e),r.unobserve(e)}}var Mu={some:0,all:1},Nu=class extends Jo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Mu[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=ju(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Pu(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Pu({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Fu={inView:{Feature:Nu},tap:{Feature:Tu},focus:{Feature:Cu},hover:{Feature:Su}},Iu={layout:{ProjectionNode:Uc,MeasureLayout:yu}},Lu=Ml({...Il,...Fu,...bu,...Iu},Nl),Ru={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Ru.node;var zu=l(Ru),Bu={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Bu.node;var Vu=l(Bu),Hu={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Hu.node;var Uu=l(Hu),Wu={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Wu.node;var Gu=l(Wu),Ku={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ku.node;var qu=l(Ku),Ju=(0,k.createContext)(null);function Yu({children:e,ports:t={}}){let n=t.timer??S,[r,i]=(0,k.useState)(null),[a,o]=(0,k.useState)(``),s=(0,k.useRef)(null);(0,k.useEffect)(()=>{r?.kind===`prompt`&&(o(r.options.initialValue??``),n.setTimeout(()=>{s.current?.focus(),s.current?.select()},0))},[r,n]);let l=(0,k.useCallback)(()=>{i(null),o(``)},[]),u=(0,k.useCallback)(()=>{r&&(r.kind===`confirm`?r.resolve(!1):r.kind===`prompt`?r.resolve(null):r.resolve(),l())},[l,r]),d=(0,k.useCallback)(()=>{r&&(r.kind===`confirm`?r.resolve(!0):r.kind===`prompt`?r.resolve(a.trim()||null):r.resolve(),l())},[l,r,a]),f=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`confirm`,options:e,resolve:t})}),[]),p=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`prompt`,options:e,resolve:t})}),[]),m=(0,k.useCallback)(e=>new Promise(t=>{i({kind:`alert`,options:e,resolve:t})}),[]),h=(0,k.useMemo)(()=>({confirm:f,prompt:p,alert:m}),[m,f,p]),g=`Confirm`;return r&&(r.kind===`alert`?g=r.options.closeLabel??`OK`:`confirmLabel`in r.options&&(g=r.options.confirmLabel??`Confirm`)),(0,O.jsxs)(Ju.Provider,{value:h,children:[e,(0,O.jsx)(y,{open:r!==null,onOpenChange:e=>{!e&&r&&u()},children:(0,O.jsx)(v,{size:`sm`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&r&&r.kind===`confirm`&&(e.preventDefault(),d())},children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(x,{className:`space-y-4`,children:[(0,O.jsx)(C,{children:r.options.title}),r.options.description?(0,O.jsx)(_,{children:r.options.description}):null,r.kind===`prompt`?(0,O.jsx)(w,{ref:s,type:`text`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())},placeholder:r.options.placeholder}):null]}),(0,O.jsxs)(b,{children:[(0,O.jsx)(c,{variant:`ghost`,size:`sm`,onClick:u,className:r.kind===`alert`?`hidden`:void 0,children:`cancelLabel`in r.options?r.options.cancelLabel??`Cancel`:`Cancel`}),(0,O.jsx)(c,{variant:r.kind===`confirm`?r.options.confirmVariant??`default`:`secondary`,size:`sm`,onClick:d,disabled:r.kind===`prompt`&&!a.trim(),children:g})]})]}):null})})]})}function Xu(){let e=(0,k.useContext)(Ju);if(!e)throw Error(`useAppDialog must be used within AppDialogProvider`);return e}var Zu=typeof window<`u`,Qu=Zu?window:null,$u=Zu?document:null,V={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},H={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},ed={NONE:0,AUTO:1,FORCE:2},td={replace:0,none:1,blend:2},nd=Symbol(),rd=Symbol(),id=Symbol(),ad=Symbol(),od=Symbol(),U=1e-11,sd=0xe8d4a51000,cd=1e3,ld=[],ud=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),dd=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],fd=dd.reduce((e,t)=>({...e,[t]:t+`(`}),{}),pd=()=>{},md=e=>e,hd=/\)\s*[-.\d]/,gd=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,_d=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,vd=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,yd=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,bd=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,xd=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Sd=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Cd=/([a-z])([A-Z])/g,wd=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Td={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:cd,delay:0,loopDelay:0,ease:`out(2)`,composition:td.replace,modifier:md,onBegin:pd,onBeforeUpdate:pd,onUpdate:pd,onLoop:pd,onPause:pd,onComplete:pd,onRender:pd},Ed={current:null,root:$u},W={defaults:Td,precision:4,timeScale:1,tickThreshold:200,editor:null},Dd={version:`4.5.0`,engine:null};Zu&&(Qu.AnimeJS||=[],Qu.AnimeJS.push(Dd));var Od=e=>e.replace(Cd,`$1-$2`).toLowerCase(),kd=(e,t)=>e.indexOf(t)===0,Ad=Date.now,jd=Array.isArray,Md=e=>e&&e.constructor===Object,Nd=e=>typeof e==`number`&&!isNaN(e),Pd=e=>typeof e==`string`,Fd=e=>typeof e==`function`,G=e=>e===void 0,Id=e=>G(e)||e===null,Ld=e=>Zu&&e instanceof SVGElement,Rd=e=>gd.test(e),zd=e=>kd(e,`rgb`),Bd=e=>kd(e,`hsl`),Vd=e=>Rd(e)||(zd(e)||Bd(e))&&(e[e.length-1]===`)`||!hd.test(e)),Hd=e=>!W.defaults.hasOwnProperty(e),Ud=[`opacity`,`rotate`,`overflow`,`color`],Wd=(e,t)=>{if(Ud.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},Gd=Math.pow,Kd=Math.sqrt,qd=Math.sin,Jd=Math.cos,Yd=Math.abs,Xd=Math.exp,Zd=Math.floor,Qd=Math.asin,$d=Math.PI,ef=Math.round,tf=(e,t,n)=>e<t?t:e>n?n:e,K=(e,t)=>{if(t<0)return e;if(!t)return ef(e);let n=10**t;return ef(e*n)/n},nf=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,rf=e=>e===1/0?sd:e===-1/0?-sd:e,af=e=>e<=1e-11?U:rf(K(e,11)),q=e=>jd(e)?[...e]:e,of=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=G(i)?t[r]:i}return n},J=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},sf=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},cf=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},lf=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[ad],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!G(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:kd(t,`scale`)?`1`:kd(t,`rotate`)||kd(t,`skew`)?`0deg`:`0px`},uf=e=>{let t=``;for(let n=0,r=dd.length;n<r;n++){let r=dd[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${fd[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},df=[];function ff(e,t){if(!e)return null;let n=df.length;outer:for(let r=0;r<n;r++){let n=df[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=df[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var pf=e=>{let t=_d.exec(e)||vd.exec(e),n=G(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},mf=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},hf=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),gf=e=>{let t=yd.exec(e)||bd.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=G(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=K(hf(t,e,n+1/3)*255,0),s=K(hf(t,e,n)*255,0),c=K(hf(t,e,n-1/3)*255,0)}return[o,s,c,a]},_f=e=>zd(e)?pf(e):Rd(e)?mf(e):Bd(e)?gf(e):[0,0,0,1],Y=(e,t)=>G(e)?t:e,vf=(e,t)=>{let n=e.match(wd),r=t[rd]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},yf=(e,t,n,r,i,a)=>{if(Fd(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(Pd(e)&&kd(e,`var(`)){if(!i)return vf(e,t);let n=()=>vf(e,t);return i.func=n,n()}return e},bf=(e,t)=>e[rd]?e[id]&&Wd(e,t)?V.ATTRIBUTE:dd.includes(t)||ud.get(t)?V.TRANSFORM:kd(t,`--`)?V.CSS_VAR:t in e.style?V.CSS:t in e?V.OBJECT:V.ATTRIBUTE:V.OBJECT,xf=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[od]||e).getPropertyValue(t);return i===`auto`?`0`:i},Sf=(e,t,n,r)=>{let i=G(n)?bf(e,t):n,a=ff(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===V.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===V.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===V.TRANSFORM?lf(e,t,r):i===V.CSS_VAR?xf(e,t,r).trimStart():xf(e,t,r)},Cf=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,wf=()=>({t:H.NUMBER,n:0,u:null,o:null,d:null,s:null}),Tf=(e,t)=>{if(t.t=H.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&Sd.exec(r);if(i)return t.t=H.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Vd(r))return t.t=H.COLOR,t.d=_f(r),t;{let e=r.match(xd);return t.t=H.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(xd)||[],t}},Ef=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=q(e._toNumbers),t.s=q(e._strings),t),Df=wf(),Of=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(K(nf(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},kf=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=tf(g,-h,o),b=tf(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=U,T=i===ed.FORCE,ee=0,te=v,ne=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=tf(n,0,l),C&&e._currentIteration--,ee=e._currentIteration%2,te=b-n*t||0}let re=f^(p&&ee),E=e._ease,D=C?re?0:o:re?c-te:te;E&&(D=c*E(D/c)||0);let ie=(a?a.backwards:v<g)?!re:!!re;if(e._currentTime=v,e._iterationTime=D,e.backwards=ie,S&&!e.began?(e.began=!0,!n&&(!a||!ie&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===ed.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||D>=_&&y!==o||D<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(ie?x*-1:x)>=W.tickThreshold,i=K(e._offset+(a?a._offset:0)+h+D,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==td.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&D<p._startTime))&&(!m||_||D>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=tf(D-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===V.OBJECT,g=f===H.NUMBER,_=g&&m||n===0||n===1?-1:W.precision,v,y;if(g)v=y=i(K(nf(o._fromNumber,o._toNumber,n),_));else if(f===H.UNIT)y=i(K(nf(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===H.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(nf(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${K(e[0],0)},${K(e[1],0)},${K(e[2],0)},${e[3]})`)}else f===H.COMPLEX&&(v=Of(o,n,_));if(h&&(o._number=y),!r&&e!==td.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===V.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===V.TRANSFORM?(s!==l&&(l=s,u=s[ad]),u[e]=v,d=1):p===V.CSS?c[e]=v:p===V.CSS_VAR&&c.setProperty(e,v)),S&&(ne=1)}else o._value=v}else n&&m&&!_&&D<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=uf(u),d=0),o=o._next}!n&&ne&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!ie&&v>0&&!s||ie&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!ie):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!ie&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,ne},Af=(e,t,n,r,i)=>{let a=e._currentIteration;if(kf(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Ad(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;J(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&kf(t,e,n,1,ed.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}J(o,e=>{let t=K((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=kf(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},jf={},Mf=(e,t,n)=>{if(n===V.TRANSFORM)return ud.get(e)||e;if(n===V.CSS||n===V.ATTRIBUTE&&Ld(t)&&e in t.style){let t=jf[e];if(t)return t;{let t=e&&Od(e);return jf[e]=t,t}}return e},Nf=(e,t=!1)=>{if(e._hasChildren)J(e,e=>Nf(e,t),!0);else{let n=e;n.pause(),J(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=Id(o)||o===``;if(e._setter){if(!t&&!s){if(Tf(o,Df),Df.d){let t=Df.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Df.n;e._setter(e.target,e._number,e)}}else if(a===V.OBJECT)!t&&!s&&(i[r]=o);else if(i[rd]){if(a===V.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===V.TRANSFORM){let n=i[ad];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=uf(n):t.removeProperty(`transform`))}else s?t.removeProperty(Od(r)):t[r]=o}}i[rd]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Pf=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=cd/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?U:t,r=cd/n;n>Td.frameRate&&(Td.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?U:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?ed.NONE:(this._lastTickTime=n>=t?e-n%t:e,ed.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ff={animation:null,update:pd},If=e=>{let t=Ff.animation;return t||(t={duration:U,computeDeltaTime:pd,_offset:0,_delay:0,_head:null,_tail:null},Ff.animation=t,Ff.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===H.COMPLEX||e===H.COLOR?q(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),kf(t,1,1,0,ed.FORCE)}),t},Lf=Zu?requestAnimationFrame:setImmediate,Rf=Zu?cancelAnimationFrame:clearImmediate,zf=class extends Pf{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Td,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Ad();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(sf(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Af(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):ed.AUTO),r=i}Ff.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Ad()),this.reqId=Lf(Bf)),this}pause(){if(this.reqId)return this.paused=!0,Vf()}resume(){if(this.paused)return this.paused=!1,J(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(W.timeScale===1?1:cd)}set speed(e){let t=e*W.timeScale;this._speed!==t&&(this._speed=t,J(this,e=>e.speed=e._speed))}get timeUnit(){return W.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(W.timeScale!==r){W.timeScale=r,W.tickThreshold=200*r;let e=n?t:cd;this.defaults.duration*=e,this._speed*=e}}get precision(){return W.precision}set precision(e){W.precision=e}},X=(()=>{let e=new zf(Ad());return Zu&&(Dd.engine=e,$u.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&($u.hidden?e.pause():e.resume())})),e})(),Bf=()=>{X._head?(X.reqId=Lf(Bf),X.update()):X.reqId=0},Vf=()=>(Rf(X.reqId),X.reqId=0,X),Hf={_rep:new WeakMap,_add:new Map},Uf=(e,t,n=`_rep`)=>{let r=Hf[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Wf=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Gf=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=U,e._currentTime=U},Kf=(e,t)=>{let n=e._composition;if(n===td.replace){let n=e._absoluteStartTime;cf(t,e,Wf,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Gf(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Gf(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=K(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Gf(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(J(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;J(e,e=>{e!==t&&J(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===td.blend){let t=Uf(e.target,e.property,`_add`),n=If(Hf._add),r=t._head;r||(r={...e},r._composition=td.replace,r._updateDuration=U,r._startTime=0,r._numbers=q(e._fromNumbers),r._number=0,r._next=null,r._prev=null,cf(t,r),cf(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=q(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=q(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}cf(t,e,null,`_prevAdd`,`_nextAdd`)}return e},qf=e=>{let t=e._composition;if(t!==td.none){let n=e.target,r=e.property,i=Hf._rep.get(n)[r];if(sf(i,e,`_prevRep`,`_nextRep`),t===td.blend){let t=Hf._add,i=t.get(n);if(!i)return;let a=i[r],o=Ff.animation;sf(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){sf(a,s,`_prevAdd`,`_nextAdd`),sf(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},Jf=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Yf=e=>e._cancelled?(e._hasChildren?J(e,Yf):J(e,e=>{e._composition!==td.none&&Kf(e,Uf(e.target,e.property))}),e._cancelled=0,e):e,Xf=0,Zf=(e,t)=>e._priority>t._priority,Qf=class extends Pf{constructor(e={},t=null,n=0){super(0),++Xf;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Ed.current&&Ed.current.register(this);let b=t?0:X._lastTickTime,x=t?t.defaults:W.defaults,S=Fd(i)||G(i)?x.delay:+i,C=Fd(a)||G(a)?1/0:+a,w=Y(c,x.loop),T=Y(l,x.loopDelay),ee=w===!0||w===1/0||w<0?1/0:w+1,te=0;t?te=n:(X.reqId||X.requestTick(Ad()),te=(X._lastTickTime-X._startTime)*W.timeScale),this.id=G(r)?Xf:r,this.parent=t,this.duration=rf((C+T)*ee-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=ee,this._autoplay=!t&&Y(u,x.autoplay),this._offset=te,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=pd,this._running=!1,this._reversed=+Y(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Y(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=Y(d,x.frameRate),this._speed=Y(f,x.playbackRate),this._priority=+Y(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return tf(K(this._currentTime,W.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return tf(K(this._iterationTime,W.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return tf(K(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return tf(K(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*tf(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Yf(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Af(this,0,1,~~e,ed.FORCE),Jf(this),this._hasChildren&&J(this,Jf),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Af(this,this.duration,1,~~e,ed.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!G(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*X._speed);return this._startTime=Ad()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Af(this,U,0,0,ed.FORCE):(this._running||=(cf(X,this,Zf),X._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,X.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Yf(this),this.completed=!1;let r=this.paused;return this.paused=!0,Af(this,e+this._delay,~~t,~~n,ed.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?Zd(sd/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?J(this,e=>e.cancel(),!0):J(this,qf),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=af(e);if(t===n)return this;let r=e/t,i=e<=U;return this.duration=i?U:n,this.iterationDuration=i?U:af(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Af(this,0,1,0,ed.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=pd){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=pd};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function $f(e){let t=Pd(e)?Ed.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function ep(e){if(Id(e))return[];if(!Zu)return jd(e)&&e.flat(1/0)||[e];if(jd(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!Id(r)){let e=$f(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!Id(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=$f(e);return t?Array.from(t):[e]}function tp(e){let t=ep(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[nd]){n[nd]=!0;let e=Ld(n);(n.nodeType||e)&&(n[rd]=!0,n[id]=e,n[ad]={})}}return t}var np={deg:1,rad:180/$d,turn:360},rp={},ip=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===H.UNIT&&i===n)return t;let o=a+i+n,s=rp[o];if(!G(s)&&!r)t.n=s;else{let r;if(i in np)r=a*np[i]/np[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==$u?o:$u.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,rp[o]=r}return t.t,H.UNIT,t.u=n,t},ap=e=>e,op=(e=1.68)=>t=>Gd(t,+e),sp={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},cp=$d/2,lp=$d*2,up={"":op,Quad:op(2),Cubic:op(3),Quart:op(4),Quint:op(5),Sine:e=>1-Jd(e*cp),Circ:e=>1-Kd(1-e*e),Expo:e=>e?Gd(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=Gd(2,--n))-1)/11;);return 1/Gd(4,3-n)-7.5625*Gd((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=tf(+e,1,10),r=tf(+t,U,2),i=r/lp*Qd(1/n),a=lp/r;return e=>e===0||e===1?e:-n*Gd(2,-10*(1-e))*qd((1-e-i)*a)}},dp=(()=>{let e={linear:ap,none:ap};for(let t in sp)for(let n in up){let r=up[n],i=sp[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),fp={linear:ap,none:ap},pp=e=>{if(fp[e])return fp[e];if(e.indexOf(`(`)<=-1){let t=sp[e]||e.includes(`Back`)||e.includes(`Elastic`)?dp[e]():dp[e];return t?fp[e]=t:ap}{let t=e.slice(0,-1).split(`(`),n=dp[t[0]];return n?fp[e]=n(...t[1].split(`,`)):ap}},mp=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],hp=e=>{if(Pd(e)){for(let t=0,n=mp.length;t<n;t++)if(kd(e,mp[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),ap}return Fd(e)?e:Pd(e)?pp(e):ap},Z=wf(),Q=wf(),gp={},_p={func:null},vp={func:null},yp=[null],bp=[null,null],xp={to:null},Sp=0,Cp=0,wp,Tp,Ep=(e,t)=>{let n={};if(jd(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Hd);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Hd(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=Y(t.duration,W.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Hd(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Dp=class extends Qf{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Cp;let s=tp(e),c=s.length,l=t.keyframes,u=l?of(Ep(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:W.defaults,b=Y(m,y.ease),x=Y(h,y.playbackEase),S=x?hp(x):null,C=!G(b.ease),w=C?b.ease:Y(m,S?`linear`:y.ease),T=C?b.settlingDuration:Y(p,y.duration),ee=Y(f,y.delay),te=g||y.modifier,ne=G(_)&&c>=1e3?td.none:G(_)?y.composition:_,re=this._offset+(n?n._offset:0);C&&(b.parent=this);let E=NaN,D=NaN,ie=0,ae=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Hd(e)){let a=bf(t,e),o=ff(t,e),s=Mf(e,t,a),f=u[e],p=jd(f);if(i&&!p&&(bp[0]=f,bp[1]=f,f=bp),p){let e=f.length,t=!Md(f[0]);e===2&&t?(xp.to=f,yp[0]=xp,wp=yp):e>2&&t?(wp=[],f.forEach((e,t)=>{t?t===1?(bp[1]=e,wp.push(bp)):wp.push(e):bp[0]=e})):wp=f}else yp[0]=f,wp=yp;let m=null,h=null,g=NaN,_=0,v=0;for(let e=wp.length;v<e;v++){let i=wp[v];Md(i)?Tp=i:(xp.to=i,Tp=xp),_p.func=null,vp.func=null;let l=yf(Y(Tp.composition,ne),t,r,c,null,null),u=Nd(l)?l:td[l];!m&&u!==td.none&&(m=Uf(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=yf(Tp.to,t,r,c,_p,f),y;Md(p)&&!G(p.to)?(Tp=p,y=p.to):y=p;let b=yf(Tp.from,t,r,c,vp,f),x=Tp.ease||w,S=yf(x,t,r,c,null,f),C=Fd(S)||Pd(S)?S:x,E=!G(C)&&!G(C.ease),D=E?C.ease:C,oe=E?C.settlingDuration:yf(Y(Tp.duration,e>1?yf(T,t,r,c,null,f)/e:T),t,r,c,null,f),se=yf(Y(Tp.delay,v?0:ee),t,r,c,null,f),ce=Tp.modifier||te,O=!G(b),k=!G(y),le=jd(y),ue=le||O&&k,de=h?_:0,fe=h?_+se:se,pe=K(re+fe,12),me=K(re+de,12);!ae&&(O||le)&&(ae=1);let A=h;if(u!==td.none){let e=m._head;for(;e&&e._absoluteStartTime<=pe;)if(e._isOverridden||(A=e),e=e._nextRep,e&&e._absoluteStartTime>=pe)for(;e;)Gf(e),e=e._nextRep}if(ue){Tf(le?yf(y[0],t,r,c,vp,f):b,Z),Tf(le?yf(y[1],t,r,c,_p,f):y,Q);let e=Sf(t,s,a,gp);Z.t===H.NUMBER&&(A?A._valueType===H.UNIT&&(Z.t=H.UNIT,Z.u=A._unit):(Tf(e,Df),Df.t===H.UNIT&&(Z.t=H.UNIT,Z.u=Df.u)))}else k?Tf(y,Q):h?Ef(h,Q):Tf(n&&A&&A.parent.parent===n?A._value:Sf(t,s,a,gp),Q),O?Tf(b,Z):h?Ef(h,Z):Tf(n&&A&&A.parent.parent===n?A._value:Sf(t,s,a,gp),Z);if(Z.o&&(Z.n=Cf(A?A._toNumber:Tf(Sf(t,s,a,gp),Df).n,Z.n,Z.o)),Q.o&&(Q.n=Cf(Z.n,Q.n,Q.o)),Z.t!==Q.t){if(Z.t===H.COMPLEX||Q.t===H.COMPLEX){let e=Z.t===H.COMPLEX?Z:Q,t=Z.t===H.COMPLEX?Q:Z;t.t=H.COMPLEX,t.s=q(e.s),t.d=e.d.map(()=>t.n)}else if(Z.t===H.UNIT||Q.t===H.UNIT){let e=Z.t===H.UNIT?Z:Q,t=Z.t===H.UNIT?Q:Z;t.t=H.UNIT,t.u=e.u}else if(Z.t===H.COLOR||Q.t===H.COLOR){let e=Z.t===H.COLOR?Z:Q,t=Z.t===H.COLOR?Q:Z;t.t=H.COLOR,t.d=e.d.map(()=>0)}}if(Z.u!==Q.u){let e=Q.u?Z:Q;e=ip(t,e,Q.u?Q.u:Z.u,!1)}if(Q.d&&Z.d&&Q.d.length!==Z.d.length){let e=Z.d.length>Q.d.length?Z:Q,t=e===Z?Q:Z;t.d=e.d.map((e,n)=>G(t.d[n])?0:t.d[n]),t.s=q(e.s)}let he=K(+oe||1e-11,12),ge=gp[s];Id(ge)||(gp[s]=null);let _e=o?o.set:null;_=K(fe+he,12);let ve=Z.d,ye=Q.d,be=Q.s,j={parent:this,id:Sp++,property:s,target:t,_value:null,_toFunc:_p.func,_fromFunc:vp.func,_ease:hp(D),_fromNumbers:ve?q(ve):ld,_toNumbers:ye?q(ye):ld,_strings:be?q(be):ld,_fromNumber:Z.n,_toNumber:Q.n,_numbers:ve?q(ve):ld,_number:Z.n,_unit:Q.u,_modifier:ce,_currentTime:0,_startTime:fe,_delay:+se,_updateDuration:he,_changeDuration:he,_absoluteStartTime:pe,_absoluteUpdateStartTime:me,_absoluteEndTime:K(re+_,12),_hasFromValue:O||le?1:0,_tweenType:a,_setter:_e,_valueType:Q.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ge,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==td.none&&Kf(j,m);let xe=j._valueType;if(xe===H.COMPLEX)j._value=Of(j,1,-1);else if(xe===H.UNIT)j._value=`${ce(j._toNumber)}${j._unit}`;else if(xe===H.COLOR){let e=Q.d;j._value=`rgba(${K(e[0],0)},${K(e[1],0)},${K(e[2],0)},${e[3]})`}else j._value=ce(j._toNumber);isNaN(g)&&(g=j._startTime),h=j,ie++,cf(this,j)}(isNaN(D)||g<D)&&(D=g),(isNaN(E)||_>E)&&(E=_),a===V.TRANSFORM&&(l=ie-v,d=ie)}if(!isNaN(l)){let e=0;J(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===td.blend&&J(Ff.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),D?(J(this,e=>{e._startTime-e._delay||(e._delay-=D),e._startTime-=D}),E-=D):D=0,E||(E=U,this.iterationCount=0),this.targets=s,this.id=G(d)?Cp:d,this.duration=E===1e-11?U:rf((E+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=D,this.iterationDuration=E,!this._autoplay&&ae&&this.onRender(this)}stretch(e){let t=this.duration;if(t===af(e))return this;let n=e/t;return J(this,e=>{e._updateDuration=af(e._updateDuration*n),e._changeDuration=af(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return J(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Tf(n(),Z),Z.u!==e._unit&&e.target[rd]&&ip(e.target,Z,e._unit,!0),e._fromNumbers=q(Z.d),e._fromNumber=Z.n):t&&(Tf(Sf(e.target,e.property,e._tweenType),Df),e._fromNumbers=q(Df.d),e._fromNumber=Df.n),t&&(Tf(t(),Q),e._toNumbers=q(Q.d),e._strings=q(Q.s),e._toNumber=Q.o?Cf(e._fromNumber,Q.n,Q.o):Q.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Nf(this)}then(e){return super.then(e)}},Op=(e,t)=>W.editor?W.editor.addAnimation(e,t):new Dp(e,t,null,0,!1).init(),kp={instant:80,quick:160,row:180,carry:240,panel:280,staggerTight:14,staggerRow:26,staggerLoose:40,sequence:860},Ap={arriving:`out(3)`,born:`outBack(1.6)`,panel:`cubicBezier(0.22, 1, 0.36, 1)`},jp={arriving:`cubic-bezier(0.22, 0.61, 0.36, 1)`,panel:`cubic-bezier(0.22, 1, 0.36, 1)`},Mp={landing:{stiffness:190,damping:17},indicator:{stiffness:240,damping:26},cardTravel:{stiffness:210,damping:24},drawer:{stiffness:210,damping:22},sheet:{stiffness:200,damping:21}};function Np(e,t){return Math.min(e,7)*t}var Pp=`(prefers-reduced-motion: reduce)`;function Fp(e=i){return e.matchesMediaQuery(Pp)}function Ip(){X.pauseOnDocumentHidden=!1,X.resume()}var Lp=r((e,t)=>{let n=null;return{spawnedChatId:null,markSpawned:(r,i=S)=>{n!==null&&i.clearTimeout(n),e({spawnedChatId:r}),n=i.setTimeout(()=>{n=null,t().clearSpawned(r)},kp.sequence)},clearSpawned:n=>{t().spawnedChatId===n&&e({spawnedChatId:null})}}});function Rp(e){return t=>e!==null&&t.spawnedChatId===e}function zp(e){return e.spawnedChatId!==null}var Bp={sm:.875,md:1,lg:1.125,xl:1.25,xxl:1.5};function Vp(e){return typeof e==`string`&&Object.hasOwn(Bp,e)}function Hp(e){return typeof e!=`string`||!Vp(e)?Bp.md:Bp[e]}function Up(e,t){return Vp(e)?e:Vp(t)?t:`md`}function Wp(e){let t=e&&Vp(e.scale)?e.scale:`md`;return{"--kanna-font-scale":String(Bp[t])}}function Gp(e){return Number.isFinite(e)?Math.max(1,Math.round(e)):1}function Kp(e){let t=e.trim().slice(0,512);return!t||!/^https?:\/\/\S+$/.test(t)?null:t.replace(/\/+$/,``)}var qp=8e3,Jp={idleTimeoutMs:6e5,maxConcurrent:4},Yp=6e4,Xp=36e5;({...Jp});var Zp={toggleEmbeddedTerminal:[`cmd+j`,"ctrl+`"],toggleRightSidebar:[`cmd+b`,`ctrl+b`],openInFinder:[`cmd+alt+f`,`ctrl+alt+f`],openInEditor:[`cmd+shift+o`,`ctrl+shift+o`],addSplitTerminal:[`cmd+/`,`ctrl+/`],jumpToSidebarChat:[`cmd+alt`],openProjectSwitcher:[`cmd+k`,`ctrl+k`],openTabSwitcher:["alt+`"],jumpToPaneTab:[`cmd+ctrl`,`ctrl+alt`],createChatInCurrentProject:[`cmd+alt+n`],openAddProject:[`cmd+alt+o`],newStack:[`cmd+alt+w`],newStackChat:[`cmd+alt+shift+n`],jumpToStacks:[`g s`],focusPaneLeft:[`cmd+ctrl+arrowleft`,`ctrl+alt+arrowleft`],focusPaneRight:[`cmd+ctrl+arrowright`,`ctrl+alt+arrowright`],focusPaneUp:[`cmd+ctrl+arrowup`,`ctrl+alt+arrowup`],focusPaneDown:[`cmd+ctrl+arrowdown`,`ctrl+alt+arrowdown`],splitPaneRight:[`cmd+ctrl+d`,`ctrl+alt+d`],splitPaneDown:[`cmd+ctrl+e`,`ctrl+alt+e`],closePaneTab:[`cmd+ctrl+w`,`ctrl+alt+q`],nextPaneTab:[`cmd+ctrl+j`,`ctrl+alt+j`],previousPaneTab:[`cmd+ctrl+k`,`ctrl+alt+k`],resizePaneLeft:[`cmd+ctrl+shift+arrowleft`,`ctrl+alt+shift+arrowleft`],resizePaneRight:[`cmd+ctrl+shift+arrowright`,`ctrl+alt+shift+arrowright`],resizePaneUp:[`cmd+ctrl+shift+arrowup`,`ctrl+alt+shift+arrowup`],resizePaneDown:[`cmd+ctrl+shift+arrowdown`,`ctrl+alt+shift+arrowdown`]},Qp=`toggleEmbeddedTerminal.toggleRightSidebar.openInFinder.openInEditor.addSplitTerminal.jumpToSidebarChat.openProjectSwitcher.openTabSwitcher.jumpToPaneTab.createChatInCurrentProject.openAddProject.newStack.newStackChat.jumpToStacks.focusPaneLeft.focusPaneRight.focusPaneUp.focusPaneDown.splitPaneRight.splitPaneDown.closePaneTab.nextPaneTab.previousPaneTab.resizePaneLeft.resizePaneRight.resizePaneUp.resizePaneDown`.split(`.`);function $p(e){return e===`cursor`||e===`vscode`||e===`xcode`||e===`windsurf`||e===`custom`}function em(e){return e===`never`||e===`unfocused`||e===`always`}function tm(e){return e===`blow`||e===`bottle`||e===`frog`||e===`funk`||e===`glass`||e===`ping`||e===`pop`||e===`purr`||e===`tink`}function nm(e){return e===`openai`||e===`openrouter`||e===`custom`}var rm=`moonshotai/kimi-k2.5:nitro`,im=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`xhigh`,label:`XHigh`},{id:`max`,label:`Max`}],am=[{id:`minimal`,label:`Minimal`},{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`xhigh`,label:`XHigh`}],om={reasoningEffort:`high`,contextWindow:`200k`},sm={reasoningEffort:`high`,fastMode:!1};function cm(e){return im.some(t=>t.id===e)}function lm(e){return am.some(t=>t.id===e)}var um=[{id:`200k`,label:`200k`},{id:`1m`,label:`1M`}];function dm(e){return um.some(t=>t.id===e)}var fm=[`low`,`medium`,`high`,`xhigh`,`max`],pm=[{id:`claude`,label:`Claude`,defaultModel:`claude-sonnet-4-6`,defaultEffort:`high`,supportsPlanMode:!0,models:[{id:`claude-fable-5`,label:`Fable 5`,supportedEfforts:fm,aliases:[`fable`],contextWindowOptions:[...um]},{id:`claude-opus-5`,label:`Opus 5`,supportedEfforts:fm,aliases:[`opus-5`],contextWindowOptions:[...um]},{id:`claude-sonnet-5`,label:`Sonnet 5`,supportedEfforts:fm,aliases:[`sonnet-5`],contextWindowOptions:[...um]},{id:`claude-opus-4-8`,label:`Opus 4.8`,supportedEfforts:fm,aliases:[`opus-4-8`],contextWindowOptions:[...um]},{id:`claude-opus-4-7`,label:`Opus 4.7`,supportedEfforts:fm,aliases:[`opus`],contextWindowOptions:[...um]},{id:`claude-sonnet-4-6`,label:`Sonnet 4.6`,supportedEfforts:[`low`,`medium`,`high`,`max`],aliases:[`sonnet`],contextWindowOptions:[...um]},{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`,supportedEfforts:[`low`,`medium`,`high`],aliases:[`haiku`]}],efforts:[...im]},{id:`codex`,label:`Codex`,defaultModel:`gpt-5.5`,supportsPlanMode:!0,models:[{id:`gpt-5.5`,label:`GPT-5.5`},{id:`gpt-5.4`,label:`GPT-5.4`},{id:`gpt-5.3-codex`,label:`GPT-5.3 Codex`,aliases:[`gpt-5-codex`]},{id:`gpt-5.3-codex-spark`,label:`GPT-5.3 Codex Spark`}],efforts:[]},{id:`openrouter`,label:`OpenRouter`,defaultModel:rm,supportsPlanMode:!0,models:[],efforts:[]}];function mm(e){let t=pm.find(t=>t.id===e);if(!t)throw Error(`Unknown provider: ${e}`);return t}function hm(e){return{id:e.id,label:e.label,...e.supportedEfforts?{supportedEfforts:e.supportedEfforts}:{},...e.aliases?{aliases:e.aliases}:{},...e.contextWindowOptions?{contextWindowOptions:e.contextWindowOptions}:{}}}function gm(e,t){return e.map(e=>{if(e.id!==`claude`&&e.id!==`codex`)return{...e,models:[...e.models]};let n=t.filter(t=>t.provider===e.id);if(n.length===0)return{...e,models:[...e.models]};let r=n.map(t=>{let n=hm(t),r=e.models.find(e=>e.id===n.id);return r?{...r,...n}:n}),i=r.some(t=>t.id===e.defaultModel)?e.defaultModel:r[0]?.id??e.defaultModel;return{...e,defaultModel:i,models:r}})}function _m(e,t){let n=mm(e);if(!t||t.length===0)return n;let[r]=gm([{...n,models:[...n.models]}],t);return r??n}function vm(e,t){return _m(e,t).models}function ym(e,t,n){if(!t)return;let r=vm(e,n);return r.find(e=>e.id===t)??r.find(e=>e.aliases?.includes(t))}function bm(e,t,n,r){let i=ym(e,t,r);if(i)return i.id;let a=_m(e,r),o=n??a.defaultModel;return!(r?.some(t=>t.provider===e)??!1)||a.models.some(e=>e.id===o)?o:a.defaultModel}function xm(e,t=`claude-opus-4-7`,n){return bm(`claude`,e,t,n)}function Sm(e,t=`gpt-5.5`,n){return bm(`codex`,e,t,n)}function Cm(e,t,n){let r=bm(e,t,void 0,n);return vm(e,n).find(e=>e.id===r)}function wm(e,t){return Cm(`claude`,e,t)}function Tm(e,t){let n=wm(e,t)?.supportedEfforts;return!n||n.length===0?[]:im.filter(e=>n.includes(e.id))}function Em(e,t,n){let r=wm(e,n)?.supportedEfforts;if(!r||r.length===0||r.includes(t))return t;for(let e of[`max`,`xhigh`,`high`,`medium`,`low`])if(r.includes(e))return e;return om.reasoningEffort}function Dm(e,t){return wm(e,t)?.contextWindowOptions??[]}function Om(e,t,n){let r=Dm(e,n);return r.length===0?om.contextWindow:dm(t)&&r.some(e=>e.id===t)?t:om.contextWindow}function km(e,t,n){return n||(pm.find(t=>t.id===e)?.models.find(e=>e.id===t)?.contextWindowOptions??[])}function Am(e){switch(e){case`1m`:return 1e6;default:return 2e5}}function jm(e){return e===`claude`||e===`codex`||e===`openrouter`}var Mm={toggleEmbeddedTerminal:`Toggle Embedded Terminal`,toggleRightSidebar:`Toggle Right Sidebar`,openInFinder:`Open In Finder`,openInEditor:`Open In Editor`,addSplitTerminal:`Add Split Terminal`,jumpToSidebarChat:`Jump To Sidebar Chat`,openProjectSwitcher:`Open Project Switcher`,openTabSwitcher:`Switch To Recent Tab`,jumpToPaneTab:`Jump To Tab By Number`,createChatInCurrentProject:`New Chat In Current Project`,openAddProject:`Open Add Project`,newStack:`New Stack`,newStackChat:`New Stack Chat`,jumpToStacks:`Jump To Stacks`,focusPaneLeft:`Focus Pane Left`,focusPaneRight:`Focus Pane Right`,focusPaneUp:`Focus Pane Up`,focusPaneDown:`Focus Pane Down`,splitPaneRight:`Split Pane Right`,splitPaneDown:`Split Pane Down`,closePaneTab:`Close Tab`,nextPaneTab:`Next Tab`,previousPaneTab:`Previous Tab`,resizePaneLeft:`Resize Pane Left`,resizePaneRight:`Resize Pane Right`,resizePaneUp:`Resize Pane Up`,resizePaneDown:`Resize Pane Down`};function Nm(e){return(e??[]).join(`, `)}function Pm(e){return e.split(`,`).map(e=>e.trim()).map(e=>e.toLowerCase()).filter(Boolean)}var Fm=new Map([[`cmd`,`meta`],[`meta`,`meta`],[`ctrl`,`ctrl`],[`control`,`ctrl`],[`alt`,`alt`],[`option`,`alt`],[`shift`,`shift`]]);function Im(e,t){let n=Qm(e);return n?$m(t,n.key)&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Lm(e,t,n){return zm(e,t).some(e=>Im(e,n))}function Rm(e,t,n){return zm(e,t).find(e=>Im(e,n))??null}function zm(e,t){return e?.bindings[t]??Zp[t]}function Bm(e){return Object.hasOwn(Zp,e)}function Vm(){return Object.keys(Zp).filter(Bm)}function Hm(e){let t={...Zp};for(let n of Vm())t[n]=e?.bindings[n]??Zp[n];return{bindings:t,warning:e?.warning??null,filePathDisplay:e?.filePathDisplay??``}}function Um(e,t){let n=Zm(e);return t.metaKey===n.meta&&t.altKey===n.alt&&t.ctrlKey===n.ctrl&&t.shiftKey===n.shift}function Wm(e,t){let n=Qm(e);return n?$m(t,n.key)&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&(!n.shift||t.shiftKey):!1}function Gm(e,t){let n=Zm(e),r=[[n.meta,t.metaKey],[n.ctrl,t.ctrlKey],[n.alt,t.altKey]].filter(([e])=>e);return r.length!==0&&r.some(([,e])=>!e)}function Km(e,t){let n=e=>Zm(e).meta;return e.find(e=>n(e)===t)??(t?e[0]:void 0)??null}var qm={meta:`⌘`,ctrl:`⌃`,alt:`⌥`,shift:`⇧`},Jm={meta:`Win`,ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`},Ym={arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,enter:`↵`,escape:`Esc`,tab:`Tab`};function Xm(e,t){let n=t?qm:Jm;return e.split(`+`).map(e=>e.trim().toLowerCase()).filter(Boolean).map(e=>{let t=Fm.get(e);return t===`ctrl`||t===`meta`||t===`alt`||t===`shift`?n[t]:Ym[e]??(e.length===1?e.toUpperCase():e)})}function Zm(e){let t={ctrl:!1,meta:!1,alt:!1,shift:!1};for(let n of e.split(`+`)){let e=Fm.get(n.trim().toLowerCase());(e===`ctrl`||e===`meta`||e===`alt`||e===`shift`)&&(t[e]=!0)}return t}function Qm(e){let t=e.split(`+`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return null;let n={key:``,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let e of t){let t=e.toLowerCase(),r=Fm.get(t);if(r===`ctrl`){n.ctrl=!0;continue}if(r===`meta`){n.meta=!0;continue}if(r===`alt`){n.alt=!0;continue}if(r===`shift`){n.shift=!0;continue}if(n.key)return null;n.key=t}return n.key?n:null}function $m(e,t){if(e.key.toLowerCase()===t)return!0;let n=eh(t);return n?e.code===n:!1}function eh(e){if(e.length===1&&e>=`a`&&e<=`z`)return`Key${e.toUpperCase()}`;if(e.length===1&&e>=`0`&&e<=`9`)return`Digit${e}`;switch(e){case`/`:return`Slash`;case"`":return`Backquote`;default:return null}}var th=[],nh=r()(e=>({rows:th,setRows:t=>e({rows:t.length>0?t:th})})),rh=e=>e.rows,ih=e=>t=>t.rows.find(t=>t.id===e)??null;function ah(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var oh=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return oh(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return oh(t)(e)}}}},sh=(e,t)=>(n,r,i)=>{let a={storage:ah(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return oh(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p};function ch(e){let t={},n=e.reasoningEffort;cm(n)&&(t.reasoningEffort=n);let r=e.contextWindow;return dm(r)&&(t.contextWindow=r),t}function lh(e){let t={},n=e.reasoningEffort;lm(n)&&(t.reasoningEffort=n);let r=e.fastMode;return typeof r==`boolean`&&(t.fastMode=r),t}function uh(e,t){return e.reasoningEffort===t.reasoningEffort&&e.contextWindow===t.contextWindow}function dh(e,t){return e.reasoningEffort===t.reasoningEffort&&e.fastMode===t.fastMode}function fh(e,t){return e.claude.model===t.claude.model&&e.claude.planMode===t.claude.planMode&&uh(e.claude.modelOptions,t.claude.modelOptions)&&e.codex.model===t.codex.model&&e.codex.planMode===t.codex.planMode&&dh(e.codex.modelOptions,t.codex.modelOptions)&&e.openrouter.model===t.openrouter.model&&e.openrouter.planMode===t.openrouter.planMode}function ph(){return T.getState().settings?.customModels??[]}var mh=`__new__`;function hh(e,t){let n=e?.modelOptions?.reasoningEffort,r;r=cm(n)?n:cm(e?.effort)?e.effort:om.reasoningEffort;let i=xm(e?.model,void 0,t),a=Om(i,e?.modelOptions?.contextWindow,t);return{model:i,modelOptions:{reasoningEffort:Em(i,r,t),contextWindow:a},planMode:!!e?.planMode}}function gh(e,t){let n=e?.modelOptions?.reasoningEffort,r;return r=lm(n)?n:lm(e?.effort)?e.effort:sm.reasoningEffort,{model:Sm(e?.model,void 0,t),modelOptions:{reasoningEffort:r,fastMode:typeof e?.modelOptions?.fastMode==`boolean`?e.modelOptions.fastMode:sm.fastMode},planMode:!!e?.planMode}}function _h(){return{claude:{model:`claude-opus-4-7`,modelOptions:{...om},planMode:!1},codex:{model:`gpt-5.5`,modelOptions:{...sm},planMode:!1},openrouter:{model:rm,modelOptions:{},planMode:!1}}}function vh(e,t){if(t===void 0){s.info(`[chat-preferences] ${e}`);return}s.info(`[chat-preferences] ${e}`,t)}function yh(e,t){if(e===`claude`){let e=t.claude;return{provider:`claude`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}if(e===`openrouter`){let e=t.openrouter;return{provider:`openrouter`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}let n=t.codex;return{provider:`codex`,model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function bh(e){return e.provider===`claude`?{provider:`claude`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}:e.provider===`openrouter`?{provider:`openrouter`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}:{provider:`codex`,model:e.model,modelOptions:{...e.modelOptions},planMode:e.planMode}}function xh(e){return e.providerHint?yh(e.providerHint,e.providerDefaults):e.defaultProvider===`last_used`?e.sourceState?bh(e.sourceState):yh(`claude`,e.providerDefaults):yh(e.defaultProvider,e.providerDefaults)}function Sh(e,t){return e.chatStates[t]||xh({defaultProvider:e.defaultProvider,providerDefaults:e.providerDefaults,legacyComposerState:e.legacyComposerState})}function Ch(e,t,n){let r=Sh(e,t);return{chatStates:{...e.chatStates,[t]:n(r)}}}var wh=r()(sh((e,t)=>({defaultProvider:`last_used`,providerDefaults:_h(),chatStates:{},pendingProviderSyncChatIds:new Set,legacyComposerState:{provider:`claude`,model:`claude-opus-4-7`,modelOptions:{...om},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),applyServerDefaults:(t,n)=>e(e=>{if(e.defaultProvider===t&&fh(e.providerDefaults,n))return{defaultProvider:t,providerDefaults:n};let{[mh]:r,...i}=e.chatStates;return{defaultProvider:t,providerDefaults:n,chatStates:i}}),setProviderDefaultModel:(t,n)=>e(e=>{let r=ph();return t===`claude`?{providerDefaults:{...e.providerDefaults,[t]:hh({...e.providerDefaults.claude,model:n},r)}}:t===`openrouter`?{providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults.openrouter,model:n}}}:{providerDefaults:{...e.providerDefaults,[t]:gh({...e.providerDefaults.codex,model:n},r)}}}),setProviderDefaultModelOptions:(t,n)=>e(e=>{let r=ph();if(t===`claude`){let i=ch(n);return{providerDefaults:{...e.providerDefaults,[t]:hh({...e.providerDefaults.claude,modelOptions:{...e.providerDefaults.claude.modelOptions,...i}},r)}}}if(t===`openrouter`)return{providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults.openrouter,modelOptions:{}}}};let i=lh(n);return{providerDefaults:{...e.providerDefaults,[t]:gh({...e.providerDefaults.codex,modelOptions:{...e.providerDefaults.codex.modelOptions,...i}},r)}}}),setProviderDefaultPlanMode:(t,n)=>e(e=>({providerDefaults:{...e.providerDefaults,[t]:{...e.providerDefaults[t],planMode:n}}})),getComposerState:e=>bh(Sh(t(),e)),initializeComposerForChat:(t,n)=>e(e=>{let r=e.chatStates[t],i=n?.providerHint;if(r){if(i&&e.pendingProviderSyncChatIds.has(t)){let n=new Set(e.pendingProviderSyncChatIds);if(n.delete(t),r.provider===i)return vh(`initializeComposerForChat sync skipped`,{chatId:t,provider:i}),{pendingProviderSyncChatIds:n};let a={...yh(i,e.providerDefaults),planMode:r.planMode};return vh(`initializeComposerForChat sync`,{chatId:t,provider:i}),{chatStates:{...e.chatStates,[t]:a},pendingProviderSyncChatIds:n}}return e}let a=xh({defaultProvider:e.defaultProvider,providerDefaults:e.providerDefaults,sourceState:n?.sourceState,legacyComposerState:e.legacyComposerState,providerHint:i});vh(`initializeComposerForChat`,{chatId:t,composerState:a});let o=i?e.pendingProviderSyncChatIds:new Set([...e.pendingProviderSyncChatIds,t]);return{chatStates:{...e.chatStates,[t]:a},pendingProviderSyncChatIds:o}}),setComposerState:(t,n)=>e(e=>{let r=ph();return{chatStates:{...e.chatStates,[t]:n.provider===`claude`?{provider:`claude`,model:hh(n,r).model,modelOptions:hh(n,r).modelOptions,planMode:n.planMode}:bh(n)}}}),setChatComposerProvider:(t,n)=>e(e=>Ch(e,t,()=>yh(n,e.providerDefaults))),setChatComposerModel:(t,n)=>e(e=>Ch(e,t,e=>{let t=ph();if(e.provider===`claude`){let r=hh({...e,model:n},t);return{provider:`claude`,model:r.model,modelOptions:r.modelOptions,planMode:e.planMode}}return e.provider===`openrouter`?{provider:`openrouter`,model:n,modelOptions:{},planMode:e.planMode}:{provider:`codex`,model:n,modelOptions:gh({...e,model:n},t).modelOptions,planMode:e.planMode}})),setChatComposerModelOptions:(t,n)=>e(e=>Ch(e,t,e=>{let t=ph();if(e.provider===`claude`){let r=ch(n);return{provider:`claude`,model:e.model,modelOptions:hh({...e,modelOptions:{...e.modelOptions,...r}},t).modelOptions,planMode:e.planMode}}if(e.provider===`openrouter`)return{provider:`openrouter`,model:e.model,modelOptions:{},planMode:e.planMode};let r=lh(n);return{provider:`codex`,model:e.model,modelOptions:gh({...e,modelOptions:{...e.modelOptions,...r}},t).modelOptions,planMode:e.planMode}})),setChatComposerPlanMode:(t,n)=>e(e=>Ch(e,t,e=>({...e,planMode:n}))),resetChatComposerFromProvider:(t,n)=>e(e=>{let r=new Set(e.pendingProviderSyncChatIds);return r.delete(t),{chatStates:{...e.chatStates,[t]:yh(n,e.providerDefaults)},pendingProviderSyncChatIds:r}}),forgetChats:t=>e(e=>({chatStates:Object.fromEntries(Object.entries(e.chatStates).filter(([e])=>!t.includes(e))),pendingProviderSyncChatIds:new Set([...e.pendingProviderSyncChatIds].filter(e=>!t.includes(e)))}))}),{name:`chat-preferences-state`,version:1,partialize:e=>({chatStates:e.chatStates,legacyComposerState:e.legacyComposerState})})),Th=`cursor`;function Eh(e){switch(e){case`vscode`:return`code {path}`;case`xcode`:return`xed {path}`;case`windsurf`:return`windsurf {path}`;case`custom`:return`cursor {path}`;default:return`cursor {path}`}}function Dh(e){switch(e){case`vscode`:return`VS Code`;case`xcode`:return`Xcode`;case`windsurf`:return`Windsurf`;case`custom`:return`Custom`;default:return`Cursor`}}function Oh(e){return Number.isFinite(e)?Math.min(900,Math.max(250,Math.round(e))):450}function kh(e){switch(e){case`vscode`:case`xcode`:case`windsurf`:case`custom`:case`cursor`:return e;default:return Th}}function Ah(e,t){let n=e?.trim();return n&&n.length>0?n:Eh(t)}var jh=r()(e=>({scrollbackLines:ie,minColumnWidth:450,editorPreset:Th,editorCommandTemplate:Eh(Th),setScrollbackLines:t=>e({scrollbackLines:ee(t)}),setMinColumnWidth:t=>e({minColumnWidth:Oh(t)}),setEditorPreset:t=>e(e=>{let n=kh(t);return{editorPreset:n,editorCommandTemplate:n===`custom`?Ah(e.editorCommandTemplate,n):Eh(n)}}),setEditorCommandTemplate:t=>e(e=>({editorCommandTemplate:Ah(t,e.editorPreset)}))}));function Mh(e){return e===void 0?null:typeof e==`string`?e?{text:e}:null:e.text||e.lexicalState?e:null}var Nh=r()(sh((e,t)=>({drafts:{},attachmentDrafts:{},setDraft:(t,n,r)=>e(e=>{let i;if(typeof n==`string`){if(!n){let{[t]:n,...r}=e.drafts;return{drafts:r}}i={text:n}}else{let a=r??``;if(!a){let{[t]:n,...r}=e.drafts;return{drafts:r}}i={text:a,lexicalState:n}}return{drafts:{...e.drafts,[t]:i}}}),clearDraft:t=>e(e=>{let{[t]:n,...r}=e.drafts;return{drafts:r}}),getDraft:e=>Mh(t().drafts[e]),setAttachmentDrafts:(t,n)=>e(e=>{if(n.length===0){let{[t]:n,...r}=e.attachmentDrafts;return{attachmentDrafts:r}}return{attachmentDrafts:{...e.attachmentDrafts,[t]:n}}}),clearAttachmentDrafts:t=>e(e=>{let{[t]:n,...r}=e.attachmentDrafts;return{attachmentDrafts:r}}),getAttachmentDrafts:e=>t().attachmentDrafts[e]??[],forgetChats:t=>e(e=>({drafts:Object.fromEntries(Object.entries(e.drafts).filter(([e])=>!t.includes(e))),attachmentDrafts:Object.fromEntries(Object.entries(e.attachmentDrafts).filter(([e])=>!t.includes(e)))}))}),{name:`chat-input-drafts`})),Ph=r()(e=>({byProjectId:{},setForProject:(t,n)=>e(e=>({byProjectId:{...e.byProjectId,[t]:n}})),clear:t=>e(e=>{if(!(t in e.byProjectId))return e;let{[t]:n,...r}=e.byProjectId;return{byProjectId:r}})}));function Fh(e){let t=E(e)?e:null,n=Ih(t?.typographyOverride),r=Ih(t?.typographyServerDefaultCache);return{autoResumeOnRateLimit:!!t?.autoResumeOnRateLimit,typographyOverride:n,typographyServerDefaultCache:r}}function Ih(e){if(typeof e==`string`)return Vp(e)?e:void 0}var Lh=r()(sh(e=>({autoResumeOnRateLimit:!1,setAutoResumeOnRateLimit:t=>e({autoResumeOnRateLimit:t}),typographyOverride:void 0,typographyServerDefaultCache:void 0,setTypographyOverride:t=>e({typographyOverride:t}),clearTypographyOverride:()=>e({typographyOverride:void 0}),cacheTypographyServerDefault:t=>e({typographyServerDefaultCache:t})}),{name:`kanna-preferences`,version:2,migrate:e=>Fh(se(e))})),Rh=[],zh=r()(e=>({models:Rh,status:`idle`,error:null,setLoading:()=>e({status:`loading`,error:null}),setModels:t=>e({models:t,status:`ready`,error:null}),setError:t=>e({status:`error`,error:t})})),Bh=400,Vh=800;function Hh(e,t,n){for(let r of e.querySelectorAll(`[${t}]`))if(r.getAttribute(t)===n)return r.querySelector(`span.truncate`);return null}async function Uh(e,t={}){try{await Wh(e,t)}catch{}}async function Wh(e,t){let n=t.root??globalThis.document;if(!n?.body||Fp())return;let r=await Gh(n,e,t);if(!r)return;let{from:i,to:a,text:o}=r,s=n.createElement(`span`);s.textContent=o,s.setAttribute(`aria-hidden`,`true`),s.style.cssText=[`position:fixed`,`left:${i.left}px`,`top:${i.top}px`,`margin:0`,`white-space:nowrap`,`pointer-events:none`,`z-index:60`].join(`;`);let c=n.defaultView?.getComputedStyle(r.fromElement);c&&(s.style.font=c.font,s.style.color=c.color),n.body.appendChild(s);let l=!1,u=()=>{l||(l=!0,s.remove())},d=setTimeout(u,Vh);try{await Op(s,{x:a.left-i.left,y:a.top-i.top,opacity:[1,0],duration:kp.carry,ease:Ap.arriving})}finally{clearTimeout(d),u()}}async function Gh(e,t,n){let r=n.now??(()=>Date.now()),i=n.raf??(e=>{requestAnimationFrame(e)}),a=r()+Bh;for(;;){let n=Hh(e,`data-chat-id`,t),o=Hh(e,`data-tab-id`,t);if(n&&o){let e=n.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0)return{from:e,to:t,fromElement:n,text:n.textContent??``}}if(r()>=a)return null;await new Promise(e=>{i(e)})}}function Kh(e){return Number.isFinite(e)?Math.max(20,e):33}function qh(){return{isVisible:!1}}function Jh(){return{viewMode:`history`,collapsedPaths:{},summary:``,description:``}}function Yh(e,t){return e[t]??qh()}function Xh(e){for(let t of Object.values(e))if(E(t)&&typeof t.size==`number`&&Number.isFinite(t.size))return t.size;return null}function Zh(e){if(!E(e))return null;let t={};if(E(e.collapsedPaths))for(let[n,r]of Object.entries(e.collapsedPaths))typeof r==`boolean`&&(t[n]=r);return{viewMode:e.viewMode===`changes`?`changes`:`history`,collapsedPaths:t,summary:typeof e.summary==`string`?e.summary:``,description:typeof e.description==`string`?e.description:``}}function Qh(e){if(!E(e))return{size:33,projects:{},projectUi:{}};let t=E(e.projects)?e.projects:{},n=e.size,r=Kh(typeof n==`number`&&Number.isFinite(n)?n:Xh(t)??33),i={};for(let[e,n]of Object.entries(t))i[e]={isVisible:E(n)&&n.isVisible===!0};let a={};if(E(e.projectUi))for(let[t,n]of Object.entries(e.projectUi)){let e=Zh(n);e&&(a[t]=e)}return{size:r,projects:i,projectUi:a}}var $h=r()(sh(e=>({size:33,projects:{},projectUi:{},toggleVisibility:t=>e(e=>({projects:{...e.projects,[t]:{...Yh(e.projects,t),isVisible:!Yh(e.projects,t).isVisible}}})),setSize:t=>e({size:Kh(t)}),reconcileCollapsedPaths:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh(),i=Object.fromEntries(n.map(e=>[e,r.collapsedPaths[e]??!0]));return Object.keys(r.collapsedPaths).length===Object.keys(i).length&&Object.entries(i).every(([e,t])=>r.collapsedPaths[e]===t)?e:{projectUi:{...e.projectUi,[t]:{...r,collapsedPaths:i}}}}),toggleCollapsedPath:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return{projectUi:{...e.projectUi,[t]:{...r,collapsedPaths:{...r.collapsedPaths,[n]:!(r.collapsedPaths[n]??!0)}}}}}),setViewMode:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.viewMode===n?e:{projectUi:{...e.projectUi,[t]:{...r,viewMode:n}}}}),setCommitDraft:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.summary===n.summary&&r.description===n.description?e:{projectUi:{...e.projectUi,[t]:{...r,summary:n.summary,description:n.description}}}}),setCommitSummary:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.summary===n?e:{projectUi:{...e.projectUi,[t]:{...r,summary:n}}}}),setCommitDescription:(t,n)=>e(e=>{let r=e.projectUi[t]??Jh();return r.description===n?e:{projectUi:{...e.projectUi,[t]:{...r,description:n}}}}),clearCommitDraft:t=>e(e=>{let n=e.projectUi[t]??Jh();return!n.summary&&!n.description?e:{projectUi:{...e.projectUi,[t]:{...n,summary:``,description:``}}}}),clearProject:t=>e(e=>{let{[t]:n,...r}=e.projects,{[t]:i,...a}=e.projectUi;return{projects:r,projectUi:a}})}),{name:`right-sidebar-layouts`,version:4,migrate:e=>Qh(se(e))})),eg={isVisible:!1},tg=[68,32];function ng(){return{isVisible:!1,mainSizes:[...tg],terminals:[],nextTerminalIndex:0}}function rg(e,t){return e[t]??ng()}function ig(e,t){for(let[n,r]of Object.entries(e)){let e=r.terminals.find(e=>e.id===t);if(e)return{projectId:n,terminal:e}}return null}function ag(e){if(e.length===0)return[];let t=e.reduce((e,t)=>e+Math.max(t,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(e=>Math.max(e,0)/t*100)}function og(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function sg(e){if(e.length===0)return e;let t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function cg(e,t,n){return{...e,[t]:n(rg(e,t))}}var lg=r()(sh(e=>({projects:{},addTerminal:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{let t=sg(e.terminals),r={id:globalThis.crypto?.randomUUID?.()??`terminal-${Date.now()}-${e.nextTerminalIndex}`,title:og(e.nextTerminalIndex),size:100/(t.length+1)},i=n?Math.max(t.findIndex(e=>e.id===n)+1,0):t.length;return{...e,isVisible:!0,nextTerminalIndex:e.nextTerminalIndex+1,terminals:[...t.slice(0,i),r,...t.slice(i)]}})})),removeTerminal:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{let t=e.terminals.filter(e=>e.id!==n);if(t.length===0)return{...e,isVisible:!1,terminals:[]};let r=ag(t.map(e=>e.size));return{...e,terminals:t.map((e,n)=>({...e,size:r[n]??100/t.length}))}})})),toggleVisibility:t=>e(e=>({projects:cg(e.projects,t,e=>({...e,isVisible:e.terminals.length>0&&!e.isVisible}))})),resetMainSizes:t=>e(e=>({projects:cg(e.projects,t,e=>({...e,mainSizes:[...tg]}))})),setMainSizes:(t,n)=>e(e=>{if(n.length!==2)return e;let[r=50,i=50]=ag(n),a=[r,i];return{projects:cg(e.projects,t,e=>({...e,mainSizes:a}))}}),setTerminalSizes:(t,n)=>e(e=>({projects:cg(e.projects,t,e=>{if(n.length!==e.terminals.length)return e;let t=ag(n);return{...e,terminals:e.terminals.map((e,n)=>({...e,size:t[n]??e.size}))}})})),clearProject:t=>e(e=>{let{[t]:n,...r}=e.projects;return{projects:r}})}),{name:`terminal-layouts`,version:1})),ug={isVisible:!1,mainSizes:[...tg],terminals:[],nextTerminalIndex:0};function dg(e){return e===void 0||!ne(e)?[]:e.filter(e=>typeof e==`string`)}function fg(e){let t=E(e)?e:{};return{deletedBoardIds:dg(t.deletedBoardIds),failures:dg(t.failures)}}var pg=[],mg=r()(e=>({chatIds:pg,setFollowed:t=>e({chatIds:t})}));function hg(e){return t=>e?t.chatIds.includes(e):!1}function gg(e){if(!E(e))return{ok:!1,error:`Unexpected response from the server`};let{ok:t,code:n,expiresAt:r,error:i}=e;return t===!0&&typeof n==`string`&&typeof r==`number`?{ok:!0,code:n,expiresAt:r}:{ok:!1,error:typeof i==`string`?i:`Could not create a pairing code`}}function _g(e){return E(e)?e.ok===!0?{ok:!0}:{ok:!1,error:typeof e.error==`string`?e.error:`Could not start the update`}:{ok:!1,error:`Unexpected response from the server`}}var vg=[],yg=[],bg=[],xg={},Sg={},Cg=r()((e,t)=>({changelogPendingAction:null,skillQuery:``,skillResults:vg,skillSearchLoading:!1,skillSearchError:null,installedSkills:yg,installedSkillIds:new Set,installedLoading:!1,installedError:null,skillOperationError:null,installingSkillId:null,uninstallingSkillId:null,installMessages:Sg,packageUpdateSnapshot:null,pluginInventory:null,pluginInventoryLoading:!1,pluginInventoryError:null,globalInstructionsDraft:``,globalInstructionsPersistedAtMount:``,globalInstructionsSaving:!1,globalInstructionsError:null,changelogStatus:`idle`,signingOut:!1,authEnabled:!1,releases:bg,changelogError:null,pushPermissionState:p().state,pushDeviceId:m(),scrollbackDraft:``,minColumnWidthDraft:``,tabMinWidthDraft:``,uploadMaxFileSizeDraft:``,claudeIdleMinutesDraft:``,claudeMaxConcurrentDraft:``,editorCommandDraft:``,keybindingDrafts:xg,keybindingsError:null,appSettingsError:null,analyticsDialogOpen:!1,tunnelError:null,cloudflaredPathDraft:``,pushContactSubjectDraft:``,shareDefaultTtlDraft:``,llmProviderDraft:{provider:`openai`,apiKey:``,model:``,baseUrl:``},llmProviderError:null,llmValidationStatus:`idle`,llmValidationError:null,llmValidationDialogOpen:!1,setChangelogPendingAction:t=>e({changelogPendingAction:t}),setSkillQuery:t=>e({skillQuery:t}),setSkillResults:t=>e({skillResults:t}),setSkillSearchLoading:t=>e({skillSearchLoading:t}),setSkillSearchError:t=>e({skillSearchError:t}),setInstalledSkills:t=>e({installedSkills:t}),setInstalledSkillIds:t=>e({installedSkillIds:t}),addInstalledSkillId:n=>{let r=t().installedSkillIds,i=new Set(r);i.add(n),e({installedSkillIds:i})},removeInstalledSkillId:n=>{let r=t().installedSkillIds,i=new Set(r);i.delete(n),e({installedSkillIds:i})},setInstalledLoading:t=>e({installedLoading:t}),setInstalledError:t=>e({installedError:t}),setSkillOperationError:t=>e({skillOperationError:t}),setInstallingSkillId:t=>e({installingSkillId:t}),setUninstallingSkillId:t=>e({uninstallingSkillId:t}),setInstallMessages:t=>e({installMessages:t}),setInstallMessage:(n,r)=>{let i=t().installMessages;e({installMessages:{...i,[n]:r}})},clearInstallMessage:n=>{let r={...t().installMessages};delete r[n],e({installMessages:r})},clearInstallMessagesForSkill:n=>{let r={...t().installMessages};for(let e of Object.keys(r))(e.endsWith(`/${n}`)||e===n)&&delete r[e];e({installMessages:r})},setPackageUpdateSnapshot:t=>e({packageUpdateSnapshot:t}),setPluginInventory:t=>e({pluginInventory:t}),setPluginInventoryLoading:t=>e({pluginInventoryLoading:t}),setPluginInventoryError:t=>e({pluginInventoryError:t}),setGlobalInstructionsDraft:t=>e({globalInstructionsDraft:t}),setGlobalInstructionsPersistedAtMount:t=>e({globalInstructionsPersistedAtMount:t}),setGlobalInstructionsSaving:t=>e({globalInstructionsSaving:t}),setGlobalInstructionsError:t=>e({globalInstructionsError:t}),setChangelogStatus:t=>e({changelogStatus:t}),setSigningOut:t=>e({signingOut:t}),setAuthEnabled:t=>e({authEnabled:t}),setReleases:t=>e({releases:t}),setChangelogError:t=>e({changelogError:t}),setPushPermissionState:t=>e({pushPermissionState:t}),setPushDeviceId:t=>e({pushDeviceId:t}),setScrollbackDraft:t=>e({scrollbackDraft:t}),setMinColumnWidthDraft:t=>e({minColumnWidthDraft:t}),setTabMinWidthDraft:t=>e({tabMinWidthDraft:t}),setUploadMaxFileSizeDraft:t=>e({uploadMaxFileSizeDraft:t}),setClaudeIdleMinutesDraft:t=>e({claudeIdleMinutesDraft:t}),setClaudeMaxConcurrentDraft:t=>e({claudeMaxConcurrentDraft:t}),setEditorCommandDraft:t=>e({editorCommandDraft:t}),setKeybindingDrafts:t=>e({keybindingDrafts:t}),setKeybindingDraft:(t,n)=>e(e=>e.keybindingDrafts[t]===n?e:{keybindingDrafts:{...e.keybindingDrafts,[t]:n}}),setKeybindingsError:t=>e({keybindingsError:t}),setAppSettingsError:t=>e({appSettingsError:t}),setAnalyticsDialogOpen:t=>e({analyticsDialogOpen:t}),setTunnelError:t=>e({tunnelError:t}),setCloudflaredPathDraft:t=>e({cloudflaredPathDraft:t}),setPushContactSubjectDraft:t=>e({pushContactSubjectDraft:t}),setShareDefaultTtlDraft:t=>e({shareDefaultTtlDraft:t}),setLlmProviderDraft:t=>e({llmProviderDraft:t}),setLlmProviderError:t=>e({llmProviderError:t}),setLlmValidationStatus:t=>e({llmValidationStatus:t}),setLlmValidationError:t=>e({llmValidationError:t}),setLlmValidationDialogOpen:t=>e({llmValidationDialogOpen:t})})),wg=`main`;function Tg(e){return e.kind===`pane`}function Eg(e){return e.kind===`group`}var Dg=.1;function Og(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function kg(e){return Array.from({length:e},()=>1/e)}function Ag(e,t){if(t<=0)return[];if(t===1)return[1];let n=Array.from({length:t},(t,n)=>{let r=e?.[n];return Og(r)?r:1}),r=n.reduce((e,t)=>e+t,0);return r<=0?kg(t):n.map(e=>e/r)}function jg(e){let t=e.length;if(t===0)return[];if(t===1)return[1];if(t*.1>1)return kg(t);let n=Ag(e,t),r=Array(t).fill(0),i=new Set(n.map((e,t)=>t)),a=1;for(;i.size>0;){let e=0;for(let t of i)e+=n[t]??0;if(e<=0){let e=a/i.size;for(let t of i)r[t]=e;break}let t=[];for(let r of i)(n[r]??0)/e*a<.1&&t.push(r);if(t.length===0){for(let t of i)r[t]=(n[t]??0)/e*a;break}for(let e of t)r[e]=Dg,i.delete(e),a-=Dg}return Ag(r,t)}function Mg(e,t,n){let r=e[t],i=e[t+1];if(r===void 0||i===void 0||!Number.isFinite(n))return[...e];let a=r+i;if(a<=0)return[...e];let o=Math.min(Dg,a/2),s=Math.min(a-o,Math.max(o,r+n)),c=[...e];return c[t]=s,c[t+1]=a-s,c}function Ng(e){return`${e.length}_${e}`}function Pg(e){switch(e.kind){case`chat`:return`chat_${Ng(e.chatId)}`;case`changes`:return`changes`;case`terminal`:return`terminal_${Ng(e.terminalId)}`;case`board`:return`board_${Ng(e.boardId)}`}}function Fg(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Ig(e){if(e===void 0||!E(e))return null;switch(e.kind){case`chat`:{let t=Fg(e.chatId);return t?{kind:`chat`,chatId:t}:null}case`changes`:return{kind:`changes`};case`terminal`:{let t=Fg(e.terminalId);return t?{kind:`terminal`,terminalId:t}:null}case`board`:{let t=Fg(e.boardId);return t?{kind:`board`,boardId:t}:null}default:return null}}function Lg(e,t){return{tabId:Pg(e),target:e,createdAt:t}}function Rg(e,t=[],n){let r=new Set,i=[];for(let e of t)r.has(e.tabId)||(r.add(e.tabId),i.push(e));return{kind:`pane`,id:e,tabs:i,focusedTabId:n&&r.has(n)?n:i[0]?.tabId??null}}function zg(e,t,n,r){return n.length===0?Rg(e):n.length===1?n[0]:{kind:`group`,id:e,direction:t,children:[...n],sizes:Ag(r,n.length)}}function Bg(){return{root:Rg(wg),focusedPaneId:wg}}function Vg(e){return Tg(e)?1:1+Math.max(...e.children.map(Vg))}function Hg(e){return Tg(e)?[e]:e.children.flatMap(Hg)}function Ug(e,t){if(Tg(e))return e.id===t?[]:null;for(let[n,r]of e.children.entries()){let e=Ug(r,t);if(e)return[n,...e]}return null}function Wg(e,t){if(Tg(e))return e.tabs.some(e=>e.tabId===t)?{pane:e,path:[]}:null;for(let[n,r]of e.children.entries()){let e=Wg(r,t);if(e)return{pane:e.pane,path:[n,...e.path]}}return null}function Gg(e,t){let n=e;for(let e of t){if(!n||!Eg(n))return null;n=n.children[e]}return n??null}function Kg(e,t){let n=Ug(e,t);if(!n)return null;for(let t=n.length-1;t>=0;t--){let r=Gg(e,n.slice(0,t));if(!r||!Eg(r))continue;let i=n[t];for(let e=i-1;e>=0;e--){let t=Hg(r.children[e]).at(-1);if(t)return t.id}for(let e=i+1;e<r.children.length;e++){let t=Hg(r.children[e])[0];if(t)return t.id}}return null}function qg(e,t,n){if(t.length===0)return n;let[r,...i]=t;if(!Eg(e))return e;let a=e.children[r];if(!a)return e;let o=[...e.children];return o[r]=qg(a,i,n),zg(e.id,e.direction,o,e.sizes)}function Jg(e,t){if(t.length===0)return Rg(e.id);let n=t.slice(0,-1),r=t.at(-1),i=Gg(e,n);if(!i||!Eg(i))return e;let a=i.children.filter((e,t)=>t!==r),o=i.sizes.filter((e,t)=>t!==r);return qg(e,n,zg(i.id,i.direction,a,jg(o)))}function Yg(e,t,n={}){let r=Wg(e,t);if(!r)return{root:e,tab:null,sourcePaneId:null};let{pane:i,path:a}=r,o=i.tabs.find(e=>e.tabId===t)??null,s=i.tabs.filter(e=>e.tabId!==t);if(s.length>0||i.id===n.preserveEmptyPaneId){let n=i.focusedTabId===t?void 0:i.focusedTabId;return{root:qg(e,a,Rg(i.id,s,n)),tab:o,sourcePaneId:i.id}}return{root:Jg(e,a),tab:o,sourcePaneId:i.id}}function Xg(e,t,n,r={}){let i=Ug(e,t);if(!i)return null;let a=Gg(e,i);if(!a||!Tg(a))return null;let o=a.tabs.filter(e=>e.tabId!==n.tabId),s=r.index??o.length;o.splice(Math.max(0,Math.min(s,o.length)),0,n);let c=r.focus??!0?n.tabId:a.focusedTabId??n.tabId;return qg(e,i,Rg(a.id,o,c))}function Zg(e){return e===`left`||e===`right`?`horizontal`:`vertical`}function Qg(e){return e===`right`||e===`bottom`}function $g(e){return Hg(e)[0]?.id??null}function e_(e,t){let{tabId:n,targetPaneId:r,position:i,ids:a}=t;if(!Ug(e.root,r))return null;let o=Wg(e.root,n);if(!o||o.pane.id===r&&o.pane.tabs.length<=1)return null;let s=Yg(e.root,n,{preserveEmptyPaneId:r});if(!s.tab)return null;let c=Ug(s.root,r);if(!c)return null;let l=Zg(i),u=Qg(i),d=Rg(a.paneId,[s.tab],s.tab.tabId),f=c.slice(0,-1),p=f.length>0||c.length>0?Gg(s.root,f):null,m;if(p&&Eg(p)&&p.direction===l){let e=c.at(-1),t=[...p.children],n=[...p.sizes],r=n[e]??1/t.length,i=u?e+1:e;t.splice(i,0,d),n.splice(i,0,r/2),n[u?e:e+1]=r/2,m=qg(s.root,f,zg(p.id,p.direction,t,n))}else{let e=Gg(s.root,c);if(!e)return null;let t=u?[e,d]:[d,e];m=qg(s.root,c,zg(a.groupId,l,t,[.5,.5]))}return Vg(m)>4?null:{root:m,focusedPaneId:a.paneId}}function t_(e,t){let n=e.indexOf(t);return n<0?null:e[n+1]??(n>0?e[n-1]??null:null)}function n_(e,t){let n=Wg(e.root,t);if(!n)return null;let{pane:r}=n,i=r.focusedTabId===t?t_(r.tabs.map(e=>e.tabId),t):null,a=Kg(e.root,r.id),o=Yg(e.root,t).root,s={root:o,focusedPaneId:e.focusedPaneId===null?null:(Ug(o,e.focusedPaneId)?e.focusedPaneId:null)??(a&&Ug(o,a)?a:null)??$g(o)??`main`};return i?i_(s,i)??s:s}function r_(e,t,n,r){let i=Wg(e.root,t);if(!i||!Ug(e.root,n))return null;let a=i.pane.id===n,o=Yg(e.root,t,{preserveEmptyPaneId:a?n:void 0});if(!o.tab)return null;let s=Xg(o.root,n,o.tab,{index:r});return s?{root:s,focusedPaneId:n}:null}function i_(e,t){let n=Wg(e.root,t);if(!n)return null;let{pane:r,path:i}=n;return r.focusedTabId===t&&e.focusedPaneId===r.id?null:{root:qg(e.root,i,Rg(r.id,r.tabs,t)),focusedPaneId:r.id}}function a_(e,t){return e.focusedPaneId===t||!Ug(e.root,t)?null:{...e,focusedPaneId:t}}function o_(e,t,n){let r=Ug(e.root,t);if(!r)return null;let i=Gg(e.root,r);if(!i||!Tg(i))return null;let a=new Map(i.tabs.map(e=>[e.tabId,e])),o=new Set,s=[];for(let e of n){let t=a.get(e);t&&!o.has(e)&&(o.add(e),s.push(t))}for(let e of i.tabs)o.has(e.tabId)||s.push(e);if(s.every((e,t)=>e.tabId===i.tabs[t]?.tabId))return null;let c=qg(e.root,r,Rg(i.id,s,i.focusedTabId));return{...e,root:c}}function s_(e,t,n={createdAt:0}){let r=Pg(t),i=n.focus??!0;if(Wg(e.root,r))return i?{layout:i_(e,r)??e,tabId:r}:{layout:e,tabId:r};let a=(e.focusedPaneId&&Ug(e.root,e.focusedPaneId)?e.focusedPaneId:null)??$g(e.root);if(!a)return null;let o=Xg(e.root,a,Lg(t,n.createdAt),{focus:i});return o?{layout:{root:o,focusedPaneId:i?a:e.focusedPaneId},tabId:r}:null}function c_(e,t,n=[]){if(Eg(e)){if(e.id===t)return n;for(let[r,i]of e.children.entries()){let e=c_(i,t,[...n,r]);if(e)return e}}return null}function l_(e,t,n){let r=c_(e.root,t);if(!r)return null;let i=Gg(e.root,r);if(!i||!Eg(i)||n.length!==i.children.length)return null;let a=jg(Ag(n,i.children.length));if(a.every((e,t)=>Math.abs(e-(i.sizes[t]??0))<1e-6))return null;let o=qg(e.root,r,zg(i.id,i.direction,i.children,a));return{...e,root:o}}function u_(e,t,n,r){if(r===0||!Number.isFinite(r))return null;let i=c_(e.root,t);if(!i)return null;let a=Gg(e.root,i);if(!a||!Eg(a))return null;let o=Mg(a.sizes,n,r);if(o.every((e,t)=>Math.abs(e-(a.sizes[t]??0))<1e-9))return null;let s=qg(e.root,i,zg(a.id,a.direction,a.children,o));return{...e,root:s}}var d_={left:0,top:0,right:1,bottom:1};function f_(e,t=d_){if(Tg(e))return[{paneId:e.id,rect:t}];let n=e.direction===`horizontal`,r=n?t.right-t.left:t.bottom-t.top,i=[],a=n?t.left:t.top;for(let[o,s]of e.children.entries()){let c=(e.sizes[o]??0)*r,l=n?{...t,left:a,right:a+c}:{...t,top:a,bottom:a+c};i.push(...f_(s,l)),a+=c}return i}function p_(e,t,n,r){return t<=n?n-t:r<=e?e-r:0}function m_(e,t,n,r){return Math.max(0,Math.min(t,r)-Math.max(e,n))}function h_(e,t,n){switch(e){case`left`:return t.left-n.right;case`right`:return n.left-t.right;case`up`:return t.top-n.bottom;case`down`:return n.top-t.bottom}}function g_(e,t,n){let r=f_(e),i=r.find(e=>e.paneId===t);if(!i)return null;let a=r.filter(e=>e.paneId!==t).map(e=>{let{rect:t}=e,r=i.rect,a=h_(n,r,t),o=n===`left`||n===`right`,s=o?r.top:r.left,c=o?r.bottom:r.right,l=o?t.top:t.left,u=o?t.bottom:t.right,d=p_(s,c,l,u),f=m_(s,c,l,u),p=Math.abs((s+c)/2-(l+u)/2);return{paneId:e.paneId,primary:a,perpendicular:d,shared:f,centreDistance:p}}).filter(e=>e.primary>=-1e-6);return a.length===0?null:(a.sort((e,t)=>e.primary-t.primary||e.perpendicular-t.perpendicular||t.shared-e.shared||e.centreDistance-t.centreDistance||e.paneId.localeCompare(t.paneId)),a[0]?.paneId??null)}var __=.05,v_={left:`horizontal`,right:`horizontal`,up:`vertical`,down:`vertical`},y_={left:-1,right:1,up:-1,down:1};function b_(e,t,n,r=__){let i=Ug(e,t);if(!i)return null;let a=v_[n];for(let t=i.length-1;t>=0;t--){let o=Gg(e,i.slice(0,t));if(!o||!Eg(o)||o.direction!==a)continue;let s=i[t],c=s<o.children.length-1?s:s-1;if(!(c<0))return{groupId:o.id,index:c,deltaRatio:y_[n]*r}}return null}function x_(e,t){return`${e}-recovered-${t||`root`}`}function S_(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function C_(e){return e===`vertical`?`vertical`:`horizontal`}function w_(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function T_(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!E(n))continue;let e=Ig(n.target);e&&t.push(Lg(e,w_(n.createdAt)??0))}return t}function E_(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=w_(n);e!==null&&t.push(e)}return t}function D_(e,t,n){if(e===void 0||!E(e))return null;let r=S_(e.id);if(e.kind===`pane`)return Rg(r??x_(`pane`,n),T_(e.tabs),S_(e.focusedTabId));if(e.kind!==`group`||!Array.isArray(e.children))return null;if(t>=4){let r=e.children.map((e,r)=>D_(e,t,`${n}.${r}`)).filter(e=>e!==null).flatMap(Hg),i=r[0];return i?Rg(i.id,r.flatMap(e=>e.tabs)):null}let i=e.children.map((e,r)=>D_(e,t+1,`${n}.${r}`)).filter(e=>e!==null);return i.length===0?null:zg(r??x_(`group`,n),C_(e.direction),i,E_(e.sizes))}function O_(e,t){if(e===null)return null;let n=S_(e);return n&&t.some(e=>e.id===n)?n:t[0]?.id??`main`}function k_(e){if(e===void 0||!E(e))return Bg();let t=D_(e.root,1,``);if(!t)return Bg();let n=Hg(t);return n.length===0?Bg():{root:t,focusedPaneId:O_(e.focusedPaneId,n)}}var A_=`main`,j_=`changes`,M_=`workspace`,N_=`terminals`,P_=`root`;function F_(e,t){return!Number.isFinite(e)||e<=0||e>=100?t:e/100}function I_(e){let t=Rg(A_,[]),n=e.terminals.filter(e=>e.id.trim().length>0).map((e,t)=>Rg(`terminal-${e.id}`,[Lg({kind:`terminal`,terminalId:e.id.trim()},t)])),r=n.length>0?zg(N_,`horizontal`,n,[...e.terminalSizes]):null,i=F_(e.mainSizes[0],.68),a=r?zg(M_,`vertical`,[t,r],[i,1-i]):t;if(!e.changesVisible)return{root:a,focusedPaneId:A_};let o=F_(e.changesSizePercent,.33);return{root:zg(P_,`horizontal`,[a,Rg(j_,[Lg({kind:`changes`},0)])],[1-o,o]),focusedPaneId:A_}}function L_(e){return Hg(e.root).find(t=>t.id===e.focusedPaneId)??null}function R_(e){return L_(e)?.focusedTabId??null}function z_(e,t){let n=R_(t);return!n||e[0]===n?e:[n,...e.filter(e=>e!==n)].slice(0,50)}function B_(e,t){let n=Hg(e.root).flatMap((e,t)=>e.tabs.map(e=>({tab:e,paneOrdinal:t+1}))),r=new Map,i=R_(e);i&&r.set(i,-1),t.forEach((e,t)=>{r.has(e)||r.set(e,t)});let a=2**53-1;return n.map((e,t)=>({entry:e,layoutIndex:t,rank:r.get(e.tab.tabId)??a})).sort((e,t)=>e.rank-t.rank||e.layoutIndex-t.layoutIndex).map(({entry:e})=>e)}function V_(e,t){return!e||e.tabs.length===0?null:t===9?e.tabs[e.tabs.length-1].tabId:e.tabs[t-1]?.tabId??null}function H_(e,t){return e<8?String(e+1):e===t-1?`9`:null}function U_(e,t){let n=zm(e,`openTabSwitcher`).find(e=>Wm(e,t));if(!n)return null;let r=n.split(`+`).some(e=>e.trim().toLowerCase()===`shift`);return{binding:n,reverse:t.shiftKey&&!r}}function W_(e,t){return zm(e,`jumpToPaneTab`).some(e=>Um(e,t))}function G_(e,t){if(!W_(e,t)||!t.code.startsWith(`Digit`))return null;let n=Number(t.code.slice(5));return n>=1&&n<=9?n:null}function K_(e){return Hg(e.root).some(e=>e.tabs.length>0)}var q_=r()(sh((e,t)=>{function n(t){e(e=>{let n=t(e.layout);return n?{...e,layout:n,recentTabIds:z_(e.recentTabIds,n)}:e})}function r(){let n=t().nodeSequence+1;return e({nodeSequence:n}),{paneId:`pane-${n}`,groupId:`group-${n}`}}return{layout:Bg(),nodeSequence:0,recentTabIds:[],getLayout:()=>t().layout,openTab:e=>n(t=>s_(t,e,{createdAt:0})?.layout??null),closeTab:e=>n(t=>n_(t,e)),closeTabsFor:({chatIds:e,boardIds:t})=>n(n=>{let r=Hg(n.root).flatMap(e=>e.tabs).filter(({target:n})=>n.kind===`chat`&&e.includes(n.chatId)||n.kind===`board`&&t.includes(n.boardId));return r.length===0?null:r.reduce((e,t)=>n_(e,t.tabId)??e,n)}),focusTab:e=>n(t=>i_(t,e)),focusPane:e=>n(t=>a_(t,e)),splitPane:e=>{let t=r();n(n=>e_(n,{...e,ids:t}))},moveTabToPane:(e,t,r)=>n(n=>r_(n,e,t,r)),focusAdjacentPane:e=>n(t=>{if(!t.focusedPaneId)return null;let n=g_(t.root,t.focusedPaneId,e);return n?a_(t,n):null}),resizeFocusedPane:e=>n(t=>{if(!t.focusedPaneId)return null;let n=b_(t.root,t.focusedPaneId,e);return n?u_(t,n.groupId,n.index,n.deltaRatio):null}),cycleFocusedPaneTab:e=>n(t=>{let n=Hg(t.root).find(e=>e.id===t.focusedPaneId);if(!n||n.tabs.length===0)return null;let r=n.tabs.findIndex(e=>e.tabId===n.focusedTabId),i=(((r===-1?0:r)+e)%n.tabs.length+n.tabs.length)%n.tabs.length;return i_(t,n.tabs[i].tabId)}),closeFocusedTab:()=>n(e=>{let t=Hg(e.root).find(t=>t.id===e.focusedPaneId),n=t?.focusedTabId??t?.tabs[0]?.tabId;return n?n_(e,n):null}),splitFocusedPane:e=>{let i=t().layout,a=Hg(i.root).find(e=>e.id===i.focusedPaneId),o=a?.focusedTabId??a?.tabs[0]?.tabId;if(!a||!o)return;let s=r();n(t=>e_(t,{tabId:o,targetPaneId:a.id,position:e,ids:s}))},reorderPaneTabs:(e,t)=>n(n=>o_(n,e,t)),resizeGroup:(e,t,r)=>n(n=>u_(n,e,t,r)),setGroupSizes:(e,t)=>n(n=>l_(n,e,t)),seedFromLegacy:t=>e(e=>{if(K_(e.layout))return e;let n=I_(t);return{...e,layout:n,recentTabIds:z_(e.recentTabIds,n)}})}},{name:`pane-layouts`,version:2,migrate:(e,t)=>{if(t>=2)return e;let n=o(e)?e.nodeSequence:void 0;return{nodeSequence:typeof n==`number`?n:0}},merge:(e,t)=>{if(!o(e))return t;let n=k_(se(e.layout)),r=K_(n)?n:t.layout,i=e.nodeSequence,a=typeof i==`number`&&Number.isFinite(i)?i:0,s=e.recentTabIds,c=Array.isArray(s)?s.filter(e=>typeof e==`string`):t.recentTabIds;return{...t,layout:r,nodeSequence:a,recentTabIds:c}},partialize:e=>({layout:e.layout,nodeSequence:e.nodeSequence,recentTabIds:e.recentTabIds})})),J_=r()(sh(e=>({checkedPathsByProjectId:{},reconcileProject:(t,n)=>e(e=>{let r=e.checkedPathsByProjectId[t]??{},i=Object.fromEntries(n.map(e=>[e,r[e]??!0]));return Object.keys(r).length===Object.keys(i).length&&Object.entries(i).every(([e,t])=>r[e]===t)?e:{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:i}}}),toggleChecked:(t,n)=>e(e=>{let r=e.checkedPathsByProjectId[t]??{};return{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:{...r,[n]:!(r[n]??!0)}}}}),toggleAllChecked:(t,n)=>e(e=>{if(n.length===0)return e;let r=e.checkedPathsByProjectId[t]??{},i=!n.every(e=>r[e]??!0);return{checkedPathsByProjectId:{...e.checkedPathsByProjectId,[t]:{...r,...Object.fromEntries(n.map(e=>[e,i]))}}}}),clearProject:t=>e(e=>{let{[t]:n,...r}=e.checkedPathsByProjectId;return{checkedPathsByProjectId:r}})}),{name:`diff-commit-selections`,version:2}));function Y_(e){Nh.getState().forgetChats(e.chatIds),wh.getState().forgetChats(e.chatIds),q_.getState().closeTabsFor({chatIds:e.chatIds,boardIds:e.boardIds??[]}),e.projectId&&J_.getState().clearProject(e.projectId)}function X_(e,t){let n=t.getItem(e);if(!n)return null;let r=D(n);return r===null||!E(r)?null:E(r.state)?r.state:null}function Z_(e){if(!E(e))return;let t={};if(E(e.claude)){let n=Q_(e.claude),r=e.claude.modelOptions;if(E(r)){let e=$_(r.reasoningEffort),t=$_(r.contextWindow);cm(e)&&dm(t)&&(n.modelOptions={reasoningEffort:e,contextWindow:t})}t.claude=n}if(E(e.codex)){let n=Q_(e.codex),r=e.codex.modelOptions;if(E(r)){let e=$_(r.reasoningEffort);lm(e)&&typeof r.fastMode==`boolean`&&(n.modelOptions={reasoningEffort:e,fastMode:r.fastMode})}t.codex=n}return E(e.openrouter)&&(t.openrouter=Q_(e.openrouter)),Object.keys(t).length>0?t:void 0}function Q_(e){let t={};return typeof e.model==`string`&&(t.model=e.model),typeof e.planMode==`boolean`&&(t.planMode=e.planMode),t}function $_(e){return typeof e==`string`?e:void 0}async function ev(e,t=d){let n=await t.getJson(`/auth/status`,{cache:`no-store`,signal:e});return n.ok?n.data:{}}async function tv(e,t=d){let n={password:e.password};return e.next&&(n.next=e.next),(await t.postJson(`/auth/login`,n)).ok}async function nv(e=d){await e.postJson(`/auth/logout`,{})}function rv(e){let t=(0,k.useCallback)(async t=>{try{await e.command(t),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]);return{handleCreateStack:(0,k.useCallback)((e,n,r)=>t({type:`stack.create`,title:e,projectIds:n,...r?{instructions:r}:{}}),[t]),handleRenameStack:(0,k.useCallback)((e,n)=>t({type:`stack.rename`,stackId:e,title:n}),[t]),handleRemoveStack:(0,k.useCallback)(e=>t({type:`stack.remove`,stackId:e}),[t]),handleAddProjectToStack:(0,k.useCallback)((e,n)=>t({type:`stack.addProject`,stackId:e,projectId:n}),[t]),handleRemoveProjectFromStack:(0,k.useCallback)((e,n)=>t({type:`stack.removeProject`,stackId:e,projectId:n}),[t]),handleSetProjectInstructions:(0,k.useCallback)((e,n)=>t({type:`project.setInstructions`,projectId:e,instructions:n}),[t]),handleSetStackInstructions:(0,k.useCallback)((e,n)=>t({type:`stack.setInstructions`,stackId:e,instructions:n}),[t])}}function $(e,t){return e===t}function iv(e,t){for(let n of[`claude`,`codex`,`openrouter`])if(e[n]!==t[n])return!1;return!0}function av(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.id===r.id&&e.taskType===r.taskType&&e.description===r.description&&e.startedAt===r.startedAt})}var ov={chatId:$,projectId:$,localPath:$,title:$,status:$,isDraining:$,provider:$,planMode:$,sessionTokensByProvider:iv,timings:()=>!0,policyOverride:()=>!0,sessionState:()=>!0,backgroundTasks:av};function sv(e,t){return e===t?!0:!e||!t?!1:ov.chatId(e.chatId,t.chatId)&&ov.projectId(e.projectId,t.projectId)&&ov.localPath(e.localPath,t.localPath)&&ov.title(e.title,t.title)&&ov.status(e.status,t.status)&&ov.isDraining(e.isDraining,t.isDraining)&&ov.provider(e.provider,t.provider)&&ov.planMode(e.planMode,t.planMode)&&ov.sessionTokensByProvider(e.sessionTokensByProvider,t.sessionTokensByProvider)&&ov.timings(e.timings,t.timings)&&ov.policyOverride(e.policyOverride,t.policyOverride)&&ov.sessionState(e.sessionState,t.sessionState)&&ov.backgroundTasks(e.backgroundTasks,t.backgroundTasks)}function cv(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return!!r&&e.path===r.path&&e.changeType===r.changeType&&e.isUntracked===r.isUntracked&&e.additions===r.additions&&e.deletions===r.deletions&&e.patchDigest===r.patchDigest&&e.mimeType===r.mimeType&&e.size===r.size})}function lv(e,t){let n=e?.entries??[],r=t?.entries??[];return n.length===r.length&&n.every((e,t)=>{let n=r[t];return!!n&&e.sha===n.sha&&e.summary===n.summary&&e.description===n.description&&e.authorName===n.authorName&&e.authoredAt===n.authoredAt&&e.githubUrl===n.githubUrl&&e.tags.length===n.tags.length&&e.tags.every((e,t)=>e===n.tags[t])})}var uv={status:$,files:cv,branchHistory:lv,branchName:$,defaultBranchName:$,hasOriginRemote:$,originRepoSlug:$,hasUpstream:$,aheadCount:$,behindCount:$,lastFetchedAt:$};function dv(e,t){return e===t?!0:!e||!t?!1:uv.status(e.status,t.status)&&uv.files(e.files,t.files)&&uv.branchHistory(e.branchHistory,t.branchHistory)&&uv.branchName(e.branchName,t.branchName)&&uv.defaultBranchName(e.defaultBranchName,t.defaultBranchName)&&uv.hasOriginRemote(e.hasOriginRemote,t.hasOriginRemote)&&uv.originRepoSlug(e.originRepoSlug,t.originRepoSlug)&&uv.hasUpstream(e.hasUpstream,t.hasUpstream)&&uv.aheadCount(e.aheadCount,t.aheadCount)&&uv.behindCount(e.behindCount,t.behindCount)&&uv.lastFetchedAt(e.lastFetchedAt,t.lastFetchedAt)}function fv(e,t){return!!(e&&e.status!==`unknown`&&t&&t.status===`unknown`&&t.files.length===0)}var pv=`kanna:ui-update-restart`,mv=`kanna:last-update-reload-request`;function hv(e,t){return t===`updating`||t===`restart_pending`?{active:!0,label:`Installing update`}:e===`awaiting_disconnect`||e===`awaiting_server_ready`?{active:!0,label:`Re-deploying Kanna`}:{active:!1,label:``}}function gv(e,t){switch(t.kind){case`reload_requested`:return String(t.reloadRequestedAt)===t.lastHandled?e:`awaiting_disconnect`;case`update_initiated`:return`awaiting_disconnect`;case`connection_status_changed`:return t.connectionStatus===`disconnected`&&e===`awaiting_disconnect`?`awaiting_server_ready`:e;case`server_ready`:return`idle`;case`aborted`:return`idle`;case`update_status_changed`:return e}}var _v=class{deps;phase;updateStatus=null;pollCancelled=!1;pollTimeoutId=null;isServerReady;constructor(e,t){this.deps=e,this.isServerReady=t.isServerReady;let n=e.storage.getItem(pv);this.phase=n===`awaiting_disconnect`||n===`awaiting_server_ready`?n:`idle`,this.phase===`awaiting_server_ready`&&this.startPolling()}getSnapshot(){return{phase:this.phase,activity:hv(this.phase,this.updateStatus)}}emit(){this.deps.onSnapshot(this.getSnapshot())}setPhase(e){e!==this.phase&&(this.phase=e,e===`idle`?this.deps.storage.removeItem(pv):this.deps.storage.setItem(pv,e),this.emit())}dispatch(e){if(e.kind===`update_status_changed`){let t=this.updateStatus;this.updateStatus=e.updateStatus,t!==this.updateStatus&&this.emit();return}let t=gv(this.phase,e);e.kind===`reload_requested`&&t===`awaiting_disconnect`&&this.deps.storage.setItem(mv,String(e.reloadRequestedAt)),this.setPhase(t),t===`awaiting_server_ready`&&this.startPolling()}startPolling(){this.pollCancelled=!1,ae(`appRuntime.poll`,this.poll())}async poll(){try{if(await this.isServerReady()){if(this.pollCancelled)return;this.setPhase(`idle`),this.deps.dom.reload();return}}catch{}this.pollCancelled||(this.pollTimeoutId=this.deps.timer.setTimeout(()=>{ae(`appRuntime.poll`,this.poll())},500))}close(){this.pollCancelled=!0,this.pollTimeoutId!==null&&(this.deps.timer.clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}static getLastHandledReloadRequest(e){return e.getItem(mv)}},vv=`settings.readLlmProvider`,yv=`chat.compose`,bv=`lever-theme`,xv=`chat-sound-preferences`,Sv=`terminal-preferences`,Cv=`chat-preferences`;function wv(e,t){t&&t.projectId===e&&Ph.getState().setForProject(t.projectId,t.commands)}function Tv(e){let t={},n=e.getItem(bv);(n===`light`||n===`dark`||n===`system`)&&(t.theme=n);let r=X_(xv,e);(r?.chatSoundPreference===`never`||r?.chatSoundPreference===`unfocused`||r?.chatSoundPreference===`always`)&&(t.chatSoundPreference=r.chatSoundPreference),(r?.chatSoundId===`blow`||r?.chatSoundId===`bottle`||r?.chatSoundId===`frog`||r?.chatSoundId===`funk`||r?.chatSoundId===`glass`||r?.chatSoundId===`ping`||r?.chatSoundId===`pop`||r?.chatSoundId===`purr`||r?.chatSoundId===`tink`)&&(t.chatSoundId=r.chatSoundId);let i=X_(Sv,e);if(i){t.terminal={},typeof i.scrollbackLines==`number`&&(t.terminal.scrollbackLines=i.scrollbackLines),typeof i.minColumnWidth==`number`&&(t.terminal.minColumnWidth=i.minColumnWidth);let e={};(i.editorPreset===`cursor`||i.editorPreset===`vscode`||i.editorPreset===`xcode`||i.editorPreset===`windsurf`||i.editorPreset===`custom`)&&(e.preset=i.editorPreset),typeof i.editorCommandTemplate==`string`&&(e.commandTemplate=i.editorCommandTemplate),Object.keys(e).length>0&&(t.editor=e)}let a=X_(Cv,e);(a?.defaultProvider===`last_used`||a?.defaultProvider===`claude`||a?.defaultProvider===`codex`)&&(t.defaultProvider=a.defaultProvider);let o=a?Z_(a.providerDefaults):null;return o&&(t.providerDefaults=o),t.browserSettingsMigrated=!0,Object.keys(t).length>1?t:null}function Ev(e){e.removeItem(bv),e.removeItem(xv),e.removeItem(Sv),e.removeItem(Cv)}function Dv(e,t){if(!t?.length||e.length<=1)return e;let n=new Map(e.map((e,t)=>[e.groupKey,t])),r=new Set,i=t.map(t=>{if(r.has(t))return null;r.add(t);let i=n.get(t);return i===void 0?null:e[i]}).filter(e=>!!e);if(i.length===0)return e;let a=[...i,...e.filter(e=>!r.has(e.groupKey))];return a.every((t,n)=>t===e[n])?e:a}function Ov(e,t){let n=e.find(e=>e.chats.some(e=>e.chatId===t));return n?n.chats.find(e=>e.chatId!==t)?.chatId??null:null}function kv(e,t){return t?e.find(e=>e.chats.some(e=>e.chatId===t))?.groupKey??null:null}function Av(e,t){let n=e.find(e=>e.groupKey===t);return n?n.chats.find(e=>e.provider!=null)?.provider??null??n.sourceProvider??null:null}function jv(e,t){return t===`updating`||t===`restart_pending`?{active:!0,label:`Installing update`}:e===`awaiting_disconnect`||e===`awaiting_server_ready`?{active:!0,label:`Re-deploying Kanna`}:{active:!1,label:``}}function Mv(e){let t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:`project_id`,projectId:t}:e.fallbackLocalProjectPath?{kind:`local_path`,localPath:e.fallbackLocalProjectPath}:null}function Nv(e,t,n,r,i,o,s,c,l){let d=Xu(),p=g(e=>e.sidebarData),m=g(e=>e.optimisticSidebarProjectOrder),_=g(e=>e.localProjects),v=g(e=>e.updateSnapshot),y=g(e=>e.uiRestartPhase),b=g(e=>e.keybindings),x=T(e=>e.settings),S=g(e=>e.pushConfig),C=g(e=>e.llmProvider),w=g(e=>e.connectionStatus),ee=g(e=>e.sidebarReady),ne=g(e=>e.localProjectsReady),E=g(e=>e.sidebarOpen),D=g(e=>e.sidebarCollapsed),ie=g(e=>e.addProjectModalOpen),se=g(e=>e.commandError),O=g(e=>e.startingLocalPath),le=g(e=>e.selectedProjectId),ue=q_(oe(e=>Hg(e.layout.root).flatMap(e=>e.tabs).flatMap(e=>e.target.kind===`chat`?[e.target.chatId]:[]))),de=c?.projectId??null,fe=(0,k.useRef)(null);(0,k.useEffect)(()=>{let e=new _v({storage:n,dom:r,timer:i,onSnapshot:e=>{g.getState().setUiRestartPhase(e.phase===`idle`?null:e.phase)}},{isServerReady:async()=>{let e=await ev();return Object.keys(e).length>0}});return fe.current=e,()=>{e.close(),fe.current=null}},[r,n,i]),(0,k.useEffect)(()=>{fe.current?.dispatch({kind:`update_status_changed`,updateStatus:v?.status})},[v?.status]),(0,k.useEffect)(()=>{let e=fe.current;e&&v?.reloadRequestedAt&&e.dispatch({kind:`reload_requested`,reloadRequestedAt:v.reloadRequestedAt,lastHandled:_v.getLastHandledReloadRequest(n)})},[n,v?.reloadRequestedAt]),(0,k.useEffect)(()=>{fe.current?.dispatch({kind:`connection_status_changed`,connectionStatus:w})},[w]);let pe=(0,k.useCallback)(e=>{fe.current?.dispatch({kind:`update_initiated`})},[]),me=(0,k.useCallback)(()=>{fe.current?.dispatch({kind:`aborted`})},[]),A=(0,k.useMemo)(()=>Dv(p.projectGroups,m),[m,p.projectGroups]),he=(0,k.useMemo)(()=>A===p.projectGroups?p:{...p,projectGroups:A},[p,A]),ge=_?.projects[0]?.localPath??null;(0,k.useEffect)(()=>e.onStatus(e=>g.getState().setConnectionStatus(e)),[e]),(0,k.useEffect)(()=>e.subscribe({type:`sidebar`},e=>{let t=g.getState();t.setSidebarData(e),t.setOptimisticSidebarProjectOrder(t=>t&&Dv(e.projectGroups,t)===e.projectGroups?null:t),t.setSidebarReady(!0),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`local-projects`},e=>{let t=g.getState();t.setLocalProjects(e),t.setLocalProjectsReady(!0),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`update`},e=>{let t=g.getState();t.setUpdateSnapshot(e),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`keybindings`},e=>{let t=g.getState();t.setKeybindings(e),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`app-settings`},e=>{let t=g.getState();T.getState().setFromServer(e),wh.getState().applyServerDefaults(e.defaultProvider,e.providerDefaults),t.setCommandError(null)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`push-config`},e=>{g.getState().setPushConfig(e)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`followed-sessions`},e=>{mg.getState().setFollowed(e.chatIds)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`cron-jobs`},e=>{h.getState().setRows(e.rows)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`beacons`},e=>{nh.getState().setRows(e.beacons)}),[e]),(0,k.useEffect)(()=>e.subscribe({type:`package-updates`},e=>{Cg.getState().setPackageUpdateSnapshot(e)}),[e]),(0,k.useEffect)(()=>{let t=new Set,n=new Map;for(let e of ue){let r=kv(A,e);r&&(t.add(r),n.set(f(r,e),{projectId:r,chatId:e}))}le&&t.add(le),de&&t.add(de);for(let e of t)n.has(e)||n.set(e,{projectId:e});if(t.size===0)return;let r=[];return n.forEach(({projectId:t,chatId:n},i)=>{r.push(e.subscribe({type:`project-git`,projectId:t,...n===void 0?{}:{chatId:n}},e=>{g.getState().setDiffSnapshotsByKey(t=>{let n=e??null;return fv(t[i]??null,n)||dv(t[i]??null,n)?t:{...t,[i]:n}}),g.getState().setCommandError(null)}))}),t.forEach(t=>{r.push(e.subscribe({type:`project-commands`,projectId:t},e=>{wv(t,e)}))}),()=>{r.forEach(e=>e())}},[ue,A,de,le,e]),(0,k.useEffect)(()=>{w===`connected`&&e.command({type:`update.check`,force:!0}).catch(e=>{g.getState().setCommandError(e instanceof Error?e.message:String(e))})},[w,e]),(0,k.useEffect)(()=>{function t(){v?.lastCheckedAt&&(Date.now()-v.lastCheckedAt<=36e5||e.command({type:`update.check`}).catch(e=>{g.getState().setCommandError(e instanceof Error?e.message:String(e))}))}return r.addWindowListener(`focus`,t)},[r,e,v?.lastCheckedAt]),(0,k.useEffect)(()=>{function e(){g.getState().incrementFocusEpoch()}let t=r.addWindowListener(`focus`,e),n=r.addDocumentListener(`visibilitychange`,e);return()=>{t(),n()}},[r]);let _e=(0,k.useCallback)(async()=>{try{T.getState().setHydrationStatus(`loading`);let t=await e.command({type:`settings.readAppSettings`}),n=g.getState();T.getState().setFromServer(t),wh.getState().applyServerDefaults(t.defaultProvider,t.providerDefaults),n.setCommandError(null)}catch(e){T.getState().setHydrationStatus(`error`),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),ve=(0,k.useCallback)(async()=>{try{let t=await e.command({type:`settings.readLlmProvider`}),n=g.getState();n.setLlmProvider(t),n.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]);(0,k.useEffect)(()=>{w===`connected`&&ae(`read app settings`,_e())},[w,_e]),(0,k.useEffect)(()=>{w===`connected`&&(zh.getState().setLoading(),e.command({type:`settings.listOpenRouterModels`}).then(e=>{zh.getState().setModels(e)}).catch(a(e=>{let t=e.message;zh.getState().setError(t)})))},[w,e]);let ye=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch(t);let n=await e.command({type:`settings.writeAppSettingsPatch`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]);(0,k.useEffect)(()=>{if(w!==`connected`||x?.browserSettingsMigrated!==!1)return;let e=Tv(t);e&&ae(`migrate legacy browser settings`,ye(e).then(()=>Ev(t)))},[x?.browserSettingsMigrated,w,ye,t]),(0,k.useEffect)(()=>{w===`connected`&&u(vv,ve)},[w,ve]),(0,k.useEffect)(()=>{if(le)return;let e=A[0];e&&g.getState().setSelectedProjectId(e.groupKey)},[le,A]);let be=(0,k.useCallback)(async t=>{try{await e.command({type:`settings.testMcpServer`,id:t}),g.getState().setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),j=(0,k.useCallback)(async()=>{try{return gg(await e.command({type:`beacons.mintPairingCode`}))}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},[e]),xe=(0,k.useCallback)(async t=>{try{return _g(await e.command({type:`beacons.update`,beaconId:t}))}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},[e]),Se=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`settings.startMcpOAuth`,id:t});return g.getState().setCommandError(null),n}catch(e){let t=e instanceof Error?e.message:String(e);return g.getState().setCommandError(t),{ok:!1,error:t}}},[e]),Ce=(0,k.useCallback)(async(t,n)=>{try{let r=await e.command({type:`settings.completeMcpOAuth`,id:t,callbackUrl:n});return g.getState().setCommandError(null),r}catch(e){let t=e instanceof Error?e.message:String(e);return g.getState().setCommandError(t),{ok:!1,error:t}}},[e]),we=(0,k.useCallback)(async(t,n)=>{try{await e.command({type:`chat.setPolicyOverride`,chatId:t,policyOverride:n}),g.getState().setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),Te=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch({cloudflareTunnel:t});let n=await e.command({type:`appSettings.setCloudflareTunnel`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]),Ee=(0,k.useCallback)(async t=>{try{T.getState().applyOptimisticPatch({claudeAuth:t});let n=await e.command({type:`appSettings.setClaudeAuth`,patch:t}),r=g.getState();T.getState().setFromServer(n),wh.getState().applyServerDefaults(n.defaultProvider,n.providerDefaults),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),await _e(),e}},[_e,e]),De=(0,k.useCallback)(async(t,n)=>await e.command({type:`appSettings.testOAuthToken`,token:t,baseUrl:n}),[e]),Oe=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`settings.writeLlmProvider`,provider:t.provider,apiKey:t.apiKey,model:t.model,baseUrl:t.baseUrl}),r=g.getState();r.setLlmProvider(n),r.setCommandError(null)}catch(e){throw g.getState().setCommandError(e instanceof Error?e.message:String(e)),e}},[e]),ke=(0,k.useCallback)(async t=>await e.command({type:`settings.validateLlmProvider`,provider:t.provider,apiKey:t.apiKey,model:t.model,baseUrl:t.baseUrl}),[e]),Ae=(0,k.useCallback)(async()=>{try{await nv(),g.getState().setCommandError(null),r.reload()}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[r]),je=(0,k.useCallback)(async t=>{try{await e.command({type:`update.check`,force:t?.force}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),Me=(0,k.useCallback)(async t=>{pe(`awaiting_disconnect`);try{let n=await e.command({type:`update.install`,version:t});if(!n.ok){me(),g.getState().setCommandError(null),await d.alert({title:n.userTitle??`Update failed`,description:n.userMessage??`Kanna could not install the update. Try again later.`,closeLabel:`OK`});return}if(n.ok&&n.action===`reload`){r.reload();return}g.getState().setCommandError(null)}catch(e){me(),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[me,d,r,pe,e]),Ne=(0,k.useCallback)(async()=>{pe(`awaiting_disconnect`);try{let t=await e.command({type:`update.reload`});if(!t.ok){me(),g.getState().setCommandError(null),await d.alert({title:t.userTitle??`Re-deploy failed`,description:t.userMessage??`Kanna could not re-deploy. Try again later.`,closeLabel:`OK`});return}if(t.action===`reload`){r.reload();return}g.getState().setCommandError(null)}catch(e){me(),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[me,d,r,pe,e]),Pe=(0,k.useCallback)(async t=>{let n=wh.getState(),r=s?n.getComposerState(s):n.getComposerState(mh),i=n.defaultProvider===`last_used`?Av(A,t):null,a=await e.command({type:`chat.create`,projectId:t});n.initializeComposerForChat(a.chatId,{sourceState:r,providerHint:i}),Lp.getState().markSpawned(a.chatId),ae(`fly chat title to tab`,Uh(a.chatId));let o=g.getState();o.setSelectedProjectId(t),o.setPendingChatId(a.chatId),l.openChat(a.chatId),o.setSidebarOpen(!1),o.setCommandError(null)},[s,l,A,e]),Fe=(0,k.useCallback)(async t=>t.kind===`project_id`?{projectId:t.projectId}:t.kind===`local_path`?{projectId:(await e.command({type:`project.open`,localPath:t.localPath})).projectId,localPath:t.localPath}:{projectId:(await e.command(t.project.mode===`new`?{type:`project.create`,localPath:t.project.localPath,title:t.project.title}:{type:`project.open`,localPath:t.project.localPath})).projectId,localPath:t.project.localPath},[e]),Ie=(0,k.useCallback)(async e=>{try{let t;t=e.kind===`project_id`?null:e.kind===`local_path`?e.localPath:e.project.localPath,t&&g.getState().setStartingLocalPath(t);let{projectId:n}=await Fe(e);await Pe(n)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}finally{g.getState().setStartingLocalPath(null)}},[Pe,Fe]),Le=(0,k.useCallback)(async e=>{await Ie({kind:`project_id`,projectId:e})},[Ie]),Re=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`chat.fork`,chatId:t.chatId}),r=wh.getState();r.initializeComposerForChat(n.chatId,{sourceState:r.getComposerState(t.chatId)});let i=g.getState();i.setPendingChatId(n.chatId),l.openChat(n.chatId),i.setSidebarOpen(!1),i.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[l,e]),ze=(0,k.useCallback)(async e=>{await Ie({kind:`local_path`,localPath:e})},[Ie]),Be=(0,k.useCallback)(async e=>{await Ie({kind:`project_request`,project:e})},[Ie]),Ve=(0,k.useCallback)(async t=>{let n=await d.prompt({title:`Rename Chat`,initialValue:t.title,confirmLabel:`Rename`});if(n&&n!==t.title)try{await e.command({type:`chat.rename`,chatId:t.chatId,title:n}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[d,e]),He=(0,k.useCallback)(async t=>{if(await d.confirm({title:`Delete Chat`,description:`Delete "${t.title}"? This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))try{if(await e.command({type:`chat.delete`,chatId:t.chatId}),Y_({chatIds:[t.chatId]}),t.chatId===s){let e=Ov(A,t.chatId);e?l.openChat(e):l.closeChat()}}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,d,A,e]),Ue=(0,k.useCallback)(async t=>{if(!t.length)return;let n=t.length;if(!await d.confirm({title:`Delete Chats`,description:`Delete ${n} chat${n===1?``:`s`}? This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))return;let r=s!=null&&t.includes(s);try{for(let n of t)await e.command({type:`chat.delete`,chatId:n}),Y_({chatIds:[n]});if(r){let e=Ov(A,s);e?l.openChat(e):l.closeChat()}}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,d,A,e]),We=(0,k.useCallback)(async t=>{try{if(await e.command({type:`chat.archive`,chatId:t.chatId}),t.chatId===s){let e=Ov(A,t.chatId);e?l.openChat(e):l.closeChat()}g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,A,e]),Ge=(0,k.useCallback)(async t=>{try{g.getState().setPendingChatId(t),await e.command({type:`chat.unarchive`,chatId:t}),l.openChat(t),g.getState().setCommandError(null)}catch(e){g.getState().setPendingChatId(null),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[l,e]),Ke=(0,k.useCallback)(e=>{lg.getState().clearProject(e),$h.getState().clearProject(e),c?.projectId===e&&l.closeChat()},[l,c]),qe=(0,k.useCallback)(async t=>{try{await e.command({type:`project.remove`,projectId:t}),Ke(t),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[Ke,e]),M=(0,k.useCallback)(async t=>{let n=A.find(e=>e.groupKey===t),r=n?ce(n.localPath):`this project`,i=[...n?.chats??[],...n?.archivedChats??[]].map(e=>e.chatId);if(await d.confirm({title:`Delete Project`,description:`Delete "${r}" and everything Kanna stored for it: ${i.length} chat${i.length===1?``:`s`} (archived included), boards and their worktrees, share links, and the attachments in .kanna inside the folder. Your own files in the folder are not touched. This cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`}))try{let n=fg(await e.command({type:`project.delete`,projectId:t}));Ke(t),Y_({chatIds:i,boardIds:n.deletedBoardIds,projectId:t}),g.getState().setCommandError(n.failures.length>0?`Project deleted, but some data could not be removed: ${n.failures.join(`; `)}`:null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[d,Ke,A,e]),Je=(0,k.useCallback)(async(t,n)=>{try{await e.command({type:`project.setStar`,projectId:t,starred:n}),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),Ye=(0,k.useCallback)(async t=>{g.getState().setOptimisticSidebarProjectOrder(t);try{await e.command({type:`sidebar.reorderProjectGroups`,projectIds:t}),g.getState().setCommandError(null)}catch(e){g.getState().setOptimisticSidebarProjectOrder(null),g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[e]),N=rv(e),Xe=(0,k.useCallback)(async(t,n,r)=>{try{let i=wh.getState(),a=s?i.getComposerState(s):i.getComposerState(mh),o=await e.command({type:`chat.create`,projectId:t,stackId:n,stackBindings:r});i.initializeComposerForChat(o.chatId,{sourceState:a});let c=g.getState();c.setSelectedProjectId(t),c.setPendingChatId(o.chatId),l.openChat(o.chatId),c.setSidebarOpen(!1),c.setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[s,l,e]),Ze=(0,k.useCallback)(async t=>{try{let n=await e.command({type:`stack.listWorktrees`,projectId:t});return g.getState().setCommandError(null),n.worktrees}catch(e){return g.getState().setCommandError(e instanceof Error?e.message:String(e)),[]}},[e]),Qe=(0,k.useCallback)(async()=>await e.command({type:`sessions.importClaude`}),[e]),$e=(0,k.useCallback)(async t=>await e.command({type:`sessions.importClaudeSession`,sessionIds:t}),[e]),et=(0,k.useCallback)(async t=>{let n=T.getState();g.getState().setCommandError(null),await e.command({type:`system.openExternal`,...t,editor:t.action===`open_editor`?t.editor??{preset:te(n),commandTemplate:re(n)}:void 0})},[e]),tt=(0,k.useCallback)(async(e,t)=>{let n=c?.localPath??_?.projects[0]?.localPath??A[0]?.localPath;if(n)try{await et({action:e,localPath:n,editor:t})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[_?.projects,et,c?.localPath,A]),nt=(0,k.useCallback)(async e=>{try{await o.writeText(e),g.getState().setCommandError(null)}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[o]),rt=(0,k.useCallback)(async(e,t=`open_editor`,n)=>{try{await et({action:t,localPath:e.path,line:e.line,column:e.column,editor:n})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[et]),it=(0,k.useCallback)(async(e,t)=>{try{await et({action:e,localPath:t})}catch(e){g.getState().setCommandError(e instanceof Error?e.message:String(e))}},[et]),at=(0,k.useCallback)(()=>g.getState().setSidebarOpen(!0),[]),ot=(0,k.useCallback)(()=>g.getState().setSidebarOpen(!1),[]),st=(0,k.useCallback)(()=>g.getState().setSidebarCollapsed(!0),[]),ct=(0,k.useCallback)(()=>g.getState().setSidebarCollapsed(!1),[]),lt=(0,k.useCallback)(()=>g.getState().setAddProjectModalOpen(!0),[]),ut=(0,k.useCallback)(()=>g.getState().setAddProjectModalOpen(!1),[]),dt=(0,k.useCallback)(()=>{let e=Mv({selectedProjectId:le,sidebarProjectId:A[0]?.groupKey,fallbackLocalProjectPath:ge});if(e){u(yv,()=>Ie(e));return}l.goHome()},[l,ge,le,A,Ie]),ft=jv(y,v?.status);return{socket:e,routeChatId:s,sidebarData:he,localProjects:_,updateSnapshot:v,keybindings:b,pushConfig:S,llmProvider:C,connectionStatus:w,sidebarReady:ee,uiRestartActive:ft.active,uiRestartLabel:ft.label,localProjectsReady:ne,commandError:se,startingLocalPath:O,sidebarOpen:E,sidebarCollapsed:D,addProjectModalOpen:ie,stacks:he.stacks,openSidebar:at,closeSidebar:ot,collapseSidebar:st,expandSidebar:ct,openAddProjectModal:lt,closeAddProjectModal:ut,handleCreateChat:Le,handleForkChat:Re,handleOpenLocalProject:ze,handleCreateProject:Be,handleCheckForUpdates:je,handleInstallUpdate:Me,handleForceReload:Ne,handleReadAppSettings:_e,handleWriteAppSettings:ye,handleTestMcpServer:be,handleMintBeaconPairingCode:j,handleUpdateBeacon:xe,handleStartMcpOAuth:Se,handleCompleteMcpOAuth:Ce,handleSetChatPolicyOverride:we,handleWriteCloudflareTunnel:Te,handleWriteClaudeAuth:Ee,handleTestOAuthToken:De,handleReadLlmProvider:ve,handleWriteLlmProvider:Oe,handleValidateLlmProvider:ke,handleSignOut:Ae,handleRenameChat:Ve,handleArchiveChat:We,handleOpenArchivedChat:Ge,handleDeleteChat:He,handleDeleteBulkChats:Ue,handleHideProject:qe,handleDeleteProject:M,handleToggleProjectStar:Je,handleReorderProjectGroups:Ye,...N,handleCreateStackChat:Xe,handleListStackWorktrees:Ze,importClaudeSessions:Qe,importClaudeSession:$e,handleCopyPath:nt,handleOpenExternal:tt,handleOpenExternalPath:it,handleOpenLocalLink:rt,handleCompose:dt,chatNavigator:l}}export{um as $,cd as $t,Ph as A,Wp as At,nh as B,Op as Bt,ug as C,em as Ct,$h as D,Vp as Dt,eg as E,Kp as Et,jh as F,Fp as Ft,Rm as G,Jd as Gt,Lm as H,$d as Ht,mh as I,kp as It,zm as J,Gd as Jt,Xm as K,Xd as Kt,wh as L,jp as Lt,Th as M,Rp as Mt,Eh as N,Lp as Nt,zh as O,Up as Ot,Dh as P,Ip as Pt,jm as Q,W as Qt,ih as R,Mp as Rt,mg as S,tm as St,lg as T,nm as Tt,Um as U,Yd as Ut,Mm as V,Y as Vt,Gm as W,tf as Wt,Pm as X,qd as Xt,Hm as Y,K as Yt,Km as Z,Kd as Zt,f_ as _,le as _n,Jp as _t,sv as a,Gu as an,pm as at,Cg as b,Qp as bt,J_ as c,zu as cn,mm as ct,U_ as d,Wc as dn,lm as dt,U as en,im as et,B_ as f,ca as fn,gm as ft,V_ as g,ue as gn,Yp as gt,H_ as h,de as hn,Xp as ht,Nv as i,qu as in,rm as it,Nh as j,zp as jt,Lh as k,Hp as kt,q_ as l,Lu as ln,dm as lt,G_ as m,fe as mn,Am as mt,vv as n,Yu as nn,om as nt,ev as o,Uu as on,km as ot,W_ as p,xi as pn,Om as pt,Nm as q,G as qt,kv as r,Xu as rn,sm as rt,tv as s,Vu as sn,Tm as st,yv as t,pd as tn,am as tt,L_ as u,Gc as un,cm as ut,Hg as v,Zp as vt,ig as w,$p as wt,hg as x,Gp as xt,Eg as y,qp as yt,rh as z,Np as zt};
|