@antseed/gateway-console 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Activity-CoD1LZfl.js → Activity-BTHWjCfF.js} +1 -1
- package/dist/assets/{Audit-CNmmoaeN.js → Audit-DEeTafQK.js} +1 -1
- package/dist/assets/{ChainGate-CeDu6YYJ.js → ChainGate-BGzMcc9t.js} +1 -1
- package/dist/assets/{ChannelClose-C_SM1g28.js → ChannelClose-B6aqPNyc.js} +1 -1
- package/dist/assets/{Charts-Dm9j6cVy.js → Charts-BqpYsDwi.js} +1 -1
- package/dist/assets/{Chat-D1yVH5Y-.js → Chat-CoYr5t7Q.js} +3 -3
- package/dist/assets/{ConnectWallet-phY-Bf7w.js → ConnectWallet-BPEdComN.js} +1 -1
- package/dist/assets/{DataTable-D65CSQpj.js → DataTable-nSpXggux.js} +1 -1
- package/dist/assets/{Disclosure-DrGE-NkF.js → Disclosure-DaXKEWtB.js} +1 -1
- package/dist/assets/{KeyHolder-CmffMcZD.js → KeyHolder-DaUngSci.js} +1 -1
- package/dist/assets/{Keys-BovEuhch.js → Keys-BIlAH1SD.js} +1 -1
- package/dist/assets/{Logs-B-T-V-pM.js → Logs-D6o56kmk.js} +1 -1
- package/dist/assets/{Members-tWNaQdIJ.js → Members-33LlQeJ4.js} +1 -1
- package/dist/assets/{Migrate-IZJLx1xU.js → Migrate-LZPwWSjY.js} +1 -1
- package/dist/assets/Models-n5Y-SyjO.js +1 -0
- package/dist/assets/{OperatorActions-DfjEKPUD.js → OperatorActions-hBx0zsfp.js} +1 -1
- package/dist/assets/{OperatorGateAlert-Bq1ilVp6.js → OperatorGateAlert-BTIl2CQW.js} +1 -1
- package/dist/assets/{Overview-CAxieiTF.js → Overview-B3WLdQF3.js} +1 -1
- package/dist/assets/PeerPicker-BvexRNjB.js +1 -0
- package/dist/assets/{PolicyEditor-BLo1sheV.js → PolicyEditor-zST9UHdU.js} +1 -1
- package/dist/assets/{PolicyField-CNEZju4W.js → PolicyField-BL2_pz19.js} +1 -1
- package/dist/assets/{Presets-DBRoMTo4.js → Presets-CMVeG1hO.js} +2 -2
- package/dist/assets/Providers-CVteCWoy.js +1 -0
- package/dist/assets/RequestLog-DHFCVVlZ.js +1 -0
- package/dist/assets/{Rewards-CRiw-wXO.js → Rewards-D3Hh7Soh.js} +2 -2
- package/dist/assets/{RewardsClaim-D6P8go-K.js → RewardsClaim-D2E08Ty-.js} +1 -1
- package/dist/assets/{Routing-YpzgjNx_.js → Routing-DSRUEAFE.js} +1 -1
- package/dist/assets/{Segmented-YOSVapPh.js → Segmented-D-_FvNVa.js} +1 -1
- package/dist/assets/{SelectField-Cog9tKMb.js → SelectField-CL9GSHwf.js} +1 -1
- package/dist/assets/{Settings-CSXJvDLz.js → Settings-DvqGXXJg.js} +3 -3
- package/dist/assets/{Switch-CGhLd0Ay.js → Switch-C5_JEBYO.js} +1 -1
- package/dist/assets/{Tabs-DuL015VX.js → Tabs-iPKA2Kfx.js} +1 -1
- package/dist/assets/{TextAreaField-Cxpnr6YH.js → TextAreaField-BwxpmCEP.js} +1 -1
- package/dist/assets/{UsageByModel-5QuGhD1d.js → UsageByModel-CWVN_g_S.js} +1 -1
- package/dist/assets/{Wallet-BOMYI48H.js → Wallet-DUot1EZD.js} +4 -4
- package/dist/assets/{WalletConfirm-Dc0AMNYH.js → WalletConfirm-PHdM3GaV.js} +1 -1
- package/dist/assets/{WalletFunding-CsUmR_iR.js → WalletFunding-BsxwGyzf.js} +1 -1
- package/dist/assets/{WalletSignIn-_VjhsjCt.js → WalletSignIn-3MlBmMgW.js} +1 -1
- package/dist/assets/{Workspaces-Da-rLWlz.js → Workspaces-Cbcnklsg.js} +1 -1
- package/dist/assets/{add-Btpjkoo6.js → add-R0POQ3W1.js} +1 -1
- package/dist/assets/{all-wallets-BfrjmkEM.js → all-wallets-DVwWXGmT.js} +1 -1
- package/dist/assets/{app-store-CjAKxMNO.js → app-store-BiL_qTZd.js} +1 -1
- package/dist/assets/{apple-BcO7LcJZ.js → apple-_Y_Xx6lJ.js} +1 -1
- package/dist/assets/{arrow-bottom-DYhsTHhV.js → arrow-bottom-QxKexUBC.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-DH3-k8Pr.js → arrow-bottom-circle-C-fUzpyi.js} +1 -1
- package/dist/assets/{arrow-left-i-RgLGSY.js → arrow-left-B5dxgBhW.js} +1 -1
- package/dist/assets/{arrow-right-Byrj5OIH.js → arrow-right-B4qewp0i.js} +1 -1
- package/dist/assets/{arrow-top-BvEWR8S0.js → arrow-top-BKBiVc06.js} +1 -1
- package/dist/assets/{bank-CqGqrPxl.js → bank-FHD-xNqV.js} +1 -1
- package/dist/assets/{basic-DWDkRcdy.js → basic-BccV4Pg1.js} +1 -1
- package/dist/assets/{browser-CQNym1bY.js → browser-CLLI-CzN.js} +1 -1
- package/dist/assets/{bundle-full-C55tgBr2.js → bundle-full-C_dLAJOc.js} +1 -1
- package/dist/assets/{card-D2zVsWGG.js → card-NLpMEn-Z.js} +1 -1
- package/dist/assets/{ccip-2-SkbDQO.js → ccip-CRC4f413.js} +1 -1
- package/dist/assets/{checkmark-FRmQx2A8.js → checkmark-ChFh19kF.js} +1 -1
- package/dist/assets/{checkmark-bold-BQmDzpHv.js → checkmark-bold-CJoZ_Jrk.js} +1 -1
- package/dist/assets/{chevron-bottom-iNshLmUE.js → chevron-bottom-yTRY8YSB.js} +1 -1
- package/dist/assets/{chevron-left-DZ-hTSFy.js → chevron-left-DFmsJ_8-.js} +1 -1
- package/dist/assets/{chevron-right-ftn9B4r7.js → chevron-right-IFdWvKJ1.js} +1 -1
- package/dist/assets/{chevron-top-nKnnD3BB.js → chevron-top-Boye5Dtz.js} +1 -1
- package/dist/assets/{chrome-store-Jvo-YJCr.js → chrome-store-D8_25Dil.js} +1 -1
- package/dist/assets/{clock-J68M1oCn.js → clock-D9LUFCJ6.js} +1 -1
- package/dist/assets/{close-Bb5jO3su.js → close-C1PmyegA.js} +1 -1
- package/dist/assets/{code-block-6bmX2qDf.js → code-block-oleEXE1g.js} +1 -1
- package/dist/assets/{coinPlaceholder-BzR2PaE2.js → coinPlaceholder-DIV2a9lC.js} +1 -1
- package/dist/assets/{compass-_xiCm8H2.js → compass-CHoy_ibd.js} +1 -1
- package/dist/assets/{copy-Cn8HQUQ0.js → copy-CHW4cQpR.js} +1 -1
- package/dist/assets/{core-z96MxYDt.js → core-BTKMBBlw.js} +3 -3
- package/dist/assets/cursor-D7dlE2wt.js +3 -0
- package/dist/assets/{cursor-transparent-BtLB_SMp.js → cursor-transparent-C642YpxV.js} +1 -1
- package/dist/assets/{desktop-BbxKfMA_.js → desktop-CFX22rtl.js} +1 -1
- package/dist/assets/{disconnect-BLztvIUd.js → disconnect-D3FRtzUF.js} +1 -1
- package/dist/assets/{discord-CHUWozPc.js → discord-DVAbkC-9.js} +1 -1
- package/dist/assets/{en_US-Y4ZOVFV4-CAcvlKBB.js → en_US-Y4ZOVFV4-CkCCvmU2.js} +4 -4
- package/dist/assets/{etherscan-D5vLd5La.js → etherscan-CbJMIgqi.js} +1 -1
- package/dist/assets/{exclamation-triangle-qrQeSTv8.js → exclamation-triangle-Co4Jh1eh.js} +1 -1
- package/dist/assets/{extension-4gVUPN7H.js → extension-BDLbDfWs.js} +1 -1
- package/dist/assets/{external-link-B14WJWrF.js → external-link-zdLNy8XP.js} +1 -1
- package/dist/assets/{facebook-CIMBt82S.js → facebook-JC7OgGSS.js} +1 -1
- package/dist/assets/{farcaster-c2htRu7g.js → farcaster-Clihjnkd.js} +1 -1
- package/dist/assets/{filters-Bv71E2AR.js → filters-CUYKBCRj.js} +1 -1
- package/dist/assets/{github-UYR2U4eW.js → github-D6Beytth.js} +1 -1
- package/dist/assets/{google-n2NyY3Dw.js → google-BwFZTm-H.js} +1 -1
- package/dist/assets/{help-circle-BLFRE_d4.js → help-circle-bA9CuhxX.js} +1 -1
- package/dist/assets/{highlighted-body-KQOG7T2V-BPvcfizq.js → highlighted-body-KQOG7T2V-BhiY5JgE.js} +1 -1
- package/dist/assets/{id-Bx-RYygz.js → id-B1fJDhOC.js} +1 -1
- package/dist/assets/{image-BOkMzreg.js → image-Bs0ponob.js} +1 -1
- package/dist/assets/{index-DzFVk9QK.js → index-7LAxO3mh.js} +1 -1
- package/dist/assets/{index-BG30WuBG.js → index-CL8Uzy58.js} +5 -5
- package/dist/assets/{index-FSpcDkTF.js → index-DBg2OUwU.js} +3 -3
- package/dist/assets/{index-DUGIknuZ.js → index-DZnhs53K.js} +1 -1
- package/dist/assets/{index-RORHmLec.js → index-DeMxDxlw.js} +1 -1
- package/dist/assets/{index.es-CA2ape1X.js → index.es-BMcYAA4u.js} +4 -4
- package/dist/assets/{info-Cn0tJEtZ.js → info-Crty5prY.js} +1 -1
- package/dist/assets/{info-circle-Bu4Zfbo-.js → info-circle-bDiLcX0l.js} +1 -1
- package/dist/assets/{lightbulb-CEuGFxl3.js → lightbulb-wiOiTKWo.js} +1 -1
- package/dist/assets/{limits-Cv54gck6.js → limits-CLb8Vgob.js} +1 -1
- package/dist/assets/{mail-DTJ1wl6n.js → mail-Bpk1E7XK.js} +1 -1
- package/dist/assets/{mermaid-MCJ5UELQ-BedJEojm.js → mermaid-MCJ5UELQ-BGV7b3EX.js} +3 -3
- package/dist/assets/{metamask-sdk-CQV3kKmz.js → metamask-sdk-C52uEAVB.js} +1 -1
- package/dist/assets/{mobile-D5XkpStI.js → mobile-emFaTh5J.js} +1 -1
- package/dist/assets/models-BSFEBc_r.js +1 -0
- package/dist/assets/{more-DdrXAXX1.js → more-zpBj89SK.js} +1 -1
- package/dist/assets/{network-placeholder-DYxULQKf.js → network-placeholder-Ck50Grfu.js} +1 -1
- package/dist/assets/{nftPlaceholder-DNCBtU2V.js → nftPlaceholder-Du211GMR.js} +1 -1
- package/dist/assets/{off-x6tIm6IU.js → off-_wDqmoP5.js} +1 -1
- package/dist/assets/{play-store-DH_0xG8x.js → play-store-CnBTcLjB.js} +1 -1
- package/dist/assets/{plus-D6bTrOQ5.js → plus-Cb-EWMOz.js} +1 -1
- package/dist/assets/{qr-code-nZ-ywovk.js → qr-code-IAHrSZeD.js} +1 -1
- package/dist/assets/{recycle-horizontal-Dfef9bS8.js → recycle-horizontal-Dp5-d1QB.js} +1 -1
- package/dist/assets/{refresh-DjaTupr6.js → refresh-D-cPnY1R.js} +1 -1
- package/dist/assets/{reown-logo-8xfPxyEW.js → reown-logo-h7OXEqAA.js} +1 -1
- package/dist/assets/{search-CTyg9yLr.js → search-3DHLTaqT.js} +1 -1
- package/dist/assets/{secp256k1-C3GZOk0r.js → secp256k1-D_Ekx0rf.js} +1 -1
- package/dist/assets/{send-BRCwXyYl.js → send-B4rs7eAg.js} +1 -1
- package/dist/assets/{swapHorizontal-DQysA-xv.js → swapHorizontal-CvyPi1B5.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CfvpnhxX.js → swapHorizontalBold-08GsNiPL.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-Ei15IdQU.js → swapHorizontalMedium-BGToxjIs.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-BrdyV7V9.js → swapHorizontalRoundedBold-Brn-wznU.js} +1 -1
- package/dist/assets/{swapVertical-Chu7IZEN.js → swapVertical-DrQ-Bc70.js} +1 -1
- package/dist/assets/{telegram-WX2YRbPh.js → telegram-NopFeNMG.js} +1 -1
- package/dist/assets/{three-dots-DxlCOrsx.js → three-dots-DdTyzR9Y.js} +1 -1
- package/dist/assets/{twitch-DnDwl6Wp.js → twitch-CgscKAJj.js} +1 -1
- package/dist/assets/{twitterIcon-BRzgYnIv.js → twitterIcon-Dj2w3xJD.js} +1 -1
- package/dist/assets/{usage-CSmvbieU.js → usage-CVWdWZuC.js} +1 -1
- package/dist/assets/{useInfiniteQuery-Dd787Fyg.js → useInfiniteQuery-D6hnkAjP.js} +1 -1
- package/dist/assets/{useTx-BMOzJPjG.js → useTx-rdzQSfyH.js} +1 -1
- package/dist/assets/{verify-BDEQw6N7.js → verify-DYZt4X2T.js} +1 -1
- package/dist/assets/{verify-filled-4pi90YF-.js → verify-filled-CsYaVqHh.js} +1 -1
- package/dist/assets/{w3m-modal-0lsUnIxD.js → w3m-modal-DPin_wEK.js} +1 -1
- package/dist/assets/{wallet-Cdj3wKM9.js → wallet-BUXq0k4x.js} +1 -1
- package/dist/assets/{wallet-placeholder-9WrqEYA6.js → wallet-placeholder-BDl3Cn3J.js} +1 -1
- package/dist/assets/{walletconnect-Dxw2wfHl.js → walletconnect-B8r28svX.js} +1 -1
- package/dist/assets/{warning-circle-BS-8TEUR.js → warning-circle-CyUfdBFs.js} +1 -1
- package/dist/assets/{x-BuEdoHYI.js → x-DO-oPY_e.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Models-gJrRx-QV.js +0 -1
- package/dist/assets/PeerPicker-JK4q0ZO9.js +0 -1
- package/dist/assets/Providers-B3qO68z-.js +0 -1
- package/dist/assets/RequestLog-vl46fVIZ.js +0 -1
- package/dist/assets/cursor-AmgDWaYf.js +0 -3
- package/dist/assets/models-DMYWCgsM.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid-MCJ5UELQ-
|
|
2
|
-
var ca=e=>{throw TypeError(e)};var ua=(e,t,n)=>t.has(e)||ca("Cannot "+n);var te=(e,t,n)=>(ua(e,t,"read from private field"),n?n.call(e):t.get(e)),We=(e,t,n)=>t.has(e)?ca("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Se=(e,t,n,r)=>(ua(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{c3 as Em,r as m,ci as Xt,j as h,cj as ci,ck as km,cl as Cm,_ as Zc,v as Pm,u as Am,e as Dn,q as Ge,F as Im,i as Mm,bS as jm,cm as Rm,cn as Nm,t as Om,n as da,V as Dm,w as kn,a7 as io,a8 as ao,f as on,as as zm,g as $m,k as fa}from"./index-BG30WuBG.js";import{c as Bc}from"./clsx-B-dksMZM.js";function P(e,t,n){function r(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const a=i.prototype,d=Object.keys(a);for(let c=0;c<d.length;c++){const f=d[c];f in l||(l[f]=a[f].bind(l))}}const s=(n==null?void 0:n.Parent)??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(l){var u;const a=n!=null&&n.Parent?new o:this;r(a,l),(u=a._zod).deferred??(u.deferred=[]);for(const d of a._zod.deferred)d();return a}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:l=>{var u,a;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(a=(u=l==null?void 0:l._zod)==null?void 0:u.traits)==null?void 0:a.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class xn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Uc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Wc={};function _t(e){return Wc}function Gc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function lo(e,t){return typeof t=="bigint"?t.toString():t}function as(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ui(e){return e==null}function di(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Lm(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u!=null&&u[1]&&(s=Number.parseInt(u[1]))}const o=n>s?n:s,i=Number.parseInt(e.toFixed(o).replace(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return i%l/10**o}const pa=Symbol("evaluating");function J(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pa)return r===void 0&&(r=pa,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Qt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ha(e){return JSON.stringify(e)}function Fm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Kc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Vm=as(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Cn(e){if(Kn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Kn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function qc(e){return Cn(e)?{...e}:Array.isArray(e)?[...e]:e}const Zm=new Set(["string","number","symbol"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function D(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Bm(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Um={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Wm(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Pt(e._zod.def,{get shape(){const i={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(i[l]=n.shape[l])}return Qt(this,"shape",i),i},checks:[]});return At(e,o)}function Gm(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Pt(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete i[l]}return Qt(this,"shape",i),i},checks:[]});return At(e,o)}function Km(e,t){if(!Cn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Pt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Qt(this,"shape",o),o}});return At(e,s)}function qm(e,t){if(!Cn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Pt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Qt(this,"shape",r),r}});return At(e,n)}function Jm(e,t){const n=Pt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Qt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return At(e,n)}function Hm(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Pt(t._zod.def,{get shape(){const l=t._zod.def.shape,u={...l};if(n)for(const a in n){if(!(a in l))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(u[a]=e?new e({type:"optional",innerType:l[a]}):l[a])}else for(const a in l)u[a]=e?new e({type:"optional",innerType:l[a]}):l[a];return Qt(this,"shape",u),u},checks:[]});return At(t,i)}function Ym(e,t,n){const r=Pt(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return Qt(this,"shape",o),o}});return At(t,r)}function pn(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function hn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function hr(e){return typeof e=="string"?e:e==null?void 0:e.message}function Tt(e,t,n){var s,o,i,l,u,a;const r={...e,path:e.path??[]};if(!e.message){const d=hr((i=(o=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:i.call(o,e))??hr((l=t==null?void 0:t.error)==null?void 0:l.call(t,e))??hr((u=n.customError)==null?void 0:u.call(n,e))??hr((a=n.localeError)==null?void 0:a.call(n,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function fi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qn(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Jc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hc=P("$ZodError",Jc),Yc=P("$ZodError",Jc,{Parent:Error});function Xm(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Qm(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>r({issues:i}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let i=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(t(o))):i[u]=i[u]||{_errors:[]},i=i[u],l++}}};return r(e),n}const pi=e=>(t,n,r,s)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new xn;if(i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(u=>Tt(u,o,_t())));throw Kc(l,s==null?void 0:s.callee),l}return i.value},hi=e=>async(t,n,r,s)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(u=>Tt(u,o,_t())));throw Kc(l,s==null?void 0:s.callee),l}return i.value},ls=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new xn;return o.issues.length?{success:!1,error:new(e??Hc)(o.issues.map(i=>Tt(i,s,_t())))}:{success:!0,data:o.value}},eg=ls(Yc),cs=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>Tt(i,s,_t())))}:{success:!0,data:o.value}},tg=cs(Yc),ng=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pi(e)(t,n,s)},rg=e=>(t,n,r)=>pi(e)(t,n,r),sg=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hi(e)(t,n,s)},og=e=>async(t,n,r)=>hi(e)(t,n,r),ig=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ls(e)(t,n,s)},ag=e=>(t,n,r)=>ls(e)(t,n,r),lg=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return cs(e)(t,n,s)},cg=e=>async(t,n,r)=>cs(e)(t,n,r),ug=/^[cC][^\s-]{8,}$/,dg=/^[0-9a-z]+$/,fg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pg=/^[0-9a-vA-V]{20}$/,hg=/^[A-Za-z0-9]{27}$/,mg=/^[a-zA-Z0-9_-]{21}$/,gg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ma=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xg(){return new RegExp(bg,"u")}const wg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_g=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Tg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Eg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xc=/^[A-Za-z0-9_-]*$/,kg=/^\+[1-9]\d{6,14}$/,Qc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Cg=new RegExp(`^${Qc}$`);function eu(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Pg(e){return new RegExp(`^${eu(e)}$`)}function Ag(e){const t=eu({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Qc}T(?:${r})$`)}const Ig=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Mg=/^-?\d+$/,tu=/^-?\d+(?:\.\d+)?$/,jg=/^(?:true|false)$/i,Rg=/^null$/i,Ng=/^[^A-Z]*$/,Og=/^[^a-z]*$/,Re=P("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu={number:"number",bigint:"bigint",object:"date"},ru=P("$ZodCheckLessThan",(e,t)=>{Re.init(e,t);const n=nu[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),su=P("$ZodCheckGreaterThan",(e,t)=>{Re.init(e,t);const n=nu[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dg=P("$ZodCheckMultipleOf",(e,t)=>{Re.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Lm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),zg=P("$ZodCheckNumberFormat",(e,t)=>{var i;Re.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[s,o]=Um[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=s,u.maximum=o,n&&(u.pattern=Mg)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<s&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>o&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),$g=P("$ZodCheckMaxLength",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=fi(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Lg=P("$ZodCheckMinLength",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=fi(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Fg=P("$ZodCheckLengthEquals",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=fi(s),l=o>t.length;r.issues.push({origin:i,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),us=P("$ZodCheckStringFormat",(e,t)=>{var n,r;Re.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vg=P("$ZodCheckRegex",(e,t)=>{us.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Zg=P("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ng),us.init(e,t)}),Bg=P("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Og),us.init(e,t)}),Ug=P("$ZodCheckIncludes",(e,t)=>{Re.init(e,t);const n=Pn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Wg=P("$ZodCheckStartsWith",(e,t)=>{Re.init(e,t);const n=new RegExp(`^${Pn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Gg=P("$ZodCheckEndsWith",(e,t)=>{Re.init(e,t);const n=new RegExp(`.*${Pn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Kg=P("$ZodCheckOverwrite",(e,t)=>{Re.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class qg{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid-MCJ5UELQ-BGV7b3EX.js","assets/index-CL8Uzy58.js","assets/index-D8vXwUTI.css","assets/bundle-full-C_dLAJOc.js","assets/clsx-B-dksMZM.js","assets/code-block-oleEXE1g.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var ca=e=>{throw TypeError(e)};var ua=(e,t,n)=>t.has(e)||ca("Cannot "+n);var te=(e,t,n)=>(ua(e,t,"read from private field"),n?n.call(e):t.get(e)),We=(e,t,n)=>t.has(e)?ca("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Se=(e,t,n,r)=>(ua(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{c4 as Em,r as m,cj as Xt,j as h,ck as ci,cl as km,cm as Cm,_ as Zc,v as Pm,u as Am,e as Dn,q as Ge,F as Im,i as Mm,bT as jm,cn as Rm,co as Nm,t as Om,n as da,V as Dm,w as kn,a7 as io,a8 as ao,f as on,as as zm,g as $m,k as fa}from"./index-CL8Uzy58.js";import{c as Bc}from"./clsx-B-dksMZM.js";function P(e,t,n){function r(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const a=i.prototype,d=Object.keys(a);for(let c=0;c<d.length;c++){const f=d[c];f in l||(l[f]=a[f].bind(l))}}const s=(n==null?void 0:n.Parent)??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(l){var u;const a=n!=null&&n.Parent?new o:this;r(a,l),(u=a._zod).deferred??(u.deferred=[]);for(const d of a._zod.deferred)d();return a}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:l=>{var u,a;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(a=(u=l==null?void 0:l._zod)==null?void 0:u.traits)==null?void 0:a.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class xn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Uc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Wc={};function _t(e){return Wc}function Gc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function lo(e,t){return typeof t=="bigint"?t.toString():t}function as(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ui(e){return e==null}function di(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Lm(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u!=null&&u[1]&&(s=Number.parseInt(u[1]))}const o=n>s?n:s,i=Number.parseInt(e.toFixed(o).replace(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return i%l/10**o}const pa=Symbol("evaluating");function J(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pa)return r===void 0&&(r=pa,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Qt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ha(e){return JSON.stringify(e)}function Fm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Kc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Vm=as(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Cn(e){if(Kn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Kn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function qc(e){return Cn(e)?{...e}:Array.isArray(e)?[...e]:e}const Zm=new Set(["string","number","symbol"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function D(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Bm(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Um={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Wm(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Pt(e._zod.def,{get shape(){const i={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(i[l]=n.shape[l])}return Qt(this,"shape",i),i},checks:[]});return At(e,o)}function Gm(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Pt(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete i[l]}return Qt(this,"shape",i),i},checks:[]});return At(e,o)}function Km(e,t){if(!Cn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Pt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Qt(this,"shape",o),o}});return At(e,s)}function qm(e,t){if(!Cn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Pt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Qt(this,"shape",r),r}});return At(e,n)}function Jm(e,t){const n=Pt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Qt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return At(e,n)}function Hm(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Pt(t._zod.def,{get shape(){const l=t._zod.def.shape,u={...l};if(n)for(const a in n){if(!(a in l))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(u[a]=e?new e({type:"optional",innerType:l[a]}):l[a])}else for(const a in l)u[a]=e?new e({type:"optional",innerType:l[a]}):l[a];return Qt(this,"shape",u),u},checks:[]});return At(t,i)}function Ym(e,t,n){const r=Pt(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return Qt(this,"shape",o),o}});return At(t,r)}function pn(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function hn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function hr(e){return typeof e=="string"?e:e==null?void 0:e.message}function Tt(e,t,n){var s,o,i,l,u,a;const r={...e,path:e.path??[]};if(!e.message){const d=hr((i=(o=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:i.call(o,e))??hr((l=t==null?void 0:t.error)==null?void 0:l.call(t,e))??hr((u=n.customError)==null?void 0:u.call(n,e))??hr((a=n.localeError)==null?void 0:a.call(n,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function fi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qn(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Jc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hc=P("$ZodError",Jc),Yc=P("$ZodError",Jc,{Parent:Error});function Xm(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Qm(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>r({issues:i}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let i=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(t(o))):i[u]=i[u]||{_errors:[]},i=i[u],l++}}};return r(e),n}const pi=e=>(t,n,r,s)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new xn;if(i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(u=>Tt(u,o,_t())));throw Kc(l,s==null?void 0:s.callee),l}return i.value},hi=e=>async(t,n,r,s)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(u=>Tt(u,o,_t())));throw Kc(l,s==null?void 0:s.callee),l}return i.value},ls=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new xn;return o.issues.length?{success:!1,error:new(e??Hc)(o.issues.map(i=>Tt(i,s,_t())))}:{success:!0,data:o.value}},eg=ls(Yc),cs=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>Tt(i,s,_t())))}:{success:!0,data:o.value}},tg=cs(Yc),ng=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pi(e)(t,n,s)},rg=e=>(t,n,r)=>pi(e)(t,n,r),sg=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hi(e)(t,n,s)},og=e=>async(t,n,r)=>hi(e)(t,n,r),ig=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ls(e)(t,n,s)},ag=e=>(t,n,r)=>ls(e)(t,n,r),lg=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return cs(e)(t,n,s)},cg=e=>async(t,n,r)=>cs(e)(t,n,r),ug=/^[cC][^\s-]{8,}$/,dg=/^[0-9a-z]+$/,fg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pg=/^[0-9a-vA-V]{20}$/,hg=/^[A-Za-z0-9]{27}$/,mg=/^[a-zA-Z0-9_-]{21}$/,gg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ma=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xg(){return new RegExp(bg,"u")}const wg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_g=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Tg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Eg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xc=/^[A-Za-z0-9_-]*$/,kg=/^\+[1-9]\d{6,14}$/,Qc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Cg=new RegExp(`^${Qc}$`);function eu(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Pg(e){return new RegExp(`^${eu(e)}$`)}function Ag(e){const t=eu({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Qc}T(?:${r})$`)}const Ig=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Mg=/^-?\d+$/,tu=/^-?\d+(?:\.\d+)?$/,jg=/^(?:true|false)$/i,Rg=/^null$/i,Ng=/^[^A-Z]*$/,Og=/^[^a-z]*$/,Re=P("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu={number:"number",bigint:"bigint",object:"date"},ru=P("$ZodCheckLessThan",(e,t)=>{Re.init(e,t);const n=nu[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),su=P("$ZodCheckGreaterThan",(e,t)=>{Re.init(e,t);const n=nu[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dg=P("$ZodCheckMultipleOf",(e,t)=>{Re.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Lm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),zg=P("$ZodCheckNumberFormat",(e,t)=>{var i;Re.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[s,o]=Um[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=s,u.maximum=o,n&&(u.pattern=Mg)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<s&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>o&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),$g=P("$ZodCheckMaxLength",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=fi(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Lg=P("$ZodCheckMinLength",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=fi(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Fg=P("$ZodCheckLengthEquals",(e,t)=>{var n;Re.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ui(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=fi(s),l=o>t.length;r.issues.push({origin:i,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),us=P("$ZodCheckStringFormat",(e,t)=>{var n,r;Re.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vg=P("$ZodCheckRegex",(e,t)=>{us.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Zg=P("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ng),us.init(e,t)}),Bg=P("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Og),us.init(e,t)}),Ug=P("$ZodCheckIncludes",(e,t)=>{Re.init(e,t);const n=Pn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Wg=P("$ZodCheckStartsWith",(e,t)=>{Re.init(e,t);const n=new RegExp(`^${Pn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Gg=P("$ZodCheckEndsWith",(e,t)=>{Re.init(e,t);const n=new RegExp(`.*${Pn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Kg=P("$ZodCheckOverwrite",(e,t)=>{Re.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class qg{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
3
3
|
`).filter(i=>i),s=Math.min(...r.map(i=>i.length-i.trimStart().length)),o=r.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,n=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,s.join(`
|
|
4
4
|
`))}}const Jg={major:4,minor:3,patch:6},re=P("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jg;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const o=(l,u,a)=>{let d=pn(l),c;for(const f of u){if(f._zod.def.when){if(!f._zod.def.when(l))continue}else if(d)continue;const y=l.issues.length,v=f._zod.check(l);if(v instanceof Promise&&(a==null?void 0:a.async)===!1)throw new xn;if(c||v instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await v,l.issues.length!==y&&(d||(d=pn(l,y)))});else{if(l.issues.length===y)continue;d||(d=pn(l,y))}}return c?c.then(()=>l):l},i=(l,u,a)=>{if(pn(l))return l.aborted=!0,l;const d=o(u,r,a);if(d instanceof Promise){if(a.async===!1)throw new xn;return d.then(c=>e._zod.parse(c,a))}return e._zod.parse(d,a)};e._zod.run=(l,u)=>{if(u.skipChecks)return e._zod.parse(l,u);if(u.direction==="backward"){const d=e._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(c=>i(c,l,u)):i(d,l,u)}const a=e._zod.parse(l,u);if(a instanceof Promise){if(u.async===!1)throw new xn;return a.then(d=>o(d,r,u))}return o(a,r,u)}}J(e,"~standard",()=>({validate:o=>{var i;try{const l=eg(e,o);return l.success?{value:l.data}:{issues:(i=l.error)==null?void 0:i.issues}}catch{return tg(e,o).then(u=>{var a;return u.success?{value:u.data}:{issues:(a=u.error)==null?void 0:a.issues}})}},vendor:"zod",version:1}))}),mi=P("$ZodString",(e,t)=>{var n;re.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??Ig(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ie=P("$ZodStringFormat",(e,t)=>{us.init(e,t),mi.init(e,t)}),Hg=P("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yg),ie.init(e,t)}),Yg=P("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ma(r))}else t.pattern??(t.pattern=ma());ie.init(e,t)}),Xg=P("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vg),ie.init(e,t)}),Qg=P("$ZodURL",(e,t)=>{ie.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ey=P("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xg()),ie.init(e,t)}),ty=P("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=mg),ie.init(e,t)}),ny=P("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ug),ie.init(e,t)}),ry=P("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dg),ie.init(e,t)}),sy=P("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fg),ie.init(e,t)}),oy=P("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pg),ie.init(e,t)}),iy=P("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=hg),ie.init(e,t)}),ay=P("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ag(t)),ie.init(e,t)}),ly=P("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cg),ie.init(e,t)}),cy=P("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Pg(t)),ie.init(e,t)}),uy=P("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gg),ie.init(e,t)}),dy=P("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wg),ie.init(e,t),e._zod.bag.format="ipv4"}),fy=P("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Sg),ie.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),py=P("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_g),ie.init(e,t)}),hy=P("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Tg),ie.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,o]=r;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ou(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const my=P("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eg),ie.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ou(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function gy(e){if(!Xc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ou(n)}const yy=P("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xc),ie.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{gy(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),vy=P("$ZodE164",(e,t)=>{t.pattern??(t.pattern=kg),ie.init(e,t)});function by(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const xy=P("$ZodJWT",(e,t)=>{ie.init(e,t),e._zod.check=n=>{by(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),iu=P("$ZodNumber",(e,t)=>{re.init(e,t),e._zod.pattern=e._zod.bag.pattern??tu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),n}}),wy=P("$ZodNumberFormat",(e,t)=>{zg.init(e,t),iu.init(e,t)}),Sy=P("$ZodBoolean",(e,t)=>{re.init(e,t),e._zod.pattern=jg,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),_y=P("$ZodNull",(e,t)=>{re.init(e,t),e._zod.pattern=Rg,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),Ty=P("$ZodUnknown",(e,t)=>{re.init(e,t),e._zod.parse=n=>n}),Ey=P("$ZodNever",(e,t)=>{re.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function ga(e,t,n){e.issues.length&&t.issues.push(...hn(n,e.issues)),t.value[n]=e.value}const ky=P("$ZodArray",(e,t)=>{re.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const o=[];for(let i=0;i<s.length;i++){const l=s[i],u=t.element._zod.run({value:l,issues:[]},r);u instanceof Promise?o.push(u.then(a=>ga(a,n,i))):ga(u,n,i)}return o.length?Promise.all(o).then(()=>n):n}});function zr(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...hn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function au(e){var r,s,o,i;const t=Object.keys(e.shape);for(const l of t)if(!((i=(o=(s=(r=e.shape)==null?void 0:r[l])==null?void 0:s._zod)==null?void 0:o.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const n=Bm(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function lu(e,t,n,r,s,o){const i=[],l=s.keySet,u=s.catchall._zod,a=u.def.type,d=u.optout==="optional";for(const c in t){if(l.has(c))continue;if(a==="never"){i.push(c);continue}const f=u.run({value:t[c],issues:[]},r);f instanceof Promise?e.push(f.then(y=>zr(y,n,c,t,d))):zr(f,n,c,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const Cy=P("$ZodObject",(e,t)=>{re.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...l};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=as(()=>au(t));J(e._zod,"propValues",()=>{const l=t.shape,u={};for(const a in l){const d=l[a]._zod;if(d.values){u[a]??(u[a]=new Set);for(const c of d.values)u[a].add(c)}}return u});const s=Kn,o=t.catchall;let i;e._zod.parse=(l,u)=>{i??(i=r.value);const a=l.value;if(!s(a))return l.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),l;l.value={};const d=[],c=i.shape;for(const f of i.keys){const y=c[f],v=y._zod.optout==="optional",T=y._zod.run({value:a[f],issues:[]},u);T instanceof Promise?d.push(T.then(S=>zr(S,l,f,a,v))):zr(T,l,f,a,v)}return o?lu(d,a,l,u,r.value,e):d.length?Promise.all(d).then(()=>l):l}}),Py=P("$ZodObjectJIT",(e,t)=>{Cy.init(e,t);const n=e._zod.parse,r=as(()=>au(t)),s=f=>{var x;const y=new qg(["shape","payload","ctx"]),v=r.value,T=p=>{const b=ha(p);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};y.write("const input = payload.value;");const S=Object.create(null);let C=0;for(const p of v.keys)S[p]=`key_${C++}`;y.write("const newResult = {};");for(const p of v.keys){const b=S[p],w=ha(p),_=f[p],E=((x=_==null?void 0:_._zod)==null?void 0:x.optout)==="optional";y.write(`const ${b} = ${T(p)};`),E?y.write(`
|
|
5
5
|
if (${b}.issues.length) {
|
|
@@ -217,4 +217,4 @@ ${w}`,c++;break;case"id":w.includes("\0")||(a=w);break;case"retry":/^\d+$/.test(
|
|
|
217
217
|
*--------------------------------------------------------------------------------------------*/const rT={damping:.7,stiffness:.05,mass:1.25},sT=70,oT=1e3/60,iT=350;let gs=!1;var Lc;(Lc=globalThis.document)==null||Lc.addEventListener("mousedown",()=>{gs=!0});var Fc;(Fc=globalThis.document)==null||Fc.addEventListener("mouseup",()=>{gs=!1});var Vc;(Vc=globalThis.document)==null||Vc.addEventListener("click",()=>{gs=!1});const aT=(e={})=>{const[t,n]=m.useState(!1),[r,s]=m.useState(e.initial!==!1),[o,i]=m.useState(!1),l=m.useRef(null);l.current=e;const u=m.useCallback(()=>{var p;if(!gs)return!1;const k=window.getSelection();if(!k||!k.rangeCount)return!1;const x=k.getRangeAt(0);return x.commonAncestorContainer.contains(S.current)||((p=S.current)==null?void 0:p.contains(x.commonAncestorContainer))},[]),a=m.useCallback(k=>{c.isAtBottom=k,s(k)},[]),d=m.useCallback(k=>{c.escapedFromLock=k,n(k)},[]),c=m.useMemo(()=>{let k;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var x;return((x=S.current)==null?void 0:x.scrollTop)??0},set scrollTop(x){if(S.current){const{scrollBehavior:p}=getComputedStyle(S.current);p!=="auto"&&(S.current.style.scrollBehavior="auto"),S.current.scrollTop=x,c.ignoreScrollToTop=S.current.scrollTop,p!=="auto"&&(S.current.style.scrollBehavior=p)}},get targetScrollTop(){return!S.current||!C.current?0:S.current.scrollHeight-1-S.current.clientHeight},get calculatedTargetScrollTop(){if(!S.current||!C.current)return 0;const{targetScrollTop:x}=this;if(!e.targetScrollTop)return x;if((k==null?void 0:k.targetScrollTop)===x)return k.calculatedScrollTop;const p=Math.max(Math.min(e.targetScrollTop(x,{scrollElement:S.current,contentElement:C.current}),x),0);return k={targetScrollTop:x,calculatedScrollTop:p},requestAnimationFrame(()=>{k=void 0}),p},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=sT}}},[]),f=m.useCallback((k={})=>{var I;typeof k=="string"&&(k={animation:k}),k.preserveScrollPosition||a(!0);const x=Date.now()+(Number(k.wait)||0),p=$s(l.current,k.animation),{ignoreEscapes:b=!1}=k;let w,_=c.calculatedTargetScrollTop;k.duration instanceof Promise?k.duration.finally(()=>{w=Date.now()}):w=x+(k.duration??0);const E=async()=>{const z=new Promise(requestAnimationFrame).then(()=>{var W;if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:K}=c,L=performance.now(),Y=(L-(c.lastTick??L))/oT;if(c.animation||(c.animation={behavior:p,promise:z,ignoreEscapes:b}),c.animation.behavior===p&&(c.lastTick=L),u()||x>Date.now())return E();if(K<Math.min(_,c.calculatedTargetScrollTop)){if(((W=c.animation)==null?void 0:W.behavior)===p){if(p==="instant")return c.scrollTop=c.calculatedTargetScrollTop,E();c.velocity=(p.damping*c.velocity+p.stiffness*c.scrollDifference)/p.mass,c.accumulated+=c.velocity*Y,c.scrollTop+=c.accumulated,c.scrollTop!==K&&(c.accumulated=0)}return E()}return w>Date.now()?(_=c.calculatedTargetScrollTop,E()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?f({animation:$s(l.current,l.current.resize),ignoreEscapes:b,duration:Math.max(0,w-Date.now())||void 0}):c.isAtBottom)});return z.then(K=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),K))};return k.wait!==!0&&(c.animation=void 0),((I=c.animation)==null?void 0:I.behavior)===p?c.animation.promise:E()},[a,u,c]),y=m.useCallback(()=>{d(!0),a(!1)},[d,a]),v=m.useCallback(({target:k})=>{if(k!==S.current)return;const{scrollTop:x,ignoreScrollToTop:p}=c;let{lastScrollTop:b=x}=c;c.lastScrollTop=x,c.ignoreScrollToTop=void 0,p&&p>x&&(b=p),i(c.isNearBottom),setTimeout(()=>{var E;if(c.resizeDifference||x===p)return;if(u()){d(!0),a(!1);return}const w=x>b,_=x<b;if((E=c.animation)!=null&&E.ignoreEscapes){c.scrollTop=b;return}_&&(d(!0),a(!1)),w&&d(!1),!c.escapedFromLock&&c.isNearBottom&&a(!0)},1)},[d,a,u,c]),T=m.useCallback(({target:k,deltaY:x})=>{var b;let p=k;for(;!["scroll","auto"].includes(getComputedStyle(p).overflow);){if(!p.parentElement)return;p=p.parentElement}p===S.current&&x<0&&S.current.scrollHeight>S.current.clientHeight&&!((b=c.animation)!=null&&b.ignoreEscapes)&&(d(!0),a(!1))},[d,a,c]),S=dl(k=>{var x,p;(x=S.current)==null||x.removeEventListener("scroll",v),(p=S.current)==null||p.removeEventListener("wheel",T),k==null||k.addEventListener("scroll",v,{passive:!0}),k==null||k.addEventListener("wheel",T,{passive:!0})},[]),C=dl(k=>{var p,b;if((p=c.resizeObserver)==null||p.disconnect(),c.resizeObserver=void 0,!k)return;let x;c.resizeObserver=new ResizeObserver(([w])=>{const{height:_}=w.contentRect,E=_-(x??_);if(c.resizeDifference=E,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),i(c.isNearBottom),E>=0){const I=$s(l.current,x?l.current.resize:l.current.initial);f({animation:I,wait:!0,preserveScrollPosition:!0,duration:I==="instant"?void 0:iT})}else c.isNearBottom&&(d(!1),a(!0));x=_,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===E&&(c.resizeDifference=0)},1)})}),(b=c.resizeObserver)==null||b.observe(k)},[]);return{contentRef:C,scrollRef:S,scrollToBottom:f,stopScroll:y,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:c}};function dl(e,t){const n=m.useCallback(r=>(n.current=r,e(r)),t);return n}const zs=new Map;function $s(...e){const t={...rT};let n=!1;for(const s of e){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,t.damping=s.damping??t.damping,t.stiffness=s.stiffness??t.stiffness,t.mass=s.mass??t.mass)}const r=JSON.stringify(t);return zs.has(r)||zs.set(r,Object.freeze(t)),n?"instant":zs.get(r)}/*!---------------------------------------------------------------------------------------------
|
|
218
218
|
* Copyright (c) StackBlitz. All rights reserved.
|
|
219
219
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
220
|
-
*--------------------------------------------------------------------------------------------*/const Hf=m.createContext(null),lT=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Jr({instance:e,children:t,resize:n,initial:r,mass:s,damping:o,stiffness:i,targetScrollTop:l,contextRef:u,...a}){const d=m.useRef(null),c=m.useCallback((b,w)=>{const _=(p==null?void 0:p.targetScrollTop)??l;return(_==null?void 0:_(b,w))??b},[l]),f=aT({mass:s,damping:o,stiffness:i,resize:n,initial:r,targetScrollTop:c}),{scrollRef:y,contentRef:v,scrollToBottom:T,stopScroll:S,isAtBottom:C,escapedFromLock:k,state:x}=e??f,p=m.useMemo(()=>({scrollToBottom:T,stopScroll:S,scrollRef:y,isAtBottom:C,escapedFromLock:k,contentRef:v,state:x,get targetScrollTop(){return d.current},set targetScrollTop(b){d.current=b}}),[T,C,v,y,S,k,x]);return m.useImperativeHandle(u,()=>p,[p]),lT(()=>{y.current&&getComputedStyle(y.current).overflow==="visible"&&(y.current.style.overflow="auto")},[]),m.createElement(Hf.Provider,{value:p},m.createElement("div",{...a},typeof t=="function"?t(p):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const o=Yf();return m.createElement("div",{ref:o.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},m.createElement("div",{...s,ref:o.contentRef},typeof n=="function"?n(o):n))}e.Content=t})(Jr||(Jr={}));function Yf(){const e=m.useContext(Hf);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const cT=({className:e,...t})=>h.jsx(Jr,{className:V("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),uT=({className:e,...t})=>h.jsx(Jr.Content,{className:V("flex flex-col gap-8 p-4",e),...t}),dT=({className:e,title:t="No messages yet",description:n="Start a conversation to see messages here",icon:r,children:s,...o})=>h.jsx("div",{className:V("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...o,children:s??h.jsxs(h.Fragment,{children:[r&&h.jsx("div",{className:"text-muted-foreground",children:r}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"font-medium text-sm",children:t}),n&&h.jsx("p",{className:"text-muted-foreground text-sm",children:n})]})]})}),fT=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:r}=Yf(),s=m.useCallback(()=>{r()},[r]);return!n&&h.jsx(Fe,{className:V("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",e),onClick:s,size:"icon",type:"button",variant:"outline",...t,children:h.jsx($w,{className:"size-4"})})},Xf=()=>Zc(()=>import("./mermaid-MCJ5UELQ-BedJEojm.js").then(e=>e.m),__vite__mapDeps([0,1,2,3,4])),pT=m.lazy(Xf);function Qf({className:e,children:t,...n}){return h.jsx(m.Suspense,{fallback:h.jsx("div",{className:V("whitespace-pre-wrap break-words",e),children:t}),children:h.jsx(pT,{className:e,...n,children:t})})}const hT=({className:e,from:t,...n})=>h.jsx("div",{className:V("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...n}),mT=({children:e,className:t,...n})=>h.jsx("div",{className:V("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...n,children:e}),ep=m.memo(({className:e,...t})=>h.jsx(Qf,{className:V("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);ep.displayName="MessageResponse";var fl=1,gT=.9,yT=.8,vT=.17,Ls=.1,Fs=.999,bT=.9999,xT=.99,wT=/[\\\/_+.#"@\[\(\{&]/,ST=/[\\\/_+.#"@\[\(\{&]/g,_T=/[\s-]/,tp=/[\s-]/g;function Ao(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?fl:xT;var l=`${s},${o}`;if(i[l]!==void 0)return i[l];for(var u=r.charAt(o),a=n.indexOf(u,s),d=0,c,f,y,v;a>=0;)c=Ao(e,t,n,r,a+1,o+1,i),c>d&&(a===s?c*=fl:wT.test(e.charAt(a-1))?(c*=yT,y=e.slice(s,a-1).match(ST),y&&s>0&&(c*=Math.pow(Fs,y.length))):_T.test(e.charAt(a-1))?(c*=gT,v=e.slice(s,a-1).match(tp),v&&s>0&&(c*=Math.pow(Fs,v.length))):(c*=vT,s>0&&(c*=Math.pow(Fs,a-s))),e.charAt(a)!==t.charAt(o)&&(c*=bT)),(c<Ls&&n.charAt(a-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(a-1)!==r.charAt(o))&&(f=Ao(e,t,n,r,a+1,o+2,i),f*Ls>c&&(c=f*Ls)),c>d&&(d=c),a=n.indexOf(u,a+1);return i[l]=d,d}function pl(e){return e.toLowerCase().replace(tp," ")}function TT(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ao(e,t,pl(e),pl(t),0,0,{})}var ET=Object.defineProperty,Qe=(e,t)=>ET(e,"name",{value:t,configurable:!0});function np(e){const t=m.forwardRef((n,r)=>{let{children:s,...o}=n,i=null,l=!1;const u=[];Io(s)&&typeof Sr=="function"&&(s=Sr(s._payload)),m.Children.forEach(s,f=>{var y;if(ip(f)){l=!0;const v=f;let T="child"in v.props?v.props.child:v.props.children;Io(T)&&typeof Sr=="function"&&(T=Sr(T._payload)),i=CT(v,T),u.push((y=i==null?void 0:i.props)==null?void 0:y.children)}else u.push(f)}),i?i=m.cloneElement(i,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(i=s);const a=i?op(i):void 0,d=gt(r,a);if(!i){if(s||s===0)throw new Error(l?IT(e):AT(e));return s}const c=sp(o,i.props??{});return i.type!==m.Fragment&&(c.ref=r?d:a),m.cloneElement(i,c)});return t.displayName=`${e}.Slot`,t}Qe(np,"createSlot");var rp=Symbol.for("radix.slottable");function kT(e){const t=Qe(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=rp,t}Qe(kT,"createSlottable");var CT=Qe((e,t)=>{if("child"in e.props){const n=e.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,e.props.children(n.props.children)):null}return m.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function sp(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{const u=o(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}Qe(sp,"mergeProps");function op(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Qe(op,"getElementRef");function ip(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rp}Qe(ip,"isSlottable");var PT=Symbol.for("react.lazy");function Io(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PT&&"_payload"in e&&ap(e._payload)}Qe(Io,"isLazyComponent");function ap(e){return typeof e=="object"&&e!==null&&"then"in e}Qe(ap,"isPromiseLike");var AT=Qe(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),IT=Qe(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Sr=Xt[" use ".trim().toString()],MT=Object.defineProperty,jT=(e,t)=>MT(e,"name",{value:t,configurable:!0}),RT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mt=RT.reduce((e,t)=>{const n=np(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...l}=s,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function NT(e,t){e&&ci.flushSync(()=>e.dispatchEvent(t))}jT(NT,"dispatchDiscreteCustomEvent");var OT=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},DT=Xt[" useId ".trim().toString()]||(()=>{}),zT=0;function Sn(e){const[t,n]=m.useState(DT());return OT(()=>{n(r=>r??String(zT++))},[e]),t?`radix-${t}`:""}var Ln='[cmdk-group=""]',Vs='[cmdk-group-items=""]',$T='[cmdk-group-heading=""]',lp='[cmdk-item=""]',hl=`${lp}:not([aria-disabled="true"])`,Mo="cmdk-item-select",un="data-value",LT=(e,t,n)=>TT(e,t,n),cp=m.createContext(void 0),ur=()=>m.useContext(cp),up=m.createContext(void 0),Ri=()=>m.useContext(up),dp=m.createContext(void 0),fp=m.forwardRef((e,t)=>{let n=dn(()=>{var A,$;return{search:"",value:($=(A=e.value)!=null?A:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dn(()=>new Set),s=dn(()=>new Map),o=dn(()=>new Map),i=dn(()=>new Set),l=pp(e),{label:u,children:a,value:d,onValueChange:c,filter:f,shouldFilter:y,loop:v,disablePointerSelection:T=!1,vimBindings:S=!0,...C}=e,k=Sn(),x=Sn(),p=Sn(),b=m.useRef(null),w=HT();Yt(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,_.emit()}},[d]),Yt(()=>{w(6,Y)},[]);let _=m.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,$,Z)=>{var j,B,H,de;if(!Object.is(n.current[A],$)){if(n.current[A]=$,A==="search")L(),z(),w(1,K);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let q=document.getElementById(p);q?q.focus():(j=document.getElementById(k))==null||j.focus()}if(w(7,()=>{var q;n.current.selectedItemId=(q=W())==null?void 0:q.id,_.emit()}),Z||w(5,Y),((B=l.current)==null?void 0:B.value)!==void 0){let q=$??"";(de=(H=l.current).onValueChange)==null||de.call(H,q);return}}_.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),E=m.useMemo(()=>({value:(A,$,Z)=>{var j;$!==((j=o.current.get(A))==null?void 0:j.value)&&(o.current.set(A,{value:$,keywords:Z}),n.current.filtered.items.set(A,I($,Z)),w(2,()=>{z(),_.emit()}))},item:(A,$)=>(r.current.add(A),$&&(s.current.has($)?s.current.get($).add(A):s.current.set($,new Set([A]))),w(3,()=>{L(),z(),n.current.value||K(),_.emit()}),()=>{o.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let Z=W();w(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===A&&K(),_.emit()})}),group:A=>(s.current.has(A)||s.current.set(A,new Set),()=>{o.current.delete(A),s.current.delete(A)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:p,labelId:x,listInnerRef:b}),[]);function I(A,$){var Z,j;let B=(j=(Z=l.current)==null?void 0:Z.filter)!=null?j:LT;return A?B(A,n.current.search,$):0}function z(){if(!n.current.search||l.current.shouldFilter===!1)return;let A=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(j=>{let B=s.current.get(j),H=0;B.forEach(de=>{let q=A.get(de);H=Math.max(q,H)}),$.push([j,H])});let Z=b.current;le().sort((j,B)=>{var H,de;let q=j.getAttribute("id"),et=B.getAttribute("id");return((H=A.get(et))!=null?H:0)-((de=A.get(q))!=null?de:0)}).forEach(j=>{let B=j.closest(Vs);B?B.appendChild(j.parentElement===B?j:j.closest(`${Vs} > *`)):Z.appendChild(j.parentElement===Z?j:j.closest(`${Vs} > *`))}),$.sort((j,B)=>B[1]-j[1]).forEach(j=>{var B;let H=(B=b.current)==null?void 0:B.querySelector(`${Ln}[${un}="${encodeURIComponent(j[0])}"]`);H==null||H.parentElement.appendChild(H)})}function K(){let A=le().find(Z=>Z.getAttribute("aria-disabled")!=="true"),$=A==null?void 0:A.getAttribute(un);_.setState("value",$||void 0)}function L(){var A,$,Z,j;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let H of r.current){let de=($=(A=o.current.get(H))==null?void 0:A.value)!=null?$:"",q=(j=(Z=o.current.get(H))==null?void 0:Z.keywords)!=null?j:[],et=I(de,q);n.current.filtered.items.set(H,et),et>0&&B++}for(let[H,de]of s.current)for(let q of de)if(n.current.filtered.items.get(q)>0){n.current.filtered.groups.add(H);break}n.current.filtered.count=B}function Y(){var A,$,Z;let j=W();j&&(((A=j.parentElement)==null?void 0:A.firstChild)===j&&((Z=($=j.closest(Ln))==null?void 0:$.querySelector($T))==null||Z.scrollIntoView({block:"nearest"})),j.scrollIntoView({block:"nearest"}))}function W(){var A;return(A=b.current)==null?void 0:A.querySelector(`${lp}[aria-selected="true"]`)}function le(){var A;return Array.from(((A=b.current)==null?void 0:A.querySelectorAll(hl))||[])}function oe(A){let $=le()[A];$&&_.setState("value",$.getAttribute(un))}function ce(A){var $;let Z=W(),j=le(),B=j.findIndex(de=>de===Z),H=j[B+A];($=l.current)!=null&&$.loop&&(H=B+A<0?j[j.length-1]:B+A===j.length?j[0]:j[B+A]),H&&_.setState("value",H.getAttribute(un))}function $e(A){let $=W(),Z=$==null?void 0:$.closest(Ln),j;for(;Z&&!j;)Z=A>0?qT(Z,Ln):JT(Z,Ln),j=Z==null?void 0:Z.querySelector(hl);j?_.setState("value",j.getAttribute(un)):ce(A)}let ke=()=>oe(le().length-1),M=A=>{A.preventDefault(),A.metaKey?ke():A.altKey?$e(1):ce(1)},he=A=>{A.preventDefault(),A.metaKey?oe(0):A.altKey?$e(-1):ce(-1)};return m.createElement(Mt.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:A=>{var $;($=C.onKeyDown)==null||$.call(C,A);let Z=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||Z))switch(A.key){case"n":case"j":{S&&A.ctrlKey&&M(A);break}case"ArrowDown":{M(A);break}case"p":case"k":{S&&A.ctrlKey&&he(A);break}case"ArrowUp":{he(A);break}case"Home":{A.preventDefault(),oe(0);break}case"End":{A.preventDefault(),ke();break}case"Enter":{A.preventDefault();let j=W();if(j){let B=new Event(Mo);j.dispatchEvent(B)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:XT},u),ys(e,A=>m.createElement(up.Provider,{value:_},m.createElement(cp.Provider,{value:E},A))))}),FT=m.forwardRef((e,t)=>{var n,r;let s=Sn(),o=m.useRef(null),i=m.useContext(dp),l=ur(),u=pp(e),a=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Yt(()=>{if(!a)return l.item(s,i==null?void 0:i.id)},[a]);let d=hp(s,o,[e.value,e.children,o],e.keywords),c=Ri(),f=kt(w=>w.value&&w.value===d.current),y=kt(w=>a||l.filter()===!1?!0:w.search?w.filtered.items.get(s)>0:!0);m.useEffect(()=>{let w=o.current;if(!(!w||e.disabled))return w.addEventListener(Mo,v),()=>w.removeEventListener(Mo,v)},[y,e.onSelect,e.disabled]);function v(){var w,_;T(),(_=(w=u.current).onSelect)==null||_.call(w,d.current)}function T(){c.setState("value",d.current,!0)}if(!y)return null;let{disabled:S,value:C,onSelect:k,forceMount:x,keywords:p,...b}=e;return m.createElement(Mt.div,{ref:Ht(o,t),...b,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!f,"data-disabled":!!S,"data-selected":!!f,onPointerMove:S||l.getDisablePointerSelection()?void 0:T,onClick:S?void 0:v},e.children)}),VT=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=Sn(),l=m.useRef(null),u=m.useRef(null),a=Sn(),d=ur(),c=kt(y=>s||d.filter()===!1?!0:y.search?y.filtered.groups.has(i):!0);Yt(()=>d.group(i),[]),hp(i,l,[e.value,e.heading,u]);let f=m.useMemo(()=>({id:i,forceMount:s}),[s]);return m.createElement(Mt.div,{ref:Ht(l,t),...o,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},n&&m.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:a},n),ys(e,y=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?a:void 0},m.createElement(dp.Provider,{value:f},y))))}),ZT=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),o=kt(i=>!i.search);return!n&&!o?null:m.createElement(Mt.div,{ref:Ht(s,t),...r,"cmdk-separator":"",role:"separator"})}),BT=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=Ri(),i=kt(a=>a.search),l=kt(a=>a.selectedItemId),u=ur();return m.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),m.createElement(Mt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:s?e.value:i,onChange:a=>{s||o.setState("search",a.target.value),n==null||n(a.target.value)}})}),UT=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=m.useRef(null),i=m.useRef(null),l=kt(a=>a.selectedItemId),u=ur();return m.useEffect(()=>{if(i.current&&o.current){let a=i.current,d=o.current,c,f=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let y=a.offsetHeight;d.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return f.observe(a),()=>{cancelAnimationFrame(c),f.unobserve(a)}}},[]),m.createElement(Mt.div,{ref:Ht(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},ys(e,a=>m.createElement("div",{ref:Ht(i,u.listInnerRef),"cmdk-list-sizer":""},a)))}),WT=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...l}=e;return m.createElement(Zf,{open:n,onOpenChange:r},m.createElement(Wf,{container:i},m.createElement(Gf,{"cmdk-overlay":"",className:s}),m.createElement(Kf,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(fp,{ref:t,...l}))))}),GT=m.forwardRef((e,t)=>kt(n=>n.filtered.count===0)?m.createElement(Mt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),KT=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return m.createElement(Mt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ys(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Rn=Object.assign(fp,{List:UT,Item:FT,Input:BT,Group:VT,Separator:ZT,Dialog:WT,Empty:GT,Loading:KT});function qT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function JT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pp(e){let t=m.useRef(e);return Yt(()=>{t.current=e}),t}var Yt=typeof window>"u"?m.useEffect:m.useLayoutEffect;function dn(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function kt(e){let t=Ri(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function hp(e,t,n,r=[]){let s=m.useRef(),o=ur();return Yt(()=>{var i;let l=(()=>{var a;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(a=d.current.textContent)==null?void 0:a.trim():s.current}})(),u=r.map(a=>a.trim());o.value(e,l,u),(i=t.current)==null||i.setAttribute(un,l),s.current=l}),s}var HT=()=>{let[e,t]=m.useState(),n=dn(()=>new Map);return Yt(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function YT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ys({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(YT(t),{ref:t.ref},n(t.props.children)):n(t)}var XT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function QT({className:e,...t}){return h.jsx(Rn,{"data-slot":"command",className:V("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function eE({className:e,...t}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(Gw,{className:"size-4 shrink-0 opacity-50"}),h.jsx(Rn.Input,{"data-slot":"command-input",className:V("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function tE({className:e,...t}){return h.jsx(Rn.List,{"data-slot":"command-list",className:V("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function nE({...e}){return h.jsx(Rn.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function rE({className:e,...t}){return h.jsx(Rn.Group,{"data-slot":"command-group",className:V("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function sE({className:e,...t}){return h.jsx(Rn.Item,{"data-slot":"command-item",className:V("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function oE({...e}){return h.jsx(Zf,{"data-slot":"dialog",...e})}function iE({...e}){return h.jsx(K_,{"data-slot":"dialog-trigger",...e})}function aE({...e}){return h.jsx(Wf,{"data-slot":"dialog-portal",...e})}function lE({className:e,...t}){return h.jsx(Gf,{"data-slot":"dialog-overlay",className:V("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function cE({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(aE,{"data-slot":"dialog-portal",children:[h.jsx(lE,{}),h.jsxs(Kf,{"data-slot":"dialog-content",className:V("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&h.jsxs(tT,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(Kd,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uE({className:e,...t}){return h.jsx(Q_,{"data-slot":"dialog-title",className:V("text-lg leading-none font-semibold",e),...t})}const mp=e=>h.jsx(oE,{...e}),gp=e=>h.jsx(iE,{...e}),yp=({className:e,children:t,title:n="Model Selector",...r})=>h.jsxs(cE,{"aria-describedby":void 0,className:V("outline! border-none! p-0 outline-border! outline-solid!",e),...r,children:[h.jsx(uE,{className:"sr-only",children:n}),h.jsx(QT,{className:"**:data-[slot=command-input-wrapper]:h-auto",children:t})]}),vp=({className:e,...t})=>h.jsx(eE,{className:V("h-auto py-3.5",e),...t}),bp=e=>h.jsx(tE,{...e}),xp=e=>h.jsx(nE,{...e}),jo=e=>h.jsx(rE,{...e}),Ro=e=>h.jsx(sE,{...e}),No=({className:e,...t})=>h.jsx("span",{className:V("flex-1 truncate text-left",e),...t});function dE({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:V("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function fE({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:V("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const pE=wi("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function hE({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:V(pE({align:t}),e),onClick:r=>{var s,o;r.target.closest("button")||(o=(s=r.currentTarget.parentElement)==null?void 0:s.querySelector("input"))==null||o.focus()},...n})}const mE=wi("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function gE({className:e,type:t="button",variant:n="ghost",size:r="xs",...s}){return h.jsx(Fe,{type:t,"data-size":r,variant:n,className:V(mE({size:r}),e),...s})}function yE({className:e,...t}){return h.jsx(dE,{"data-slot":"input-group-control",className:V("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",e),...t})}function wp({className:e,...t}){return h.jsx(Bw,{role:"status","aria-label":"Loading",className:V("size-4 animate-spin",e),...t})}const vE=({className:e,onSubmit:t,children:n,...r})=>{const s=m.useCallback(o=>{o.preventDefault();const i=o.currentTarget,l=new FormData(i).get("message")||"";i.reset(),t({text:l},o)},[t]);return h.jsx("form",{className:V("w-full",e),onSubmit:s,...r,children:h.jsx(fE,{className:"overflow-hidden",children:n})})},bE=({className:e,...t})=>h.jsx("div",{className:V("contents",e),...t}),xE=({onKeyDown:e,className:t,placeholder:n="What would you like to know?",...r})=>{const[s,o]=m.useState(!1),i=m.useCallback(a=>{if(e==null||e(a),a.defaultPrevented||a.key!=="Enter"||a.shiftKey||s||a.nativeEvent.isComposing)return;a.preventDefault();const{form:d}=a.currentTarget,c=d==null?void 0:d.querySelector('button[type="submit"]');c!=null&&c.disabled||d==null||d.requestSubmit()},[e,s]),l=m.useCallback(()=>o(!1),[]),u=m.useCallback(()=>o(!0),[]);return h.jsx(yE,{className:V("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:l,onCompositionStart:u,onKeyDown:i,placeholder:n,...r})},wE=({className:e,...t})=>h.jsx(hE,{align:"block-end",className:V("justify-between gap-1",e),...t}),SE=({className:e,...t})=>h.jsx("div",{className:V("flex min-w-0 items-center gap-1",e),...t}),_E=({className:e,variant:t="default",size:n="icon-sm",status:r,onStop:s,onClick:o,children:i,...l})=>{const u=r==="submitted"||r==="streaming";let a=h.jsx(Zw,{className:"size-4"});r==="submitted"?a=h.jsx(wp,{}):r==="streaming"?a=h.jsx(Kw,{className:"size-4"}):r==="error"&&(a=h.jsx(Kd,{className:"size-4"}));const d=m.useCallback(c=>{if(u&&s){c.preventDefault(),s();return}o==null||o(c)},[u,s,o]);return h.jsx(gE,{"aria-label":u?"Stop":"Submit",className:V(e),onClick:d,size:n,type:u&&s?"button":"submit",variant:t,...l,children:i??a})};function Sp({...e}){return h.jsx(T_,{"data-slot":"collapsible",...e})}function _p({...e}){return h.jsx(k_,{"data-slot":"collapsible-trigger",...e})}function Tp({...e}){return h.jsx(C_,{"data-slot":"collapsible-content",...e})}const Ep=m.createContext({});function TE(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const EE=typeof window<"u",ml=EE?m.useLayoutEffect:m.useEffect,Ni=m.createContext(null);function Oi(e,t){e.indexOf(t)===-1&&e.push(t)}function Hr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yt=(e,t,n)=>n>t?t:n<e?e:n;let vs=()=>{};const mt={},Di=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),kp=e=>typeof e=="object"&&e!==null,zi=e=>/^0[^.\s]+$/u.test(e);function Cp(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,dr=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Xn=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Yr{constructor(){this.subscriptions=[]}add(t){return Oi(this.subscriptions,t),()=>this.remove(t)}remove(t){Hr(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ze=e=>e*1e3,Ve=e=>e/1e3,Pp=(e,t)=>t?e*(1e3/t):0,Ap=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kE=1e-7,CE=12;function PE(e,t,n,r,s){let o,i,l=0;do i=t+(n-t)/2,o=Ap(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>kE&&++l<CE);return i}function fr(e,t,n,r){if(e===t&&n===r)return Xe;const s=o=>PE(o,0,1,e,n);return o=>o===0||o===1?o:Ap(s(o),t,r)}const Ip=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mp=e=>t=>1-e(1-t),jp=fr(.33,1.53,.69,.99),$i=Mp(jp),Rp=Ip($i),Np=e=>e>=1?1:(e*=2)<1?.5*$i(e):.5*(2-Math.pow(2,-10*(e-1))),Li=e=>1-Math.sin(Math.acos(e)),Op=Mp(Li),Dp=Ip(Li),AE=fr(.42,0,1,1),IE=fr(0,0,.58,1),Fi=fr(.42,0,.58,1),ME=e=>Array.isArray(e)&&typeof e[0]!="number",zp=e=>Array.isArray(e)&&typeof e[0]=="number",jE={linear:Xe,easeIn:AE,easeInOut:Fi,easeOut:IE,circIn:Li,circInOut:Dp,circOut:Op,backIn:$i,backInOut:Rp,backOut:jp,anticipate:Np},RE=e=>typeof e=="string",gl=e=>{if(zp(e)){vs(e.length===4);const[t,n,r,s]=e;return fr(t,n,r,s)}else if(RE(e))return jE[e];return e},ve={delta:0,timestamp:0,isProcessing:!1};let Pr;function NE(){Pr=void 0}const Te={now:()=>(Pr===void 0&&Te.set(ve.isProcessing||mt.useManualTiming?ve.timestamp:performance.now()),Pr),set:e=>{Pr=e,queueMicrotask(NE)}},_n=e=>Math.round(e*1e5)/1e5,$p=e=>t=>typeof t=="string"&&t.startsWith(e),Lp=$p("--"),OE=$p("var(--"),Vi=e=>OE(e)?DE.test(e.split("/*")[0].trim()):!1,DE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yl(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Nn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qn={...Nn,transform:e=>yt(0,1,e)},_r={...Nn,default:1},Zi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zE(e){return e==null}const $E=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bi=(e,t)=>n=>!!(typeof n=="string"&&$E.test(n)&&n.startsWith(e)||t&&!zE(n)&&Object.prototype.hasOwnProperty.call(n,t)),Fp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,l]=r.match(Zi);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:l!==void 0?parseFloat(l):1}},LE=e=>yt(0,255,e),Zs={...Nn,transform:e=>Math.round(LE(e))},Ft={test:Bi("rgb","red"),parse:Fp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zs.transform(e)+", "+Zs.transform(t)+", "+Zs.transform(n)+", "+_n(Qn.transform(r))+")"};function FE(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Oo={test:Bi("#"),parse:FE,transform:Ft.transform},pr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ft=pr("deg"),lt=pr("%"),O=pr("px"),VE=pr("vh"),ZE=pr("vw"),vl={...lt,parse:e=>lt.parse(e)/100,transform:e=>lt.transform(e*100)},mn={test:Bi("hsl","hue"),parse:Fp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lt.transform(_n(t))+", "+lt.transform(_n(n))+", "+_n(Qn.transform(r))+")"},be={test:e=>Ft.test(e)||Oo.test(e)||mn.test(e),parse:e=>Ft.test(e)?Ft.parse(e):mn.test(e)?mn.parse(e):Oo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ft.transform(e):mn.transform(e),getAnimatableNone:e=>{const t=be.parse(e);return t.alpha=0,be.transform(t)}},BE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vp=new RegExp(Zi.source),Zp=new RegExp(BE.source,"i");function UE(e){return isNaN(e)&&typeof e=="string"&&(Vp.test(e)||Zp.test(e))}const Bp="number",Up="color",WE="var",GE="var(",bl="${}",KE=/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 qE(e){const t=e.toString();return Vp.test(t)||Zp.test(t)}function er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const l=t.replace(KE,u=>(be.test(u)?(r.color.push(o),s.push(Up),n.push(be.parse(u))):u.startsWith(GE)?(r.var.push(o),s.push(WE),n.push(u)):(r.number.push(o),s.push(Bp),n.push(parseFloat(u))),++o,bl)).split(bl);return{values:n,split:l,indexes:r,types:s}}function JE(e){return er(e).values}function Wp({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===Bp?s+=_n(r[o]):i===Up?s+=be.transform(r[o]):s+=r[o]}return s}}function HE(e){return Wp(er(e))}const YE=e=>typeof e=="number"?0:be.test(e)?be.getAnimatableNone(e):e,XE=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:YE(e);function QE(e){const t=er(e);return Wp(t)(t.values.map((r,s)=>XE(r,t.split[s])))}const Oe={test:UE,parse:JE,createTransformer:HE,getAnimatableNone:QE};function Bs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ek({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;s=Bs(u,l,e+1/3),o=Bs(u,l,e),i=Bs(u,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Xr(e,t){return n=>n>0?t:e}const Q=(e,t,n)=>e+(t-e)*n,Us=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tk=[Oo,Ft,mn],nk=e=>tk.find(t=>t.test(e));function xl(e){const t=nk(e);if(!t)return!1;let n=t.parse(e);return t===mn&&(n=ek(n)),n}const wl=(e,t)=>{const n=xl(e),r=xl(t);if(!n||!r)return Xr(e,t);const s={...n};return o=>(s.red=Us(n.red,r.red,o),s.green=Us(n.green,r.green,o),s.blue=Us(n.blue,r.blue,o),s.alpha=Q(n.alpha,r.alpha,o),Ft.transform(s))},Do=new Set(["none","hidden"]);function rk(e,t){return Do.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sk(e,t){return n=>Q(e,t,n)}function Ui(e){return typeof e=="number"?sk:typeof e=="string"?Vi(e)?Xr:be.test(e)?wl:ak:Array.isArray(e)?Gp:typeof e=="object"?be.test(e)?wl:ok:Xr}function Gp(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Ui(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function ok(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ui(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function ik(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],l=e.values[i]??0;n[s]=l,r[o]++}return n}const ak=(e,t)=>{const n=Oe.createTransformer(t),r=er(e),s=er(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Do.has(e)&&!s.values.length||Do.has(t)&&!r.values.length?rk(e,t):dr(Gp(ik(r,s),s.values),n):Xr(e,t)},Sl=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function lk(e,t){const n=Sl.exec(e);if(!n)return;const r=Sl.exec(t);if(!r||n[2]!==r[2])return;const s=n[2],o=parseFloat(n[1]),i=parseFloat(r[1]);return l=>_n(Q(o,i,l))+s}function Wi(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return Q(e,t,n);if(typeof e=="string"&&typeof t=="string"){const s=lk(e,t);if(s)return s}return Ui(e)(e,t)}const Tr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ck(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new Set;let i={delta:0,timestamp:0,isProcessing:!1};function l(a){o.has(a)&&(n.add(a),e()),a(i)}const u={schedule:(a,d=!1,c=!1)=>{const y=c&&r?t:n;return d&&o.add(a),y.add(a),a},cancel:a=>{n.delete(a),o.delete(a)},process:a=>{if(i=a,r){s=!0;return}r=!0;const d=t;t=n,n=d,t.forEach(l),t.clear(),r=!1,s&&(s=!1,u.process(a))}};return u}const uk=40;function Kp(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,s=!0;const o=()=>r=!0,i=Tr.reduce((x,p)=>(x[p]=ck(o),x),{}),{setup:l,read:u,resolveKeyframes:a,preUpdate:d,update:c,preRender:f,render:y,postRender:v}=i,T=()=>{const x=mt.useManualTiming,p=x?n.timestamp:performance.now();r=!1,x||(n.delta=s?1e3/60:Math.max(Math.min(p-n.timestamp,uk),1)),n.timestamp=p,n.isProcessing=!0,l.process(n),u.process(n),a.process(n),d.process(n),c.process(n),f.process(n),y.process(n),v.process(n),n.isProcessing=!1,r&&t&&(s=!1,e(T))},S=()=>{r=!0,s=!0,n.isProcessing||e(T)};return{schedule:Tr.reduce((x,p)=>{const b=i[p];return x[p]=(w,_=!1,E=!1)=>(r||S(),b.schedule(w,_,E)),x},{}),cancel:x=>{for(let p=0;p<Tr.length;p++)i[Tr[p]].cancel(x)},state:n,steps:i}}const{schedule:ee,cancel:Ct,steps:Ws}=Kp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0,ve),dk=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ee.update(t,n),stop:()=>Ct(t),now:()=>ve.isProcessing?ve.timestamp:Te.now()}},qp=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Gi=2e4;function Ki(e,t=50,n=Gi,r){let s=0,o=e.next(s);for(;!o.done&&s<n;)s+=t,o=e.next(s);return s>=n?1/0:s}function fk(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Ki(r),Gi);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Ve(s)}}const _e={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Jp=e=>e<0?1/Math.max(1+e,_e.minDamping):Math.max(1-e,_e.minDamping);function Hp(e,t){if(!(e>1))return 1;const n=Math.sqrt(e*e-1),r=e-n,s=e+n,o=2*n*Math.exp(-t)*(1+t);return Yp(i=>s*Math.exp(-r*i)-r*Math.exp(-s*i)-o,i=>Math.exp(-s*i)-Math.exp(-r*i),t)/t}function zo(e,t){return e*Math.sqrt(1-t*t)}const pk=12;function Yp(e,t,n){let r=n;for(let s=1;s<pk;s++)r=r-e(r)/t(r);return r}const Gs=.001;function hk({duration:e=_e.duration,bounce:t=_e.bounce}){let n,r;const s=Jp(t);e=yt(_e.minDuration,_e.maxDuration,Ve(e)),s<1?(n=a=>{const d=a*s,c=d*e,f=zo(a,s),y=Math.exp(-c);return Gs-d/f*y},r=a=>{const c=a*s*e,f=s*s*a*a*e,y=Math.exp(-c),v=zo(a*a,s);return(-n(a)+Gs>0?-1:1)*-f*y/v}):(n=a=>{const d=Math.exp(-a*e),c=a*e+1;return-Gs+d*c},r=a=>{const d=Math.exp(-a*e),c=-a*(e*e);return d*c});const o=5/e,i=Yp(n,r,o),l=i*Hp(s,i*e),u=l*l;return{stiffness:u,damping:s*2*Math.sqrt(u),duration:Ze(e)}}const $o=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Ks(e,t){if($o(e,t))return e}function mk(e){const t=Ks(e.stiffness),n=Ks(e.damping,!0),r=Ks(e.mass),s={...e,stiffness:t??_e.stiffness,damping:n??_e.damping,mass:r??_e.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(s.isTimeDefined){if(e.visualDuration){const o=Jp(e.bounce||0),i=2*Math.PI/(e.visualDuration*1.2)*Hp(o,2*Math.PI/1.2);s.stiffness=i*i,s.damping=2*o*Math.sqrt(s.stiffness)}else Object.assign(s,hk(s)),s.isResolvedFromDuration=!0;(!$o(s.stiffness)||!$o(s.damping,!0))&&(s.stiffness=_e.stiffness,s.damping=_e.damping)}return s}function Qr(e=_e.visualDuration,t=_e.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,r=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:i,damping:l,mass:u,duration:a,isResolvedFromDuration:d,isTimeDefined:c}=mk({...n}),f=_=>c?0:-Ve(_),y=l/(2*Math.sqrt(i*u)),v=Ve(Math.sqrt(i/u)),T=y*v,S={target:s,delta:s-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},C=()=>{const _=Math.abs(S.delta)<5;S.restSpeed=n.restSpeed||(_?_e.restSpeed.granular:_e.restSpeed.default),S.restDelta=n.restDelta||(_?_e.restDelta.granular:_e.restDelta.default)};C();let k,x,p;if(y<1){const _=zo(v,y),E={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};p=()=>{E.A=(S.velocity+T*S.delta)/_,E.sinC=T*E.A+S.delta*_,E.cosC=T*S.delta-E.A*_};const I=z=>{z!==E.t&&(E.t=z,E.env=Math.exp(-T*z),E.sin=Math.sin(_*z),E.cos=Math.cos(_*z))};k=z=>(I(z),S.target-E.env*(E.A*E.sin+S.delta*E.cos)),x=z=>(I(z),E.env*(E.sinC*E.sin+E.cosC*E.cos))}else if(y===1){k=E=>S.target-Math.exp(-v*E)*(S.delta+(S.velocity+v*S.delta)*E);const _={C:0};p=()=>{_.C=S.velocity+v*S.delta},x=E=>Math.exp(-v*E)*(v*_.C*E-S.velocity)}else{const _=v*Math.sqrt(y*y-1),E=T-_,I=T+_,z=c?1/0:300/_,K=(Y,W)=>Math.exp(W>z?-Y*z-T*(W-z):-Y*W),L={S:0,F:0};p=()=>{const Y=(S.velocity+T*S.delta)/_;L.S=(S.delta+Y)/2,L.F=(S.delta-Y)/2},k=Y=>S.target-L.S*K(E,Y)-L.F*K(I,Y),x=Y=>E*L.S*K(E,Y)+I*L.F*K(I,Y)}p();const b=d&&a||null,w={calculatedDuration:b,retarget:(_,E)=>{S.target=_[_.length-1],S.delta=S.target-_[0],S.velocity=f(E),n.restSpeed&&n.restDelta||C(),w.calculatedDuration=b,o.done=!1,p()},velocity:_=>Ze(x(_)),next:_=>{const E=k(_);if(d)o.done=_>=a;else{const I=Ze(x(_));o.done=Math.abs(I)<=S.restSpeed&&Math.abs(S.target-E)<=S.restDelta}return o.value=o.done?S.target:E,o},toString:()=>{const _=Math.min(Ki(w),Gi),E=qp(I=>w.next(_*I).value,_,30);return _+"ms "+E},toTransition:()=>{}};return w}Qr.applyToOptions=e=>{const t=fk(e,100,Qr);return e.ease=t.ease,e.duration=Ze(t.duration),e.type="keyframes",e};function Lo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:l,max:u,restDelta:a=.5,restSpeed:d}){const c=e[0],f={done:!1,value:c},y=_=>_<l||_>u,v=_=>l===void 0?u:u===void 0||Math.abs(l-_)<Math.abs(u-_)?l:u;let T=n*t;const S=c+T,C=i===void 0?S:i(S);C!==S&&(T=C-c);const k=_=>-T*Math.exp(-_/r),x=_=>{const E=k(_);f.done=Math.abs(E)<=a,f.value=f.done?C:C+E};let p,b;const w=_=>{y(f.value)&&(p=_,b=Qr({keyframes:[f.value,v(f.value)],velocity:-k(_)/r*1e3,damping:s,stiffness:o,restDelta:a,restSpeed:d}))};return w(0),{calculatedDuration:null,next:_=>{let E=!1;return!b&&p===void 0&&(E=!0,x(_),w(_)),p!==void 0&&_>=p?b.next(_-p):(!E&&x(_),f)}}}function gk(e,t,n){const r=[],s=n||mt.mix||Wi,o=e.length-1;for(let i=0;i<o;i++){let l=s(e[i],e[i+1]);if(t){const u=Array.isArray(t)?t[i]||Xe:t;l=dr(u,l)}r.push(l)}return r}function yk(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(vs(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gk(t,r,s),u=l.length,a=d=>{if(i&&d<e[0])return t[0];let c=0;if(u>1)for(;c<e.length-2&&!(d<e[c+1]);c++);const f=Xn(e[c],e[c+1],d);return l[c](f)};return n?d=>a(yt(e[0],e[o-1],d)):a}function vk(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xn(0,t,r);e.push(Q(n,1,s))}}function bk(e){const t=[0];return vk(t,e.length-1),t}function xk(e,t){return e.map(n=>n*t)}function wk(e,t){return e.map(()=>t||Fi).splice(0,e.length-1)}function Un({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=ME(r)?r.map(gl):gl(r)||Fi,o={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(s)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){const[u,a]=t,d=u===a?void 0:(mt.mix||Wi)(u,a);return{calculatedDuration:e,next:c=>(o.value=d?d(s(e>0?yt(0,1,c/e):1)):a,o.done=c>=e,o)}}const i=xk(n&&n.length===t.length?n:bk(t),e),l=yk(i,t,{ease:Array.isArray(s)?s:wk(t,s)});return{calculatedDuration:e,next:u=>(o.value=l(u),o.done=u>=e,o)}}const Sk=5;function _k(e,t,n){const r=Math.max(t-Sk,0);return Pp(n-e(r),t-r)}function Tk(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):_k(r=>e.next(r).value,t,e.next(t).value)}const Ek=e=>e!==null;function bs(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(Ek),l=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!l||r===void 0?o[l]:r}const kk={decay:Lo,inertia:Lo,tween:Un,keyframes:Un,spring:Qr};function Xp(e){typeof e.type=="string"&&(e.type=kk[e.type])}function Qp(e,t){return{kind:e,animation:t,timestamp:Te.now(),frameTimestamp:ve.timestamp,frameIsProcessing:ve.isProcessing}}function eh(e,t,n){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Qp("animation-start",e),options:n?{...t,...n}:t})}catch{}}function Ck(e,t){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Qp("layout-animation-start",e),node:t})}catch{}}class qi{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,n){return this.finished.then(t,n)}}const Pk=e=>e/100;class es extends qi{constructor(t){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=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Te.now()&&this.tick(Te.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),eh(this,this.options)}initAnimation(){const{options:t}=this;Xp(t);const{type:n=Un,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:l}=t;const u=n||Un;u!==Un&&typeof l[0]!="number"&&(this.mixKeyframes=dr(Pk,Wi(l[0],l[1])),l=[0,100]);const a=u(l===t.keyframes?t:{...t,keyframes:l});o==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-i})),a.calculatedDuration===null&&(a.calculatedDuration=Ki(a));const{calculatedDuration:d}=a;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=a}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:a=0,keyframes:d,repeat:c,repeatType:f,repeatDelay:y,type:v,onUpdate:T,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const C=this.currentTime-a*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?C<0:C>s;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,p=r;if(c){const E=Math.min(this.currentTime,s)/l;let I=Math.floor(E),z=E%1;!z&&E>=1&&(z=1),z===1&&I--,I=Math.min(I,c+1),!!(I%2)&&(f==="reverse"?(z=1-z,y&&(z-=y/l)):f==="mirror"&&(p=i)),x=yt(0,1,z)*l}let b;k?(this.delayState.value=d[0],b=this.delayState):b=p.next(x),o&&!k&&(b.value=o(b.value));let{done:w}=b;!k&&u!==null&&(w=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return _&&v!==Lo&&(b.value=bs(d,this.options,S,this.speed)),T&&T(b.value),_&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return Ve(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ve(t)}get time(){return Ve(this.currentTime)}set time(t){t=Ze(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Tk(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Te.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ve(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=dk,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Te.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}const Ak=new Set(["brightness","contrast","saturate","opacity"]);function Ik(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Zi)||[];if(!r)return e;const s=n.replace(r,"");let o=Ak.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Mk=/\b([a-z-]*)\(.*?\)/gu,Fo={...Oe,getAnimatableNone:e=>{const t=e.match(Mk);return t?t.map(Ik).join(" "):e}},Vo={...Oe,getAnimatableNone:e=>{const t=Oe.parse(e);return Oe.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},_l={...Nn,transform:Math.round},jk={rotate:ft,pathRotation:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:_r,scaleX:_r,scaleY:_r,scaleZ:_r,skew:ft,skewX:ft,skewY:ft,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:Qn,originX:vl,originY:vl,originZ:O},ts={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,top:O,right:O,bottom:O,left:O,inset:O,insetBlock:O,insetBlockStart:O,insetBlockEnd:O,insetInline:O,insetInlineStart:O,insetInlineEnd:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,paddingBlock:O,paddingBlockStart:O,paddingBlockEnd:O,paddingInline:O,paddingInlineStart:O,paddingInlineEnd:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,marginBlock:O,marginBlockStart:O,marginBlockEnd:O,marginInline:O,marginInlineStart:O,marginInlineEnd:O,fontSize:O,backgroundPositionX:O,backgroundPositionY:O,...jk,zIndex:_l,fillOpacity:Qn,strokeOpacity:Qn,numOctaves:_l},Rk={...ts,color:be,backgroundColor:be,outlineColor:be,fill:be,stroke:be,borderColor:be,borderTopColor:be,borderRightColor:be,borderBottomColor:be,borderLeftColor:be,filter:Fo,WebkitFilter:Fo,mask:Vo,WebkitMask:Vo},th=e=>Rk[e],Nk=new Set([Fo,Vo]);function Ji(e,t){let n=th(e);return Nk.has(n)||(n=Oe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function Ok(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Vt=e=>e*180/Math.PI,Zo=e=>{const t=Vt(Math.atan2(e[1],e[0]));return Bo(t)},Dk={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Zo,rotateZ:Zo,skewX:e=>Vt(Math.atan(e[1])),skewY:e=>Vt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bo=e=>(e=e%360,e<0&&(e+=360),e),Tl=Zo,El=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),kl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),zk={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:El,scaleY:kl,scale:e=>(El(e)+kl(e))/2,rotateX:e=>Bo(Vt(Math.atan2(e[6],e[5]))),rotateY:e=>Bo(Vt(Math.atan2(-e[2],e[0]))),rotateZ:Tl,rotate:Tl,skewX:e=>Vt(Math.atan(e[4])),skewY:e=>Vt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tr(e){return e.includes("scale")?1:0}function Uo(e,t){if(!e||e==="none")return tr(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=zk,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Dk,s=l}if(!s)return tr(t);const o=r[t],i=s[1].split(",").map(Lk);return typeof o=="function"?o(i):i[o]}const $k=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Uo(n,t)};function Lk(e){return parseFloat(e.trim())}const On=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],St=new Set([...On,"pathRotation"]),Cl=e=>e===Nn||e===O,Fk=new Set(["x","y","z"]),Vk=On.filter(e=>!Fk.has(e));function Zk(e){const t=[];return Vk.forEach(n=>{const r=e.getValue(n);if(r!==void 0){const s=r.get(),o=n.startsWith("scale")?1:0;if(s===o)return;t.push([n,s]),r.set(o)}}),t}const Bk=new Set(["bottom","right"]);function Pl(e,t,n,r,s,o){const i=parseFloat(e);if(!isNaN(i))return i;const{min:l,max:u}=t()[n],a=u-l;return o==="border-box"?a:a-parseFloat(r)-parseFloat(s)}const Gt={width:({width:e,paddingLeft:t="0",paddingRight:n="0",boxSizing:r},s)=>Pl(e,s,"x",t,n,r),height:({height:e,paddingTop:t="0",paddingBottom:n="0",boxSizing:r},s)=>Pl(e,s,"y",t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{const{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Uo(e,"x"),y:({transform:e})=>Uo(e,"y")};Gt.translateX=Gt.x;Gt.translateY=Gt.y;const Kt=new Set;let Wo=!1,Go=!1,Ko=!1;function nh(){if(Go){const e=[],t=new Set,n=new Set;Kt.forEach(s=>{s.needsMeasurement&&(e.push(s),t.add(s.element),Bk.has(s.name)&&n.add(s.element))});const r=new Map;n.forEach(s=>{const o=Zk(s);o.length&&(r.set(s,o),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const o=r.get(s);o&&o.forEach(([i,l])=>{var u;(u=s.getValue(i))==null||u.set(l)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Go=!1,Wo=!1,Kt.forEach(e=>e.complete(Ko)),Kt.clear()}function rh(){Kt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Go=!0)})}function Uk(){Ko=!0,rh(),nh(),Ko=!1}function Wk(e,t,n){if(typeof e=="string"){if(Di(e)||zi(e))return parseFloat(e);if(!Oe.test(e)&&Oe.test(n))return Ji(t,n)}return e??void 0}class Hi{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Kt.add(this),Wo||(Wo=!0,ee.read(rh),ee.resolveKeyframes(nh))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=Wk(r.readValue(n,i),n,i);l!==void 0&&(t[0]=l)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Ok(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Kt.delete(this)}cancel(){this.state==="scheduled"&&(Kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gk=e=>e.startsWith("--");function sh(e,t,n){Gk(t)?e.style.setProperty(t,n):e.style[t]=n}const Kk={};function oh(e,t){const n=Cp(e);return()=>Kk[t]??n()}const qk=oh(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ih=oh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Zn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Al={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zn([0,.65,.55,1]),circOut:Zn([.55,0,1,.45]),backIn:Zn([.31,.01,.66,-.59]),backOut:Zn([.33,1.53,.69,.99])};function ah(e,t){if(e)return typeof e=="function"?ih()?qp(e,t):"ease-out":zp(e)?Zn(e):Array.isArray(e)?e.map(n=>ah(n,t)||Al.easeOut):Al[e]}function Jk(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:l="easeOut",times:u}={},a=void 0){const d={[t]:n};u&&(d.offset=u);const c=ah(l,s);Array.isArray(c)&&(d.easing=c);const f={delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return a&&(f.pseudoElement=a),e.animate(d,f)}function lh(e){return typeof e=="function"&&"applyToOptions"in e}function Hk({type:e,...t}){return lh(e)&&ih()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ch extends qi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,vs(typeof t.type!="string");const a=Hk(t);this.animation=Jk(n,r,s,a,o),a.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=bs(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),sh(n,r,d),this.animation.cancel()}u==null||u(),this.notifyFinished()},eh(this,t,a)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ve(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ve(t)}get time(){return Ve(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ze(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:n,observe:r}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qk()?(this.animation.timeline=t,n==null||n(this.animation),Xe):r(this)}}const uh={anticipate:Np,backInOut:Rp,circInOut:Dp};function Yk(e){return e in uh}function Xk(e){typeof e.ease=="string"&&Yk(e.ease)&&(e.ease=uh[e.ease])}const qs=10;class Qk extends ch{constructor(t){Xk(t),Xp(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new es({...i,autoplay:!1}),u=Math.max(qs,Te.now()-this.startTime),a=yt(0,qs,u-qs),d=l.sample(u).value,{name:c}=this.options;o&&c&&sh(o,c,d),n.setWithVelocity(l.sample(Math.max(0,u-a)).value,d,a),l.stop()}}const Il=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Oe.test(e)||e==="0")&&!e.startsWith("url("));function eC(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tC(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Il(s,t),l=Il(o,t);return!i||!l?!1:eC(e)||(n==="spring"||lh(n))&&r}function qo(e){e.duration=0,e.type="keyframes"}const Jo=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),nC=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function rC(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&nC.test(e[t]))return!0;return!1}const Ml=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sC=Cp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oC(e){var c;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:l}=e;if(!n||!(Jo.has(n)||Ml.has(n)))return!1;const u=(c=t==null?void 0:t.owner)==null?void 0:c.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:a,transformTemplate:d}=t.owner.getProps();return sC()&&(Jo.has(n)||Ml.has(n)&&rC(l))&&(n!=="transform"||!d)&&!a&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const iC=40;class aC extends qi{constructor(t){var u;super(),this.stop=()=>{var a,d;this._animation&&(this._animation.stop(),(a=this.stopTimeline)==null||a.call(this)),(d=this.keyframeResolver)==null||d.cancel()},this.createdAt=Te.now();const{keyframes:n,name:r,motionValue:s,element:o}=t,i=t;i.autoplay??(i.autoplay=!0),i.delay??(i.delay=0),i.type??(i.type="keyframes"),i.repeat??(i.repeat=0),i.repeatDelay??(i.repeatDelay=0),i.repeatType??(i.repeatType="loop");const l=(o==null?void 0:o.KeyframeResolver)||Hi;this.keyframeResolver=new l(n,(a,d,c)=>this.onKeyframesResolved(a,d,i,!c),r,s,o),(u=this.keyframeResolver)==null||u.scheduleResolve()}onKeyframesResolved(t,n,r,s){var S,C;this.keyframeResolver=void 0;const{name:o,type:i,velocity:l,delay:u,isHandoff:a,onUpdate:d}=r;this.resolvedAt=Te.now();let c=!0;tC(t,o,i,l)||(c=!1,(mt.instantAnimations||!u)&&(d==null||d(bs(t,r,n))),t[0]=t[t.length-1],qo(r),r.repeat=0);const f=s?this.resolvedAt?this.resolvedAt-this.createdAt>iC?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:y}=r;r.startTime??(r.startTime=f),r.finalKeyframe=n,r.keyframes=t,r.onComplete=()=>{y==null||y(),this.notifyFinished()};const v=c&&!a&&oC(r);let T;if(v){r.element=(C=(S=r.motionValue)==null?void 0:S.owner)==null?void 0:C.current;try{T=new Qk(r)}catch{T=new es(r)}}else T=new es(r);this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this._animation.finished:super.finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Uk()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function dh(e,t,n,r=0,s=1){const o=Array.from(e).sort((a,d)=>a.sortNodePosition(d)).indexOf(t),i=e.size,l=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:l-o*r}const jl=30,lC=e=>!isNaN(parseFloat(e));class cC{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=Te.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Te.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lC(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){var r;return t==="change"?this.onChangeSubscribe(n):((r=this.events)[t]||(r[t]=new Yr)).add(n)}onChangeSubscribe(t){const{events:n}=this;return!n.change&&!this.changeSubscriber?this.changeSubscriber=t:(n.change||(n.change=new Yr,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)),()=>{var r;this.changeSubscriber===t?this.changeSubscriber=void 0:(r=n.change)==null||r.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){ee.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var r;const{current:t,changeSubscriber:n}=this;n?n(t):(r=this.events.change)==null||r.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Te.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>jl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,jl);return Pp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{var o;this.hasAnimated=!0;let r=!1,s;s=t(()=>{var i;r=!0,(i=this.events.animationComplete)==null||i.notify(),this.animation===s&&this.clearAnimation(),n()}),r||(this.animation=s),(o=this.events.animationStart)==null||o.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(e,t){return new cC(e,t)}function fh(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Yi(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?fh(n,e):n}const uC={type:"spring",stiffness:500,damping:25,restSpeed:10},dC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fC={type:"keyframes",duration:.8},pC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hC=(e,{keyframes:t})=>t.length>2?fC:St.has(e)?e.startsWith("scale")?dC(t[1]):uC:pC,mC=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function gC(e){for(const t in e)if(!mC.has(t))return!0;return!1}const Xi=(e,t,n,r={},s,o)=>i=>{const l=Yi(r,e)||{},u=l.delay||r.delay||0;let{elapsed:a=0}=r;a=a-Ze(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-a,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{i(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:s};gC(l)||Object.assign(d,hC(e,d)),d.duration&&(d.duration=Ze(d.duration)),d.repeatDelay&&(d.repeatDelay=Ze(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(qo(d),d.delay===0&&(c=!0)),(mt.instantAnimations||mt.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(c=!0,qo(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,c&&!o&&t.get()!==void 0){const f=bs(d.keyframes,l);if(f!==void 0){ee.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new es(d):new aC(d)},yC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vC(e){const t=yC.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function ph(e,t,n=1){const[r,s]=vC(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return Di(i)?parseFloat(i):i}return Vi(s)?ph(s,t,n+1):s}function bC(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function hh(e,t,n,r){const s=o=>typeof o=="function"?o(n!==void 0?n:e.custom,...bC(r)):o;return t=s(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),s(t)}function qt(e,t,n){return hh(e.getProps(),t,n,e)}const mh=(e,t)=>{var n;return t==="exit"?(n=e.presenceContext)==null?void 0:n.custom:void 0},gh=new Set(["width","height","top","left","right","bottom",...On]),xC=e=>Array.isArray(e);function wC(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,In(n))}function SC(e){return xC(e)?e[e.length-1]||0:e}function _C(e,t){const n=qt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const l=SC(o[i]);wC(e,i,l)}}const Ee=e=>!!(e&&e.getVelocity);function TC(e){return!!(Ee(e)&&e.add)}function Ho(e,t){const n=e.getValue("willChange");if(TC(n))return n.add(t);if(!n&&mt.WillChange){const r=new mt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Qi(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const EC="framerAppearId",yh="data-"+Qi(EC);function vh(e){return e.props[yh]}const kC=typeof window<"u";function CC({protectedKeys:e,needsAnimating:t},n){const r=n in e&&!t[n];return t[n]=!1,r}function bh(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var v;let{transition:o,transitionEnd:i,...l}=t;const u=e.getDefaultTransition();o=o?fh(o,u):u;const a=o==null?void 0:o.reduceMotion,d=o==null?void 0:o.skipAnimations;r&&(o=r);const c=[],f=s&&((v=e.animationState)==null?void 0:v.getState()[s]),y=o==null?void 0:o.path;y&&y.animateVisualElement(e,l,o,n,c);for(const T in l){const S=e.getValue(T,e.latestValues[T]??null),C=l[T];if(C===void 0||f&&CC(f,T))continue;const k={delay:n,...Yi(o||{},T)};d&&(k.skipAnimations=!0);const x=S.get();if(x!==void 0&&!S.isAnimating()&&!Array.isArray(C)&&C===x&&!k.velocity){ee.update(()=>S.set(C));continue}let p=!1;if(kC&&window.MotionHandoffAnimation){const _=vh(e);if(_){const E=window.MotionHandoffAnimation(_,T,ee);E!==null&&(k.startTime=E,p=!0)}}Ho(e,T);const b=a??e.shouldReduceMotion;S.start(Xi(T,S,C,b&&gh.has(T)?{type:!1}:k,e,p));const w=S.animation;w&&c.push(w)}if(i){const T=()=>ee.update(()=>{i&&_C(e,i)});c.length?Promise.all(c).then(T):T()}return c}function Yo(e,t,n={}){const r=qt(e,t,mh(e,n.type)),s=n.transitionOverride||((r==null?void 0:r.transition)??(e.getDefaultTransition()||{})),o=()=>Promise.all(r?bh(e,r,n):[]),i=(u=0)=>{const{variantChildren:a}=e,{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=s,y=[];return a==null||a.forEach(v=>{v.notify("AnimationStart",t),y.push(Yo(v,t,{...n,delay:u+(typeof d=="function"?0:d)+dh(a,v,d,c,f)}).then(()=>v.notify("AnimationComplete",t)))}),Promise.all(y)},{when:l}=s;return l?l==="beforeChildren"?o().then(()=>i()):i().then(o):Promise.all([o(),i(n.delay)])}function PC(e,t,n={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(s=>Yo(e,s,n))):typeof t=="string"?Yo(e,t,n):Promise.all(bh(e,qt(e,t,n.custom),n))).then(()=>{e.notify("AnimationComplete",t)})}const AC={test:e=>e==="auto",parse:e=>e},IC=e=>t=>t.test(e),MC=[Nn,O,lt,ft,ZE,VE,AC],Rl=e=>MC.find(IC(e));function jC(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zi(e):!0}const RC=new Set(["auto","none","0"]);function NC(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!RC.has(o)&&qE(o)&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]!==s&&(e[o]=Ji(n,s))}class OC extends Hi{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let c=t[d];if(typeof c=="string"&&(c=c.trim(),Vi(c))){const f=ph(c,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!gh.has(r)||t.length!==2)return;const[s,o]=t;if(typeof s=="number"&&typeof o=="number")return;const i=Rl(s),l=Rl(o),u=yl(s),a=yl(o);if(u!==a&&Gt[r]){this.needsMeasurement=!0;return}if(i!==l)if(Cl(i)&&Cl(l))for(let d=0;d<t.length;d++){const c=t[d];typeof c=="string"&&(t[d]=parseFloat(c))}else Gt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||jC(t[s]))&&r.push(s);r.length&&NC(t,r,n)}measure(){const{element:t,name:n}=this;return Gt[n](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var o;const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&((o=this.motionValue)==null||o.jump(s,!1))}measureEndState(){var o,i;const{element:t,unresolvedKeyframes:n}=this;if(!t||!t.current)return;(o=this.motionValue)==null||o.jump(this.measuredOrigin,!1);const r=n.length-1,s=n[r];n[r]=this.measure(),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const ea=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function DC(e){return kp(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function ta(e){return kp(e)&&"ownerSVGElement"in e}const Xo=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function xh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const zC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$C=On.length;function LC(e,t,n){let r="",s=!0;for(let i=0;i<$C;i++){const l=On[i],u=e[l];if(u===void 0)continue;let a=!0;if(typeof u=="number")a=u===(l.startsWith("scale")?1:0);else{const d=parseFloat(u);a=l.startsWith("scale")?d===1:d===0}if(!a||n){const d=Xo(u,ts[l]);if(!a){s=!1;const c=zC[l]||l;r+=`${c}(${d}) `}n&&(t[l]=d)}}const o=e.pathRotation;return o&&(s=!1,r+=`rotate(${Xo(o,ts.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function na(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,l=!1;for(const u in t){const a=t[u];if(St.has(u)){i=!0;continue}else if(Lp(u)){s[u]=a;continue}else{const d=Xo(a,ts[u]);u.startsWith("origin")?(l=!0,o[u]=d):r[u]=d}}if(t.transform||(i||n?r.transform=LC(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:a="50%",originZ:d=0}=o;r.transformOrigin=`${u} ${a} ${d}`}}const FC={offset:"stroke-dashoffset",array:"stroke-dasharray"},VC={offset:"strokeDashoffset",array:"strokeDasharray"};function ZC(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?FC:VC;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const wh=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Sh(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...l},u,a,d){if(na(e,l,a),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:c,style:f}=e;for(const y of wh)c[y]!==void 0&&(f[y]=c[y],delete c[y]);(f.transform||c.transformOrigin)&&(f.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete c.transformBox),t!==void 0&&(c.x=t),n!==void 0&&(c.y=n),r!==void 0&&(c.scale=r),s!==void 0&&ZC(c,s,o,i,!1)}function _h({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BC({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UC(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(e){return e===void 0||e===1}function Qo({scale:e,scaleX:t,scaleY:n}){return!Js(e)||!Js(t)||!Js(n)}function Lt(e){return Qo(e)||Th(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Th(e){return Nl(e.x)||Nl(e.y)}function Nl(e){return e&&e!=="0%"}function ns(e,t,n){const r=e-n,s=t*r;return n+s}function Ol(e,t,n,r,s){return s!==void 0&&(e=ns(e,s,r)),ns(e,n,r)+t}function ei(e,t=0,n=1,r,s){e.min=Ol(e.min,t,n,r,s),e.max=Ol(e.max,t,n,r,s)}function Eh(e,{x:t,y:n}){ei(e.x,t.translate,t.scale,t.originPoint),ei(e.y,n.translate,n.scale,n.originPoint)}const Dl=.999999999999,zl=1.0000000000001;function WC(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let u=0;u<s;u++){o=n[u],i=o.projectionDelta;const{visualElement:a}=o.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ot(e.x,-o.scroll.offset.x),ot(e.y,-o.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Eh(e,i)),r&&Lt(o.latestValues)&&Ar(e,o.latestValues,(l=o.layout)==null?void 0:l.layoutBox))}t.x<zl&&t.x>Dl&&(t.x=1),t.y<zl&&t.y>Dl&&(t.y=1)}function ot(e,t){e.min+=t,e.max+=t}function $l(e,t,n,r,s=.5){const o=Q(e.min,e.max,s);ei(e,t,n,o,r)}function Ll(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Ar(e,t,n){const r=n??e;$l(e.x,Ll(t.x,r.x),t.scaleX,t.scale,t.originX),$l(e.y,Ll(t.y,r.y),t.scaleY,t.scale,t.originY)}function kh(e,t){return _h(UC(e.getBoundingClientRect(),t))}function GC(e,t,n){const r=kh(e,n),{scroll:s}=t;return s&&(ot(r.x,s.offset.x),ot(r.y,s.offset.y)),r}const{schedule:ra}=Kp(queueMicrotask,!1),He={x:!1,y:!1};function Ch(){return He.x||He.y}function KC(e){return e==="x"||e==="y"?He[e]?null:(He[e]=!0,()=>{He[e]=!1}):He.x||He.y?null:(He.x=He.y=!0,()=>{He.x=He.y=!1})}function Ph(e,t){const n=xh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function qC(e){return!(e.pointerType==="touch"||Ch())}function JC(e,t,n={}){const[r,s,o]=Ph(e,n);return r.forEach(i=>{let l=!1,u=!1,a;const d=()=>{i.removeEventListener("pointerleave",v)},c=S=>{a&&(a(S),a=void 0),d()},f=S=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,c(S))},y=()=>{l=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},v=S=>{if(S.pointerType!=="touch"){if(l){u=!0;return}c(S)}},T=S=>{if(!qC(S))return;u=!1;const C=t(i,S);typeof C=="function"&&(a=C,i.addEventListener("pointerleave",v,s))};i.addEventListener("pointerenter",T,s),i.addEventListener("pointerdown",y,s)}),o}const Ah=(e,t)=>t?e===t?!0:Ah(e,t.parentElement):!1,sa=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,HC=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YC(e){return HC.has(e.tagName)||e.isContentEditable===!0}const XC=new Set(["INPUT","SELECT","TEXTAREA"]);function QC(e){return XC.has(e.tagName)||e.isContentEditable===!0}const Ir=new WeakSet;function Fl(e){return t=>{t.key==="Enter"&&e(t)}}function Hs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const eP=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Fl(()=>{if(Ir.has(n))return;Hs(n,"down");const s=Fl(()=>{Hs(n,"up")}),o=()=>Hs(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vl(e){return sa(e)&&!Ch()}const Zl=new WeakSet;function tP(e,t,n={}){const[r,s,o]=Ph(e,n),i=l=>{const u=l.currentTarget;if(!Vl(l)||Zl.has(l))return;Ir.add(u),n.stopPropagation&&Zl.add(l);const a=t(u,l),d={...s,capture:!0},c=(v,T)=>{window.removeEventListener("pointerup",f,d),window.removeEventListener("pointercancel",y,d),Ir.has(u)&&Ir.delete(u),Vl(v)&&typeof a=="function"&&a(v,{success:T})},f=v=>{c(v,u===window||u===document||n.useGlobalTarget||Ah(u,v.target))},y=v=>{c(v,!1)};window.addEventListener("pointerup",f,d),window.addEventListener("pointercancel",y,d)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",i,s),DC(l)&&(l.addEventListener("focus",a=>eP(a,s)),!YC(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),o}const Mr=new WeakMap;let xt;const Ih=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:ta(r)&&"getBBox"in r?r.getBBox()[t]:r[n],nP=Ih("inline","width","offsetWidth"),rP=Ih("block","height","offsetHeight");function sP({target:e,borderBoxSize:t}){var n;(n=Mr.get(e))==null||n.forEach(r=>{r(e,{get width(){return nP(e,t)},get height(){return rP(e,t)}})})}function oP(e){e.forEach(sP)}function iP(){typeof ResizeObserver>"u"||(xt=new ResizeObserver(oP))}function aP(e,t){xt||iP();const n=xh(e);return n.forEach(r=>{let s=Mr.get(r);s||(s=new Set,Mr.set(r,s)),s.add(t),xt==null||xt.observe(r)}),()=>{n.forEach(r=>{const s=Mr.get(r);s==null||s.delete(t),s!=null&&s.size||xt==null||xt.unobserve(r)})}}const jr=new Set;let gn;function lP(){gn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jr.forEach(t=>t(e))},window.addEventListener("resize",gn)}function cP(e){return jr.add(e),gn||lP(),()=>{jr.delete(e),!jr.size&&typeof gn=="function"&&(window.removeEventListener("resize",gn),gn=void 0)}}function Bl(e,t){return typeof e=="function"?cP(e):aP(e,t)}function uP(e){return ta(e)&&e.tagName==="svg"}const Ul=e=>typeof e=="number"?e:parseFloat(e),Wl=()=>({translate:0,scale:1,origin:0,originPoint:0}),yn=()=>({x:Wl(),y:Wl()}),Gl=()=>({min:0,max:0}),ye=()=>({x:Gl(),y:Gl()}),dP=new WeakMap;function xs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function nr(e){return typeof e=="string"||Array.isArray(e)}const oa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kl=["initial",...oa];function ws(e){if(xs(e.animate))return!0;for(let t=0;t<Kl.length;t++)if(nr(e[Kl[t]]))return!0;return!1}function Mh(e){return!!(ws(e)||e.variants)}function fP(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Ee(s))e.addValue(r,s);else if(Ee(o))e.addValue(r,In(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,In(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ti={current:null},jh={current:!1},pP=typeof window<"u";function hP(){if(jh.current=!0,!!pP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ti.current=e.matches;e.addEventListener("change",t),t()}else ti.current=!1}const ql=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rs={};function Rh(e){rs=e}function mP(){return rs}class gP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:l},u={}){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=Hi,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 y=Te.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,ee.render(this.render,!1,!0))};const{latestValues:a,renderState:d}=l;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=u,this.blockInitialAnimation=!!i,this.isControllingVariants=ws(n),this.isVariantNode=Mh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in f){const v=f[y];a[y]!==void 0&&Ee(v)&&v.set(a[y])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];if(this.current=t,dP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let s=this;do s=s.props.inherit!==!1&&s.parent;while(s&&!s.isVariantNode);if(s){const{variantChildren:o}=s;o.add(this),this.removeFromVariantTree=()=>o.delete(this)}}this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(jh.current||hP(),this.shouldReduceMotion=ti.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ct(this.notifyUpdate),Ct(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Jo.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:l,times:u,ease:a,duration:d}=n.accelerate,c=new ch({element:this.current,name:t,keyframes:l,times:u,ease:a,duration:Ze(d)}),f=i(c);this.valueSubscriptions.set(t,()=>{f(),c.cancel()});return}const r=St.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ee.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rs){const n=rs[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];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):ye()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ql.length;r++){const s=ql[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=fP(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,n){const r=this.values.get(t);if(n!==r){r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n);const s=n.get();s!==void 0&&(this.latestValues[t]=s)}}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){var s;if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=In(n??((s=this.getDefaultValue)==null?void 0:s.call(this,t)),{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Di(r)||zi(r))?r=parseFloat(r):typeof r!="number"&&!Oe.test(r)&&Oe.test(n)&&(r=Ji(t,n)),this.setBaseTarget(t,Ee(r)?r.get():r)),Ee(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}on(t,n){return this.events[t]||(this.events[t]=new Yr),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ra.render(this.render)}}class Nh extends gP{constructor(){super(...arguments),this.KeyframeResolver=OC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Oh(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}const rr={};function Dh(e,{layout:t,layoutId:n}){return St.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!rr[e]||e==="opacity")}function ia(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const l in r)(Ee(r[l])||s&&Ee(s[l])||Dh(l,e)||((i=n==null?void 0:n.getValue(l))==null?void 0:i.liveStyle)!==void 0)&&(o[l]=r[l]);return o}function yP(e){return window.getComputedStyle(e)}class vP extends Nh{constructor(){super(...arguments),this.type="html",this.renderInstance=Oh}mount(t){vs(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(St.has(n))return(r=this.projection)!=null&&r.isProjecting?tr(n):$k(t,n);{const s=yP(t),o=(Lp(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return kh(t,n)}build(t,n,r){na(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ia(t,n,r)}}const zh=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"]),$h=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bP(e,t,n,r){Oh(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(zh.has(s)?s:Qi(s),t.attrs[s])}function Lh(e,t,n){const r=ia(e,t,n);for(const s in e)if(Ee(e[s])||Ee(t[s])){const o=On.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class xP extends Nh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ye}getBaseTargetFromProps(t,n){return St.has(n)?super.getBaseTargetFromProps(t,n)??tr(n):t[n]}getDefaultValue(t){return St.has(t)?this.latestValues[t]??tr(t):void 0}readValueFromInstance(t,n){if(St.has(n)){const r=th(n);return r&&r.default||0}if(wh.includes(n)){const s=getComputedStyle(t)[n];if(typeof s=="string"&&s)return s.trim()}return n=zh.has(n)?n:Qi(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Lh(t,n,r)}build(t,n,r){Sh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){bP(t,n,r,s)}mount(t){this.isSVGTag=$h(t.tagName),super.mount(t)}}function Fh(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const wP=[...oa].reverse();function SP(e){let t=l=>Promise.all(l.map(({animation:u,options:a})=>PC(e,u,a))),n=Jl(),r=!0,s=!1;function o(l){var k;const{props:u,parent:a,manuallyAnimateOnMount:d}=e,c=r||s,f=[],y=new Set;let v={},T=1/0,S=e;do S=S.props.inherit!==!1&&S.parent;while(S&&!S.isControllingVariants);if(wP.forEach((x,p)=>{var $e,ke;const b=n[x],w=u[x],_=S&&S.props[x],E=w!==void 0?w:nr(_)||_===!1?_:void 0,I=nr(E),z=x===l?b.isActive:null;z===!1&&(T=p);const K=I&&w===void 0&&!(c&&d);if(b.protectedKeys={...v},!b.isActive&&z===null||!E&&!b.prevProp||xs(E)||typeof E=="boolean")return;if(x==="exit"&&b.isActive&&z!==!0){v={...v,...b.prevResolvedValues};return}const L=_P(b.prevProp,E);let Y=L||I&&(z&&!K||p>T),W=!1;const le=Array.isArray(E)?E:[E];let oe={};if(z!==!1)for(const M of le){const{transition:he,transitionEnd:A,...$}=qt(e,M,mh(e,x))||{};oe={...oe,...$,...A}}const{prevResolvedValues:ce}=b;for(const M in{...ce,...oe}){if(M in v)continue;const he=oe[M],A=ce[M],$=Array.isArray(he)&&Array.isArray(A)?!Fh(he,A)||L:he!==A;if($&&he==null)y.add(M);else if($||he!==void 0&&y.has(M)){Y=!0,y.delete(M)&&(W=!0),b.needsAnimating[M]=!0;const Z=e.getValue(M);Z&&(Z.liveStyle=!1)}else b.protectedKeys[M]=!0}if(b.prevProp=E,b.prevResolvedValues=oe,b.isActive&&(v={...v,...oe}),Y&&(!(K&&L)||W))for(const M of le){const he={type:x};if(typeof M=="string"&&c&&d&&(a!=null&&a.enteringChildren)){const A=(ke=($e=qt(a,M))==null?void 0:$e.transition)==null?void 0:ke.delayChildren;he.delay=dh(a.enteringChildren,e,A)}f.push({animation:M,options:he})}}),y.size){const{initial:x}=u,p={},b=typeof x!="boolean"&&qt(e,Array.isArray(x)?x[0]:x,(k=e.presenceContext)==null?void 0:k.custom);b&&b.transition&&(p.transition=b.transition),y.forEach(w=>{const _=e.getValue(w);_&&(_.liveStyle=!0);const E=b&&!Array.isArray(x)?b[w]:void 0,I=e.getBaseTargetFromProps(u,w);p[w]=(E!==void 0?E:I!==void 0&&!Ee(I)?I:e.initialValues[w]===void 0?e.baseTarget[w]:void 0)??null}),f.push({animation:p})}const C=c&&e.blockInitialAnimation||r&&!d&&(u.initial===!1||u.initial===u.animate);return r=s=!1,!C&&f.length?t(f):Promise.resolve()}function i(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(c=>{var f;return(f=c.animationState)==null?void 0:f.setActive(l,u)}),n[l].isActive=u;const a=o(l);for(const c in n)n[c].protectedKeys={};return a}return{animateChanges:o,setActive:i,setAnimateFunction:l=>{t=l(e)},getState:()=>n,reset:()=>{n=Jl(),s=!0}}}function _P(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fh(t,e):!1}function Jl(){const e={};for(const t of oa)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ni(e,t){e.min=t.min,e.max=t.max}function Je(e,t){ni(e.x,t.x),ni(e.y,t.y)}function Hl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Vh=1e-4,TP=1-Vh,EP=1+Vh,Zh=.01,kP=0-Zh,CP=0+Zh;function je(e){return e.max-e.min}function PP(e,t,n){return Math.abs(e-t)<=n}function Yl(e,t,n,r=.5){e.origin=r,e.originPoint=Q(t.min,t.max,e.origin),e.scale=je(n)/je(t),e.translate=Q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=TP&&e.scale<=EP||isNaN(e.scale))&&(e.scale=1),(e.translate>=kP&&e.translate<=CP||isNaN(e.translate))&&(e.translate=0)}function Wn(e,t,n,r){Yl(e.x,t.x,n.x,r?r.originX:void 0),Yl(e.y,t.y,n.y,r?r.originY:void 0)}function Xl(e,t,n,r=0){const s=r?Q(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+je(t)}function AP(e,t,n,r){Xl(e.x,t.x,n.x,r==null?void 0:r.x),Xl(e.y,t.y,n.y,r==null?void 0:r.y)}function Ql(e,t,n,r=0){const s=r?Q(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+je(t)}function ss(e,t,n,r){Ql(e.x,t.x,n.x,r==null?void 0:r.x),Ql(e.y,t.y,n.y,r==null?void 0:r.y)}function ec(e,t,n,r,s){return e-=t,e=ns(e,1/n,r),s!==void 0&&(e=ns(e,1/s,r)),e}function IP(e,t=0,n=1,r=.5,s,o=e,i=e){if(lt.test(t)&&(t=parseFloat(t),t=Q(i.min,i.max,t/100)-i.min),typeof t!="number")return;let l=Q(o.min,o.max,r);e===o&&(l-=t),e.min=ec(e.min,t,n,l,s),e.max=ec(e.max,t,n,l,s)}function tc(e,t,[n,r,s],o,i){IP(e,t[n],t[r],t[s],t.scale,o,i)}const MP=["x","scaleX","originX"],jP=["y","scaleY","originY"];function nc(e,t,n,r){tc(e.x,t,MP,n?n.x:void 0,r?r.x:void 0),tc(e.y,t,jP,n?n.y:void 0,r?r.y:void 0)}function rc(e){return e.translate===0&&e.scale===1}function Bh(e){return rc(e.x)&&rc(e.y)}function sc(e,t){return e.min===t.min&&e.max===t.max}function RP(e,t){return sc(e.x,t.x)&&sc(e.y,t.y)}function oc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uh(e,t){return oc(e.x,t.x)&&oc(e.y,t.y)}function ic(e){return je(e.x)/je(e.y)}function ac(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function st(e){return[e("x"),e("y")]}function lc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=lc(e,t.target.x),r=lc(e,t.target.y);return`${n}% ${r}%`}},NP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Oe.parse(e);if(s.length>5)return r;const o=Oe.createTransformer(e),i=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;s[0+i]/=l,s[1+i]/=u;const a=Q(l,u,.5);return typeof s[2+i]=="number"&&(s[2+i]/=a),typeof s[3+i]=="number"&&(s[3+i]/=a),o(s)}};function OP(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:a,rotate:d,pathRotation:c,rotateX:f,rotateY:y,skewX:v,skewY:T}=n;a&&(r=`perspective(${a}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),T&&(r+=`skewY(${T}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const DP=ea.length,cc=e=>typeof e=="number"||O.test(e);function zP(e,t,n,r,s,o){s?(e.opacity=Q(0,n.opacity??1,$P(r)),e.opacityExit=Q(t.opacity??1,0,LP(r))):o&&(e.opacity=Q(t.opacity??1,n.opacity??1,r));for(let i=0;i<DP;i++){const l=ea[i];let u=uc(t,l),a=uc(n,l);if(u===void 0&&a===void 0)continue;u||(u=0),a||(a=0),u===0||a===0||cc(u)===cc(a)?(e[l]=Math.max(Q(Ul(u),Ul(a),r),0),(lt.test(a)||lt.test(u))&&(e[l]+="%")):e[l]=a}(t.rotate||n.rotate)&&(e.rotate=Q(t.rotate||0,n.rotate||0,r))}function uc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $P=Wh(0,.5,Op),LP=Wh(.5,.95,Xe);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(Xn(e,t,r))}function FP(e,t,n){const r=Ee(e)?e:In(e);return r.start(Xi("",r,t,n)),r.animation}function sr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const VP=(e,t)=>e.depth-t.depth;class ZP{constructor(){this.children=[],this.isDirty=!1}add(t){Oi(this.children,t),this.isDirty=!0}remove(t){Hr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VP),this.isDirty=!1,this.children.forEach(t)}}function BP(e,t){const n=Te.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(Ct(r),e(o-t))};return ee.setup(r,!0),()=>Ct(r)}function Rr(e){return Ee(e)?e.get():e}class UP{constructor(){this.members=[]}add(t){Oi(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Hr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Hr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:i}=t.options;(o===void 0||o!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,o,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(s=t.resumingFrom)==null?void 0:(o=s.options).onExitComplete)==null||i.call(o)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const WP={borderRadius:{...Fn,applyTo:[...ea]},borderTopLeftRadius:Fn,borderTopRightRadius:Fn,borderBottomLeftRadius:Fn,borderBottomRightRadius:Fn,boxShadow:NP},Nr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(rr,{...WP,...rr});const Ys=["","X","Y","Z"],GP=1e3;let KP=0;function Xs(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Gh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Gh(r)}function Kh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},l=t==null?void 0:t()){this.id=KP++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(HP),this.nodes.forEach(rA),this.nodes.forEach(sA),this.nodes.forEach(YP)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new ZP)}addEventListener(i,l){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Yr),this.eventHandlers.get(i).add(l)}notifyListeners(i,...l){const u=this.eventHandlers.get(i);u&&u.notify(...l)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=ta(i)&&!uP(i),this.instance=i;const{layoutId:l,layout:u,visualElement:a}=this.options;if(a&&!a.current&&a.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),e){let d,c=0;const f=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{c=window.innerWidth}),e(i,()=>{const y=window.innerWidth;y!==c&&(c=y,this.root.updateBlockedByResize=!0,d&&d(),d=BP(f,250),Nr.hasAnimatedSinceResize&&(Nr.hasAnimatedSinceResize=!1,this.nodes.forEach(pc)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&a&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:c,hasRelativeLayoutChanged:f,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||a.getDefaultTransition()||cA,{onLayoutAnimationStart:T,onLayoutAnimationComplete:S}=a.getProps(),C=!this.targetLayout||!Uh(this.targetLayout,y),k=!c&&f;if(this.options.layoutRoot||this.resumeFrom||k||c&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Yi(v,"layout"),onPlay:T,onComplete:S};(a.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,k,x.path)}else c||pc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ct(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(oA),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const c=this.path[d];c.shouldResetTransform=!0,(typeof c.latestValues.x=="string"||typeof c.latestValues.y=="string")&&(c.isLayoutDirty=!0),c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const a=this.getTransformTemplate();this.prevTransformTemplateValue=a?a(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(QP),this.nodes.forEach(dc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eA),this.nodes.forEach(tA),this.nodes.forEach(nA),this.nodes.forEach(qP),this.nodes.forEach(JP)):this.nodes.forEach(fc),this.clearAllSnapshots();const l=Te.now();ve.delta=yt(0,1e3/60,l-ve.timestamp),ve.timestamp=l,ve.isProcessing=!0,Ws.update.process(ve),Ws.preRender.process(ve),Ws.render.process(ve),ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ra.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XP),this.sharedNodes.forEach(iA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!je(this.snapshot.measuredBox.x)&&!je(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=ye()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Bh(this.projectionDelta),u=this.getTransformTemplate(),a=u?u(this.latestValues,""):void 0,d=a!==this.prevTransformTemplateValue;i&&this.instance&&(l||Lt(this.latestValues)||d)&&(s(this.instance,a),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return i&&(u=this.removeTransform(u)),uA(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var a;const{visualElement:i}=this.options;if(!i)return ye();const l=i.measureViewportBox();if(!(((a=this.scroll)==null?void 0:a.wasRoot)||this.path.some(dA))){const{scroll:d}=this.root;d&&(ot(l.x,d.offset.x),ot(l.y,d.offset.y))}return l}removeElementScroll(i){var u;const l=ye();if(Je(l,i),(u=this.scroll)!=null&&u.wasRoot)return l;for(let a=0;a<this.path.length;a++){const d=this.path[a],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&Je(l,i),ot(l.x,c.offset.x),ot(l.y,c.offset.y))}return l}applyTransform(i,l=!1,u){var d,c;const a=u||ye();Je(a,i);for(let f=0;f<this.path.length;f++){const y=this.path[f];!l&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(ot(a.x,-y.scroll.offset.x),ot(a.y,-y.scroll.offset.y)),Lt(y.latestValues)&&Ar(a,y.latestValues,(d=y.layout)==null?void 0:d.layoutBox)}return Lt(this.latestValues)&&Ar(a,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),a}removeTransform(i){var u;const l=ye();Je(l,i);for(let a=0;a<this.path.length;a++){const d=this.path[a];if(!Lt(d.latestValues))continue;let c;d.instance&&(Qo(d.latestValues)&&d.updateSnapshot(),c=ye(),Je(c,d.measurePageBox())),nc(l,d.latestValues,(u=d.snapshot)==null?void 0:u.layoutBox,c)}return Lt(this.latestValues)&&nc(l,this.latestValues),l}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var y;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(i||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:c}=this.options;if(!this.layout||!(d||c))return;this.resolvedRelativeTargetAt=ve.timestamp;const f=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ye(),this.targetWithTransforms=ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),AP(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Je(this.target,this.layout.layoutBox),Eh(this.target,this.targetDelta)):Je(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Qo(this.parent.latestValues)||Th(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,l,u){this.relativeParent=i,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ye(),this.relativeTargetOrigin=ye(),ss(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),Je(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const i=this.getLead(),l=!!this.resumingFrom||this!==i;let u=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ve.timestamp&&(u=!1),u)return;const{layout:a,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(a||d))return;Je(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,f=this.treeScale.y;WC(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=ye());const{target:y}=i;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Hl(this.prevProjectionDelta.x,this.projectionDelta.x),Hl(this.prevProjectionDelta.y,this.projectionDelta.y)),Wn(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==f||!ac(this.projectionDelta.x,this.prevProjectionDelta.x)||!ac(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),i){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yn(),this.projectionDelta=yn(),this.projectionDeltaWithTransform=yn()}setAnimationOrigin(i,l=!1,u){const a=this.snapshot,d=a?a.latestValues:{},c={...this.latestValues},f=yn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const y=ye(),v=a?a.source:void 0,T=this.layout?this.layout.source:void 0,S=v!==T,C=this.getStack(),k=!C||C.members.length<=1,x=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(lA));this.animationProgress=0;let p;const b=u==null?void 0:u.interpolateProjection(i);this.mixTargetDelta=w=>{const _=w/1e3,E=b==null?void 0:b(_);E?(f.x.translate=E.x,f.x.scale=Q(i.x.scale,1,_),f.x.origin=i.x.origin,f.x.originPoint=i.x.originPoint,f.y.translate=E.y,f.y.scale=Q(i.y.scale,1,_),f.y.origin=i.y.origin,f.y.originPoint=i.y.originPoint):(hc(f.x,i.x,_),hc(f.y,i.y,_)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ss(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),aA(this.relativeTarget,this.relativeTargetOrigin,y,_),p&&RP(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p=ye()),Je(p,this.relativeTarget)),S&&(this.animationValues=c,zP(c,d,this.latestValues,_,x,k)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=c),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var l,u,a;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(a=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||a.stop(),this.pendingAnimation&&(Ct(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{Nr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=FP(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),Ck(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(GP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead(),{targetWithTransforms:l,layout:u,latestValues:a}=i;let{target:d}=i;if(!(!l||!d||!u)){if(this!==i&&this.layout&&u&&qh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){d=this.target||ye();const c=je(this.layout.layoutBox.x);d.x.min=i.target.x.min,d.x.max=d.x.min+c;const f=je(this.layout.layoutBox.y);d.y.min=i.target.y.min,d.y.max=d.y.min+f}Je(l,d),Ar(l,a),Wn(this.projectionDeltaWithTransform,this.layoutCorrected,l,a)}}registerSharedNode(i,l){this.sharedNodes.has(i)||this.sharedNodes.set(i,new UP),this.sharedNodes.get(i).add(l);const a=l.options.initialPromotionConfig;l.promote({transition:a?a.transition:void 0,preserveFollowOpacity:a&&a.shouldPreserveFollowOpacity?a.shouldPreserveFollowOpacity(l):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var l;const{layoutId:i}=this.options;return i?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:i}=this.options;return i?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:l,preserveFollowOpacity:u}={}){const a=this.getStack();a&&a.promote(this,u),i&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let l=!1;const{latestValues:u}=i;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const a={};u.z&&Xs("z",i,a,this.animationValues);for(let d=0;d<Ys.length;d++)Xs(`rotate${Ys[d]}`,i,a,this.animationValues),Xs(`skew${Ys[d]}`,i,a,this.animationValues);i.render();for(const d in a)i.setStaticValue(d,a[d]),this.animationValues&&(this.animationValues[d]=a[d]);i.scheduleRender()}applyProjectionStyles(i,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Rr(l==null?void 0:l.pointerEvents)||"",i.transform=u?u(this.latestValues,""):"none";return}const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Rr(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Lt(this.latestValues)&&(i.transform=u?u({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=a.animationValues||a.latestValues;this.applyTransformsToTarget();let c=OP(this.projectionDeltaWithTransform,this.treeScale,d);u&&(c=u(d,c)),i.transform=c;const{x:f,y}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${y.origin*100}% 0`,a.animationValues?i.opacity=a===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=a===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in rr){if(d[v]===void 0)continue;const{correct:T,applyTo:S,isCSSVariable:C}=rr[v],k=c==="none"?d[v]:T(d[v],a);if(S){const x=S.length;for(let p=0;p<x;p++)i[S[p]]=k}else C?this.options.visualElement.renderState.vars[v]=k:i[v]=k}this.options.layoutId&&(i.pointerEvents=a===this?Rr(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var l;return(l=i.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(dc),this.root.sharedNodes.clear()}}}function qP(e){e.updateLayout()}function JP(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;if(o==="size")st(c=>{const f=i?t.measuredBox[c]:t.layoutBox[c],y=je(f);f.min=r[c].min,f.max=f.min+y});else if(o==="x"||o==="y"){const c=o==="x"?"y":"x";ni(i?t.measuredBox[c]:t.layoutBox[c],r[c])}else qh(o,t.layoutBox,r)&&st(c=>{const f=i?t.measuredBox[c]:t.layoutBox[c],y=je(r[c]);f.max=f.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+y)});const l=yn();Wn(l,r,t.layoutBox);const u=yn();i?Wn(u,e.applyTransform(s,!0),t.measuredBox):Wn(u,r,t.layoutBox);const a=!Bh(l);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:y}=c;if(f&&y){const v=e.options.layoutAnchor||void 0,T=ye();ss(T,t.layoutBox,f.layoutBox,v);const S=ye();ss(S,r,y.layoutBox,v),Uh(T,S)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=T,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:a,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function HP(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function YP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function XP(e){e.clearSnapshot()}function dc(e){e.clearMeasurements()}function QP(e){e.isLayoutDirty=!0,e.updateLayout()}function fc(e){e.isLayoutDirty=!1}function eA(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function tA(e){var t;e.relativeTarget&&((t=e.relativeParent)!=null&&t.isLayoutDirty)&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function nA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rA(e){e.resolveTargetDelta()}function sA(e){e.calcProjection()}function oA(e){e.resetSkewAndRotation()}function iA(e){e.removeLeadSnapshot()}function hc(e,t,n){e.translate=Q(t.translate,0,n),e.scale=Q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mc(e,t,n,r){e.min=Q(t.min,n.min,r),e.max=Q(t.max,n.max,r)}function aA(e,t,n,r){mc(e.x,t.x,n.x,r),mc(e.y,t.y,n.y,r)}function lA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},gc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yc=gc("applewebkit/")&&!gc("chrome/")?Math.round:Xe;function vc(e){e.min=yc(e.min),e.max=yc(e.max)}function uA(e){vc(e.x),vc(e.y)}function qh(e,t,n){return e==="position"||e==="preserve-aspect"&&!PP(ic(t),ic(n),.2)}function dA(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fA=Kh({attachResizeListener:(e,t)=>sr(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Qs={current:void 0},Jh=Kh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qs.current){const e=new fA({});e.mount(window),e.setOptions({layoutScroll:!0}),Qs.current=e}return Qs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Hh=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function pA(e=!0){const t=m.useContext(Ni);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=m.useId();m.useEffect(()=>{if(e)return s(o)},[e]);const i=m.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const Yh=m.createContext({strict:!1}),bc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let xc=!1;function hA(){if(xc)return;const e={};for(const t in bc)e[t]={isEnabled:n=>bc[t].some(r=>!!n[r])};Rh(e),xc=!0}function Xh(){return hA(),mP()}function mA(e){const t=Xh();for(const n in e)t[n]={...t[n],...e[n]};Rh(t)}const Ss=m.createContext({});function gA(e,t){if(ws(e)){const{initial:n,animate:r}=e;return{initial:n===!1||nr(n)?n:void 0,animate:nr(r)?r:void 0}}return e.inherit!==!1?t:{}}function yA(e){const{initial:t,animate:n}=gA(e,m.useContext(Ss));return m.useMemo(()=>({initial:t,animate:n}),[wc(t),wc(n)])}function wc(e){return Array.isArray(e)?e.join(" "):e}const aa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qh(e,t,n){for(const r in t)!Ee(t[r])&&!Dh(r,n)&&(e[r]=t[r])}function vA({transformTemplate:e},t){return m.useMemo(()=>{const n=aa();return na(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bA(e,t){const n=e.style||{},r={};return Qh(r,n,e),Object.assign(r,vA(e,t)),r}function xA(e,t){const n={},r=bA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const em=()=>({...aa(),attrs:{}});function wA(e,t,n,r){const s=m.useMemo(()=>{const o=em();return Sh(o,t,$h(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Qh(o,e.style,e),s.style={...o,...s.style}}return s}const SA=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function os(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||SA.has(e)}function _A(e,t){return e.startsWith("on")?!os(e):(t==null?void 0:t(e))??!os(e)}function TA(e,t,n,r){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||Ee(e[o])||(_A(o,r)||n===!0&&os(o)||!t&&!os(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}const EA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function la(e){return typeof e!="string"||e.includes("-")?!1:!!(EA.indexOf(e)>-1||/[A-Z]/u.test(e))}function kA(e,t,n,{latestValues:r},s,o=!1,i,l){const a=(i??la(e)?wA:xA)(t,r,s,e),d=TA(t,typeof e=="string",o,l),c=e!==m.Fragment?{...d,...a,ref:n}:{},{children:f}=t,y=m.useMemo(()=>Ee(f)?f.get():f,[f]);return m.createElement(e,{...c,children:y})}function CA({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:PA(n,r,s,e),renderState:t()}}function PA(e,t,n,r){const s={},o=r(e,{});for(const f in o)s[f]=Rr(o[f]);let{initial:i,animate:l}=e;const u=ws(e),a=Mh(e);t&&a&&!u&&e.inherit!==!1&&(i===void 0&&(i=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const c=d?l:i;if(c&&typeof c!="boolean"&&!xs(c)){const f=Array.isArray(c)?c:[c];for(let y=0;y<f.length;y++){const v=hh(e,f[y]);if(v){const{transitionEnd:T,transition:S,...C}=v;for(const k in C){let x=C[k];if(Array.isArray(x)){const p=d?x.length-1:0;x=x[p]}x!==null&&(s[k]=x)}for(const k in T)s[k]=T[k]}}}return s}const tm=e=>(t,n)=>{const r=m.useContext(Ss),s=m.useContext(Ni),o=()=>CA(e,t,r,s);return n?o():TE(o)},AA=tm({scrapeMotionValuesFromProps:ia,createRenderState:aa}),IA=tm({scrapeMotionValuesFromProps:Lh,createRenderState:em}),MA=Symbol.for("motionComponentSymbol");function jA(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(o=>{var l;o&&((l=e.onMount)==null||l.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=r.current;if(typeof i=="function")if(o){const u=i(o);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o)},[t])}const nm=m.createContext({});function fn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function RA(e,t,n,r,s,o){var x,p;const{visualElement:i}=m.useContext(Ss),l=m.useContext(Yh),u=m.useContext(Ni),a=m.useContext(Hh),d=a.reducedMotion,c=a.skipAnimations,f=m.useRef(null),y=m.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:c,isSVG:o}),y.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const v=f.current,T=m.useContext(nm);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&NA(f.current,n,s,T);const S=m.useRef(!1);m.useInsertionEffect(()=>{v&&S.current&&v.update(n,u)});const C=n[yh],k=m.useRef(!!C&&typeof window<"u"&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,C))&&((p=window.MotionHasOptimisedAnimation)==null?void 0:p.call(window,C)));return ml(()=>{var b;!y.current||!v||((b=v.animationState)==null||b.animateChanges(),v.enteringChildren=void 0)},[]),ml(()=>{y.current=!0,v&&(S.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),k.current&&v.animationState&&v.animationState.animateChanges())}),m.useEffect(()=>{v&&(!k.current&&v.animationState&&v.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,C)}),k.current=!1),v.enteringChildren=void 0)}),v}function NA(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:l,layoutScroll:u,layoutRoot:a,layoutAnchor:d,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:rm(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||l&&fn(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:u,layoutRoot:a,layoutAnchor:d})}function rm(e){if(e)return e.options.allowProjection!==!1?e.projection:rm(e.parent)}function eo(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&mA(r);const o=n?n==="svg":la(e),i=o?IA:AA;function l(a,d){let c;const f={...m.useContext(Hh),...a,layoutId:OA(a)},{isStatic:y,isValidProp:v}=f,T=yA(a),S=i(a,y);if(!y&&typeof window<"u"){DA();const C=zA(f);c=C.MeasureLayout,T.visualElement=RA(e,S,f,s,C.ProjectionNode,o)}return h.jsxs(Ss.Provider,{value:T,children:[c&&T.visualElement?h.jsx(c,{visualElement:T.visualElement,...f}):null,kA(e,a,jA(S,T.visualElement,d),S,y,t,o,v)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=m.forwardRef(l);return u[MA]=e,u}function OA({layoutId:e}){const t=m.useContext(Ep).id;return t&&e!==void 0?t+"-"+e:e}function DA(e,t){m.useContext(Yh).strict}function zA(e){const t=Xh(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function $A(e,t){if(typeof Proxy>"u")return eo;const n=new Map,r=(o,i)=>eo(o,i,e,t),s=(o,i)=>r(o,i);return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,eo(i,void 0,e,t)),n.get(i))})}const LA=(e,t)=>t.isSVG??la(e)?new xP(t):new vP(t,{allowProjection:e!==m.Fragment});class FA extends jt{constructor(t){super(t),t.animationState||(t.animationState=SP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let VA=0;class ZA extends jt{constructor(){super(...arguments),this.id=VA++}update(){var u;const{presenceContext:t,prevPresenceContext:n,animationState:r}=this.node;if(!t||!r)return;const{isPresent:s,onExitComplete:o}=t,i=n==null?void 0:n.isPresent;if(s===i)return;if(s&&i===!1){if(this.exit===!0){const{initial:a}=this.node.getProps();if(a&&!Array.isArray(a)){const{transition:d,transitionEnd:c,...f}=qt(this.node,a)||{};for(const y in f)(u=this.node.getValue(y))==null||u.jump(f[y])}this.node.blockInitialAnimation=!1,r.reset(),r.animateChanges()}else r.setActive("exit",!1);this.exit=void 0;return}const l=this.exit=r.setActive("exit",!s);o&&!s&&l.then(()=>{this.exit===l&&(this.exit=!0,o(this.id))})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const BA={animation:{Feature:FA},exit:{Feature:ZA}};function _s(e){return{point:{x:e.pageX,y:e.pageY}}}const UA=e=>t=>sa(t)&&e(t,_s(t));function Gn(e,t,n,r){return sr(e,t,UA(n),r)}const sm=({current:e})=>e?e.ownerDocument.defaultView:null,Sc=(e,t)=>Math.abs(e-t);function WA(e,t){const n=Sc(e.x,t.x),r=Sc(e.y,t.y);return Math.sqrt(n**2+r**2)}const _c=new Set(["auto","scroll"]);class om{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Er(this.lastRawMoveEventInfo,this.transformPagePoint));const v=to(this.lastMoveEventInfo,this.history),T=this.startEvent!==null,S=WA(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!T&&!S)return;const{point:C}=v;this.history.push({...C,timestamp:Te.now()});const{onStart:k,onMove:x}=this.handlers;T||(k&&k(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,v)},this.handlePointerMove=(v,T)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=T,this.lastMoveEventInfo=Er(T,this.transformPagePoint),this.hasPendingMove=!0,ee.update(this.updatePoint,!0)},this.handlePointerUp=(v,T)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=to(v.type==="pointercancel"?this.lastMoveEventInfo:Er(T,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,x),C&&C(v,x)},!sa(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const u=_s(t),a=Er(u,this.transformPagePoint),{point:d}=a,{timestamp:c}=ve;this.history=[{...d,timestamp:c}];const{onSessionStart:f}=n;f&&f(t,to(a,this.history));const y={passive:!0,capture:!0};this.removeListeners=dr(Gn(this.contextWindow,"pointermove",this.handlePointerMove,y),Gn(this.contextWindow,"pointerup",this.handlePointerUp,y),Gn(this.contextWindow,"pointercancel",this.handlePointerUp,y)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(_c.has(r.overflowX)||_c.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ct(this.updatePoint)}}function Er(e,t){return t?{point:t(e.point)}:e}function Tc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function to({point:e},t){return{point:e,delta:Tc(e,im(t)),offset:Tc(e,GA(t)),velocity:KA(t,.1)}}function GA(e){return e[0]}function im(e){return e[e.length-1]}function KA(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=im(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ze(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ze(t)*2&&(r=e[1]);const o=Ve(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function qA(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Q(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Q(n,e,r.max):Math.min(e,n)),e}function Ec(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function JA(e,{top:t,left:n,bottom:r,right:s}){return{x:Ec(e.x,n,s),y:Ec(e.y,t,r)}}function kc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function HA(e,t){return{x:kc(e.x,t.x),y:kc(e.y,t.y)}}function YA(e,t){let n=.5;const r=je(e),s=je(t);return s>r?n=Xn(t.min,t.max-r,e.min):r>s&&(n=Xn(e.min,e.max-s,t.min)),yt(0,1,n)}function XA(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ri=.35;function QA(e=ri){return e===!1?e=0:e===!0&&(e=ri),{x:Cc(e,"left","right"),y:Cc(e,"top","bottom")}}function Cc(e,t,n){return{min:Pc(e,t),max:Pc(e,n)}}function Pc(e,t){return typeof e=="number"?e:e[t]||0}const e1=new WeakMap;class t1{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=c=>{n&&this.snapToCursor(c),this.stopAnimation()},i=(c,f)=>{const{drag:y,dragPropagation:v,onDragStart:T}=this.getProps();if(y&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=KC(y),!this.openDragLock))return;this.latestPointerEvent=c,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),st(C=>{let k=this.getAxisMotionValue(C).get()||0;if(lt.test(k)){const{projection:x}=this.visualElement;if(x&&x.layout){const p=x.layout.layoutBox[C];p&&(k=je(p)*(parseFloat(k)/100))}}this.originPoint[C]=k}),T&&ee.update(()=>T(c,f),!1,!0),Ho(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(c,f)=>{this.latestPointerEvent=c,this.latestPanInfo=f;const{dragPropagation:y,dragDirectionLock:v,onDirectionLock:T,onDrag:S}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:C}=f;if(v&&this.currentDirection===null){this.currentDirection=r1(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",f.point,C),this.updateAxis("y",f.point,C),this.visualElement.render(),S&&ee.update(()=>S(c,f),!1,!0)},u=(c,f)=>{this.latestPointerEvent=c,this.latestPanInfo=f,this.stop(c,f),this.latestPointerEvent=null,this.latestPanInfo=null},a=()=>{const{dragSnapToOrigin:c}=this.getProps();(c||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new om(t,{onSessionStart:o,onStart:i,onMove:l,onSessionEnd:u,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:sm(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:l}=this.getProps();l&&ee.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!kr(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=qA(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&fn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=JA(r.layoutBox,t):this.constraints=!1,this.elastic=QA(n),s!==this.constraints&&!fn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&st(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=XA(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fn(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=GC(r,s.root,this.visualElement.getTransformPagePoint());let i=HA(s.layout.layoutBox,o);if(n){const l=n(BC(i));this.hasMutatedConstraints=!!l,l&&(i=_h(l))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},a=st(d=>{if(!kr(d,n,this.currentDirection))return;let c=u&&u[d]||{};(i===!0||i===d)&&(c={min:0,max:0});const f=s?200:1e6,y=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...c};return this.startAxisValueAnimation(d,v)});return Promise.all(a).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ho(this.visualElement,t),r.start(Xi(t,r,0,n,this.visualElement,!1))}stopAnimation(){st(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:n}){var l;const{drag:r}=this.getProps(),s={x:t,y:n},o=((l=this.visualElement.getTransformPagePoint())==null?void 0:l(s))||s,i=this.visualElement.measureViewportBox();st(u=>{if(!kr(u,r,this.currentDirection))return;const a=this.getAxisMotionValue(u),{min:d,max:c}=i[u];a.set((a.get()||0)+o[u]-Q(d,c,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!fn(n)||!r||!this.constraints)return;this.stopAnimation();const s=this.constraints,o={x:0,y:0};st(l=>{const u=this.getAxisMotionValue(l).get();o[l]=YA({min:u,max:u},s[l])});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),st(l=>{const u=this.getAxisMotionValue(l);if(!kr(l,t,null)||!u.get())return;const{min:a,max:d}=this.constraints[l];u.set(Q(a,d,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;e1.set(this.visualElement,this);const t=this.visualElement.current,n=Gn(t,"pointerdown",a=>{const{drag:d,dragListener:c=!0}=this.getProps(),f=a.target,y=f!==t&&QC(f);d&&c&&!y&&this.start(a)});let r;const s=()=>{const{dragConstraints:a}=this.getProps();fn(a)&&a.current&&(this.constraints=this.resolveRefConstraints(),r||(r=n1(t,a.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,i=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ee.read(s);const l=sr(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",(({delta:a,hasLayoutChanged:d})=>{this.isDragging&&d&&(st(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=a[c].translate,f.set(f.get()+a[c].translate))}),this.visualElement.render())}));return()=>{l(),n(),i(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=ri,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:l}}}function Ac(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function n1(e,t,n){const r=Bl(e,Ac(n)),s=Bl(t,Ac(n));return()=>{r(),s()}}function kr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function r1(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class s1 extends jt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new t1(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const no=e=>(t,n)=>{e&&ee.update(()=>e(t,n),!1,!0)};class o1 extends jt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new om(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:no(t),onStart:no(n),onMove:no(r),onEnd:(o,i)=>{delete this.session,s&&ee.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=Gn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ro=!1;class i1 extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),ro&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Nr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ro=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||ee.postRender(()=>{const l=i.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ra.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ro=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function am(e){const[t,n]=pA(),r=m.useContext(Ep);return h.jsx(i1,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(nm),isPresent:t,safeToRemove:n})}const a1={pan:{Feature:o1},drag:{Feature:s1,ProjectionNode:Jh,MeasureLayout:am}};function Ic(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&ee.postRender(()=>o(t,_s(t)))}class l1 extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=JC(t,(n,r)=>(Ic(this.node,r,"Start"),s=>Ic(this.node,s,"End"))))}unmount(){}}class c1 extends jt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dr(sr(this.node.current,"focus",()=>this.onFocus()),sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&ee.postRender(()=>o(t,_s(t)))}class u1 extends jt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=tP(t,(s,o)=>(Mc(this.node,o,"Start"),(i,{success:l})=>Mc(this.node,i,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const si=new WeakMap,so=new WeakMap,d1=e=>{const t=si.get(e.target);t&&t(e)},f1=e=>{e.forEach(d1)};function p1({root:e,...t}){const n=e||document;so.has(n)||so.set(n,{});const r=so.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(f1,{root:e,...t})),r[s]}function h1(e,t,n){const r=p1(t);return si.set(e,n),r.observe(e),()=>{si.delete(e),r.unobserve(e)}}const m1={some:0,all:1};class g1 extends jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:m1[s]},l=a=>{const{isIntersecting:d}=a;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),y=d?c:f;y&&y(a)};this.stopObserver=h1(this.node.current,i,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(y1(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function y1({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const v1={inView:{Feature:g1},tap:{Feature:u1},focus:{Feature:c1},hover:{Feature:l1}},b1={layout:{ProjectionNode:Jh,MeasureLayout:am}},x1={...BA,...v1,...a1,...b1},w1=$A(x1,LA),S1=w1,jc=new Map,_1=e=>{let t=jc.get(e);return t||(t=S1.create(e),jc.set(e,t)),t},T1=({children:e,as:t="p",className:n,duration:r=2,spread:s=2})=>{const o=_1(t),i=m.useMemo(()=>((e==null?void 0:e.length)??0)*s,[e,s]);return h.jsx(o,{animate:{backgroundPosition:"0% center"},className:V("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",n),initial:{backgroundPosition:"100% center"},style:{"--spread":`${i}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{duration:r,ease:"linear",repeat:Number.POSITIVE_INFINITY},children:e})},lm=m.memo(T1),cm=m.createContext(null),E1=()=>{const e=m.useContext(cm);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},k1=1e3,C1=1e3,um=m.memo(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:s,duration:o,children:i,...l})=>{const u=r??t,a=r===!1,[d,c]=Hn({defaultProp:u,onChange:s,prop:n}),[f,y]=Hn({defaultProp:void 0,prop:o}),v=m.useRef(t),[T,S]=m.useState(!1),C=m.useRef(null);m.useEffect(()=>{t?(v.current=!0,C.current===null&&(C.current=Date.now())):C.current!==null&&(y(Math.ceil((Date.now()-C.current)/C1)),C.current=null)},[t,y]),m.useEffect(()=>{t&&!d&&!a&&c(!0)},[t,d,c,a]),m.useEffect(()=>{if(v.current&&!t&&d&&!T){const p=setTimeout(()=>{c(!1),S(!0)},k1);return()=>clearTimeout(p)}},[t,d,c,T]);const k=m.useCallback(p=>{c(p)},[c]),x=m.useMemo(()=>({duration:f,isOpen:d,isStreaming:t,setIsOpen:c}),[f,d,t,c]);return h.jsx(cm.Provider,{value:x,children:h.jsx(Sp,{className:V("not-prose mb-4",e),onOpenChange:k,open:d,...l,children:i})})}),P1=(e,t)=>e||t===0?h.jsx(lm,{duration:1,children:"Thinking..."}):t===void 0?h.jsx("p",{children:"Thought for a few seconds"}):h.jsxs("p",{children:["Thought for ",t," seconds"]}),dm=m.memo(({className:e,children:t,getThinkingMessage:n=P1,...r})=>{const{isStreaming:s,isOpen:o,duration:i}=E1();return h.jsx(_p,{className:V("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??h.jsxs(h.Fragment,{children:[h.jsx(Lw,{className:"size-4"}),n(s,i),h.jsx(Pd,{className:V("size-4 transition-transform",o?"rotate-180":"rotate-0")})]})})}),fm=m.memo(({className:e,children:t,...n})=>h.jsx(Tp,{className:V("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:h.jsx(Qf,{children:t})}));um.displayName="Reasoning";dm.displayName="ReasoningTrigger";fm.displayName="ReasoningContent";const A1=({suggestion:e,onClick:t,className:n,variant:r="outline",size:s="sm",children:o,...i})=>{const l=m.useCallback(()=>{t==null||t(e)},[t,e]);return h.jsx(Fe,{className:V("cursor-pointer rounded-full px-4",n),onClick:l,size:s,type:"button",variant:r,...i,children:o||e})},I1=m.lazy(()=>Zc(()=>import("./code-block-6bmX2qDf.js"),__vite__mapDeps([5,1,2,3,4])).then(e=>({default:e.CodeBlock}))),oi=({code:e,language:t})=>h.jsx(m.Suspense,{fallback:h.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all p-4 font-mono text-xs",children:e}),children:h.jsx(I1,{code:e,language:t})}),M1=({className:e,...t})=>h.jsx(Sp,{className:V("group not-prose mb-4 w-full rounded-md border",e),...t}),j1={"approval-requested":"Awaiting Approval","approval-responded":"Responded","input-available":"Running","input-streaming":"Pending","output-available":"Completed","output-denied":"Denied","output-error":"Error"},R1={"approval-requested":h.jsx(Ja,{className:"size-3 text-muted-foreground"}),"approval-responded":h.jsx(Ka,{className:"size-3 text-muted-foreground"}),"input-available":h.jsx(Ja,{className:"size-3 animate-pulse"}),"input-streaming":h.jsx(Vw,{className:"size-3"}),"output-available":h.jsx(Ka,{className:"size-3 text-green-600"}),"output-denied":h.jsx(qa,{className:"size-3 text-orange-600"}),"output-error":h.jsx(qa,{className:"size-3 text-red-600"})},N1=e=>h.jsxs(Pm,{children:[R1[e],j1[e]]}),Rc=({className:e,title:t,type:n,state:r,toolName:s,...o})=>{const i=n==="dynamic-tool"?s:n.split("-").slice(1).join("-");return h.jsxs(_p,{className:V("flex w-full items-center justify-between gap-4 p-3",e),...o,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Jw,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"font-medium text-sm",children:t??i}),N1(r)]}),h.jsx(Pd,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})},O1=({className:e,...t})=>h.jsx(Tp,{className:V("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),D1=({className:e,input:t,...n})=>h.jsxs("div",{className:V("space-y-2 overflow-hidden",e),...n,children:[h.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),h.jsx("div",{className:"rounded-md bg-muted/50",children:h.jsx(oi,{code:JSON.stringify(t,null,2),language:"json"})})]}),z1=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let s=h.jsx("div",{children:t});return typeof t=="object"&&!m.isValidElement(t)?s=h.jsx(oi,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=h.jsx(oi,{code:t,language:"json"})),h.jsxs("div",{className:V("space-y-2",e),...r,children:[h.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:n?"Error":"Result"}),h.jsxs("div",{className:V("overflow-x-auto rounded-md text-xs [&_table]:w-full",n?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[n&&h.jsx("div",{children:n}),s]})]})},pm="antseed-console-chat";function vn(e,t){try{const n=localStorage.getItem(`${pm}:${e}`);return n?JSON.parse(n):t}catch{return t}}function bn(e,t){try{localStorage.setItem(`${pm}:${e}`,JSON.stringify(t))}catch{}}function Nc(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function is(e){return e===null?"?":`$${e<.01?e.toFixed(3):e.toFixed(2)}`}function hm(e){return e===null?"cost unknown":`≈ ${$m(e??0)}`}const $1="(max-width: 640px)";function L1(){const e=m.useRef(null);return m.useLayoutEffect(()=>{const t=e.current;if(!t)return;const n=document.documentElement,r=window.matchMedia($1),s=window.visualViewport,o=()=>{if(r.matches){t.style.height&&(t.style.height=""),s&&(n.style.setProperty("--gc-vvh",`${s.height}px`),n.style.setProperty("--gc-vvtop",`${s.offsetTop}px`));return}const l=t.getBoundingClientRect().top+window.scrollY,u=t.closest("main"),a=u&&parseFloat(getComputedStyle(u).paddingBottom)||0,d=`${Math.max(448,window.innerHeight-l-a)}px`;t.style.height!==d&&(t.style.height=d)};o();const i=new ResizeObserver(o);return i.observe(document.body),window.addEventListener("resize",o),r.addEventListener("change",o),s==null||s.addEventListener("resize",o),s==null||s.addEventListener("scroll",o),()=>{i.disconnect(),window.removeEventListener("resize",o),r.removeEventListener("change",o),s==null||s.removeEventListener("resize",o),s==null||s.removeEventListener("scroll",o),n.style.removeProperty("--gc-vvh"),n.style.removeProperty("--gc-vvtop")}},[]),e}function ii(e){return e.name?`${e.name} (${kn(e.peerId)})`:kn(e.peerId)}function Or(e){return e.name??kn(e.peerId)}function it({tone:e="neutral",children:t,title:n}){const r={free:"border-success/30 bg-success/10 text-success",tee:"border-info/30 bg-info/10 text-info",neutral:"border-border text-muted-foreground"};return h.jsx("span",{title:n,className:`inline-flex items-center rounded border px-1.5 py-px font-medium text-[10px] leading-4 ${r[e]}`,children:t})}function ai(e){let t=0;for(const n of e)t=(t*31+n.charCodeAt(0))%300;return`hsl(${30+t} 65% 55%)`}function mm({offer:e}){return en(e)?h.jsx(it,{tone:"free",children:"Free"}):h.jsx("span",{className:"text-muted-foreground text-xs",children:li(e)})}function F1(e){if(!e||e.role!=="assistant")return!0;const t=e.parts.filter(n=>n.type!=="step-start").at(-1);if(!t)return!0;if(t.type==="text"||t.type==="reasoning")return t.state!=="streaming";if(t.type==="dynamic-tool"||t.type.startsWith("tool-")){const{state:n}=t;return n==="output-available"||n==="output-error"||n==="output-denied"}return!1}function gm({children:e,card:t,side:n="top"}){const[r,s]=m.useState(n),o=i=>{if(n!=="top")return;const l=i.currentTarget.closest(".gc-chat-conversation")??document.documentElement,u=i.currentTarget.getBoundingClientRect().top-l.getBoundingClientRect().top;s(u<160?"bottom":"top")};return h.jsxs("span",{className:"group/hover relative inline-flex min-w-0 shrink",onMouseEnter:o,onFocus:o,children:[e,h.jsx("span",{role:"tooltip",className:V("pointer-events-none invisible absolute left-0 z-30 w-max max-w-80 rounded-lg border bg-popover p-3 text-left font-normal text-popover-foreground text-xs leading-5 opacity-0 shadow-md transition-opacity","group-focus-within/hover:visible group-focus-within/hover:opacity-100 group-hover/hover:visible group-hover/hover:opacity-100",r==="top"?"bottom-full mb-2":"top-full mt-2"),children:t})]})}function ym(e){return en(e)?"Free":`${is(e.inputUsdPerMillion)} in · ${is(e.outputUsdPerMillion)} out per 1M`}function vm(e,t){var a,d;if(!e)return"Auto picks the best seller that passes your routing settings.";const n=((a=e.sources.find(c=>c.level==="buyer"))==null?void 0:a.policy)??null,r=e.policy.sort??(n==null?void 0:n.sort)??"balanced",s=Math.max(e.policy.minTrustScore??0,(n==null?void 0:n.minTrustScore)??0);let i=`${{price:"Auto: cheapest seller",latency:"Auto: fastest seller",trust:"Auto: most trusted seller",balanced:"Auto: best mix of price, trust and speed"}[r]}${s>0?` with trust ${s}+`:""}.`;const l=Kr(e),u=e.candidates.filter(c=>!c.eligible&&c.inputUsdPerMillion!==null&&(l==null?void 0:l.inputUsdPerMillion)!=null&&c.inputUsdPerMillion<l.inputUsdPerMillion).sort((c,f)=>(c.inputUsdPerMillion??0)-(f.inputUsdPerMillion??0))[0];if(u){const c=((d=t==null?void 0:t.peers.find(f=>f.peerId===u.peerId.toLowerCase()))==null?void 0:d.name)??u.displayName??kn(u.peerId);i+=` Cheaper ${c} is skipped: ${u.reasons[0]??"not eligible"}.`}return i}function V1({message:e,streaming:t,model:n,preview:r,actions:s}){var v;const o=e.metadata;if(!o)return null;const i=o.peers;if(i.length===0)return t?null:h.jsx("div",{className:"text-muted-foreground text-xs",children:"No seller answered"});const l=i[i.length-1],u=n==null?void 0:n.peers.find(T=>T.peerId===l.peerId),a=((v=r==null?void 0:r.candidates.find(T=>T.peerId.toLowerCase()===l.peerId))==null?void 0:v.trustScore)??null,d=o.usage,c=[...new Set(i.map(Or))].join(" → "),f=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"block font-medium text-sm",children:[(n==null?void 0:n.name)??o.model," via ",c]}),u&&h.jsx("span",{className:"block font-mono",children:ym(u)}),d&&h.jsxs("span",{className:"block text-muted-foreground",children:[fa(d.inputTokens)," in / ",fa(d.outputTokens)," out tokens"]}),h.jsx("span",{className:"block text-muted-foreground",children:o.pinnedPeerId?"Pinned seller.":vm(r,n)}),h.jsx("span",{className:"block font-mono text-muted-foreground",children:l.peerId})]}),y="font-medium text-foreground underline underline-offset-2 hover:no-underline";return h.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-muted-foreground text-xs","aria-live":"polite",children:[t?h.jsx(wp,{className:"size-3.5"}):h.jsx(Fw,{className:"size-3.5"}),h.jsx(gm,{card:f,children:h.jsx("span",{tabIndex:0,className:"cursor-default text-foreground outline-none",children:c})}),a!==null&&h.jsxs("span",{children:["· trust ",Math.round(a)]}),h.jsx("span",{children:"·"}),o.costUsd===0?h.jsx(it,{tone:"free",children:"Free"}):h.jsx("span",{className:"text-foreground",title:"At the serving seller's advertised prices; the signed amount is in Logs.",children:hm(o.costUsd)}),o.pinnedPeerId&&h.jsx("span",{children:"· pinned"}),s&&!s.pinned&&h.jsx("button",{type:"button",className:V("ml-1",y),onClick:s.onPin,children:"Pin"}),(s==null?void 0:s.onTryAnother)&&h.jsx("button",{type:"button",className:V(s.pinned?"ml-1":"",y),onClick:s.onTryAnother,children:"Try another seller"})]})}function oo({label:e,on:t,onChange:n,title:r,icon:s}){return h.jsxs("button",{type:"button",role:"switch","aria-checked":t,title:r,onClick:()=>n(!t),className:V("inline-flex h-7 items-center gap-1 rounded-full border px-2.5 text-xs transition-colors",t?"border-foreground/20 bg-muted text-foreground":"border-transparent text-muted-foreground hover:bg-muted/60"),children:[t?h.jsx(Jn,{className:"size-3"}):s,e]})}function bm({filters:e,active:t,onToggle:n,sorts:r,sort:s,onSort:o,count:i}){return h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b px-3 py-2",children:[e.map(l=>h.jsxs(Fe,{type:"button",size:"xs",variant:t.has(l.id)?"secondary":"ghost","aria-pressed":t.has(l.id),className:t.has(l.id)?"border border-foreground/30":"border border-transparent text-muted-foreground",onClick:()=>n(l.id),children:[t.has(l.id)&&h.jsx(Jn,{}),l.label]},l.id)),h.jsx("span",{className:"ml-auto text-muted-foreground text-xs",children:i}),h.jsxs("label",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:["Sort",h.jsx("select",{className:"rounded-md border bg-transparent px-1.5 py-0.5 text-foreground text-xs",value:s,onChange:l=>o(l.target.value),children:r.map(l=>h.jsx("option",{value:l.id,children:l.label},l.id))})]})]})}function xm({free:e,tools:t,reasoning:n,vision:r,tee:s}){return h.jsxs("span",{className:"flex flex-wrap gap-1",children:[e&&h.jsx(it,{tone:"free",children:"Free"}),s&&h.jsx(it,{tone:"tee",children:"TEE"}),t&&h.jsx(it,{children:"Tools"}),n&&h.jsx(it,{children:"Reasoning"}),r&&h.jsx(it,{children:"Vision"})]})}function wm(e){const[t,n]=m.useState(()=>new Set(vn(e,[])));return[t,s=>n(o=>{const i=new Set(o);return i.has(s)?i.delete(s):i.add(s),bn(e,[...i]),i})]}function Sm(e,t){const[n,r]=m.useState(()=>vn(e,t));return[n,s=>{r(s),bn(e,s)}]}function li(e){return en(e)?"Free":`${is(e.inputUsdPerMillion)} / ${is(e.outputUsdPerMillion)} per M`}function Z1({models:e,value:t,onChange:n,className:r}){const[s,o]=m.useState(!1),[i,l]=wm("model-filters"),[u,a]=Sm("model-sort","popular"),d=tS(e,i,u);return h.jsxs(mp,{open:s,onOpenChange:o,children:[h.jsx(gp,{asChild:!0,children:h.jsxs(Fe,{variant:"ghost",size:"sm",className:V("min-w-0 max-w-80 shrink justify-between gap-1 px-2 font-semibold",r),title:t?`${t.offers} seller${t.offers===1?"":"s"}, ${t.free?"free offers":`from ${li(t)}`}`:void 0,children:[h.jsx("span",{className:"truncate",children:t?t.name:"Pick a model"}),(t==null?void 0:t.free)&&h.jsx(it,{tone:"free",children:"Free"}),h.jsx(Id,{className:"size-3.5 shrink-0 opacity-60"})]})}),h.jsxs(yp,{title:"Model",className:"sm:max-w-2xl",children:[h.jsx(vp,{placeholder:"Search models…"}),h.jsx(bm,{filters:Hw,active:i,onToggle:l,sorts:Yw,sort:u,onSort:a,count:`${d.length} of ${e.length} models`}),h.jsxs(bp,{className:"max-h-[min(28rem,60vh)]",children:[h.jsxs(xp,{children:["No model matches.",i.size>0?" Try fewer filters.":""]}),h.jsx(jo,{children:d.map(c=>h.jsxs(Ro,{value:`${c.name} ${c.id}`,onSelect:()=>{n(c.id),o(!1)},className:"items-start py-2",children:[h.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx(No,{children:c.name}),h.jsx(xm,{free:c.free,tools:c.toolUse,reasoning:c.reasoning,vision:c.vision,tee:c.tee})]}),h.jsxs("span",{className:"ml-auto shrink-0 text-right text-muted-foreground text-xs",children:[c.offers," seller",c.offers===1?"":"s",h.jsx("span",{className:"mt-0.5 block",children:c.free?h.jsx(it,{tone:"free",children:"Free offers"}):`from ${li(c)}`})]}),(t==null?void 0:t.id)===c.id&&h.jsx(Jn,{className:"size-3.5 shrink-0"})]},c.id))})]})]})]})}function Dr({children:e}){return h.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[h.jsx("span",{className:"size-2 shrink-0 translate-y-[-1px] rounded-full bg-amber-500","aria-hidden":"true"}),h.jsx("span",{children:e})]})}const Oc=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"");function B1(e,t,n,r){if(n)return"Checking which seller automatic routing picks…";if(!e)return"No seller passes your routing settings for this model right now.";const s=t==null?void 0:t.peers.find(i=>i.peerId===e.peerId.toLowerCase()),o=ii(s||{peerId:e.peerId,name:e.displayName});return h.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1.5 align-middle",children:["Right now:",h.jsx("span",{className:"size-2 rounded-full",style:{background:ai(e.peerId.toLowerCase())},"aria-hidden":"true"}),h.jsx("span",{className:"font-medium text-foreground",children:o}),h.jsx(mm,{offer:e}),e.trustScore!==null&&h.jsxs("span",{children:["trust ",Math.round(e.trustScore)]}),r&&!en(e)&&h.jsxs(Dr,{children:["No free seller offers ",(t==null?void 0:t.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",h.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"})]})]})}function U1({model:e,value:t,onChange:n,preview:r,previewLoading:s,unfunded:o,className:i,compact:l=!1}){const[u,a]=m.useState(!1),[d,c]=wm("peer-filters"),[f,y]=Sm("peer-sort","auto"),v=(e==null?void 0:e.peers.find(p=>p.peerId===t))??null,T=nS(r),S=Kr(r),C=S?(e==null?void 0:e.peers.find(p=>p.peerId===S.peerId.toLowerCase()))??null:null,k=(e==null?void 0:e.peers)??[],x=sS(k,d,f,T);return h.jsxs(mp,{open:u,onOpenChange:a,children:[h.jsx(gm,{side:"bottom",card:h.jsxs(h.Fragment,{children:[(v??C)&&h.jsxs("span",{className:"block font-medium text-sm",children:[e==null?void 0:e.name," via ",Or(v??C)]}),(v??C)&&h.jsx("span",{className:"block font-mono",children:ym(v??C)}),h.jsx("span",{className:"block text-muted-foreground",children:v?"Pinned: every turn goes to this seller.":vm(r,e)})]}),children:h.jsx(gp,{asChild:!0,children:h.jsxs(Fe,{variant:"ghost",size:"sm",className:V("min-w-0 max-w-96 shrink justify-between gap-1.5 px-2 text-muted-foreground",i),disabled:!e,children:[v?h.jsx("span",{className:"size-2 rounded-full",style:{background:ai(v.peerId)},"aria-hidden":"true"}):h.jsx(Ha,{className:"size-3.5"}),h.jsx("span",{className:"truncate",children:v?Or(v):h.jsxs(h.Fragment,{children:["Auto",C&&!l?h.jsxs("span",{className:"max-sm:hidden",children:[" · ",Or(C)]}):""]})}),h.jsx(Id,{className:"size-3.5 shrink-0 opacity-60"})]})})}),h.jsxs(yp,{title:"Seller",className:"sm:max-w-2xl",children:[h.jsx(vp,{placeholder:"Search sellers…"}),h.jsx(bm,{filters:Xw,active:d,onToggle:c,sorts:Qw,sort:f,onSort:y,count:`${x.length} of ${k.length} sellers`}),h.jsxs(bp,{className:"max-h-[min(30rem,60vh)]",children:[h.jsxs(xp,{children:["No seller matches.",d.size>0?" Try fewer filters.":""]}),h.jsx(jo,{heading:"Routing",children:h.jsxs(Ro,{value:"auto automatic best offer routing",onSelect:()=>{n(null),a(!1)},className:"items-start py-2",children:[h.jsx(Ha,{className:"mt-0.5 size-3.5"}),h.jsxs("span",{className:"flex min-w-0 flex-col",children:[h.jsx(No,{children:"Auto: the gateway picks the best offer each turn"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:B1(S,e,s,o)})]}),t===null&&h.jsx(Jn,{className:"ml-auto size-3.5"})]})}),h.jsx(jo,{heading:`Sellers offering ${(e==null?void 0:e.name)??"this model"}`,children:x.map(p=>{const b=T.get(p.peerId),w=b!==void 0&&!b.eligible;return h.jsxs(Ro,{value:`${p.name??""} ${p.peerId}`,onSelect:()=>{n(p.peerId),a(!1)},className:"items-start py-2",children:[h.jsx("span",{className:"mt-1.5 size-2 shrink-0 rounded-full",style:{background:ai(p.peerId)},"aria-hidden":"true"}),h.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[h.jsxs("span",{className:`flex items-center gap-2 ${w?"text-muted-foreground":""}`,children:[h.jsx(No,{children:ii(p)}),(b==null?void 0:b.eligible)&&b.rank!==null&&h.jsxs("span",{className:"text-muted-foreground text-xs",children:["#",b.rank]})]}),h.jsx(xm,{free:en(p),tools:p.toolUse,reasoning:p.reasoning,vision:p.vision,tee:p.tee}),w&&h.jsxs("span",{className:"text-muted-foreground text-xs",children:["Auto skips it: ",b.reasons[0]??"not eligible",". You can still pin it."]}),!p.toolUse&&h.jsx("span",{className:"text-muted-foreground text-xs",children:"No tools: plain chat when pinned."})]}),h.jsxs("span",{className:"ml-auto flex shrink-0 flex-col items-end gap-0.5 text-muted-foreground text-xs",children:[h.jsx(mm,{offer:p}),p.reputation!==null&&h.jsxs("span",{children:["trust ",Math.round(p.reputation)]})]}),t===p.peerId&&h.jsx(Jn,{className:"size-3.5 shrink-0"})]},p.peerId)})})]})]})]})}function W1({part:e,onAnswer:t}){const n=e.input,r=typeof(n==null?void 0:n.command)=="string"?n.command:JSON.stringify(e.input,null,2);return h.jsxs("div",{className:"space-y-2 border-t p-3",children:[h.jsx("p",{className:"font-medium text-sm",children:"Run this command on the gateway host?"}),h.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/50 p-2 font-mono text-xs",children:r}),h.jsx("p",{className:"text-muted-foreground text-xs",children:"It runs as the gateway's user, with access to its files. The model chose it, and a seller or a page it read can steer the model: approve only a command you understand."}),t?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Fe,{type:"button",size:"sm",variant:"secondary",onClick:()=>t(!0),children:"Approve"}),h.jsx(Fe,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!1),children:"Deny"})]}):h.jsx("p",{className:"text-muted-foreground text-xs",children:"Not run: the conversation moved on."})]})}function G1({part:e,onApproval:t}){const n=e.state==="approval-requested";return h.jsxs(M1,{defaultOpen:e.state==="output-error",children:[e.type==="dynamic-tool"?h.jsx(Rc,{type:e.type,state:e.state,toolName:e.toolName}):h.jsx(Rc,{type:e.type,state:e.state}),h.jsxs(O1,{children:[h.jsx(D1,{input:e.input}),h.jsx(z1,{output:e.output,errorText:e.errorText})]}),n&&h.jsx(W1,{part:e,onAnswer:t?r=>t(e.approval.id,r):null})]})}function Dc({threads:e,loading:t,activeId:n,onOpen:r,onRemove:s}){return e.length===0?h.jsx("p",{className:"px-2 py-3 text-muted-foreground text-xs",children:t?"Loading…":"Your conversations show up here."}):e.map(o=>h.jsxs("div",{className:`group flex items-center gap-1 rounded-md px-2 py-1.5 text-sm ${o.id===n?"bg-muted":"hover:bg-muted/60"}`,children:[h.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>r(o.id),title:o.title,children:[h.jsx("span",{className:"block truncate",children:o.title}),h.jsxs("span",{className:"block truncate text-muted-foreground text-xs",children:[zm(o.updatedAt),o.model?` · ${o.model}`:"",o.peerId?` · ${kn(o.peerId)}`:""]})]}),h.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:text-foreground focus-visible:opacity-100 md:opacity-0 md:group-hover:opacity-100","aria-label":`Delete "${o.title}"`,onClick:()=>s(o.id),children:h.jsx(qw,{className:"size-3.5"})})]},o.id))}function K1(){var Rt,rn,Nt;const{workspace:e,viewer:t,me:n}=Am(),r=`${e.id}:${n.member.id}`,s=Dn({queryKey:Ge.chatModels(e.id),queryFn:()=>on.chat.models(e.id),staleTime:6e4}),[o,i]=m.useState(()=>vn(`model:${r}`,null)),[l,u]=m.useState(()=>vn(`peer:${r}`,null)),a=Im(),d=Dn({queryKey:Ge.chatThreads(e.id),queryFn:()=>on.chat.threads(e.id)}),c=Dn({queryKey:Ge.chatContext(e.id),queryFn:()=>on.chat.context(e.id),staleTime:3e4}),f=L1();m.useEffect(()=>{Xf().catch(()=>{})},[]);const[y,v]=m.useState(()=>vn(`chat:${r}`,Nc())),[T,S]=m.useState(!1),[C,k]=m.useState(()=>({web:!0,files:!0,shell:!1,...vn("tools",{})})),x=(F,ue)=>k(Ce=>{const fe={...Ce,[F]:ue};return bn("tools",fe),fe}),p=((Rt=s.data)==null?void 0:Rt.find(F=>F.id===o))??(o?(rn=s.data)==null?void 0:rn.find(F=>Oc(F.id)===Oc(o)):void 0)??null,[b,w]=m.useState(null),_=Mm(t),E=jm(e.id,_),I=!!E.data&&Number(E.data.available)<=0,z=((Nt=c.data)==null?void 0:Nt.key.id)??null,K=Dn({queryKey:["chat-route-preview",e.id,z,o],queryFn:()=>on.network.routePreview({model:o,key:z}),enabled:!!(o&&z),staleTime:3e4});m.useEffect(()=>{var ue;if(!((ue=s.data)!=null&&ue.length)||p)return;const F=s.data.find(Ce=>Ce.toolUse)??s.data[0];o&&w(o),i(F.id)},[s.data,p]),m.useEffect(()=>{bn(`model:${r}`,o)},[r,o]),m.useEffect(()=>{bn(`peer:${r}`,l)},[r,l]),m.useEffect(()=>{bn(`chat:${r}`,y)},[r,y]);const L=m.useRef({workspaceId:e.id,model:o,peerId:l,tools:C});L.current={workspaceId:e.id,model:o,peerId:l,tools:C};const Y=m.useMemo(()=>new xi({api:`${Rm}/chat`,credentials:"same-origin",headers:{[Nm]:"1"},prepareSendMessagesRequest:({id:F,messages:ue})=>({body:{...L.current,id:F,messages:ue.slice(-1)}})}),[]),{messages:W,sendMessage:le,regenerate:oe,status:ce,stop:$e,error:ke,setMessages:M,clearError:he,addToolApprovalResponse:A}=Cw({id:y,transport:Y,sendAutomaticallyWhen:vw}),$=Dn({queryKey:Ge.chatThread(e.id,y),queryFn:()=>on.chat.thread(e.id,y),enabled:(d.data??[]).some(F=>F.id===y),staleTime:1/0});m.useEffect(()=>{$.data&&(M($.data.messages),$.data.model&&i($.data.model),u($.data.peerId))},[$.data]),m.useEffect(()=>{(ce==="streaming"||ce==="ready")&&W.length>0&&a.invalidateQueries({queryKey:Ge.chatThreads(e.id)}),ce==="ready"&&W.length>0&&(a.removeQueries({queryKey:Ge.chatThread(e.id,y),exact:!0}),a.invalidateQueries({queryKey:Ge.chatContext(e.id)}),a.invalidateQueries({queryKey:["chat-route-preview",e.id]}))},[ce]),m.useEffect(()=>{ke&&(a.invalidateQueries({queryKey:Ge.chatModels(e.id)}),a.invalidateQueries({queryKey:["chat-route-preview",e.id]}),_&&a.invalidateQueries({queryKey:Ge.wallet(e.id)}))},[ke]);const Z=ce==="submitted"||ce==="streaming",j=W.reduce((F,ue)=>{var fe;const Ce=(fe=ue.metadata)==null?void 0:fe.costUsd;return F===null||Ce===null?null:F+(Ce??0)},0),B=F=>{const ue=F.text.trim();!ue||!o||Z||(a.setQueryData(Ge.chatThreads(e.id),(Ce=[])=>Ce.some(fe=>fe.id===y)?Ce:[{id:y,title:ue.replace(/\s+/g," ").slice(0,80),model:o,peerId:l,createdAt:Date.now(),updatedAt:Date.now()},...Ce]),le({text:ue}))},H=F=>{S(!1),!(F===y||Z)&&(he(),M([]),v(F))},de=()=>{S(!1),$e(),he(),M([]),v(Nc())},q=F=>{var tt;const ue=[...((tt=K.data)==null?void 0:tt.candidates)??[]].filter(xe=>xe.eligible&&xe.rank!==null).sort((xe,sn)=>(xe.rank??0)-(sn.rank??0)).map(xe=>xe.peerId.toLowerCase()),Ce=(p==null?void 0:p.peers.map(xe=>xe.peerId))??[],fe=[...ue,...Ce].find(xe=>xe!==F&&Ce.includes(xe));!fe||Z||(u(fe),L.current={...L.current,peerId:fe},he(),oe())},et=Om({mutationFn:F=>on.chat.deleteThread(e.id,F),onSuccess:(F,ue)=>{ue===y&&de()},invalidate:[Ge.chatThreads(e.id)]}),nn=["What are today's top AI news? Search and cite sources.","Read https://antseed.com and explain how it works in 5 bullets.",da(t)?"Write a Python script that prints the first 20 primes, save it and run it.":"Write a short README for a CLI tool and save it as README.md."];return h.jsxs("div",{ref:f,className:"gc-chat gc-chat-page flex gap-4",children:[h.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col gap-2 md:flex","aria-label":"Conversations",children:[h.jsxs(Fe,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:de,disabled:W.length===0&&!Z,children:[h.jsx(Rs,{className:"size-3.5"})," New chat"]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx(Dc,{threads:d.data??[],loading:d.isLoading,activeId:y,onOpen:H,onRemove:F=>et.mutate(F)})})]}),h.jsxs(Dm,{isOpen:T,onClose:()=>S(!1),side:"left",title:"Chats",className:"gc-chat gc-chat-history",children:[h.jsxs(Fe,{variant:"outline",size:"sm",className:"mb-2 w-full justify-start gap-2",onClick:de,children:[h.jsx(Rs,{className:"size-3.5"})," New chat"]}),h.jsx(Dc,{threads:d.data??[],loading:d.isLoading,activeId:y,onOpen:H,onRemove:F=>et.mutate(F)})]}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3 max-sm:gap-2",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-0.5 border-b pb-2",children:[h.jsx(Fe,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:()=>S(!0),"aria-label":"Chats",children:h.jsx(Ww,{className:"size-4"})}),h.jsx("h1",{className:"sr-only",children:"Chat"}),h.jsx(Z1,{models:s.data??[],value:p,onChange:F=>{i(F),u(null),w(null)}}),h.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"·"}),h.jsx(U1,{model:p,value:l,onChange:u,preview:K.data,previewLoading:K.isLoading,unfunded:I}),h.jsx("span",{className:"ml-auto shrink-0 pl-2 font-mono text-muted-foreground text-xs",title:"Estimated at the serving sellers' prices; the signed amounts are in Logs.",children:W.length>0?j===0?"Free so far":h.jsxs(h.Fragment,{children:[hm(j),h.jsx("span",{className:"max-sm:hidden",children:" this chat"})]}):""}),h.jsx(Fe,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:de,disabled:W.length===0&&!Z,"aria-label":"New chat",children:h.jsx(Rs,{className:"size-4"})})]}),b&&p&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:["No seller offers ",b," right now (sellers stop offering a model while they are busy), so the chat switched to ",p.name,"."]})}),l&&p&&!p.peers.some(F=>F.peerId===l)&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:[kn(l)," no longer offers ",p.name," (sellers stop offering a model while they are busy)."," ",h.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:()=>u(null),children:"Use Auto"})," or pick another seller."]})}),!l&&I&&Kr(K.data)&&!en(Kr(K.data))&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:["No free seller offers ",(p==null?void 0:p.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",h.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"})]})}),h.jsxs(cT,{className:"gc-chat-conversation",children:[h.jsxs(uT,{className:"mx-auto w-full max-w-3xl gap-6 px-1 sm:px-4",children:[W.length===0?h.jsx(dT,{children:h.jsxs("div",{className:"flex w-full min-w-0 max-w-2xl flex-col items-center gap-2 text-center",children:[h.jsx("h3",{className:"font-medium text-base",children:"Ask anything"}),h.jsx("p",{className:"text-muted-foreground text-sm",children:"The agent can search and read the web and keep files in this chat's scratch space on the gateway."}),h.jsx("div",{className:"mt-3 flex flex-wrap justify-center gap-2",children:nn.map(F=>h.jsx(A1,{suggestion:F,onClick:ue=>B({text:ue}),className:"h-auto min-h-8 max-w-full whitespace-normal py-1.5 max-sm:w-full max-sm:rounded-xl max-sm:text-left"},F))})]})}):W.map((F,ue)=>{const Ce=Z&&ue===W.length-1;return h.jsxs(hT,{from:F.role,children:[h.jsx(mT,{children:F.parts.map((fe,tt)=>{const xe=`${F.id}-${tt}`;if(fe.type==="text")return h.jsx(ep,{children:fe.text},xe);if(fe.type==="reasoning")return h.jsxs(um,{isStreaming:Ce&&tt===F.parts.length-1,children:[h.jsx(dm,{}),h.jsx(fm,{children:fe.text})]},xe);if(fe.type==="dynamic-tool"||fe.type.startsWith("tool-")){const sn=!Z&&ue===W.length-1;return h.jsx(G1,{part:fe,onApproval:sn?(_m,Tm)=>{A({id:_m,approved:Tm})}:null},xe)}return null})}),F.role==="assistant"&&(()=>{var xe,sn;const fe=ue===W.length-1&&!Z,tt=((sn=(xe=F.metadata)==null?void 0:xe.peers.at(-1))==null?void 0:sn.peerId)??null;return h.jsx(V1,{message:F,streaming:Ce,model:p,preview:K.data,actions:fe&&tt?{pinned:l===tt,onPin:()=>u(tt),onTryAnother:((p==null?void 0:p.peers.length)??0)>1?()=>q(tt):null}:null})})()]},F.id)}),Z&&F1(W.at(-1))&&h.jsx("div",{className:"-mt-4 text-muted-foreground text-sm",role:"status",children:h.jsx(lm,{duration:1,children:"Thinking…"})}),ke&&h.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:/out of AntSeed credits|insufficient_deposits/i.test(ke.message)?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-medium",children:"No free seller took this, and paid ones need funds."})," ","No free seller offers ",(p==null?void 0:p.name)??"this model"," right now (free sellers stop offering a model while they are busy), and the ",e.name," wallet has no deposits for a paid one."," ",h.jsx("a",{className:"font-medium underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"}),", or pick a model marked ",h.jsx(it,{tone:"free",children:"Free"}),"."]}):/model_not_found|not served by this peer/i.test(ke.message)?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-medium",children:["The seller stopped offering ",(p==null?void 0:p.name)??"this model","."]})," ","Sellers drop a model while they are busy, and the list had not caught up yet. Send again",l?h.jsxs(h.Fragment,{children:[" after switching to ",h.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:()=>u(null),children:"Auto"})]}):""," to use another seller."]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-medium",children:"The request failed."})," ",ke.message]})})]}),h.jsx(fT,{})]}),h.jsxs(vE,{onSubmit:B,className:"mx-auto w-full max-w-3xl [&_[data-slot=input-group]]:rounded-3xl",children:[h.jsx(bE,{children:h.jsx(xE,{placeholder:p?`Message ${p.name}…`:"Loading models…",className:"max-sm:min-h-10"})}),h.jsxs(wE,{children:[h.jsx(SE,{className:"min-w-0 flex-wrap gap-1",children:p&&!p.toolUse?h.jsx("span",{className:"px-2 text-muted-foreground text-xs",children:"This model cannot use tools"}):h.jsxs(h.Fragment,{children:[h.jsx(oo,{label:"Web",on:C.web,onChange:F=>x("web",F),title:"Search and read web pages"}),h.jsx(oo,{label:"Files",on:C.files,onChange:F=>x("files",F),title:"Keep files in this chat's scratch space on the gateway"}),da(t)&&h.jsx(oo,{label:"Shell",on:C.shell,onChange:F=>x("shell",F),icon:h.jsx(Uw,{className:"size-3"}),title:"Run commands on the gateway host; you approve each one first (organization admins)"})]})}),h.jsx(_E,{status:ce,onStop:$e,disabled:!o})]})]})]})]})}const nI=Object.freeze(Object.defineProperty({__proto__:null,default:K1},Symbol.toStringTag,{value:"Module"}));export{nI as C,V as c,JS as t};
|
|
220
|
+
*--------------------------------------------------------------------------------------------*/const Hf=m.createContext(null),lT=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Jr({instance:e,children:t,resize:n,initial:r,mass:s,damping:o,stiffness:i,targetScrollTop:l,contextRef:u,...a}){const d=m.useRef(null),c=m.useCallback((b,w)=>{const _=(p==null?void 0:p.targetScrollTop)??l;return(_==null?void 0:_(b,w))??b},[l]),f=aT({mass:s,damping:o,stiffness:i,resize:n,initial:r,targetScrollTop:c}),{scrollRef:y,contentRef:v,scrollToBottom:T,stopScroll:S,isAtBottom:C,escapedFromLock:k,state:x}=e??f,p=m.useMemo(()=>({scrollToBottom:T,stopScroll:S,scrollRef:y,isAtBottom:C,escapedFromLock:k,contentRef:v,state:x,get targetScrollTop(){return d.current},set targetScrollTop(b){d.current=b}}),[T,C,v,y,S,k,x]);return m.useImperativeHandle(u,()=>p,[p]),lT(()=>{y.current&&getComputedStyle(y.current).overflow==="visible"&&(y.current.style.overflow="auto")},[]),m.createElement(Hf.Provider,{value:p},m.createElement("div",{...a},typeof t=="function"?t(p):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const o=Yf();return m.createElement("div",{ref:o.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},m.createElement("div",{...s,ref:o.contentRef},typeof n=="function"?n(o):n))}e.Content=t})(Jr||(Jr={}));function Yf(){const e=m.useContext(Hf);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const cT=({className:e,...t})=>h.jsx(Jr,{className:V("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),uT=({className:e,...t})=>h.jsx(Jr.Content,{className:V("flex flex-col gap-8 p-4",e),...t}),dT=({className:e,title:t="No messages yet",description:n="Start a conversation to see messages here",icon:r,children:s,...o})=>h.jsx("div",{className:V("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...o,children:s??h.jsxs(h.Fragment,{children:[r&&h.jsx("div",{className:"text-muted-foreground",children:r}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"font-medium text-sm",children:t}),n&&h.jsx("p",{className:"text-muted-foreground text-sm",children:n})]})]})}),fT=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:r}=Yf(),s=m.useCallback(()=>{r()},[r]);return!n&&h.jsx(Fe,{className:V("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",e),onClick:s,size:"icon",type:"button",variant:"outline",...t,children:h.jsx($w,{className:"size-4"})})},Xf=()=>Zc(()=>import("./mermaid-MCJ5UELQ-BGV7b3EX.js").then(e=>e.m),__vite__mapDeps([0,1,2,3,4])),pT=m.lazy(Xf);function Qf({className:e,children:t,...n}){return h.jsx(m.Suspense,{fallback:h.jsx("div",{className:V("whitespace-pre-wrap break-words",e),children:t}),children:h.jsx(pT,{className:e,...n,children:t})})}const hT=({className:e,from:t,...n})=>h.jsx("div",{className:V("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...n}),mT=({children:e,className:t,...n})=>h.jsx("div",{className:V("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...n,children:e}),ep=m.memo(({className:e,...t})=>h.jsx(Qf,{className:V("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);ep.displayName="MessageResponse";var fl=1,gT=.9,yT=.8,vT=.17,Ls=.1,Fs=.999,bT=.9999,xT=.99,wT=/[\\\/_+.#"@\[\(\{&]/,ST=/[\\\/_+.#"@\[\(\{&]/g,_T=/[\s-]/,tp=/[\s-]/g;function Ao(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?fl:xT;var l=`${s},${o}`;if(i[l]!==void 0)return i[l];for(var u=r.charAt(o),a=n.indexOf(u,s),d=0,c,f,y,v;a>=0;)c=Ao(e,t,n,r,a+1,o+1,i),c>d&&(a===s?c*=fl:wT.test(e.charAt(a-1))?(c*=yT,y=e.slice(s,a-1).match(ST),y&&s>0&&(c*=Math.pow(Fs,y.length))):_T.test(e.charAt(a-1))?(c*=gT,v=e.slice(s,a-1).match(tp),v&&s>0&&(c*=Math.pow(Fs,v.length))):(c*=vT,s>0&&(c*=Math.pow(Fs,a-s))),e.charAt(a)!==t.charAt(o)&&(c*=bT)),(c<Ls&&n.charAt(a-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(a-1)!==r.charAt(o))&&(f=Ao(e,t,n,r,a+1,o+2,i),f*Ls>c&&(c=f*Ls)),c>d&&(d=c),a=n.indexOf(u,a+1);return i[l]=d,d}function pl(e){return e.toLowerCase().replace(tp," ")}function TT(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ao(e,t,pl(e),pl(t),0,0,{})}var ET=Object.defineProperty,Qe=(e,t)=>ET(e,"name",{value:t,configurable:!0});function np(e){const t=m.forwardRef((n,r)=>{let{children:s,...o}=n,i=null,l=!1;const u=[];Io(s)&&typeof Sr=="function"&&(s=Sr(s._payload)),m.Children.forEach(s,f=>{var y;if(ip(f)){l=!0;const v=f;let T="child"in v.props?v.props.child:v.props.children;Io(T)&&typeof Sr=="function"&&(T=Sr(T._payload)),i=CT(v,T),u.push((y=i==null?void 0:i.props)==null?void 0:y.children)}else u.push(f)}),i?i=m.cloneElement(i,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(i=s);const a=i?op(i):void 0,d=gt(r,a);if(!i){if(s||s===0)throw new Error(l?IT(e):AT(e));return s}const c=sp(o,i.props??{});return i.type!==m.Fragment&&(c.ref=r?d:a),m.cloneElement(i,c)});return t.displayName=`${e}.Slot`,t}Qe(np,"createSlot");var rp=Symbol.for("radix.slottable");function kT(e){const t=Qe(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=rp,t}Qe(kT,"createSlottable");var CT=Qe((e,t)=>{if("child"in e.props){const n=e.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,e.props.children(n.props.children)):null}return m.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function sp(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{const u=o(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}Qe(sp,"mergeProps");function op(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Qe(op,"getElementRef");function ip(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rp}Qe(ip,"isSlottable");var PT=Symbol.for("react.lazy");function Io(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PT&&"_payload"in e&&ap(e._payload)}Qe(Io,"isLazyComponent");function ap(e){return typeof e=="object"&&e!==null&&"then"in e}Qe(ap,"isPromiseLike");var AT=Qe(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),IT=Qe(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Sr=Xt[" use ".trim().toString()],MT=Object.defineProperty,jT=(e,t)=>MT(e,"name",{value:t,configurable:!0}),RT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mt=RT.reduce((e,t)=>{const n=np(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...l}=s,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function NT(e,t){e&&ci.flushSync(()=>e.dispatchEvent(t))}jT(NT,"dispatchDiscreteCustomEvent");var OT=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},DT=Xt[" useId ".trim().toString()]||(()=>{}),zT=0;function Sn(e){const[t,n]=m.useState(DT());return OT(()=>{n(r=>r??String(zT++))},[e]),t?`radix-${t}`:""}var Ln='[cmdk-group=""]',Vs='[cmdk-group-items=""]',$T='[cmdk-group-heading=""]',lp='[cmdk-item=""]',hl=`${lp}:not([aria-disabled="true"])`,Mo="cmdk-item-select",un="data-value",LT=(e,t,n)=>TT(e,t,n),cp=m.createContext(void 0),ur=()=>m.useContext(cp),up=m.createContext(void 0),Ri=()=>m.useContext(up),dp=m.createContext(void 0),fp=m.forwardRef((e,t)=>{let n=dn(()=>{var A,$;return{search:"",value:($=(A=e.value)!=null?A:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dn(()=>new Set),s=dn(()=>new Map),o=dn(()=>new Map),i=dn(()=>new Set),l=pp(e),{label:u,children:a,value:d,onValueChange:c,filter:f,shouldFilter:y,loop:v,disablePointerSelection:T=!1,vimBindings:S=!0,...C}=e,k=Sn(),x=Sn(),p=Sn(),b=m.useRef(null),w=HT();Yt(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,_.emit()}},[d]),Yt(()=>{w(6,Y)},[]);let _=m.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,$,Z)=>{var j,B,H,de;if(!Object.is(n.current[A],$)){if(n.current[A]=$,A==="search")L(),z(),w(1,K);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let q=document.getElementById(p);q?q.focus():(j=document.getElementById(k))==null||j.focus()}if(w(7,()=>{var q;n.current.selectedItemId=(q=W())==null?void 0:q.id,_.emit()}),Z||w(5,Y),((B=l.current)==null?void 0:B.value)!==void 0){let q=$??"";(de=(H=l.current).onValueChange)==null||de.call(H,q);return}}_.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),E=m.useMemo(()=>({value:(A,$,Z)=>{var j;$!==((j=o.current.get(A))==null?void 0:j.value)&&(o.current.set(A,{value:$,keywords:Z}),n.current.filtered.items.set(A,I($,Z)),w(2,()=>{z(),_.emit()}))},item:(A,$)=>(r.current.add(A),$&&(s.current.has($)?s.current.get($).add(A):s.current.set($,new Set([A]))),w(3,()=>{L(),z(),n.current.value||K(),_.emit()}),()=>{o.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let Z=W();w(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===A&&K(),_.emit()})}),group:A=>(s.current.has(A)||s.current.set(A,new Set),()=>{o.current.delete(A),s.current.delete(A)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:p,labelId:x,listInnerRef:b}),[]);function I(A,$){var Z,j;let B=(j=(Z=l.current)==null?void 0:Z.filter)!=null?j:LT;return A?B(A,n.current.search,$):0}function z(){if(!n.current.search||l.current.shouldFilter===!1)return;let A=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(j=>{let B=s.current.get(j),H=0;B.forEach(de=>{let q=A.get(de);H=Math.max(q,H)}),$.push([j,H])});let Z=b.current;le().sort((j,B)=>{var H,de;let q=j.getAttribute("id"),et=B.getAttribute("id");return((H=A.get(et))!=null?H:0)-((de=A.get(q))!=null?de:0)}).forEach(j=>{let B=j.closest(Vs);B?B.appendChild(j.parentElement===B?j:j.closest(`${Vs} > *`)):Z.appendChild(j.parentElement===Z?j:j.closest(`${Vs} > *`))}),$.sort((j,B)=>B[1]-j[1]).forEach(j=>{var B;let H=(B=b.current)==null?void 0:B.querySelector(`${Ln}[${un}="${encodeURIComponent(j[0])}"]`);H==null||H.parentElement.appendChild(H)})}function K(){let A=le().find(Z=>Z.getAttribute("aria-disabled")!=="true"),$=A==null?void 0:A.getAttribute(un);_.setState("value",$||void 0)}function L(){var A,$,Z,j;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let H of r.current){let de=($=(A=o.current.get(H))==null?void 0:A.value)!=null?$:"",q=(j=(Z=o.current.get(H))==null?void 0:Z.keywords)!=null?j:[],et=I(de,q);n.current.filtered.items.set(H,et),et>0&&B++}for(let[H,de]of s.current)for(let q of de)if(n.current.filtered.items.get(q)>0){n.current.filtered.groups.add(H);break}n.current.filtered.count=B}function Y(){var A,$,Z;let j=W();j&&(((A=j.parentElement)==null?void 0:A.firstChild)===j&&((Z=($=j.closest(Ln))==null?void 0:$.querySelector($T))==null||Z.scrollIntoView({block:"nearest"})),j.scrollIntoView({block:"nearest"}))}function W(){var A;return(A=b.current)==null?void 0:A.querySelector(`${lp}[aria-selected="true"]`)}function le(){var A;return Array.from(((A=b.current)==null?void 0:A.querySelectorAll(hl))||[])}function oe(A){let $=le()[A];$&&_.setState("value",$.getAttribute(un))}function ce(A){var $;let Z=W(),j=le(),B=j.findIndex(de=>de===Z),H=j[B+A];($=l.current)!=null&&$.loop&&(H=B+A<0?j[j.length-1]:B+A===j.length?j[0]:j[B+A]),H&&_.setState("value",H.getAttribute(un))}function $e(A){let $=W(),Z=$==null?void 0:$.closest(Ln),j;for(;Z&&!j;)Z=A>0?qT(Z,Ln):JT(Z,Ln),j=Z==null?void 0:Z.querySelector(hl);j?_.setState("value",j.getAttribute(un)):ce(A)}let ke=()=>oe(le().length-1),M=A=>{A.preventDefault(),A.metaKey?ke():A.altKey?$e(1):ce(1)},he=A=>{A.preventDefault(),A.metaKey?oe(0):A.altKey?$e(-1):ce(-1)};return m.createElement(Mt.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:A=>{var $;($=C.onKeyDown)==null||$.call(C,A);let Z=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||Z))switch(A.key){case"n":case"j":{S&&A.ctrlKey&&M(A);break}case"ArrowDown":{M(A);break}case"p":case"k":{S&&A.ctrlKey&&he(A);break}case"ArrowUp":{he(A);break}case"Home":{A.preventDefault(),oe(0);break}case"End":{A.preventDefault(),ke();break}case"Enter":{A.preventDefault();let j=W();if(j){let B=new Event(Mo);j.dispatchEvent(B)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:XT},u),ys(e,A=>m.createElement(up.Provider,{value:_},m.createElement(cp.Provider,{value:E},A))))}),FT=m.forwardRef((e,t)=>{var n,r;let s=Sn(),o=m.useRef(null),i=m.useContext(dp),l=ur(),u=pp(e),a=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Yt(()=>{if(!a)return l.item(s,i==null?void 0:i.id)},[a]);let d=hp(s,o,[e.value,e.children,o],e.keywords),c=Ri(),f=kt(w=>w.value&&w.value===d.current),y=kt(w=>a||l.filter()===!1?!0:w.search?w.filtered.items.get(s)>0:!0);m.useEffect(()=>{let w=o.current;if(!(!w||e.disabled))return w.addEventListener(Mo,v),()=>w.removeEventListener(Mo,v)},[y,e.onSelect,e.disabled]);function v(){var w,_;T(),(_=(w=u.current).onSelect)==null||_.call(w,d.current)}function T(){c.setState("value",d.current,!0)}if(!y)return null;let{disabled:S,value:C,onSelect:k,forceMount:x,keywords:p,...b}=e;return m.createElement(Mt.div,{ref:Ht(o,t),...b,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!f,"data-disabled":!!S,"data-selected":!!f,onPointerMove:S||l.getDisablePointerSelection()?void 0:T,onClick:S?void 0:v},e.children)}),VT=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=Sn(),l=m.useRef(null),u=m.useRef(null),a=Sn(),d=ur(),c=kt(y=>s||d.filter()===!1?!0:y.search?y.filtered.groups.has(i):!0);Yt(()=>d.group(i),[]),hp(i,l,[e.value,e.heading,u]);let f=m.useMemo(()=>({id:i,forceMount:s}),[s]);return m.createElement(Mt.div,{ref:Ht(l,t),...o,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},n&&m.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:a},n),ys(e,y=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?a:void 0},m.createElement(dp.Provider,{value:f},y))))}),ZT=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),o=kt(i=>!i.search);return!n&&!o?null:m.createElement(Mt.div,{ref:Ht(s,t),...r,"cmdk-separator":"",role:"separator"})}),BT=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=Ri(),i=kt(a=>a.search),l=kt(a=>a.selectedItemId),u=ur();return m.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),m.createElement(Mt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:s?e.value:i,onChange:a=>{s||o.setState("search",a.target.value),n==null||n(a.target.value)}})}),UT=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=m.useRef(null),i=m.useRef(null),l=kt(a=>a.selectedItemId),u=ur();return m.useEffect(()=>{if(i.current&&o.current){let a=i.current,d=o.current,c,f=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let y=a.offsetHeight;d.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return f.observe(a),()=>{cancelAnimationFrame(c),f.unobserve(a)}}},[]),m.createElement(Mt.div,{ref:Ht(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},ys(e,a=>m.createElement("div",{ref:Ht(i,u.listInnerRef),"cmdk-list-sizer":""},a)))}),WT=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...l}=e;return m.createElement(Zf,{open:n,onOpenChange:r},m.createElement(Wf,{container:i},m.createElement(Gf,{"cmdk-overlay":"",className:s}),m.createElement(Kf,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(fp,{ref:t,...l}))))}),GT=m.forwardRef((e,t)=>kt(n=>n.filtered.count===0)?m.createElement(Mt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),KT=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return m.createElement(Mt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ys(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Rn=Object.assign(fp,{List:UT,Item:FT,Input:BT,Group:VT,Separator:ZT,Dialog:WT,Empty:GT,Loading:KT});function qT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function JT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pp(e){let t=m.useRef(e);return Yt(()=>{t.current=e}),t}var Yt=typeof window>"u"?m.useEffect:m.useLayoutEffect;function dn(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function kt(e){let t=Ri(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function hp(e,t,n,r=[]){let s=m.useRef(),o=ur();return Yt(()=>{var i;let l=(()=>{var a;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(a=d.current.textContent)==null?void 0:a.trim():s.current}})(),u=r.map(a=>a.trim());o.value(e,l,u),(i=t.current)==null||i.setAttribute(un,l),s.current=l}),s}var HT=()=>{let[e,t]=m.useState(),n=dn(()=>new Map);return Yt(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function YT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ys({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(YT(t),{ref:t.ref},n(t.props.children)):n(t)}var XT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function QT({className:e,...t}){return h.jsx(Rn,{"data-slot":"command",className:V("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function eE({className:e,...t}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(Gw,{className:"size-4 shrink-0 opacity-50"}),h.jsx(Rn.Input,{"data-slot":"command-input",className:V("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function tE({className:e,...t}){return h.jsx(Rn.List,{"data-slot":"command-list",className:V("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function nE({...e}){return h.jsx(Rn.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function rE({className:e,...t}){return h.jsx(Rn.Group,{"data-slot":"command-group",className:V("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function sE({className:e,...t}){return h.jsx(Rn.Item,{"data-slot":"command-item",className:V("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function oE({...e}){return h.jsx(Zf,{"data-slot":"dialog",...e})}function iE({...e}){return h.jsx(K_,{"data-slot":"dialog-trigger",...e})}function aE({...e}){return h.jsx(Wf,{"data-slot":"dialog-portal",...e})}function lE({className:e,...t}){return h.jsx(Gf,{"data-slot":"dialog-overlay",className:V("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function cE({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(aE,{"data-slot":"dialog-portal",children:[h.jsx(lE,{}),h.jsxs(Kf,{"data-slot":"dialog-content",className:V("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&h.jsxs(tT,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(Kd,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uE({className:e,...t}){return h.jsx(Q_,{"data-slot":"dialog-title",className:V("text-lg leading-none font-semibold",e),...t})}const mp=e=>h.jsx(oE,{...e}),gp=e=>h.jsx(iE,{...e}),yp=({className:e,children:t,title:n="Model Selector",...r})=>h.jsxs(cE,{"aria-describedby":void 0,className:V("outline! border-none! p-0 outline-border! outline-solid!",e),...r,children:[h.jsx(uE,{className:"sr-only",children:n}),h.jsx(QT,{className:"**:data-[slot=command-input-wrapper]:h-auto",children:t})]}),vp=({className:e,...t})=>h.jsx(eE,{className:V("h-auto py-3.5",e),...t}),bp=e=>h.jsx(tE,{...e}),xp=e=>h.jsx(nE,{...e}),jo=e=>h.jsx(rE,{...e}),Ro=e=>h.jsx(sE,{...e}),No=({className:e,...t})=>h.jsx("span",{className:V("flex-1 truncate text-left",e),...t});function dE({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:V("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function fE({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:V("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const pE=wi("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function hE({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:V(pE({align:t}),e),onClick:r=>{var s,o;r.target.closest("button")||(o=(s=r.currentTarget.parentElement)==null?void 0:s.querySelector("input"))==null||o.focus()},...n})}const mE=wi("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function gE({className:e,type:t="button",variant:n="ghost",size:r="xs",...s}){return h.jsx(Fe,{type:t,"data-size":r,variant:n,className:V(mE({size:r}),e),...s})}function yE({className:e,...t}){return h.jsx(dE,{"data-slot":"input-group-control",className:V("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",e),...t})}function wp({className:e,...t}){return h.jsx(Bw,{role:"status","aria-label":"Loading",className:V("size-4 animate-spin",e),...t})}const vE=({className:e,onSubmit:t,children:n,...r})=>{const s=m.useCallback(o=>{o.preventDefault();const i=o.currentTarget,l=new FormData(i).get("message")||"";i.reset(),t({text:l},o)},[t]);return h.jsx("form",{className:V("w-full",e),onSubmit:s,...r,children:h.jsx(fE,{className:"overflow-hidden",children:n})})},bE=({className:e,...t})=>h.jsx("div",{className:V("contents",e),...t}),xE=({onKeyDown:e,className:t,placeholder:n="What would you like to know?",...r})=>{const[s,o]=m.useState(!1),i=m.useCallback(a=>{if(e==null||e(a),a.defaultPrevented||a.key!=="Enter"||a.shiftKey||s||a.nativeEvent.isComposing)return;a.preventDefault();const{form:d}=a.currentTarget,c=d==null?void 0:d.querySelector('button[type="submit"]');c!=null&&c.disabled||d==null||d.requestSubmit()},[e,s]),l=m.useCallback(()=>o(!1),[]),u=m.useCallback(()=>o(!0),[]);return h.jsx(yE,{className:V("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:l,onCompositionStart:u,onKeyDown:i,placeholder:n,...r})},wE=({className:e,...t})=>h.jsx(hE,{align:"block-end",className:V("justify-between gap-1",e),...t}),SE=({className:e,...t})=>h.jsx("div",{className:V("flex min-w-0 items-center gap-1",e),...t}),_E=({className:e,variant:t="default",size:n="icon-sm",status:r,onStop:s,onClick:o,children:i,...l})=>{const u=r==="submitted"||r==="streaming";let a=h.jsx(Zw,{className:"size-4"});r==="submitted"?a=h.jsx(wp,{}):r==="streaming"?a=h.jsx(Kw,{className:"size-4"}):r==="error"&&(a=h.jsx(Kd,{className:"size-4"}));const d=m.useCallback(c=>{if(u&&s){c.preventDefault(),s();return}o==null||o(c)},[u,s,o]);return h.jsx(gE,{"aria-label":u?"Stop":"Submit",className:V(e),onClick:d,size:n,type:u&&s?"button":"submit",variant:t,...l,children:i??a})};function Sp({...e}){return h.jsx(T_,{"data-slot":"collapsible",...e})}function _p({...e}){return h.jsx(k_,{"data-slot":"collapsible-trigger",...e})}function Tp({...e}){return h.jsx(C_,{"data-slot":"collapsible-content",...e})}const Ep=m.createContext({});function TE(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const EE=typeof window<"u",ml=EE?m.useLayoutEffect:m.useEffect,Ni=m.createContext(null);function Oi(e,t){e.indexOf(t)===-1&&e.push(t)}function Hr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yt=(e,t,n)=>n>t?t:n<e?e:n;let vs=()=>{};const mt={},Di=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),kp=e=>typeof e=="object"&&e!==null,zi=e=>/^0[^.\s]+$/u.test(e);function Cp(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,dr=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Xn=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Yr{constructor(){this.subscriptions=[]}add(t){return Oi(this.subscriptions,t),()=>this.remove(t)}remove(t){Hr(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ze=e=>e*1e3,Ve=e=>e/1e3,Pp=(e,t)=>t?e*(1e3/t):0,Ap=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kE=1e-7,CE=12;function PE(e,t,n,r,s){let o,i,l=0;do i=t+(n-t)/2,o=Ap(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>kE&&++l<CE);return i}function fr(e,t,n,r){if(e===t&&n===r)return Xe;const s=o=>PE(o,0,1,e,n);return o=>o===0||o===1?o:Ap(s(o),t,r)}const Ip=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mp=e=>t=>1-e(1-t),jp=fr(.33,1.53,.69,.99),$i=Mp(jp),Rp=Ip($i),Np=e=>e>=1?1:(e*=2)<1?.5*$i(e):.5*(2-Math.pow(2,-10*(e-1))),Li=e=>1-Math.sin(Math.acos(e)),Op=Mp(Li),Dp=Ip(Li),AE=fr(.42,0,1,1),IE=fr(0,0,.58,1),Fi=fr(.42,0,.58,1),ME=e=>Array.isArray(e)&&typeof e[0]!="number",zp=e=>Array.isArray(e)&&typeof e[0]=="number",jE={linear:Xe,easeIn:AE,easeInOut:Fi,easeOut:IE,circIn:Li,circInOut:Dp,circOut:Op,backIn:$i,backInOut:Rp,backOut:jp,anticipate:Np},RE=e=>typeof e=="string",gl=e=>{if(zp(e)){vs(e.length===4);const[t,n,r,s]=e;return fr(t,n,r,s)}else if(RE(e))return jE[e];return e},ve={delta:0,timestamp:0,isProcessing:!1};let Pr;function NE(){Pr=void 0}const Te={now:()=>(Pr===void 0&&Te.set(ve.isProcessing||mt.useManualTiming?ve.timestamp:performance.now()),Pr),set:e=>{Pr=e,queueMicrotask(NE)}},_n=e=>Math.round(e*1e5)/1e5,$p=e=>t=>typeof t=="string"&&t.startsWith(e),Lp=$p("--"),OE=$p("var(--"),Vi=e=>OE(e)?DE.test(e.split("/*")[0].trim()):!1,DE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yl(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Nn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qn={...Nn,transform:e=>yt(0,1,e)},_r={...Nn,default:1},Zi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zE(e){return e==null}const $E=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bi=(e,t)=>n=>!!(typeof n=="string"&&$E.test(n)&&n.startsWith(e)||t&&!zE(n)&&Object.prototype.hasOwnProperty.call(n,t)),Fp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,l]=r.match(Zi);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:l!==void 0?parseFloat(l):1}},LE=e=>yt(0,255,e),Zs={...Nn,transform:e=>Math.round(LE(e))},Ft={test:Bi("rgb","red"),parse:Fp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zs.transform(e)+", "+Zs.transform(t)+", "+Zs.transform(n)+", "+_n(Qn.transform(r))+")"};function FE(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Oo={test:Bi("#"),parse:FE,transform:Ft.transform},pr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ft=pr("deg"),lt=pr("%"),O=pr("px"),VE=pr("vh"),ZE=pr("vw"),vl={...lt,parse:e=>lt.parse(e)/100,transform:e=>lt.transform(e*100)},mn={test:Bi("hsl","hue"),parse:Fp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lt.transform(_n(t))+", "+lt.transform(_n(n))+", "+_n(Qn.transform(r))+")"},be={test:e=>Ft.test(e)||Oo.test(e)||mn.test(e),parse:e=>Ft.test(e)?Ft.parse(e):mn.test(e)?mn.parse(e):Oo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ft.transform(e):mn.transform(e),getAnimatableNone:e=>{const t=be.parse(e);return t.alpha=0,be.transform(t)}},BE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vp=new RegExp(Zi.source),Zp=new RegExp(BE.source,"i");function UE(e){return isNaN(e)&&typeof e=="string"&&(Vp.test(e)||Zp.test(e))}const Bp="number",Up="color",WE="var",GE="var(",bl="${}",KE=/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 qE(e){const t=e.toString();return Vp.test(t)||Zp.test(t)}function er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const l=t.replace(KE,u=>(be.test(u)?(r.color.push(o),s.push(Up),n.push(be.parse(u))):u.startsWith(GE)?(r.var.push(o),s.push(WE),n.push(u)):(r.number.push(o),s.push(Bp),n.push(parseFloat(u))),++o,bl)).split(bl);return{values:n,split:l,indexes:r,types:s}}function JE(e){return er(e).values}function Wp({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===Bp?s+=_n(r[o]):i===Up?s+=be.transform(r[o]):s+=r[o]}return s}}function HE(e){return Wp(er(e))}const YE=e=>typeof e=="number"?0:be.test(e)?be.getAnimatableNone(e):e,XE=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:YE(e);function QE(e){const t=er(e);return Wp(t)(t.values.map((r,s)=>XE(r,t.split[s])))}const Oe={test:UE,parse:JE,createTransformer:HE,getAnimatableNone:QE};function Bs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ek({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;s=Bs(u,l,e+1/3),o=Bs(u,l,e),i=Bs(u,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Xr(e,t){return n=>n>0?t:e}const Q=(e,t,n)=>e+(t-e)*n,Us=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tk=[Oo,Ft,mn],nk=e=>tk.find(t=>t.test(e));function xl(e){const t=nk(e);if(!t)return!1;let n=t.parse(e);return t===mn&&(n=ek(n)),n}const wl=(e,t)=>{const n=xl(e),r=xl(t);if(!n||!r)return Xr(e,t);const s={...n};return o=>(s.red=Us(n.red,r.red,o),s.green=Us(n.green,r.green,o),s.blue=Us(n.blue,r.blue,o),s.alpha=Q(n.alpha,r.alpha,o),Ft.transform(s))},Do=new Set(["none","hidden"]);function rk(e,t){return Do.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sk(e,t){return n=>Q(e,t,n)}function Ui(e){return typeof e=="number"?sk:typeof e=="string"?Vi(e)?Xr:be.test(e)?wl:ak:Array.isArray(e)?Gp:typeof e=="object"?be.test(e)?wl:ok:Xr}function Gp(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Ui(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function ok(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ui(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function ik(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],l=e.values[i]??0;n[s]=l,r[o]++}return n}const ak=(e,t)=>{const n=Oe.createTransformer(t),r=er(e),s=er(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Do.has(e)&&!s.values.length||Do.has(t)&&!r.values.length?rk(e,t):dr(Gp(ik(r,s),s.values),n):Xr(e,t)},Sl=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function lk(e,t){const n=Sl.exec(e);if(!n)return;const r=Sl.exec(t);if(!r||n[2]!==r[2])return;const s=n[2],o=parseFloat(n[1]),i=parseFloat(r[1]);return l=>_n(Q(o,i,l))+s}function Wi(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return Q(e,t,n);if(typeof e=="string"&&typeof t=="string"){const s=lk(e,t);if(s)return s}return Ui(e)(e,t)}const Tr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ck(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new Set;let i={delta:0,timestamp:0,isProcessing:!1};function l(a){o.has(a)&&(n.add(a),e()),a(i)}const u={schedule:(a,d=!1,c=!1)=>{const y=c&&r?t:n;return d&&o.add(a),y.add(a),a},cancel:a=>{n.delete(a),o.delete(a)},process:a=>{if(i=a,r){s=!0;return}r=!0;const d=t;t=n,n=d,t.forEach(l),t.clear(),r=!1,s&&(s=!1,u.process(a))}};return u}const uk=40;function Kp(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,s=!0;const o=()=>r=!0,i=Tr.reduce((x,p)=>(x[p]=ck(o),x),{}),{setup:l,read:u,resolveKeyframes:a,preUpdate:d,update:c,preRender:f,render:y,postRender:v}=i,T=()=>{const x=mt.useManualTiming,p=x?n.timestamp:performance.now();r=!1,x||(n.delta=s?1e3/60:Math.max(Math.min(p-n.timestamp,uk),1)),n.timestamp=p,n.isProcessing=!0,l.process(n),u.process(n),a.process(n),d.process(n),c.process(n),f.process(n),y.process(n),v.process(n),n.isProcessing=!1,r&&t&&(s=!1,e(T))},S=()=>{r=!0,s=!0,n.isProcessing||e(T)};return{schedule:Tr.reduce((x,p)=>{const b=i[p];return x[p]=(w,_=!1,E=!1)=>(r||S(),b.schedule(w,_,E)),x},{}),cancel:x=>{for(let p=0;p<Tr.length;p++)i[Tr[p]].cancel(x)},state:n,steps:i}}const{schedule:ee,cancel:Ct,steps:Ws}=Kp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0,ve),dk=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ee.update(t,n),stop:()=>Ct(t),now:()=>ve.isProcessing?ve.timestamp:Te.now()}},qp=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Gi=2e4;function Ki(e,t=50,n=Gi,r){let s=0,o=e.next(s);for(;!o.done&&s<n;)s+=t,o=e.next(s);return s>=n?1/0:s}function fk(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Ki(r),Gi);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Ve(s)}}const _e={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Jp=e=>e<0?1/Math.max(1+e,_e.minDamping):Math.max(1-e,_e.minDamping);function Hp(e,t){if(!(e>1))return 1;const n=Math.sqrt(e*e-1),r=e-n,s=e+n,o=2*n*Math.exp(-t)*(1+t);return Yp(i=>s*Math.exp(-r*i)-r*Math.exp(-s*i)-o,i=>Math.exp(-s*i)-Math.exp(-r*i),t)/t}function zo(e,t){return e*Math.sqrt(1-t*t)}const pk=12;function Yp(e,t,n){let r=n;for(let s=1;s<pk;s++)r=r-e(r)/t(r);return r}const Gs=.001;function hk({duration:e=_e.duration,bounce:t=_e.bounce}){let n,r;const s=Jp(t);e=yt(_e.minDuration,_e.maxDuration,Ve(e)),s<1?(n=a=>{const d=a*s,c=d*e,f=zo(a,s),y=Math.exp(-c);return Gs-d/f*y},r=a=>{const c=a*s*e,f=s*s*a*a*e,y=Math.exp(-c),v=zo(a*a,s);return(-n(a)+Gs>0?-1:1)*-f*y/v}):(n=a=>{const d=Math.exp(-a*e),c=a*e+1;return-Gs+d*c},r=a=>{const d=Math.exp(-a*e),c=-a*(e*e);return d*c});const o=5/e,i=Yp(n,r,o),l=i*Hp(s,i*e),u=l*l;return{stiffness:u,damping:s*2*Math.sqrt(u),duration:Ze(e)}}const $o=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Ks(e,t){if($o(e,t))return e}function mk(e){const t=Ks(e.stiffness),n=Ks(e.damping,!0),r=Ks(e.mass),s={...e,stiffness:t??_e.stiffness,damping:n??_e.damping,mass:r??_e.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(s.isTimeDefined){if(e.visualDuration){const o=Jp(e.bounce||0),i=2*Math.PI/(e.visualDuration*1.2)*Hp(o,2*Math.PI/1.2);s.stiffness=i*i,s.damping=2*o*Math.sqrt(s.stiffness)}else Object.assign(s,hk(s)),s.isResolvedFromDuration=!0;(!$o(s.stiffness)||!$o(s.damping,!0))&&(s.stiffness=_e.stiffness,s.damping=_e.damping)}return s}function Qr(e=_e.visualDuration,t=_e.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,r=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:i,damping:l,mass:u,duration:a,isResolvedFromDuration:d,isTimeDefined:c}=mk({...n}),f=_=>c?0:-Ve(_),y=l/(2*Math.sqrt(i*u)),v=Ve(Math.sqrt(i/u)),T=y*v,S={target:s,delta:s-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},C=()=>{const _=Math.abs(S.delta)<5;S.restSpeed=n.restSpeed||(_?_e.restSpeed.granular:_e.restSpeed.default),S.restDelta=n.restDelta||(_?_e.restDelta.granular:_e.restDelta.default)};C();let k,x,p;if(y<1){const _=zo(v,y),E={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};p=()=>{E.A=(S.velocity+T*S.delta)/_,E.sinC=T*E.A+S.delta*_,E.cosC=T*S.delta-E.A*_};const I=z=>{z!==E.t&&(E.t=z,E.env=Math.exp(-T*z),E.sin=Math.sin(_*z),E.cos=Math.cos(_*z))};k=z=>(I(z),S.target-E.env*(E.A*E.sin+S.delta*E.cos)),x=z=>(I(z),E.env*(E.sinC*E.sin+E.cosC*E.cos))}else if(y===1){k=E=>S.target-Math.exp(-v*E)*(S.delta+(S.velocity+v*S.delta)*E);const _={C:0};p=()=>{_.C=S.velocity+v*S.delta},x=E=>Math.exp(-v*E)*(v*_.C*E-S.velocity)}else{const _=v*Math.sqrt(y*y-1),E=T-_,I=T+_,z=c?1/0:300/_,K=(Y,W)=>Math.exp(W>z?-Y*z-T*(W-z):-Y*W),L={S:0,F:0};p=()=>{const Y=(S.velocity+T*S.delta)/_;L.S=(S.delta+Y)/2,L.F=(S.delta-Y)/2},k=Y=>S.target-L.S*K(E,Y)-L.F*K(I,Y),x=Y=>E*L.S*K(E,Y)+I*L.F*K(I,Y)}p();const b=d&&a||null,w={calculatedDuration:b,retarget:(_,E)=>{S.target=_[_.length-1],S.delta=S.target-_[0],S.velocity=f(E),n.restSpeed&&n.restDelta||C(),w.calculatedDuration=b,o.done=!1,p()},velocity:_=>Ze(x(_)),next:_=>{const E=k(_);if(d)o.done=_>=a;else{const I=Ze(x(_));o.done=Math.abs(I)<=S.restSpeed&&Math.abs(S.target-E)<=S.restDelta}return o.value=o.done?S.target:E,o},toString:()=>{const _=Math.min(Ki(w),Gi),E=qp(I=>w.next(_*I).value,_,30);return _+"ms "+E},toTransition:()=>{}};return w}Qr.applyToOptions=e=>{const t=fk(e,100,Qr);return e.ease=t.ease,e.duration=Ze(t.duration),e.type="keyframes",e};function Lo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:l,max:u,restDelta:a=.5,restSpeed:d}){const c=e[0],f={done:!1,value:c},y=_=>_<l||_>u,v=_=>l===void 0?u:u===void 0||Math.abs(l-_)<Math.abs(u-_)?l:u;let T=n*t;const S=c+T,C=i===void 0?S:i(S);C!==S&&(T=C-c);const k=_=>-T*Math.exp(-_/r),x=_=>{const E=k(_);f.done=Math.abs(E)<=a,f.value=f.done?C:C+E};let p,b;const w=_=>{y(f.value)&&(p=_,b=Qr({keyframes:[f.value,v(f.value)],velocity:-k(_)/r*1e3,damping:s,stiffness:o,restDelta:a,restSpeed:d}))};return w(0),{calculatedDuration:null,next:_=>{let E=!1;return!b&&p===void 0&&(E=!0,x(_),w(_)),p!==void 0&&_>=p?b.next(_-p):(!E&&x(_),f)}}}function gk(e,t,n){const r=[],s=n||mt.mix||Wi,o=e.length-1;for(let i=0;i<o;i++){let l=s(e[i],e[i+1]);if(t){const u=Array.isArray(t)?t[i]||Xe:t;l=dr(u,l)}r.push(l)}return r}function yk(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(vs(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gk(t,r,s),u=l.length,a=d=>{if(i&&d<e[0])return t[0];let c=0;if(u>1)for(;c<e.length-2&&!(d<e[c+1]);c++);const f=Xn(e[c],e[c+1],d);return l[c](f)};return n?d=>a(yt(e[0],e[o-1],d)):a}function vk(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xn(0,t,r);e.push(Q(n,1,s))}}function bk(e){const t=[0];return vk(t,e.length-1),t}function xk(e,t){return e.map(n=>n*t)}function wk(e,t){return e.map(()=>t||Fi).splice(0,e.length-1)}function Un({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=ME(r)?r.map(gl):gl(r)||Fi,o={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(s)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){const[u,a]=t,d=u===a?void 0:(mt.mix||Wi)(u,a);return{calculatedDuration:e,next:c=>(o.value=d?d(s(e>0?yt(0,1,c/e):1)):a,o.done=c>=e,o)}}const i=xk(n&&n.length===t.length?n:bk(t),e),l=yk(i,t,{ease:Array.isArray(s)?s:wk(t,s)});return{calculatedDuration:e,next:u=>(o.value=l(u),o.done=u>=e,o)}}const Sk=5;function _k(e,t,n){const r=Math.max(t-Sk,0);return Pp(n-e(r),t-r)}function Tk(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):_k(r=>e.next(r).value,t,e.next(t).value)}const Ek=e=>e!==null;function bs(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(Ek),l=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!l||r===void 0?o[l]:r}const kk={decay:Lo,inertia:Lo,tween:Un,keyframes:Un,spring:Qr};function Xp(e){typeof e.type=="string"&&(e.type=kk[e.type])}function Qp(e,t){return{kind:e,animation:t,timestamp:Te.now(),frameTimestamp:ve.timestamp,frameIsProcessing:ve.isProcessing}}function eh(e,t,n){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Qp("animation-start",e),options:n?{...t,...n}:t})}catch{}}function Ck(e,t){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Qp("layout-animation-start",e),node:t})}catch{}}class qi{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,n){return this.finished.then(t,n)}}const Pk=e=>e/100;class es extends qi{constructor(t){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=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Te.now()&&this.tick(Te.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),eh(this,this.options)}initAnimation(){const{options:t}=this;Xp(t);const{type:n=Un,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:l}=t;const u=n||Un;u!==Un&&typeof l[0]!="number"&&(this.mixKeyframes=dr(Pk,Wi(l[0],l[1])),l=[0,100]);const a=u(l===t.keyframes?t:{...t,keyframes:l});o==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-i})),a.calculatedDuration===null&&(a.calculatedDuration=Ki(a));const{calculatedDuration:d}=a;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=a}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:a=0,keyframes:d,repeat:c,repeatType:f,repeatDelay:y,type:v,onUpdate:T,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const C=this.currentTime-a*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?C<0:C>s;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,p=r;if(c){const E=Math.min(this.currentTime,s)/l;let I=Math.floor(E),z=E%1;!z&&E>=1&&(z=1),z===1&&I--,I=Math.min(I,c+1),!!(I%2)&&(f==="reverse"?(z=1-z,y&&(z-=y/l)):f==="mirror"&&(p=i)),x=yt(0,1,z)*l}let b;k?(this.delayState.value=d[0],b=this.delayState):b=p.next(x),o&&!k&&(b.value=o(b.value));let{done:w}=b;!k&&u!==null&&(w=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return _&&v!==Lo&&(b.value=bs(d,this.options,S,this.speed)),T&&T(b.value),_&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return Ve(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ve(t)}get time(){return Ve(this.currentTime)}set time(t){t=Ze(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Tk(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Te.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ve(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=dk,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Te.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}const Ak=new Set(["brightness","contrast","saturate","opacity"]);function Ik(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Zi)||[];if(!r)return e;const s=n.replace(r,"");let o=Ak.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Mk=/\b([a-z-]*)\(.*?\)/gu,Fo={...Oe,getAnimatableNone:e=>{const t=e.match(Mk);return t?t.map(Ik).join(" "):e}},Vo={...Oe,getAnimatableNone:e=>{const t=Oe.parse(e);return Oe.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},_l={...Nn,transform:Math.round},jk={rotate:ft,pathRotation:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:_r,scaleX:_r,scaleY:_r,scaleZ:_r,skew:ft,skewX:ft,skewY:ft,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:Qn,originX:vl,originY:vl,originZ:O},ts={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,top:O,right:O,bottom:O,left:O,inset:O,insetBlock:O,insetBlockStart:O,insetBlockEnd:O,insetInline:O,insetInlineStart:O,insetInlineEnd:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,paddingBlock:O,paddingBlockStart:O,paddingBlockEnd:O,paddingInline:O,paddingInlineStart:O,paddingInlineEnd:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,marginBlock:O,marginBlockStart:O,marginBlockEnd:O,marginInline:O,marginInlineStart:O,marginInlineEnd:O,fontSize:O,backgroundPositionX:O,backgroundPositionY:O,...jk,zIndex:_l,fillOpacity:Qn,strokeOpacity:Qn,numOctaves:_l},Rk={...ts,color:be,backgroundColor:be,outlineColor:be,fill:be,stroke:be,borderColor:be,borderTopColor:be,borderRightColor:be,borderBottomColor:be,borderLeftColor:be,filter:Fo,WebkitFilter:Fo,mask:Vo,WebkitMask:Vo},th=e=>Rk[e],Nk=new Set([Fo,Vo]);function Ji(e,t){let n=th(e);return Nk.has(n)||(n=Oe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function Ok(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Vt=e=>e*180/Math.PI,Zo=e=>{const t=Vt(Math.atan2(e[1],e[0]));return Bo(t)},Dk={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Zo,rotateZ:Zo,skewX:e=>Vt(Math.atan(e[1])),skewY:e=>Vt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bo=e=>(e=e%360,e<0&&(e+=360),e),Tl=Zo,El=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),kl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),zk={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:El,scaleY:kl,scale:e=>(El(e)+kl(e))/2,rotateX:e=>Bo(Vt(Math.atan2(e[6],e[5]))),rotateY:e=>Bo(Vt(Math.atan2(-e[2],e[0]))),rotateZ:Tl,rotate:Tl,skewX:e=>Vt(Math.atan(e[4])),skewY:e=>Vt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tr(e){return e.includes("scale")?1:0}function Uo(e,t){if(!e||e==="none")return tr(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=zk,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Dk,s=l}if(!s)return tr(t);const o=r[t],i=s[1].split(",").map(Lk);return typeof o=="function"?o(i):i[o]}const $k=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Uo(n,t)};function Lk(e){return parseFloat(e.trim())}const On=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],St=new Set([...On,"pathRotation"]),Cl=e=>e===Nn||e===O,Fk=new Set(["x","y","z"]),Vk=On.filter(e=>!Fk.has(e));function Zk(e){const t=[];return Vk.forEach(n=>{const r=e.getValue(n);if(r!==void 0){const s=r.get(),o=n.startsWith("scale")?1:0;if(s===o)return;t.push([n,s]),r.set(o)}}),t}const Bk=new Set(["bottom","right"]);function Pl(e,t,n,r,s,o){const i=parseFloat(e);if(!isNaN(i))return i;const{min:l,max:u}=t()[n],a=u-l;return o==="border-box"?a:a-parseFloat(r)-parseFloat(s)}const Gt={width:({width:e,paddingLeft:t="0",paddingRight:n="0",boxSizing:r},s)=>Pl(e,s,"x",t,n,r),height:({height:e,paddingTop:t="0",paddingBottom:n="0",boxSizing:r},s)=>Pl(e,s,"y",t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{const{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Uo(e,"x"),y:({transform:e})=>Uo(e,"y")};Gt.translateX=Gt.x;Gt.translateY=Gt.y;const Kt=new Set;let Wo=!1,Go=!1,Ko=!1;function nh(){if(Go){const e=[],t=new Set,n=new Set;Kt.forEach(s=>{s.needsMeasurement&&(e.push(s),t.add(s.element),Bk.has(s.name)&&n.add(s.element))});const r=new Map;n.forEach(s=>{const o=Zk(s);o.length&&(r.set(s,o),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const o=r.get(s);o&&o.forEach(([i,l])=>{var u;(u=s.getValue(i))==null||u.set(l)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Go=!1,Wo=!1,Kt.forEach(e=>e.complete(Ko)),Kt.clear()}function rh(){Kt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Go=!0)})}function Uk(){Ko=!0,rh(),nh(),Ko=!1}function Wk(e,t,n){if(typeof e=="string"){if(Di(e)||zi(e))return parseFloat(e);if(!Oe.test(e)&&Oe.test(n))return Ji(t,n)}return e??void 0}class Hi{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Kt.add(this),Wo||(Wo=!0,ee.read(rh),ee.resolveKeyframes(nh))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=Wk(r.readValue(n,i),n,i);l!==void 0&&(t[0]=l)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Ok(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Kt.delete(this)}cancel(){this.state==="scheduled"&&(Kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gk=e=>e.startsWith("--");function sh(e,t,n){Gk(t)?e.style.setProperty(t,n):e.style[t]=n}const Kk={};function oh(e,t){const n=Cp(e);return()=>Kk[t]??n()}const qk=oh(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ih=oh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Zn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Al={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zn([0,.65,.55,1]),circOut:Zn([.55,0,1,.45]),backIn:Zn([.31,.01,.66,-.59]),backOut:Zn([.33,1.53,.69,.99])};function ah(e,t){if(e)return typeof e=="function"?ih()?qp(e,t):"ease-out":zp(e)?Zn(e):Array.isArray(e)?e.map(n=>ah(n,t)||Al.easeOut):Al[e]}function Jk(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:l="easeOut",times:u}={},a=void 0){const d={[t]:n};u&&(d.offset=u);const c=ah(l,s);Array.isArray(c)&&(d.easing=c);const f={delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return a&&(f.pseudoElement=a),e.animate(d,f)}function lh(e){return typeof e=="function"&&"applyToOptions"in e}function Hk({type:e,...t}){return lh(e)&&ih()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ch extends qi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,vs(typeof t.type!="string");const a=Hk(t);this.animation=Jk(n,r,s,a,o),a.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=bs(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),sh(n,r,d),this.animation.cancel()}u==null||u(),this.notifyFinished()},eh(this,t,a)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ve(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ve(t)}get time(){return Ve(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ze(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:n,observe:r}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qk()?(this.animation.timeline=t,n==null||n(this.animation),Xe):r(this)}}const uh={anticipate:Np,backInOut:Rp,circInOut:Dp};function Yk(e){return e in uh}function Xk(e){typeof e.ease=="string"&&Yk(e.ease)&&(e.ease=uh[e.ease])}const qs=10;class Qk extends ch{constructor(t){Xk(t),Xp(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new es({...i,autoplay:!1}),u=Math.max(qs,Te.now()-this.startTime),a=yt(0,qs,u-qs),d=l.sample(u).value,{name:c}=this.options;o&&c&&sh(o,c,d),n.setWithVelocity(l.sample(Math.max(0,u-a)).value,d,a),l.stop()}}const Il=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Oe.test(e)||e==="0")&&!e.startsWith("url("));function eC(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tC(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Il(s,t),l=Il(o,t);return!i||!l?!1:eC(e)||(n==="spring"||lh(n))&&r}function qo(e){e.duration=0,e.type="keyframes"}const Jo=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),nC=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function rC(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&nC.test(e[t]))return!0;return!1}const Ml=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sC=Cp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oC(e){var c;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:l}=e;if(!n||!(Jo.has(n)||Ml.has(n)))return!1;const u=(c=t==null?void 0:t.owner)==null?void 0:c.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:a,transformTemplate:d}=t.owner.getProps();return sC()&&(Jo.has(n)||Ml.has(n)&&rC(l))&&(n!=="transform"||!d)&&!a&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const iC=40;class aC extends qi{constructor(t){var u;super(),this.stop=()=>{var a,d;this._animation&&(this._animation.stop(),(a=this.stopTimeline)==null||a.call(this)),(d=this.keyframeResolver)==null||d.cancel()},this.createdAt=Te.now();const{keyframes:n,name:r,motionValue:s,element:o}=t,i=t;i.autoplay??(i.autoplay=!0),i.delay??(i.delay=0),i.type??(i.type="keyframes"),i.repeat??(i.repeat=0),i.repeatDelay??(i.repeatDelay=0),i.repeatType??(i.repeatType="loop");const l=(o==null?void 0:o.KeyframeResolver)||Hi;this.keyframeResolver=new l(n,(a,d,c)=>this.onKeyframesResolved(a,d,i,!c),r,s,o),(u=this.keyframeResolver)==null||u.scheduleResolve()}onKeyframesResolved(t,n,r,s){var S,C;this.keyframeResolver=void 0;const{name:o,type:i,velocity:l,delay:u,isHandoff:a,onUpdate:d}=r;this.resolvedAt=Te.now();let c=!0;tC(t,o,i,l)||(c=!1,(mt.instantAnimations||!u)&&(d==null||d(bs(t,r,n))),t[0]=t[t.length-1],qo(r),r.repeat=0);const f=s?this.resolvedAt?this.resolvedAt-this.createdAt>iC?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:y}=r;r.startTime??(r.startTime=f),r.finalKeyframe=n,r.keyframes=t,r.onComplete=()=>{y==null||y(),this.notifyFinished()};const v=c&&!a&&oC(r);let T;if(v){r.element=(C=(S=r.motionValue)==null?void 0:S.owner)==null?void 0:C.current;try{T=new Qk(r)}catch{T=new es(r)}}else T=new es(r);this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this._animation.finished:super.finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Uk()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function dh(e,t,n,r=0,s=1){const o=Array.from(e).sort((a,d)=>a.sortNodePosition(d)).indexOf(t),i=e.size,l=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:l-o*r}const jl=30,lC=e=>!isNaN(parseFloat(e));class cC{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=Te.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Te.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lC(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){var r;return t==="change"?this.onChangeSubscribe(n):((r=this.events)[t]||(r[t]=new Yr)).add(n)}onChangeSubscribe(t){const{events:n}=this;return!n.change&&!this.changeSubscriber?this.changeSubscriber=t:(n.change||(n.change=new Yr,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)),()=>{var r;this.changeSubscriber===t?this.changeSubscriber=void 0:(r=n.change)==null||r.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){ee.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var r;const{current:t,changeSubscriber:n}=this;n?n(t):(r=this.events.change)==null||r.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Te.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>jl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,jl);return Pp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{var o;this.hasAnimated=!0;let r=!1,s;s=t(()=>{var i;r=!0,(i=this.events.animationComplete)==null||i.notify(),this.animation===s&&this.clearAnimation(),n()}),r||(this.animation=s),(o=this.events.animationStart)==null||o.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(e,t){return new cC(e,t)}function fh(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Yi(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?fh(n,e):n}const uC={type:"spring",stiffness:500,damping:25,restSpeed:10},dC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fC={type:"keyframes",duration:.8},pC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hC=(e,{keyframes:t})=>t.length>2?fC:St.has(e)?e.startsWith("scale")?dC(t[1]):uC:pC,mC=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function gC(e){for(const t in e)if(!mC.has(t))return!0;return!1}const Xi=(e,t,n,r={},s,o)=>i=>{const l=Yi(r,e)||{},u=l.delay||r.delay||0;let{elapsed:a=0}=r;a=a-Ze(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-a,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{i(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:s};gC(l)||Object.assign(d,hC(e,d)),d.duration&&(d.duration=Ze(d.duration)),d.repeatDelay&&(d.repeatDelay=Ze(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(qo(d),d.delay===0&&(c=!0)),(mt.instantAnimations||mt.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(c=!0,qo(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,c&&!o&&t.get()!==void 0){const f=bs(d.keyframes,l);if(f!==void 0){ee.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new es(d):new aC(d)},yC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vC(e){const t=yC.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function ph(e,t,n=1){const[r,s]=vC(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return Di(i)?parseFloat(i):i}return Vi(s)?ph(s,t,n+1):s}function bC(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function hh(e,t,n,r){const s=o=>typeof o=="function"?o(n!==void 0?n:e.custom,...bC(r)):o;return t=s(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),s(t)}function qt(e,t,n){return hh(e.getProps(),t,n,e)}const mh=(e,t)=>{var n;return t==="exit"?(n=e.presenceContext)==null?void 0:n.custom:void 0},gh=new Set(["width","height","top","left","right","bottom",...On]),xC=e=>Array.isArray(e);function wC(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,In(n))}function SC(e){return xC(e)?e[e.length-1]||0:e}function _C(e,t){const n=qt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const l=SC(o[i]);wC(e,i,l)}}const Ee=e=>!!(e&&e.getVelocity);function TC(e){return!!(Ee(e)&&e.add)}function Ho(e,t){const n=e.getValue("willChange");if(TC(n))return n.add(t);if(!n&&mt.WillChange){const r=new mt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Qi(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const EC="framerAppearId",yh="data-"+Qi(EC);function vh(e){return e.props[yh]}const kC=typeof window<"u";function CC({protectedKeys:e,needsAnimating:t},n){const r=n in e&&!t[n];return t[n]=!1,r}function bh(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var v;let{transition:o,transitionEnd:i,...l}=t;const u=e.getDefaultTransition();o=o?fh(o,u):u;const a=o==null?void 0:o.reduceMotion,d=o==null?void 0:o.skipAnimations;r&&(o=r);const c=[],f=s&&((v=e.animationState)==null?void 0:v.getState()[s]),y=o==null?void 0:o.path;y&&y.animateVisualElement(e,l,o,n,c);for(const T in l){const S=e.getValue(T,e.latestValues[T]??null),C=l[T];if(C===void 0||f&&CC(f,T))continue;const k={delay:n,...Yi(o||{},T)};d&&(k.skipAnimations=!0);const x=S.get();if(x!==void 0&&!S.isAnimating()&&!Array.isArray(C)&&C===x&&!k.velocity){ee.update(()=>S.set(C));continue}let p=!1;if(kC&&window.MotionHandoffAnimation){const _=vh(e);if(_){const E=window.MotionHandoffAnimation(_,T,ee);E!==null&&(k.startTime=E,p=!0)}}Ho(e,T);const b=a??e.shouldReduceMotion;S.start(Xi(T,S,C,b&&gh.has(T)?{type:!1}:k,e,p));const w=S.animation;w&&c.push(w)}if(i){const T=()=>ee.update(()=>{i&&_C(e,i)});c.length?Promise.all(c).then(T):T()}return c}function Yo(e,t,n={}){const r=qt(e,t,mh(e,n.type)),s=n.transitionOverride||((r==null?void 0:r.transition)??(e.getDefaultTransition()||{})),o=()=>Promise.all(r?bh(e,r,n):[]),i=(u=0)=>{const{variantChildren:a}=e,{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=s,y=[];return a==null||a.forEach(v=>{v.notify("AnimationStart",t),y.push(Yo(v,t,{...n,delay:u+(typeof d=="function"?0:d)+dh(a,v,d,c,f)}).then(()=>v.notify("AnimationComplete",t)))}),Promise.all(y)},{when:l}=s;return l?l==="beforeChildren"?o().then(()=>i()):i().then(o):Promise.all([o(),i(n.delay)])}function PC(e,t,n={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(s=>Yo(e,s,n))):typeof t=="string"?Yo(e,t,n):Promise.all(bh(e,qt(e,t,n.custom),n))).then(()=>{e.notify("AnimationComplete",t)})}const AC={test:e=>e==="auto",parse:e=>e},IC=e=>t=>t.test(e),MC=[Nn,O,lt,ft,ZE,VE,AC],Rl=e=>MC.find(IC(e));function jC(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zi(e):!0}const RC=new Set(["auto","none","0"]);function NC(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!RC.has(o)&&qE(o)&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]!==s&&(e[o]=Ji(n,s))}class OC extends Hi{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let c=t[d];if(typeof c=="string"&&(c=c.trim(),Vi(c))){const f=ph(c,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!gh.has(r)||t.length!==2)return;const[s,o]=t;if(typeof s=="number"&&typeof o=="number")return;const i=Rl(s),l=Rl(o),u=yl(s),a=yl(o);if(u!==a&&Gt[r]){this.needsMeasurement=!0;return}if(i!==l)if(Cl(i)&&Cl(l))for(let d=0;d<t.length;d++){const c=t[d];typeof c=="string"&&(t[d]=parseFloat(c))}else Gt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||jC(t[s]))&&r.push(s);r.length&&NC(t,r,n)}measure(){const{element:t,name:n}=this;return Gt[n](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var o;const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&((o=this.motionValue)==null||o.jump(s,!1))}measureEndState(){var o,i;const{element:t,unresolvedKeyframes:n}=this;if(!t||!t.current)return;(o=this.motionValue)==null||o.jump(this.measuredOrigin,!1);const r=n.length-1,s=n[r];n[r]=this.measure(),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const ea=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function DC(e){return kp(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function ta(e){return kp(e)&&"ownerSVGElement"in e}const Xo=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function xh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const zC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$C=On.length;function LC(e,t,n){let r="",s=!0;for(let i=0;i<$C;i++){const l=On[i],u=e[l];if(u===void 0)continue;let a=!0;if(typeof u=="number")a=u===(l.startsWith("scale")?1:0);else{const d=parseFloat(u);a=l.startsWith("scale")?d===1:d===0}if(!a||n){const d=Xo(u,ts[l]);if(!a){s=!1;const c=zC[l]||l;r+=`${c}(${d}) `}n&&(t[l]=d)}}const o=e.pathRotation;return o&&(s=!1,r+=`rotate(${Xo(o,ts.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function na(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,l=!1;for(const u in t){const a=t[u];if(St.has(u)){i=!0;continue}else if(Lp(u)){s[u]=a;continue}else{const d=Xo(a,ts[u]);u.startsWith("origin")?(l=!0,o[u]=d):r[u]=d}}if(t.transform||(i||n?r.transform=LC(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:a="50%",originZ:d=0}=o;r.transformOrigin=`${u} ${a} ${d}`}}const FC={offset:"stroke-dashoffset",array:"stroke-dasharray"},VC={offset:"strokeDashoffset",array:"strokeDasharray"};function ZC(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?FC:VC;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const wh=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Sh(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...l},u,a,d){if(na(e,l,a),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:c,style:f}=e;for(const y of wh)c[y]!==void 0&&(f[y]=c[y],delete c[y]);(f.transform||c.transformOrigin)&&(f.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete c.transformBox),t!==void 0&&(c.x=t),n!==void 0&&(c.y=n),r!==void 0&&(c.scale=r),s!==void 0&&ZC(c,s,o,i,!1)}function _h({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BC({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UC(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(e){return e===void 0||e===1}function Qo({scale:e,scaleX:t,scaleY:n}){return!Js(e)||!Js(t)||!Js(n)}function Lt(e){return Qo(e)||Th(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Th(e){return Nl(e.x)||Nl(e.y)}function Nl(e){return e&&e!=="0%"}function ns(e,t,n){const r=e-n,s=t*r;return n+s}function Ol(e,t,n,r,s){return s!==void 0&&(e=ns(e,s,r)),ns(e,n,r)+t}function ei(e,t=0,n=1,r,s){e.min=Ol(e.min,t,n,r,s),e.max=Ol(e.max,t,n,r,s)}function Eh(e,{x:t,y:n}){ei(e.x,t.translate,t.scale,t.originPoint),ei(e.y,n.translate,n.scale,n.originPoint)}const Dl=.999999999999,zl=1.0000000000001;function WC(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let u=0;u<s;u++){o=n[u],i=o.projectionDelta;const{visualElement:a}=o.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ot(e.x,-o.scroll.offset.x),ot(e.y,-o.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Eh(e,i)),r&&Lt(o.latestValues)&&Ar(e,o.latestValues,(l=o.layout)==null?void 0:l.layoutBox))}t.x<zl&&t.x>Dl&&(t.x=1),t.y<zl&&t.y>Dl&&(t.y=1)}function ot(e,t){e.min+=t,e.max+=t}function $l(e,t,n,r,s=.5){const o=Q(e.min,e.max,s);ei(e,t,n,o,r)}function Ll(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Ar(e,t,n){const r=n??e;$l(e.x,Ll(t.x,r.x),t.scaleX,t.scale,t.originX),$l(e.y,Ll(t.y,r.y),t.scaleY,t.scale,t.originY)}function kh(e,t){return _h(UC(e.getBoundingClientRect(),t))}function GC(e,t,n){const r=kh(e,n),{scroll:s}=t;return s&&(ot(r.x,s.offset.x),ot(r.y,s.offset.y)),r}const{schedule:ra}=Kp(queueMicrotask,!1),He={x:!1,y:!1};function Ch(){return He.x||He.y}function KC(e){return e==="x"||e==="y"?He[e]?null:(He[e]=!0,()=>{He[e]=!1}):He.x||He.y?null:(He.x=He.y=!0,()=>{He.x=He.y=!1})}function Ph(e,t){const n=xh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function qC(e){return!(e.pointerType==="touch"||Ch())}function JC(e,t,n={}){const[r,s,o]=Ph(e,n);return r.forEach(i=>{let l=!1,u=!1,a;const d=()=>{i.removeEventListener("pointerleave",v)},c=S=>{a&&(a(S),a=void 0),d()},f=S=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,c(S))},y=()=>{l=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},v=S=>{if(S.pointerType!=="touch"){if(l){u=!0;return}c(S)}},T=S=>{if(!qC(S))return;u=!1;const C=t(i,S);typeof C=="function"&&(a=C,i.addEventListener("pointerleave",v,s))};i.addEventListener("pointerenter",T,s),i.addEventListener("pointerdown",y,s)}),o}const Ah=(e,t)=>t?e===t?!0:Ah(e,t.parentElement):!1,sa=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,HC=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YC(e){return HC.has(e.tagName)||e.isContentEditable===!0}const XC=new Set(["INPUT","SELECT","TEXTAREA"]);function QC(e){return XC.has(e.tagName)||e.isContentEditable===!0}const Ir=new WeakSet;function Fl(e){return t=>{t.key==="Enter"&&e(t)}}function Hs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const eP=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Fl(()=>{if(Ir.has(n))return;Hs(n,"down");const s=Fl(()=>{Hs(n,"up")}),o=()=>Hs(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vl(e){return sa(e)&&!Ch()}const Zl=new WeakSet;function tP(e,t,n={}){const[r,s,o]=Ph(e,n),i=l=>{const u=l.currentTarget;if(!Vl(l)||Zl.has(l))return;Ir.add(u),n.stopPropagation&&Zl.add(l);const a=t(u,l),d={...s,capture:!0},c=(v,T)=>{window.removeEventListener("pointerup",f,d),window.removeEventListener("pointercancel",y,d),Ir.has(u)&&Ir.delete(u),Vl(v)&&typeof a=="function"&&a(v,{success:T})},f=v=>{c(v,u===window||u===document||n.useGlobalTarget||Ah(u,v.target))},y=v=>{c(v,!1)};window.addEventListener("pointerup",f,d),window.addEventListener("pointercancel",y,d)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",i,s),DC(l)&&(l.addEventListener("focus",a=>eP(a,s)),!YC(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),o}const Mr=new WeakMap;let xt;const Ih=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:ta(r)&&"getBBox"in r?r.getBBox()[t]:r[n],nP=Ih("inline","width","offsetWidth"),rP=Ih("block","height","offsetHeight");function sP({target:e,borderBoxSize:t}){var n;(n=Mr.get(e))==null||n.forEach(r=>{r(e,{get width(){return nP(e,t)},get height(){return rP(e,t)}})})}function oP(e){e.forEach(sP)}function iP(){typeof ResizeObserver>"u"||(xt=new ResizeObserver(oP))}function aP(e,t){xt||iP();const n=xh(e);return n.forEach(r=>{let s=Mr.get(r);s||(s=new Set,Mr.set(r,s)),s.add(t),xt==null||xt.observe(r)}),()=>{n.forEach(r=>{const s=Mr.get(r);s==null||s.delete(t),s!=null&&s.size||xt==null||xt.unobserve(r)})}}const jr=new Set;let gn;function lP(){gn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jr.forEach(t=>t(e))},window.addEventListener("resize",gn)}function cP(e){return jr.add(e),gn||lP(),()=>{jr.delete(e),!jr.size&&typeof gn=="function"&&(window.removeEventListener("resize",gn),gn=void 0)}}function Bl(e,t){return typeof e=="function"?cP(e):aP(e,t)}function uP(e){return ta(e)&&e.tagName==="svg"}const Ul=e=>typeof e=="number"?e:parseFloat(e),Wl=()=>({translate:0,scale:1,origin:0,originPoint:0}),yn=()=>({x:Wl(),y:Wl()}),Gl=()=>({min:0,max:0}),ye=()=>({x:Gl(),y:Gl()}),dP=new WeakMap;function xs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function nr(e){return typeof e=="string"||Array.isArray(e)}const oa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kl=["initial",...oa];function ws(e){if(xs(e.animate))return!0;for(let t=0;t<Kl.length;t++)if(nr(e[Kl[t]]))return!0;return!1}function Mh(e){return!!(ws(e)||e.variants)}function fP(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Ee(s))e.addValue(r,s);else if(Ee(o))e.addValue(r,In(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,In(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ti={current:null},jh={current:!1},pP=typeof window<"u";function hP(){if(jh.current=!0,!!pP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ti.current=e.matches;e.addEventListener("change",t),t()}else ti.current=!1}const ql=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rs={};function Rh(e){rs=e}function mP(){return rs}class gP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:l},u={}){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=Hi,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 y=Te.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,ee.render(this.render,!1,!0))};const{latestValues:a,renderState:d}=l;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=u,this.blockInitialAnimation=!!i,this.isControllingVariants=ws(n),this.isVariantNode=Mh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in f){const v=f[y];a[y]!==void 0&&Ee(v)&&v.set(a[y])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];if(this.current=t,dP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let s=this;do s=s.props.inherit!==!1&&s.parent;while(s&&!s.isVariantNode);if(s){const{variantChildren:o}=s;o.add(this),this.removeFromVariantTree=()=>o.delete(this)}}this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(jh.current||hP(),this.shouldReduceMotion=ti.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ct(this.notifyUpdate),Ct(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Jo.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:l,times:u,ease:a,duration:d}=n.accelerate,c=new ch({element:this.current,name:t,keyframes:l,times:u,ease:a,duration:Ze(d)}),f=i(c);this.valueSubscriptions.set(t,()=>{f(),c.cancel()});return}const r=St.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ee.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rs){const n=rs[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];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):ye()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ql.length;r++){const s=ql[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=fP(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,n){const r=this.values.get(t);if(n!==r){r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n);const s=n.get();s!==void 0&&(this.latestValues[t]=s)}}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){var s;if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=In(n??((s=this.getDefaultValue)==null?void 0:s.call(this,t)),{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Di(r)||zi(r))?r=parseFloat(r):typeof r!="number"&&!Oe.test(r)&&Oe.test(n)&&(r=Ji(t,n)),this.setBaseTarget(t,Ee(r)?r.get():r)),Ee(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}on(t,n){return this.events[t]||(this.events[t]=new Yr),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ra.render(this.render)}}class Nh extends gP{constructor(){super(...arguments),this.KeyframeResolver=OC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Oh(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}const rr={};function Dh(e,{layout:t,layoutId:n}){return St.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!rr[e]||e==="opacity")}function ia(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const l in r)(Ee(r[l])||s&&Ee(s[l])||Dh(l,e)||((i=n==null?void 0:n.getValue(l))==null?void 0:i.liveStyle)!==void 0)&&(o[l]=r[l]);return o}function yP(e){return window.getComputedStyle(e)}class vP extends Nh{constructor(){super(...arguments),this.type="html",this.renderInstance=Oh}mount(t){vs(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(St.has(n))return(r=this.projection)!=null&&r.isProjecting?tr(n):$k(t,n);{const s=yP(t),o=(Lp(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return kh(t,n)}build(t,n,r){na(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ia(t,n,r)}}const zh=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"]),$h=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bP(e,t,n,r){Oh(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(zh.has(s)?s:Qi(s),t.attrs[s])}function Lh(e,t,n){const r=ia(e,t,n);for(const s in e)if(Ee(e[s])||Ee(t[s])){const o=On.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class xP extends Nh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ye}getBaseTargetFromProps(t,n){return St.has(n)?super.getBaseTargetFromProps(t,n)??tr(n):t[n]}getDefaultValue(t){return St.has(t)?this.latestValues[t]??tr(t):void 0}readValueFromInstance(t,n){if(St.has(n)){const r=th(n);return r&&r.default||0}if(wh.includes(n)){const s=getComputedStyle(t)[n];if(typeof s=="string"&&s)return s.trim()}return n=zh.has(n)?n:Qi(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Lh(t,n,r)}build(t,n,r){Sh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){bP(t,n,r,s)}mount(t){this.isSVGTag=$h(t.tagName),super.mount(t)}}function Fh(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const wP=[...oa].reverse();function SP(e){let t=l=>Promise.all(l.map(({animation:u,options:a})=>PC(e,u,a))),n=Jl(),r=!0,s=!1;function o(l){var k;const{props:u,parent:a,manuallyAnimateOnMount:d}=e,c=r||s,f=[],y=new Set;let v={},T=1/0,S=e;do S=S.props.inherit!==!1&&S.parent;while(S&&!S.isControllingVariants);if(wP.forEach((x,p)=>{var $e,ke;const b=n[x],w=u[x],_=S&&S.props[x],E=w!==void 0?w:nr(_)||_===!1?_:void 0,I=nr(E),z=x===l?b.isActive:null;z===!1&&(T=p);const K=I&&w===void 0&&!(c&&d);if(b.protectedKeys={...v},!b.isActive&&z===null||!E&&!b.prevProp||xs(E)||typeof E=="boolean")return;if(x==="exit"&&b.isActive&&z!==!0){v={...v,...b.prevResolvedValues};return}const L=_P(b.prevProp,E);let Y=L||I&&(z&&!K||p>T),W=!1;const le=Array.isArray(E)?E:[E];let oe={};if(z!==!1)for(const M of le){const{transition:he,transitionEnd:A,...$}=qt(e,M,mh(e,x))||{};oe={...oe,...$,...A}}const{prevResolvedValues:ce}=b;for(const M in{...ce,...oe}){if(M in v)continue;const he=oe[M],A=ce[M],$=Array.isArray(he)&&Array.isArray(A)?!Fh(he,A)||L:he!==A;if($&&he==null)y.add(M);else if($||he!==void 0&&y.has(M)){Y=!0,y.delete(M)&&(W=!0),b.needsAnimating[M]=!0;const Z=e.getValue(M);Z&&(Z.liveStyle=!1)}else b.protectedKeys[M]=!0}if(b.prevProp=E,b.prevResolvedValues=oe,b.isActive&&(v={...v,...oe}),Y&&(!(K&&L)||W))for(const M of le){const he={type:x};if(typeof M=="string"&&c&&d&&(a!=null&&a.enteringChildren)){const A=(ke=($e=qt(a,M))==null?void 0:$e.transition)==null?void 0:ke.delayChildren;he.delay=dh(a.enteringChildren,e,A)}f.push({animation:M,options:he})}}),y.size){const{initial:x}=u,p={},b=typeof x!="boolean"&&qt(e,Array.isArray(x)?x[0]:x,(k=e.presenceContext)==null?void 0:k.custom);b&&b.transition&&(p.transition=b.transition),y.forEach(w=>{const _=e.getValue(w);_&&(_.liveStyle=!0);const E=b&&!Array.isArray(x)?b[w]:void 0,I=e.getBaseTargetFromProps(u,w);p[w]=(E!==void 0?E:I!==void 0&&!Ee(I)?I:e.initialValues[w]===void 0?e.baseTarget[w]:void 0)??null}),f.push({animation:p})}const C=c&&e.blockInitialAnimation||r&&!d&&(u.initial===!1||u.initial===u.animate);return r=s=!1,!C&&f.length?t(f):Promise.resolve()}function i(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(c=>{var f;return(f=c.animationState)==null?void 0:f.setActive(l,u)}),n[l].isActive=u;const a=o(l);for(const c in n)n[c].protectedKeys={};return a}return{animateChanges:o,setActive:i,setAnimateFunction:l=>{t=l(e)},getState:()=>n,reset:()=>{n=Jl(),s=!0}}}function _P(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fh(t,e):!1}function Jl(){const e={};for(const t of oa)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ni(e,t){e.min=t.min,e.max=t.max}function Je(e,t){ni(e.x,t.x),ni(e.y,t.y)}function Hl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Vh=1e-4,TP=1-Vh,EP=1+Vh,Zh=.01,kP=0-Zh,CP=0+Zh;function je(e){return e.max-e.min}function PP(e,t,n){return Math.abs(e-t)<=n}function Yl(e,t,n,r=.5){e.origin=r,e.originPoint=Q(t.min,t.max,e.origin),e.scale=je(n)/je(t),e.translate=Q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=TP&&e.scale<=EP||isNaN(e.scale))&&(e.scale=1),(e.translate>=kP&&e.translate<=CP||isNaN(e.translate))&&(e.translate=0)}function Wn(e,t,n,r){Yl(e.x,t.x,n.x,r?r.originX:void 0),Yl(e.y,t.y,n.y,r?r.originY:void 0)}function Xl(e,t,n,r=0){const s=r?Q(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+je(t)}function AP(e,t,n,r){Xl(e.x,t.x,n.x,r==null?void 0:r.x),Xl(e.y,t.y,n.y,r==null?void 0:r.y)}function Ql(e,t,n,r=0){const s=r?Q(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+je(t)}function ss(e,t,n,r){Ql(e.x,t.x,n.x,r==null?void 0:r.x),Ql(e.y,t.y,n.y,r==null?void 0:r.y)}function ec(e,t,n,r,s){return e-=t,e=ns(e,1/n,r),s!==void 0&&(e=ns(e,1/s,r)),e}function IP(e,t=0,n=1,r=.5,s,o=e,i=e){if(lt.test(t)&&(t=parseFloat(t),t=Q(i.min,i.max,t/100)-i.min),typeof t!="number")return;let l=Q(o.min,o.max,r);e===o&&(l-=t),e.min=ec(e.min,t,n,l,s),e.max=ec(e.max,t,n,l,s)}function tc(e,t,[n,r,s],o,i){IP(e,t[n],t[r],t[s],t.scale,o,i)}const MP=["x","scaleX","originX"],jP=["y","scaleY","originY"];function nc(e,t,n,r){tc(e.x,t,MP,n?n.x:void 0,r?r.x:void 0),tc(e.y,t,jP,n?n.y:void 0,r?r.y:void 0)}function rc(e){return e.translate===0&&e.scale===1}function Bh(e){return rc(e.x)&&rc(e.y)}function sc(e,t){return e.min===t.min&&e.max===t.max}function RP(e,t){return sc(e.x,t.x)&&sc(e.y,t.y)}function oc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uh(e,t){return oc(e.x,t.x)&&oc(e.y,t.y)}function ic(e){return je(e.x)/je(e.y)}function ac(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function st(e){return[e("x"),e("y")]}function lc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=lc(e,t.target.x),r=lc(e,t.target.y);return`${n}% ${r}%`}},NP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Oe.parse(e);if(s.length>5)return r;const o=Oe.createTransformer(e),i=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;s[0+i]/=l,s[1+i]/=u;const a=Q(l,u,.5);return typeof s[2+i]=="number"&&(s[2+i]/=a),typeof s[3+i]=="number"&&(s[3+i]/=a),o(s)}};function OP(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:a,rotate:d,pathRotation:c,rotateX:f,rotateY:y,skewX:v,skewY:T}=n;a&&(r=`perspective(${a}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),T&&(r+=`skewY(${T}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const DP=ea.length,cc=e=>typeof e=="number"||O.test(e);function zP(e,t,n,r,s,o){s?(e.opacity=Q(0,n.opacity??1,$P(r)),e.opacityExit=Q(t.opacity??1,0,LP(r))):o&&(e.opacity=Q(t.opacity??1,n.opacity??1,r));for(let i=0;i<DP;i++){const l=ea[i];let u=uc(t,l),a=uc(n,l);if(u===void 0&&a===void 0)continue;u||(u=0),a||(a=0),u===0||a===0||cc(u)===cc(a)?(e[l]=Math.max(Q(Ul(u),Ul(a),r),0),(lt.test(a)||lt.test(u))&&(e[l]+="%")):e[l]=a}(t.rotate||n.rotate)&&(e.rotate=Q(t.rotate||0,n.rotate||0,r))}function uc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $P=Wh(0,.5,Op),LP=Wh(.5,.95,Xe);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(Xn(e,t,r))}function FP(e,t,n){const r=Ee(e)?e:In(e);return r.start(Xi("",r,t,n)),r.animation}function sr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const VP=(e,t)=>e.depth-t.depth;class ZP{constructor(){this.children=[],this.isDirty=!1}add(t){Oi(this.children,t),this.isDirty=!0}remove(t){Hr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VP),this.isDirty=!1,this.children.forEach(t)}}function BP(e,t){const n=Te.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(Ct(r),e(o-t))};return ee.setup(r,!0),()=>Ct(r)}function Rr(e){return Ee(e)?e.get():e}class UP{constructor(){this.members=[]}add(t){Oi(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Hr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Hr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:i}=t.options;(o===void 0||o!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,o,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(s=t.resumingFrom)==null?void 0:(o=s.options).onExitComplete)==null||i.call(o)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const WP={borderRadius:{...Fn,applyTo:[...ea]},borderTopLeftRadius:Fn,borderTopRightRadius:Fn,borderBottomLeftRadius:Fn,borderBottomRightRadius:Fn,boxShadow:NP},Nr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(rr,{...WP,...rr});const Ys=["","X","Y","Z"],GP=1e3;let KP=0;function Xs(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Gh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Gh(r)}function Kh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},l=t==null?void 0:t()){this.id=KP++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(HP),this.nodes.forEach(rA),this.nodes.forEach(sA),this.nodes.forEach(YP)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new ZP)}addEventListener(i,l){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Yr),this.eventHandlers.get(i).add(l)}notifyListeners(i,...l){const u=this.eventHandlers.get(i);u&&u.notify(...l)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=ta(i)&&!uP(i),this.instance=i;const{layoutId:l,layout:u,visualElement:a}=this.options;if(a&&!a.current&&a.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),e){let d,c=0;const f=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{c=window.innerWidth}),e(i,()=>{const y=window.innerWidth;y!==c&&(c=y,this.root.updateBlockedByResize=!0,d&&d(),d=BP(f,250),Nr.hasAnimatedSinceResize&&(Nr.hasAnimatedSinceResize=!1,this.nodes.forEach(pc)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&a&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:c,hasRelativeLayoutChanged:f,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||a.getDefaultTransition()||cA,{onLayoutAnimationStart:T,onLayoutAnimationComplete:S}=a.getProps(),C=!this.targetLayout||!Uh(this.targetLayout,y),k=!c&&f;if(this.options.layoutRoot||this.resumeFrom||k||c&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Yi(v,"layout"),onPlay:T,onComplete:S};(a.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,k,x.path)}else c||pc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ct(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(oA),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const c=this.path[d];c.shouldResetTransform=!0,(typeof c.latestValues.x=="string"||typeof c.latestValues.y=="string")&&(c.isLayoutDirty=!0),c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const a=this.getTransformTemplate();this.prevTransformTemplateValue=a?a(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(QP),this.nodes.forEach(dc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eA),this.nodes.forEach(tA),this.nodes.forEach(nA),this.nodes.forEach(qP),this.nodes.forEach(JP)):this.nodes.forEach(fc),this.clearAllSnapshots();const l=Te.now();ve.delta=yt(0,1e3/60,l-ve.timestamp),ve.timestamp=l,ve.isProcessing=!0,Ws.update.process(ve),Ws.preRender.process(ve),Ws.render.process(ve),ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ra.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XP),this.sharedNodes.forEach(iA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!je(this.snapshot.measuredBox.x)&&!je(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=ye()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Bh(this.projectionDelta),u=this.getTransformTemplate(),a=u?u(this.latestValues,""):void 0,d=a!==this.prevTransformTemplateValue;i&&this.instance&&(l||Lt(this.latestValues)||d)&&(s(this.instance,a),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return i&&(u=this.removeTransform(u)),uA(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var a;const{visualElement:i}=this.options;if(!i)return ye();const l=i.measureViewportBox();if(!(((a=this.scroll)==null?void 0:a.wasRoot)||this.path.some(dA))){const{scroll:d}=this.root;d&&(ot(l.x,d.offset.x),ot(l.y,d.offset.y))}return l}removeElementScroll(i){var u;const l=ye();if(Je(l,i),(u=this.scroll)!=null&&u.wasRoot)return l;for(let a=0;a<this.path.length;a++){const d=this.path[a],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&Je(l,i),ot(l.x,c.offset.x),ot(l.y,c.offset.y))}return l}applyTransform(i,l=!1,u){var d,c;const a=u||ye();Je(a,i);for(let f=0;f<this.path.length;f++){const y=this.path[f];!l&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(ot(a.x,-y.scroll.offset.x),ot(a.y,-y.scroll.offset.y)),Lt(y.latestValues)&&Ar(a,y.latestValues,(d=y.layout)==null?void 0:d.layoutBox)}return Lt(this.latestValues)&&Ar(a,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),a}removeTransform(i){var u;const l=ye();Je(l,i);for(let a=0;a<this.path.length;a++){const d=this.path[a];if(!Lt(d.latestValues))continue;let c;d.instance&&(Qo(d.latestValues)&&d.updateSnapshot(),c=ye(),Je(c,d.measurePageBox())),nc(l,d.latestValues,(u=d.snapshot)==null?void 0:u.layoutBox,c)}return Lt(this.latestValues)&&nc(l,this.latestValues),l}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var y;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(i||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:c}=this.options;if(!this.layout||!(d||c))return;this.resolvedRelativeTargetAt=ve.timestamp;const f=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ye(),this.targetWithTransforms=ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),AP(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Je(this.target,this.layout.layoutBox),Eh(this.target,this.targetDelta)):Je(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Qo(this.parent.latestValues)||Th(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,l,u){this.relativeParent=i,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ye(),this.relativeTargetOrigin=ye(),ss(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),Je(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const i=this.getLead(),l=!!this.resumingFrom||this!==i;let u=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ve.timestamp&&(u=!1),u)return;const{layout:a,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(a||d))return;Je(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,f=this.treeScale.y;WC(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=ye());const{target:y}=i;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Hl(this.prevProjectionDelta.x,this.projectionDelta.x),Hl(this.prevProjectionDelta.y,this.projectionDelta.y)),Wn(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==f||!ac(this.projectionDelta.x,this.prevProjectionDelta.x)||!ac(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),i){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yn(),this.projectionDelta=yn(),this.projectionDeltaWithTransform=yn()}setAnimationOrigin(i,l=!1,u){const a=this.snapshot,d=a?a.latestValues:{},c={...this.latestValues},f=yn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const y=ye(),v=a?a.source:void 0,T=this.layout?this.layout.source:void 0,S=v!==T,C=this.getStack(),k=!C||C.members.length<=1,x=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(lA));this.animationProgress=0;let p;const b=u==null?void 0:u.interpolateProjection(i);this.mixTargetDelta=w=>{const _=w/1e3,E=b==null?void 0:b(_);E?(f.x.translate=E.x,f.x.scale=Q(i.x.scale,1,_),f.x.origin=i.x.origin,f.x.originPoint=i.x.originPoint,f.y.translate=E.y,f.y.scale=Q(i.y.scale,1,_),f.y.origin=i.y.origin,f.y.originPoint=i.y.originPoint):(hc(f.x,i.x,_),hc(f.y,i.y,_)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ss(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),aA(this.relativeTarget,this.relativeTargetOrigin,y,_),p&&RP(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p=ye()),Je(p,this.relativeTarget)),S&&(this.animationValues=c,zP(c,d,this.latestValues,_,x,k)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=c),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var l,u,a;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(a=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||a.stop(),this.pendingAnimation&&(Ct(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{Nr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=In(0)),this.motionValue.jump(0,!1),this.currentAnimation=FP(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),Ck(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(GP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead(),{targetWithTransforms:l,layout:u,latestValues:a}=i;let{target:d}=i;if(!(!l||!d||!u)){if(this!==i&&this.layout&&u&&qh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){d=this.target||ye();const c=je(this.layout.layoutBox.x);d.x.min=i.target.x.min,d.x.max=d.x.min+c;const f=je(this.layout.layoutBox.y);d.y.min=i.target.y.min,d.y.max=d.y.min+f}Je(l,d),Ar(l,a),Wn(this.projectionDeltaWithTransform,this.layoutCorrected,l,a)}}registerSharedNode(i,l){this.sharedNodes.has(i)||this.sharedNodes.set(i,new UP),this.sharedNodes.get(i).add(l);const a=l.options.initialPromotionConfig;l.promote({transition:a?a.transition:void 0,preserveFollowOpacity:a&&a.shouldPreserveFollowOpacity?a.shouldPreserveFollowOpacity(l):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var l;const{layoutId:i}=this.options;return i?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:i}=this.options;return i?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:l,preserveFollowOpacity:u}={}){const a=this.getStack();a&&a.promote(this,u),i&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let l=!1;const{latestValues:u}=i;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const a={};u.z&&Xs("z",i,a,this.animationValues);for(let d=0;d<Ys.length;d++)Xs(`rotate${Ys[d]}`,i,a,this.animationValues),Xs(`skew${Ys[d]}`,i,a,this.animationValues);i.render();for(const d in a)i.setStaticValue(d,a[d]),this.animationValues&&(this.animationValues[d]=a[d]);i.scheduleRender()}applyProjectionStyles(i,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Rr(l==null?void 0:l.pointerEvents)||"",i.transform=u?u(this.latestValues,""):"none";return}const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Rr(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Lt(this.latestValues)&&(i.transform=u?u({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=a.animationValues||a.latestValues;this.applyTransformsToTarget();let c=OP(this.projectionDeltaWithTransform,this.treeScale,d);u&&(c=u(d,c)),i.transform=c;const{x:f,y}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${y.origin*100}% 0`,a.animationValues?i.opacity=a===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=a===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in rr){if(d[v]===void 0)continue;const{correct:T,applyTo:S,isCSSVariable:C}=rr[v],k=c==="none"?d[v]:T(d[v],a);if(S){const x=S.length;for(let p=0;p<x;p++)i[S[p]]=k}else C?this.options.visualElement.renderState.vars[v]=k:i[v]=k}this.options.layoutId&&(i.pointerEvents=a===this?Rr(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var l;return(l=i.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(dc),this.root.sharedNodes.clear()}}}function qP(e){e.updateLayout()}function JP(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;if(o==="size")st(c=>{const f=i?t.measuredBox[c]:t.layoutBox[c],y=je(f);f.min=r[c].min,f.max=f.min+y});else if(o==="x"||o==="y"){const c=o==="x"?"y":"x";ni(i?t.measuredBox[c]:t.layoutBox[c],r[c])}else qh(o,t.layoutBox,r)&&st(c=>{const f=i?t.measuredBox[c]:t.layoutBox[c],y=je(r[c]);f.max=f.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+y)});const l=yn();Wn(l,r,t.layoutBox);const u=yn();i?Wn(u,e.applyTransform(s,!0),t.measuredBox):Wn(u,r,t.layoutBox);const a=!Bh(l);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:y}=c;if(f&&y){const v=e.options.layoutAnchor||void 0,T=ye();ss(T,t.layoutBox,f.layoutBox,v);const S=ye();ss(S,r,y.layoutBox,v),Uh(T,S)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=T,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:a,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function HP(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function YP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function XP(e){e.clearSnapshot()}function dc(e){e.clearMeasurements()}function QP(e){e.isLayoutDirty=!0,e.updateLayout()}function fc(e){e.isLayoutDirty=!1}function eA(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function tA(e){var t;e.relativeTarget&&((t=e.relativeParent)!=null&&t.isLayoutDirty)&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function nA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rA(e){e.resolveTargetDelta()}function sA(e){e.calcProjection()}function oA(e){e.resetSkewAndRotation()}function iA(e){e.removeLeadSnapshot()}function hc(e,t,n){e.translate=Q(t.translate,0,n),e.scale=Q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mc(e,t,n,r){e.min=Q(t.min,n.min,r),e.max=Q(t.max,n.max,r)}function aA(e,t,n,r){mc(e.x,t.x,n.x,r),mc(e.y,t.y,n.y,r)}function lA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},gc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yc=gc("applewebkit/")&&!gc("chrome/")?Math.round:Xe;function vc(e){e.min=yc(e.min),e.max=yc(e.max)}function uA(e){vc(e.x),vc(e.y)}function qh(e,t,n){return e==="position"||e==="preserve-aspect"&&!PP(ic(t),ic(n),.2)}function dA(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fA=Kh({attachResizeListener:(e,t)=>sr(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Qs={current:void 0},Jh=Kh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qs.current){const e=new fA({});e.mount(window),e.setOptions({layoutScroll:!0}),Qs.current=e}return Qs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Hh=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function pA(e=!0){const t=m.useContext(Ni);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=m.useId();m.useEffect(()=>{if(e)return s(o)},[e]);const i=m.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const Yh=m.createContext({strict:!1}),bc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let xc=!1;function hA(){if(xc)return;const e={};for(const t in bc)e[t]={isEnabled:n=>bc[t].some(r=>!!n[r])};Rh(e),xc=!0}function Xh(){return hA(),mP()}function mA(e){const t=Xh();for(const n in e)t[n]={...t[n],...e[n]};Rh(t)}const Ss=m.createContext({});function gA(e,t){if(ws(e)){const{initial:n,animate:r}=e;return{initial:n===!1||nr(n)?n:void 0,animate:nr(r)?r:void 0}}return e.inherit!==!1?t:{}}function yA(e){const{initial:t,animate:n}=gA(e,m.useContext(Ss));return m.useMemo(()=>({initial:t,animate:n}),[wc(t),wc(n)])}function wc(e){return Array.isArray(e)?e.join(" "):e}const aa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qh(e,t,n){for(const r in t)!Ee(t[r])&&!Dh(r,n)&&(e[r]=t[r])}function vA({transformTemplate:e},t){return m.useMemo(()=>{const n=aa();return na(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bA(e,t){const n=e.style||{},r={};return Qh(r,n,e),Object.assign(r,vA(e,t)),r}function xA(e,t){const n={},r=bA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const em=()=>({...aa(),attrs:{}});function wA(e,t,n,r){const s=m.useMemo(()=>{const o=em();return Sh(o,t,$h(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Qh(o,e.style,e),s.style={...o,...s.style}}return s}const SA=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function os(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||SA.has(e)}function _A(e,t){return e.startsWith("on")?!os(e):(t==null?void 0:t(e))??!os(e)}function TA(e,t,n,r){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||Ee(e[o])||(_A(o,r)||n===!0&&os(o)||!t&&!os(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}const EA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function la(e){return typeof e!="string"||e.includes("-")?!1:!!(EA.indexOf(e)>-1||/[A-Z]/u.test(e))}function kA(e,t,n,{latestValues:r},s,o=!1,i,l){const a=(i??la(e)?wA:xA)(t,r,s,e),d=TA(t,typeof e=="string",o,l),c=e!==m.Fragment?{...d,...a,ref:n}:{},{children:f}=t,y=m.useMemo(()=>Ee(f)?f.get():f,[f]);return m.createElement(e,{...c,children:y})}function CA({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:PA(n,r,s,e),renderState:t()}}function PA(e,t,n,r){const s={},o=r(e,{});for(const f in o)s[f]=Rr(o[f]);let{initial:i,animate:l}=e;const u=ws(e),a=Mh(e);t&&a&&!u&&e.inherit!==!1&&(i===void 0&&(i=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const c=d?l:i;if(c&&typeof c!="boolean"&&!xs(c)){const f=Array.isArray(c)?c:[c];for(let y=0;y<f.length;y++){const v=hh(e,f[y]);if(v){const{transitionEnd:T,transition:S,...C}=v;for(const k in C){let x=C[k];if(Array.isArray(x)){const p=d?x.length-1:0;x=x[p]}x!==null&&(s[k]=x)}for(const k in T)s[k]=T[k]}}}return s}const tm=e=>(t,n)=>{const r=m.useContext(Ss),s=m.useContext(Ni),o=()=>CA(e,t,r,s);return n?o():TE(o)},AA=tm({scrapeMotionValuesFromProps:ia,createRenderState:aa}),IA=tm({scrapeMotionValuesFromProps:Lh,createRenderState:em}),MA=Symbol.for("motionComponentSymbol");function jA(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(o=>{var l;o&&((l=e.onMount)==null||l.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=r.current;if(typeof i=="function")if(o){const u=i(o);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o)},[t])}const nm=m.createContext({});function fn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function RA(e,t,n,r,s,o){var x,p;const{visualElement:i}=m.useContext(Ss),l=m.useContext(Yh),u=m.useContext(Ni),a=m.useContext(Hh),d=a.reducedMotion,c=a.skipAnimations,f=m.useRef(null),y=m.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:c,isSVG:o}),y.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const v=f.current,T=m.useContext(nm);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&NA(f.current,n,s,T);const S=m.useRef(!1);m.useInsertionEffect(()=>{v&&S.current&&v.update(n,u)});const C=n[yh],k=m.useRef(!!C&&typeof window<"u"&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,C))&&((p=window.MotionHasOptimisedAnimation)==null?void 0:p.call(window,C)));return ml(()=>{var b;!y.current||!v||((b=v.animationState)==null||b.animateChanges(),v.enteringChildren=void 0)},[]),ml(()=>{y.current=!0,v&&(S.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),k.current&&v.animationState&&v.animationState.animateChanges())}),m.useEffect(()=>{v&&(!k.current&&v.animationState&&v.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,C)}),k.current=!1),v.enteringChildren=void 0)}),v}function NA(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:l,layoutScroll:u,layoutRoot:a,layoutAnchor:d,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:rm(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||l&&fn(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:u,layoutRoot:a,layoutAnchor:d})}function rm(e){if(e)return e.options.allowProjection!==!1?e.projection:rm(e.parent)}function eo(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&mA(r);const o=n?n==="svg":la(e),i=o?IA:AA;function l(a,d){let c;const f={...m.useContext(Hh),...a,layoutId:OA(a)},{isStatic:y,isValidProp:v}=f,T=yA(a),S=i(a,y);if(!y&&typeof window<"u"){DA();const C=zA(f);c=C.MeasureLayout,T.visualElement=RA(e,S,f,s,C.ProjectionNode,o)}return h.jsxs(Ss.Provider,{value:T,children:[c&&T.visualElement?h.jsx(c,{visualElement:T.visualElement,...f}):null,kA(e,a,jA(S,T.visualElement,d),S,y,t,o,v)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=m.forwardRef(l);return u[MA]=e,u}function OA({layoutId:e}){const t=m.useContext(Ep).id;return t&&e!==void 0?t+"-"+e:e}function DA(e,t){m.useContext(Yh).strict}function zA(e){const t=Xh(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function $A(e,t){if(typeof Proxy>"u")return eo;const n=new Map,r=(o,i)=>eo(o,i,e,t),s=(o,i)=>r(o,i);return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,eo(i,void 0,e,t)),n.get(i))})}const LA=(e,t)=>t.isSVG??la(e)?new xP(t):new vP(t,{allowProjection:e!==m.Fragment});class FA extends jt{constructor(t){super(t),t.animationState||(t.animationState=SP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let VA=0;class ZA extends jt{constructor(){super(...arguments),this.id=VA++}update(){var u;const{presenceContext:t,prevPresenceContext:n,animationState:r}=this.node;if(!t||!r)return;const{isPresent:s,onExitComplete:o}=t,i=n==null?void 0:n.isPresent;if(s===i)return;if(s&&i===!1){if(this.exit===!0){const{initial:a}=this.node.getProps();if(a&&!Array.isArray(a)){const{transition:d,transitionEnd:c,...f}=qt(this.node,a)||{};for(const y in f)(u=this.node.getValue(y))==null||u.jump(f[y])}this.node.blockInitialAnimation=!1,r.reset(),r.animateChanges()}else r.setActive("exit",!1);this.exit=void 0;return}const l=this.exit=r.setActive("exit",!s);o&&!s&&l.then(()=>{this.exit===l&&(this.exit=!0,o(this.id))})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const BA={animation:{Feature:FA},exit:{Feature:ZA}};function _s(e){return{point:{x:e.pageX,y:e.pageY}}}const UA=e=>t=>sa(t)&&e(t,_s(t));function Gn(e,t,n,r){return sr(e,t,UA(n),r)}const sm=({current:e})=>e?e.ownerDocument.defaultView:null,Sc=(e,t)=>Math.abs(e-t);function WA(e,t){const n=Sc(e.x,t.x),r=Sc(e.y,t.y);return Math.sqrt(n**2+r**2)}const _c=new Set(["auto","scroll"]);class om{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Er(this.lastRawMoveEventInfo,this.transformPagePoint));const v=to(this.lastMoveEventInfo,this.history),T=this.startEvent!==null,S=WA(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!T&&!S)return;const{point:C}=v;this.history.push({...C,timestamp:Te.now()});const{onStart:k,onMove:x}=this.handlers;T||(k&&k(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,v)},this.handlePointerMove=(v,T)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=T,this.lastMoveEventInfo=Er(T,this.transformPagePoint),this.hasPendingMove=!0,ee.update(this.updatePoint,!0)},this.handlePointerUp=(v,T)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=to(v.type==="pointercancel"?this.lastMoveEventInfo:Er(T,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,x),C&&C(v,x)},!sa(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const u=_s(t),a=Er(u,this.transformPagePoint),{point:d}=a,{timestamp:c}=ve;this.history=[{...d,timestamp:c}];const{onSessionStart:f}=n;f&&f(t,to(a,this.history));const y={passive:!0,capture:!0};this.removeListeners=dr(Gn(this.contextWindow,"pointermove",this.handlePointerMove,y),Gn(this.contextWindow,"pointerup",this.handlePointerUp,y),Gn(this.contextWindow,"pointercancel",this.handlePointerUp,y)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(_c.has(r.overflowX)||_c.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ct(this.updatePoint)}}function Er(e,t){return t?{point:t(e.point)}:e}function Tc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function to({point:e},t){return{point:e,delta:Tc(e,im(t)),offset:Tc(e,GA(t)),velocity:KA(t,.1)}}function GA(e){return e[0]}function im(e){return e[e.length-1]}function KA(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=im(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ze(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ze(t)*2&&(r=e[1]);const o=Ve(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function qA(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Q(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Q(n,e,r.max):Math.min(e,n)),e}function Ec(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function JA(e,{top:t,left:n,bottom:r,right:s}){return{x:Ec(e.x,n,s),y:Ec(e.y,t,r)}}function kc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function HA(e,t){return{x:kc(e.x,t.x),y:kc(e.y,t.y)}}function YA(e,t){let n=.5;const r=je(e),s=je(t);return s>r?n=Xn(t.min,t.max-r,e.min):r>s&&(n=Xn(e.min,e.max-s,t.min)),yt(0,1,n)}function XA(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ri=.35;function QA(e=ri){return e===!1?e=0:e===!0&&(e=ri),{x:Cc(e,"left","right"),y:Cc(e,"top","bottom")}}function Cc(e,t,n){return{min:Pc(e,t),max:Pc(e,n)}}function Pc(e,t){return typeof e=="number"?e:e[t]||0}const e1=new WeakMap;class t1{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=c=>{n&&this.snapToCursor(c),this.stopAnimation()},i=(c,f)=>{const{drag:y,dragPropagation:v,onDragStart:T}=this.getProps();if(y&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=KC(y),!this.openDragLock))return;this.latestPointerEvent=c,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),st(C=>{let k=this.getAxisMotionValue(C).get()||0;if(lt.test(k)){const{projection:x}=this.visualElement;if(x&&x.layout){const p=x.layout.layoutBox[C];p&&(k=je(p)*(parseFloat(k)/100))}}this.originPoint[C]=k}),T&&ee.update(()=>T(c,f),!1,!0),Ho(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(c,f)=>{this.latestPointerEvent=c,this.latestPanInfo=f;const{dragPropagation:y,dragDirectionLock:v,onDirectionLock:T,onDrag:S}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:C}=f;if(v&&this.currentDirection===null){this.currentDirection=r1(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",f.point,C),this.updateAxis("y",f.point,C),this.visualElement.render(),S&&ee.update(()=>S(c,f),!1,!0)},u=(c,f)=>{this.latestPointerEvent=c,this.latestPanInfo=f,this.stop(c,f),this.latestPointerEvent=null,this.latestPanInfo=null},a=()=>{const{dragSnapToOrigin:c}=this.getProps();(c||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new om(t,{onSessionStart:o,onStart:i,onMove:l,onSessionEnd:u,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:sm(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:l}=this.getProps();l&&ee.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!kr(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=qA(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&fn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=JA(r.layoutBox,t):this.constraints=!1,this.elastic=QA(n),s!==this.constraints&&!fn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&st(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=XA(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fn(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=GC(r,s.root,this.visualElement.getTransformPagePoint());let i=HA(s.layout.layoutBox,o);if(n){const l=n(BC(i));this.hasMutatedConstraints=!!l,l&&(i=_h(l))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},a=st(d=>{if(!kr(d,n,this.currentDirection))return;let c=u&&u[d]||{};(i===!0||i===d)&&(c={min:0,max:0});const f=s?200:1e6,y=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...c};return this.startAxisValueAnimation(d,v)});return Promise.all(a).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ho(this.visualElement,t),r.start(Xi(t,r,0,n,this.visualElement,!1))}stopAnimation(){st(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:n}){var l;const{drag:r}=this.getProps(),s={x:t,y:n},o=((l=this.visualElement.getTransformPagePoint())==null?void 0:l(s))||s,i=this.visualElement.measureViewportBox();st(u=>{if(!kr(u,r,this.currentDirection))return;const a=this.getAxisMotionValue(u),{min:d,max:c}=i[u];a.set((a.get()||0)+o[u]-Q(d,c,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!fn(n)||!r||!this.constraints)return;this.stopAnimation();const s=this.constraints,o={x:0,y:0};st(l=>{const u=this.getAxisMotionValue(l).get();o[l]=YA({min:u,max:u},s[l])});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),st(l=>{const u=this.getAxisMotionValue(l);if(!kr(l,t,null)||!u.get())return;const{min:a,max:d}=this.constraints[l];u.set(Q(a,d,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;e1.set(this.visualElement,this);const t=this.visualElement.current,n=Gn(t,"pointerdown",a=>{const{drag:d,dragListener:c=!0}=this.getProps(),f=a.target,y=f!==t&&QC(f);d&&c&&!y&&this.start(a)});let r;const s=()=>{const{dragConstraints:a}=this.getProps();fn(a)&&a.current&&(this.constraints=this.resolveRefConstraints(),r||(r=n1(t,a.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,i=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ee.read(s);const l=sr(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",(({delta:a,hasLayoutChanged:d})=>{this.isDragging&&d&&(st(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=a[c].translate,f.set(f.get()+a[c].translate))}),this.visualElement.render())}));return()=>{l(),n(),i(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=ri,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:l}}}function Ac(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function n1(e,t,n){const r=Bl(e,Ac(n)),s=Bl(t,Ac(n));return()=>{r(),s()}}function kr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function r1(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class s1 extends jt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new t1(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const no=e=>(t,n)=>{e&&ee.update(()=>e(t,n),!1,!0)};class o1 extends jt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new om(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:no(t),onStart:no(n),onMove:no(r),onEnd:(o,i)=>{delete this.session,s&&ee.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=Gn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ro=!1;class i1 extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),ro&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Nr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ro=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||ee.postRender(()=>{const l=i.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ra.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ro=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function am(e){const[t,n]=pA(),r=m.useContext(Ep);return h.jsx(i1,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(nm),isPresent:t,safeToRemove:n})}const a1={pan:{Feature:o1},drag:{Feature:s1,ProjectionNode:Jh,MeasureLayout:am}};function Ic(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&ee.postRender(()=>o(t,_s(t)))}class l1 extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=JC(t,(n,r)=>(Ic(this.node,r,"Start"),s=>Ic(this.node,s,"End"))))}unmount(){}}class c1 extends jt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dr(sr(this.node.current,"focus",()=>this.onFocus()),sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&ee.postRender(()=>o(t,_s(t)))}class u1 extends jt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=tP(t,(s,o)=>(Mc(this.node,o,"Start"),(i,{success:l})=>Mc(this.node,i,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const si=new WeakMap,so=new WeakMap,d1=e=>{const t=si.get(e.target);t&&t(e)},f1=e=>{e.forEach(d1)};function p1({root:e,...t}){const n=e||document;so.has(n)||so.set(n,{});const r=so.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(f1,{root:e,...t})),r[s]}function h1(e,t,n){const r=p1(t);return si.set(e,n),r.observe(e),()=>{si.delete(e),r.unobserve(e)}}const m1={some:0,all:1};class g1 extends jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:m1[s]},l=a=>{const{isIntersecting:d}=a;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),y=d?c:f;y&&y(a)};this.stopObserver=h1(this.node.current,i,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(y1(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function y1({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const v1={inView:{Feature:g1},tap:{Feature:u1},focus:{Feature:c1},hover:{Feature:l1}},b1={layout:{ProjectionNode:Jh,MeasureLayout:am}},x1={...BA,...v1,...a1,...b1},w1=$A(x1,LA),S1=w1,jc=new Map,_1=e=>{let t=jc.get(e);return t||(t=S1.create(e),jc.set(e,t)),t},T1=({children:e,as:t="p",className:n,duration:r=2,spread:s=2})=>{const o=_1(t),i=m.useMemo(()=>((e==null?void 0:e.length)??0)*s,[e,s]);return h.jsx(o,{animate:{backgroundPosition:"0% center"},className:V("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",n),initial:{backgroundPosition:"100% center"},style:{"--spread":`${i}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{duration:r,ease:"linear",repeat:Number.POSITIVE_INFINITY},children:e})},lm=m.memo(T1),cm=m.createContext(null),E1=()=>{const e=m.useContext(cm);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},k1=1e3,C1=1e3,um=m.memo(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:s,duration:o,children:i,...l})=>{const u=r??t,a=r===!1,[d,c]=Hn({defaultProp:u,onChange:s,prop:n}),[f,y]=Hn({defaultProp:void 0,prop:o}),v=m.useRef(t),[T,S]=m.useState(!1),C=m.useRef(null);m.useEffect(()=>{t?(v.current=!0,C.current===null&&(C.current=Date.now())):C.current!==null&&(y(Math.ceil((Date.now()-C.current)/C1)),C.current=null)},[t,y]),m.useEffect(()=>{t&&!d&&!a&&c(!0)},[t,d,c,a]),m.useEffect(()=>{if(v.current&&!t&&d&&!T){const p=setTimeout(()=>{c(!1),S(!0)},k1);return()=>clearTimeout(p)}},[t,d,c,T]);const k=m.useCallback(p=>{c(p)},[c]),x=m.useMemo(()=>({duration:f,isOpen:d,isStreaming:t,setIsOpen:c}),[f,d,t,c]);return h.jsx(cm.Provider,{value:x,children:h.jsx(Sp,{className:V("not-prose mb-4",e),onOpenChange:k,open:d,...l,children:i})})}),P1=(e,t)=>e||t===0?h.jsx(lm,{duration:1,children:"Thinking..."}):t===void 0?h.jsx("p",{children:"Thought for a few seconds"}):h.jsxs("p",{children:["Thought for ",t," seconds"]}),dm=m.memo(({className:e,children:t,getThinkingMessage:n=P1,...r})=>{const{isStreaming:s,isOpen:o,duration:i}=E1();return h.jsx(_p,{className:V("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??h.jsxs(h.Fragment,{children:[h.jsx(Lw,{className:"size-4"}),n(s,i),h.jsx(Pd,{className:V("size-4 transition-transform",o?"rotate-180":"rotate-0")})]})})}),fm=m.memo(({className:e,children:t,...n})=>h.jsx(Tp,{className:V("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:h.jsx(Qf,{children:t})}));um.displayName="Reasoning";dm.displayName="ReasoningTrigger";fm.displayName="ReasoningContent";const A1=({suggestion:e,onClick:t,className:n,variant:r="outline",size:s="sm",children:o,...i})=>{const l=m.useCallback(()=>{t==null||t(e)},[t,e]);return h.jsx(Fe,{className:V("cursor-pointer rounded-full px-4",n),onClick:l,size:s,type:"button",variant:r,...i,children:o||e})},I1=m.lazy(()=>Zc(()=>import("./code-block-oleEXE1g.js"),__vite__mapDeps([5,1,2,3,4])).then(e=>({default:e.CodeBlock}))),oi=({code:e,language:t})=>h.jsx(m.Suspense,{fallback:h.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all p-4 font-mono text-xs",children:e}),children:h.jsx(I1,{code:e,language:t})}),M1=({className:e,...t})=>h.jsx(Sp,{className:V("group not-prose mb-4 w-full rounded-md border",e),...t}),j1={"approval-requested":"Awaiting Approval","approval-responded":"Responded","input-available":"Running","input-streaming":"Pending","output-available":"Completed","output-denied":"Denied","output-error":"Error"},R1={"approval-requested":h.jsx(Ja,{className:"size-3 text-muted-foreground"}),"approval-responded":h.jsx(Ka,{className:"size-3 text-muted-foreground"}),"input-available":h.jsx(Ja,{className:"size-3 animate-pulse"}),"input-streaming":h.jsx(Vw,{className:"size-3"}),"output-available":h.jsx(Ka,{className:"size-3 text-green-600"}),"output-denied":h.jsx(qa,{className:"size-3 text-orange-600"}),"output-error":h.jsx(qa,{className:"size-3 text-red-600"})},N1=e=>h.jsxs(Pm,{children:[R1[e],j1[e]]}),Rc=({className:e,title:t,type:n,state:r,toolName:s,...o})=>{const i=n==="dynamic-tool"?s:n.split("-").slice(1).join("-");return h.jsxs(_p,{className:V("flex w-full items-center justify-between gap-4 p-3",e),...o,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Jw,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"font-medium text-sm",children:t??i}),N1(r)]}),h.jsx(Pd,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})},O1=({className:e,...t})=>h.jsx(Tp,{className:V("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),D1=({className:e,input:t,...n})=>h.jsxs("div",{className:V("space-y-2 overflow-hidden",e),...n,children:[h.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),h.jsx("div",{className:"rounded-md bg-muted/50",children:h.jsx(oi,{code:JSON.stringify(t,null,2),language:"json"})})]}),z1=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let s=h.jsx("div",{children:t});return typeof t=="object"&&!m.isValidElement(t)?s=h.jsx(oi,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=h.jsx(oi,{code:t,language:"json"})),h.jsxs("div",{className:V("space-y-2",e),...r,children:[h.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:n?"Error":"Result"}),h.jsxs("div",{className:V("overflow-x-auto rounded-md text-xs [&_table]:w-full",n?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[n&&h.jsx("div",{children:n}),s]})]})},pm="antseed-console-chat";function vn(e,t){try{const n=localStorage.getItem(`${pm}:${e}`);return n?JSON.parse(n):t}catch{return t}}function bn(e,t){try{localStorage.setItem(`${pm}:${e}`,JSON.stringify(t))}catch{}}function Nc(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function is(e){return e===null?"?":`$${e<.01?e.toFixed(3):e.toFixed(2)}`}function hm(e){return e===null?"cost unknown":`≈ ${$m(e??0)}`}const $1="(max-width: 640px)";function L1(){const e=m.useRef(null);return m.useLayoutEffect(()=>{const t=e.current;if(!t)return;const n=document.documentElement,r=window.matchMedia($1),s=window.visualViewport,o=()=>{if(r.matches){t.style.height&&(t.style.height=""),s&&(n.style.setProperty("--gc-vvh",`${s.height}px`),n.style.setProperty("--gc-vvtop",`${s.offsetTop}px`));return}const l=t.getBoundingClientRect().top+window.scrollY,u=t.closest("main"),a=u&&parseFloat(getComputedStyle(u).paddingBottom)||0,d=`${Math.max(448,window.innerHeight-l-a)}px`;t.style.height!==d&&(t.style.height=d)};o();const i=new ResizeObserver(o);return i.observe(document.body),window.addEventListener("resize",o),r.addEventListener("change",o),s==null||s.addEventListener("resize",o),s==null||s.addEventListener("scroll",o),()=>{i.disconnect(),window.removeEventListener("resize",o),r.removeEventListener("change",o),s==null||s.removeEventListener("resize",o),s==null||s.removeEventListener("scroll",o),n.style.removeProperty("--gc-vvh"),n.style.removeProperty("--gc-vvtop")}},[]),e}function ii(e){return e.name?`${e.name} (${kn(e.peerId)})`:kn(e.peerId)}function Or(e){return e.name??kn(e.peerId)}function it({tone:e="neutral",children:t,title:n}){const r={free:"border-success/30 bg-success/10 text-success",tee:"border-info/30 bg-info/10 text-info",neutral:"border-border text-muted-foreground"};return h.jsx("span",{title:n,className:`inline-flex items-center rounded border px-1.5 py-px font-medium text-[10px] leading-4 ${r[e]}`,children:t})}function ai(e){let t=0;for(const n of e)t=(t*31+n.charCodeAt(0))%300;return`hsl(${30+t} 65% 55%)`}function mm({offer:e}){return en(e)?h.jsx(it,{tone:"free",children:"Free"}):h.jsx("span",{className:"text-muted-foreground text-xs",children:li(e)})}function F1(e){if(!e||e.role!=="assistant")return!0;const t=e.parts.filter(n=>n.type!=="step-start").at(-1);if(!t)return!0;if(t.type==="text"||t.type==="reasoning")return t.state!=="streaming";if(t.type==="dynamic-tool"||t.type.startsWith("tool-")){const{state:n}=t;return n==="output-available"||n==="output-error"||n==="output-denied"}return!1}function gm({children:e,card:t,side:n="top"}){const[r,s]=m.useState(n),o=i=>{if(n!=="top")return;const l=i.currentTarget.closest(".gc-chat-conversation")??document.documentElement,u=i.currentTarget.getBoundingClientRect().top-l.getBoundingClientRect().top;s(u<160?"bottom":"top")};return h.jsxs("span",{className:"group/hover relative inline-flex min-w-0 shrink",onMouseEnter:o,onFocus:o,children:[e,h.jsx("span",{role:"tooltip",className:V("pointer-events-none invisible absolute left-0 z-30 w-max max-w-80 rounded-lg border bg-popover p-3 text-left font-normal text-popover-foreground text-xs leading-5 opacity-0 shadow-md transition-opacity","group-focus-within/hover:visible group-focus-within/hover:opacity-100 group-hover/hover:visible group-hover/hover:opacity-100",r==="top"?"bottom-full mb-2":"top-full mt-2"),children:t})]})}function ym(e){return en(e)?"Free":`${is(e.inputUsdPerMillion)} in · ${is(e.outputUsdPerMillion)} out per 1M`}function vm(e,t){var a,d;if(!e)return"Auto picks the best seller that passes your routing settings.";const n=((a=e.sources.find(c=>c.level==="buyer"))==null?void 0:a.policy)??null,r=e.policy.sort??(n==null?void 0:n.sort)??"balanced",s=Math.max(e.policy.minTrustScore??0,(n==null?void 0:n.minTrustScore)??0);let i=`${{price:"Auto: cheapest seller",latency:"Auto: fastest seller",trust:"Auto: most trusted seller",balanced:"Auto: best mix of price, trust and speed"}[r]}${s>0?` with trust ${s}+`:""}.`;const l=Kr(e),u=e.candidates.filter(c=>!c.eligible&&c.inputUsdPerMillion!==null&&(l==null?void 0:l.inputUsdPerMillion)!=null&&c.inputUsdPerMillion<l.inputUsdPerMillion).sort((c,f)=>(c.inputUsdPerMillion??0)-(f.inputUsdPerMillion??0))[0];if(u){const c=((d=t==null?void 0:t.peers.find(f=>f.peerId===u.peerId.toLowerCase()))==null?void 0:d.name)??u.displayName??kn(u.peerId);i+=` Cheaper ${c} is skipped: ${u.reasons[0]??"not eligible"}.`}return i}function V1({message:e,streaming:t,model:n,preview:r,actions:s}){var v;const o=e.metadata;if(!o)return null;const i=o.peers;if(i.length===0)return t?null:h.jsx("div",{className:"text-muted-foreground text-xs",children:"No seller answered"});const l=i[i.length-1],u=n==null?void 0:n.peers.find(T=>T.peerId===l.peerId),a=((v=r==null?void 0:r.candidates.find(T=>T.peerId.toLowerCase()===l.peerId))==null?void 0:v.trustScore)??null,d=o.usage,c=[...new Set(i.map(Or))].join(" → "),f=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"block font-medium text-sm",children:[(n==null?void 0:n.name)??o.model," via ",c]}),u&&h.jsx("span",{className:"block font-mono",children:ym(u)}),d&&h.jsxs("span",{className:"block text-muted-foreground",children:[fa(d.inputTokens)," in / ",fa(d.outputTokens)," out tokens"]}),h.jsx("span",{className:"block text-muted-foreground",children:o.pinnedPeerId?"Pinned seller.":vm(r,n)}),h.jsx("span",{className:"block font-mono text-muted-foreground",children:l.peerId})]}),y="font-medium text-foreground underline underline-offset-2 hover:no-underline";return h.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-muted-foreground text-xs","aria-live":"polite",children:[t?h.jsx(wp,{className:"size-3.5"}):h.jsx(Fw,{className:"size-3.5"}),h.jsx(gm,{card:f,children:h.jsx("span",{tabIndex:0,className:"cursor-default text-foreground outline-none",children:c})}),a!==null&&h.jsxs("span",{children:["· trust ",Math.round(a)]}),h.jsx("span",{children:"·"}),o.costUsd===0?h.jsx(it,{tone:"free",children:"Free"}):h.jsx("span",{className:"text-foreground",title:"At the serving seller's advertised prices; the signed amount is in Logs.",children:hm(o.costUsd)}),o.pinnedPeerId&&h.jsx("span",{children:"· pinned"}),s&&!s.pinned&&h.jsx("button",{type:"button",className:V("ml-1",y),onClick:s.onPin,children:"Pin"}),(s==null?void 0:s.onTryAnother)&&h.jsx("button",{type:"button",className:V(s.pinned?"ml-1":"",y),onClick:s.onTryAnother,children:"Try another seller"})]})}function oo({label:e,on:t,onChange:n,title:r,icon:s}){return h.jsxs("button",{type:"button",role:"switch","aria-checked":t,title:r,onClick:()=>n(!t),className:V("inline-flex h-7 items-center gap-1 rounded-full border px-2.5 text-xs transition-colors",t?"border-foreground/20 bg-muted text-foreground":"border-transparent text-muted-foreground hover:bg-muted/60"),children:[t?h.jsx(Jn,{className:"size-3"}):s,e]})}function bm({filters:e,active:t,onToggle:n,sorts:r,sort:s,onSort:o,count:i}){return h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b px-3 py-2",children:[e.map(l=>h.jsxs(Fe,{type:"button",size:"xs",variant:t.has(l.id)?"secondary":"ghost","aria-pressed":t.has(l.id),className:t.has(l.id)?"border border-foreground/30":"border border-transparent text-muted-foreground",onClick:()=>n(l.id),children:[t.has(l.id)&&h.jsx(Jn,{}),l.label]},l.id)),h.jsx("span",{className:"ml-auto text-muted-foreground text-xs",children:i}),h.jsxs("label",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:["Sort",h.jsx("select",{className:"rounded-md border bg-transparent px-1.5 py-0.5 text-foreground text-xs",value:s,onChange:l=>o(l.target.value),children:r.map(l=>h.jsx("option",{value:l.id,children:l.label},l.id))})]})]})}function xm({free:e,tools:t,reasoning:n,vision:r,tee:s}){return h.jsxs("span",{className:"flex flex-wrap gap-1",children:[e&&h.jsx(it,{tone:"free",children:"Free"}),s&&h.jsx(it,{tone:"tee",children:"TEE"}),t&&h.jsx(it,{children:"Tools"}),n&&h.jsx(it,{children:"Reasoning"}),r&&h.jsx(it,{children:"Vision"})]})}function wm(e){const[t,n]=m.useState(()=>new Set(vn(e,[])));return[t,s=>n(o=>{const i=new Set(o);return i.has(s)?i.delete(s):i.add(s),bn(e,[...i]),i})]}function Sm(e,t){const[n,r]=m.useState(()=>vn(e,t));return[n,s=>{r(s),bn(e,s)}]}function li(e){return en(e)?"Free":`${is(e.inputUsdPerMillion)} / ${is(e.outputUsdPerMillion)} per M`}function Z1({models:e,value:t,onChange:n,className:r}){const[s,o]=m.useState(!1),[i,l]=wm("model-filters"),[u,a]=Sm("model-sort","popular"),d=tS(e,i,u);return h.jsxs(mp,{open:s,onOpenChange:o,children:[h.jsx(gp,{asChild:!0,children:h.jsxs(Fe,{variant:"ghost",size:"sm",className:V("min-w-0 max-w-80 shrink justify-between gap-1 px-2 font-semibold",r),title:t?`${t.offers} seller${t.offers===1?"":"s"}, ${t.free?"free offers":`from ${li(t)}`}`:void 0,children:[h.jsx("span",{className:"truncate",children:t?t.name:"Pick a model"}),(t==null?void 0:t.free)&&h.jsx(it,{tone:"free",children:"Free"}),h.jsx(Id,{className:"size-3.5 shrink-0 opacity-60"})]})}),h.jsxs(yp,{title:"Model",className:"sm:max-w-2xl",children:[h.jsx(vp,{placeholder:"Search models…"}),h.jsx(bm,{filters:Hw,active:i,onToggle:l,sorts:Yw,sort:u,onSort:a,count:`${d.length} of ${e.length} models`}),h.jsxs(bp,{className:"max-h-[min(28rem,60vh)]",children:[h.jsxs(xp,{children:["No model matches.",i.size>0?" Try fewer filters.":""]}),h.jsx(jo,{children:d.map(c=>h.jsxs(Ro,{value:`${c.name} ${c.id}`,onSelect:()=>{n(c.id),o(!1)},className:"items-start py-2",children:[h.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx(No,{children:c.name}),h.jsx(xm,{free:c.free,tools:c.toolUse,reasoning:c.reasoning,vision:c.vision,tee:c.tee})]}),h.jsxs("span",{className:"ml-auto shrink-0 text-right text-muted-foreground text-xs",children:[c.offers," seller",c.offers===1?"":"s",h.jsx("span",{className:"mt-0.5 block",children:c.free?h.jsx(it,{tone:"free",children:"Free offers"}):`from ${li(c)}`})]}),(t==null?void 0:t.id)===c.id&&h.jsx(Jn,{className:"size-3.5 shrink-0"})]},c.id))})]})]})]})}function Dr({children:e}){return h.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[h.jsx("span",{className:"size-2 shrink-0 translate-y-[-1px] rounded-full bg-amber-500","aria-hidden":"true"}),h.jsx("span",{children:e})]})}const Oc=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"");function B1(e,t,n,r){if(n)return"Checking which seller automatic routing picks…";if(!e)return"No seller passes your routing settings for this model right now.";const s=t==null?void 0:t.peers.find(i=>i.peerId===e.peerId.toLowerCase()),o=ii(s||{peerId:e.peerId,name:e.displayName});return h.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1.5 align-middle",children:["Right now:",h.jsx("span",{className:"size-2 rounded-full",style:{background:ai(e.peerId.toLowerCase())},"aria-hidden":"true"}),h.jsx("span",{className:"font-medium text-foreground",children:o}),h.jsx(mm,{offer:e}),e.trustScore!==null&&h.jsxs("span",{children:["trust ",Math.round(e.trustScore)]}),r&&!en(e)&&h.jsxs(Dr,{children:["No free seller offers ",(t==null?void 0:t.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",h.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"})]})]})}function U1({model:e,value:t,onChange:n,preview:r,previewLoading:s,unfunded:o,className:i,compact:l=!1}){const[u,a]=m.useState(!1),[d,c]=wm("peer-filters"),[f,y]=Sm("peer-sort","auto"),v=(e==null?void 0:e.peers.find(p=>p.peerId===t))??null,T=nS(r),S=Kr(r),C=S?(e==null?void 0:e.peers.find(p=>p.peerId===S.peerId.toLowerCase()))??null:null,k=(e==null?void 0:e.peers)??[],x=sS(k,d,f,T);return h.jsxs(mp,{open:u,onOpenChange:a,children:[h.jsx(gm,{side:"bottom",card:h.jsxs(h.Fragment,{children:[(v??C)&&h.jsxs("span",{className:"block font-medium text-sm",children:[e==null?void 0:e.name," via ",Or(v??C)]}),(v??C)&&h.jsx("span",{className:"block font-mono",children:ym(v??C)}),h.jsx("span",{className:"block text-muted-foreground",children:v?"Pinned: every turn goes to this seller.":vm(r,e)})]}),children:h.jsx(gp,{asChild:!0,children:h.jsxs(Fe,{variant:"ghost",size:"sm",className:V("min-w-0 max-w-96 shrink justify-between gap-1.5 px-2 text-muted-foreground",i),disabled:!e,children:[v?h.jsx("span",{className:"size-2 rounded-full",style:{background:ai(v.peerId)},"aria-hidden":"true"}):h.jsx(Ha,{className:"size-3.5"}),h.jsx("span",{className:"truncate",children:v?Or(v):h.jsxs(h.Fragment,{children:["Auto",C&&!l?h.jsxs("span",{className:"max-sm:hidden",children:[" · ",Or(C)]}):""]})}),h.jsx(Id,{className:"size-3.5 shrink-0 opacity-60"})]})})}),h.jsxs(yp,{title:"Seller",className:"sm:max-w-2xl",children:[h.jsx(vp,{placeholder:"Search sellers…"}),h.jsx(bm,{filters:Xw,active:d,onToggle:c,sorts:Qw,sort:f,onSort:y,count:`${x.length} of ${k.length} sellers`}),h.jsxs(bp,{className:"max-h-[min(30rem,60vh)]",children:[h.jsxs(xp,{children:["No seller matches.",d.size>0?" Try fewer filters.":""]}),h.jsx(jo,{heading:"Routing",children:h.jsxs(Ro,{value:"auto automatic best offer routing",onSelect:()=>{n(null),a(!1)},className:"items-start py-2",children:[h.jsx(Ha,{className:"mt-0.5 size-3.5"}),h.jsxs("span",{className:"flex min-w-0 flex-col",children:[h.jsx(No,{children:"Auto: the gateway picks the best offer each turn"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:B1(S,e,s,o)})]}),t===null&&h.jsx(Jn,{className:"ml-auto size-3.5"})]})}),h.jsx(jo,{heading:`Sellers offering ${(e==null?void 0:e.name)??"this model"}`,children:x.map(p=>{const b=T.get(p.peerId),w=b!==void 0&&!b.eligible;return h.jsxs(Ro,{value:`${p.name??""} ${p.peerId}`,onSelect:()=>{n(p.peerId),a(!1)},className:"items-start py-2",children:[h.jsx("span",{className:"mt-1.5 size-2 shrink-0 rounded-full",style:{background:ai(p.peerId)},"aria-hidden":"true"}),h.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[h.jsxs("span",{className:`flex items-center gap-2 ${w?"text-muted-foreground":""}`,children:[h.jsx(No,{children:ii(p)}),(b==null?void 0:b.eligible)&&b.rank!==null&&h.jsxs("span",{className:"text-muted-foreground text-xs",children:["#",b.rank]})]}),h.jsx(xm,{free:en(p),tools:p.toolUse,reasoning:p.reasoning,vision:p.vision,tee:p.tee}),w&&h.jsxs("span",{className:"text-muted-foreground text-xs",children:["Auto skips it: ",b.reasons[0]??"not eligible",". You can still pin it."]}),!p.toolUse&&h.jsx("span",{className:"text-muted-foreground text-xs",children:"No tools: plain chat when pinned."})]}),h.jsxs("span",{className:"ml-auto flex shrink-0 flex-col items-end gap-0.5 text-muted-foreground text-xs",children:[h.jsx(mm,{offer:p}),p.reputation!==null&&h.jsxs("span",{children:["trust ",Math.round(p.reputation)]})]}),t===p.peerId&&h.jsx(Jn,{className:"size-3.5 shrink-0"})]},p.peerId)})})]})]})]})}function W1({part:e,onAnswer:t}){const n=e.input,r=typeof(n==null?void 0:n.command)=="string"?n.command:JSON.stringify(e.input,null,2);return h.jsxs("div",{className:"space-y-2 border-t p-3",children:[h.jsx("p",{className:"font-medium text-sm",children:"Run this command on the gateway host?"}),h.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/50 p-2 font-mono text-xs",children:r}),h.jsx("p",{className:"text-muted-foreground text-xs",children:"It runs as the gateway's user, with access to its files. The model chose it, and a seller or a page it read can steer the model: approve only a command you understand."}),t?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Fe,{type:"button",size:"sm",variant:"secondary",onClick:()=>t(!0),children:"Approve"}),h.jsx(Fe,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!1),children:"Deny"})]}):h.jsx("p",{className:"text-muted-foreground text-xs",children:"Not run: the conversation moved on."})]})}function G1({part:e,onApproval:t}){const n=e.state==="approval-requested";return h.jsxs(M1,{defaultOpen:e.state==="output-error",children:[e.type==="dynamic-tool"?h.jsx(Rc,{type:e.type,state:e.state,toolName:e.toolName}):h.jsx(Rc,{type:e.type,state:e.state}),h.jsxs(O1,{children:[h.jsx(D1,{input:e.input}),h.jsx(z1,{output:e.output,errorText:e.errorText})]}),n&&h.jsx(W1,{part:e,onAnswer:t?r=>t(e.approval.id,r):null})]})}function Dc({threads:e,loading:t,activeId:n,onOpen:r,onRemove:s}){return e.length===0?h.jsx("p",{className:"px-2 py-3 text-muted-foreground text-xs",children:t?"Loading…":"Your conversations show up here."}):e.map(o=>h.jsxs("div",{className:`group flex items-center gap-1 rounded-md px-2 py-1.5 text-sm ${o.id===n?"bg-muted":"hover:bg-muted/60"}`,children:[h.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>r(o.id),title:o.title,children:[h.jsx("span",{className:"block truncate",children:o.title}),h.jsxs("span",{className:"block truncate text-muted-foreground text-xs",children:[zm(o.updatedAt),o.model?` · ${o.model}`:"",o.peerId?` · ${kn(o.peerId)}`:""]})]}),h.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:text-foreground focus-visible:opacity-100 md:opacity-0 md:group-hover:opacity-100","aria-label":`Delete "${o.title}"`,onClick:()=>s(o.id),children:h.jsx(qw,{className:"size-3.5"})})]},o.id))}function K1(){var Rt,rn,Nt;const{workspace:e,viewer:t,me:n}=Am(),r=`${e.id}:${n.member.id}`,s=Dn({queryKey:Ge.chatModels(e.id),queryFn:()=>on.chat.models(e.id),staleTime:6e4}),[o,i]=m.useState(()=>vn(`model:${r}`,null)),[l,u]=m.useState(()=>vn(`peer:${r}`,null)),a=Im(),d=Dn({queryKey:Ge.chatThreads(e.id),queryFn:()=>on.chat.threads(e.id)}),c=Dn({queryKey:Ge.chatContext(e.id),queryFn:()=>on.chat.context(e.id),staleTime:3e4}),f=L1();m.useEffect(()=>{Xf().catch(()=>{})},[]);const[y,v]=m.useState(()=>vn(`chat:${r}`,Nc())),[T,S]=m.useState(!1),[C,k]=m.useState(()=>({web:!0,files:!0,shell:!1,...vn("tools",{})})),x=(F,ue)=>k(Ce=>{const fe={...Ce,[F]:ue};return bn("tools",fe),fe}),p=((Rt=s.data)==null?void 0:Rt.find(F=>F.id===o))??(o?(rn=s.data)==null?void 0:rn.find(F=>Oc(F.id)===Oc(o)):void 0)??null,[b,w]=m.useState(null),_=Mm(t),E=jm(e.id,_),I=!!E.data&&Number(E.data.available)<=0,z=((Nt=c.data)==null?void 0:Nt.key.id)??null,K=Dn({queryKey:["chat-route-preview",e.id,z,o],queryFn:()=>on.network.routePreview({model:o,key:z}),enabled:!!(o&&z),staleTime:3e4});m.useEffect(()=>{var ue;if(!((ue=s.data)!=null&&ue.length)||p)return;const F=s.data.find(Ce=>Ce.toolUse)??s.data[0];o&&w(o),i(F.id)},[s.data,p]),m.useEffect(()=>{bn(`model:${r}`,o)},[r,o]),m.useEffect(()=>{bn(`peer:${r}`,l)},[r,l]),m.useEffect(()=>{bn(`chat:${r}`,y)},[r,y]);const L=m.useRef({workspaceId:e.id,model:o,peerId:l,tools:C});L.current={workspaceId:e.id,model:o,peerId:l,tools:C};const Y=m.useMemo(()=>new xi({api:`${Rm}/chat`,credentials:"same-origin",headers:{[Nm]:"1"},prepareSendMessagesRequest:({id:F,messages:ue})=>({body:{...L.current,id:F,messages:ue.slice(-1)}})}),[]),{messages:W,sendMessage:le,regenerate:oe,status:ce,stop:$e,error:ke,setMessages:M,clearError:he,addToolApprovalResponse:A}=Cw({id:y,transport:Y,sendAutomaticallyWhen:vw}),$=Dn({queryKey:Ge.chatThread(e.id,y),queryFn:()=>on.chat.thread(e.id,y),enabled:(d.data??[]).some(F=>F.id===y),staleTime:1/0});m.useEffect(()=>{$.data&&(M($.data.messages),$.data.model&&i($.data.model),u($.data.peerId))},[$.data]),m.useEffect(()=>{(ce==="streaming"||ce==="ready")&&W.length>0&&a.invalidateQueries({queryKey:Ge.chatThreads(e.id)}),ce==="ready"&&W.length>0&&(a.removeQueries({queryKey:Ge.chatThread(e.id,y),exact:!0}),a.invalidateQueries({queryKey:Ge.chatContext(e.id)}),a.invalidateQueries({queryKey:["chat-route-preview",e.id]}))},[ce]),m.useEffect(()=>{ke&&(a.invalidateQueries({queryKey:Ge.chatModels(e.id)}),a.invalidateQueries({queryKey:["chat-route-preview",e.id]}),_&&a.invalidateQueries({queryKey:Ge.wallet(e.id)}))},[ke]);const Z=ce==="submitted"||ce==="streaming",j=W.reduce((F,ue)=>{var fe;const Ce=(fe=ue.metadata)==null?void 0:fe.costUsd;return F===null||Ce===null?null:F+(Ce??0)},0),B=F=>{const ue=F.text.trim();!ue||!o||Z||(a.setQueryData(Ge.chatThreads(e.id),(Ce=[])=>Ce.some(fe=>fe.id===y)?Ce:[{id:y,title:ue.replace(/\s+/g," ").slice(0,80),model:o,peerId:l,createdAt:Date.now(),updatedAt:Date.now()},...Ce]),le({text:ue}))},H=F=>{S(!1),!(F===y||Z)&&(he(),M([]),v(F))},de=()=>{S(!1),$e(),he(),M([]),v(Nc())},q=F=>{var tt;const ue=[...((tt=K.data)==null?void 0:tt.candidates)??[]].filter(xe=>xe.eligible&&xe.rank!==null).sort((xe,sn)=>(xe.rank??0)-(sn.rank??0)).map(xe=>xe.peerId.toLowerCase()),Ce=(p==null?void 0:p.peers.map(xe=>xe.peerId))??[],fe=[...ue,...Ce].find(xe=>xe!==F&&Ce.includes(xe));!fe||Z||(u(fe),L.current={...L.current,peerId:fe},he(),oe())},et=Om({mutationFn:F=>on.chat.deleteThread(e.id,F),onSuccess:(F,ue)=>{ue===y&&de()},invalidate:[Ge.chatThreads(e.id)]}),nn=["What are today's top AI news? Search and cite sources.","Read https://antseed.com and explain how it works in 5 bullets.",da(t)?"Write a Python script that prints the first 20 primes, save it and run it.":"Write a short README for a CLI tool and save it as README.md."];return h.jsxs("div",{ref:f,className:"gc-chat gc-chat-page flex gap-4",children:[h.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col gap-2 md:flex","aria-label":"Conversations",children:[h.jsxs(Fe,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:de,disabled:W.length===0&&!Z,children:[h.jsx(Rs,{className:"size-3.5"})," New chat"]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx(Dc,{threads:d.data??[],loading:d.isLoading,activeId:y,onOpen:H,onRemove:F=>et.mutate(F)})})]}),h.jsxs(Dm,{isOpen:T,onClose:()=>S(!1),side:"left",title:"Chats",className:"gc-chat gc-chat-history",children:[h.jsxs(Fe,{variant:"outline",size:"sm",className:"mb-2 w-full justify-start gap-2",onClick:de,children:[h.jsx(Rs,{className:"size-3.5"})," New chat"]}),h.jsx(Dc,{threads:d.data??[],loading:d.isLoading,activeId:y,onOpen:H,onRemove:F=>et.mutate(F)})]}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3 max-sm:gap-2",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-0.5 border-b pb-2",children:[h.jsx(Fe,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:()=>S(!0),"aria-label":"Chats",children:h.jsx(Ww,{className:"size-4"})}),h.jsx("h1",{className:"sr-only",children:"Chat"}),h.jsx(Z1,{models:s.data??[],value:p,onChange:F=>{i(F),u(null),w(null)}}),h.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"·"}),h.jsx(U1,{model:p,value:l,onChange:u,preview:K.data,previewLoading:K.isLoading,unfunded:I}),h.jsx("span",{className:"ml-auto shrink-0 pl-2 font-mono text-muted-foreground text-xs",title:"Estimated at the serving sellers' prices; the signed amounts are in Logs.",children:W.length>0?j===0?"Free so far":h.jsxs(h.Fragment,{children:[hm(j),h.jsx("span",{className:"max-sm:hidden",children:" this chat"})]}):""}),h.jsx(Fe,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:de,disabled:W.length===0&&!Z,"aria-label":"New chat",children:h.jsx(Rs,{className:"size-4"})})]}),b&&p&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:["No seller offers ",b," right now (sellers stop offering a model while they are busy), so the chat switched to ",p.name,"."]})}),l&&p&&!p.peers.some(F=>F.peerId===l)&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:[kn(l)," no longer offers ",p.name," (sellers stop offering a model while they are busy)."," ",h.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:()=>u(null),children:"Use Auto"})," or pick another seller."]})}),!l&&I&&Kr(K.data)&&!en(Kr(K.data))&&h.jsx("p",{className:"text-muted-foreground text-xs",children:h.jsxs(Dr,{children:["No free seller offers ",(p==null?void 0:p.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",h.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"})]})}),h.jsxs(cT,{className:"gc-chat-conversation",children:[h.jsxs(uT,{className:"mx-auto w-full max-w-3xl gap-6 px-1 sm:px-4",children:[W.length===0?h.jsx(dT,{children:h.jsxs("div",{className:"flex w-full min-w-0 max-w-2xl flex-col items-center gap-2 text-center",children:[h.jsx("h3",{className:"font-medium text-base",children:"Ask anything"}),h.jsx("p",{className:"text-muted-foreground text-sm",children:"The agent can search and read the web and keep files in this chat's scratch space on the gateway."}),h.jsx("div",{className:"mt-3 flex flex-wrap justify-center gap-2",children:nn.map(F=>h.jsx(A1,{suggestion:F,onClick:ue=>B({text:ue}),className:"h-auto min-h-8 max-w-full whitespace-normal py-1.5 max-sm:w-full max-sm:rounded-xl max-sm:text-left"},F))})]})}):W.map((F,ue)=>{const Ce=Z&&ue===W.length-1;return h.jsxs(hT,{from:F.role,children:[h.jsx(mT,{children:F.parts.map((fe,tt)=>{const xe=`${F.id}-${tt}`;if(fe.type==="text")return h.jsx(ep,{children:fe.text},xe);if(fe.type==="reasoning")return h.jsxs(um,{isStreaming:Ce&&tt===F.parts.length-1,children:[h.jsx(dm,{}),h.jsx(fm,{children:fe.text})]},xe);if(fe.type==="dynamic-tool"||fe.type.startsWith("tool-")){const sn=!Z&&ue===W.length-1;return h.jsx(G1,{part:fe,onApproval:sn?(_m,Tm)=>{A({id:_m,approved:Tm})}:null},xe)}return null})}),F.role==="assistant"&&(()=>{var xe,sn;const fe=ue===W.length-1&&!Z,tt=((sn=(xe=F.metadata)==null?void 0:xe.peers.at(-1))==null?void 0:sn.peerId)??null;return h.jsx(V1,{message:F,streaming:Ce,model:p,preview:K.data,actions:fe&&tt?{pinned:l===tt,onPin:()=>u(tt),onTryAnother:((p==null?void 0:p.peers.length)??0)>1?()=>q(tt):null}:null})})()]},F.id)}),Z&&F1(W.at(-1))&&h.jsx("div",{className:"-mt-4 text-muted-foreground text-sm",role:"status",children:h.jsx(lm,{duration:1,children:"Thinking…"})}),ke&&h.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:/out of AntSeed credits|insufficient_deposits/i.test(ke.message)?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-medium",children:"No free seller took this, and paid ones need funds."})," ","No free seller offers ",(p==null?void 0:p.name)??"this model"," right now (free sellers stop offering a model while they are busy), and the ",e.name," wallet has no deposits for a paid one."," ",h.jsx("a",{className:"font-medium underline underline-offset-2",href:ao("wallet"),onClick:io("wallet"),children:"Add funds"}),", or pick a model marked ",h.jsx(it,{tone:"free",children:"Free"}),"."]}):/model_not_found|not served by this peer/i.test(ke.message)?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-medium",children:["The seller stopped offering ",(p==null?void 0:p.name)??"this model","."]})," ","Sellers drop a model while they are busy, and the list had not caught up yet. Send again",l?h.jsxs(h.Fragment,{children:[" after switching to ",h.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:()=>u(null),children:"Auto"})]}):""," to use another seller."]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-medium",children:"The request failed."})," ",ke.message]})})]}),h.jsx(fT,{})]}),h.jsxs(vE,{onSubmit:B,className:"mx-auto w-full max-w-3xl [&_[data-slot=input-group]]:rounded-3xl",children:[h.jsx(bE,{children:h.jsx(xE,{placeholder:p?`Message ${p.name}…`:"Loading models…",className:"max-sm:min-h-10"})}),h.jsxs(wE,{children:[h.jsx(SE,{className:"min-w-0 flex-wrap gap-1",children:p&&!p.toolUse?h.jsx("span",{className:"px-2 text-muted-foreground text-xs",children:"This model cannot use tools"}):h.jsxs(h.Fragment,{children:[h.jsx(oo,{label:"Web",on:C.web,onChange:F=>x("web",F),title:"Search and read web pages"}),h.jsx(oo,{label:"Files",on:C.files,onChange:F=>x("files",F),title:"Keep files in this chat's scratch space on the gateway"}),da(t)&&h.jsx(oo,{label:"Shell",on:C.shell,onChange:F=>x("shell",F),icon:h.jsx(Uw,{className:"size-3"}),title:"Run commands on the gateway host; you approve each one first (organization admins)"})]})}),h.jsx(_E,{status:ce,onStop:$e,disabled:!o})]})]})]})]})}const nI=Object.freeze(Object.defineProperty({__proto__:null,default:K1},Symbol.toStringTag,{value:"Module"}));export{nI as C,V as c,JS as t};
|