@kaitranntt/ccs 7.74.0-dev.4 → 7.74.0-dev.6

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.
Files changed (62) hide show
  1. package/dist/api/services/profile-writer.d.ts +1 -1
  2. package/dist/api/services/profile-writer.d.ts.map +1 -1
  3. package/dist/api/services/profile-writer.js +11 -5
  4. package/dist/api/services/profile-writer.js.map +1 -1
  5. package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
  6. package/dist/cliproxy/sync/profile-mapper.js +21 -0
  7. package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
  8. package/dist/commands/api-command/create-command.d.ts.map +1 -1
  9. package/dist/commands/api-command/create-command.js +4 -1
  10. package/dist/commands/api-command/create-command.js.map +1 -1
  11. package/dist/commands/api-command/help.d.ts.map +1 -1
  12. package/dist/commands/api-command/help.js +4 -0
  13. package/dist/commands/api-command/help.js.map +1 -1
  14. package/dist/commands/api-command/shared.d.ts +2 -1
  15. package/dist/commands/api-command/shared.d.ts.map +1 -1
  16. package/dist/commands/api-command/shared.js +9 -0
  17. package/dist/commands/api-command/shared.js.map +1 -1
  18. package/dist/ui/assets/{accounts-BGE0yjYy.js → accounts-Bi9l48Df.js} +1 -1
  19. package/dist/ui/assets/{alert-dialog-DuiOADsV.js → alert-dialog-BRUwq6tw.js} +1 -1
  20. package/dist/ui/assets/{api-Guj515aS.js → api-D-U56E4i.js} +1 -1
  21. package/dist/ui/assets/{auth-section-SAQbhr1I.js → auth-section-Ce9qsANj.js} +1 -1
  22. package/dist/ui/assets/{backups-section-DDvlWpiu.js → backups-section-sgFRBpZK.js} +1 -1
  23. package/dist/ui/assets/{channels-BplAqAOq.js → channels-N0BJTNsj.js} +1 -1
  24. package/dist/ui/assets/{checkbox-BOkFW5T7.js → checkbox-C1C1vyVk.js} +1 -1
  25. package/dist/ui/assets/{claude-extension-n_MuC68N.js → claude-extension-DlsLoPw6.js} +1 -1
  26. package/dist/ui/assets/{cliproxy-WWj2GyJE.js → cliproxy-DYhugtcp.js} +1 -1
  27. package/dist/ui/assets/{cliproxy-ai-providers-B70CiXmm.js → cliproxy-ai-providers-DCpIG9TD.js} +1 -1
  28. package/dist/ui/assets/{cliproxy-control-panel-B7FrWnuW.js → cliproxy-control-panel-DCfZjUBO.js} +1 -1
  29. package/dist/ui/assets/{codex-BoljmCX9.js → codex-ZkG1YspX.js} +1 -1
  30. package/dist/ui/assets/{confirm-dialog-D73zMOJ7.js → confirm-dialog-DesWFrB5.js} +1 -1
  31. package/dist/ui/assets/{copilot-CmS0DhuS.js → copilot-BQcghL5h.js} +1 -1
  32. package/dist/ui/assets/{cursor-btzq1F22.js → cursor-z9CgZr4F.js} +1 -1
  33. package/dist/ui/assets/{droid-Dt-4f5BE.js → droid-Du97l2rE.js} +1 -1
  34. package/dist/ui/assets/{globalenv-section-DWWZ9ERp.js → globalenv-section-Dbi199_E.js} +1 -1
  35. package/dist/ui/assets/{health-CuzprvVL.js → health-LEYI6q2O.js} +1 -1
  36. package/dist/ui/assets/{index-CA5Km3DW.js → index-3YVWpOmW.js} +1 -1
  37. package/dist/ui/assets/{index-CHCBgQxw.js → index-BD1XO7hd.js} +1 -1
  38. package/dist/ui/assets/index-BIHjOqHW.css +1 -0
  39. package/dist/ui/assets/{index-DQXr3j8J.js → index-CDOC8O90.js} +1 -1
  40. package/dist/ui/assets/{index-DEqhujvv.js → index-Ce4IouO8.js} +1 -1
  41. package/dist/ui/assets/{index-DPiX3K4c.js → index-DTxpIlHx.js} +1 -1
  42. package/dist/ui/assets/{index-DhAjOd4r.js → index-EoKZSZjT.js} +7 -7
  43. package/dist/ui/assets/{index-ClrCKbzh.js → index-YC5YfdvY.js} +1 -1
  44. package/dist/ui/assets/{logs-CabVgAOr.js → logs-_wJgNka8.js} +1 -1
  45. package/dist/ui/assets/{masked-input-4lwOg03z.js → masked-input-Bvitkjfi.js} +1 -1
  46. package/dist/ui/assets/{proxy-status-widget-C6Ctzus0.js → proxy-status-widget-DKF_u-z_.js} +1 -1
  47. package/dist/ui/assets/{raw-json-settings-editor-panel-upVhpuik.js → raw-json-settings-editor-panel-B-kpXlsF.js} +1 -1
  48. package/dist/ui/assets/{searchable-select-DkL__exx.js → searchable-select-BIIDffTw.js} +1 -1
  49. package/dist/ui/assets/{separator-fWUi3UIY.js → separator-DuNFfbVb.js} +1 -1
  50. package/dist/ui/assets/{shared-I-FRJqTw.js → shared-zxKI7DcS.js} +1 -1
  51. package/dist/ui/assets/{table-D3mrbj8H.js → table-DeH167eX.js} +1 -1
  52. package/dist/ui/assets/{updates-2HIhdejN.js → updates-DeNEfEmm.js} +1 -1
  53. package/dist/ui/index.html +2 -2
  54. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  55. package/dist/web-server/routes/profile-routes.js +13 -3
  56. package/dist/web-server/routes/profile-routes.js.map +1 -1
  57. package/dist/web-server/routes/route-helpers.d.ts +1 -0
  58. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  59. package/dist/web-server/routes/route-helpers.js +11 -0
  60. package/dist/web-server/routes/route-helpers.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/ui/assets/index-DuTB1_9r.css +0 -1
@@ -1,4 +1,4 @@
1
- import{j as f}from"./radix-ui-Zb8sVEtn.js";import{r as b}from"./react-vendor-CNOkPC89.js";import{bt as io,bu as ro,Y as we,a as pi,bv as oo,bi as On,bk as zn,d as yt,n as ao,c as Tt,L as xt,I as Un,r as Wn,s as Kn,t as $n,v as Hn,w as _n,aI as Gn,M as lo,N as co,O as uo}from"./index-DhAjOd4r.js";import{R as Dt,I as Zt,x as Et,ab as ho,_ as fo,ba as mo,w as gi,$ as po,a6 as go,e as yo,s as xo}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function vo(t,e){return{claude:{...t.claude,...e.claude},codex:{...t.codex,...e.codex}}}function bo(){const{state:t}=io(),e=ro(),n=b.useCallback(async()=>{try{e.setBrowserLoading(!0),e.setBrowserError(null);const o=await we.browser.get();e.setBrowserConfig(o.config),e.setBrowserStatus(o.status)}catch(o){e.setBrowserError(o.message)}finally{e.setBrowserLoading(!1),e.setBrowserStatusLoading(!1)}},[e]),s=b.useCallback(async()=>{try{e.setBrowserStatusLoading(!0),e.setBrowserError(null);const o=await we.browser.getStatus();return e.setBrowserStatus(o),o}catch(o){return e.setBrowserError(o.message),null}finally{e.setBrowserStatusLoading(!1)}},[e]),i=b.useCallback(async o=>{const r=t.browserConfig;if(!r)return!1;const a=vo(r,o);e.setBrowserConfig(a);try{e.setBrowserSaving(!0),e.setBrowserError(null);const c=await we.browser.update(o);return e.setBrowserConfig(c.browser.config),e.setBrowserStatus(c.browser.status),e.setBrowserSuccess(!0),window.setTimeout(()=>e.setBrowserSuccess(!1),1500),!0}catch(c){return e.setBrowserConfig(r),e.setBrowserError(c.message),!1}finally{e.setBrowserSaving(!1)}},[e,t.browserConfig]);return{config:t.browserConfig,status:t.browserStatus,loading:t.browserLoading,statusLoading:t.browserStatusLoading,saving:t.browserSaving,error:t.browserError,success:t.browserSuccess,fetchConfig:n,fetchStatus:s,saveConfig:i}}const un=b.createContext({});function dn(t){const e=b.useRef(null);return e.current===null&&(e.current=t()),e.current}const wo=typeof window<"u",yi=wo?b.useLayoutEffect:b.useEffect,ge=b.createContext(null);function hn(t,e){t.indexOf(e)===-1&&t.push(e)}function ae(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const nt=(t,e,n)=>n>e?e:n<t?t:n;let fn=()=>{};const rt={},xi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function vi(t){return typeof t=="object"&&t!==null}const bi=t=>/^0[^.\s]+$/u.test(t);function wi(t){let e;return()=>(e===void 0&&(e=t()),e)}const G=t=>t,So=(t,e)=>n=>e(t(n)),Ut=(...t)=>t.reduce(So),It=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class mn{constructor(){this.subscriptions=[]}add(e){return hn(this.subscriptions,e),()=>ae(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $=t=>t*1e3,_=t=>t/1e3;function Si(t,e){return e?t*(1e3/e):0}const Ti=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,To=1e-7,Po=12;function Co(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Ti(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>To&&++a<Po);return r}function Wt(t,e,n,s){if(t===e&&n===s)return G;const i=o=>Co(o,0,1,t,n);return o=>o===0||o===1?o:Ti(i(o),e,s)}const Pi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ci=t=>e=>1-t(1-e),Ai=Wt(.33,1.53,.69,.99),pn=Ci(Ai),Vi=Pi(pn),Mi=t=>t>=1?1:(t*=2)<1?.5*pn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),Di=Ci(gn),ki=Pi(gn),Ao=Wt(.42,0,1,1),Vo=Wt(0,0,.58,1),Ei=Wt(.42,0,.58,1),Mo=t=>Array.isArray(t)&&typeof t[0]!="number",ji=t=>Array.isArray(t)&&typeof t[0]=="number",Do={linear:G,easeIn:Ao,easeInOut:Ei,easeOut:Vo,circIn:gn,circInOut:ki,circOut:Di,backIn:pn,backInOut:Vi,backOut:Ai,anticipate:Mi},ko=t=>typeof t=="string",Xn=t=>{if(ji(t)){fn(t.length===4);const[e,n,s,i]=t;return Wt(e,n,s,i)}else if(ko(t))return Do[t];return t},Ht=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Eo(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){r.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,d=!1,h=!1)=>{const p=h&&i?n:s;return d&&r.add(l),p.add(l),l},cancel:l=>{s.delete(l),r.delete(l)},process:l=>{if(a=l,i){o=!0;return}i=!0;const d=n;n=s,s=d,n.forEach(c),n.clear(),i=!1,o&&(o=!1,u.process(l))}};return u}const jo=40;function Ri(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ht.reduce((w,S)=>(w[S]=Eo(o),w),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:d,preRender:h,render:m,postRender:p}=r,y=()=>{const w=rt.useManualTiming,S=w?i.timestamp:performance.now();n=!1,w||(i.delta=s?1e3/60:Math.max(Math.min(S-i.timestamp,jo),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),d.process(i),h.process(i),m.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},x=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Ht.reduce((w,S)=>{const P=r[S];return w[S]=(D,L=!1,A=!1)=>(n||x(),P.schedule(D,L,A)),w},{}),cancel:w=>{for(let S=0;S<Ht.length;S++)r[Ht[S]].cancel(w)},state:i,steps:r}}const{schedule:k,cancel:ot,state:z,steps:Se}=Ri(typeof requestAnimationFrame<"u"?requestAnimationFrame:G,!0);let Jt;function Ro(){Jt=void 0}const W={now:()=>(Jt===void 0&&W.set(z.isProcessing||rt.useManualTiming?z.timestamp:performance.now()),Jt),set:t=>{Jt=t,queueMicrotask(Ro)}},Li=t=>e=>typeof e=="string"&&e.startsWith(t),Ni=Li("--"),Lo=Li("var(--"),yn=t=>Lo(t)?No.test(t.split("/*")[0].trim()):!1,No=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const At={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft={...At,transform:t=>nt(0,1,t)},_t={...At,default:1},Rt=t=>Math.round(t*1e5)/1e5,xn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Bo(t){return t==null}const Io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vn=(t,e)=>n=>!!(typeof n=="string"&&Io.test(n)&&n.startsWith(t)||e&&!Bo(n)&&Object.prototype.hasOwnProperty.call(n,e)),Bi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(xn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Fo=t=>nt(0,255,t),Te={...At,transform:t=>Math.round(Fo(t))},ht={test:vn("rgb","red"),parse:Bi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Te.transform(t)+", "+Te.transform(e)+", "+Te.transform(n)+", "+Rt(Ft.transform(s))+")"};function Oo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Oe={test:vn("#"),parse:Oo,transform:ht.transform},Kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Kt("deg"),et=Kt("%"),T=Kt("px"),zo=Kt("vh"),Uo=Kt("vw"),qn={...et,parse:t=>et.parse(t)/100,transform:t=>et.transform(t*100)},bt={test:vn("hsl","hue"),parse:Bi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+et.transform(Rt(e))+", "+et.transform(Rt(n))+", "+Rt(Ft.transform(s))+")"},N={test:t=>ht.test(t)||Oe.test(t)||bt.test(t),parse:t=>ht.test(t)?ht.parse(t):bt.test(t)?bt.parse(t):Oe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):bt.transform(t),getAnimatableNone:t=>{const e=N.parse(t);return e.alpha=0,N.transform(e)}},Wo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ko(t){return isNaN(t)&&typeof t=="string"&&(t.match(xn)?.length||0)+(t.match(Wo)?.length||0)>0}const Ii="number",Fi="color",$o="var",Ho="var(",Zn="${}",_o=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(_o,c=>(N.test(c)?(s.color.push(o),i.push(Fi),n.push(N.parse(c))):c.startsWith(Ho)?(s.var.push(o),i.push($o),n.push(c)):(s.number.push(o),i.push(Ii),n.push(parseFloat(c))),++o,Zn)).split(Zn);return{values:n,split:a,indexes:s,types:i}}function Go(t){return Pt(t).values}function Oi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let o=0;o<n;o++)if(i+=t[o],s[o]!==void 0){const r=e[o];r===Ii?i+=Rt(s[o]):r===Fi?i+=N.transform(s[o]):i+=s[o]}return i}}function Xo(t){return Oi(Pt(t))}const Yo=t=>typeof t=="number"?0:N.test(t)?N.getAnimatableNone(t):t,qo=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:Yo(t);function Zo(t){const e=Pt(t);return Oi(e)(e.values.map((s,i)=>qo(s,e.split[i])))}const Z={test:Ko,parse:Go,createTransformer:Xo,getAnimatableNone:Zo};function Pe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Jo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Pe(c,a,t+1/3),o=Pe(c,a,t),r=Pe(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function le(t,e){return n=>n>0?e:t}const j=(t,e,n)=>t+(e-t)*n,Ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Qo=[Oe,ht,bt],ta=t=>Qo.find(e=>e.test(t));function Jn(t){const e=ta(t);if(!e)return!1;let n=e.parse(t);return e===bt&&(n=Jo(n)),n}const Qn=(t,e)=>{const n=Jn(t),s=Jn(e);if(!n||!s)return le(t,e);const i={...n};return o=>(i.red=Ce(n.red,s.red,o),i.green=Ce(n.green,s.green,o),i.blue=Ce(n.blue,s.blue,o),i.alpha=j(n.alpha,s.alpha,o),ht.transform(i))},ze=new Set(["none","hidden"]);function ea(t,e){return ze.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function na(t,e){return n=>j(t,e,n)}function bn(t){return typeof t=="number"?na:typeof t=="string"?yn(t)?le:N.test(t)?Qn:ra:Array.isArray(t)?zi:typeof t=="object"?N.test(t)?Qn:sa:le}function zi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>bn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function sa(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=bn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function ia(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const ra=(t,e)=>{const n=Z.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ze.has(t)&&!i.values.length||ze.has(e)&&!s.values.length?ea(t,e):Ut(zi(ia(s,i),i.values),n):le(t,e)};function Ui(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?j(t,e,n):bn(t)(t,e)}const oa=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>k.update(e,n),stop:()=>ot(e),now:()=>z.isProcessing?z.timestamp:W.now()}},Wi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ce=2e4;function wn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ce;)e+=n,s=t.next(e);return e>=ce?1/0:e}function aa(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(wn(s),ce);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:_(i)}}const R={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ue(t,e){return t*Math.sqrt(1-e*e)}const la=12;function ca(t,e,n){let s=n;for(let i=1;i<la;i++)s=s-t(s)/e(s);return s}const Ae=.001;function ua({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,o,r=1-e;r=nt(R.minDamping,R.maxDamping,r),t=nt(R.minDuration,R.maxDuration,_(t)),r<1?(i=u=>{const l=u*r,d=l*t,h=l-n,m=Ue(u,r),p=Math.exp(-d);return Ae-h/m*p},o=u=>{const d=u*r*t,h=d*n+n,m=Math.pow(r,2)*Math.pow(u,2)*t,p=Math.exp(-d),y=Ue(Math.pow(u,2),r);return(-i(u)+Ae>0?-1:1)*((h-m)*p)/y}):(i=u=>{const l=Math.exp(-u*t),d=(u-n)*t+1;return-Ae+l*d},o=u=>{const l=Math.exp(-u*t),d=(n-u)*(t*t);return l*d});const a=5/t,c=ca(i,o,a);if(t=$(t),isNaN(c))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const da=["duration","bounce"],ha=["stiffness","damping","mass"];function ts(t,e){return e.some(n=>t[n]!==void 0)}function fa(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!ts(t,ha)&&ts(t,da))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*nt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:o}}else{const n=ua({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function ue(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:u,mass:l,duration:d,velocity:h,isResolvedFromDuration:m}=fa({...n,velocity:-_(n.velocity||0)}),p=h||0,y=u/(2*Math.sqrt(c*l)),x=r-o,v=_(Math.sqrt(c/l)),g=Math.abs(x)<5;s||(s=g?R.restSpeed.granular:R.restSpeed.default),i||(i=g?R.restDelta.granular:R.restDelta.default);let w,S,P,D,L,A;if(y<1)P=Ue(v,y),D=(p+y*v*x)/P,w=C=>{const E=Math.exp(-y*v*C);return r-E*(D*Math.sin(P*C)+x*Math.cos(P*C))},L=y*v*D+x*P,A=y*v*x-D*P,S=C=>Math.exp(-y*v*C)*(L*Math.sin(P*C)+A*Math.cos(P*C));else if(y===1){w=E=>r-Math.exp(-v*E)*(x+(p+v*x)*E);const C=p+v*x;S=E=>Math.exp(-v*E)*(v*C*E-p)}else{const C=v*Math.sqrt(y*y-1);w=M=>{const I=Math.exp(-y*v*M),J=Math.min(C*M,300);return r-I*((p+y*v*x)*Math.sinh(J)+C*x*Math.cosh(J))/C};const E=(p+y*v*x)/C,B=y*v*E-x*C,X=y*v*x-E*C;S=M=>{const I=Math.exp(-y*v*M),J=Math.min(C*M,300);return I*(B*Math.sinh(J)+X*Math.cosh(J))}}const V={calculatedDuration:m&&d||null,velocity:C=>$(S(C)),next:C=>{if(!m&&y<1){const B=Math.exp(-y*v*C),X=Math.sin(P*C),M=Math.cos(P*C),I=r-B*(D*X+x*M),J=$(B*(L*X+A*M));return a.done=Math.abs(J)<=s&&Math.abs(r-I)<=i,a.value=a.done?r:I,a}const E=w(C);if(m)a.done=C>=d;else{const B=$(S(C));a.done=Math.abs(B)<=s&&Math.abs(r-E)<=i}return a.value=a.done?r:E,a},toString:()=>{const C=Math.min(wn(V),ce),E=Wi(B=>V.next(C*B).value,C,30);return C+"ms "+E},toTransition:()=>{}};return V}ue.applyToOptions=t=>{const e=aa(t,100,ue);return t.ease=e.ease,t.duration=$(e.duration),t.type="keyframes",t};const ma=5;function Ki(t,e,n){const s=Math.max(e-ma,0);return Si(n-t(s),e-s)}function We({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:u=.5,restSpeed:l}){const d=t[0],h={done:!1,value:d},m=A=>a!==void 0&&A<a||c!==void 0&&A>c,p=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let y=n*e;const x=d+y,v=r===void 0?x:r(x);v!==x&&(y=v-d);const g=A=>-y*Math.exp(-A/s),w=A=>v+g(A),S=A=>{const V=g(A),C=w(A);h.done=Math.abs(V)<=u,h.value=h.done?v:C};let P,D;const L=A=>{m(h.value)&&(P=A,D=ue({keyframes:[h.value,p(h.value)],velocity:Ki(w,A,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:l}))};return L(0),{calculatedDuration:null,next:A=>{let V=!1;return!D&&P===void 0&&(V=!0,S(A),L(A)),P!==void 0&&A>=P?D.next(A-P):(!V&&S(A),h)}}}function pa(t,e,n){const s=[],i=n||rt.mix||Ui,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const c=Array.isArray(e)?e[r]||G:e;a=Ut(c,a)}s.push(a)}return s}function ga(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(fn(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=pa(e,s,i),c=a.length,u=l=>{if(r&&l<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(l<t[d+1]);d++);const h=It(t[d],t[d+1],l);return a[d](h)};return n?l=>u(nt(t[0],t[o-1],l)):u}function ya(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=It(0,e,s);t.push(j(n,1,i))}}function xa(t){const e=[0];return ya(e,t.length-1),e}function va(t,e){return t.map(n=>n*e)}function ba(t,e){return t.map(()=>e||Ei).splice(0,t.length-1)}function Lt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Mo(s)?s.map(Xn):Xn(s),o={done:!1,value:e[0]},r=va(n&&n.length===e.length?n:xa(e),t),a=ga(r,e,{ease:Array.isArray(i)?i:ba(e,i)});return{calculatedDuration:t,next:c=>(o.value=a(c),o.done=c>=t,o)}}const wa=t=>t!==null;function ye(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(wa),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Sa={decay:We,inertia:We,tween:Lt,keyframes:Lt,spring:ue};function $i(t){typeof t.type=="string"&&(t.type=Sa[t.type])}class Sn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Ta=t=>t/100;class de extends Sn{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=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==W.now()&&this.tick(W.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;$i(e);const{type:n=Lt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const c=n||Lt;c!==Lt&&typeof a[0]!="number"&&(this.mixKeyframes=Ut(Ta,Ui(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=wn(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:d,repeatType:h,repeatDelay:m,type:p,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,S=s;if(d){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),C=A%1;!C&&A>=1&&(C=1),C===1&&V--,V=Math.min(V,d+1),!!(V%2)&&(h==="reverse"?(C=1-C,m&&(C-=m/a)):h==="mirror"&&(S=r)),w=nt(0,1,C)*a}let P;g?(this.delayState.value=l[0],P=this.delayState):P=S.next(w),o&&!g&&(P.value=o(P.value));let{done:D}=P;!g&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return L&&p!==We&&(P.value=ye(l,this.options,x,this.speed)),y&&y(P.value),L&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return _(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_(e)}get time(){return _(this.currentTime)}set time(e){e=$(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(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Ki(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(W.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=_(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=oa,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(W.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(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Pa(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,Ke=t=>{const e=ft(Math.atan2(t[1],t[0]));return $e(e)},Ca={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ke,rotateZ:Ke,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$e=t=>(t=t%360,t<0&&(t+=360),t),es=Ke,ns=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ss=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Aa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ns,scaleY:ss,scale:t=>(ns(t)+ss(t))/2,rotateX:t=>$e(ft(Math.atan2(t[6],t[5]))),rotateY:t=>$e(ft(Math.atan2(-t[2],t[0]))),rotateZ:es,rotate:es,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function _e(t,e){if(!t||t==="none")return He(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Aa,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ca,i=a}if(!i)return He(e);const o=s[e],r=i[1].split(",").map(Ma);return typeof o=="function"?o(r):r[o]}const Va=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return _e(n,e)};function Ma(t){return parseFloat(t.trim())}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mt=new Set(Vt),is=t=>t===At||t===T,Da=new Set(["x","y","z"]),ka=Vt.filter(t=>!Da.has(t));function Ea(t){const e=[];return ka.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>_e(e,"x"),y:(t,{transform:e})=>_e(e,"y")};it.translateX=it.x;it.translateY=it.y;const mt=new Set;let Ge=!1,Xe=!1,Ye=!1;function Hi(){if(Xe){const t=Array.from(mt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Ea(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Xe=!1,Ge=!1,mt.forEach(t=>t.complete(Ye)),mt.clear()}function _i(){mt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Xe=!0)})}function ja(){Ye=!0,_i(),Hi(),Ye=!1}class Tn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),Ge||(Ge=!0,k.read(_i),k.resolveKeyframes(Hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Pa(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ra=t=>t.startsWith("--");function Gi(t,e,n){Ra(e)?t.style.setProperty(e,n):t.style[e]=n}const La={};function Xi(t,e){const n=wi(t);return()=>La[e]??n()}const Na=Xi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Yi=Xi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,rs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function qi(t,e){if(t)return typeof t=="function"?Yi()?Wi(t,e):"ease-out":ji(t)?jt(t):Array.isArray(t)?t.map(n=>qi(n,e)||rs.easeOut):rs[t]}function Ba(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const d=qi(a,i);Array.isArray(d)&&(l.easing=d);const h={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(l,h)}function Zi(t){return typeof t=="function"&&"applyToOptions"in t}function Ia({type:t,...e}){return Zi(t)&&Yi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ji extends Sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,fn(typeof e.type!="string");const u=Ia(e);this.animation=Ba(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=ye(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Gi(n,s,l),this.animation.cancel()}c?.(),this.notifyFinished()}}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;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return _(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_(e)}get time(){return _(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=$(e),n&&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?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Na()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),G):i(this)}}const Qi={anticipate:Mi,backInOut:Vi,circInOut:ki};function Fa(t){return t in Qi}function Oa(t){typeof t.ease=="string"&&Fa(t.ease)&&(t.ease=Qi[t.ease])}const Ve=10;class za extends Ji{constructor(e){Oa(e),$i(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new de({...r,autoplay:!1}),c=Math.max(Ve,W.now()-this.startTime),u=nt(0,Ve,c-Ve),l=a.sample(c).value,{name:d}=this.options;o&&d&&Gi(o,d,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const os=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Z.test(t)||t==="0")&&!t.startsWith("url("));function Ua(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Wa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=os(i,e),a=os(o,e);return!r||!a?!1:Ua(t)||(n==="spring"||Zi(n))&&s}function qe(t){t.duration=0,t.type="keyframes"}const tr=new Set(["opacity","clipPath","filter","transform"]),Ka=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function $a(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Ka.test(t[e]))return!0;return!1}const Ha=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),_a=wi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ga(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return _a()&&n&&(tr.has(n)||Ha.has(n)&&$a(a))&&(n!=="transform"||!l)&&!u&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const Xa=40;class Ya extends Sn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:c,motionValue:u,element:l,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=W.now();const h={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:c,motionValue:u,element:l,...d},m=l?.KeyframeResolver||Tn;this.keyframeResolver=new m(a,(p,y,x)=>this.onKeyframesResolved(p,y,h,!x),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=W.now();let d=!0;Wa(e,o,r,a)||(d=!1,(rt.instantAnimations||!c)&&l?.(ye(e,s,n)),e[0]=e[e.length-1],qe(s),s.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Xa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=d&&!u&&Ga(m),y=m.motionValue?.owner?.current;let x;if(p)try{x=new za({...m,element:y})}catch{x=new de(m)}else x=new de(m);x.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ja()),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 er(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const qa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Za(t){const e=qa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function nr(t,e,n=1){const[s,i]=Za(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return xi(r)?parseFloat(r):r}return yn(i)?nr(i,e,n+1):i}const Ja={type:"spring",stiffness:500,damping:25,restSpeed:10},Qa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),tl={type:"keyframes",duration:.8},el={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nl=(t,{keyframes:e})=>e.length>2?tl:Mt.has(t)?t.startsWith("scale")?Qa(e[1]):Ja:el;function sr(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Pn(t,e){const n=t?.[e]??t?.default??t;return n!==t?sr(n,t):n}const sl=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function il(t){for(const e in t)if(!sl.has(e))return!0;return!1}const Cn=(t,e,n,s={},i,o)=>r=>{const a=Pn(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-$(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};il(a)||Object.assign(l,nl(t,l)),l.duration&&(l.duration=$(l.duration)),l.repeatDelay&&(l.repeatDelay=$(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let d=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(qe(l),l.delay===0&&(d=!0)),(rt.instantAnimations||rt.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,qe(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,d&&!o&&e.get()!==void 0){const h=ye(l.keyframes,a);if(h!==void 0){k.update(()=>{l.onUpdate(h),l.onComplete()});return}}return a.isSync?new de(l):new Ya(l)};function as(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function An(t,e,n,s){if(typeof e=="function"){const[i,o]=as(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=as(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function pt(t,e,n){const s=t.getProps();return An(s,e,n!==void 0?n:s.custom,t)}const ir=new Set(["width","height","top","left","right","bottom",...Vt]),ls=30,rl=t=>!isNaN(parseFloat(t));class ol{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=W.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=W.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=rl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new mn);const s=this.events[e].add(n);return e==="change"?()=>{s(),k.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ls)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ls);return Si(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ct(t,e){return new ol(t,e)}const Ze=t=>Array.isArray(t);function al(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ct(n))}function ll(t){return Ze(t)?t[t.length-1]||0:t}function cl(t,e){const n=pt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ll(o[r]);al(t,r,a)}}const U=t=>!!(t&&t.getVelocity);function ul(t){return!!(U(t)&&t.add)}function Je(t,e){const n=t.getValue("willChange");if(ul(n))return n.add(e);if(!n&&rt.WillChange){const s=new rt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Vn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const dl="framerAppearId",rr="data-"+Vn(dl);function or(t){return t.props[rr]}function hl({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ar(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o,transitionEnd:r,...a}=e;const c=t.getDefaultTransition();o=o?sr(o,c):c;const u=o?.reduceMotion;s&&(o=s);const l=[],d=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),p=a[h];if(p===void 0||d&&hl(d,h))continue;const y={delay:n,...Pn(o||{},h)},x=m.get();if(x!==void 0&&!m.isAnimating()&&!Array.isArray(p)&&p===x&&!y.velocity){k.update(()=>m.set(p));continue}let v=!1;if(window.MotionHandoffAnimation){const S=or(t);if(S){const P=window.MotionHandoffAnimation(S,h,k);P!==null&&(y.startTime=P,v=!0)}}Je(t,h);const g=u??t.shouldReduceMotion;m.start(Cn(h,m,p,g&&ir.has(h)?{type:!1}:y,t,v));const w=m.animation;w&&l.push(w)}if(r){const h=()=>k.update(()=>{r&&cl(t,r)});l.length?Promise.all(l).then(h):h()}return l}function Qe(t,e,n={}){const s=pt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(ar(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:d}=i;return fl(t,e,c,u,l,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function fl(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Qe(c,e,{...r,delay:n+(typeof s=="function"?0:s)+er(t.variantChildren,c,s,i,o)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function ml(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Qe(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Qe(t,e,n);else{const i=typeof e=="function"?pt(t,e,n.custom):e;s=Promise.all(ar(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const pl={test:t=>t==="auto",parse:t=>t},lr=t=>e=>e.test(t),cr=[At,T,et,st,Uo,zo,pl],cs=t=>cr.find(lr(t));function gl(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||bi(t):!0}const yl=new Set(["brightness","contrast","saturate","opacity"]);function xl(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(xn)||[];if(!s)return t;const i=n.replace(s,"");let o=yl.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const vl=/\b([a-z-]*)\(.*?\)/gu,tn={...Z,getAnimatableNone:t=>{const e=t.match(vl);return e?e.map(xl).join(" "):t}},en={...Z,getAnimatableNone:t=>{const e=Z.parse(t);return Z.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},us={...At,transform:Math.round},bl={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:_t,scaleX:_t,scaleY:_t,scaleZ:_t,skew:st,skewX:st,skewY:st,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ft,originX:qn,originY:qn,originZ:T},Mn={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...bl,zIndex:us,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:us},wl={...Mn,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:tn,WebkitFilter:tn,mask:en,WebkitMask:en},ur=t=>wl[t],Sl=new Set([tn,en]);function dr(t,e){let n=ur(t);return Sl.has(n)||(n=Z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Tl=new Set(["auto","none","0"]);function Pl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Tl.has(o)&&Pt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=dr(n,i)}class Cl extends Tn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let d=e[l];if(typeof d=="string"&&(d=d.trim(),yn(d))){const h=nr(d,n.current);h!==void 0&&(e[l]=h),l===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!ir.has(s)||e.length!==2)return;const[i,o]=e,r=cs(i),a=cs(o),c=Yn(i),u=Yn(o);if(c!==u&&it[s]){this.needsMeasurement=!0;return}if(r!==a)if(is(r)&&is(a))for(let l=0;l<e.length;l++){const d=e[l];typeof d=="string"&&(e[l]=parseFloat(d))}else it[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||gl(e[i]))&&s.push(i);s.length&&Pl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=it[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function hr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const fr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Qt(t){return vi(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Dn}=Ri(queueMicrotask,!1),q={x:!1,y:!1};function mr(){return q.x||q.y}function Al(t){return t==="x"||t==="y"?q[t]?null:(q[t]=!0,()=>{q[t]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function pr(t,e){const n=hr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Vl(t){return!(t.pointerType==="touch"||mr())}function Ml(t,e,n={}){const[s,i,o]=pr(t,n);return s.forEach(r=>{let a=!1,c=!1,u;const l=()=>{r.removeEventListener("pointerleave",p)},d=x=>{u&&(u(x),u=void 0),l()},h=x=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,d(x))},m=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},p=x=>{if(x.pointerType!=="touch"){if(a){c=!0;return}d(x)}},y=x=>{if(!Vl(x))return;c=!1;const v=e(r,x);typeof v=="function"&&(u=v,r.addEventListener("pointerleave",p,i))};r.addEventListener("pointerenter",y,i),r.addEventListener("pointerdown",m,i)}),o}const gr=(t,e)=>e?t===e?!0:gr(t,e.parentElement):!1,kn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Dl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kl(t){return Dl.has(t.tagName)||t.isContentEditable===!0}const El=new Set(["INPUT","SELECT","TEXTAREA"]);function jl(t){return El.has(t.tagName)||t.isContentEditable===!0}const te=new WeakSet;function ds(t){return e=>{e.key==="Enter"&&t(e)}}function Me(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Rl=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ds(()=>{if(te.has(n))return;Me(n,"down");const i=ds(()=>{Me(n,"up")}),o=()=>Me(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function hs(t){return kn(t)&&!mr()}const fs=new WeakSet;function Ll(t,e,n={}){const[s,i,o]=pr(t,n),r=a=>{const c=a.currentTarget;if(!hs(a)||fs.has(a))return;te.add(c),n.stopPropagation&&fs.add(a);const u=e(c,a),l=(m,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),te.has(c)&&te.delete(c),hs(m)&&typeof u=="function"&&u(m,{success:p})},d=m=>{l(m,c===window||c===document||n.useGlobalTarget||gr(c,m.target))},h=m=>{l(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Qt(a)&&(a.addEventListener("focus",u=>Rl(u,i)),!kl(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function En(t){return vi(t)&&"ownerSVGElement"in t}const ee=new WeakMap;let ne;const yr=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:En(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Nl=yr("inline","width","offsetWidth"),Bl=yr("block","height","offsetHeight");function Il({target:t,borderBoxSize:e}){ee.get(t)?.forEach(n=>{n(t,{get width(){return Nl(t,e)},get height(){return Bl(t,e)}})})}function Fl(t){t.forEach(Il)}function Ol(){typeof ResizeObserver>"u"||(ne=new ResizeObserver(Fl))}function zl(t,e){ne||Ol();const n=hr(t);return n.forEach(s=>{let i=ee.get(s);i||(i=new Set,ee.set(s,i)),i.add(e),ne?.observe(s)}),()=>{n.forEach(s=>{const i=ee.get(s);i?.delete(e),i?.size||ne?.unobserve(s)})}}const se=new Set;let wt;function Ul(){wt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};se.forEach(e=>e(t))},window.addEventListener("resize",wt)}function Wl(t){return se.add(t),wt||Ul(),()=>{se.delete(t),!se.size&&typeof wt=="function"&&(window.removeEventListener("resize",wt),wt=void 0)}}function ms(t,e){return typeof t=="function"?Wl(t):zl(t,e)}function Kl(t){return En(t)&&t.tagName==="svg"}const $l=[...cr,N,Z],Hl=t=>$l.find(lr(t)),ps=()=>({translate:0,scale:1,origin:0,originPoint:0}),St=()=>({x:ps(),y:ps()}),gs=()=>({min:0,max:0}),F=()=>({x:gs(),y:gs()}),_l=new WeakMap;function xe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ot(t){return typeof t=="string"||Array.isArray(t)}const jn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rn=["initial",...jn];function ve(t){return xe(t.animate)||Rn.some(e=>Ot(t[e]))}function xr(t){return!!(ve(t)||t.variants)}function Gl(t,e,n){for(const s in e){const i=e[s],o=n[s];if(U(i))t.addValue(s,i);else if(U(o))t.addValue(s,Ct(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,Ct(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const nn={current:null},vr={current:!1},Xl=typeof window<"u";function Yl(){if(vr.current=!0,!!Xl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>nn.current=t.matches;t.addEventListener("change",e),e()}else nn.current=!1}const ys=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let he={};function br(t){he=t}function ql(){return he}class Zl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},c={}){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=Tn,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=()=>{const m=W.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,k.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=c,this.blockInitialAnimation=!!r,this.isControllingVariants=ve(n),this.isVariantNode=xr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const p=h[m];u[m]!==void 0&&U(p)&&p.set(u[m])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,_l.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(vr.current||Yl(),this.shouldReduceMotion=nn.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(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&tr.has(e)&&this.current instanceof HTMLElement){const{factory:r,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,d=new Ji({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:$(l)}),h=r(d);this.valueSubscriptions.set(e,()=>{h(),d.cancel()});return}const s=Mt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&k.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in he){const n=he[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ys.length;s++){const i=ys[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Gl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Ct(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(xi(s)||bi(s))?s=parseFloat(s):!Hl(s)&&Z.test(n)&&(s=dr(e,n)),this.setBaseTarget(e,U(s)?s.get():s)),U(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=An(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!U(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new mn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Dn.render(this.render)}}class wr extends Zl{constructor(){super(...arguments),this.KeyframeResolver=Cl}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;U(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Sr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Jl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ql(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function De(t){return t===void 0||t===1}function sn({scale:t,scaleX:e,scaleY:n}){return!De(t)||!De(e)||!De(n)}function ut(t){return sn(t)||Tr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Tr(t){return xs(t.x)||xs(t.y)}function xs(t){return t&&t!=="0%"}function fe(t,e,n){const s=t-n,i=e*s;return n+i}function vs(t,e,n,s,i){return i!==void 0&&(t=fe(t,i,s)),fe(t,n,s)+e}function rn(t,e=0,n=1,s,i){t.min=vs(t.min,e,n,s,i),t.max=vs(t.max,e,n,s,i)}function Pr(t,{x:e,y:n}){rn(t.x,e.translate,e.scale,e.originPoint),rn(t.y,n.translate,n.scale,n.originPoint)}const bs=.999999999999,ws=1.0000000000001;function tc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(tt(t.x,-o.scroll.offset.x),tt(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Pr(t,r)),s&&ut(o.latestValues)&&ie(t,o.latestValues,o.layout?.layoutBox))}e.x<ws&&e.x>bs&&(e.x=1),e.y<ws&&e.y>bs&&(e.y=1)}function tt(t,e){t.min+=e,t.max+=e}function Ss(t,e,n,s,i=.5){const o=j(t.min,t.max,i);rn(t,e,n,o,s)}function Ts(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function ie(t,e,n){const s=n??t;Ss(t.x,Ts(e.x,s.x),e.scaleX,e.scale,e.originX),Ss(t.y,Ts(e.y,s.y),e.scaleY,e.scale,e.originY)}function Cr(t,e){return Sr(Ql(t.getBoundingClientRect(),e))}function ec(t,e,n){const s=Cr(t,n),{scroll:i}=e;return i&&(tt(s.x,i.offset.x),tt(s.y,i.offset.y)),s}const nc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sc=Vt.length;function ic(t,e,n){let s="",i=!0;for(let o=0;o<sc;o++){const r=Vt[o],a=t[r];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);c=r.startsWith("scale")?u===1:u===0}if(!c||n){const u=fr(a,Mn[r]);if(!c){i=!1;const l=nc[r]||r;s+=`${l}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Ln(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const c in e){const u=e[c];if(Mt.has(c)){r=!0;continue}else if(Ni(c)){i[c]=u;continue}else{const l=fr(u,Mn[c]);c.startsWith("origin")?(a=!0,o[c]=l):s[c]=l}}if(e.transform||(r||n?s.transform=ic(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=o;s.transformOrigin=`${c} ${u} ${l}`}}function Ar(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function Ps(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const kt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Ps(t,e.target.x),s=Ps(t,e.target.y);return`${n}% ${s}%`}},rc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Z.parse(t);if(i.length>5)return s;const o=Z.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=c;const u=j(a,c,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},on={borderRadius:{...kt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:kt,borderTopRightRadius:kt,borderBottomLeftRadius:kt,borderBottomRightRadius:kt,boxShadow:rc};function Vr(t,{layout:e,layoutId:n}){return Mt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!on[t]||t==="opacity")}function Nn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(U(s[r])||i&&U(i[r])||Vr(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function oc(t){return window.getComputedStyle(t)}class ac extends wr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(e,n){if(Mt.has(n))return this.projection?.isProjecting?He(n):Va(e,n);{const s=oc(e),i=(Ni(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Cr(e,n)}build(e,n,s){Ln(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Nn(e,n,s)}}const lc={offset:"stroke-dashoffset",array:"stroke-dasharray"},cc={offset:"strokeDashoffset",array:"strokeDasharray"};function uc(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?lc:cc;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const dc=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Mr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},c,u,l){if(Ln(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h}=t;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=l?.transformBox??"fill-box",delete d.transformBox);for(const m of dc)d[m]!==void 0&&(h[m]=d[m],delete d[m]);e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&uc(d,i,o,r,!1)}const Dr=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"]),kr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function hc(t,e,n,s){Ar(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Dr.has(i)?i:Vn(i),e.attrs[i])}function Er(t,e,n){const s=Nn(t,e,n);for(const i in t)if(U(t[i])||U(e[i])){const o=Vt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class fc extends wr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Mt.has(n)){const s=ur(n);return s&&s.default||0}return n=Dr.has(n)?n:Vn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Er(e,n,s)}build(e,n,s){Mr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){hc(e,n,s,i)}mount(e){this.isSVGTag=kr(e.tagName),super.mount(e)}}const mc=Rn.length;function jr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<mc;n++){const s=Rn[n],i=t.props[s];(Ot(i)||i===!1)&&(e[s]=i)}return e}function Rr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const pc=[...jn].reverse(),gc=jn.length;function yc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ml(t,n,s)))}function xc(t){let e=yc(t),n=Cs(),s=!0,i=!1;const o=u=>(l,d)=>{const h=pt(t,d,u==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:m,transitionEnd:p,...y}=h;l={...l,...y,...p}}return l};function r(u){e=u(t)}function a(u){const{props:l}=t,d=jr(t.parent)||{},h=[],m=new Set;let p={},y=1/0;for(let v=0;v<gc;v++){const g=pc[v],w=n[g],S=l[g]!==void 0?l[g]:d[g],P=Ot(S),D=g===u?w.isActive:null;D===!1&&(y=v);let L=S===d[g]&&S!==l[g]&&P;if(L&&(s||i)&&t.manuallyAnimateOnMount&&(L=!1),w.protectedKeys={...p},!w.isActive&&D===null||!S&&!w.prevProp||xe(S)||typeof S=="boolean")continue;if(g==="exit"&&w.isActive&&D!==!0){w.prevResolvedValues&&(p={...p,...w.prevResolvedValues});continue}const A=vc(w.prevProp,S);let V=A||g===u&&w.isActive&&!L&&P||v>y&&P,C=!1;const E=Array.isArray(S)?S:[S];let B=E.reduce(o(g),{});D===!1&&(B={});const{prevResolvedValues:X={}}=w,M={...X,...B},I=O=>{V=!0,m.has(O)&&(C=!0,m.delete(O)),w.needsAnimating[O]=!0;const H=t.getValue(O);H&&(H.liveStyle=!1)};for(const O in M){const H=B[O],lt=X[O];if(p.hasOwnProperty(O))continue;let gt=!1;Ze(H)&&Ze(lt)?gt=!Rr(H,lt):gt=H!==lt,gt?H!=null?I(O):m.add(O):H!==void 0&&m.has(O)?I(O):w.protectedKeys[O]=!0}w.prevProp=S,w.prevResolvedValues=B,w.isActive&&(p={...p,...B}),(s||i)&&t.blockInitialAnimation&&(V=!1);const J=L&&A;V&&(!J||C)&&h.push(...E.map(O=>{const H={type:g};if(typeof O=="string"&&(s||i)&&!J&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,gt=pt(lt,O);if(lt.enteringChildren&&gt){const{delayChildren:so}=gt.transition||{};H.delay=er(lt.enteringChildren,t,so)}}return{animation:O,options:H}}))}if(m.size){const v={};if(typeof l.initial!="boolean"){const g=pt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);g&&g.transition&&(v.transition=g.transition)}m.forEach(g=>{const w=t.getBaseTarget(g),S=t.getValue(g);S&&(S.liveStyle=!0),v[g]=w??null}),h.push({animation:v})}let x=!!h.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(x=!1),s=!1,i=!1,x?e(h):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(u,l)),n[u].isActive=l;const d=a(u);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:c,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Cs(),i=!0}}}function vc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Rr(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cs(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function an(t,e){t.min=e.min,t.max=e.max}function Y(t,e){an(t.x,e.x),an(t.y,e.y)}function As(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Lr=1e-4,bc=1-Lr,wc=1+Lr,Nr=.01,Sc=0-Nr,Tc=0+Nr;function K(t){return t.max-t.min}function Pc(t,e,n){return Math.abs(t-e)<=n}function Vs(t,e,n,s=.5){t.origin=s,t.originPoint=j(e.min,e.max,t.origin),t.scale=K(n)/K(e),t.translate=j(n.min,n.max,t.origin)-t.originPoint,(t.scale>=bc&&t.scale<=wc||isNaN(t.scale))&&(t.scale=1),(t.translate>=Sc&&t.translate<=Tc||isNaN(t.translate))&&(t.translate=0)}function Nt(t,e,n,s){Vs(t.x,e.x,n.x,s?s.originX:void 0),Vs(t.y,e.y,n.y,s?s.originY:void 0)}function Ms(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+K(e)}function Cc(t,e,n,s){Ms(t.x,e.x,n.x,s?.x),Ms(t.y,e.y,n.y,s?.y)}function Ds(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+K(e)}function me(t,e,n,s){Ds(t.x,e.x,n.x,s?.x),Ds(t.y,e.y,n.y,s?.y)}function ks(t,e,n,s,i){return t-=e,t=fe(t,1/n,s),i!==void 0&&(t=fe(t,1/i,s)),t}function Ac(t,e=0,n=1,s=.5,i,o=t,r=t){if(et.test(e)&&(e=parseFloat(e),e=j(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=j(o.min,o.max,s);t===o&&(a-=e),t.min=ks(t.min,e,n,a,i),t.max=ks(t.max,e,n,a,i)}function Es(t,e,[n,s,i],o,r){Ac(t,e[n],e[s],e[i],e.scale,o,r)}const Vc=["x","scaleX","originX"],Mc=["y","scaleY","originY"];function js(t,e,n,s){Es(t.x,e,Vc,n?n.x:void 0,s?s.x:void 0),Es(t.y,e,Mc,n?n.y:void 0,s?s.y:void 0)}function Rs(t){return t.translate===0&&t.scale===1}function Br(t){return Rs(t.x)&&Rs(t.y)}function Ls(t,e){return t.min===e.min&&t.max===e.max}function Dc(t,e){return Ls(t.x,e.x)&&Ls(t.y,e.y)}function Ns(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ir(t,e){return Ns(t.x,e.x)&&Ns(t.y,e.y)}function Bs(t){return K(t.x)/K(t.y)}function Is(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Q(t){return[t("x"),t("y")]}function kc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:d,rotateY:h,skewX:m,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),d&&(s+=`rotateX(${d}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Fr=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Ec=Fr.length,Fs=t=>typeof t=="string"?parseFloat(t):t,Os=t=>typeof t=="number"||T.test(t);function jc(t,e,n,s,i,o){i?(t.opacity=j(0,n.opacity??1,Rc(s)),t.opacityExit=j(e.opacity??1,0,Lc(s))):o&&(t.opacity=j(e.opacity??1,n.opacity??1,s));for(let r=0;r<Ec;r++){const a=Fr[r];let c=zs(e,a),u=zs(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Os(c)===Os(u)?(t[a]=Math.max(j(Fs(c),Fs(u),s),0),(et.test(u)||et.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=j(e.rotate||0,n.rotate||0,s))}function zs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Rc=Or(0,.5,Di),Lc=Or(.5,.95,G);function Or(t,e,n){return s=>s<t?0:s>e?1:n(It(t,e,s))}function Nc(t,e,n){const s=U(t)?t:Ct(t);return s.start(Cn("",s,e,n)),s.animation}function zt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Bc=(t,e)=>t.depth-e.depth;class Ic{constructor(){this.children=[],this.isDirty=!1}add(e){hn(this.children,e),this.isDirty=!0}remove(e){ae(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bc),this.isDirty=!1,this.children.forEach(e)}}function Fc(t,e){const n=W.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(ot(s),t(o-e))};return k.setup(s,!0),()=>ot(s)}function re(t){return U(t)?t.get():t}class Oc{constructor(){this.members=[]}add(e){hn(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(ae(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(ae(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.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)}}const oe={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ke=["","X","Y","Z"],zc=1e3;let Uc=0;function Ee(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function zr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=or(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",k,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&zr(s)}function Ur({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach($c),this.nodes.forEach(qc),this.nodes.forEach(Zc),this.nodes.forEach(Hc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ic)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new mn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const c=this.eventHandlers.get(r);c&&c.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=En(r)&&!Kl(r),this.instance=r;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,d=0;const h=()=>this.root.updateBlockedByResize=!1;k.read(()=>{d=window.innerWidth}),t(r,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,l&&l(),l=Fc(h,250),oe.hasAnimatedSinceResize&&(oe.hasAnimatedSinceResize=!1,this.nodes.forEach(Ks)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||nu,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!Ir(this.targetLayout,m),g=!d&&h;if(this.options.layoutRoot||this.resumeFrom||g||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Pn(p,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,g)}else d||Ks(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ot(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(Jc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const d=this.path[l];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Gc),this.nodes.forEach(Us);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ws);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Xc),this.nodes.forEach(Yc),this.nodes.forEach(Wc),this.nodes.forEach(Kc)):this.nodes.forEach(Ws),this.clearAllSnapshots();const a=W.now();z.delta=nt(0,1e3/60,a-z.timestamp),z.timestamp=a,z.isProcessing=!0,Se.update.process(z),Se.preRender.process(z),Se.render.process(z),z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_c),this.sharedNodes.forEach(Qc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=F()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Br(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||ut(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return r&&(c=this.removeTransform(c)),su(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return F();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(iu))){const{scroll:u}=this.root;u&&(tt(a.x,u.offset.x),tt(a.y,u.offset.y))}return a}removeElementScroll(r){const a=F();if(Y(a,r),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:d}=u;u!==this.root&&l&&d.layoutScroll&&(l.wasRoot&&Y(a,r),tt(a.x,l.offset.x),tt(a.y,l.offset.y))}return a}applyTransform(r,a=!1,c){const u=c||F();Y(u,r);for(let l=0;l<this.path.length;l++){const d=this.path[l];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(tt(u.x,-d.scroll.offset.x),tt(u.y,-d.scroll.offset.y)),ut(d.latestValues)&&ie(u,d.latestValues,d.layout?.layoutBox)}return ut(this.latestValues)&&ie(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(r){const a=F();Y(a,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ut(u.latestValues))continue;let l;u.instance&&(sn(u.latestValues)&&u.updateSnapshot(),l=F(),Y(l,u.measurePageBox())),js(a,u.latestValues,u.snapshot?.layoutBox,l)}return ut(this.latestValues)&&js(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}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!==z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:d}=this.options;if(!this.layout||!(l||d))return;this.resolvedRelativeTargetAt=z.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cc(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Y(this.target,this.layout.layoutBox),Pr(this.target,this.targetDelta)):Y(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||sn(this.parent.latestValues)||Tr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,c){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),me(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Y(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===z.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;Y(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;tc(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=F());const{target:m}=r;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(As(this.prevProjectionDelta.x,this.projectionDelta.x),As(this.prevProjectionDelta.y,this.projectionDelta.y)),Nt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Is(this.projectionDelta.x,this.prevProjectionDelta.x)||!Is(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=St(),this.projectionDelta=St(),this.projectionDeltaWithTransform=St()}setAnimationOrigin(r,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},d=St();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=F(),m=c?c.source:void 0,p=this.layout?this.layout.source:void 0,y=m!==p,x=this.getStack(),v=!x||x.members.length<=1,g=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(eu));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const P=S/1e3;$s(d.x,r.x,P),$s(d.y,r.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(me(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tu(this.relativeTarget,this.relativeTargetOrigin,h,P),w&&Dc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=F()),Y(w,this.relativeTarget)),y&&(this.animationValues=l,jc(l,u,this.latestValues,P,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ot(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=k.update(()=>{oe.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ct(0)),this.motionValue.jump(0,!1),this.currentAnimation=Nc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=r;if(!(!a||!c||!u)){if(this!==r&&this.layout&&u&&Wr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||F();const d=K(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+d;const h=K(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+h}Y(a,c),ie(a,l),Nt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Oc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:c}=r;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&Ee("z",r,u,this.animationValues);for(let l=0;l<ke.length;l++)Ee(`rotate${ke[l]}`,r,u,this.animationValues),Ee(`skew${ke[l]}`,r,u,this.animationValues);r.render();for(const l in u)r.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=re(a?.pointerEvents)||"",r.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=re(a?.pointerEvents)||""),this.hasProjected&&!ut(this.latestValues)&&(r.transform=c?c({},""):"none",this.hasProjected=!1);return}r.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=kc(this.projectionDeltaWithTransform,this.treeScale,l);c&&(d=c(l,d)),r.transform=d;const{x:h,y:m}=this.projectionDelta;r.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?r.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:r.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in on){if(l[p]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:v}=on[p],g=d==="none"?l[p]:y(l[p],u);if(x){const w=x.length;for(let S=0;S<w;S++)r[x[S]]=g}else v?this.options.visualElement.renderState.vars[p]=g:r[p]=g}this.options.layoutId&&(r.pointerEvents=u===this?re(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Us),this.root.sharedNodes.clear()}}}function Wc(t){t.updateLayout()}function Kc(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Q(l=>{const d=o?e.measuredBox[l]:e.layoutBox[l],h=K(d);d.min=n[l].min,d.max=d.min+h});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";an(o?e.measuredBox[l]:e.layoutBox[l],n[l])}else Wr(i,e.layoutBox,n)&&Q(l=>{const d=o?e.measuredBox[l]:e.layoutBox[l],h=K(n[l]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+h)});const r=St();Nt(r,n,e.layoutBox);const a=St();o?Nt(a,t.applyTransform(s,!0),e.measuredBox):Nt(a,n,e.layoutBox);const c=!Br(r);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:d,layout:h}=l;if(d&&h){const m=t.options.layoutAnchor||void 0,p=F();me(p,e.layoutBox,d.layoutBox,m);const y=F();me(y,n,h.layoutBox,m),Ir(p,y)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=p,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function $c(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _c(t){t.clearSnapshot()}function Us(t){t.clearMeasurements()}function Gc(t){t.isLayoutDirty=!0,t.updateLayout()}function Ws(t){t.isLayoutDirty=!1}function Xc(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Yc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ks(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qc(t){t.resolveTargetDelta()}function Zc(t){t.calcProjection()}function Jc(t){t.resetSkewAndRotation()}function Qc(t){t.removeLeadSnapshot()}function $s(t,e,n){t.translate=j(e.translate,0,n),t.scale=j(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Hs(t,e,n,s){t.min=j(e.min,n.min,s),t.max=j(e.max,n.max,s)}function tu(t,e,n,s){Hs(t.x,e.x,n.x,s),Hs(t.y,e.y,n.y,s)}function eu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const nu={duration:.45,ease:[.4,0,.1,1]},_s=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gs=_s("applewebkit/")&&!_s("chrome/")?Math.round:G;function Xs(t){t.min=Gs(t.min),t.max=Gs(t.max)}function su(t){Xs(t.x),Xs(t.y)}function Wr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Pc(Bs(e),Bs(n),.2)}function iu(t){return t!==t.root&&t.scroll?.wasRoot}const ru=Ur({attachResizeListener:(t,e)=>zt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),je={current:void 0},Kr=Ur({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!je.current){const t=new ru({});t.mount(window),t.setOptions({layoutScroll:!0}),je.current=t}return je.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Bn=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ys(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ou(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Ys(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():Ys(t[i],null)}}}}function au(...t){return b.useCallback(ou(...t),t)}class lu extends b.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Qt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Qt(s)&&s.offsetWidth||0,o=Qt(s)&&s.offsetHeight||0,r=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(r.height),a.width=parseFloat(r.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=o-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function cu({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:o}){const r=b.useId(),a=b.useRef(null),c=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=b.useContext(Bn),l=t.props?.ref??t?.ref,d=au(a,l);return b.useInsertionEffect(()=>{const{width:h,height:m,top:p,left:y,right:x,bottom:v}=c.current;if(e||o===!1||!a.current||!h||!m)return;const g=n==="left"?`left: ${y}`:`right: ${x}`,w=s==="bottom"?`bottom: ${v}`:`top: ${p}`;a.current.dataset.motionPopId=r;const S=document.createElement("style");u&&(S.nonce=u);const P=i??document.head;return P.appendChild(S),S.sheet&&S.sheet.insertRule(`
1
+ import{j as f}from"./radix-ui-Zb8sVEtn.js";import{r as b}from"./react-vendor-CNOkPC89.js";import{bt as io,bu as ro,Y as we,a as pi,bv as oo,bi as On,bk as zn,d as yt,n as ao,c as Tt,L as xt,I as Un,r as Wn,s as Kn,t as $n,v as Hn,w as _n,aI as Gn,M as lo,N as co,O as uo}from"./index-EoKZSZjT.js";import{R as Dt,I as Zt,x as Et,ab as ho,_ as fo,ba as mo,w as gi,$ as po,a6 as go,e as yo,s as xo}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function vo(t,e){return{claude:{...t.claude,...e.claude},codex:{...t.codex,...e.codex}}}function bo(){const{state:t}=io(),e=ro(),n=b.useCallback(async()=>{try{e.setBrowserLoading(!0),e.setBrowserError(null);const o=await we.browser.get();e.setBrowserConfig(o.config),e.setBrowserStatus(o.status)}catch(o){e.setBrowserError(o.message)}finally{e.setBrowserLoading(!1),e.setBrowserStatusLoading(!1)}},[e]),s=b.useCallback(async()=>{try{e.setBrowserStatusLoading(!0),e.setBrowserError(null);const o=await we.browser.getStatus();return e.setBrowserStatus(o),o}catch(o){return e.setBrowserError(o.message),null}finally{e.setBrowserStatusLoading(!1)}},[e]),i=b.useCallback(async o=>{const r=t.browserConfig;if(!r)return!1;const a=vo(r,o);e.setBrowserConfig(a);try{e.setBrowserSaving(!0),e.setBrowserError(null);const c=await we.browser.update(o);return e.setBrowserConfig(c.browser.config),e.setBrowserStatus(c.browser.status),e.setBrowserSuccess(!0),window.setTimeout(()=>e.setBrowserSuccess(!1),1500),!0}catch(c){return e.setBrowserConfig(r),e.setBrowserError(c.message),!1}finally{e.setBrowserSaving(!1)}},[e,t.browserConfig]);return{config:t.browserConfig,status:t.browserStatus,loading:t.browserLoading,statusLoading:t.browserStatusLoading,saving:t.browserSaving,error:t.browserError,success:t.browserSuccess,fetchConfig:n,fetchStatus:s,saveConfig:i}}const un=b.createContext({});function dn(t){const e=b.useRef(null);return e.current===null&&(e.current=t()),e.current}const wo=typeof window<"u",yi=wo?b.useLayoutEffect:b.useEffect,ge=b.createContext(null);function hn(t,e){t.indexOf(e)===-1&&t.push(e)}function ae(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const nt=(t,e,n)=>n>e?e:n<t?t:n;let fn=()=>{};const rt={},xi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function vi(t){return typeof t=="object"&&t!==null}const bi=t=>/^0[^.\s]+$/u.test(t);function wi(t){let e;return()=>(e===void 0&&(e=t()),e)}const G=t=>t,So=(t,e)=>n=>e(t(n)),Ut=(...t)=>t.reduce(So),It=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class mn{constructor(){this.subscriptions=[]}add(e){return hn(this.subscriptions,e),()=>ae(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $=t=>t*1e3,_=t=>t/1e3;function Si(t,e){return e?t*(1e3/e):0}const Ti=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,To=1e-7,Po=12;function Co(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Ti(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>To&&++a<Po);return r}function Wt(t,e,n,s){if(t===e&&n===s)return G;const i=o=>Co(o,0,1,t,n);return o=>o===0||o===1?o:Ti(i(o),e,s)}const Pi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ci=t=>e=>1-t(1-e),Ai=Wt(.33,1.53,.69,.99),pn=Ci(Ai),Vi=Pi(pn),Mi=t=>t>=1?1:(t*=2)<1?.5*pn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),Di=Ci(gn),ki=Pi(gn),Ao=Wt(.42,0,1,1),Vo=Wt(0,0,.58,1),Ei=Wt(.42,0,.58,1),Mo=t=>Array.isArray(t)&&typeof t[0]!="number",ji=t=>Array.isArray(t)&&typeof t[0]=="number",Do={linear:G,easeIn:Ao,easeInOut:Ei,easeOut:Vo,circIn:gn,circInOut:ki,circOut:Di,backIn:pn,backInOut:Vi,backOut:Ai,anticipate:Mi},ko=t=>typeof t=="string",Xn=t=>{if(ji(t)){fn(t.length===4);const[e,n,s,i]=t;return Wt(e,n,s,i)}else if(ko(t))return Do[t];return t},Ht=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Eo(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){r.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,d=!1,h=!1)=>{const p=h&&i?n:s;return d&&r.add(l),p.add(l),l},cancel:l=>{s.delete(l),r.delete(l)},process:l=>{if(a=l,i){o=!0;return}i=!0;const d=n;n=s,s=d,n.forEach(c),n.clear(),i=!1,o&&(o=!1,u.process(l))}};return u}const jo=40;function Ri(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ht.reduce((w,S)=>(w[S]=Eo(o),w),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:d,preRender:h,render:m,postRender:p}=r,y=()=>{const w=rt.useManualTiming,S=w?i.timestamp:performance.now();n=!1,w||(i.delta=s?1e3/60:Math.max(Math.min(S-i.timestamp,jo),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),d.process(i),h.process(i),m.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},x=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Ht.reduce((w,S)=>{const P=r[S];return w[S]=(D,L=!1,A=!1)=>(n||x(),P.schedule(D,L,A)),w},{}),cancel:w=>{for(let S=0;S<Ht.length;S++)r[Ht[S]].cancel(w)},state:i,steps:r}}const{schedule:k,cancel:ot,state:z,steps:Se}=Ri(typeof requestAnimationFrame<"u"?requestAnimationFrame:G,!0);let Jt;function Ro(){Jt=void 0}const W={now:()=>(Jt===void 0&&W.set(z.isProcessing||rt.useManualTiming?z.timestamp:performance.now()),Jt),set:t=>{Jt=t,queueMicrotask(Ro)}},Li=t=>e=>typeof e=="string"&&e.startsWith(t),Ni=Li("--"),Lo=Li("var(--"),yn=t=>Lo(t)?No.test(t.split("/*")[0].trim()):!1,No=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const At={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft={...At,transform:t=>nt(0,1,t)},_t={...At,default:1},Rt=t=>Math.round(t*1e5)/1e5,xn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Bo(t){return t==null}const Io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vn=(t,e)=>n=>!!(typeof n=="string"&&Io.test(n)&&n.startsWith(t)||e&&!Bo(n)&&Object.prototype.hasOwnProperty.call(n,e)),Bi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(xn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Fo=t=>nt(0,255,t),Te={...At,transform:t=>Math.round(Fo(t))},ht={test:vn("rgb","red"),parse:Bi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Te.transform(t)+", "+Te.transform(e)+", "+Te.transform(n)+", "+Rt(Ft.transform(s))+")"};function Oo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Oe={test:vn("#"),parse:Oo,transform:ht.transform},Kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Kt("deg"),et=Kt("%"),T=Kt("px"),zo=Kt("vh"),Uo=Kt("vw"),qn={...et,parse:t=>et.parse(t)/100,transform:t=>et.transform(t*100)},bt={test:vn("hsl","hue"),parse:Bi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+et.transform(Rt(e))+", "+et.transform(Rt(n))+", "+Rt(Ft.transform(s))+")"},N={test:t=>ht.test(t)||Oe.test(t)||bt.test(t),parse:t=>ht.test(t)?ht.parse(t):bt.test(t)?bt.parse(t):Oe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):bt.transform(t),getAnimatableNone:t=>{const e=N.parse(t);return e.alpha=0,N.transform(e)}},Wo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ko(t){return isNaN(t)&&typeof t=="string"&&(t.match(xn)?.length||0)+(t.match(Wo)?.length||0)>0}const Ii="number",Fi="color",$o="var",Ho="var(",Zn="${}",_o=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(_o,c=>(N.test(c)?(s.color.push(o),i.push(Fi),n.push(N.parse(c))):c.startsWith(Ho)?(s.var.push(o),i.push($o),n.push(c)):(s.number.push(o),i.push(Ii),n.push(parseFloat(c))),++o,Zn)).split(Zn);return{values:n,split:a,indexes:s,types:i}}function Go(t){return Pt(t).values}function Oi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let o=0;o<n;o++)if(i+=t[o],s[o]!==void 0){const r=e[o];r===Ii?i+=Rt(s[o]):r===Fi?i+=N.transform(s[o]):i+=s[o]}return i}}function Xo(t){return Oi(Pt(t))}const Yo=t=>typeof t=="number"?0:N.test(t)?N.getAnimatableNone(t):t,qo=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:Yo(t);function Zo(t){const e=Pt(t);return Oi(e)(e.values.map((s,i)=>qo(s,e.split[i])))}const Z={test:Ko,parse:Go,createTransformer:Xo,getAnimatableNone:Zo};function Pe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Jo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Pe(c,a,t+1/3),o=Pe(c,a,t),r=Pe(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function le(t,e){return n=>n>0?e:t}const j=(t,e,n)=>t+(e-t)*n,Ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Qo=[Oe,ht,bt],ta=t=>Qo.find(e=>e.test(t));function Jn(t){const e=ta(t);if(!e)return!1;let n=e.parse(t);return e===bt&&(n=Jo(n)),n}const Qn=(t,e)=>{const n=Jn(t),s=Jn(e);if(!n||!s)return le(t,e);const i={...n};return o=>(i.red=Ce(n.red,s.red,o),i.green=Ce(n.green,s.green,o),i.blue=Ce(n.blue,s.blue,o),i.alpha=j(n.alpha,s.alpha,o),ht.transform(i))},ze=new Set(["none","hidden"]);function ea(t,e){return ze.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function na(t,e){return n=>j(t,e,n)}function bn(t){return typeof t=="number"?na:typeof t=="string"?yn(t)?le:N.test(t)?Qn:ra:Array.isArray(t)?zi:typeof t=="object"?N.test(t)?Qn:sa:le}function zi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>bn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function sa(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=bn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function ia(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const ra=(t,e)=>{const n=Z.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ze.has(t)&&!i.values.length||ze.has(e)&&!s.values.length?ea(t,e):Ut(zi(ia(s,i),i.values),n):le(t,e)};function Ui(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?j(t,e,n):bn(t)(t,e)}const oa=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>k.update(e,n),stop:()=>ot(e),now:()=>z.isProcessing?z.timestamp:W.now()}},Wi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ce=2e4;function wn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ce;)e+=n,s=t.next(e);return e>=ce?1/0:e}function aa(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(wn(s),ce);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:_(i)}}const R={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ue(t,e){return t*Math.sqrt(1-e*e)}const la=12;function ca(t,e,n){let s=n;for(let i=1;i<la;i++)s=s-t(s)/e(s);return s}const Ae=.001;function ua({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,o,r=1-e;r=nt(R.minDamping,R.maxDamping,r),t=nt(R.minDuration,R.maxDuration,_(t)),r<1?(i=u=>{const l=u*r,d=l*t,h=l-n,m=Ue(u,r),p=Math.exp(-d);return Ae-h/m*p},o=u=>{const d=u*r*t,h=d*n+n,m=Math.pow(r,2)*Math.pow(u,2)*t,p=Math.exp(-d),y=Ue(Math.pow(u,2),r);return(-i(u)+Ae>0?-1:1)*((h-m)*p)/y}):(i=u=>{const l=Math.exp(-u*t),d=(u-n)*t+1;return-Ae+l*d},o=u=>{const l=Math.exp(-u*t),d=(n-u)*(t*t);return l*d});const a=5/t,c=ca(i,o,a);if(t=$(t),isNaN(c))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const da=["duration","bounce"],ha=["stiffness","damping","mass"];function ts(t,e){return e.some(n=>t[n]!==void 0)}function fa(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!ts(t,ha)&&ts(t,da))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*nt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:o}}else{const n=ua({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function ue(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:u,mass:l,duration:d,velocity:h,isResolvedFromDuration:m}=fa({...n,velocity:-_(n.velocity||0)}),p=h||0,y=u/(2*Math.sqrt(c*l)),x=r-o,v=_(Math.sqrt(c/l)),g=Math.abs(x)<5;s||(s=g?R.restSpeed.granular:R.restSpeed.default),i||(i=g?R.restDelta.granular:R.restDelta.default);let w,S,P,D,L,A;if(y<1)P=Ue(v,y),D=(p+y*v*x)/P,w=C=>{const E=Math.exp(-y*v*C);return r-E*(D*Math.sin(P*C)+x*Math.cos(P*C))},L=y*v*D+x*P,A=y*v*x-D*P,S=C=>Math.exp(-y*v*C)*(L*Math.sin(P*C)+A*Math.cos(P*C));else if(y===1){w=E=>r-Math.exp(-v*E)*(x+(p+v*x)*E);const C=p+v*x;S=E=>Math.exp(-v*E)*(v*C*E-p)}else{const C=v*Math.sqrt(y*y-1);w=M=>{const I=Math.exp(-y*v*M),J=Math.min(C*M,300);return r-I*((p+y*v*x)*Math.sinh(J)+C*x*Math.cosh(J))/C};const E=(p+y*v*x)/C,B=y*v*E-x*C,X=y*v*x-E*C;S=M=>{const I=Math.exp(-y*v*M),J=Math.min(C*M,300);return I*(B*Math.sinh(J)+X*Math.cosh(J))}}const V={calculatedDuration:m&&d||null,velocity:C=>$(S(C)),next:C=>{if(!m&&y<1){const B=Math.exp(-y*v*C),X=Math.sin(P*C),M=Math.cos(P*C),I=r-B*(D*X+x*M),J=$(B*(L*X+A*M));return a.done=Math.abs(J)<=s&&Math.abs(r-I)<=i,a.value=a.done?r:I,a}const E=w(C);if(m)a.done=C>=d;else{const B=$(S(C));a.done=Math.abs(B)<=s&&Math.abs(r-E)<=i}return a.value=a.done?r:E,a},toString:()=>{const C=Math.min(wn(V),ce),E=Wi(B=>V.next(C*B).value,C,30);return C+"ms "+E},toTransition:()=>{}};return V}ue.applyToOptions=t=>{const e=aa(t,100,ue);return t.ease=e.ease,t.duration=$(e.duration),t.type="keyframes",t};const ma=5;function Ki(t,e,n){const s=Math.max(e-ma,0);return Si(n-t(s),e-s)}function We({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:u=.5,restSpeed:l}){const d=t[0],h={done:!1,value:d},m=A=>a!==void 0&&A<a||c!==void 0&&A>c,p=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let y=n*e;const x=d+y,v=r===void 0?x:r(x);v!==x&&(y=v-d);const g=A=>-y*Math.exp(-A/s),w=A=>v+g(A),S=A=>{const V=g(A),C=w(A);h.done=Math.abs(V)<=u,h.value=h.done?v:C};let P,D;const L=A=>{m(h.value)&&(P=A,D=ue({keyframes:[h.value,p(h.value)],velocity:Ki(w,A,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:l}))};return L(0),{calculatedDuration:null,next:A=>{let V=!1;return!D&&P===void 0&&(V=!0,S(A),L(A)),P!==void 0&&A>=P?D.next(A-P):(!V&&S(A),h)}}}function pa(t,e,n){const s=[],i=n||rt.mix||Ui,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const c=Array.isArray(e)?e[r]||G:e;a=Ut(c,a)}s.push(a)}return s}function ga(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(fn(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=pa(e,s,i),c=a.length,u=l=>{if(r&&l<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(l<t[d+1]);d++);const h=It(t[d],t[d+1],l);return a[d](h)};return n?l=>u(nt(t[0],t[o-1],l)):u}function ya(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=It(0,e,s);t.push(j(n,1,i))}}function xa(t){const e=[0];return ya(e,t.length-1),e}function va(t,e){return t.map(n=>n*e)}function ba(t,e){return t.map(()=>e||Ei).splice(0,t.length-1)}function Lt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Mo(s)?s.map(Xn):Xn(s),o={done:!1,value:e[0]},r=va(n&&n.length===e.length?n:xa(e),t),a=ga(r,e,{ease:Array.isArray(i)?i:ba(e,i)});return{calculatedDuration:t,next:c=>(o.value=a(c),o.done=c>=t,o)}}const wa=t=>t!==null;function ye(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(wa),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Sa={decay:We,inertia:We,tween:Lt,keyframes:Lt,spring:ue};function $i(t){typeof t.type=="string"&&(t.type=Sa[t.type])}class Sn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Ta=t=>t/100;class de extends Sn{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=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==W.now()&&this.tick(W.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;$i(e);const{type:n=Lt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const c=n||Lt;c!==Lt&&typeof a[0]!="number"&&(this.mixKeyframes=Ut(Ta,Ui(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=wn(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:d,repeatType:h,repeatDelay:m,type:p,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,S=s;if(d){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),C=A%1;!C&&A>=1&&(C=1),C===1&&V--,V=Math.min(V,d+1),!!(V%2)&&(h==="reverse"?(C=1-C,m&&(C-=m/a)):h==="mirror"&&(S=r)),w=nt(0,1,C)*a}let P;g?(this.delayState.value=l[0],P=this.delayState):P=S.next(w),o&&!g&&(P.value=o(P.value));let{done:D}=P;!g&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return L&&p!==We&&(P.value=ye(l,this.options,x,this.speed)),y&&y(P.value),L&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return _(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_(e)}get time(){return _(this.currentTime)}set time(e){e=$(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(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Ki(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(W.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=_(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=oa,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(W.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(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Pa(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,Ke=t=>{const e=ft(Math.atan2(t[1],t[0]));return $e(e)},Ca={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ke,rotateZ:Ke,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$e=t=>(t=t%360,t<0&&(t+=360),t),es=Ke,ns=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ss=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Aa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ns,scaleY:ss,scale:t=>(ns(t)+ss(t))/2,rotateX:t=>$e(ft(Math.atan2(t[6],t[5]))),rotateY:t=>$e(ft(Math.atan2(-t[2],t[0]))),rotateZ:es,rotate:es,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function _e(t,e){if(!t||t==="none")return He(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Aa,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ca,i=a}if(!i)return He(e);const o=s[e],r=i[1].split(",").map(Ma);return typeof o=="function"?o(r):r[o]}const Va=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return _e(n,e)};function Ma(t){return parseFloat(t.trim())}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mt=new Set(Vt),is=t=>t===At||t===T,Da=new Set(["x","y","z"]),ka=Vt.filter(t=>!Da.has(t));function Ea(t){const e=[];return ka.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>_e(e,"x"),y:(t,{transform:e})=>_e(e,"y")};it.translateX=it.x;it.translateY=it.y;const mt=new Set;let Ge=!1,Xe=!1,Ye=!1;function Hi(){if(Xe){const t=Array.from(mt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Ea(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Xe=!1,Ge=!1,mt.forEach(t=>t.complete(Ye)),mt.clear()}function _i(){mt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Xe=!0)})}function ja(){Ye=!0,_i(),Hi(),Ye=!1}class Tn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),Ge||(Ge=!0,k.read(_i),k.resolveKeyframes(Hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Pa(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ra=t=>t.startsWith("--");function Gi(t,e,n){Ra(e)?t.style.setProperty(e,n):t.style[e]=n}const La={};function Xi(t,e){const n=wi(t);return()=>La[e]??n()}const Na=Xi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Yi=Xi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,rs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function qi(t,e){if(t)return typeof t=="function"?Yi()?Wi(t,e):"ease-out":ji(t)?jt(t):Array.isArray(t)?t.map(n=>qi(n,e)||rs.easeOut):rs[t]}function Ba(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const d=qi(a,i);Array.isArray(d)&&(l.easing=d);const h={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(l,h)}function Zi(t){return typeof t=="function"&&"applyToOptions"in t}function Ia({type:t,...e}){return Zi(t)&&Yi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ji extends Sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,fn(typeof e.type!="string");const u=Ia(e);this.animation=Ba(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=ye(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Gi(n,s,l),this.animation.cancel()}c?.(),this.notifyFinished()}}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;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return _(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_(e)}get time(){return _(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=$(e),n&&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?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Na()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),G):i(this)}}const Qi={anticipate:Mi,backInOut:Vi,circInOut:ki};function Fa(t){return t in Qi}function Oa(t){typeof t.ease=="string"&&Fa(t.ease)&&(t.ease=Qi[t.ease])}const Ve=10;class za extends Ji{constructor(e){Oa(e),$i(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new de({...r,autoplay:!1}),c=Math.max(Ve,W.now()-this.startTime),u=nt(0,Ve,c-Ve),l=a.sample(c).value,{name:d}=this.options;o&&d&&Gi(o,d,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const os=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Z.test(t)||t==="0")&&!t.startsWith("url("));function Ua(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Wa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=os(i,e),a=os(o,e);return!r||!a?!1:Ua(t)||(n==="spring"||Zi(n))&&s}function qe(t){t.duration=0,t.type="keyframes"}const tr=new Set(["opacity","clipPath","filter","transform"]),Ka=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function $a(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Ka.test(t[e]))return!0;return!1}const Ha=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),_a=wi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ga(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return _a()&&n&&(tr.has(n)||Ha.has(n)&&$a(a))&&(n!=="transform"||!l)&&!u&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const Xa=40;class Ya extends Sn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:c,motionValue:u,element:l,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=W.now();const h={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:c,motionValue:u,element:l,...d},m=l?.KeyframeResolver||Tn;this.keyframeResolver=new m(a,(p,y,x)=>this.onKeyframesResolved(p,y,h,!x),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=W.now();let d=!0;Wa(e,o,r,a)||(d=!1,(rt.instantAnimations||!c)&&l?.(ye(e,s,n)),e[0]=e[e.length-1],qe(s),s.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Xa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=d&&!u&&Ga(m),y=m.motionValue?.owner?.current;let x;if(p)try{x=new za({...m,element:y})}catch{x=new de(m)}else x=new de(m);x.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ja()),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 er(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const qa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Za(t){const e=qa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function nr(t,e,n=1){const[s,i]=Za(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return xi(r)?parseFloat(r):r}return yn(i)?nr(i,e,n+1):i}const Ja={type:"spring",stiffness:500,damping:25,restSpeed:10},Qa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),tl={type:"keyframes",duration:.8},el={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nl=(t,{keyframes:e})=>e.length>2?tl:Mt.has(t)?t.startsWith("scale")?Qa(e[1]):Ja:el;function sr(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Pn(t,e){const n=t?.[e]??t?.default??t;return n!==t?sr(n,t):n}const sl=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function il(t){for(const e in t)if(!sl.has(e))return!0;return!1}const Cn=(t,e,n,s={},i,o)=>r=>{const a=Pn(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-$(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};il(a)||Object.assign(l,nl(t,l)),l.duration&&(l.duration=$(l.duration)),l.repeatDelay&&(l.repeatDelay=$(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let d=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(qe(l),l.delay===0&&(d=!0)),(rt.instantAnimations||rt.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,qe(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,d&&!o&&e.get()!==void 0){const h=ye(l.keyframes,a);if(h!==void 0){k.update(()=>{l.onUpdate(h),l.onComplete()});return}}return a.isSync?new de(l):new Ya(l)};function as(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function An(t,e,n,s){if(typeof e=="function"){const[i,o]=as(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=as(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function pt(t,e,n){const s=t.getProps();return An(s,e,n!==void 0?n:s.custom,t)}const ir=new Set(["width","height","top","left","right","bottom",...Vt]),ls=30,rl=t=>!isNaN(parseFloat(t));class ol{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=W.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=W.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=rl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new mn);const s=this.events[e].add(n);return e==="change"?()=>{s(),k.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ls)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ls);return Si(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ct(t,e){return new ol(t,e)}const Ze=t=>Array.isArray(t);function al(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ct(n))}function ll(t){return Ze(t)?t[t.length-1]||0:t}function cl(t,e){const n=pt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ll(o[r]);al(t,r,a)}}const U=t=>!!(t&&t.getVelocity);function ul(t){return!!(U(t)&&t.add)}function Je(t,e){const n=t.getValue("willChange");if(ul(n))return n.add(e);if(!n&&rt.WillChange){const s=new rt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Vn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const dl="framerAppearId",rr="data-"+Vn(dl);function or(t){return t.props[rr]}function hl({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ar(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o,transitionEnd:r,...a}=e;const c=t.getDefaultTransition();o=o?sr(o,c):c;const u=o?.reduceMotion;s&&(o=s);const l=[],d=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),p=a[h];if(p===void 0||d&&hl(d,h))continue;const y={delay:n,...Pn(o||{},h)},x=m.get();if(x!==void 0&&!m.isAnimating()&&!Array.isArray(p)&&p===x&&!y.velocity){k.update(()=>m.set(p));continue}let v=!1;if(window.MotionHandoffAnimation){const S=or(t);if(S){const P=window.MotionHandoffAnimation(S,h,k);P!==null&&(y.startTime=P,v=!0)}}Je(t,h);const g=u??t.shouldReduceMotion;m.start(Cn(h,m,p,g&&ir.has(h)?{type:!1}:y,t,v));const w=m.animation;w&&l.push(w)}if(r){const h=()=>k.update(()=>{r&&cl(t,r)});l.length?Promise.all(l).then(h):h()}return l}function Qe(t,e,n={}){const s=pt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(ar(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:d}=i;return fl(t,e,c,u,l,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function fl(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Qe(c,e,{...r,delay:n+(typeof s=="function"?0:s)+er(t.variantChildren,c,s,i,o)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function ml(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Qe(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Qe(t,e,n);else{const i=typeof e=="function"?pt(t,e,n.custom):e;s=Promise.all(ar(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const pl={test:t=>t==="auto",parse:t=>t},lr=t=>e=>e.test(t),cr=[At,T,et,st,Uo,zo,pl],cs=t=>cr.find(lr(t));function gl(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||bi(t):!0}const yl=new Set(["brightness","contrast","saturate","opacity"]);function xl(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(xn)||[];if(!s)return t;const i=n.replace(s,"");let o=yl.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const vl=/\b([a-z-]*)\(.*?\)/gu,tn={...Z,getAnimatableNone:t=>{const e=t.match(vl);return e?e.map(xl).join(" "):t}},en={...Z,getAnimatableNone:t=>{const e=Z.parse(t);return Z.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},us={...At,transform:Math.round},bl={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:_t,scaleX:_t,scaleY:_t,scaleZ:_t,skew:st,skewX:st,skewY:st,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ft,originX:qn,originY:qn,originZ:T},Mn={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...bl,zIndex:us,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:us},wl={...Mn,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:tn,WebkitFilter:tn,mask:en,WebkitMask:en},ur=t=>wl[t],Sl=new Set([tn,en]);function dr(t,e){let n=ur(t);return Sl.has(n)||(n=Z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Tl=new Set(["auto","none","0"]);function Pl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Tl.has(o)&&Pt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=dr(n,i)}class Cl extends Tn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let d=e[l];if(typeof d=="string"&&(d=d.trim(),yn(d))){const h=nr(d,n.current);h!==void 0&&(e[l]=h),l===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!ir.has(s)||e.length!==2)return;const[i,o]=e,r=cs(i),a=cs(o),c=Yn(i),u=Yn(o);if(c!==u&&it[s]){this.needsMeasurement=!0;return}if(r!==a)if(is(r)&&is(a))for(let l=0;l<e.length;l++){const d=e[l];typeof d=="string"&&(e[l]=parseFloat(d))}else it[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||gl(e[i]))&&s.push(i);s.length&&Pl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=it[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function hr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const fr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Qt(t){return vi(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Dn}=Ri(queueMicrotask,!1),q={x:!1,y:!1};function mr(){return q.x||q.y}function Al(t){return t==="x"||t==="y"?q[t]?null:(q[t]=!0,()=>{q[t]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function pr(t,e){const n=hr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Vl(t){return!(t.pointerType==="touch"||mr())}function Ml(t,e,n={}){const[s,i,o]=pr(t,n);return s.forEach(r=>{let a=!1,c=!1,u;const l=()=>{r.removeEventListener("pointerleave",p)},d=x=>{u&&(u(x),u=void 0),l()},h=x=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,d(x))},m=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},p=x=>{if(x.pointerType!=="touch"){if(a){c=!0;return}d(x)}},y=x=>{if(!Vl(x))return;c=!1;const v=e(r,x);typeof v=="function"&&(u=v,r.addEventListener("pointerleave",p,i))};r.addEventListener("pointerenter",y,i),r.addEventListener("pointerdown",m,i)}),o}const gr=(t,e)=>e?t===e?!0:gr(t,e.parentElement):!1,kn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Dl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kl(t){return Dl.has(t.tagName)||t.isContentEditable===!0}const El=new Set(["INPUT","SELECT","TEXTAREA"]);function jl(t){return El.has(t.tagName)||t.isContentEditable===!0}const te=new WeakSet;function ds(t){return e=>{e.key==="Enter"&&t(e)}}function Me(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Rl=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ds(()=>{if(te.has(n))return;Me(n,"down");const i=ds(()=>{Me(n,"up")}),o=()=>Me(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function hs(t){return kn(t)&&!mr()}const fs=new WeakSet;function Ll(t,e,n={}){const[s,i,o]=pr(t,n),r=a=>{const c=a.currentTarget;if(!hs(a)||fs.has(a))return;te.add(c),n.stopPropagation&&fs.add(a);const u=e(c,a),l=(m,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),te.has(c)&&te.delete(c),hs(m)&&typeof u=="function"&&u(m,{success:p})},d=m=>{l(m,c===window||c===document||n.useGlobalTarget||gr(c,m.target))},h=m=>{l(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Qt(a)&&(a.addEventListener("focus",u=>Rl(u,i)),!kl(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function En(t){return vi(t)&&"ownerSVGElement"in t}const ee=new WeakMap;let ne;const yr=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:En(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Nl=yr("inline","width","offsetWidth"),Bl=yr("block","height","offsetHeight");function Il({target:t,borderBoxSize:e}){ee.get(t)?.forEach(n=>{n(t,{get width(){return Nl(t,e)},get height(){return Bl(t,e)}})})}function Fl(t){t.forEach(Il)}function Ol(){typeof ResizeObserver>"u"||(ne=new ResizeObserver(Fl))}function zl(t,e){ne||Ol();const n=hr(t);return n.forEach(s=>{let i=ee.get(s);i||(i=new Set,ee.set(s,i)),i.add(e),ne?.observe(s)}),()=>{n.forEach(s=>{const i=ee.get(s);i?.delete(e),i?.size||ne?.unobserve(s)})}}const se=new Set;let wt;function Ul(){wt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};se.forEach(e=>e(t))},window.addEventListener("resize",wt)}function Wl(t){return se.add(t),wt||Ul(),()=>{se.delete(t),!se.size&&typeof wt=="function"&&(window.removeEventListener("resize",wt),wt=void 0)}}function ms(t,e){return typeof t=="function"?Wl(t):zl(t,e)}function Kl(t){return En(t)&&t.tagName==="svg"}const $l=[...cr,N,Z],Hl=t=>$l.find(lr(t)),ps=()=>({translate:0,scale:1,origin:0,originPoint:0}),St=()=>({x:ps(),y:ps()}),gs=()=>({min:0,max:0}),F=()=>({x:gs(),y:gs()}),_l=new WeakMap;function xe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ot(t){return typeof t=="string"||Array.isArray(t)}const jn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rn=["initial",...jn];function ve(t){return xe(t.animate)||Rn.some(e=>Ot(t[e]))}function xr(t){return!!(ve(t)||t.variants)}function Gl(t,e,n){for(const s in e){const i=e[s],o=n[s];if(U(i))t.addValue(s,i);else if(U(o))t.addValue(s,Ct(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,Ct(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const nn={current:null},vr={current:!1},Xl=typeof window<"u";function Yl(){if(vr.current=!0,!!Xl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>nn.current=t.matches;t.addEventListener("change",e),e()}else nn.current=!1}const ys=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let he={};function br(t){he=t}function ql(){return he}class Zl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},c={}){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=Tn,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=()=>{const m=W.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,k.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=c,this.blockInitialAnimation=!!r,this.isControllingVariants=ve(n),this.isVariantNode=xr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const p=h[m];u[m]!==void 0&&U(p)&&p.set(u[m])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,_l.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(vr.current||Yl(),this.shouldReduceMotion=nn.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(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&tr.has(e)&&this.current instanceof HTMLElement){const{factory:r,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,d=new Ji({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:$(l)}),h=r(d);this.valueSubscriptions.set(e,()=>{h(),d.cancel()});return}const s=Mt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&k.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in he){const n=he[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ys.length;s++){const i=ys[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Gl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Ct(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(xi(s)||bi(s))?s=parseFloat(s):!Hl(s)&&Z.test(n)&&(s=dr(e,n)),this.setBaseTarget(e,U(s)?s.get():s)),U(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=An(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!U(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new mn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Dn.render(this.render)}}class wr extends Zl{constructor(){super(...arguments),this.KeyframeResolver=Cl}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;U(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Sr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Jl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ql(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function De(t){return t===void 0||t===1}function sn({scale:t,scaleX:e,scaleY:n}){return!De(t)||!De(e)||!De(n)}function ut(t){return sn(t)||Tr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Tr(t){return xs(t.x)||xs(t.y)}function xs(t){return t&&t!=="0%"}function fe(t,e,n){const s=t-n,i=e*s;return n+i}function vs(t,e,n,s,i){return i!==void 0&&(t=fe(t,i,s)),fe(t,n,s)+e}function rn(t,e=0,n=1,s,i){t.min=vs(t.min,e,n,s,i),t.max=vs(t.max,e,n,s,i)}function Pr(t,{x:e,y:n}){rn(t.x,e.translate,e.scale,e.originPoint),rn(t.y,n.translate,n.scale,n.originPoint)}const bs=.999999999999,ws=1.0000000000001;function tc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(tt(t.x,-o.scroll.offset.x),tt(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Pr(t,r)),s&&ut(o.latestValues)&&ie(t,o.latestValues,o.layout?.layoutBox))}e.x<ws&&e.x>bs&&(e.x=1),e.y<ws&&e.y>bs&&(e.y=1)}function tt(t,e){t.min+=e,t.max+=e}function Ss(t,e,n,s,i=.5){const o=j(t.min,t.max,i);rn(t,e,n,o,s)}function Ts(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function ie(t,e,n){const s=n??t;Ss(t.x,Ts(e.x,s.x),e.scaleX,e.scale,e.originX),Ss(t.y,Ts(e.y,s.y),e.scaleY,e.scale,e.originY)}function Cr(t,e){return Sr(Ql(t.getBoundingClientRect(),e))}function ec(t,e,n){const s=Cr(t,n),{scroll:i}=e;return i&&(tt(s.x,i.offset.x),tt(s.y,i.offset.y)),s}const nc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sc=Vt.length;function ic(t,e,n){let s="",i=!0;for(let o=0;o<sc;o++){const r=Vt[o],a=t[r];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);c=r.startsWith("scale")?u===1:u===0}if(!c||n){const u=fr(a,Mn[r]);if(!c){i=!1;const l=nc[r]||r;s+=`${l}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Ln(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const c in e){const u=e[c];if(Mt.has(c)){r=!0;continue}else if(Ni(c)){i[c]=u;continue}else{const l=fr(u,Mn[c]);c.startsWith("origin")?(a=!0,o[c]=l):s[c]=l}}if(e.transform||(r||n?s.transform=ic(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=o;s.transformOrigin=`${c} ${u} ${l}`}}function Ar(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function Ps(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const kt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Ps(t,e.target.x),s=Ps(t,e.target.y);return`${n}% ${s}%`}},rc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Z.parse(t);if(i.length>5)return s;const o=Z.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=c;const u=j(a,c,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},on={borderRadius:{...kt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:kt,borderTopRightRadius:kt,borderBottomLeftRadius:kt,borderBottomRightRadius:kt,boxShadow:rc};function Vr(t,{layout:e,layoutId:n}){return Mt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!on[t]||t==="opacity")}function Nn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(U(s[r])||i&&U(i[r])||Vr(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function oc(t){return window.getComputedStyle(t)}class ac extends wr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(e,n){if(Mt.has(n))return this.projection?.isProjecting?He(n):Va(e,n);{const s=oc(e),i=(Ni(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Cr(e,n)}build(e,n,s){Ln(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Nn(e,n,s)}}const lc={offset:"stroke-dashoffset",array:"stroke-dasharray"},cc={offset:"strokeDashoffset",array:"strokeDasharray"};function uc(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?lc:cc;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const dc=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Mr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},c,u,l){if(Ln(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h}=t;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=l?.transformBox??"fill-box",delete d.transformBox);for(const m of dc)d[m]!==void 0&&(h[m]=d[m],delete d[m]);e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&uc(d,i,o,r,!1)}const Dr=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"]),kr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function hc(t,e,n,s){Ar(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Dr.has(i)?i:Vn(i),e.attrs[i])}function Er(t,e,n){const s=Nn(t,e,n);for(const i in t)if(U(t[i])||U(e[i])){const o=Vt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class fc extends wr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Mt.has(n)){const s=ur(n);return s&&s.default||0}return n=Dr.has(n)?n:Vn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Er(e,n,s)}build(e,n,s){Mr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){hc(e,n,s,i)}mount(e){this.isSVGTag=kr(e.tagName),super.mount(e)}}const mc=Rn.length;function jr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<mc;n++){const s=Rn[n],i=t.props[s];(Ot(i)||i===!1)&&(e[s]=i)}return e}function Rr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const pc=[...jn].reverse(),gc=jn.length;function yc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ml(t,n,s)))}function xc(t){let e=yc(t),n=Cs(),s=!0,i=!1;const o=u=>(l,d)=>{const h=pt(t,d,u==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:m,transitionEnd:p,...y}=h;l={...l,...y,...p}}return l};function r(u){e=u(t)}function a(u){const{props:l}=t,d=jr(t.parent)||{},h=[],m=new Set;let p={},y=1/0;for(let v=0;v<gc;v++){const g=pc[v],w=n[g],S=l[g]!==void 0?l[g]:d[g],P=Ot(S),D=g===u?w.isActive:null;D===!1&&(y=v);let L=S===d[g]&&S!==l[g]&&P;if(L&&(s||i)&&t.manuallyAnimateOnMount&&(L=!1),w.protectedKeys={...p},!w.isActive&&D===null||!S&&!w.prevProp||xe(S)||typeof S=="boolean")continue;if(g==="exit"&&w.isActive&&D!==!0){w.prevResolvedValues&&(p={...p,...w.prevResolvedValues});continue}const A=vc(w.prevProp,S);let V=A||g===u&&w.isActive&&!L&&P||v>y&&P,C=!1;const E=Array.isArray(S)?S:[S];let B=E.reduce(o(g),{});D===!1&&(B={});const{prevResolvedValues:X={}}=w,M={...X,...B},I=O=>{V=!0,m.has(O)&&(C=!0,m.delete(O)),w.needsAnimating[O]=!0;const H=t.getValue(O);H&&(H.liveStyle=!1)};for(const O in M){const H=B[O],lt=X[O];if(p.hasOwnProperty(O))continue;let gt=!1;Ze(H)&&Ze(lt)?gt=!Rr(H,lt):gt=H!==lt,gt?H!=null?I(O):m.add(O):H!==void 0&&m.has(O)?I(O):w.protectedKeys[O]=!0}w.prevProp=S,w.prevResolvedValues=B,w.isActive&&(p={...p,...B}),(s||i)&&t.blockInitialAnimation&&(V=!1);const J=L&&A;V&&(!J||C)&&h.push(...E.map(O=>{const H={type:g};if(typeof O=="string"&&(s||i)&&!J&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,gt=pt(lt,O);if(lt.enteringChildren&&gt){const{delayChildren:so}=gt.transition||{};H.delay=er(lt.enteringChildren,t,so)}}return{animation:O,options:H}}))}if(m.size){const v={};if(typeof l.initial!="boolean"){const g=pt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);g&&g.transition&&(v.transition=g.transition)}m.forEach(g=>{const w=t.getBaseTarget(g),S=t.getValue(g);S&&(S.liveStyle=!0),v[g]=w??null}),h.push({animation:v})}let x=!!h.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(x=!1),s=!1,i=!1,x?e(h):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(u,l)),n[u].isActive=l;const d=a(u);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:c,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Cs(),i=!0}}}function vc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Rr(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cs(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function an(t,e){t.min=e.min,t.max=e.max}function Y(t,e){an(t.x,e.x),an(t.y,e.y)}function As(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Lr=1e-4,bc=1-Lr,wc=1+Lr,Nr=.01,Sc=0-Nr,Tc=0+Nr;function K(t){return t.max-t.min}function Pc(t,e,n){return Math.abs(t-e)<=n}function Vs(t,e,n,s=.5){t.origin=s,t.originPoint=j(e.min,e.max,t.origin),t.scale=K(n)/K(e),t.translate=j(n.min,n.max,t.origin)-t.originPoint,(t.scale>=bc&&t.scale<=wc||isNaN(t.scale))&&(t.scale=1),(t.translate>=Sc&&t.translate<=Tc||isNaN(t.translate))&&(t.translate=0)}function Nt(t,e,n,s){Vs(t.x,e.x,n.x,s?s.originX:void 0),Vs(t.y,e.y,n.y,s?s.originY:void 0)}function Ms(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+K(e)}function Cc(t,e,n,s){Ms(t.x,e.x,n.x,s?.x),Ms(t.y,e.y,n.y,s?.y)}function Ds(t,e,n,s=0){const i=s?j(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+K(e)}function me(t,e,n,s){Ds(t.x,e.x,n.x,s?.x),Ds(t.y,e.y,n.y,s?.y)}function ks(t,e,n,s,i){return t-=e,t=fe(t,1/n,s),i!==void 0&&(t=fe(t,1/i,s)),t}function Ac(t,e=0,n=1,s=.5,i,o=t,r=t){if(et.test(e)&&(e=parseFloat(e),e=j(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=j(o.min,o.max,s);t===o&&(a-=e),t.min=ks(t.min,e,n,a,i),t.max=ks(t.max,e,n,a,i)}function Es(t,e,[n,s,i],o,r){Ac(t,e[n],e[s],e[i],e.scale,o,r)}const Vc=["x","scaleX","originX"],Mc=["y","scaleY","originY"];function js(t,e,n,s){Es(t.x,e,Vc,n?n.x:void 0,s?s.x:void 0),Es(t.y,e,Mc,n?n.y:void 0,s?s.y:void 0)}function Rs(t){return t.translate===0&&t.scale===1}function Br(t){return Rs(t.x)&&Rs(t.y)}function Ls(t,e){return t.min===e.min&&t.max===e.max}function Dc(t,e){return Ls(t.x,e.x)&&Ls(t.y,e.y)}function Ns(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ir(t,e){return Ns(t.x,e.x)&&Ns(t.y,e.y)}function Bs(t){return K(t.x)/K(t.y)}function Is(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Q(t){return[t("x"),t("y")]}function kc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:d,rotateY:h,skewX:m,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),d&&(s+=`rotateX(${d}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Fr=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Ec=Fr.length,Fs=t=>typeof t=="string"?parseFloat(t):t,Os=t=>typeof t=="number"||T.test(t);function jc(t,e,n,s,i,o){i?(t.opacity=j(0,n.opacity??1,Rc(s)),t.opacityExit=j(e.opacity??1,0,Lc(s))):o&&(t.opacity=j(e.opacity??1,n.opacity??1,s));for(let r=0;r<Ec;r++){const a=Fr[r];let c=zs(e,a),u=zs(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Os(c)===Os(u)?(t[a]=Math.max(j(Fs(c),Fs(u),s),0),(et.test(u)||et.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=j(e.rotate||0,n.rotate||0,s))}function zs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Rc=Or(0,.5,Di),Lc=Or(.5,.95,G);function Or(t,e,n){return s=>s<t?0:s>e?1:n(It(t,e,s))}function Nc(t,e,n){const s=U(t)?t:Ct(t);return s.start(Cn("",s,e,n)),s.animation}function zt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Bc=(t,e)=>t.depth-e.depth;class Ic{constructor(){this.children=[],this.isDirty=!1}add(e){hn(this.children,e),this.isDirty=!0}remove(e){ae(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bc),this.isDirty=!1,this.children.forEach(e)}}function Fc(t,e){const n=W.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(ot(s),t(o-e))};return k.setup(s,!0),()=>ot(s)}function re(t){return U(t)?t.get():t}class Oc{constructor(){this.members=[]}add(e){hn(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(ae(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(ae(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.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)}}const oe={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ke=["","X","Y","Z"],zc=1e3;let Uc=0;function Ee(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function zr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=or(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",k,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&zr(s)}function Ur({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach($c),this.nodes.forEach(qc),this.nodes.forEach(Zc),this.nodes.forEach(Hc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ic)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new mn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const c=this.eventHandlers.get(r);c&&c.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=En(r)&&!Kl(r),this.instance=r;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,d=0;const h=()=>this.root.updateBlockedByResize=!1;k.read(()=>{d=window.innerWidth}),t(r,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,l&&l(),l=Fc(h,250),oe.hasAnimatedSinceResize&&(oe.hasAnimatedSinceResize=!1,this.nodes.forEach(Ks)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||nu,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!Ir(this.targetLayout,m),g=!d&&h;if(this.options.layoutRoot||this.resumeFrom||g||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Pn(p,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,g)}else d||Ks(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ot(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(Jc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const d=this.path[l];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Gc),this.nodes.forEach(Us);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ws);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Xc),this.nodes.forEach(Yc),this.nodes.forEach(Wc),this.nodes.forEach(Kc)):this.nodes.forEach(Ws),this.clearAllSnapshots();const a=W.now();z.delta=nt(0,1e3/60,a-z.timestamp),z.timestamp=a,z.isProcessing=!0,Se.update.process(z),Se.preRender.process(z),Se.render.process(z),z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_c),this.sharedNodes.forEach(Qc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=F()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Br(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||ut(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return r&&(c=this.removeTransform(c)),su(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return F();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(iu))){const{scroll:u}=this.root;u&&(tt(a.x,u.offset.x),tt(a.y,u.offset.y))}return a}removeElementScroll(r){const a=F();if(Y(a,r),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:d}=u;u!==this.root&&l&&d.layoutScroll&&(l.wasRoot&&Y(a,r),tt(a.x,l.offset.x),tt(a.y,l.offset.y))}return a}applyTransform(r,a=!1,c){const u=c||F();Y(u,r);for(let l=0;l<this.path.length;l++){const d=this.path[l];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(tt(u.x,-d.scroll.offset.x),tt(u.y,-d.scroll.offset.y)),ut(d.latestValues)&&ie(u,d.latestValues,d.layout?.layoutBox)}return ut(this.latestValues)&&ie(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(r){const a=F();Y(a,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ut(u.latestValues))continue;let l;u.instance&&(sn(u.latestValues)&&u.updateSnapshot(),l=F(),Y(l,u.measurePageBox())),js(a,u.latestValues,u.snapshot?.layoutBox,l)}return ut(this.latestValues)&&js(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}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!==z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:d}=this.options;if(!this.layout||!(l||d))return;this.resolvedRelativeTargetAt=z.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cc(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Y(this.target,this.layout.layoutBox),Pr(this.target,this.targetDelta)):Y(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||sn(this.parent.latestValues)||Tr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,c){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),me(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Y(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===z.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;Y(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;tc(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=F());const{target:m}=r;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(As(this.prevProjectionDelta.x,this.projectionDelta.x),As(this.prevProjectionDelta.y,this.projectionDelta.y)),Nt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Is(this.projectionDelta.x,this.prevProjectionDelta.x)||!Is(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=St(),this.projectionDelta=St(),this.projectionDeltaWithTransform=St()}setAnimationOrigin(r,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},d=St();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=F(),m=c?c.source:void 0,p=this.layout?this.layout.source:void 0,y=m!==p,x=this.getStack(),v=!x||x.members.length<=1,g=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(eu));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const P=S/1e3;$s(d.x,r.x,P),$s(d.y,r.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(me(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tu(this.relativeTarget,this.relativeTargetOrigin,h,P),w&&Dc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=F()),Y(w,this.relativeTarget)),y&&(this.animationValues=l,jc(l,u,this.latestValues,P,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ot(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=k.update(()=>{oe.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ct(0)),this.motionValue.jump(0,!1),this.currentAnimation=Nc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=r;if(!(!a||!c||!u)){if(this!==r&&this.layout&&u&&Wr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||F();const d=K(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+d;const h=K(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+h}Y(a,c),ie(a,l),Nt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Oc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:c}=r;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&Ee("z",r,u,this.animationValues);for(let l=0;l<ke.length;l++)Ee(`rotate${ke[l]}`,r,u,this.animationValues),Ee(`skew${ke[l]}`,r,u,this.animationValues);r.render();for(const l in u)r.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=re(a?.pointerEvents)||"",r.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=re(a?.pointerEvents)||""),this.hasProjected&&!ut(this.latestValues)&&(r.transform=c?c({},""):"none",this.hasProjected=!1);return}r.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=kc(this.projectionDeltaWithTransform,this.treeScale,l);c&&(d=c(l,d)),r.transform=d;const{x:h,y:m}=this.projectionDelta;r.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?r.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:r.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in on){if(l[p]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:v}=on[p],g=d==="none"?l[p]:y(l[p],u);if(x){const w=x.length;for(let S=0;S<w;S++)r[x[S]]=g}else v?this.options.visualElement.renderState.vars[p]=g:r[p]=g}this.options.layoutId&&(r.pointerEvents=u===this?re(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Us),this.root.sharedNodes.clear()}}}function Wc(t){t.updateLayout()}function Kc(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Q(l=>{const d=o?e.measuredBox[l]:e.layoutBox[l],h=K(d);d.min=n[l].min,d.max=d.min+h});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";an(o?e.measuredBox[l]:e.layoutBox[l],n[l])}else Wr(i,e.layoutBox,n)&&Q(l=>{const d=o?e.measuredBox[l]:e.layoutBox[l],h=K(n[l]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+h)});const r=St();Nt(r,n,e.layoutBox);const a=St();o?Nt(a,t.applyTransform(s,!0),e.measuredBox):Nt(a,n,e.layoutBox);const c=!Br(r);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:d,layout:h}=l;if(d&&h){const m=t.options.layoutAnchor||void 0,p=F();me(p,e.layoutBox,d.layoutBox,m);const y=F();me(y,n,h.layoutBox,m),Ir(p,y)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=p,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function $c(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _c(t){t.clearSnapshot()}function Us(t){t.clearMeasurements()}function Gc(t){t.isLayoutDirty=!0,t.updateLayout()}function Ws(t){t.isLayoutDirty=!1}function Xc(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Yc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ks(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qc(t){t.resolveTargetDelta()}function Zc(t){t.calcProjection()}function Jc(t){t.resetSkewAndRotation()}function Qc(t){t.removeLeadSnapshot()}function $s(t,e,n){t.translate=j(e.translate,0,n),t.scale=j(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Hs(t,e,n,s){t.min=j(e.min,n.min,s),t.max=j(e.max,n.max,s)}function tu(t,e,n,s){Hs(t.x,e.x,n.x,s),Hs(t.y,e.y,n.y,s)}function eu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const nu={duration:.45,ease:[.4,0,.1,1]},_s=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gs=_s("applewebkit/")&&!_s("chrome/")?Math.round:G;function Xs(t){t.min=Gs(t.min),t.max=Gs(t.max)}function su(t){Xs(t.x),Xs(t.y)}function Wr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Pc(Bs(e),Bs(n),.2)}function iu(t){return t!==t.root&&t.scroll?.wasRoot}const ru=Ur({attachResizeListener:(t,e)=>zt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),je={current:void 0},Kr=Ur({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!je.current){const t=new ru({});t.mount(window),t.setOptions({layoutScroll:!0}),je.current=t}return je.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Bn=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ys(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ou(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Ys(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():Ys(t[i],null)}}}}function au(...t){return b.useCallback(ou(...t),t)}class lu extends b.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Qt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Qt(s)&&s.offsetWidth||0,o=Qt(s)&&s.offsetHeight||0,r=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(r.height),a.width=parseFloat(r.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=o-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function cu({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:o}){const r=b.useId(),a=b.useRef(null),c=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=b.useContext(Bn),l=t.props?.ref??t?.ref,d=au(a,l);return b.useInsertionEffect(()=>{const{width:h,height:m,top:p,left:y,right:x,bottom:v}=c.current;if(e||o===!1||!a.current||!h||!m)return;const g=n==="left"?`left: ${y}`:`right: ${x}`,w=s==="bottom"?`bottom: ${v}`:`top: ${p}`;a.current.dataset.motionPopId=r;const S=document.createElement("style");u&&(S.nonce=u);const P=i??document.head;return P.appendChild(S),S.sheet&&S.sheet.insertRule(`
2
2
  [data-motion-pop-id="${r}"] {
3
3
  position: absolute !important;
4
4
  width: ${h}px !important;
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as o}from"./react-vendor-CNOkPC89.js";import{a as q,bi as J,bk as X,d as I,n as Y,L as A,r as R,s as M,t as K,v as B,w as E,I as F,aI as Q}from"./index-DhAjOd4r.js";import{R as $,w as Z,x as ee,ad as se,_ as te,s as re}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const z={mode:"auto",tier_defaults:{opus:"high",sonnet:"medium",haiku:"low"},show_warnings:!0},U=1e4;function ie(){const[t,i]=o.useState(null),[b,d]=o.useState(!0),[_,N]=o.useState(!1),[p,g]=o.useState(null),[P,y]=o.useState(!1),f=o.useRef(void 0),w=o.useRef(!1),k=o.useCallback(async()=>{const r=new AbortController,c=setTimeout(()=>r.abort(),U);try{d(!0),g(null);const n=await fetch("/api/thinking",{signal:r.signal});if(clearTimeout(c),!n.ok)throw n.headers.get("content-type")?.includes("text/html")?new Error(`Server error (${n.status})`):new Error("Failed to load Thinking config");const m=await n.json();i(m.config||z),f.current=m.lastModified,w.current=!0}catch(n){clearTimeout(c),n.name==="AbortError"?g("Request timeout - please try again"):g(n.message)}finally{d(!1)}return()=>r.abort()},[]),l=o.useCallback(async r=>{if(!w.current||t===null){g("Cannot save settings before they load. Click Refresh and try again.");return}const c=t,n={...c,...r.mode!==void 0?{mode:r.mode}:{},...r.tier_defaults!==void 0?{tier_defaults:r.tier_defaults}:{},...r.show_warnings!==void 0?{show_warnings:r.show_warnings}:{}};r.clear_override||r.override===null?delete n.override:r.override!==void 0&&(n.override=r.override),r.clear_provider_overrides||r.provider_overrides===null?delete n.provider_overrides:r.provider_overrides!==void 0&&(n.provider_overrides=r.provider_overrides),i(n);const m=new AbortController,h=setTimeout(()=>m.abort(),U);try{N(!0),g(null);const x={...n,lastModified:f.current},u=await fetch("/api/thinking",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(clearTimeout(h),!u.ok){if(u.headers.get("content-type")?.includes("text/html"))throw new Error(`Server error (${u.status})`);const s=await u.json();throw u.status===409?new Error("Config changed by another session. Refreshing..."):new Error(s.error||"Failed to save")}const v=await u.json();i(v.config),f.current=v.lastModified,y(!0),setTimeout(()=>y(!1),1500)}catch(x){clearTimeout(h),i(c),x.name==="AbortError"?g("Request timeout - please try again"):(g(x.message),x.message.includes("another session")&&setTimeout(()=>k(),1e3))}finally{N(!1)}},[t,k]),T=o.useCallback(r=>{l({mode:r})},[l]),C=o.useCallback((r,c)=>{const n=t?.tier_defaults||z.tier_defaults;l({tier_defaults:{...n,[r]:c}})},[t,l]),O=o.useCallback(r=>{l({show_warnings:r})},[l]),D=o.useCallback(r=>{if(r===void 0){l({override:null,clear_override:!0});return}l({override:r,clear_override:!1})},[l]),L=o.useCallback((r,c,n)=>{const m=t?.provider_overrides||{},h=m[r]||{};if(n===void 0){const{[c]:x,...u}=h,v=Object.keys(u).length>0?u:void 0,{[r]:S,...s}=m,a=v?{...s,[r]:v}:s;l({provider_overrides:Object.keys(a).length>0?a:null,clear_provider_overrides:Object.keys(a).length===0})}else l({provider_overrides:{...m,[r]:{...h,[c]:n}},clear_provider_overrides:!1})},[t,l]);return{config:t||z,loading:b,saving:_,error:p,success:P,fetchConfig:k,saveConfig:l,setMode:T,setTierDefault:C,setShowWarnings:O,setOverride:D,setProviderOverride:L}}const H=[{value:"minimal",label:"Minimal (512 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (8K tokens)"},{value:"high",label:"High (24K tokens)"},{value:"xhigh",label:"Extra High (32K tokens)"},{value:"max",label:"Max (adaptive ceiling)"},{value:"auto",label:"Auto (dynamic)"}],ne=[{value:"__none__",label:"None (use CLI flags only)"},...H,{value:"__custom__",label:"Custom budget (number)"},{value:"off",label:"Off (disable thinking)"}],ae=["agy","gemini","codex"],G=0,V=1e5;function fe(){const{t}=q(),{config:i,loading:b,saving:d,error:_,success:N,fetchConfig:p,setMode:g,setTierDefault:P,setShowWarnings:y,setOverride:f,setProviderOverride:w}=ie(),[k,l]=o.useState(null),[T,C]=o.useState(""),[O,D]=o.useState([]),[L,r]=o.useState(null),c=o.useMemo(()=>Array.from(new Set([...ae,...Object.keys(i.provider_overrides??{}),...O])),[O,i.provider_overrides]),n=i.override===void 0?"__none__":typeof i.override=="number"||/^\d+$/.test(String(i.override))?"__custom__":String(i.override),m=typeof i.override=="number"||/^\d+$/.test(String(i.override??""))?String(i.override):"",h=L??m,x=Object.keys(i.provider_overrides??{}).length>0,u=k??x;o.useEffect(()=>{p()},[p]);const v=()=>{const s=T.trim().toLowerCase();s&&(c.includes(s)||D(a=>[...a,s]),C(""),l(!0))},S=()=>{const s=h.trim();if(!s){f(void 0);return}const a=Number.parseInt(s,10);Number.isNaN(a)||a<G||a>V||!/^\d+$/.test(s)||f(a)};return b?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx($,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:t("settings.loading")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${_||N?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[_&&e.jsx(J,{variant:"destructive",className:"py-2 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4"}),e.jsx(X,{children:_})]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:p,className:"h-7 px-2 text-xs border-destructive/50 hover:bg-destructive/10",children:[e.jsx($,{className:"w-3 h-3 mr-1"}),t("sharedPage.retry")]})]})}),N&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:t("settings.saved")})]})]}),e.jsx(Y,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.description")})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(te,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.supportedProviders")}),e.jsxs("ul",{className:"mt-1 space-y-0.5 text-blue-600 dark:text-blue-400",children:[e.jsxs("li",{children:[t("settingsThinking.supportLine1Prefix")," ",e.jsx("strong",{children:"agy"}),","," ",e.jsx("strong",{children:"gemini"})," ",t("settingsThinking.supportLine1Suffix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine2Prefix")," ",e.jsx("strong",{children:"codex"})," ",t("settingsThinking.supportLine2SuffixPrefix"),e.jsx("code",{children:"--effort"}),t("settingsThinking.supportLine2SuffixPostfix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine3Prefix")," ",e.jsx("code",{children:"-high"}),t("settingsThinking.supportLine3Suffix")]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.modeTitle")}),e.jsx("div",{className:"space-y-2",children:["auto","off","manual"].map(s=>e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg cursor-pointer transition-colors ${i.mode===s?"bg-primary/10 border border-primary/30":"bg-muted/50 hover:bg-muted/80"} ${d?"opacity-70 pointer-events-none":""}`,onClick:()=>{d||g(s)},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="auto"&&t("settingsThinking.modeAutoDesc"),s==="off"&&t("settingsThinking.modeOffDesc"),s==="manual"&&t("settingsThinking.modeManualDesc")]})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 ${i.mode===s?"bg-primary border-primary":"border-muted-foreground/50"}`})]},s))})]}),i.mode==="auto"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.tierDefaults")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.tierDefaultsDesc")}),e.jsx("div",{className:"space-y-3",children:["opus","sonnet","haiku"].map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"w-20 capitalize font-medium",children:s}),e.jsxs(R,{value:i.tier_defaults[s],onValueChange:a=>P(s,a),disabled:d,children:[e.jsx(M,{className:"flex-1",children:e.jsx(K,{})}),e.jsx(B,{children:H.map(a=>e.jsx(E,{value:a.value,children:a.label},a.value))})]})]},s))})]}),i.mode==="manual"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.persistentOverride")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.persistentOverrideDesc")}),e.jsxs(R,{value:n,onValueChange:s=>{if(s==="__none__"){f(void 0);return}if(s==="__custom__"){h||r("8192");return}r(null),f(s)},disabled:d,children:[e.jsx(M,{children:e.jsx(K,{})}),e.jsx(B,{children:ne.map(s=>e.jsx(E,{value:s.value,children:s.label},s.value))})]}),n==="__custom__"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{type:"number",min:G,max:V,value:h,onChange:s=>r(s.target.value),onBlur:S,disabled:d,placeholder:t("settingsThinking.enterCustomBudget")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:S,disabled:d,children:t("settingsThinking.apply")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Range: ",G," to ",V]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 text-base font-medium w-full text-left",onClick:()=>l(s=>!(s??x)),disabled:d,children:[e.jsx(re,{className:`w-4 h-4 transition-transform ${u?"rotate-0":"-rotate-90"}`}),t("settingsThinking.providerOverrides",{count:Object.keys(i.provider_overrides??{}).length})]}),u&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.providerOverridesDesc")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{value:T,onChange:s=>C(s.target.value),disabled:d,placeholder:t("settingsThinking.addProviderPlaceholder")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:v,disabled:d,children:t("settingsGlobalEnv.add")})]}),c.map(s=>e.jsxs("div",{className:"space-y-2 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"capitalize font-medium text-sm",children:s}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:["opus","sonnet","haiku"].map(a=>{const W=i.provider_overrides?.[s]?.[a]||"__default__";return e.jsxs("div",{className:"space-y-1",children:[e.jsx(A,{className:"text-xs text-muted-foreground capitalize",children:a}),e.jsxs(R,{value:W,onValueChange:j=>w(s,a,j==="__default__"?void 0:j),disabled:d,children:[e.jsx(M,{className:"h-8 text-xs",children:e.jsx(K,{})}),e.jsxs(B,{children:[e.jsx(E,{value:"__default__",children:t("cursorPage.default")}),H.map(j=>e.jsx(E,{value:j.value,children:j.label},j.value))]})]})]},a)})})]},s))]})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.showWarnings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.showWarningsDesc")})]}),e.jsx(Q,{checked:i.show_warnings??!0,onCheckedChange:y,disabled:d})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:t("settingsThinking.cliEnvOverride")}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Override per session with flags or"," ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"CCS_THINKING"})," env var. Priority: flag > env > config."]}),e.jsxs("div",{className:"space-y-1 text-sm font-mono text-muted-foreground",children:[e.jsx("p",{children:"ccs gemini --thinking high"}),e.jsx("p",{children:"ccs codex --effort xhigh"}),e.jsx("p",{children:'CCS_THINKING=high ccs codex "debug this"'}),e.jsx("p",{children:"ccs config thinking --mode auto"})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(I,{variant:"outline",size:"sm",onClick:p,disabled:b||d,className:"w-full",children:[e.jsx($,{className:`w-4 h-4 mr-2 ${b?"animate-spin":""}`}),t("settings.refresh")]})})]})}export{fe as default};
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as o}from"./react-vendor-CNOkPC89.js";import{a as q,bi as J,bk as X,d as I,n as Y,L as A,r as R,s as M,t as K,v as B,w as E,I as F,aI as Q}from"./index-EoKZSZjT.js";import{R as $,w as Z,x as ee,ad as se,_ as te,s as re}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const z={mode:"auto",tier_defaults:{opus:"high",sonnet:"medium",haiku:"low"},show_warnings:!0},U=1e4;function ie(){const[t,i]=o.useState(null),[b,d]=o.useState(!0),[_,N]=o.useState(!1),[p,g]=o.useState(null),[P,y]=o.useState(!1),f=o.useRef(void 0),w=o.useRef(!1),k=o.useCallback(async()=>{const r=new AbortController,c=setTimeout(()=>r.abort(),U);try{d(!0),g(null);const n=await fetch("/api/thinking",{signal:r.signal});if(clearTimeout(c),!n.ok)throw n.headers.get("content-type")?.includes("text/html")?new Error(`Server error (${n.status})`):new Error("Failed to load Thinking config");const m=await n.json();i(m.config||z),f.current=m.lastModified,w.current=!0}catch(n){clearTimeout(c),n.name==="AbortError"?g("Request timeout - please try again"):g(n.message)}finally{d(!1)}return()=>r.abort()},[]),l=o.useCallback(async r=>{if(!w.current||t===null){g("Cannot save settings before they load. Click Refresh and try again.");return}const c=t,n={...c,...r.mode!==void 0?{mode:r.mode}:{},...r.tier_defaults!==void 0?{tier_defaults:r.tier_defaults}:{},...r.show_warnings!==void 0?{show_warnings:r.show_warnings}:{}};r.clear_override||r.override===null?delete n.override:r.override!==void 0&&(n.override=r.override),r.clear_provider_overrides||r.provider_overrides===null?delete n.provider_overrides:r.provider_overrides!==void 0&&(n.provider_overrides=r.provider_overrides),i(n);const m=new AbortController,h=setTimeout(()=>m.abort(),U);try{N(!0),g(null);const x={...n,lastModified:f.current},u=await fetch("/api/thinking",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(clearTimeout(h),!u.ok){if(u.headers.get("content-type")?.includes("text/html"))throw new Error(`Server error (${u.status})`);const s=await u.json();throw u.status===409?new Error("Config changed by another session. Refreshing..."):new Error(s.error||"Failed to save")}const v=await u.json();i(v.config),f.current=v.lastModified,y(!0),setTimeout(()=>y(!1),1500)}catch(x){clearTimeout(h),i(c),x.name==="AbortError"?g("Request timeout - please try again"):(g(x.message),x.message.includes("another session")&&setTimeout(()=>k(),1e3))}finally{N(!1)}},[t,k]),T=o.useCallback(r=>{l({mode:r})},[l]),C=o.useCallback((r,c)=>{const n=t?.tier_defaults||z.tier_defaults;l({tier_defaults:{...n,[r]:c}})},[t,l]),O=o.useCallback(r=>{l({show_warnings:r})},[l]),D=o.useCallback(r=>{if(r===void 0){l({override:null,clear_override:!0});return}l({override:r,clear_override:!1})},[l]),L=o.useCallback((r,c,n)=>{const m=t?.provider_overrides||{},h=m[r]||{};if(n===void 0){const{[c]:x,...u}=h,v=Object.keys(u).length>0?u:void 0,{[r]:S,...s}=m,a=v?{...s,[r]:v}:s;l({provider_overrides:Object.keys(a).length>0?a:null,clear_provider_overrides:Object.keys(a).length===0})}else l({provider_overrides:{...m,[r]:{...h,[c]:n}},clear_provider_overrides:!1})},[t,l]);return{config:t||z,loading:b,saving:_,error:p,success:P,fetchConfig:k,saveConfig:l,setMode:T,setTierDefault:C,setShowWarnings:O,setOverride:D,setProviderOverride:L}}const H=[{value:"minimal",label:"Minimal (512 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (8K tokens)"},{value:"high",label:"High (24K tokens)"},{value:"xhigh",label:"Extra High (32K tokens)"},{value:"max",label:"Max (adaptive ceiling)"},{value:"auto",label:"Auto (dynamic)"}],ne=[{value:"__none__",label:"None (use CLI flags only)"},...H,{value:"__custom__",label:"Custom budget (number)"},{value:"off",label:"Off (disable thinking)"}],ae=["agy","gemini","codex"],G=0,V=1e5;function fe(){const{t}=q(),{config:i,loading:b,saving:d,error:_,success:N,fetchConfig:p,setMode:g,setTierDefault:P,setShowWarnings:y,setOverride:f,setProviderOverride:w}=ie(),[k,l]=o.useState(null),[T,C]=o.useState(""),[O,D]=o.useState([]),[L,r]=o.useState(null),c=o.useMemo(()=>Array.from(new Set([...ae,...Object.keys(i.provider_overrides??{}),...O])),[O,i.provider_overrides]),n=i.override===void 0?"__none__":typeof i.override=="number"||/^\d+$/.test(String(i.override))?"__custom__":String(i.override),m=typeof i.override=="number"||/^\d+$/.test(String(i.override??""))?String(i.override):"",h=L??m,x=Object.keys(i.provider_overrides??{}).length>0,u=k??x;o.useEffect(()=>{p()},[p]);const v=()=>{const s=T.trim().toLowerCase();s&&(c.includes(s)||D(a=>[...a,s]),C(""),l(!0))},S=()=>{const s=h.trim();if(!s){f(void 0);return}const a=Number.parseInt(s,10);Number.isNaN(a)||a<G||a>V||!/^\d+$/.test(s)||f(a)};return b?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx($,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:t("settings.loading")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${_||N?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[_&&e.jsx(J,{variant:"destructive",className:"py-2 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4"}),e.jsx(X,{children:_})]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:p,className:"h-7 px-2 text-xs border-destructive/50 hover:bg-destructive/10",children:[e.jsx($,{className:"w-3 h-3 mr-1"}),t("sharedPage.retry")]})]})}),N&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:t("settings.saved")})]})]}),e.jsx(Y,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.description")})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(te,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.supportedProviders")}),e.jsxs("ul",{className:"mt-1 space-y-0.5 text-blue-600 dark:text-blue-400",children:[e.jsxs("li",{children:[t("settingsThinking.supportLine1Prefix")," ",e.jsx("strong",{children:"agy"}),","," ",e.jsx("strong",{children:"gemini"})," ",t("settingsThinking.supportLine1Suffix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine2Prefix")," ",e.jsx("strong",{children:"codex"})," ",t("settingsThinking.supportLine2SuffixPrefix"),e.jsx("code",{children:"--effort"}),t("settingsThinking.supportLine2SuffixPostfix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine3Prefix")," ",e.jsx("code",{children:"-high"}),t("settingsThinking.supportLine3Suffix")]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.modeTitle")}),e.jsx("div",{className:"space-y-2",children:["auto","off","manual"].map(s=>e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg cursor-pointer transition-colors ${i.mode===s?"bg-primary/10 border border-primary/30":"bg-muted/50 hover:bg-muted/80"} ${d?"opacity-70 pointer-events-none":""}`,onClick:()=>{d||g(s)},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="auto"&&t("settingsThinking.modeAutoDesc"),s==="off"&&t("settingsThinking.modeOffDesc"),s==="manual"&&t("settingsThinking.modeManualDesc")]})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 ${i.mode===s?"bg-primary border-primary":"border-muted-foreground/50"}`})]},s))})]}),i.mode==="auto"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.tierDefaults")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.tierDefaultsDesc")}),e.jsx("div",{className:"space-y-3",children:["opus","sonnet","haiku"].map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"w-20 capitalize font-medium",children:s}),e.jsxs(R,{value:i.tier_defaults[s],onValueChange:a=>P(s,a),disabled:d,children:[e.jsx(M,{className:"flex-1",children:e.jsx(K,{})}),e.jsx(B,{children:H.map(a=>e.jsx(E,{value:a.value,children:a.label},a.value))})]})]},s))})]}),i.mode==="manual"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.persistentOverride")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.persistentOverrideDesc")}),e.jsxs(R,{value:n,onValueChange:s=>{if(s==="__none__"){f(void 0);return}if(s==="__custom__"){h||r("8192");return}r(null),f(s)},disabled:d,children:[e.jsx(M,{children:e.jsx(K,{})}),e.jsx(B,{children:ne.map(s=>e.jsx(E,{value:s.value,children:s.label},s.value))})]}),n==="__custom__"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{type:"number",min:G,max:V,value:h,onChange:s=>r(s.target.value),onBlur:S,disabled:d,placeholder:t("settingsThinking.enterCustomBudget")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:S,disabled:d,children:t("settingsThinking.apply")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Range: ",G," to ",V]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 text-base font-medium w-full text-left",onClick:()=>l(s=>!(s??x)),disabled:d,children:[e.jsx(re,{className:`w-4 h-4 transition-transform ${u?"rotate-0":"-rotate-90"}`}),t("settingsThinking.providerOverrides",{count:Object.keys(i.provider_overrides??{}).length})]}),u&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.providerOverridesDesc")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{value:T,onChange:s=>C(s.target.value),disabled:d,placeholder:t("settingsThinking.addProviderPlaceholder")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:v,disabled:d,children:t("settingsGlobalEnv.add")})]}),c.map(s=>e.jsxs("div",{className:"space-y-2 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"capitalize font-medium text-sm",children:s}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:["opus","sonnet","haiku"].map(a=>{const W=i.provider_overrides?.[s]?.[a]||"__default__";return e.jsxs("div",{className:"space-y-1",children:[e.jsx(A,{className:"text-xs text-muted-foreground capitalize",children:a}),e.jsxs(R,{value:W,onValueChange:j=>w(s,a,j==="__default__"?void 0:j),disabled:d,children:[e.jsx(M,{className:"h-8 text-xs",children:e.jsx(K,{})}),e.jsxs(B,{children:[e.jsx(E,{value:"__default__",children:t("cursorPage.default")}),H.map(j=>e.jsx(E,{value:j.value,children:j.label},j.value))]})]})]},a)})})]},s))]})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.showWarnings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.showWarningsDesc")})]}),e.jsx(Q,{checked:i.show_warnings??!0,onCheckedChange:y,disabled:d})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:t("settingsThinking.cliEnvOverride")}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Override per session with flags or"," ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"CCS_THINKING"})," env var. Priority: flag > env > config."]}),e.jsxs("div",{className:"space-y-1 text-sm font-mono text-muted-foreground",children:[e.jsx("p",{children:"ccs gemini --thinking high"}),e.jsx("p",{children:"ccs codex --effort xhigh"}),e.jsx("p",{children:'CCS_THINKING=high ccs codex "debug this"'}),e.jsx("p",{children:"ccs config thinking --mode auto"})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(I,{variant:"outline",size:"sm",onClick:p,disabled:b||d,className:"w-full",children:[e.jsx($,{className:`w-4 h-4 mr-2 ${b?"animate-spin":""}`}),t("settings.refresh")]})})]})}export{fe as default};