okengine 0.23.1 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/package.json +1 -1
  2. package/site/content/docs/ai/mcp.mdx +3 -3
  3. package/site/content/docs/elements/signal/broadcast.mdx +4 -2
  4. package/site/content/docs/reference/configuration.mdx +16 -0
  5. package/site/content/docs/reference/errors.mdx +31 -19
  6. package/src/compiler/aot.test.ts +3 -2
  7. package/src/compiler/aot.ts +45 -1
  8. package/src/compiler/dynamic.ts +1 -1
  9. package/src/compiler/http-parse.test.ts +101 -0
  10. package/src/compiler/http-parse.ts +188 -9
  11. package/src/compiler/interpret.ts +25 -2
  12. package/src/console/ui-next/dist/assets/{access-page-C_N4qvai.js → access-page-zBMhZnFm.js} +1 -1
  13. package/src/console/ui-next/dist/assets/{agent-disclosure-Cq1TxniW.js → agent-disclosure-CBj9f7Ju.js} +1 -1
  14. package/src/console/ui-next/dist/assets/{cache-glyph-BaI4uxZz.js → cache-glyph-D3MY49h3.js} +1 -1
  15. package/src/console/ui-next/dist/assets/{call-pii-button-DNyK7IIY.js → call-pii-button-L9JxdBhp.js} +1 -1
  16. package/src/console/ui-next/dist/assets/{collapsible-CRhBJMZR.js → collapsible-BvFaX-Zt.js} +1 -1
  17. package/src/console/ui-next/dist/assets/{decisions-page-D9twj8Xy.js → decisions-page-DgB76m-X.js} +1 -1
  18. package/src/console/ui-next/dist/assets/{duration-tone-CsHWlVPU.js → duration-tone-l1DSJ2Vz.js} +1 -1
  19. package/src/console/ui-next/dist/assets/{flows-page-ZaTJAhR9.js → flows-page-Bb9t1lu6.js} +1 -1
  20. package/src/console/ui-next/dist/assets/{highlighted-json-DQ-EMAfz.js → highlighted-json-DMvsi3Ti.js} +1 -1
  21. package/src/console/ui-next/dist/assets/{http-method-Cn_Fl79s.js → http-method-BwhJBTcQ.js} +1 -1
  22. package/src/console/ui-next/dist/assets/{index-CmRFeWdT.js → index-RhV2jT_7.js} +3 -3
  23. package/src/console/ui-next/dist/assets/{observability-page-Cn6R_dXz.js → observability-page-BRfUILBq.js} +1 -1
  24. package/src/console/ui-next/dist/assets/{replica-lag-Bx6EZhSe.js → replica-lag-BsceAzIG.js} +1 -1
  25. package/src/console/ui-next/dist/assets/{request-meta-DmdiUrfh.js → request-meta-C6lTyCXp.js} +1 -1
  26. package/src/console/ui-next/dist/assets/{store-page-8P6vGXnn.js → store-page-YmE806bJ.js} +1 -1
  27. package/src/console/ui-next/dist/assets/{trace-detail-sheet-BfGvpFSv.js → trace-detail-sheet-Di4irS49.js} +1 -1
  28. package/src/console/ui-next/dist/assets/{tree-expand-toggle-CWdUHbc0.js → tree-expand-toggle-DYeL6Rye.js} +1 -1
  29. package/src/console/ui-next/dist/assets/{units-page-CZOFZzay.js → units-page-07agasRA.js} +1 -1
  30. package/src/console/ui-next/dist/assets/{vault-page-ki_ishmX.js → vault-page-CHBck4n_.js} +1 -1
  31. package/src/console/ui-next/dist/index.html +1 -1
  32. package/src/console/ui-next/seed-parked-approval.ts +5 -1
  33. package/src/drivers/journal-postgres.test.ts +84 -1
  34. package/src/drivers/journal-postgres.ts +282 -32
  35. package/src/drivers/postgres.test.ts +60 -0
  36. package/src/drivers/postgres.ts +79 -5
  37. package/src/drivers/signal-compete.test.ts +6 -2
  38. package/src/drivers/signal-postgres.test.ts +170 -0
  39. package/src/drivers/signal-postgres.ts +449 -196
  40. package/src/drivers/signal-redis.test.ts +224 -0
  41. package/src/drivers/signal-redis.ts +835 -150
  42. package/src/elements/ai/approval.test.ts +15 -3
  43. package/src/elements/ai/approval.ts +15 -9
  44. package/src/elements/channel/runtime.ts +31 -4
  45. package/src/elements/channel/sql-ledger.test.ts +404 -0
  46. package/src/elements/channel/sql-ledger.ts +177 -33
  47. package/src/elements/clock/chaos-child.ts +12 -2
  48. package/src/elements/clock/durable.ts +11 -0
  49. package/src/elements/store/cache-bus.test.ts +121 -0
  50. package/src/elements/store/cache-bus.ts +278 -0
  51. package/src/elements/store/cache.test.ts +59 -0
  52. package/src/elements/store/cache.ts +157 -12
  53. package/src/elements/store/runtime.ts +44 -2
  54. package/src/elements/store/sql-errors.test.ts +131 -0
  55. package/src/elements/store/sql-errors.ts +39 -16
  56. package/src/elements/store/sql-nested-tx.test.ts +344 -0
  57. package/src/elements/store/sql-session.ts +183 -3
  58. package/src/kernel/app.ts +176 -28
  59. package/src/kernel/auto-registry.test.ts +5 -1
  60. package/src/kernel/boot-bind/signal.ts +13 -2
  61. package/src/kernel/boot-bind/store.ts +16 -1
  62. package/src/kernel/boot.test.ts +2 -2
  63. package/src/kernel/boot.ts +41 -11
  64. package/src/kernel/boundary-contract.ts +7 -0
  65. package/src/kernel/builtin-errors.ts +2 -0
  66. package/src/kernel/call.test.ts +1 -0
  67. package/src/kernel/fx-sql-handle.ts +7 -1
  68. package/src/kernel/horizontal-child.ts +54 -1
  69. package/src/kernel/horizontal.integration.test.ts +131 -7
  70. package/src/kernel/idempotency.test.ts +5 -6
  71. package/src/kernel/journal-boot.test.ts +83 -6
  72. package/src/kernel/journal.test.ts +44 -0
  73. package/src/kernel/journal.ts +171 -26
  74. package/src/mcp/authorization.ts +5 -11
  75. package/src/mcp/confirmation.ts +203 -38
  76. package/src/mcp/docs-server.ts +7 -2
  77. package/src/mcp/index.ts +4 -0
  78. package/src/mcp/mcp.test.ts +321 -33
  79. package/src/mcp/server.ts +8 -3
  80. package/src/mcp/session.ts +7 -0
  81. package/src/mcp/tools.ts +68 -19
  82. package/src/runtime/bun.ts +5 -0
  83. package/src/runtime/types.ts +5 -0
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flows-page-ZaTJAhR9.js","assets/rolldown-runtime-hePW80VL.js","assets/react-dom-Ddte4I-Q.js","assets/xyflow-yApv7D4e.js","assets/xyflow-CSyC6ryz.css","assets/shortcut-keys-DTE1sjTC.js","assets/explorer-chrome-Dslh2yE8.js","assets/element-icons-C6t8Vlml.js","assets/collapsible-CRhBJMZR.js","assets/trace-detail-sheet-BfGvpFSv.js","assets/http-method-Cn_Fl79s.js","assets/UserIcon-DaE2PB5_.js","assets/duration-tone-CsHWlVPU.js","assets/highlighted-json-DQ-EMAfz.js","assets/request-meta-DmdiUrfh.js","assets/UnavailableIcon-D9cvHVPr.js","assets/copy-inline-button-BTjPVjRT.js","assets/dagre.esm-B1_XeuLP.js","assets/cache-glyph-BaI4uxZz.js","assets/agent-disclosure-Cq1TxniW.js","assets/units-page-CZOFZzay.js","assets/call-pii-button-DNyK7IIY.js","assets/tree-expand-toggle-CWdUHbc0.js","assets/dropdown-menu-CRGrj5JU.js","assets/explorer-empty-CIVg7Jgb.js","assets/detail-header-Dk5LipF6.js","assets/decisions-page-D9twj8Xy.js","assets/store-page-8P6vGXnn.js","assets/replica-lag-Bx6EZhSe.js","assets/FileExportIcon-Ck-5od4R.js","assets/MoreHorizontalCircle01Icon-gMNGsE37.js","assets/confirm-sheet-DZfuJXP4.js","assets/vault-page-ki_ishmX.js","assets/use-vault-list-BAyQG8Re.js","assets/access-page-C_N4qvai.js","assets/observability-page-Cn6R_dXz.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flows-page-Bb9t1lu6.js","assets/rolldown-runtime-hePW80VL.js","assets/react-dom-Ddte4I-Q.js","assets/xyflow-yApv7D4e.js","assets/xyflow-CSyC6ryz.css","assets/shortcut-keys-DTE1sjTC.js","assets/explorer-chrome-Dslh2yE8.js","assets/element-icons-C6t8Vlml.js","assets/collapsible-BvFaX-Zt.js","assets/trace-detail-sheet-Di4irS49.js","assets/http-method-BwhJBTcQ.js","assets/UserIcon-DaE2PB5_.js","assets/duration-tone-l1DSJ2Vz.js","assets/highlighted-json-DMvsi3Ti.js","assets/request-meta-C6lTyCXp.js","assets/UnavailableIcon-D9cvHVPr.js","assets/copy-inline-button-BTjPVjRT.js","assets/dagre.esm-B1_XeuLP.js","assets/cache-glyph-D3MY49h3.js","assets/agent-disclosure-CBj9f7Ju.js","assets/units-page-07agasRA.js","assets/call-pii-button-L9JxdBhp.js","assets/tree-expand-toggle-DYeL6Rye.js","assets/dropdown-menu-CRGrj5JU.js","assets/explorer-empty-CIVg7Jgb.js","assets/detail-header-Dk5LipF6.js","assets/decisions-page-DgB76m-X.js","assets/store-page-YmE806bJ.js","assets/replica-lag-BsceAzIG.js","assets/FileExportIcon-Ck-5od4R.js","assets/MoreHorizontalCircle01Icon-gMNGsE37.js","assets/confirm-sheet-DZfuJXP4.js","assets/vault-page-CHBck4n_.js","assets/use-vault-list-BAyQG8Re.js","assets/access-page-zBMhZnFm.js","assets/observability-page-BRfUILBq.js"])))=>i.map(i=>d[i]);
2
2
  import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,r as n,t as r}from"./react-dom-Ddte4I-Q.js";import{A as i}from"./xyflow-yApv7D4e.js";import{$n as a,Cr as o,E as s,Et as c,F as l,I as u,L as d,Qn as f,R as p,Sr as m,T as h,Tt as g,_,_r as v,ar as y,b,br as x,cr as S,d as C,dr as w,er as ee,f as te,fr as ne,gr as T,h as re,hr as ie,i as ae,ir as oe,l as se,lr as ce,mr as le,n as ue,nr as de,o as fe,or as pe,pr as me,r as he,rr as ge,s as _e,sr as ve,t as ye,tr as be,u as xe,ur as Se,vr as Ce,x as we,xr as Te,y as Ee,yr as De}from"./shortcut-keys-DTE1sjTC.js";import{$ as Oe,$t as ke,Bt as Ae,C as je,D as Me,E as Ne,Ft as E,Gt as Pe,Ht as Fe,It as Ie,Jt as Le,Kt as Re,Lt as ze,Mt as Be,Nt as Ve,Pt as He,Qt as Ue,Rt as We,S as Ge,U as Ke,Ut as qe,Vt as Je,W as Ye,Wt as Xe,Xt as Ze,Yt as Qe,Zt as $e,_ as et,at as tt,c as nt,ct as rt,d as it,dt as at,en as ot,f as st,ft as ct,g as lt,h as ut,lt as dt,nt as ft,ot as pt,p as mt,qt as ht,st as gt,tn as _t,u as vt,ut as yt,w as bt,y as xt,zt as St}from"./explorer-chrome-Dslh2yE8.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ct=class extends y{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||wt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=pe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),S.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Tt=class extends Se{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ct({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Et(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Et(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Et(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Et(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>le(t,e))}findAll(e={}){return this.getAll().filter(t=>le(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(T))))}};function Et(e){return e.options.scope?.id}var Dt=class extends Se{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),De(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ne(t.mutationKey)!==ne(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??wt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){S.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ot=class extends Se{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??me(r,t),a=this.get(i);return a||(a=new oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ie(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ie(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ot,this.#t=e.mutationCache||new Tt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ce.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ve.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ce(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(T).catch(T)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(T)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(T)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ce(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ce(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(T).catch(T)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(T).catch(T)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ve.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ne(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{v(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ne(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{v(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=me(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Te&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},D=e(n(),1);function At(e,t){let n=o(t),[r]=D.useState(()=>new Dt(n,e));D.useEffect(()=>{r.setOptions(e)},[r,e]);let i=D.useSyncExternalStore(D.useCallback(e=>r.subscribe(S.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=D.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(T)},[r]);if(i.error&&x(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var jt=D.use,Mt=D.useLayoutEffect;function Nt(e){return e.replace(/\/{2,}/g,`/`)}function Pt(e){return e===`/`?e:e.replace(/^\/+/,``)}function Ft(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function It(e){return Ft(Pt(e))}function Lt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Rt(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Nt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Nt(e)),o=e.split(`/`);o.length>1&&Ue(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Ue(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Nt(s):s)||`/`;return a&&r&&r.set(a,c),c}function zt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Bt(e){return e==null||e===``}function Vt(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function Ht(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Bt(f)){if(c===`/`&&!d)continue;f=``}o+=c+Vt(s,f,r)+(d||``)}}return o+a||`/`}function Ut(e){return e?.isNotFound===!0}function Wt(){try{return sessionStorage}catch{return}}var Gt=`tsr-scroll-restoration-v1_3`,Kt=Wt();function qt(){try{return JSON.parse(Kt?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Jt(){try{Kt?.setItem(Gt,JSON.stringify(Yt))}catch{}}var Yt=qt(),Xt=`data-scroll-restoration-id`,Zt=e=>e.state.__TSR_key||e.href;function Qt(e){let t=e.getAttribute(Xt);if(t)return`[${Xt}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var $t=!1,en=`window`;function tn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function nn(e){let t=new Set;for(let n of e){if(n===en)continue;let e=tn(n);e&&t.add(e)}return t}function rn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Zt,a=new Set,o=e=>{let t=Yt[e]||={};for(let e of a)e===document?t[en]={scrollX,scrollY}:e.isConnected&&(t[Qt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,$t=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{$t||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Jt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Yt[d];if(e){let t=Yt[u];for(let n in e){if(n===en){if(s)continue}else{let e=tn(n);if(!e||s&&o&&(l??=nn(o),l.has(e)))continue}t||=Yt[u]={},t[n]??=e[n]}}}$t=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=nn(o));let t=e&&i&&c,s=r.restoring?Yt[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===en){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=tn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{$t=!1}}))}function an(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function on(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function sn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=on(r):Array.isArray(t)?t.push(on(r)):n[e]=[t,on(r)]}return n}var cn=/^(?:\s|["[{\d-]|fa|nu|tr)/,ln=dn(JSON.parse),un=fn(JSON.stringify,JSON.parse);function dn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=sn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!cn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function fn(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!cn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=an(e,r);return t?`?${t}`:``}}var pn=`__root__`;function mn(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function hn(e){return e instanceof Response&&!!e.options}function gn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var _n=4,vn=5;function yn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function bn(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.substring(s,a);return[o?3:c?1:2,c||`_splat`,r.substring(0,i),e.substring(t+a+1,c?n:e.length)]}}return r}function xn(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=Ue(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=bn(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Cn(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.substring(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=Cn(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.substring(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Cn(r,vn);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=Cn(r,_n);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function Sn(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cn(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function wn(e,t){let n=Cn(),r=[];function i(e,t,n,a){let[o,s,c]=xn(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Sn);t.masksTree=n,t.flatCache=gn(1e3)}function Tn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=kn(e,t.masksTree);return t.flatCache.set(e,r),r}function En(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Cn(),xn(t,{from:e},1,o),i.singleCache.set(a,o)),kn(r,o,n)}function Dn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=kn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=jn(a.route)),t.matchCache.set(r,a),a}function On(e,t=!1){let n=Cn(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&St(),i[e.id]=e,o!==0&&e.path){let t=Ft(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=xn(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Sn);return{processedTree:{segmentTree:n,singleCache:gn(1e3),matchCache:gn(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function kn(e,t,n=!1){let r=e.split(`/`),i=Nn(e,r,t,n);if(!i)return null;let[a]=An(e,r,i);return{route:i.node.route,rawParams:a}}function An(e,t,n){let r=Mn(n.node),i=n.node.data&&yn(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===_n)break;if(u.kind===vn){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function jn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Mn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Nn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ue(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Ln(l,n))continue;if(i.parse){if(!In(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==_n&&Ln(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===_n||i.kind===2)&&Ln(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(In(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Fn(f,o))return n;Ln(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Pn(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Pn(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Pn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Pn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Pn(e,t){return 2**(e-t-1)}function Fn(e,t){return e===2**(t-1)-1}function In(e,t,n){let r,i;try{[r,i]=An(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Ln(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===_n)>(e.node.kind===_n)||t.node.kind===_n==(e.node.kind===_n)&&t.node.depth>e.node.depth)))}function Rn(e,t,n){let r=It(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=Nt(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>zn(n,s.input({url:e})),output:({url:e})=>s.output({url:Bn(n,e)})}:s}function zn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Bn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Vn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{Je(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Hn=`__TSR_index`,Un=`popstate`,Wn=`beforeunload`,Gn=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Kn(e){let t=Gn.exec(e);return t?`/`+e.slice(t[0].length):e}function qn(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
3
3
  \r`.includes(e)?``:encodeURIComponent(e))),Kn(e)}function Jn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Zn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Hn];i=Yn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Hn];i=Yn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Hn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function Yn(e,t){let n=Qn();return{...t,key:n,__TSR_key:n,[Hn]:e}}function Xn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>qn(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Zn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Qn();t.history.replaceState({[Hn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Zn(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[Hn]-l.state[Hn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Jn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Wn,x,{capture:!0}),t.removeEventListener(Un,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(Wn,x,{capture:!0}),t.addEventListener(Un,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Zn(e,t){let n=qn(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=Qn();t={[Hn]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function Qn(){return(Math.random()+1).toString(36).substring(7)}function $n(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function er(e){return e.pathname+e.search+e.hash}function tr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function nr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function rr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function ir(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function ar(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var or=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Xn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&It(n)?Rn(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Vn(this.latestLocation,e),rn(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=On(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&wn(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:gn(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:qe(e),external:!1,searchStr:o,search:ke(t?.search,i),hash:qe(r.slice(1)),state:_t(t?.state,a)}}let o=zn(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:qe(Kn(o.pathname)),external:!!this.rewrite&&$n(o,this.origin),searchStr:c,search:ke(t?.search,s),hash:qe(o.hash.slice(1)),state:_t(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Dn(Ft(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Zn(n.href,{});n={...n,to:zn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=Rt(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[Ft(c)],u=c.includes(`$`),d;if(l)d=l._branch??=jn(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??xn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=dr(n.params,e),!Le(p))break;p===e&&(p=Object.assign(Fe(),p));try{Object.assign(p,t(p))}catch{}}}p??=dr(n.params,fr(n.params,f)?o()[3]:pr);let m=e.leaveParams?c:Kn(qe(f?Ht(c,f,p,this.pathParamsDecoder):c)),h=mr(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,ur(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?hr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||pr,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:pr,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=Bn(this.rewrite,e);C=er(e),$n(n,t)?(w=n.href,ee=!0):w=Kn(er(n))}else C=Pe(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Tn(r.pathname,this.processedTree);if(t){let i=Object.assign(Fe(),t.rawParams),{from:a,params:o,...s}=t.route,c=dr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return sr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=Ft(this.latestLocation.href)===Ft(n.href)&&Xe(rr(n.state),rr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?ht(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return sr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ai(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(nr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&tr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(ot.test(n)||(r=ht(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:$n(e,this.origin)||(n=er(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=br,this.preloadRoute=e=>oi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?Rt(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=En(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Xe(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Xe(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=zt(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??un,parseSearch:e.parseSearch??ln,protocolAllowlist:e.protocolAllowlist??Ae}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=xn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ft(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?gr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=ur(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof cr||(r=new cr(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=Fe(),_=i._interpolation?Ht(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{_r(i,d)}catch(e){if(x=Ut(e)||hn(e)?e:new lr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:ke(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=tr(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?ke(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?_t(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?ke(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=Ue(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=Ue(a),c={...e.search};for(let e of a)try{Object.assign(c,ur(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{_r(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function sr(e,t,{replace:n,ignoreBlocker:r}){if(!Ze(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var cr=class extends Error{},lr=class extends Error{};function ur(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new cr(`Async validation not supported`);if(n.issues)throw new cr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function dr(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function fr(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Qe.call(e,t[1]))}var pr=Object.freeze({});function mr(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=ur(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function hr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Re(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function gr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return pn}function _r(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function vr(e,t){return e.options[t]?.preload?.()}function yr(e,t){let n=vr(e,`component`),r=vr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function br(e,t,n){let r=()=>t===!1?void 0:t?vr(e,t):yr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function xr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Sr=0,Cr=1,wr=2,O=3,Tr=[4];function Er(e){return typeof e[0]==`number`}function Dr(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Or(e,t){return e.routesById[t.routeId]}function kr(e,t,n){return hn(e)?[O,e]:Ut(e)?(e.routeId||=n,[wr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Cr,e]):[Sr,e]}function Ar(e,t){let n=kr(t,!0,e.id);if(n[0]!==Cr)return n;try{e.options.onError?.(n[1])}catch(t){n=kr(t,!0,e.id)}return n}function jr(e,t,n,r,i){return i[0].signal.aborted?Tr:Kr(e,t,n,Ar(n,r),i)}async function Mr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Or(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Pr(e,r),[i,jr(e,t,u,a,n)]}if(c.aborted)return[i,Tr];let p=r.paramsError??r.searchError;if(p!==void 0)return Pr(e,r),[i,jr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Ir(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Dr(a,c):a);if(c.aborted)return[i,Tr];let s=Kr(e,t,u,kr(o,!1,u.id),n);if(s[0]!==Sr)return Pr(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Pr(e,r),[i,jr(e,t,u,a,n)]}finally{r.status=h,Ir(e,r,!1,n[0])}}i()}function Nr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Pr(e,t){let n=t._flight;t._flight=void 0,Nr(e,t,n)?.abort()}function k(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Nr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Fr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Ir(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Lr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Rr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Tr;if(!i)return[Sr,void 0];let l=n._flight;Ir(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Lr(e,t,n,r,s,a,!!o[3]))).then(e=>kr(e,!1,r.id),e=>kr(e,!0,r.id)).then(t=>(t[0]!==Sr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Cr&&l[2]?Ar(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Kr(e,t,r,await Dr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Pr(e,n),Tr}finally{Ir(e,n,!1,s)}}function zr(e,t,n){t[0]!==O&&(e.status=`success`,e.error=void 0,t[0]===Sr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Br(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Pr(e,r)}function Vr(e,t){return t[0]===Cr||t[0]===wr?{...e,status:t[0]===Cr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Hr(e,t,n,r,i,a,o){let s=t[1][n],c=Or(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Lr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Tr)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Pr(e,s),p=jr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Nr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Rr(e,t,s,c,g,i,a).then(t=>(zr(s,t,l),t[0]===Sr&&(m&&!a[0].signal.aborted&&Br(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Sr,s.loaderData]),ee=(async()=>{try{let e=br(c,void 0,C);e&&await Dr(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,jr(e,t,c,r,a)]}let r=await w;x&&r[0]===Sr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>Vr(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ne=Rr(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,zr(te,e,!1),e));return(t[2]??=[]).push([n,ne,ee,te]),ne.then(e=>Vr(te,e))}async function Ur(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Or(e,t[n]);try{let e=br(i,!1);e&&await Dr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Wr(e,t){t[2]&&=(k(e,t[2].map(e=>e[3])),void 0)}async function Gr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=O)throw[a,t];!i&&t[0]!==Sr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===O)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Kr(e,t,n,r,i,a){for(;r[0]===O;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[O,t]:[O,t,a]}return[O,o,n]}catch(e){r=a?[Cr,e]:Ar(n,e),a=!0}}return r}async function qr(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===wr?Ur(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=O)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Sr&&t[0]<O&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=O){let n=s[1];if(n[0]!==O||n[1].options.reloadDocument||n[2])return Wr(e,t),n;c=!0,s=[0,[Cr,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Cr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Or(e,u);try{await Dr(i?Promise.resolve().then(()=>br(m,l===Cr?`errorComponent`:`notFoundComponent`)):Promise.all([br(m),br(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Wr(e,t),Tr}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Wr(e,t),k(e,o),p()):u.status=`success`}return t}async function Jr(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Or(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Dr(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Yr(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Ur(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Hr(e,i,t,u,f,r,l)},m=await Mr(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===wr){let t=await Ur(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=O&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=qr(e,i,u,r[0],Gr(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Gr(i[2],void 0,void 0,h.then(e=>Er(e)?0:xr(n).length,()=>0))),o=await h}catch(t){if(Wr(e,i),t===a&&a.aborted)return Tr;throw t}return Er(o)?o:Jr(e,o,a,r[6]===n.length?r[6]:0)}function Xr(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Or(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Xr(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Zr(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Qr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!xr(t[3]).some(e=>e.id===n[1]))return;let i;try{await Dr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function $r(e,t){e._committed=t,e.stores.setMatches(t)}function ei(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=xr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Or(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=ir(n);$r(e,n),k(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),ar(e,i,n,a,l,t)}async function ti(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function ni(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function ri(e,t,n,r,i){let a=n.map(e=>({...e}));Fr(a);for(let t of r)Pr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await qr(e,o,r,t[0],i)}catch(t){throw k(e,a),t}if(Er(s)){k(e,a),s[0]===O&&e._tx===t&&e._committed===n&&await ni(e,t,s);return}if(await Jr(e,s,t[0].signal),e._tx!==t||e._committed!==n){k(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Pr(e,n))}$r(e,a),k(e,n,a)}async function ii(e,t,n,r,i,a){let o=await Yr(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Er(o)){let n=o[0]===O&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Zr(e,t),k(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Zr(e,t);return}await ni(e,t,o);return}let s=o[1];if(e._tx===t&&await Qr(e,t),e._tx!==t){Zr(e,t),k(e,s),Wr(e,o);return}let c=t[2],l=nr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Qr(e,t),e._tx!==t){Zr(e,t),k(e,s),Wr(e,o);return}let n=await e.startTransition(()=>{Zr(e,t),ei(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){Wr(e,o);return}u?.length&&ri(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function ai(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=nr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await ti(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Fr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){k(e,m),await ti(e,n);return}e._preflight=void 0;let g,_=()=>ii(e,y,f,()=>Xr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>ti(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Ir(e,t,!1)}n[0].abort(),k(e,n[3],y[3],!0)}if(e._tx!==y){k(e,y[3]),y[3]=[],g?.(),await ti(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Xr(e,y),g?.(_()),await y[5]}async function oi(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Fr(a),o=(e._preloads??=new Map).set(i,a),s=await Yr(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),k(e,a)),i.abort()}if(!Er(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Ut(e)||console.error(e);return}}}var si=`Error preloading route! ☝️`,ci=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=pn:this.parentRoute||St();let r=n?pn:t?.path;r&&r!==`/`&&(r=Pt(r));let i=t?.id||r,a=n?pn:Nt((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:Nt(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=Ft(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>mn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},li=class extends ci{constructor(e){super(e)}},A=i(),ui=class extends D.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?D.createElement(this.props.errorComponent??di,{error:e[0],reset:this.reset}):this.props.children}};function di({error:e}){let[t,n]=D.useState(!1);return(0,A.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,A.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,A.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,A.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,A.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,A.jsx)(`div`,{children:(0,A.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,A.jsx)(`code`,{children:e.message}):null})}):null]})}var fi=()=>!0,pi=()=>!1;function mi({children:e,fallback:t=null}){return(0,A.jsx)(D.Fragment,{children:hi()?e:t})}function hi(e=!0){return D.useSyncExternalStore(gi,fi,e?pi:fi)}function gi(){return()=>{}}function _i({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function vi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var yi=[],bi=0,{link:xi,unlink:Si,propagate:Ci,checkDirty:wi,shallowPropagate:Ti}=_i({update(e){return e._update()},notify(e){yi[Di++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ai(e))}}),Ei=0,Di=0,Oi,ki=0;function j(e){try{++ki,e()}finally{--ki||ji()}}function Ai(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Si(n,e)}function ji(){if(!(ki>0)){for(;Ei<Di;){let e=yi[Ei];yi[Ei++]=void 0,e.notify()}Ei=0,Di=0}}function Mi(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Oi!==void 0&&xi(i,Oi,bi),i._snapshot},subscribe(e){let t=vi(e),n={current:!1},r=Ni(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Oi,o=t?.compare??Object.is;if(n)Oi=i,++bi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Oi=a,n&&(i.flags&=-5),Ai(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&wi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ti(e)}}else e&32&&(i.flags=e&-33);return Oi!==void 0&&xi(i,Oi,bi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ci(e),Ti(e),ji())}},i}function Ni(e){let t=()=>{let t=Oi;Oi=n,++bi,n.depsTail=void 0,n.flags=6;try{return e()}finally{Oi=t,n.flags&=-5,Ai(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&wi(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Ai(this)}};return t(),n}var Pi=class{constructor(e,t){this.atom=Mi(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(vi(e))}},Fi=class{constructor(e){this.atom=Mi(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(vi(e))}};function Ii(e,t){return typeof e==`function`?new Fi(e):t?new Pi(e,t):new Pi(e)}function Li(e){return Ve({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ri(e){let{select:t,...n}=e;return Ve({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function zi(e){return Ve({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Bi(e){return Ve({...e,select:t=>e.select?e.select(t.context):t.context})}function Vi(...e){let t=D.useRef(e),n=t.current;return e.forEach((e,t)=>{Xe(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Hi(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(si)})}var Ui={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function Wi(e,t){let n=typeof e==`string`&&ht(e);if(n)return t.has(n)?e:null}function Gi(e,t,n,r,i){let a=Lt(e.pathname,r),o=Lt(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!Xe(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function Ki(e,t,n){let r=ze(),i=D.useRef(null),a=D.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,ignoreBlocker:h,disabled:g,target:_,onClick:v,onBlur:y,onFocus:b,onMouseEnter:x,onMouseLeave:S,onTouchStart:C}=e,w=hi(!!o?.includeHash),[ee,te,ne]=Vi(e.search,e.params,o),[T,re]=D.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,ee,te,e.state,e.mask,e.unsafeRelative]),ie=D.useCallback(e=>{let t=Wi(s,r.protocolAllowlist);if(t!==void 0)return[t??void 0];T._fromLocation||(re._fromLocation=e);let n=r.buildLocation(re),i=ta(n,r,g);return[i,!g&&(!i||ht(i))?void 0:Gi(e,n,ne,r.basepath,w)]},[ne,g,w,T,re,r,s]),[ae,oe]=E(r.stores.location,ie,Ui),se=oe===void 0?ae:void 0,ce=g||ae===void 0,le=D.useRef(!1),ue=e.reloadDocument||se||ce?!1:c??r.options.defaultPreload,de=l??r.options.defaultPreloadDelay??0,fe=D.useCallback(e=>{let t=e?.isIntersecting;if(!(t??ue===`intent`)){t===!1&&$i(i);return}if(!de){Hi(r,T);return}Qi.has(i)||Qi.set(i,setTimeout(()=>{Qi.delete(i),Hi(r,T)},de))},[r,T,i,ue,de]);D.useEffect(()=>{ue===`render`&&!le.current&&(le.current=!0,Hi(r,T));let e;return ue===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(e=new IntersectionObserver(e=>fe(e.pop()),{rootMargin:`100px`}),e.observe(i.current)),()=>{e?.disconnect(),$i(i)}},[r,T,ue,fe,i]);let pe=Xi(e,n);if(pe.ref=t?a:i,se)return pe.href=se,pe;let me=e=>{let t=_??e.currentTarget.getAttribute(`target`);!ce&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...T,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:h}))},he=()=>{ue===`intent`&&Hi(r,T)},ge=()=>{ue===`intent`&&$i(i)};return pe.onClick=ea(v,me),pe.onBlur=ea(y,ge),pe.onFocus=ea(b,fe),pe.onMouseEnter=ea(x,fe),pe.onMouseLeave=ea(S,ge),pe.onTouchStart=ea(C,he),Zi(pe,e,oe,ae,ce,n)}var qi={},Ji={className:`active`},Yi=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Xi(e,t){let n={};for(let r in e)Yi.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Zi(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=Re(n?o:s,{})??(n?Ji:qi);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var Qi=new WeakMap,$i=e=>{clearTimeout(Qi.get(e)),Qi.delete(e)},ea=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function ta(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!Ze(i,t.protocolAllowlist))return i}var na=D.memo(D.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Ki(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return D.createElement(n,r,i)}),ra);function ra(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Yi.has(r)||!Xe(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var ia=class extends ci{constructor(e){super(e),this.useMatch=e=>Ve({...e,from:this.id}),this.useRouteContext=e=>Bi({...e,from:this.id}),this.useSearch=e=>Be({...e,from:this.id}),this.useParams=e=>zi({...e,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=D.forwardRef((e,t)=>(0,A.jsx)(na,{ref:t,from:this.fullPath,...e}))}};function aa(e){return new ia(e)}var oa=class extends li{constructor(e){super(e),this.useMatch=e=>Ve({...e,from:this.id}),this.useRouteContext=e=>Bi({...e,from:this.id}),this.useSearch=e=>Be({...e,from:this.id}),this.useParams=e=>zi({...e,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=D.forwardRef((e,t)=>(0,A.jsx)(na,{ref:t,from:this.fullPath,...e}))}};function sa(e){return new oa(e)}function ca(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if($e(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(jt)jt(a());else throw a()}return D.createElement(r,e)};return o.preload=a,o}function la(e){let t=ze(),n=`not-found-${E(t.stores.location,e=>e.pathname)}-${E(t.stores.status)}`;return(0,A.jsx)(ui,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ut(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ut(t))return e.fallback?.(t);throw t},children:e.children})}function ua(){return(0,A.jsx)(`p`,{children:`Not Found`})}function da(e){return(0,A.jsx)(A.Fragment,{children:e.children})}function fa(e,t,n){return t.options.notFoundComponent?(0,A.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,A.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,A.jsx)(ua,{})}function pa(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}var ma=(e,t)=>e[0]===t[0]&&e[1]===t[1],ha=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ga=D.memo(function({routeId:e}){let t=ze();return(0,A.jsx)(_a,{router:t,match:E(t.stores.getMatchStore(e))})});function _a({router:e,match:t}){let n=e.routesById[t.routeId],r=pa(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ha(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?D.Suspense:da,l=i?ui:da,u=o?la:da;return(0,A.jsxs)(n.isRoot?n.options.shellComponent??da:da,{children:[(0,A.jsx)(Ie.Provider,{value:t.routeId,children:(0,A.jsx)(c,{fallback:r,children:(0,A.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Ut(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,A.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return D.createElement(o,e)},children:s?(0,A.jsx)(mi,{fallback:r,children:(0,A.jsx)(va,{match:t})}):(0,A.jsx)(va,{match:t})})})})}),null]})}var va=D.memo(function({match:e}){let t=ze(),n=e.routeId,r=t.routesById[n],i=D.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=D.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,A.jsx)(e,{},i):(0,A.jsx)(ya,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ha(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return pa(t,r)}if(e.status===`notFound`)return fa(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ya=D.memo(function(){let e=ze(),t=D.useContext(Ie),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=E(a,e=>[!!e._notFound,e.error],{compare:ma}),i=E(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return fa(e,e.routesById[t],r);if(!i)return null;let a=(0,A.jsx)(ga,{routeId:i});return t===`__root__`?(0,A.jsx)(D.Suspense,{fallback:pa(e),children:a}):a});function ba(e,t){let n=e[1];e.length=0,n?.(t)}function xa({t:e}){let t=ze(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ba(n,!1),n.push(i,a),e(t),D.startTransition(r)}),Mt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ft(r.publicHref)!==Ft(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...nr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Sa(){let e=ze(),t=e.routesById[pn],n=pa(e,t),r=e.ssr?da:D.Suspense,i=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(xa,{t:D.useState()[1]}),(0,A.jsx)(r,{fallback:n,children:(0,A.jsx)(Ca,{})})]});return e.options.InnerWrap?(0,A.jsx)(e.options.InnerWrap,{children:i}):i}function Ca(){let e=ze(),t=e._rendered,n=E(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Mt(()=>{t[0]===n&&ba(t,!0)},[t,n]);let a=i?(0,A.jsx)(ga,{routeId:i}):null;return(0,A.jsx)(Ie.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,A.jsx)(ui,{getResetKey:()=>r,onCatch:void 0,children:a})})}var wa=e=>({createMutableStore:Mi,createReadonlyStore:Mi,batch:j}),Ta=e=>new Ea(e),Ea=class extends or{constructor(e){super(e,wa)}};function Da({router:e,children:t,...n}){Le(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,A.jsx)(We.Provider,{value:e,children:t});return e.options.Wrap?(0,A.jsx)(e.options.Wrap,{children:r}):r}function Oa({router:e,...t}){return(0,A.jsx)(Da,{router:e,...t,children:(0,A.jsx)(Sa,{})})}function ka(e){let t=ze({warn:e?.router===void 0}),n=e?.router||t;return E(n.stores.__store,He(e,n))}var Aa=null;function M(e,...t){Aa?.(e,t)}var ja={303:`Multiple adapter contexts detected. This might happen in monorepos.`,404:`nuqs requires an adapter to work with your framework.`,409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:`Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.`,429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:`Empty search params cache. Search params can't be accessed in Layouts.`,501:"Search params cache already populated. Have you called `parse` twice?",502:"`processUrlSearchParams` threw while processing key(s) `%s`. %O"};function Ma(e){return`[nuqs] ${ja[e]}
4
- See https://nuqs.dev/NUQS-${e}`}function Na(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${Pa(r)}`)}return`?`+t.join(`&`)}function Pa(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var Fa=`2.10.1`,Ia={};function La(e,t){let n=Symbol.for(`nuqs.${Fa}.${e}`),r=globalThis;if(r[n]!=null)return r[n];let i=Object.isExtensible(r)?r:Ia;return i[n]??=t()}function Ra(e,t,n){let r=La(e,()=>new WeakMap);return r.has(t)||r.set(t,n()),r.get(t)}var za=Ra(`adapter-context`,D.createContext,()=>{let e=(0,D.createContext)({useAdapter(){throw Error(Ma(404))}});return e.displayName=`NuqsAdapterContext`,e});typeof window<`u`&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==za&&console.error(Ma(303)),window.__NuqsAdapterContext=za);function Ba(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...i})=>(0,D.createElement)(za.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function Va(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function Ha(e){return{method:`throttle`,timeMs:e}}var Ua=Ha(Va());function Wa(e,t,n){if(typeof n==`string`)e.set(t,n);else{e.delete(t);for(let r of n)e.append(t,r);e.has(t)||e.set(t,``)}return e}function Ga(){let e=new Map;return{on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){e.get(t)?.forEach(e=>e(n))}}}function Ka(e,t,n){function r(){e(),n.removeEventListener(`abort`,a)}let i=setTimeout(r,t);function a(){clearTimeout(i),n.removeEventListener(`abort`,a)}n.addEventListener(`abort`,a)}function qa(){let e=Promise;if(Promise.hasOwnProperty(`withResolvers`))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function Ja(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}function Ya(){return new URLSearchParams(location.search)}var Xa=class{updateMap=new Map;options={history:`replace`,scroll:!1,shallow:!0};timeMs=Ua.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=Ua.timeMs){this.resetQueueOnNextPush&&=(this.reset(),!1),M(7,e,t,n),this.updateMap.set(e,t),n.history===`push`&&(this.options.history=`push`),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Ya}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Ya,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return M(8),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=qa();let i=()=>{this.lastFlushedAt=performance.now();let[t,i]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);i===null?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null};return Ka(()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,r=t*Math.max(0,n-e);M(9,r,n,t),r===0?i():Ka(i,r,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return M(10,JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:`replace`,scroll:!1,shallow:!0},this.timeMs=Ua.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:r}=e,i=r();if(M(11,this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];let a=Array.from(this.updateMap.entries()),o={...this.options},s=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),M(12,a,o);for(let[e,t]of a)t===null?i.delete(e):i=Wa(i,e,t);if(t)try{i=t(i)}catch(e){return console.error(Ma(502),a.map(([e])=>e).join(),e),this.resetQueueOnNextPush=!0,[i,e]}try{return Ja(s,()=>n(i,o)),[i,null]}catch(e){return console.error(Ma(429),a.map(([e])=>e).join(),e),[i,e]}}},Za=La(`throttle-queue`,()=>new Xa),Qa=class{resolvers=qa();controller=new AbortController;queuedValue=void 0;abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t,n){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Ka(()=>{let t=this.resolvers;try{M(13,e);let r=n(e);M(14,this.queuedValue),this.queuedValue=void 0,this.resolvers=qa(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}},$a=class{throttleQueue;queues=new Map;queuedQuerySync=Ga();constructor(e=new Xa){this.throttleQueue=e}push(e,t,n,r){if(!Number.isFinite(t)){let e=n.getSearchParamsSnapshot??Ya;return Promise.resolve(e())}let i=e.key,a=this.queues.get(i);a||(M(15,i),a=new Qa,this.queues.set(i,a)),M(17,e);let o=a.push(e,t,()=>(this.throttleQueue.push(e),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(i)?.queuedValue===void 0&&(M(16,i),this.queues.delete(i)),this.queuedQuerySync.emit(i)})));return this.queuedQuerySync.emit(i),o}abort(e){let t=this.queues.get(e);return t?(M(18,e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())M(18,e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return t===void 0?this.throttleQueue.getQueuedQuery(e):t}},eo=La(`debounce-controller`,()=>new $a(Za));La(`queue-reset`,()=>({mutex:0}));function to(){M(19),eo.abortAll(),Za.abort().forEach(e=>eo.queuedQuerySync.emit(e))}function no(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of Array.from(e.keys()))t.includes(n)||r.delete(n);return r}function ro(e){return La(`history-emitter.${e}`,()=>Ga())}var io=`__nuqs__`,ao=ro(`react`);function oo(e){return function(t,n){let r=new URL(location.href);r.search=Na(t),M(20,`react`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,io,r),ao.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var so=(0,D.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function co(e){return ao.on(`update`,e),window.addEventListener(`popstate`,e),()=>{ao.off(`update`,e),window.removeEventListener(`popstate`,e)}}function lo(){return(0,D.useEffect)(()=>(window.addEventListener(`popstate`,to),()=>window.removeEventListener(`popstate`,to)),[]),null}function uo(e){let{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}=(0,D.useContext)(so),r=(0,D.useRef)(null);function i(t){let n=no(new URLSearchParams(t),e,!1),i=n.toString();return r.current?.key===i?r.current.search:(r.current={key:i,search:n},n)}return{searchParams:(0,D.useSyncExternalStore)(co,()=>i(location.search),()=>i(n??``)),updateUrl:(0,D.useMemo)(()=>oo(t),[t])}}var fo=Ba(uo);function po({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,serverSearch:n,...r}){return(0,D.createElement)(so.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}},(0,D.createElement)(fo,{...r,children:[(0,D.createElement)(lo,{key:`nuqs-adapter-queue-reset`}),e]}))}var mo=r();function ho(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0,r=e.follow===!1||e.follow===`false`?!1:void 0;return{...t===void 0?{}:{run:t},...n===void 0?{}:{flow:n},...r===void 0?{}:{follow:r}}}function go(){let e=Be({strict:!1}),t=de();return{selectedRunId:typeof e.run==`string`?e.run:null,selectedFlowId:typeof e.flow==`string`?e.flow:null,follow:e.follow!==!1,setSelectedRun:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,run:e??void 0}),replace:!0})},[t]),setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t]),setFollow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,follow:e?void 0:!1}),replace:!0})},[t])}}function _o(e){let t=typeof e.resource==`string`&&e.resource.length>0?e.resource:void 0,n=typeof e.tenant==`string`&&e.tenant.length>0?e.tenant:void 0,r=e.view===`query`||e.view===`schema`||e.view===`performance`?e.view:void 0,i=e.facet===`sql`||e.facet===`kv`?e.facet:void 0;return{...t===void 0?{}:{resource:t},...n===void 0?{}:{tenant:n},...r===void 0?{}:{view:r},...i===void 0?{}:{facet:i}}}function vo(){let e=Be({strict:!1}),t=de(),n=typeof e.resource==`string`?e.resource:null,r=typeof e.tenant==`string`?e.tenant:null,i=e.view===`query`&&(e.facet===`sql`||e.facet===`kv`)?e.facet:null,a=e.view===`schema`,o=e.view===`performance`,s=o?e.facet===`kv`?`kv`:`sql`:null,c=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,resource:e??void 0,...n?.keepView?{}:{view:void 0,facet:void 0}}),replace:!0})},[t]),l=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`query`:void 0,facet:e??void 0}),replace:!0})},[t]),u=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`schema`:void 0,facet:void 0}),replace:!0})},[t]),d=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,view:e?`performance`:void 0,facet:e&&n===`kv`?`kv`:void 0}),replace:!0})},[t]);return{selectedResource:n,selectedTenant:r,queryFacet:i,schemaView:a,performanceView:o,performanceFacet:s,setSelectedResource:c,setSelectedTenant:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,tenant:e??void 0}),replace:!0})},[t]),setQueryFacet:l,setSchemaView:u,setPerformanceView:d}}function yo(e){let t=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0;return{...t===void 0?{}:{flow:t}}}function bo(){let e=Be({strict:!1}),t=de();return{selectedFlowId:typeof e.flow==`string`?e.flow:null,setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t])}}var xo={"15m":9e5,"1h":36e5,"24h":864e5,"7d":6048e5};function So(e){return e===`15m`||e===`1h`||e===`24h`||e===`7d`?e:`1h`}function Co(e){return e.error!=null&&e.error.length>0}function wo(e,t){return e.length===0?0:e.length===1?e[0]:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]}function To(e,t,n){let r=t-Math.max(0,n);return e.filter(e=>e.startedAt>=r&&e.startedAt<=t)}function Eo(e,t,n){let r=To(e,t,n);if(r.length===0)return{kind:`empty`};let i=r.map(e=>e.durationMs).sort((e,t)=>e-t),a=r.filter(Co).length,o=r.length;return{kind:`summary`,total:o,errors:a,errorRate:a/o,p50Ms:wo(i,.5),p95Ms:wo(i,.95),p99Ms:wo(i,.99),from:t-Math.max(0,n),to:t,windowMs:n}}function Do(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=So(e.window),r=typeof e.error==`string`&&e.error.length>0?e.error:void 0,i=typeof e.q==`string`&&e.q.length>0?e.q:void 0,a=e.view===`query`||e.view===`ai`?e.view:void 0,o=typeof e.agentRun==`string`&&e.agentRun.length>0?e.agentRun:void 0;return{...t===void 0?{}:{run:t},...n===`1h`?{}:{window:n},...r===void 0?{}:{error:r},...i===void 0?{}:{q:i},...a===void 0?{}:{view:a},...o===void 0?{}:{agentRun:o}}}function Oo(){let e=Be({strict:!1}),t=de(),n=typeof e.run==`string`?e.run:null,r=So(e.window),i=typeof e.error==`string`?e.error:null,a=typeof e.q==`string`?e.q:``,o=e.view===`query`||e.view===`ai`?e.view:`metrics`,s=typeof e.agentRun==`string`?e.agentRun:null,c=(0,D.useCallback)(e=>{t({to:`.`,search:t=>Do({...t,...e}),replace:!0})},[t]);return{selectedRunId:n,window:r,selectedErrorKey:i,query:a,view:o,agentRunId:s,setSelectedRun:(0,D.useCallback)(e=>{c({run:e??void 0})},[c]),setWindow:(0,D.useCallback)(e=>{c({window:e})},[c]),setSelectedError:(0,D.useCallback)((e,t)=>{c({error:e??void 0,...t===void 0?{}:{run:t??void 0}})},[c]),setQuery:(0,D.useCallback)(e=>{c({q:e.length>0?e:void 0})},[c]),setView:(0,D.useCallback)(e=>{c({view:e===`metrics`?void 0:e})},[c]),setAgentRun:(0,D.useCallback)(e=>{c({agentRun:e??void 0,view:`ai`})},[c])}}function ko(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.name==`string`&&e.name.length>0?e.name:void 0,r=e.action===`set`||e.action===`rotate`||e.action===`rotate-master`||e.action===`create`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{name:n},...r===void 0?{}:{action:r}}}function Ao(){let e=Be({strict:!1}),t=de(),n=typeof e.q==`string`?e.q:``,r=typeof e.name==`string`?e.name:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>ko({...t,...e}),replace:!0})},[t]);return{query:n,selectedName:r,action:i,setQuery:(0,D.useCallback)(e=>{a({q:e.length>0?e:void 0})},[a]),setSelectedName:(0,D.useCallback)(e=>{a({name:e??void 0,action:void 0})},[a]),setAction:(0,D.useCallback)(e=>{a({action:e??void 0})},[a])}}function jo(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.key==`string`&&e.key.length>0?e.key:void 0,r=e.action===`create`||e.action===`edit`||e.action===`refresh`||e.action===`revoke`||e.action===`rotate`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{key:n},...r===void 0?{}:{action:r}}}function Mo(){let e=Be({strict:!1}),t=de(),n=typeof e.q==`string`?e.q:``,r=typeof e.key==`string`?e.key:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>jo({...t,...e}),replace:!0})},[t]);return{query:n,selectedKey:r,action:i,setQuery:e=>{a({q:e.length>0?e:void 0})},setSelectedKey:e=>{a({key:e??void 0,action:void 0})},setAction:e=>{a({action:e??void 0})}}}var No=`/overview`,Po=new Set([`/overview`,`/flows`,`/store`,`/vault`,`/access`,`/observability`]),Fo=`/monitoring`,Io=`/observability`,Lo=1024;function Ro(e){if(typeof e!=`string`)return;let t=e.trim();if(t.length===0||t.length>Lo||!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`://`))return;let n,r;try{let e=new URL(t,`http://console.local`);if(e.origin!==`http://console.local`)return;n=e.pathname,r=e.search}catch{return}if(n===Fo&&(n=Io),Po.has(n))return r.length>0?`${n}${r}`:n}function zo(e){let t=Ro(e.next);return t===void 0||t===`/overview`?{}:{next:t}}function Bo(e){return zo({next:e})}function Vo(e){let t=Ro(e);if(t===void 0)return{to:No,search:{}};let n=new URL(t,`http://console.local`),r=Object.fromEntries(n.searchParams.entries());return n.pathname===`/flows`?{to:`/flows`,search:yo(r)}:n.pathname===`/store`?{to:`/store`,search:_o(r)}:n.pathname===`/vault`?{to:`/vault`,search:ko(r)}:n.pathname===`/access`?{to:`/access`,search:jo(r)}:n.pathname===Io?{to:`/observability`,search:Do(r)}:{to:`/overview`,search:ho(r)}}function Ho(e,t){let n=Vo(t);switch(n.to){case`/flows`:e({to:`/flows`,search:n.search});return;case`/store`:e({to:`/store`,search:n.search});return;case`/vault`:e({to:`/vault`,search:n.search});return;case`/access`:e({to:`/access`,search:n.search});return;case`/observability`:e({to:`/observability`,search:n.search});return;default:e({to:`/overview`,search:n.search})}}var Uo=[[`path`,{d:`M15 5H19.5C20.4346 5 20.9019 5 21.25 5.20096C21.478 5.33261 21.6674 5.52197 21.799 5.75C22 6.09808 22 6.56538 22 7.5C22 8.43462 22 8.90192 21.799 9.25C21.6674 9.47803 21.478 9.66739 21.25 9.79904C20.9019 10 20.4346 10 19.5 10H15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 14H19.5C20.4346 14 20.9019 14 21.25 14.201C21.478 14.3326 21.6674 14.522 21.799 14.75C22 15.0981 22 15.5654 22 16.5C22 17.4346 22 17.9019 21.799 18.25C21.6674 18.478 21.478 18.6674 21.25 18.799C20.9019 19 20.4346 19 19.5 19H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.29969 14.3638L9.92373 13.9477L9.92373 13.9477L9.29969 14.3638ZM9.32684 14.4045L8.7028 14.8205L8.7028 14.8205L9.32684 14.4045ZM8.41421 21L7.88388 20.4697L8.41421 21ZM9.05201 20.3622L9.58234 20.8925H9.58234L9.05201 20.3622ZM9.19561 16.4867L8.59561 16.0367L8.59561 16.0367L9.19561 16.4867ZM9.27186 16.3851L9.87186 16.8351L9.87186 16.8351L9.27186 16.3851ZM9.19561 18.3417L8.59561 18.7917L8.59561 18.7917L9.19561 18.3417ZM8.79241 17.7024L9.5106 17.4862V17.4862L8.79241 17.7024ZM8.79241 17.1261L9.5106 17.3422V17.3422L8.79241 17.1261ZM5.58579 21L5.05546 21.5303L5.05546 21.5303L5.58579 21ZM9.76462 15.2332L10.5065 15.1229L10.5065 15.1229L9.76462 15.2332ZM9.75494 15.5819L10.4895 15.7332V15.7332L9.75494 15.5819ZM9.60244 19.7056L8.91033 19.4167V19.4167L9.60244 19.7056ZM9.64765 19.0695L10.3737 18.8814V18.8814L9.64765 19.0695ZM9.02647 13.84L9.75662 13.6686L9.75662 13.6686L9.02647 13.84ZM9.06318 13.9613L8.36057 14.2236L8.36057 14.2236L9.06318 13.9613ZM9 11.584L8.69972 10.8967C8.42655 11.016 8.25 11.2859 8.25 11.584H9ZM5 11.584H5.75C5.75 11.2859 5.57345 11.016 5.30028 10.8967L5 11.584ZM2 7H2.75C2.75 4.65279 4.65279 2.75 7 2.75V2V1.25C3.82436 1.25 1.25 3.82436 1.25 7H2ZM7 2V2.75C9.34721 2.75 11.25 4.65279 11.25 7H12H12.75C12.75 3.82436 10.1756 1.25 7 1.25V2ZM9.29969 14.3638L8.67565 14.7798L8.7028 14.8205L9.32684 14.4045L9.95088 13.9884L9.92373 13.9477L9.29969 14.3638ZM8.41421 21L8.94454 21.5303L9.58234 20.8925L9.05201 20.3622L8.52168 19.8319L7.88388 20.4697L8.41421 21ZM9.19561 16.4867L9.79561 16.9367L9.87186 16.8351L9.27186 16.3851L8.67186 15.9351L8.59561 16.0367L9.19561 16.4867ZM9.19561 18.3417L9.79561 17.8917C9.67257 17.7276 9.60164 17.6325 9.55282 17.5578C9.50856 17.4902 9.50756 17.4761 9.5106 17.4862L8.79241 17.7024L8.07422 17.9185C8.17302 18.2468 8.39708 18.527 8.59561 18.7917L9.19561 18.3417ZM9.19561 16.4867L8.59561 16.0367C8.39708 16.3014 8.17302 16.5816 8.07422 16.91L8.79241 17.1261L9.5106 17.3422C9.50756 17.3523 9.50856 17.3382 9.55282 17.2706C9.60164 17.196 9.67257 17.1008 9.79561 16.9367L9.19561 16.4867ZM8.79241 17.7024L9.5106 17.4862C9.49647 17.4393 9.49647 17.3892 9.5106 17.3422L8.79241 17.1261L8.07422 16.91C7.97526 17.2388 7.97526 17.5896 8.07422 17.9185L8.79241 17.7024ZM5.58579 21L5.05546 21.5303C5.37379 21.8487 5.66477 22.1419 5.93262 22.3463C6.21778 22.5638 6.56297 22.75 7 22.75V22V21.25C6.99936 21.25 6.99936 21.25 6.9998 21.25C7.00025 21.2501 7.00053 21.2501 7.00045 21.2501C7.00036 21.2501 6.99936 21.2499 6.99731 21.2492C6.99523 21.2486 6.99174 21.2474 6.98671 21.2453C6.96497 21.2362 6.91996 21.2128 6.8425 21.1537C6.67346 21.0248 6.46444 20.818 6.11612 20.4697L5.58579 21ZM8.41421 21L7.88388 20.4697C7.53556 20.818 7.32654 21.0248 7.1575 21.1537C7.08004 21.2128 7.03503 21.2362 7.0133 21.2453C7.00826 21.2474 7.00477 21.2486 7.00269 21.2492C7.00064 21.2499 6.99965 21.2501 6.99955 21.2501C6.99947 21.2501 6.99975 21.2501 7.0002 21.25C7.00064 21.25 7.00064 21.25 7 21.25V22V22.75C7.43703 22.75 7.78222 22.5638 8.06737 22.3463C8.33523 22.1419 8.62621 21.8487 8.94454 21.5303L8.41421 21ZM5 19.5858H4.25C4.25 19.9333 4.23672 20.316 4.38321 20.6697L5.07612 20.3827L5.76903 20.0957C5.76901 20.0956 5.76889 20.0954 5.7686 20.0944C5.76828 20.0933 5.76746 20.0905 5.76635 20.0852C5.76401 20.0739 5.76041 20.052 5.75736 20.0117C5.7505 19.9215 5.75 19.8011 5.75 19.5858H5ZM5.58579 21L6.11612 20.4697C5.96383 20.3174 5.87909 20.2319 5.82012 20.1633C5.79385 20.1327 5.78085 20.1146 5.77456 20.105C5.77157 20.1004 5.77014 20.0978 5.76963 20.0969C5.76915 20.096 5.76905 20.0957 5.76903 20.0957L5.07612 20.3827L4.38321 20.6697C4.5297 21.0233 4.8097 21.2846 5.05546 21.5303L5.58579 21ZM9.32684 14.4045L8.7028 14.8205C8.84441 15.0329 8.92554 15.1556 8.97895 15.2518C9.0267 15.3378 9.02449 15.355 9.02277 15.3435L9.76462 15.2332L10.5065 15.1229C10.4718 14.8899 10.3857 14.6953 10.2903 14.5234C10.2005 14.3618 10.0792 14.1809 9.95087 13.9884L9.32684 14.4045ZM9.27186 16.3851L9.87186 16.8351C10.0106 16.65 10.1418 16.4761 10.2404 16.3197C10.3452 16.1534 10.442 15.9638 10.4895 15.7332L9.75494 15.5819L9.02035 15.4306C9.02271 15.4192 9.02396 15.4366 8.97152 15.5197C8.91285 15.6128 8.82504 15.7308 8.67186 15.9351L9.27186 16.3851ZM9.76462 15.2332L9.02277 15.3435C9.02708 15.3724 9.02626 15.402 9.02035 15.4306L9.75494 15.5819L10.4895 15.7332C10.5309 15.5323 10.5366 15.3257 10.5065 15.1229L9.76462 15.2332ZM9.05201 20.3622L9.58234 20.8925C9.73312 20.7418 9.87353 20.6019 9.98321 20.4758C10.0983 20.3435 10.2133 20.1892 10.2946 19.9945L9.60244 19.7056L8.91033 19.4167C8.91552 19.4043 8.9134 19.4202 8.85137 19.4915C8.78391 19.569 8.68714 19.6664 8.52168 19.8319L9.05201 20.3622ZM9.19561 18.3417L8.59561 18.7917C8.736 18.9789 8.81803 19.089 8.87384 19.1753C8.92516 19.2547 8.92501 19.2707 8.92163 19.2577L9.64765 19.0695L10.3737 18.8814C10.3207 18.6772 10.2287 18.5082 10.1335 18.3609C10.0428 18.2205 9.92355 18.0623 9.79561 17.8917L9.19561 18.3417ZM9.60244 19.7056L10.2946 19.9945C10.4417 19.6421 10.4695 19.2511 10.3737 18.8814L9.64765 19.0695L8.92163 19.2577C8.93532 19.3105 8.93135 19.3663 8.91033 19.4167L9.60244 19.7056ZM9 13.3739H8.25C8.25 13.5755 8.24543 13.7947 8.29633 14.0115L9.02647 13.84L9.75662 13.6686C9.75749 13.6723 9.75458 13.6641 9.75254 13.6191C9.75018 13.5669 9.75 13.4981 9.75 13.3739H9ZM9.29969 14.3638L9.92373 13.9477C9.85483 13.8444 9.81683 13.7871 9.78988 13.7424C9.76658 13.7037 9.76447 13.6953 9.7658 13.6989L9.06318 13.9613L8.36057 14.2236C8.43847 14.4322 8.56384 14.6121 8.67565 14.7798L9.29969 14.3638ZM9.02647 13.84L8.29633 14.0114C8.31324 14.0835 8.3347 14.1543 8.36057 14.2236L9.06318 13.9613L9.7658 13.6989C9.7621 13.689 9.75903 13.6789 9.75662 13.6686L9.02647 13.84ZM9 11.584H8.25V13.3739H9H9.75V11.584H9ZM12 7H11.25C11.25 8.74161 10.2023 10.2402 8.69972 10.8967L9 11.584L9.30028 12.2712C11.3295 11.3846 12.75 9.35903 12.75 7H12ZM5 11.584H4.25V19.5858H5H5.75V11.584H5ZM5 11.584L5.30028 10.8967C3.79769 10.2402 2.75 8.74161 2.75 7H2H1.25C1.25 9.35903 2.6705 11.3846 4.69972 12.2712L5 11.584Z`,fill:`currentColor`,key:`2`}],[`path`,{d:`M7.25 7H7M7.5 7C7.5 7.27614 7.27614 7.5 7 7.5C6.72386 7.5 6.5 7.27614 6.5 7C6.5 6.72386 6.72386 6.5 7 6.5C7.27614 6.5 7.5 6.72386 7.5 7Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Wo=[[`path`,{d:`M7 21H16.9999C19.3569 21 20.5354 21 21.2677 20.2678C21.9999 19.5355 21.9999 18.357 21.9999 16C21.9999 13.643 21.9999 12.4645 21.2677 11.7322C20.5354 11 19.3569 11 16.9999 11H7C4.64302 11 3.46453 11 2.7323 11.7322C2.00007 12.4644 2.00005 13.6429 2 15.9999C1.99995 18.357 1.99993 19.5355 2.73217 20.2677C3.4644 21 4.64294 21 7 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4 11C4.00005 9.59977 4.00008 8.89966 4.27263 8.36485C4.5123 7.89455 4.89469 7.51218 5.365 7.27253C5.89981 7 6.59993 7 8.00015 7H16C17.4001 7 18.1002 7 18.635 7.27248C19.1054 7.51217 19.4878 7.89462 19.7275 8.36502C20 8.8998 20 9.59987 20 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M6 7C6.00004 5.5998 6.00006 4.89969 6.27259 4.3649C6.51227 3.89457 6.89467 3.51218 7.36501 3.27252C7.89981 3 8.59991 3 10.0001 3H14C15.4001 3 16.1002 3 16.635 3.27248C17.1054 3.51217 17.4878 3.89462 17.7275 4.36502C18 4.8998 18 5.59987 18 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M16 15L15.7 15.4C15.1111 16.1851 14.8167 16.5777 14.3944 16.7889C13.9721 17 13.4814 17 12.5 17H11.5C10.5186 17 10.0279 17 9.60557 16.7889C9.18328 16.5777 8.88885 16.1851 8.3 15.4L8 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Go=[[`path`,{d:`M4.26781 18.8447C4.49269 20.515 5.87613 21.8235 7.55966 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.879 17.7547 20 16.6376 20 15.5C20 14.3624 19.879 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55966 9.09909C5.87613 9.17649 4.49269 10.485 4.26781 12.1553C4.12105 13.2453 4 14.3624 4 15.5C4 16.6376 4.12105 17.7547 4.26781 18.8447Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 9V6.5C7.5 4.01472 9.51472 2 12 2C14.4853 2 16.5 4.01472 16.5 6.5V9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 17.5V16C8 13.7909 9.79086 12 12 12C14.2091 12 16 13.7909 16 16V17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10.5 19V16C10.5 15.1716 11.1716 14.5 12 14.5C12.8284 14.5 13.5 15.1716 13.5 16M13.5 19V18`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],Ko=[[`path`,{d:`M3 11L5.5 8.5C6.51706 7.48294 7.02558 6.97442 7.63723 6.8616C7.87705 6.81737 8.12295 6.81737 8.36277 6.8616C8.97442 6.97442 9.48295 7.48295 10.5 8.5C11.5171 9.51705 12.0256 10.0256 12.6372 10.1384C12.8771 10.1826 13.1229 10.1826 13.3628 10.1384C13.9744 10.0256 14.4829 9.51705 15.5 8.5L21 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 15V21M9 13V21M15 16V21M21 9V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qo=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L10.5 15L16 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Jo=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Yo=[[`path`,{d:`M15 9V15H9V9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.3431 21 15 19.6569 15 18V15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9 15.002H6C4.34315 15.002 3 16.3451 3 18.002C3 19.6588 4.34315 21.002 6 21.002C7.65685 21.002 9 19.6588 9 18.002V15.002Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 9L15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M9 9V6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9H9Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Xo=[[`path`,{d:`M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zo=[[`path`,{d:`M2.79289 21.2071C3.08579 21.5 3.55719 21.5 4.5 21.5H14.5C15.4428 21.5 15.9142 21.5 16.2071 21.2071M2.79289 21.2071C2.5 20.9142 2.5 20.4428 2.5 19.5V9.5C2.5 8.55719 2.5 8.08579 2.79289 7.79289M2.79289 21.2071L8.79289 15.2071M16.2071 21.2071C16.5 20.9142 16.5 20.4428 16.5 19.5V9.5C16.5 8.55719 16.5 8.08579 16.2071 7.79289M16.2071 21.2071L21.2071 16.2071C21.5 15.9142 21.5 15.4428 21.5 14.5V4.5C21.5 3.55719 21.5 3.08579 21.2071 2.79289M16.2071 7.79289C15.9142 7.5 15.4428 7.5 14.5 7.5H4.5C3.55719 7.5 3.08579 7.5 2.79289 7.79289M16.2071 7.79289L21.2071 2.79289M2.79289 7.79289L7.79289 2.79289C8.08579 2.5 8.55719 2.5 9.5 2.5H19.5C20.4428 2.5 20.9142 2.5 21.2071 2.79289M8.79289 15.2071C9.08579 15.5 9.55719 15.5 10.5 15.5H14M8.79289 15.2071C8.5 14.9142 8.5 14.4428 8.5 13.5V10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Qo=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],$o=[[`path`,{d:`M18 18C18 18.4644 18 18.6965 17.978 18.8918C17.7952 20.5145 16.5145 21.7952 14.8919 21.978C14.6965 22 14.4644 22 14 22H11C7.70017 22 6.05025 22 5.02513 20.9749C4 19.9498 4 18.2998 4 15L4.00001 8.99998C4.00001 5.70016 4.00003 4.05024 5.02514 3.02512C6.05027 2 7.70018 2 11 2H14C14.4644 2 14.6965 2 14.8919 2.02201C16.5145 2.20483 17.7952 3.48547 17.978 5.10816C18 5.30347 18 5.53565 18 6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.07612 11.1183C8 11.3021 8 11.535 8 12.001C8 12.4669 8 12.6999 8.07612 12.8837C8.17761 13.1287 8.37229 13.3234 8.61732 13.4249C8.80109 13.501 9.03406 13.501 9.5 13.501H14.5C14.5002 15.2503 14.511 16.1299 15.0623 16.3858C15.0829 16.3954 15.1037 16.4042 15.1249 16.4124C15.7045 16.6353 16.3999 16.0139 17.7907 14.7711C19.2576 13.4602 19.9912 12.7851 20 11.957C19.9912 11.1289 19.2576 10.4538 17.7907 9.14301C16.3999 7.90018 15.7045 7.27876 15.1249 7.50171C15.1037 7.50985 15.0829 7.51869 15.0623 7.52822C14.5018 7.78844 14.5 8.69318 14.5 10.501H9.5C9.03406 10.501 8.80109 10.501 8.61732 10.5771C8.37229 10.6786 8.17761 10.8733 8.07612 11.1183Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],es=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ts=[[`path`,{d:`M17 17L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ns=[[`path`,{d:`M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],rs=[[`path`,{d:`M13.3382 10H10.6618C9.1273 10 8.36006 10 8.08543 9.49297C7.8108 8.98594 8.21743 8.32019 9.0307 6.9887L10.3689 4.79773C11.101 3.59924 11.467 3 12 3C12.533 3 12.899 3.59924 13.6311 4.79773L14.9693 6.9887C15.7826 8.32019 16.1892 8.98594 15.9146 9.49297C15.6399 10 14.8727 10 13.3382 10Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.66294 20.1111C10 19.6067 10 18.9045 10 17.5C10 16.0955 10 15.3933 9.66294 14.8889C9.51702 14.6705 9.32952 14.483 9.11114 14.3371C8.60669 14 7.90446 14 6.5 14C5.09554 14 4.39331 14 3.88886 14.3371C3.67048 14.483 3.48298 14.6705 3.33706 14.8889C3 15.3933 3 16.0955 3 17.5C3 18.9045 3 19.6067 3.33706 20.1111C3.48298 20.3295 3.67048 20.517 3.88886 20.6629C4.39331 21 5.09554 21 6.5 21C7.90446 21 8.60669 21 9.11114 20.6629C9.32952 20.517 9.51702 20.3295 9.66294 20.1111Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],is=[[`path`,{d:`M19.5576 4L20.4551 4.97574C20.8561 5.41165 21.0566 5.62961 20.9861 5.81481C20.9155 6 20.632 6 20.0649 6C18.7956 6 17.2771 5.79493 16.1111 6.4733C15.3903 6.89272 14.8883 7.62517 14.0392 9M3 18H4.58082C6.50873 18 7.47269 18 8.2862 17.5267C9.00708 17.1073 9.50904 16.3748 10.3582 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.5576 20L20.4551 19.0243C20.8561 18.5883 21.0566 18.3704 20.9861 18.1852C20.9155 18 20.632 18 20.0649 18C18.7956 18 17.2771 18.2051 16.1111 17.5267C15.2976 17.0534 14.7629 16.1815 13.6935 14.4376L10.7038 9.5624C9.63441 7.81853 9.0997 6.9466 8.2862 6.4733C7.47269 6 6.50873 6 4.58082 6H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],as=[[`path`,{d:`M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 3L9.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 7H6M5 10H6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],os=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2V3.5M12 20.5V22M19.0708 19.0713L18.0101 18.0106M5.98926 5.98926L4.9286 4.9286M22 12H20.5M3.5 12H2M19.0713 4.92871L18.0106 5.98937M5.98975 18.0107L4.92909 19.0714`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],ss=[[`path`,{d:`M19.439 15.439C20.3636 14.5212 21.0775 13.6091 21.544 12.955C21.848 12.5287 22 12.3155 22 12C22 11.6845 21.848 11.4713 21.544 11.045C20.1779 9.12944 16.6892 5 12 5C11.0922 5 10.2294 5.15476 9.41827 5.41827M6.74742 6.74742C4.73118 8.1072 3.24215 9.94266 2.45604 11.045C2.15201 11.4713 2 11.6845 2 12C2 12.3155 2.15201 12.5287 2.45604 12.955C3.8221 14.8706 7.31078 19 12 19C13.9908 19 15.7651 18.2557 17.2526 17.2526`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.85786 10C9.32783 10.53 9 11.2623 9 12.0711C9 13.6887 10.3113 15 11.9289 15C12.7377 15 13.47 14.6722 14 14.1421`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 3L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],cs=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],ls=[[`path`,{d:`M3 19C3 20.4142 3 21.1213 3.43934 21.5607C3.87868 22 4.58579 22 6 22C7.41421 22 8.12132 22 8.56066 21.5607C9 21.1213 9 20.4142 9 19C9 17.5858 9 16.8787 8.56066 16.4393C8.12132 16 7.41421 16 6 16C4.58579 16 3.87868 16 3.43934 16.4393C3 16.8787 3 17.5858 3 19Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5C3 6.41421 3 7.12132 3.43934 7.56066C3.87868 8 4.58579 8 6 8C7.41421 8 8.12132 8 8.56066 7.56066C9 7.12132 9 6.41421 9 5C9 3.58579 9 2.87868 8.56066 2.43934C8.12132 2 7.41421 2 6 2C4.58579 2 3.87868 2 3.43934 2.43934C3 2.87868 3 3.58579 3 5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 14C15 15.4142 15 16.1213 15.4393 16.5607C15.8787 17 16.5858 17 18 17C19.4142 17 20.1213 17 20.5607 16.5607C21 16.1213 21 15.4142 21 14C21 12.5858 21 11.8787 20.5607 11.4393C20.1213 11 19.4142 11 18 11C16.5858 11 15.8787 11 15.4393 11.4393C15 11.8787 15 12.5858 15 14Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 8V16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15 14H12C8.68629 14 6 11.3137 6 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],us=[.16,1,.3,1],ds={type:`spring`,stiffness:500,damping:30,mass:.6},fs={type:`spring`,stiffness:460,damping:30,mass:.55},ps={type:`spring`,stiffness:420,damping:40,mass:.5},ms={type:`spring`,stiffness:360,damping:32,mass:.6};function hs(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>{t(e.matches)};return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var gs=(0,D.createContext)({});function _s(e){let t=(0,D.useRef)(null);return t.current===null&&(t.current=e()),t.current}var vs=typeof window<`u`?D.useLayoutEffect:D.useEffect,ys=(0,D.createContext)(null);function bs(e,t){e.indexOf(t)===-1&&e.push(t)}function xs(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Ss=(e,t,n)=>n>t?t:n<e?e:n,Cs=()=>{},ws=()=>{},Ts={},Es=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ds=e=>typeof e==`object`&&!!e,Os=e=>/^0[^.\s]+$/u.test(e);function ks(e){let t;return()=>(t===void 0&&(t=e()),t)}var As=e=>e,js=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ms=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Ns=class{constructor(){this.subscriptions=[]}add(e){return bs(this.subscriptions,e),()=>this.remove(e)}remove(e){xs(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ps=e=>e*1e3,Fs=e=>e/1e3,Is=(e,t)=>t?1e3/t*e:0,Ls=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Rs=1e-7,zs=12;function Bs(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ls(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Rs&&++s<zs);return o}function Vs(e,t,n,r){if(e===t&&n===r)return As;let i=t=>Bs(t,0,1,e,n);return e=>e===0||e===1?e:Ls(i(e),t,r)}var Hs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Us=e=>t=>1-e(1-t),Ws=Vs(.33,1.53,.69,.99),Gs=Us(Ws),Ks=Hs(Gs),qs=e=>e>=1?1:(e*=2)<1?.5*Gs(e):.5*(2-2**(-10*(e-1))),Js=e=>1-Math.sin(Math.acos(e)),Ys=Us(Js),Xs=Hs(Js),Zs=Vs(.42,0,1,1),Qs=Vs(0,0,.58,1),$s=Vs(.42,0,.58,1),ec=e=>Array.isArray(e)&&typeof e[0]!=`number`,tc=e=>Array.isArray(e)&&typeof e[0]==`number`,nc={linear:As,easeIn:Zs,easeInOut:$s,easeOut:Qs,circIn:Js,circInOut:Xs,circOut:Ys,backIn:Gs,backInOut:Ks,backOut:Ws,anticipate:qs},rc=e=>typeof e==`string`,ic=e=>{if(tc(e)){e.length;let[t,n,r,i]=e;return Vs(t,n,r,i)}return rc(e)?(nc[e],`${e}`,nc[e]):e},ac=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function oc(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var sc=40;function cc(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ac.reduce((e,t)=>(e[t]=oc(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Ts.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,sc),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ac.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ac.length;t++)o[ac[t]].cancel(e)},state:i,steps:o}}var{schedule:N,cancel:lc,state:P,steps:uc}=cc(typeof requestAnimationFrame<`u`?requestAnimationFrame:As,!0),dc;function fc(){dc=void 0}var F={now:()=>(dc===void 0&&F.set(P.isProcessing||Ts.useManualTiming?P.timestamp:performance.now()),dc),set:e=>{dc=e,queueMicrotask(fc)}},pc=e=>Math.round(e*1e5)/1e5,mc=e=>t=>typeof t==`string`&&t.startsWith(e),hc=mc(`--`),gc=mc(`var(--`),_c=e=>gc(e)?vc.test(e.split(`/*`)[0].trim()):!1,vc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yc(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var bc={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},xc={...bc,transform:e=>Ss(0,1,e)},Sc={...bc,default:1},Cc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wc(e){return e==null}var Tc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ec=(e,t)=>n=>!!(typeof n==`string`&&Tc.test(n)&&n.startsWith(e)||t&&!wc(n)&&Object.prototype.hasOwnProperty.call(n,t)),Dc=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Cc);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Oc=e=>Ss(0,255,e),kc={...bc,transform:e=>Math.round(Oc(e))},Ac={test:Ec(`rgb`,`red`),parse:Dc(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+kc.transform(e)+`, `+kc.transform(t)+`, `+kc.transform(n)+`, `+pc(xc.transform(r))+`)`};function jc(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Mc={test:Ec(`#`),parse:jc,transform:Ac.transform},Nc=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pc=Nc(`deg`),Fc=Nc(`%`),I=Nc(`px`),Ic=Nc(`vh`),Lc=Nc(`vw`),Rc={...Fc,parse:e=>Fc.parse(e)/100,transform:e=>Fc.transform(e*100)},zc={test:Ec(`hsl`,`hue`),parse:Dc(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Fc.transform(pc(t))+`, `+Fc.transform(pc(n))+`, `+pc(xc.transform(r))+`)`},L={test:e=>Ac.test(e)||Mc.test(e)||zc.test(e),parse:e=>Ac.test(e)?Ac.parse(e):zc.test(e)?zc.parse(e):Mc.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ac.transform(e):zc.transform(e),getAnimatableNone:e=>{let t=L.parse(e);return t.alpha=0,L.transform(t)}},Bc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vc=new RegExp(Cc.source),Hc=new RegExp(Bc.source,`i`);function Uc(e){return isNaN(e)&&typeof e==`string`&&(Vc.test(e)||Hc.test(e))}var Wc=`number`,Gc=`color`,Kc=`var`,qc=`var(`,Jc="${}",Yc=/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 Xc(e){let t=e.toString();return Vc.test(t)||Hc.test(t)}function Zc(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Yc,e=>(L.test(e)?(r.color.push(a),i.push(Gc),n.push(L.parse(e))):e.startsWith(qc)?(r.var.push(a),i.push(Kc),n.push(e)):(r.number.push(a),i.push(Wc),n.push(parseFloat(e))),++a,Jc)).split(Jc),indexes:r,types:i}}function Qc(e){return Zc(e).values}function $c({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Wc?pc(r[a]):e===Gc?L.transform(r[a]):r[a]}return i}}function el(e){return $c(Zc(e))}var tl=e=>typeof e==`number`?0:L.test(e)?L.getAnimatableNone(e):e,nl=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:tl(e);function rl(e){let t=Zc(e);return $c(t)(t.values.map((e,n)=>nl(e,t.split[n])))}var il={test:Uc,parse:Qc,createTransformer:el,getAnimatableNone:rl};function al(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ol({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=al(s,r,e+1/3),a=al(s,r,e),o=al(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function sl(e,t){return n=>n>0?t:e}var R=(e,t,n)=>e+(t-e)*n,cl=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ll=[Mc,Ac,zc],ul=e=>ll.find(t=>t.test(e));function dl(e){let t=ul(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===zc&&(n=ol(n)),n}var fl=(e,t)=>{let n=dl(e),r=dl(t);if(!n||!r)return sl(e,t);let i={...n};return e=>(i.red=cl(n.red,r.red,e),i.green=cl(n.green,r.green,e),i.blue=cl(n.blue,r.blue,e),i.alpha=R(n.alpha,r.alpha,e),Ac.transform(i))},pl=new Set([`none`,`hidden`]);function ml(e,t){return pl.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hl(e,t){return n=>R(e,t,n)}function gl(e){return typeof e==`number`?hl:typeof e==`string`?_c(e)?sl:L.test(e)?fl:bl:Array.isArray(e)?_l:typeof e==`object`?L.test(e)?fl:vl:sl}function _l(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>gl(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function vl(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=gl(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function yl(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var bl=(e,t)=>{let n=il.createTransformer(t),r=Zc(e),i=Zc(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pl.has(e)&&!i.values.length||pl.has(t)&&!r.values.length?ml(e,t):js(_l(yl(r,i),i.values),n):(`${e}${t}`,sl(e,t))},xl=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Sl(e,t){let n=xl.exec(e);if(!n)return;let r=xl.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>pc(R(a,o,e))+i}function Cl(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return R(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Sl(e,t);if(n)return n}return gl(e)(e,t)}var wl=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>N.update(t,e),stop:()=>lc(t),now:()=>P.isProcessing?P.timestamp:F.now()}},Tl=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},El=2e4;function Dl(e,t=50,n=El,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Ol(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Dl(r),El);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Fs(i)}}var z={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function kl(e,t){return e*Math.sqrt(1-t*t)}var Al=12;function jl(e,t,n){let r=n;for(let n=1;n<Al;n++)r-=e(r)/t(r);return r}var Ml=.001;function Nl({duration:e=z.duration,bounce:t=z.bounce,velocity:n=z.velocity,mass:r=z.mass}){let i,a;z.maxDuration;let o=1-t;o=Ss(z.minDamping,z.maxDamping,o),e=Ss(z.minDuration,z.maxDuration,Fs(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=kl(t,o),c=Math.exp(-i);return Ml-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=kl(t*t,o);return(-i(t)+Ml>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=jl(i,a,s);if(e=Ps(e),isNaN(c))return{stiffness:z.stiffness,damping:z.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Pl=[`duration`,`bounce`],Fl=[`stiffness`,`damping`,`mass`];function Il(e,t){return t.some(t=>e[t]!==void 0)}function Ll(e){let t={velocity:z.velocity,stiffness:z.stiffness,damping:z.damping,mass:z.mass,isResolvedFromDuration:!1,...e};if(!Il(e,Fl)&&Il(e,Pl)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Ss(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:z.mass,stiffness:i,damping:a}}else{let n=Nl({...e,velocity:0});t={...t,...n,mass:z.mass},t.isResolvedFromDuration=!0}}return t}function Rl(e=z.visualDuration,t=z.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,velocity:u,isResolvedFromDuration:d}=Ll({...n,velocity:-Fs(n.velocity||0)}),f=s/(2*Math.sqrt(o*c)),p=Fs(Math.sqrt(o/c)),m=f*p,h={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},g=()=>{let e=Math.abs(h.delta)<5;h.restSpeed=n.restSpeed||(e?z.restSpeed.granular:z.restSpeed.default),h.restDelta=n.restDelta||(e?z.restDelta.granular:z.restDelta.default)};g();let _,v,y;if(f<1){let e=kl(p,f),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};y=()=>{t.A=(h.velocity+m*h.delta)/e,t.sinC=m*t.A+h.delta*e,t.cosC=m*h.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-m*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};_=e=>(n(e),h.target-t.env*(t.A*t.sin+h.delta*t.cos)),v=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(f===1){_=e=>h.target-Math.exp(-p*e)*(h.delta+(h.velocity+p*h.delta)*e);let e={C:0};y=()=>{e.C=h.velocity+p*h.delta},v=t=>Math.exp(-p*t)*(p*e.C*t-h.velocity)}else{let e=p*Math.sqrt(f*f-1);_=t=>{let n=Math.exp(-m*t),r=Math.min(e*t,300);return h.target-n*((h.velocity+m*h.delta)*Math.sinh(r)+e*h.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};y=()=>{t.P=(h.velocity+m*h.delta)/e,t.sinh=m*t.P-h.delta*e,t.cosh=m*h.delta-t.P*e},v=n=>{let r=Math.exp(-m*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}y();let b=!Il(n,Fl)&&Il(n,Pl),x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{h.target=e[e.length-1],h.delta=h.target-e[0],h.velocity=b?0:-Fs(t),n.restSpeed&&n.restDelta||g(),S.calculatedDuration=x,a.done=!1,y()},velocity:e=>Ps(v(e)),next:e=>{let t=_(e);if(d)a.done=e>=l;else{let n=Ps(v(e));a.done=Math.abs(n)<=h.restSpeed&&Math.abs(h.target-t)<=h.restDelta}return a.value=a.done?h.target:t,a},toString:()=>{let e=Math.min(Dl(S),El),t=Tl(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Rl.applyToOptions=e=>{let t=Ol(e,100,Rl);return e.ease=t.ease,e.duration=Ps(t.duration),e.type=`keyframes`,e};function zl({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Rl({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Bl(e,t,n){let r=[],i=n||Ts.mix||Cl,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=js(Array.isArray(t)?t[n]||As:t,a)),r.push(a)}return r}function Vl(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Bl(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Ms(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Ss(e[0],e[a-1],t)):l}function Hl(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ms(0,t,r);e.push(R(n,1,i))}}function Ul(e){let t=[0];return Hl(t,e.length-1),t}function Wl(e,t){return e.map(e=>e*t)}function Gl(e,t){return e.map(()=>t||$s).splice(0,e.length-1)}function Kl({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ec(r)?r.map(ic):ic(r)||$s,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Ts.mix||Cl)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Ss(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Vl(Wl(n&&n.length===t.length?n:Ul(t),e),t,{ease:Array.isArray(i)?i:Gl(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ql=5;function Jl(e,t,n){let r=Math.max(t-ql,0);return Is(n-e(r),t-r)}function Yl(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Jl(t=>e.next(t).value,t,e.next(t).value)}var Xl=e=>e!==null;function Zl(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Xl),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ql={decay:zl,inertia:zl,tween:Kl,keyframes:Kl,spring:Rl};function $l(e){typeof e.type==`string`&&(e.type=Ql[e.type])}function eu(e,t){return{kind:e,animation:t,timestamp:F.now(),frameTimestamp:P.timestamp,frameIsProcessing:P.isProcessing}}function tu(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...eu(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function nu(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...eu(`layout-animation-start`,e),node:t})}catch{}}var ru=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},iu=e=>e/100,au=class extends ru{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==F.now()&&this.tick(F.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),tu(this,this.options)}initAnimation(){let{options:e}=this;$l(e);let{type:t=Kl,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Kl;s!==Kl&&typeof o[0]!=`number`&&(this.mixKeyframes=js(iu,Cl(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Dl(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Ss(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==zl&&(b.value=Zl(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Fs(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(this.currentTime)}set time(e){e=Ps(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Yl(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(F.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Fs(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=wl,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(F.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},ou=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function su(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Cc)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ou.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var cu=/\b([a-z-]*)\(.*?\)/gu,lu={...il,getAnimatableNone:e=>{let t=e.match(cu);return t?t.map(su).join(` `):e}},uu={...il,getAnimatableNone:e=>{let t=il.parse(e);return il.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},du={...bc,transform:Math.round},fu={rotate:Pc,pathRotation:Pc,rotateX:Pc,rotateY:Pc,rotateZ:Pc,scale:Sc,scaleX:Sc,scaleY:Sc,scaleZ:Sc,skew:Pc,skewX:Pc,skewY:Pc,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:xc,originX:Rc,originY:Rc,originZ:I},pu={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,inset:I,insetBlock:I,insetBlockStart:I,insetBlockEnd:I,insetInline:I,insetInlineStart:I,insetInlineEnd:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockStart:I,paddingBlockEnd:I,paddingInline:I,paddingInlineStart:I,paddingInlineEnd:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockStart:I,marginBlockEnd:I,marginInline:I,marginInlineStart:I,marginInlineEnd:I,fontSize:I,backgroundPositionX:I,backgroundPositionY:I,...fu,zIndex:du,fillOpacity:xc,strokeOpacity:xc,numOctaves:du},mu={...pu,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:lu,WebkitFilter:lu,mask:uu,WebkitMask:uu},hu=e=>mu[e],gu=new Set([lu,uu]);function _u(e,t){let n=hu(e);return gu.has(n)||(n=il),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function vu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var yu=e=>e*180/Math.PI,bu=e=>Su(yu(Math.atan2(e[1],e[0]))),xu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bu,rotateZ:bu,skewX:e=>yu(Math.atan(e[1])),skewY:e=>yu(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Su=e=>(e%=360,e<0&&(e+=360),e),Cu=bu,wu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Eu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wu,scaleY:Tu,scale:e=>(wu(e)+Tu(e))/2,rotateX:e=>Su(yu(Math.atan2(e[6],e[5]))),rotateY:e=>Su(yu(Math.atan2(-e[2],e[0]))),rotateZ:Cu,rotate:Cu,skewX:e=>yu(Math.atan(e[4])),skewY:e=>yu(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Du(e){return+!!e.includes(`scale`)}function Ou(e,t){if(!e||e===`none`)return Du(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Eu,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xu,i=t}if(!i)return Du(t);let a=r[t],o=i[1].split(`,`).map(Au);return typeof a==`function`?a(o):o[a]}var ku=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ou(n,t)};function Au(e){return parseFloat(e.trim())}var ju=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Mu=new Set([...ju,`pathRotation`]),Nu=e=>e===bc||e===I,Pu=new Set([`x`,`y`,`z`]),Fu=ju.filter(e=>!Pu.has(e));function Iu(e){let t=[];return Fu.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Lu=new Set([`bottom`,`right`]);function Ru(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var zu={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ru(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ru(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ou(e,`x`),y:({transform:e})=>Ou(e,`y`)};zu.translateX=zu.x,zu.translateY=zu.y;var Bu=new Set,Vu=!1,Hu=!1,Uu=!1;function Wu(){if(Hu){let e=[],t=new Set,n=new Set;Bu.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Lu.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Iu(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Hu=!1,Vu=!1,Bu.forEach(e=>e.complete(Uu)),Bu.clear()}function Gu(){Bu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hu=!0)})}function Ku(){Uu=!0,Gu(),Wu(),Uu=!1}function qu(e,t,n){if(typeof e==`string`){if(Es(e)||Os(e))return parseFloat(e);if(!il.test(e)&&il.test(n))return _u(t,n)}return e??void 0}var Ju=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Bu.add(this),Vu||(Vu=!0,N.read(Gu),N.resolveKeyframes(Wu))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=qu(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vu(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bu.delete(this)}cancel(){this.state===`scheduled`&&(Bu.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Yu=e=>e.startsWith(`--`);function Xu(e,t,n){Yu(t)?e.style.setProperty(t,n):e.style[t]=n}var Zu={};function Qu(e,t){let n=ks(e);return()=>Zu[t]??n()}var $u=Qu(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ed=Qu(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),td=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nd={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:td([0,.65,.55,1]),circOut:td([.55,0,1,.45]),backIn:td([.31,.01,.66,-.59]),backOut:td([.33,1.53,.69,.99])};function rd(e,t){if(e)return typeof e==`function`?ed()?Tl(e,t):`ease-out`:tc(e)?td(e):Array.isArray(e)?e.map(e=>rd(e,t)||nd.easeOut):nd[e]}function id(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=rd(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function ad(e){return typeof e==`function`&&`applyToOptions`in e}function od({type:e,...t}){return ad(e)&&ed()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var sd=class extends ru{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=od(e);this.animation=id(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Zl(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Xu(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},tu(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Fs(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ps(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&$u()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),As):r(this)}},cd={anticipate:qs,backInOut:Ks,circInOut:Xs};function ld(e){return e in cd}function ud(e){typeof e.ease==`string`&&ld(e.ease)&&(e.ease=cd[e.ease])}var dd=10,fd=class extends sd{constructor(e){ud(e),$l(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new au({...a,autoplay:!1}),s=Math.max(dd,F.now()-this.startTime),c=Ss(0,dd,s-dd),l=o.sample(s).value,{name:u}=this.options;i&&u&&Xu(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},pd=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(il.test(e)||e===`0`)&&!e.startsWith(`url(`));function md(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hd(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=pd(i,t),s=pd(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):md(e)||(n===`spring`||ad(n))&&r}function gd(e){e.duration=0,e.type=`keyframes`}var _d=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),vd=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yd(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&vd.test(e[t]))return!0;return!1}var bd=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),xd=ks(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Sd(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(_d.has(n)||bd.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return xd()&&(_d.has(n)||bd.has(n)&&yd(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Cd=40,wd=class extends ru{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Ju;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=F.now();let u=!0;hd(e,i,a,o)||(u=!1,(Ts.instantAnimations||!s)&&l?.(Zl(e,n,t)),e[0]=e[e.length-1],gd(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>Cd?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&Sd(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new fd(n)}catch{m=new au(n)}}else m=new au(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ku()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Td(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ed=30,Dd=e=>!isNaN(parseFloat(e)),Od={current:void 0},kd=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=F.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Dd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Ns)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Ns,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){N.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Od.current&&Od.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ed)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ed);return Is(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ad(e,t){return new kd(e,t)}function jd(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Md(e,t){let n=e?.[t]??e?.default??e;return n===e?n:jd(n,e)}var Nd={type:`spring`,stiffness:500,damping:25,restSpeed:10},Pd=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fd={type:`keyframes`,duration:.8},Id={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ld=(e,{keyframes:t})=>t.length>2?Fd:Mu.has(e)?e.startsWith(`scale`)?Pd(t[1]):Nd:Id,Rd=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function zd(e){for(let t in e)if(!Rd.has(t))return!0;return!1}var Bd=(e,t,n,r={},i,a)=>o=>{let s=Md(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ps(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};zd(s)||Object.assign(u,Ld(e,u)),u.duration&&=Ps(u.duration),u.repeatDelay&&=Ps(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gd(u),u.delay===0&&(d=!0)),(Ts.instantAnimations||Ts.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,gd(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Zl(u.keyframes,s);if(e!==void 0){N.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new au(u):new wd(u)},Vd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hd(e){let t=Vd.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ud(e,t,n=1){`${e}`;let[r,i]=Hd(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Es(e)?parseFloat(e):e}return _c(i)?Ud(i,t,n+1):i}function Wd(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Gd(e,t,n,r){if(typeof t==`function`){let[i,a]=Wd(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Wd(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Kd(e,t,n){let r=e.getProps();return Gd(r,t,n===void 0?r.custom:n,e)}var qd=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...ju]),Jd=e=>Array.isArray(e);function Yd(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ad(n))}function Xd(e){return Jd(e)?e[e.length-1]||0:e}function Zd(e,t){let{transitionEnd:n={},transition:r={},...i}=Kd(e,t)||{};i={...i,...n};for(let t in i)Yd(e,t,Xd(i[t]))}var B=e=>!!(e&&e.getVelocity);function Qd(e){return!!(B(e)&&e.add)}function $d(e,t){let n=e.getValue(`willChange`);if(Qd(n))return n.add(t);if(!n&&Ts.WillChange){let n=new Ts.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function ef(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var tf=`data-`+ef(`framerAppearId`);function nf(e){return e.props[tf]}var rf=typeof window<`u`;function af({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function of(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?jd(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&af(f,t))continue;let o={delay:n,...Md(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){N.update(()=>r.set(i));continue}let p=!1;if(rf&&window.MotionHandoffAnimation){let n=nf(e);if(n){let e=window.MotionHandoffAnimation(n,t,N);e!==null&&(o.startTime=e,p=!0)}}$d(e,t);let m=l??e.shouldReduceMotion;r.start(Bd(t,r,i,m&&qd.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>N.update(()=>{o&&Zd(e,o)});d.length?Promise.all(d).then(t):t()}return d}function sf(e,t,n={}){let r=Kd(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(of(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return cf(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function cf(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(sf(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Td(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function lf(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>sf(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=sf(e,t,n);else{let i=typeof t==`function`?Kd(e,t,n.custom):t;r=Promise.all(of(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var uf={test:e=>e===`auto`,parse:e=>e},df=e=>t=>t.test(e),ff=[bc,I,Fc,Pc,Lc,Ic,uf],pf=e=>ff.find(df(e));function mf(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Os(e)}var hf=new Set([`auto`,`none`,`0`]);function gf(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!hf.has(t)&&Xc(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=_u(n,i))}var _f=class extends Ju{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),_c(r))){let i=Ud(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!qd.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=pf(r),o=pf(i);if(yc(r)!==yc(i)&&zu[n]){this.needsMeasurement=!0;return}if(a!==o){if(Nu(a)&&Nu(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zu[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||mf(e[t]))&&n.push(t);n.length&&gf(e,n,t)}measure(){let{element:e,name:t}=this;return zu[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},vf=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function yf(e){return Ds(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function bf(e){return Ds(e)&&`ownerSVGElement`in e}var xf=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Sf(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Cf={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wf=ju.length;function Tf(e,t,n){let r=``,i=!0;for(let a=0;a<wf;a++){let o=ju[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=xf(s,pu[o]);if(!c){i=!1;let t=Cf[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${xf(a,pu.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ef(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Mu.has(e)){o=!0;continue}if(hc(e)){i[e]=n;continue}{let t=xf(n,pu[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Tf(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Df={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Of={offset:`strokeDashoffset`,array:`strokeDasharray`};function kf(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Df:Of;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Af=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function jf(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ef(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Af)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&kf(d,i,a,o,!1)}function Mf({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Nf({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Pf(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ff(e){return e===void 0||e===1}function If({scale:e,scaleX:t,scaleY:n}){return!Ff(e)||!Ff(t)||!Ff(n)}function Lf(e){return If(e)||Rf(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rf(e){return zf(e.x)||zf(e.y)}function zf(e){return e&&e!==`0%`}function Bf(e,t,n){return n+t*(e-n)}function Vf(e,t,n,r,i){return i!==void 0&&(e=Bf(e,i,r)),Bf(e,n,r)+t}function Hf(e,t=0,n=1,r,i){e.min=Vf(e.min,t,n,r,i),e.max=Vf(e.max,t,n,r,i)}function Uf(e,{x:t,y:n}){Hf(e.x,t.translate,t.scale,t.originPoint),Hf(e.y,n.translate,n.scale,n.originPoint)}var Wf=.999999999999,Gf=1.0000000000001;function Kf(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(qf(e.x,-a.scroll.offset.x),qf(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Uf(e,o)),r&&Lf(a.latestValues)&&Xf(e,a.latestValues,a.layout?.layoutBox))}t.x<Gf&&t.x>Wf&&(t.x=1),t.y<Gf&&t.y>Wf&&(t.y=1)}function qf(e,t){e.min+=t,e.max+=t}function Jf(e,t,n,r,i=.5){Hf(e,t,n,R(e.min,e.max,i),r)}function Yf(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Xf(e,t,n){let r=n??e;Jf(e.x,Yf(t.x,r.x),t.scaleX,t.scale,t.originX),Jf(e.y,Yf(t.y,r.y),t.scaleY,t.scale,t.originY)}function Zf(e,t){return Mf(Pf(e.getBoundingClientRect(),t))}function Qf(e,t,n){let r=Zf(e,n),{scroll:i}=t;return i&&(qf(r.x,i.offset.x),qf(r.y,i.offset.y)),r}var{schedule:$f,cancel:ep}=cc(queueMicrotask,!1),tp={x:!1,y:!1};function np(){return tp.x||tp.y}function rp(e){return e===`x`||e===`y`?tp[e]?null:(tp[e]=!0,()=>{tp[e]=!1}):tp.x||tp.y?null:(tp.x=tp.y=!0,()=>{tp.x=tp.y=!1})}function ip(e,t){let n=Sf(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ap(e){return!(e.pointerType===`touch`||np())}function op(e,t,n={}){let[r,i,a]=ip(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!ap(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var sp=(e,t)=>t?e===t||sp(e,t.parentElement):!1,cp=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,lp=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function up(e){return lp.has(e.tagName)||e.isContentEditable===!0}var dp=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function fp(e){return dp.has(e.tagName)||e.isContentEditable===!0}var pp=new WeakSet;function mp(e){return t=>{t.key===`Enter`&&e(t)}}function hp(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var gp=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=mp(()=>{if(pp.has(n))return;hp(n,`down`);let e=mp(()=>{hp(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>hp(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function _p(e){return cp(e)&&!np()}var vp=new WeakSet;function yp(e,t,n={}){let[r,i,a]=ip(e,n),o=e=>{let r=e.currentTarget;if(!_p(e)||vp.has(e))return;pp.add(r),n.stopPropagation&&vp.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),pp.has(r)&&pp.delete(r),_p(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||sp(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),yf(e)&&(e.addEventListener(`focus`,e=>gp(e,i)),!up(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var bp=new WeakMap,xp,Sp=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:bf(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Cp=Sp(`inline`,`width`,`offsetWidth`),wp=Sp(`block`,`height`,`offsetHeight`);function Tp({target:e,borderBoxSize:t}){bp.get(e)?.forEach(n=>{n(e,{get width(){return Cp(e,t)},get height(){return wp(e,t)}})})}function Ep(e){e.forEach(Tp)}function Dp(){typeof ResizeObserver>`u`||(xp=new ResizeObserver(Ep))}function Op(e,t){xp||Dp();let n=Sf(e);return n.forEach(e=>{let n=bp.get(e);n||(n=new Set,bp.set(e,n)),n.add(t),xp?.observe(e)}),()=>{n.forEach(e=>{let n=bp.get(e);n?.delete(t),n?.size||xp?.unobserve(e)})}}var kp=new Set,Ap;function jp(){Ap=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};kp.forEach(t=>t(e))},window.addEventListener(`resize`,Ap)}function Mp(e){return kp.add(e),Ap||jp(),()=>{kp.delete(e),!kp.size&&typeof Ap==`function`&&(window.removeEventListener(`resize`,Ap),Ap=void 0)}}function Np(e,t){return typeof e==`function`?Mp(e):Op(e,t)}var Pp={value:null,addProjectionMetrics:null};function Fp(e){return bf(e)&&e.tagName===`svg`}var Ip=()=>({translate:0,scale:1,origin:0,originPoint:0}),Lp=()=>({x:Ip(),y:Ip()}),Rp=()=>({min:0,max:0}),V=()=>({x:Rp(),y:Rp()}),zp=new WeakMap;function Bp(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Vp(e){return typeof e==`string`||Array.isArray(e)}var Hp=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Up=[`initial`,...Hp];function Wp(e){if(Bp(e.animate))return!0;for(let t=0;t<Up.length;t++)if(Vp(e[Up[t]]))return!0;return!1}function Gp(e){return!!(Wp(e)||e.variants)}function Kp(e,t,n){for(let r in t){let i=t[r],a=n[r];if(B(i))e.addValue(r,i);else if(B(a))e.addValue(r,Ad(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ad(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var qp={current:null},Jp={current:!1},Yp=typeof window<`u`;function Xp(){if(Jp.current=!0,Yp){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>qp.current=e.matches;e.addEventListener(`change`,t),t()}else qp.current=!1}}var Zp=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Qp={};function $p(e){Qp=e}function em(){return Qp}var tm=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ju,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=F.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,N.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Wp(t),this.isVariantNode=Gp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&B(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,zp.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Jp.current||Xp(),this.shouldReduceMotion=qp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lc(this.notifyUpdate),lc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&_d.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new sd({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ps(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Mu.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&N.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Qp){let t=Qp[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):V()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Zp.length;t++){let n=Zp[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Kp(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Ad(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Es(n)||Os(n))?n=parseFloat(n):typeof n!=`number`&&!il.test(n)&&il.test(t)&&(n=_u(e,t)),this.setBaseTarget(e,B(n)?n.get():n)),B(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Gd(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!B(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Ns),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){$f.render(this.render)}},nm=class extends tm{constructor(){super(...arguments),this.KeyframeResolver=_f}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;B(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},rm=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function im(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function am(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var om={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(I.test(e))e=parseFloat(e);else return e}return`${am(e,t.target.x)}% ${am(e,t.target.y)}%`}},sm={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=il.parse(e);if(i.length>5)return r;let a=il.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=R(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},cm={borderRadius:{...om,applyTo:[...vf]},borderTopLeftRadius:om,borderTopRightRadius:om,borderBottomLeftRadius:om,borderBottomRightRadius:om,boxShadow:sm};function lm(e,{layout:t,layoutId:n}){return Mu.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!cm[e]||e===`opacity`)}function um(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(B(r[t])||i&&B(i[t])||lm(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function dm(e){return window.getComputedStyle(e)}var fm=class extends nm{constructor(){super(...arguments),this.type=`html`,this.renderInstance=im}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Mu.has(t))return this.projection?.isProjecting?Du(t):ku(e,t);{let n=dm(e),r=(hc(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zf(e,t)}build(e,t,n){Ef(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return um(e,t,n)}},pm=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`]),mm=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function hm(e,t,n,r){im(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(pm.has(n)?n:ef(n),t.attrs[n])}function gm(e,t,n){let r=um(e,t,n);for(let n in e)if(B(e[n])||B(t[n])){let t=ju.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var _m=class extends nm{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=V}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Mu.has(t)){let e=hu(t);return e&&e.default||0}if(Af.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=pm.has(t)?t:ef(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return gm(e,t,n)}build(e,t,n){jf(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){hm(e,t,n,r)}mount(e){this.isSVGTag=mm(e.tagName),super.mount(e)}},vm=Up.length;function ym(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ym(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<vm;n++){let r=Up[n],i=e.props[r];(Vp(i)||i===!1)&&(t[r]=i)}return t}function bm(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var xm=[...Hp].reverse(),Sm=Hp.length;function Cm(e){return t=>Promise.all(t.map(({animation:t,options:n})=>lf(e,t,n)))}function wm(e){let t=Cm(e),n=Dm(),r=!0,i=!1,a=t=>(n,r)=>{let i=Kd(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=ym(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Sm;t++){let p=xm[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Vp(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Bp(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Tm(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,ee={...w,...C},te=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in ee){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Jd(t)&&Jd(n)?!bm(t,n)||y:t!==n,r?t==null?u.add(e):te(e):t!==void 0&&u.has(e)?te(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ne=v&&y;b&&(!ne||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ne&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Kd(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Td(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Kd(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Dm(),i=!0}}}function Tm(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!bm(t,e):!1}function Em(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dm(){return{animate:Em(!0),whileInView:Em(),whileHover:Em(),whileTap:Em(),whileDrag:Em(),whileFocus:Em(),exit:Em()}}function Om(e,t){e.min=t.min,e.max=t.max}function km(e,t){Om(e.x,t.x),Om(e.y,t.y)}function Am(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var jm=.9999,Mm=1.0001,Nm=-.01,Pm=.01;function H(e){return e.max-e.min}function Fm(e,t,n){return Math.abs(e-t)<=n}function Im(e,t,n,r=.5){e.origin=r,e.originPoint=R(t.min,t.max,e.origin),e.scale=H(n)/H(t),e.translate=R(n.min,n.max,e.origin)-e.originPoint,(e.scale>=jm&&e.scale<=Mm||isNaN(e.scale))&&(e.scale=1),(e.translate>=Nm&&e.translate<=Pm||isNaN(e.translate))&&(e.translate=0)}function Lm(e,t,n,r){Im(e.x,t.x,n.x,r?r.originX:void 0),Im(e.y,t.y,n.y,r?r.originY:void 0)}function Rm(e,t,n,r=0){e.min=(r?R(n.min,n.max,r):n.min)+t.min,e.max=e.min+H(t)}function zm(e,t,n,r){Rm(e.x,t.x,n.x,r?.x),Rm(e.y,t.y,n.y,r?.y)}function Bm(e,t,n,r=0){let i=r?R(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+H(t)}function Vm(e,t,n,r){Bm(e.x,t.x,n.x,r?.x),Bm(e.y,t.y,n.y,r?.y)}function Hm(e,t,n,r,i){return e-=t,e=Bf(e,1/n,r),i!==void 0&&(e=Bf(e,1/i,r)),e}function Um(e,t=0,n=1,r=.5,i,a=e,o=e){if(Fc.test(t)&&(t=parseFloat(t),t=R(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=R(a.min,a.max,r);e===a&&(s-=t),e.min=Hm(e.min,t,n,s,i),e.max=Hm(e.max,t,n,s,i)}function Wm(e,t,[n,r,i],a,o){Um(e,t[n],t[r],t[i],t.scale,a,o)}var Gm=[`x`,`scaleX`,`originX`],Km=[`y`,`scaleY`,`originY`];function qm(e,t,n,r){Wm(e.x,t,Gm,n?n.x:void 0,r?r.x:void 0),Wm(e.y,t,Km,n?n.y:void 0,r?r.y:void 0)}function Jm(e){return e.translate===0&&e.scale===1}function Ym(e){return Jm(e.x)&&Jm(e.y)}function Xm(e,t){return e.min===t.min&&e.max===t.max}function Zm(e,t){return Xm(e.x,t.x)&&Xm(e.y,t.y)}function Qm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $m(e,t){return Qm(e.x,t.x)&&Qm(e.y,t.y)}function eh(e){return H(e.x)/H(e.y)}function th(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function nh(e){return[e(`x`),e(`y`)]}function rh(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var ih=vf.length,ah=e=>typeof e==`string`?parseFloat(e):e,oh=e=>typeof e==`number`||I.test(e);function sh(e,t,n,r,i,a){i?(e.opacity=R(0,n.opacity??1,lh(r)),e.opacityExit=R(t.opacity??1,0,uh(r))):a&&(e.opacity=R(t.opacity??1,n.opacity??1,r));for(let i=0;i<ih;i++){let a=vf[i],o=ch(t,a),s=ch(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||oh(o)===oh(s)?(e[a]=Math.max(R(ah(o),ah(s),r),0),(Fc.test(s)||Fc.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=R(t.rotate||0,n.rotate||0,r))}function ch(e,t){return e[t]===void 0?e.borderRadius:e[t]}var lh=dh(0,.5,Ys),uh=dh(.5,.95,As);function dh(e,t,n){return r=>r<e?0:r>t?1:n(Ms(e,t,r))}function fh(e,t,n){let r=B(e)?e:Ad(e);return r.start(Bd(``,r,t,n)),r.animation}function ph(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var mh=(e,t)=>e.depth-t.depth,hh=class{constructor(){this.children=[],this.isDirty=!1}add(e){bs(this.children,e),this.isDirty=!0}remove(e){xs(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mh),this.isDirty=!1,this.children.forEach(e)}};function gh(e,t){let n=F.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(lc(r),e(a-t))};return N.setup(r,!0),()=>lc(r)}function _h(e){return B(e)?e.get():e}var vh=class{constructor(){this.members=[]}add(e){bs(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(xs(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(xs(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},yh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},bh={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},xh=[``,`X`,`Y`,`Z`],Sh=1e3,Ch=0;function wh(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Th(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=nf(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,N,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Th(r)}function Eh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ch++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Pp.value&&(bh.nodes=bh.calculatedTargetDeltas=bh.calculatedProjections=0),this.nodes.forEach(kh),this.nodes.forEach(Rh),this.nodes.forEach(zh),this.nodes.forEach(Ah),Pp.addProjectionMetrics&&Pp.addProjectionMetrics(bh)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new hh)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ns),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=bf(t)&&!Fp(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;N.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=gh(i,250),yh.hasAnimatedSinceResize&&(yh.hasAnimatedSinceResize=!1,this.nodes.forEach(Lh)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Kh,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!$m(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Md(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Lh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lc(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(Bh),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Th(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Nh),this.nodes.forEach(Mh);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ph);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fh),this.nodes.forEach(Ih),this.nodes.forEach(Dh),this.nodes.forEach(Oh)):this.nodes.forEach(Ph),this.clearAllSnapshots();let e=F.now();P.delta=Ss(0,1e3/60,e-P.timestamp),P.timestamp=e,P.isProcessing=!0,uc.update.process(P),uc.preRender.process(P),uc.render.process(P),P.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$f.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jh),this.sharedNodes.forEach(Vh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!H(this.snapshot.measuredBox.x)&&!H(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=V(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ym(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Lf(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Xh(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return V();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Qh))){let{scroll:e}=this.root;e&&(qf(t.x,e.offset.x),qf(t.y,e.offset.y))}return t}removeElementScroll(e){let t=V();if(km(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&km(t,e),qf(t.x,i.offset.x),qf(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||V();km(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qf(r.x,-n.scroll.offset.x),qf(r.y,-n.scroll.offset.y)),Lf(n.latestValues)&&Xf(r,n.latestValues,n.layout?.layoutBox)}return Lf(this.latestValues)&&Xf(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=V();km(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Lf(n.latestValues))continue;let r;n.instance&&(If(n.latestValues)&&n.updateSnapshot(),r=V(),km(r,n.measurePageBox())),qm(t,n.latestValues,n.snapshot?.layoutBox,r)}return Lf(this.latestValues)&&qm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==P.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=P.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=V(),this.targetWithTransforms=V()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zm(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):km(this.target,this.layout.layoutBox),Uf(this.target,this.targetDelta)):km(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Pp.value&&bh.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||If(this.parent.latestValues)||Rf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=V(),this.relativeTargetOrigin=V(),Vm(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),km(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===P.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;km(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Kf(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=V());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Am(this.prevProjectionDelta.x,this.projectionDelta.x),Am(this.prevProjectionDelta.y,this.projectionDelta.y)),Lm(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!th(this.projectionDelta.x,this.prevProjectionDelta.x)||!th(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Pp.value&&bh.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Lp(),this.projectionDelta=Lp(),this.projectionDeltaWithTransform=Lp()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Lp();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=V(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Gh));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=R(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=R(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Hh(o.x,e.x,n),Hh(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vm(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Wh(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Zm(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=V(),km(f,this.relativeTarget)),c&&(this.animationValues=a,sh(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(lc(this.pendingAnimation),void 0),this.pendingAnimation=N.update(()=>{yh.hasAnimatedSinceResize=!0,this.motionValue||=Ad(0),this.motionValue.jump(0,!1),this.currentAnimation=fh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),nu(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Sh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Zh(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||V();let t=H(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=H(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}km(t,i),Xf(t,r),Lm(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new vh),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&wh(`z`,e,r,this.animationValues);for(let t=0;t<xh.length;t++)wh(`rotate${xh[t]}`,e,r,this.animationValues),wh(`skew${xh[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=_h(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=_h(t?.pointerEvents)||``),this.hasProjected&&!Lf(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=rh(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in cm){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=cm[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?_h(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Mh),this.root.sharedNodes.clear()}}}function Dh(e){e.updateLayout()}function Oh(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)nh(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=H(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Om(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Zh(i,t.layoutBox,n)&&nh(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=H(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Lp();Lm(o,n,t.layoutBox);let s=Lp();a?Lm(s,e.applyTransform(r,!0),t.measuredBox):Lm(s,n,t.layoutBox);let c=!Ym(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=V();Vm(s,t.layoutBox,i.layoutBox,o);let c=V();Vm(c,n,a.layoutBox,o),$m(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function kh(e){Pp.value&&bh.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ah(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function jh(e){e.clearSnapshot()}function Mh(e){e.clearMeasurements()}function Nh(e){e.isLayoutDirty=!0,e.updateLayout()}function Ph(e){e.isLayoutDirty=!1}function Fh(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Ih(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Lh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Rh(e){e.resolveTargetDelta()}function zh(e){e.calcProjection()}function Bh(e){e.resetSkewAndRotation()}function Vh(e){e.removeLeadSnapshot()}function Hh(e,t,n){e.translate=R(t.translate,0,n),e.scale=R(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Uh(e,t,n,r){e.min=R(t.min,n.min,r),e.max=R(t.max,n.max,r)}function Wh(e,t,n,r){Uh(e.x,t.x,n.x,r),Uh(e.y,t.y,n.y,r)}function Gh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Kh={duration:.45,ease:[.4,0,.1,1]},qh=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jh=qh(`applewebkit/`)&&!qh(`chrome/`)?Math.round:As;function Yh(e){e.min=Jh(e.min),e.max=Jh(e.max)}function Xh(e){Yh(e.x),Yh(e.y)}function Zh(e,t,n){return e===`position`||e===`preserve-aspect`&&!Fm(eh(t),eh(n),.2)}function Qh(e){return e!==e.root&&e.scroll?.wasRoot}var $h=Eh({attachResizeListener:(e,t)=>ph(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),eg={current:void 0},tg=Eh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!eg.current){let e=new $h({});e.mount(window),e.setOptions({layoutScroll:!0}),eg.current=e}return eg.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),ng=(0,D.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function rg(e=!0){let t=(0,D.useContext)(ys);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,D.useId)();(0,D.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,D.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ig=(0,D.createContext)({strict:!1}),ag={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`]},og=!1;function sg(){if(og)return;let e={};for(let t in ag)e[t]={isEnabled:e=>ag[t].some(t=>!!e[t])};$p(e),og=!0}function cg(){return sg(),em()}function lg(e){let t=cg();for(let n in e)t[n]={...t[n],...e[n]};$p(t)}var ug=(0,D.createContext)({});function dg(e,t){if(Wp(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Vp(t)?t:void 0,animate:Vp(n)?n:void 0}}return e.inherit===!1?{}:t}function fg(e){let{initial:t,animate:n}=dg(e,(0,D.useContext)(ug));return(0,D.useMemo)(()=>({initial:t,animate:n}),[pg(t),pg(n)])}function pg(e){return Array.isArray(e)?e.join(` `):e}var mg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hg(e,t,n){for(let r in t)!B(t[r])&&!lm(r,n)&&(e[r]=t[r])}function gg({transformTemplate:e},t){return(0,D.useMemo)(()=>{let n=mg();return Ef(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _g(e,t){let n=e.style||{},r={};return hg(r,n,e),Object.assign(r,gg(e,t)),r}function vg(e,t){let n={},r=_g(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var yg=()=>({...mg(),attrs:{}});function bg(e,t,n,r){let i=(0,D.useMemo)(()=>{let n=yg();return jf(n,t,mm(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};hg(t,e.style,e),i.style={...t,...i.style}}return i}var xg=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Sg(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||xg.has(e)}function Cg(e,t){return e.startsWith(`on`)?!Sg(e):t?.(e)??!Sg(e)}function wg(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(B(e[a])||(Cg(a,r)||n===!0&&Sg(a)||!t&&!Sg(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Tg=[`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 Eg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Tg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Dg(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Eg(e)?bg:vg)(t,r,i,e),l=wg(t,typeof e==`string`,a,s),u=e===D.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,D.useMemo)(()=>B(d)?d.get():d,[d]);return(0,D.createElement)(e,{...u,children:f})}function Og({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:kg(n,r,i,e),renderState:t()}}function kg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=_h(a[e]);let{initial:o,animate:s}=e,c=Wp(e),l=Gp(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Bp(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Gd(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Ag=e=>(t,n)=>{let r=(0,D.useContext)(ug),i=(0,D.useContext)(ys),a=()=>Og(e,t,r,i);return n?a():_s(a)},jg=Ag({scrapeMotionValuesFromProps:um,createRenderState:mg}),Mg=Ag({scrapeMotionValuesFromProps:gm,createRenderState:yg}),Ng=Symbol.for(`motionComponentSymbol`);function Pg(e,t,n){let r=(0,D.useRef)(n);(0,D.useInsertionEffect)(()=>{r.current=n});let i=(0,D.useRef)(null);return(0,D.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Fg=(0,D.createContext)({});function Ig(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Lg(e,t,n,r,i,a){let{visualElement:o}=(0,D.useContext)(ug),s=(0,D.useContext)(ig),c=(0,D.useContext)(ys),l=(0,D.useContext)(ng),u=l.reducedMotion,d=l.skipAnimations,f=(0,D.useRef)(null),p=(0,D.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,D.useContext)(Fg);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Rg(f.current,n,i,h);let g=(0,D.useRef)(!1);(0,D.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[tf],v=(0,D.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return vs(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,D.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Rg(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:zg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ig(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function zg(e){if(e)return e.options.allowProjection===!1?zg(e.parent):e.projection}function Bg(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&lg(r);let a=n?n===`svg`:Eg(e),o=a?Mg:jg;function s(n,s){let c,l={...(0,D.useContext)(ng),...n,layoutId:Vg(n)},{isStatic:u,isValidProp:d}=l,f=fg(n),p=o(n,u);if(!u&&typeof window<`u`){Hg(l,r);let t=Ug(l);c=t.MeasureLayout,f.visualElement=Lg(e,p,l,i,t.ProjectionNode,a)}return(0,A.jsxs)(ug.Provider,{value:f,children:[c&&f.visualElement?(0,A.jsx)(c,{visualElement:f.visualElement,...l}):null,Dg(e,n,Pg(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,D.forwardRef)(s);return c[Ng]=e,c}function Vg({layoutId:e}){let t=(0,D.useContext)(gs).id;return t&&e!==void 0?t+`-`+e:e}function Hg(e,t){(0,D.useContext)(ig).strict}function Ug(e){let{drag:t,layout:n}=cg();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Wg(e,t){if(typeof Proxy>`u`)return Bg;let n=new Map,r=(n,r)=>Bg(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Bg(a,void 0,e,t)),n.get(a))})}var Gg=(e,t)=>t.isSVG??Eg(e)?new _m(t):new fm(t,{allowProjection:e!==D.Fragment}),Kg=class extends rm{constructor(e){super(e),e.animationState||=wm(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Bp(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},qg=0,Jg={animation:{Feature:Kg},exit:{Feature:class extends rm{constructor(){super(...arguments),this.id=qg++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Kd(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Yg(e){return{point:{x:e.pageX,y:e.pageY}}}var Xg=e=>t=>cp(t)&&e(t,Yg(t));function Zg(e,t,n,r){return ph(e,t,Xg(n),r)}var Qg=({current:e})=>e?e.ownerDocument.defaultView:null,$g=(e,t)=>Math.abs(e-t);function e_(e,t){let n=$g(e.x,t.x),r=$g(e.y,t.y);return Math.sqrt(n**2+r**2)}var t_=new Set([`auto`,`scroll`]),n_=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=r_(this.lastRawMoveEventInfo,this.transformPagePoint));let e=a_(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=e_(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=P;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=r_(t,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=a_(e.type===`pointercancel`?this.lastMoveEventInfo:r_(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!cp(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=r_(Yg(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=P;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,a_(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=js(Zg(this.contextWindow,`pointermove`,this.handlePointerMove,d),Zg(this.contextWindow,`pointerup`,this.handlePointerUp,d),Zg(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(t_.has(e.overflowX)||t_.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),N.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),lc(this.updatePoint)}};function r_(e,t){return t?{point:t(e.point)}:e}function i_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function a_({point:e},t){return{point:e,delta:i_(e,s_(t)),offset:i_(e,o_(t)),velocity:c_(t,.1)}}function o_(e){return e[0]}function s_(e){return e[e.length-1]}function c_(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=s_(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ps(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ps(t)*2&&(r=e[1]);let a=Fs(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function l_(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?R(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?R(n,e,r.max):Math.min(e,n)),e}function u_(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function d_(e,{top:t,left:n,bottom:r,right:i}){return{x:u_(e.x,n,i),y:u_(e.y,t,r)}}function f_(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 p_(e,t){return{x:f_(e.x,t.x),y:f_(e.y,t.y)}}function m_(e,t){let n=.5,r=H(e),i=H(t);return i>r?n=Ms(t.min,t.max-r,e.min):r>i&&(n=Ms(e.min,e.max-i,t.min)),Ss(0,1,n)}function h_(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var g_=.35;function __(e=g_){return e===!1?e=0:e===!0&&(e=g_),{x:v_(e,`left`,`right`),y:v_(e,`top`,`bottom`)}}function v_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e==`number`?e:e[t]||0}var b_=new WeakMap,x_=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=V(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Yg(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rp(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nh(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Fc.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=H(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&N.update(()=>i(e,t),!1,!0),$d(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=T_(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&N.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new n_(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Qg(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&N.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!w_(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=l_(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Ig(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?d_(n.layoutBox,e):!1,this.elastic=__(t),r!==this.constraints&&!Ig(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&nh(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=h_(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ig(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Qf(n,r.root,this.visualElement.getTransformPagePoint()),a=p_(r.layout.layoutBox,i);if(t){let e=t(Nf(a));this.hasMutatedConstraints=!!e,e&&(a=Mf(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=nh(o=>{if(!w_(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return $d(this.visualElement,e),n.start(Bd(e,n,0,t,this.visualElement,!1))}stopAnimation(){nh(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){nh(t=>{let{drag:n}=this.getProps();if(!w_(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-R(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Ig(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};nh(e=>{let t=this.getAxisMotionValue(e).get();i[e]=m_({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),nh(t=>{let n=this.getAxisMotionValue(t);if(!w_(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(R(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;b_.set(this.visualElement,this);let e=this.visualElement.current,t=Zg(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&fp(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Ig(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=C_(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),N.read(r);let o=ph(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nh(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=g_,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function S_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function C_(e,t,n){let r=Np(e,S_(n)),i=Np(t,S_(n));return()=>{r(),i()}}function w_(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function T_(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var E_=class extends rm{constructor(e){super(e),this.removeGroupControls=As,this.removeListeners=As,this.controls=new x_(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||As}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},D_=e=>(t,n)=>{e&&N.update(()=>e(t,n),!1,!0)},O_=class extends rm{constructor(){super(...arguments),this.removePointerDownListener=As}onPointerDown(e){this.session=new n_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qg(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:D_(e),onStart:D_(t),onMove:D_(n),onEnd:(e,t)=>{delete this.session,r&&N.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Zg(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},k_=!1,A_=class extends D.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),k_&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),k_=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||N.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),$f.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;k_=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function j_(e){let[t,n]=rg(),r=(0,D.useContext)(gs);return(0,A.jsx)(A_,{...e,layoutGroup:r,switchLayoutGroup:(0,D.useContext)(Fg),isPresent:t,safeToRemove:n})}var M_={pan:{Feature:O_},drag:{Feature:E_,ProjectionNode:tg,MeasureLayout:j_}};function N_(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&N.postRender(()=>i(t,Yg(t)))}var P_=class extends rm{mount(){let{current:e}=this.node;e&&(this.unmount=op(e,(e,t)=>(N_(this.node,t,`Start`),e=>N_(this.node,e,`End`))))}unmount(){}},F_=class extends rm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=js(ph(this.node.current,`focus`,()=>this.onFocus()),ph(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function I_(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&N.postRender(()=>i(t,Yg(t)))}var L_=class extends rm{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=yp(e,(e,t)=>(I_(this.node,t,`Start`),(e,{success:t})=>I_(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},R_=new WeakMap,z_=new WeakMap,B_=e=>{let t=R_.get(e.target);t&&t(e)},V_=e=>{e.forEach(B_)};function H_({root:e,...t}){let n=e||document;z_.has(n)||z_.set(n,{});let r=z_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(V_,{root:e,...t})),r[i]}function U_(e,t,n){let r=H_(t);return R_.set(e,n),r.observe(e),()=>{R_.delete(e),r.unobserve(e)}}var W_={some:0,all:1},G_=class extends rm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:W_[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=U_(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(K_(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function K_({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var q_={inView:{Feature:G_},tap:{Feature:L_},focus:{Feature:F_},hover:{Feature:P_}},J_={layout:{ProjectionNode:tg,MeasureLayout:j_}},Y_=Wg({...Jg,...q_,...M_,...J_},Gg);function X_(){!Jp.current&&Xp();let[e]=(0,D.useState)(qp.current);return e}var Z_=Y_,Q_=[1,.78,.54,.32,.16],$_=36;function ev({className:e}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 20 28`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,A.jsx)(`circle`,{cx:`4`,cy:`4`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`10`,cy:`9`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`16`,cy:`14`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`10`,cy:`19`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`4`,cy:`24`,r:`2`,fill:`currentColor`})]})}var tv=(0,D.forwardRef)(function({children:e,className:t,accentClassName:n,labelClassName:r,expand:i=!0,disabled:a,onMouseEnter:o,onMouseLeave:s,onFocus:c,onBlur:l,...u},d){let p=X_(),m=hs(),[h,g]=(0,D.useState)(!1),[_,v]=(0,D.useState)(!1),y=!!(i&&!a&&(m&&h||_)),b=p?{duration:0}:ms;return(0,A.jsxs)(Z_.button,{ref:d,type:`button`,disabled:a,onMouseEnter:e=>{g(!0),o?.(e)},onMouseLeave:e=>{g(!1),s?.(e)},onFocus:e=>{v(!0),c?.(e)},onBlur:e=>{v(!1),l?.(e)},whileTap:p||a?void 0:{scale:.98},transition:ds,className:f(`relative inline-flex h-11 w-full items-center overflow-hidden rounded-none bg-primary p-1 text-primary-foreground select-none`,`outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,`disabled:pointer-events-none disabled:opacity-50`,t),...u,children:[i?(0,A.jsxs)(Z_.span,{layout:`size`,"aria-hidden":!0,transition:b,style:{width:y?`calc(100% - 8px)`:$_,borderRadius:0},className:f(`absolute inset-y-1 left-1 z-10 overflow-hidden bg-background text-foreground`,n),children:[(0,A.jsx)(Z_.span,{animate:{opacity:+!y},transition:{duration:p?0:.1,ease:us},className:`absolute inset-0 grid place-items-center`,children:(0,A.jsx)(ev,{className:`h-5 w-3.5`})}),(0,A.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-around px-3`,children:Q_.map((e,t)=>(0,A.jsx)(Z_.span,{animate:{opacity:y?e:0,transform:y&&!p?`translateX(0px)`:`translateX(-6px)`},transition:{duration:p?0:.18,delay:y&&!p?.04+t*.025:0,ease:us},className:`inline-grid place-items-center`,children:(0,A.jsx)(ev,{className:`h-5 w-3.5`})},e))})]}):null,(0,A.jsx)(Z_.span,{animate:{opacity:+!y,transform:y&&!p?`translateX(6px)`:`translateX(0px)`},transition:{duration:p?0:.12,ease:us},className:f(`relative z-0 flex w-full items-center justify-center text-sm font-medium text-primary-foreground`,i&&`pr-3 pl-11`,r),children:e})]})});function nv({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`skeleton`,className:f(`animate-pulse rounded-md bg-muted`,e),...t})}var rv=`flex w-full flex-col rounded-none border border-border bg-card text-card-foreground`,iv=`gap-0 border-t border-border/60`,av=`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 gap-y-1 border-b border-border/60 px-5 py-3.5 last:border-b-0 data-[invalid=true]:border-destructive`,ov=`h-8 rounded-none border-0 bg-transparent px-0 text-sm shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent autofill:bg-transparent autofill:shadow-none`,sv=`col-start-2 min-w-0`,cv=`text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase group-focus-within/field:text-foreground`;function lv(e){return e.pending?`loading`:e.success?`success`:e.error?`error`:`idle`}function uv({state:e=`idle`,children:t,loadingText:n=`Loading`,successText:r=`Done`,errorText:i=`Try again`,disabled:o,...s}){let c=e===`loading`,l=e===`loading`?n:e===`success`?r:e===`error`?i:t,u=e===`loading`?Qo:e===`success`?ee:e===`error`?be:null;return(0,A.jsx)(tv,{disabled:o||c,expand:e===`idle`,"aria-busy":c||void 0,"data-slot":`auth-submit`,...s,children:(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u?(0,A.jsx)(a,{icon:u,size:16,color:`currentColor`,strokeWidth:1.5,className:e===`loading`?`animate-spin`:void 0,"aria-hidden":!0}):null,l]})})}var dv={neutral:`bg-foreground/35`,open:`bg-foreground`,alert:`bg-destructive`};function fv({label:e,tone:t=`neutral`}){return(0,A.jsxs)(`p`,{className:f(cv,`flex h-10 shrink-0 items-center gap-1.5 border-b border-border/60 px-5 group-focus-within/field:text-muted-foreground`),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(`size-1.5 rounded-[1px]`,dv[t])}),e]})}var pv=`pointer-events-none absolute size-3 border-foreground/50`;function mv(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-top-1.5 -left-1.5 border-t border-l`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-top-1.5 -right-1.5 border-t border-r`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-bottom-1.5 -left-1.5 border-b border-l`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-right-1.5 -bottom-1.5 border-r border-b`)})]})}function hv({title:e,description:t,status:n,children:r,footer:i,className:a}){let o=(0,D.useId)(),s=`auth-title-${o}`,c=t?`auth-desc-${o}`:void 0,l=X_()??!1;return(0,A.jsxs)(Z_.div,{"data-slot":`auth-card`,initial:!l&&{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:l?0:.42,ease:us},className:f(`relative flex w-full flex-col gap-4`,a),children:[(0,A.jsx)(mv,{}),(0,A.jsxs)(`div`,{"data-auth-layer":`0`,className:rv,children:[n?(0,A.jsx)(fv,{...n}):null,(0,A.jsxs)(`header`,{"data-auth-layer":`1`,className:f(`flex flex-col gap-3 px-5`,n?`pt-7`:`pt-6`),children:[(0,A.jsx)(`h1`,{id:s,className:`text-[1.75rem] leading-none font-semibold tracking-[-0.03em] text-foreground`,children:e}),t?(0,A.jsx)(`p`,{id:c,className:`text-[13px] leading-snug text-muted-foreground`,children:t}):null]}),(0,A.jsx)(`div`,{className:`mt-7 flex flex-col pb-1`,children:typeof r==`function`?r({titleId:s,descriptionId:c}):r})]}),i?(0,A.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:i}):null]})}function gv(){return(0,A.jsxs)(`div`,{"data-slot":`auth-card`,className:`relative flex w-full flex-col gap-4`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:`Checking setup…`}),(0,A.jsx)(mv,{}),(0,A.jsxs)(`div`,{"data-auth-layer":`0`,className:rv,children:[(0,A.jsx)(`div`,{className:`flex h-10 shrink-0 items-center border-b border-border/60 px-5`,children:(0,A.jsx)(nv,{className:`h-3 w-24 rounded-none`})}),(0,A.jsxs)(`header`,{"data-auth-layer":`1`,className:`flex flex-col gap-3 px-5 pt-7`,children:[(0,A.jsx)(nv,{className:`h-7 w-36 rounded-none`}),(0,A.jsx)(nv,{className:`h-4 w-full rounded-none`})]}),(0,A.jsx)(`div`,{className:`mt-7 flex flex-col border-t border-border/60 pb-1`,children:Array.from({length:2},(e,t)=>(0,A.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 border-b border-border/60 px-5 py-3.5 last:border-b-0`,children:[(0,A.jsx)(nv,{className:`h-3 w-14 rounded-none`}),(0,A.jsx)(nv,{className:`h-8 w-full rounded-none`})]},t))})]}),(0,A.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:(0,A.jsx)(nv,{className:`h-11 w-full rounded-none`})})]})}var _v=(0,D.createContext)({theme:`system`,setTheme:()=>null});function vv({children:e,defaultTheme:t=`system`,storageKey:n=`oke-console-theme`,...r}){let[i,a]=(0,D.useState)(()=>localStorage.getItem(n)||t);(0,D.useEffect)(()=>{let e=window.document.documentElement,t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let n=i===`system`?t.matches?`dark`:`light`:i;e.classList.remove(`light`,`dark`),e.classList.add(n)};if(n(),i===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[i]);let o={theme:i,setTheme:e=>{localStorage.setItem(n,e),a(e)}};return(0,A.jsx)(_v.Provider,{...r,value:o,children:e})}function yv(){let e=(0,D.useContext)(_v);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}var bv=[{value:`light`,label:`Light`,icon:os},{value:`dark`,label:`Dark`,icon:es},{value:`system`,label:`System`,icon:Xo}];function xv(){let{theme:e,setTheme:t}=yv();return(0,A.jsx)(`div`,{role:`group`,"aria-label":`Theme`,"data-slot":`mode-toggle`,className:`flex h-10 items-stretch`,children:bv.map(n=>{let r=e===n.value;return(0,A.jsxs)(l,{disabled:r,children:[(0,A.jsx)(p,{render:e=>(0,A.jsxs)(`button`,{...e,type:`button`,"aria-label":n.label,"aria-pressed":r,onClick:r=>{e.onClick?.(r),t(n.value)},className:f(je,`font-semibold tracking-[0.08em] uppercase`,r?Ge:bt,e.className),children:[(0,A.jsx)(a,{icon:n.icon,className:`size-3`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?n.label:null]})}),(0,A.jsx)(u,{side:`top`,sideOffset:6,children:n.label})]},n.value)})})}function Sv({className:e,...t}){return(0,A.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 327 87`,fill:`none`,role:`img`,"aria-label":`OKE`,className:f(`text-foreground`,e),...t,children:[(0,A.jsx)(`path`,{d:`M231.08 84.672V0H320.648V13.824H250.088V33.696H303.944V47.952H250.088V70.848H321.224L326.984 83.088C326.984 83.472 325.688 83.856 323.096 84.24C320.504 84.528 316.04 84.672 309.704 84.672H231.08Z`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M136.638 13.672V36.864H144.702C146.622 36.864 148.206 36.624 149.454 36.144C150.702 35.664 151.854 34.896 152.91 33.84C155.598 31.152 158.67 27.792 162.126 23.76C165.582 19.728 168.942 15.6 172.206 11.376C175.566 7.05599 178.446 3.264 180.846 0H204.174L198.27 8.64C195.582 11.424 192.702 14.448 189.63 17.712C186.558 20.976 183.534 24.192 180.558 27.36C177.582 30.432 174.894 33.168 172.494 35.568C170.094 37.872 168.318 39.552 167.166 40.608C169.758 41.472 172.11 42.576 174.222 43.92C176.43 45.264 179.118 47.232 182.286 49.824C184.686 51.744 186.99 53.712 189.198 55.728C191.502 57.744 194.142 60.144 197.118 62.928C200.478 66 203.646 68.256 206.622 69.696C209.598 71.136 212.094 72.048 214.11 72.432C216.222 72.816 217.566 73.008 218.142 73.008L215.262 84.672C214.974 84.96 214.11 85.248 212.67 85.536C211.23 85.92 209.166 86.112 206.478 86.112C201.774 86.112 197.694 85.152 194.238 83.232C190.782 81.312 187.374 78.72 184.014 75.456C180.366 71.616 175.95 67.2 170.766 62.208C168.366 59.712 165.918 57.648 163.422 56.016C160.926 54.384 158.094 53.136 154.926 52.272C151.854 51.408 148.014 50.976 143.406 50.976H136.638V70.672H117.63V13.672H136.638Z`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})]})}function Cv({className:e,...t}){return(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 95 85`,fill:`none`,role:`img`,"aria-label":`OKE`,className:f(`text-foreground`,e),...t,children:(0,A.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})})}function wv({children:e}){return(0,A.jsxs)(`div`,{className:`flex min-h-dvh w-full flex-col bg-background`,"data-slot":`console-chrome`,children:[(0,A.jsx)(`main`,{className:`mx-auto flex w-full max-w-md flex-1 flex-col justify-center px-4 py-10`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-stretch gap-10`,children:[(0,A.jsx)(Sv,{className:`h-7 w-auto self-center`}),e]})}),(0,A.jsxs)(`footer`,{className:`grid h-10 shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-stretch border-t border-border/60`,children:[(0,A.jsx)(`p`,{className:`flex min-w-0 items-center truncate px-2 text-[10px] font-medium text-muted-foreground`,children:`OKE | Console`}),(0,A.jsx)(xv,{}),(0,A.jsxs)(`p`,{className:`${nt} flex min-w-0 items-center justify-end gap-1.5 px-2`,children:[(0,A.jsx)(a,{icon:Zo,size:12,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),(0,A.jsxs)(`span`,{children:[`v`,`0.23.1`]})]})]})]})}function Tv(){return(0,A.jsx)(wv,{children:(0,A.jsxs)(`div`,{"data-slot":`not-found`,children:[(0,A.jsx)(`p`,{className:cv,children:`404`}),(0,A.jsx)(`h1`,{className:`mt-3 text-2xl font-semibold tracking-tight`,children:`Page not found`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`This URL is not a Console page.`})]})})}var Ev=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Dv(e,t){return new Ev(e,t).maybeExecute}var Ov=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},kv=new class extends Ov{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Av(e,t){return typeof e==`function`?e(t):e}function jv(e,t){return zv(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function Mv(e,t,n){let r=zv(t);function i(e){if(!r.length)return Av(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Nv(e,t){let n=zv(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Pv=46,Fv=91,Iv=93,Lv=48,Rv=57;function zv(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===Fv),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===Pv||s===Fv||s===Iv){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==Lv),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==Iv&&(a!==-1||s!==Iv)&&(a!==s||s!==Pv&&s!==Fv)&&n.push(``);r=o+1,i=!0}else(s<Lv||s>Rv)&&(i=!1);a=s}return n.length||n.push(``),n}function Bv(e){return!(Array.isArray(e)&&e.length===0)}function Vv(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Hv(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Uv=e=>!!e&&typeof e==`object`&&`fields`in e;function Wv(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Wv(e[i],t[i]))return!1;return!0}var Gv=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Kv=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function U(e,t){return e==null?t:{...e,...t}}for(var qv=256,Jv=[],Yv;qv--;)Jv[qv]=(qv+256).toString(16).substring(1);function Xv(){let e=0,t,n=``;if(!Yv||qv+16>256){for(Yv=Array(256),e=256;e--;)Yv[e]=256*Math.random()|0;e=0,qv=0}for(;e<16;e++)t=Yv[qv+e],n+=e===6?Jv[t&15|64]:e===8?Jv[t&63|128]:Jv[t],e&1&&e>1&&e<11&&(n+=`-`);return qv++,n}var Zv=Dv(e=>kv.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function Qv(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=Qv(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,Qv(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(Qv(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Qv(e[n]));return t}function $v(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var ey=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function ty(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var ny=(e,t)=>{let n=ty(e,t);return{form:n,fields:n}},ry={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:ny(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:ny(r.issues,e)}},iy=e=>!!e&&`~standard`in e,W={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function ay(e){function t(t){let n=e.getFieldMeta(t)??W;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>W;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function oy(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var sy=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Zv(this)}),t=kv.on(`request-form-state`,e=>{e.payload.id===this._formId&&kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=kv.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=kv.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),kv.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Wv(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Wv(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(j(()=>{this.baseStore.setState(()=>oy(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=ay(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=Mv(t,e.instance.name,e.instance.options.defaultValue))}),oy({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return j(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return j(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Vv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||ey}),r=!1,i={};return j(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=cy(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=ly(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=a?.[e],{newErrorValue:s,newSource:c}=Gv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=ly(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=ly(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=Hv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||ey});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=ly(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=cy(r);s&&(i=i?{...i,...s}:s);let c=ly(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=i?.[e],{newErrorValue:a,newSource:o}=Gv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),j(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}j(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),j(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>jv(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:Av(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=W,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;j(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:Mv(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Nv(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),ay(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],U(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),ay(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),U(r,{dontValidate:!0})),ay(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),U(n,{dontValidate:!0})),ay(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return Mv(Mv(e,`${t}`,i),`${n}`,r)},U(r,{dontValidate:!0})),ay(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},U(r,{dontValidate:!0})),ay(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],U(t,{dontValidate:!0})),ay(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=jv(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:W},values:i===void 0?t.values:Mv(t.values,e,i)}})},this.setErrorMap=e=>{j(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Uv(t)){let{formError:e,fieldErrors:r}=cy(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>ry.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>ry.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Xv(),this._devtoolsSubmissionOverride=!1;let t=oy({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Uv(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=Ii(t);let n;this.fieldMetaDerived=Ii(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=jv(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!Bv(u),f=!o.isDirty,p=Wv(l,this.getFieldInfo(a)?.instance?.options.defaultValue??jv(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=Ii(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!$v(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&$v(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let ee={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(ee,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=ee}return r});let r;this.store=Ii(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Uv(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Wv(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return iy(e.validate)?ry[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function cy(e){return e?Uv(e)?{formError:cy(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function ly(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var uy=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...W,isTouched:e.fieldMetaBase[this.name]?.isTouched??W.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??W.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??W.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Wv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,U(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Vv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||ey}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Vv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;j(()=>{let e=(e,n)=>{let r=fy(n.cause),a=n.validate?dy(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Kv({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=fy(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Hv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||ey}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=Hv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));j(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=fy(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=dy(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Kv({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),j(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[fy(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[fy(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>ry.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>ry.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)$v(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=Ii(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...W,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return iy(e.validate)?ry[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function dy(e){if(e)return e}function fy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function py(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function my(e){return{...W,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var hy=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??py({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Wv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...W,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??py({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;_y(t)&&(n=t.group,r=t.fields);let i=gy(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:py({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof uy&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&$v(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Gv({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=W)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Vv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||ey}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Vv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;j(()=>{let t=(t,r)=>{let i=yy(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&_y(s)&&(c=s.group,l=s.fields);let u=gy(c),d=n[i],{newErrorValue:f,newSource:p}=Kv({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=yy(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=Hv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||ey}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=Hv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=yy(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&_y(o)&&(l=o.group,u=o.fields);let d=gy(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Kv({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return j(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[yy(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),j(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}j(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),j(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=Ii(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??my(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(iy(e.validate)){let t=ry[e.type](e.value,e.validate);return e.type===`validate`?vy(t):t.then(vy)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function gy(e){if(e)return e}function _y(e){return!!e&&typeof e==`object`&&`fields`in e}function vy(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function yy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function by(e,t){if(!t)return;let n=Object.assign({},e,{state:Qv(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return j(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var xy=typeof window<`u`?D.useLayoutEffect:D.useEffect;function Sy(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new uy({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new uy({...e}),i(a),n({form:e.form,name:e.name}));let o=E(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=E(a.store,e=>e.meta.isTouched),c=E(a.store,e=>e.meta.isBlurred),l=E(a.store,e=>e.meta.isDirty),u=E(a.store,e=>e.meta.errorMap),d=E(a.store,e=>e.meta.errorSourceMap),f=E(a.store,e=>e.meta.isValidating),p=(0,D.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return xy(a.mount,[a]),xy(()=>{a.update(e)}),p}var Cy=(({children:e,...t})=>{let n=Sy(t),r=(0,D.useMemo)(()=>Av(e,n),[e,n]);return(0,A.jsx)(A.Fragment,{children:r})});function wy(){return(0,D.useState)(()=>Xv())[0]}var Ty=D,Ey=`19.3.0`.split(`.`)[0]===`17`?wy:Ty.useId;function Dy(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new hy({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new hy({...e})),n({form:e.form,name:e.name}));let a=E(r.store,e=>e.value),o=E(r.store,e=>e.meta.isTouched),s=E(r.store,e=>e.meta.isBlurred),c=E(r.store,e=>e.meta.isDirty),l=E(r.store,e=>e.meta.errorMap),u=E(r.store,e=>e.meta.errorSourceMap),d=E(r.store,e=>e.meta.isValidating),f=E(r.store,e=>e.meta.isSubmitting),p=E(r.store,e=>e.meta.isSubmitted),m=E(r.store,e=>e.meta.submissionAttempts),h=E(r.store,e=>e.meta.isSubmitSuccessful),g=E(r.store,e=>e.meta.canSubmit),_=E(r.store,e=>e.meta.isValid),v=E(r.store,e=>e.meta.isFieldsValid),y=E(r.store,e=>e.meta.isFieldsValidating),b=E(r.store,e=>e.meta.isGroupValid),x=(0,D.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return xy(r.mount,[r]),xy(()=>{r.update(e)}),x}var Oy=(({children:e,...t})=>{let n=Dy(t),r=(0,D.useMemo)(()=>Av(e,n),[e,n]);return(0,A.jsx)(A.Fragment,{children:r})});function ky({form:e,selector:t=e=>e,children:n}){let r=E(e.store,t);return(0,A.jsx)(A.Fragment,{children:Av(n,r)})}function Ay(e){let t=Ey(),[n,r]=(0,D.useState)(e?.formId),[i,a]=(0,D.useState)(()=>new sy({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new sy({...e,formId:n})),r(n)}let o=(0,D.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,A.jsx)(Cy,{...e,form:i})},e.FormGroup=function(e){return(0,A.jsx)(Oy,{...e,form:i})},e.Subscribe=function(e){return(0,A.jsx)(ky,{form:i,selector:e.selector,children:e.children})},e},[i]);xy(i.mount,[]),xy(()=>{i.update(e)});let s=(0,D.useRef)(!1);return xy(()=>{s.current&&e?.transform&&by(i,e.transform)},[i,e?.transform]),xy(()=>{s.current=!0}),o}function jy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function My(e,t=`|`){return e.map(e=>nb(e)).join(t)}function Ny(e,t){return typeof t==`bigint`?t.toString():t}var Py=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Fy(e){return new Py(e)}function Iy(e){return e==null}function Ly(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ry(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zy(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function By(e){return zy(e._zod.def)??e._zod.def.shape}function Vy(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ry(this,t,e),e},enumerable:!0,configurable:!0})}function Hy(e,t,n){t in e?Ry(e,t,n):e[t]=n}function Uy(e,t,n,r){let i=By(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Vy(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Hy(e,a,r?r(n.value,a):n.value))}}function Wy(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Vy(e,n,()=>t[n]):Hy(e,n,r.value))}}function Gy(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ky(e){return JSON.stringify(e)}function qy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Jy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Yy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Xy=Fy(()=>{if(Wb.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Zy(e){if(Yy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Yy(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Qy(e){return Zy(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var $y=new Set([`string`,`number`,`symbol`]);function eb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function tb(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 nb(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function rb(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ib={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ab={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ob(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Uy(i,e,sb(e,t)),tb(e,Gy(n,{shape:i,checks:[]}))}function sb(e,t){let n=By(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function cb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(sb(e,t)),a={};return Uy(a,e,Reflect.ownKeys(By(e)).filter(e=>!i.has(e))),tb(e,Gy(n,{shape:a,checks:[]}))}function lb(e,t){if(!Zy(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=By(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return tb(e,Gy(e._zod.def,{shape:ub(e,t)}))}function ub(e,t){let n={};return Uy(n,e,Reflect.ownKeys(By(e))),Wy(n,t),n}function db(e,t){if(!Zy(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return tb(e,Gy(e._zod.def,{shape:ub(e,t)}))}function fb(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Uy(n,e,Reflect.ownKeys(By(e))),Uy(n,t,Reflect.ownKeys(By(t))),tb(e,Gy(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function pb(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(sb(t,n)):void 0,o={};return Uy(o,t,Reflect.ownKeys(By(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),tb(t,Gy(t._zod.def,{shape:o,checks:[]}))}function mb(e,t,n){let r=n?new Set(sb(t,n)):void 0,i={};return Uy(i,t,Reflect.ownKeys(By(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),tb(t,Gy(t._zod.def,{shape:i}))}function hb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function gb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function _b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function vb(e){return typeof e==`string`?e:e?.message}function yb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function bb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:vb(e.inst?._zod.def?.error?.(e))??vb(a?.(e))??vb(t?.error?.(e))??vb(n.customError?.(e))??vb(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var xb=/[\uD800-\uDBFF]/;function Sb(e){let t=e.length;if(!xb.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Cb(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wb(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Tb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Eb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ab(e,n,r.value)}}function Db(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ob(e,t,n){return Db(e,t,n,!1)}function kb(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Db(this,n,r(this))},set(e){Db(this,n,e)}})}return t}function Ab(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Db(this,t,n.bind(this))},set(e){Db(this,t,e)}})}function jb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Mb,Nb=!1,Pb={configurable:!0,get(){Nb=!0}};function K(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Mb!==e._zod){Mb=void 0;return}Mb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Pb);let e=Nb;Nb=!1;try{let r=n(this);return Nb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Nb||=e,r}catch(n){throw delete this[t],Nb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Fb(e,t,n,r){let i=jb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ib=`~constantCatch`;function Lb(e){let t=()=>e;return t[Ib]=!0,t}var Rb,zb={value:void 0,enumerable:!1},Bb=`captureStackTrace`in Error?Error:null;function Vb(e){let t=Bb;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Bb=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function q(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){zb.value=new a(r);try{Object.defineProperty(n,"_zod",zb)}finally{zb.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Eb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Vb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Hb=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ub=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Rb=globalThis).__zod_globalConfig??(Rb.__zod_globalConfig={});var Wb=globalThis.__zod_globalConfig;function Gb(e){return e&&Object.assign(Wb,e),Wb}function Kb(){let e=this._zod;return e.message??=JSON.stringify(e.def,Ny,2),e.message}function qb(e){this._zod.message=e}var Jb={get:Kb,set:qb,enumerable:!0,configurable:!0},Yb={value:void 0,enumerable:!1},Xb=new WeakSet([Object.prototype,Error.prototype]),Zb=(e,t)=>{e.name=`$ZodError`,Yb.value=t,Object.defineProperty(e,"issues",Yb),Yb.value=void 0,Object.defineProperty(e,"message",Jb);let n=Object.getPrototypeOf(e);Xb.has(n)||(Xb.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Qb=q(`$ZodError`,Zb);q(`$ZodError`,Zb,void 0,{Parent:Error});function $b(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ex(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?$b(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function tx(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function nx(e,t){return{callee:t?.callee??e,Err:t?.Err}}var rx=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Hb;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>bb(e,o,Gb())));throw Jy(n,a?.callee??t),n}return s.value};return t},ix=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>bb(e,o,Gb())));throw Jy(n,a?.callee??t),n}return s.value};return t},ax=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Hb;return a.issues.length?ox(e,a.issues,i):{success:!0,data:a.value}};function ox(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>bb(e,n,Gb()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var sx=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?ox(e,a.issues,i):{success:!0,data:a.value}},cx=Symbol.for(`zod.compile.invalid`),lx=Symbol.for(`zod.compile.fallback`),ux=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==cx)return!0;if(r.definite===!0&&n===void 0)return!1}return dx(e,t,n)});function dx(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[lx]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Hb;return a.issues.length===0}var fx=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},px=e=>{let t=rx(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,nx(n,a))};return n},mx=e=>{let t=rx(e),n=(e,r,i,a)=>t(e,r,i,nx(n,a));return n},hx=e=>{let t=ix(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,nx(n,a))};return n},gx=e=>{let t=ix(e),n=async(e,r,i,a)=>await t(e,r,i,nx(n,a));return n},_x=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ax(e)(t,n,i)},vx=e=>(t,n,r)=>ax(e)(t,n,r),yx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return sx(e)(t,n,i)},bx=e=>async(t,n,r)=>sx(e)(t,n,r),xx=/^[cC][0-9a-z]{6,}$/,Sx=/^[0-9a-z]+$/,Cx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wx=/^[0-9a-vA-V]{20}$/,Tx=/^[A-Za-z0-9]{27}$/,Ex=/^[a-zA-Z0-9_-]{21}$/;function Dx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ox=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kx=/^([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})$/,Ax=e=>e?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)$/,jx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nx(){return new RegExp(Mx,`u`)}var Px=/^(?:(?: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])$/,Fx=/^(([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}|:))$/,Ix=/^((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])$/,Lx=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Bx=/^https?$/,Vx=/^\+[1-9]\d{6,14}$/,Hx=`(?:(?:\\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])))`;function Ux(e){return RegExp(`^${e}$`)}var Wx=Ux(Hx);function Gx(e){let 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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kx(e){return RegExp(`^${Gx(e)}$`)}function qx(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gx({precision:e.precision})}`:n;return RegExp(`^${Hx}T(?:${r})$`)}var Jx=/^[\s\S]{0,}$/,Yx=/^[^A-Z]*$/,Xx=/^[^a-z]*$/,Zx=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qx=e=>{let t=e.value;return!Iy(t)&&t.length!==void 0},$x=q(`$ZodCheckMaxLength`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Sb(r):i)<=t.maximum)return;let a=Cb(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eS=q(`$ZodCheckMinLength`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Sb(r):i)>=t.minimum)return;let a=Cb(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tS=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Sb(r):i;if(a===t.length)return;let o=Cb(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nS=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Zx.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),rS=q(`$ZodCheckRegex`,(e,t)=>{nS.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})}}),iS=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yx,nS.init(e,t)}),aS=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xx,nS.init(e,t)}),oS=q(`$ZodCheckIncludes`,(e,t)=>{Zx.init(e,t);let n=eb(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),sS=q(`$ZodCheckStartsWith`,(e,t)=>{Zx.init(e,t);let n=RegExp(`^${eb(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),cS=q(`$ZodCheckEndsWith`,(e,t)=>{Zx.init(e,t);let n=RegExp(`.*${eb(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),lS=q(`$ZodCheckOverwrite`,(e,t)=>{Zx.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),uS=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
4
+ See https://nuqs.dev/NUQS-${e}`}function Na(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${Pa(r)}`)}return`?`+t.join(`&`)}function Pa(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var Fa=`2.10.1`,Ia={};function La(e,t){let n=Symbol.for(`nuqs.${Fa}.${e}`),r=globalThis;if(r[n]!=null)return r[n];let i=Object.isExtensible(r)?r:Ia;return i[n]??=t()}function Ra(e,t,n){let r=La(e,()=>new WeakMap);return r.has(t)||r.set(t,n()),r.get(t)}var za=Ra(`adapter-context`,D.createContext,()=>{let e=(0,D.createContext)({useAdapter(){throw Error(Ma(404))}});return e.displayName=`NuqsAdapterContext`,e});typeof window<`u`&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==za&&console.error(Ma(303)),window.__NuqsAdapterContext=za);function Ba(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...i})=>(0,D.createElement)(za.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function Va(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function Ha(e){return{method:`throttle`,timeMs:e}}var Ua=Ha(Va());function Wa(e,t,n){if(typeof n==`string`)e.set(t,n);else{e.delete(t);for(let r of n)e.append(t,r);e.has(t)||e.set(t,``)}return e}function Ga(){let e=new Map;return{on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){e.get(t)?.forEach(e=>e(n))}}}function Ka(e,t,n){function r(){e(),n.removeEventListener(`abort`,a)}let i=setTimeout(r,t);function a(){clearTimeout(i),n.removeEventListener(`abort`,a)}n.addEventListener(`abort`,a)}function qa(){let e=Promise;if(Promise.hasOwnProperty(`withResolvers`))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function Ja(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}function Ya(){return new URLSearchParams(location.search)}var Xa=class{updateMap=new Map;options={history:`replace`,scroll:!1,shallow:!0};timeMs=Ua.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=Ua.timeMs){this.resetQueueOnNextPush&&=(this.reset(),!1),M(7,e,t,n),this.updateMap.set(e,t),n.history===`push`&&(this.options.history=`push`),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Ya}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Ya,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return M(8),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=qa();let i=()=>{this.lastFlushedAt=performance.now();let[t,i]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);i===null?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null};return Ka(()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,r=t*Math.max(0,n-e);M(9,r,n,t),r===0?i():Ka(i,r,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return M(10,JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:`replace`,scroll:!1,shallow:!0},this.timeMs=Ua.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:r}=e,i=r();if(M(11,this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];let a=Array.from(this.updateMap.entries()),o={...this.options},s=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),M(12,a,o);for(let[e,t]of a)t===null?i.delete(e):i=Wa(i,e,t);if(t)try{i=t(i)}catch(e){return console.error(Ma(502),a.map(([e])=>e).join(),e),this.resetQueueOnNextPush=!0,[i,e]}try{return Ja(s,()=>n(i,o)),[i,null]}catch(e){return console.error(Ma(429),a.map(([e])=>e).join(),e),[i,e]}}},Za=La(`throttle-queue`,()=>new Xa),Qa=class{resolvers=qa();controller=new AbortController;queuedValue=void 0;abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t,n){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Ka(()=>{let t=this.resolvers;try{M(13,e);let r=n(e);M(14,this.queuedValue),this.queuedValue=void 0,this.resolvers=qa(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}},$a=class{throttleQueue;queues=new Map;queuedQuerySync=Ga();constructor(e=new Xa){this.throttleQueue=e}push(e,t,n,r){if(!Number.isFinite(t)){let e=n.getSearchParamsSnapshot??Ya;return Promise.resolve(e())}let i=e.key,a=this.queues.get(i);a||(M(15,i),a=new Qa,this.queues.set(i,a)),M(17,e);let o=a.push(e,t,()=>(this.throttleQueue.push(e),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(i)?.queuedValue===void 0&&(M(16,i),this.queues.delete(i)),this.queuedQuerySync.emit(i)})));return this.queuedQuerySync.emit(i),o}abort(e){let t=this.queues.get(e);return t?(M(18,e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())M(18,e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return t===void 0?this.throttleQueue.getQueuedQuery(e):t}},eo=La(`debounce-controller`,()=>new $a(Za));La(`queue-reset`,()=>({mutex:0}));function to(){M(19),eo.abortAll(),Za.abort().forEach(e=>eo.queuedQuerySync.emit(e))}function no(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of Array.from(e.keys()))t.includes(n)||r.delete(n);return r}function ro(e){return La(`history-emitter.${e}`,()=>Ga())}var io=`__nuqs__`,ao=ro(`react`);function oo(e){return function(t,n){let r=new URL(location.href);r.search=Na(t),M(20,`react`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,io,r),ao.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var so=(0,D.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function co(e){return ao.on(`update`,e),window.addEventListener(`popstate`,e),()=>{ao.off(`update`,e),window.removeEventListener(`popstate`,e)}}function lo(){return(0,D.useEffect)(()=>(window.addEventListener(`popstate`,to),()=>window.removeEventListener(`popstate`,to)),[]),null}function uo(e){let{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}=(0,D.useContext)(so),r=(0,D.useRef)(null);function i(t){let n=no(new URLSearchParams(t),e,!1),i=n.toString();return r.current?.key===i?r.current.search:(r.current={key:i,search:n},n)}return{searchParams:(0,D.useSyncExternalStore)(co,()=>i(location.search),()=>i(n??``)),updateUrl:(0,D.useMemo)(()=>oo(t),[t])}}var fo=Ba(uo);function po({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,serverSearch:n,...r}){return(0,D.createElement)(so.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}},(0,D.createElement)(fo,{...r,children:[(0,D.createElement)(lo,{key:`nuqs-adapter-queue-reset`}),e]}))}var mo=r();function ho(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0,r=e.follow===!1||e.follow===`false`?!1:void 0;return{...t===void 0?{}:{run:t},...n===void 0?{}:{flow:n},...r===void 0?{}:{follow:r}}}function go(){let e=Be({strict:!1}),t=de();return{selectedRunId:typeof e.run==`string`?e.run:null,selectedFlowId:typeof e.flow==`string`?e.flow:null,follow:e.follow!==!1,setSelectedRun:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,run:e??void 0}),replace:!0})},[t]),setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t]),setFollow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,follow:e?void 0:!1}),replace:!0})},[t])}}function _o(e){let t=typeof e.resource==`string`&&e.resource.length>0?e.resource:void 0,n=typeof e.tenant==`string`&&e.tenant.length>0?e.tenant:void 0,r=e.view===`query`||e.view===`schema`||e.view===`performance`?e.view:void 0,i=e.facet===`sql`||e.facet===`kv`?e.facet:void 0;return{...t===void 0?{}:{resource:t},...n===void 0?{}:{tenant:n},...r===void 0?{}:{view:r},...i===void 0?{}:{facet:i}}}function vo(){let e=Be({strict:!1}),t=de(),n=typeof e.resource==`string`?e.resource:null,r=typeof e.tenant==`string`?e.tenant:null,i=e.view===`query`&&(e.facet===`sql`||e.facet===`kv`)?e.facet:null,a=e.view===`schema`,o=e.view===`performance`,s=o?e.facet===`kv`?`kv`:`sql`:null,c=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,resource:e??void 0,...n?.keepView?{}:{view:void 0,facet:void 0}}),replace:!0})},[t]),l=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`query`:void 0,facet:e??void 0}),replace:!0})},[t]),u=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`schema`:void 0,facet:void 0}),replace:!0})},[t]),d=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,view:e?`performance`:void 0,facet:e&&n===`kv`?`kv`:void 0}),replace:!0})},[t]);return{selectedResource:n,selectedTenant:r,queryFacet:i,schemaView:a,performanceView:o,performanceFacet:s,setSelectedResource:c,setSelectedTenant:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,tenant:e??void 0}),replace:!0})},[t]),setQueryFacet:l,setSchemaView:u,setPerformanceView:d}}function yo(e){let t=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0;return{...t===void 0?{}:{flow:t}}}function bo(){let e=Be({strict:!1}),t=de();return{selectedFlowId:typeof e.flow==`string`?e.flow:null,setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t])}}var xo={"15m":9e5,"1h":36e5,"24h":864e5,"7d":6048e5};function So(e){return e===`15m`||e===`1h`||e===`24h`||e===`7d`?e:`1h`}function Co(e){return e.error!=null&&e.error.length>0}function wo(e,t){return e.length===0?0:e.length===1?e[0]:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]}function To(e,t,n){let r=t-Math.max(0,n);return e.filter(e=>e.startedAt>=r&&e.startedAt<=t)}function Eo(e,t,n){let r=To(e,t,n);if(r.length===0)return{kind:`empty`};let i=r.map(e=>e.durationMs).sort((e,t)=>e-t),a=r.filter(Co).length,o=r.length;return{kind:`summary`,total:o,errors:a,errorRate:a/o,p50Ms:wo(i,.5),p95Ms:wo(i,.95),p99Ms:wo(i,.99),from:t-Math.max(0,n),to:t,windowMs:n}}function Do(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=So(e.window),r=typeof e.error==`string`&&e.error.length>0?e.error:void 0,i=typeof e.q==`string`&&e.q.length>0?e.q:void 0,a=e.view===`query`||e.view===`ai`?e.view:void 0,o=typeof e.agentRun==`string`&&e.agentRun.length>0?e.agentRun:void 0;return{...t===void 0?{}:{run:t},...n===`1h`?{}:{window:n},...r===void 0?{}:{error:r},...i===void 0?{}:{q:i},...a===void 0?{}:{view:a},...o===void 0?{}:{agentRun:o}}}function Oo(){let e=Be({strict:!1}),t=de(),n=typeof e.run==`string`?e.run:null,r=So(e.window),i=typeof e.error==`string`?e.error:null,a=typeof e.q==`string`?e.q:``,o=e.view===`query`||e.view===`ai`?e.view:`metrics`,s=typeof e.agentRun==`string`?e.agentRun:null,c=(0,D.useCallback)(e=>{t({to:`.`,search:t=>Do({...t,...e}),replace:!0})},[t]);return{selectedRunId:n,window:r,selectedErrorKey:i,query:a,view:o,agentRunId:s,setSelectedRun:(0,D.useCallback)(e=>{c({run:e??void 0})},[c]),setWindow:(0,D.useCallback)(e=>{c({window:e})},[c]),setSelectedError:(0,D.useCallback)((e,t)=>{c({error:e??void 0,...t===void 0?{}:{run:t??void 0}})},[c]),setQuery:(0,D.useCallback)(e=>{c({q:e.length>0?e:void 0})},[c]),setView:(0,D.useCallback)(e=>{c({view:e===`metrics`?void 0:e})},[c]),setAgentRun:(0,D.useCallback)(e=>{c({agentRun:e??void 0,view:`ai`})},[c])}}function ko(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.name==`string`&&e.name.length>0?e.name:void 0,r=e.action===`set`||e.action===`rotate`||e.action===`rotate-master`||e.action===`create`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{name:n},...r===void 0?{}:{action:r}}}function Ao(){let e=Be({strict:!1}),t=de(),n=typeof e.q==`string`?e.q:``,r=typeof e.name==`string`?e.name:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>ko({...t,...e}),replace:!0})},[t]);return{query:n,selectedName:r,action:i,setQuery:(0,D.useCallback)(e=>{a({q:e.length>0?e:void 0})},[a]),setSelectedName:(0,D.useCallback)(e=>{a({name:e??void 0,action:void 0})},[a]),setAction:(0,D.useCallback)(e=>{a({action:e??void 0})},[a])}}function jo(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.key==`string`&&e.key.length>0?e.key:void 0,r=e.action===`create`||e.action===`edit`||e.action===`refresh`||e.action===`revoke`||e.action===`rotate`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{key:n},...r===void 0?{}:{action:r}}}function Mo(){let e=Be({strict:!1}),t=de(),n=typeof e.q==`string`?e.q:``,r=typeof e.key==`string`?e.key:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>jo({...t,...e}),replace:!0})},[t]);return{query:n,selectedKey:r,action:i,setQuery:e=>{a({q:e.length>0?e:void 0})},setSelectedKey:e=>{a({key:e??void 0,action:void 0})},setAction:e=>{a({action:e??void 0})}}}var No=`/overview`,Po=new Set([`/overview`,`/flows`,`/store`,`/vault`,`/access`,`/observability`]),Fo=`/monitoring`,Io=`/observability`,Lo=1024;function Ro(e){if(typeof e!=`string`)return;let t=e.trim();if(t.length===0||t.length>Lo||!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`://`))return;let n,r;try{let e=new URL(t,`http://console.local`);if(e.origin!==`http://console.local`)return;n=e.pathname,r=e.search}catch{return}if(n===Fo&&(n=Io),Po.has(n))return r.length>0?`${n}${r}`:n}function zo(e){let t=Ro(e.next);return t===void 0||t===`/overview`?{}:{next:t}}function Bo(e){return zo({next:e})}function Vo(e){let t=Ro(e);if(t===void 0)return{to:No,search:{}};let n=new URL(t,`http://console.local`),r=Object.fromEntries(n.searchParams.entries());return n.pathname===`/flows`?{to:`/flows`,search:yo(r)}:n.pathname===`/store`?{to:`/store`,search:_o(r)}:n.pathname===`/vault`?{to:`/vault`,search:ko(r)}:n.pathname===`/access`?{to:`/access`,search:jo(r)}:n.pathname===Io?{to:`/observability`,search:Do(r)}:{to:`/overview`,search:ho(r)}}function Ho(e,t){let n=Vo(t);switch(n.to){case`/flows`:e({to:`/flows`,search:n.search});return;case`/store`:e({to:`/store`,search:n.search});return;case`/vault`:e({to:`/vault`,search:n.search});return;case`/access`:e({to:`/access`,search:n.search});return;case`/observability`:e({to:`/observability`,search:n.search});return;default:e({to:`/overview`,search:n.search})}}var Uo=[[`path`,{d:`M15 5H19.5C20.4346 5 20.9019 5 21.25 5.20096C21.478 5.33261 21.6674 5.52197 21.799 5.75C22 6.09808 22 6.56538 22 7.5C22 8.43462 22 8.90192 21.799 9.25C21.6674 9.47803 21.478 9.66739 21.25 9.79904C20.9019 10 20.4346 10 19.5 10H15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 14H19.5C20.4346 14 20.9019 14 21.25 14.201C21.478 14.3326 21.6674 14.522 21.799 14.75C22 15.0981 22 15.5654 22 16.5C22 17.4346 22 17.9019 21.799 18.25C21.6674 18.478 21.478 18.6674 21.25 18.799C20.9019 19 20.4346 19 19.5 19H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.29969 14.3638L9.92373 13.9477L9.92373 13.9477L9.29969 14.3638ZM9.32684 14.4045L8.7028 14.8205L8.7028 14.8205L9.32684 14.4045ZM8.41421 21L7.88388 20.4697L8.41421 21ZM9.05201 20.3622L9.58234 20.8925H9.58234L9.05201 20.3622ZM9.19561 16.4867L8.59561 16.0367L8.59561 16.0367L9.19561 16.4867ZM9.27186 16.3851L9.87186 16.8351L9.87186 16.8351L9.27186 16.3851ZM9.19561 18.3417L8.59561 18.7917L8.59561 18.7917L9.19561 18.3417ZM8.79241 17.7024L9.5106 17.4862V17.4862L8.79241 17.7024ZM8.79241 17.1261L9.5106 17.3422V17.3422L8.79241 17.1261ZM5.58579 21L5.05546 21.5303L5.05546 21.5303L5.58579 21ZM9.76462 15.2332L10.5065 15.1229L10.5065 15.1229L9.76462 15.2332ZM9.75494 15.5819L10.4895 15.7332V15.7332L9.75494 15.5819ZM9.60244 19.7056L8.91033 19.4167V19.4167L9.60244 19.7056ZM9.64765 19.0695L10.3737 18.8814V18.8814L9.64765 19.0695ZM9.02647 13.84L9.75662 13.6686L9.75662 13.6686L9.02647 13.84ZM9.06318 13.9613L8.36057 14.2236L8.36057 14.2236L9.06318 13.9613ZM9 11.584L8.69972 10.8967C8.42655 11.016 8.25 11.2859 8.25 11.584H9ZM5 11.584H5.75C5.75 11.2859 5.57345 11.016 5.30028 10.8967L5 11.584ZM2 7H2.75C2.75 4.65279 4.65279 2.75 7 2.75V2V1.25C3.82436 1.25 1.25 3.82436 1.25 7H2ZM7 2V2.75C9.34721 2.75 11.25 4.65279 11.25 7H12H12.75C12.75 3.82436 10.1756 1.25 7 1.25V2ZM9.29969 14.3638L8.67565 14.7798L8.7028 14.8205L9.32684 14.4045L9.95088 13.9884L9.92373 13.9477L9.29969 14.3638ZM8.41421 21L8.94454 21.5303L9.58234 20.8925L9.05201 20.3622L8.52168 19.8319L7.88388 20.4697L8.41421 21ZM9.19561 16.4867L9.79561 16.9367L9.87186 16.8351L9.27186 16.3851L8.67186 15.9351L8.59561 16.0367L9.19561 16.4867ZM9.19561 18.3417L9.79561 17.8917C9.67257 17.7276 9.60164 17.6325 9.55282 17.5578C9.50856 17.4902 9.50756 17.4761 9.5106 17.4862L8.79241 17.7024L8.07422 17.9185C8.17302 18.2468 8.39708 18.527 8.59561 18.7917L9.19561 18.3417ZM9.19561 16.4867L8.59561 16.0367C8.39708 16.3014 8.17302 16.5816 8.07422 16.91L8.79241 17.1261L9.5106 17.3422C9.50756 17.3523 9.50856 17.3382 9.55282 17.2706C9.60164 17.196 9.67257 17.1008 9.79561 16.9367L9.19561 16.4867ZM8.79241 17.7024L9.5106 17.4862C9.49647 17.4393 9.49647 17.3892 9.5106 17.3422L8.79241 17.1261L8.07422 16.91C7.97526 17.2388 7.97526 17.5896 8.07422 17.9185L8.79241 17.7024ZM5.58579 21L5.05546 21.5303C5.37379 21.8487 5.66477 22.1419 5.93262 22.3463C6.21778 22.5638 6.56297 22.75 7 22.75V22V21.25C6.99936 21.25 6.99936 21.25 6.9998 21.25C7.00025 21.2501 7.00053 21.2501 7.00045 21.2501C7.00036 21.2501 6.99936 21.2499 6.99731 21.2492C6.99523 21.2486 6.99174 21.2474 6.98671 21.2453C6.96497 21.2362 6.91996 21.2128 6.8425 21.1537C6.67346 21.0248 6.46444 20.818 6.11612 20.4697L5.58579 21ZM8.41421 21L7.88388 20.4697C7.53556 20.818 7.32654 21.0248 7.1575 21.1537C7.08004 21.2128 7.03503 21.2362 7.0133 21.2453C7.00826 21.2474 7.00477 21.2486 7.00269 21.2492C7.00064 21.2499 6.99965 21.2501 6.99955 21.2501C6.99947 21.2501 6.99975 21.2501 7.0002 21.25C7.00064 21.25 7.00064 21.25 7 21.25V22V22.75C7.43703 22.75 7.78222 22.5638 8.06737 22.3463C8.33523 22.1419 8.62621 21.8487 8.94454 21.5303L8.41421 21ZM5 19.5858H4.25C4.25 19.9333 4.23672 20.316 4.38321 20.6697L5.07612 20.3827L5.76903 20.0957C5.76901 20.0956 5.76889 20.0954 5.7686 20.0944C5.76828 20.0933 5.76746 20.0905 5.76635 20.0852C5.76401 20.0739 5.76041 20.052 5.75736 20.0117C5.7505 19.9215 5.75 19.8011 5.75 19.5858H5ZM5.58579 21L6.11612 20.4697C5.96383 20.3174 5.87909 20.2319 5.82012 20.1633C5.79385 20.1327 5.78085 20.1146 5.77456 20.105C5.77157 20.1004 5.77014 20.0978 5.76963 20.0969C5.76915 20.096 5.76905 20.0957 5.76903 20.0957L5.07612 20.3827L4.38321 20.6697C4.5297 21.0233 4.8097 21.2846 5.05546 21.5303L5.58579 21ZM9.32684 14.4045L8.7028 14.8205C8.84441 15.0329 8.92554 15.1556 8.97895 15.2518C9.0267 15.3378 9.02449 15.355 9.02277 15.3435L9.76462 15.2332L10.5065 15.1229C10.4718 14.8899 10.3857 14.6953 10.2903 14.5234C10.2005 14.3618 10.0792 14.1809 9.95087 13.9884L9.32684 14.4045ZM9.27186 16.3851L9.87186 16.8351C10.0106 16.65 10.1418 16.4761 10.2404 16.3197C10.3452 16.1534 10.442 15.9638 10.4895 15.7332L9.75494 15.5819L9.02035 15.4306C9.02271 15.4192 9.02396 15.4366 8.97152 15.5197C8.91285 15.6128 8.82504 15.7308 8.67186 15.9351L9.27186 16.3851ZM9.76462 15.2332L9.02277 15.3435C9.02708 15.3724 9.02626 15.402 9.02035 15.4306L9.75494 15.5819L10.4895 15.7332C10.5309 15.5323 10.5366 15.3257 10.5065 15.1229L9.76462 15.2332ZM9.05201 20.3622L9.58234 20.8925C9.73312 20.7418 9.87353 20.6019 9.98321 20.4758C10.0983 20.3435 10.2133 20.1892 10.2946 19.9945L9.60244 19.7056L8.91033 19.4167C8.91552 19.4043 8.9134 19.4202 8.85137 19.4915C8.78391 19.569 8.68714 19.6664 8.52168 19.8319L9.05201 20.3622ZM9.19561 18.3417L8.59561 18.7917C8.736 18.9789 8.81803 19.089 8.87384 19.1753C8.92516 19.2547 8.92501 19.2707 8.92163 19.2577L9.64765 19.0695L10.3737 18.8814C10.3207 18.6772 10.2287 18.5082 10.1335 18.3609C10.0428 18.2205 9.92355 18.0623 9.79561 17.8917L9.19561 18.3417ZM9.60244 19.7056L10.2946 19.9945C10.4417 19.6421 10.4695 19.2511 10.3737 18.8814L9.64765 19.0695L8.92163 19.2577C8.93532 19.3105 8.93135 19.3663 8.91033 19.4167L9.60244 19.7056ZM9 13.3739H8.25C8.25 13.5755 8.24543 13.7947 8.29633 14.0115L9.02647 13.84L9.75662 13.6686C9.75749 13.6723 9.75458 13.6641 9.75254 13.6191C9.75018 13.5669 9.75 13.4981 9.75 13.3739H9ZM9.29969 14.3638L9.92373 13.9477C9.85483 13.8444 9.81683 13.7871 9.78988 13.7424C9.76658 13.7037 9.76447 13.6953 9.7658 13.6989L9.06318 13.9613L8.36057 14.2236C8.43847 14.4322 8.56384 14.6121 8.67565 14.7798L9.29969 14.3638ZM9.02647 13.84L8.29633 14.0114C8.31324 14.0835 8.3347 14.1543 8.36057 14.2236L9.06318 13.9613L9.7658 13.6989C9.7621 13.689 9.75903 13.6789 9.75662 13.6686L9.02647 13.84ZM9 11.584H8.25V13.3739H9H9.75V11.584H9ZM12 7H11.25C11.25 8.74161 10.2023 10.2402 8.69972 10.8967L9 11.584L9.30028 12.2712C11.3295 11.3846 12.75 9.35903 12.75 7H12ZM5 11.584H4.25V19.5858H5H5.75V11.584H5ZM5 11.584L5.30028 10.8967C3.79769 10.2402 2.75 8.74161 2.75 7H2H1.25C1.25 9.35903 2.6705 11.3846 4.69972 12.2712L5 11.584Z`,fill:`currentColor`,key:`2`}],[`path`,{d:`M7.25 7H7M7.5 7C7.5 7.27614 7.27614 7.5 7 7.5C6.72386 7.5 6.5 7.27614 6.5 7C6.5 6.72386 6.72386 6.5 7 6.5C7.27614 6.5 7.5 6.72386 7.5 7Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Wo=[[`path`,{d:`M7 21H16.9999C19.3569 21 20.5354 21 21.2677 20.2678C21.9999 19.5355 21.9999 18.357 21.9999 16C21.9999 13.643 21.9999 12.4645 21.2677 11.7322C20.5354 11 19.3569 11 16.9999 11H7C4.64302 11 3.46453 11 2.7323 11.7322C2.00007 12.4644 2.00005 13.6429 2 15.9999C1.99995 18.357 1.99993 19.5355 2.73217 20.2677C3.4644 21 4.64294 21 7 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4 11C4.00005 9.59977 4.00008 8.89966 4.27263 8.36485C4.5123 7.89455 4.89469 7.51218 5.365 7.27253C5.89981 7 6.59993 7 8.00015 7H16C17.4001 7 18.1002 7 18.635 7.27248C19.1054 7.51217 19.4878 7.89462 19.7275 8.36502C20 8.8998 20 9.59987 20 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M6 7C6.00004 5.5998 6.00006 4.89969 6.27259 4.3649C6.51227 3.89457 6.89467 3.51218 7.36501 3.27252C7.89981 3 8.59991 3 10.0001 3H14C15.4001 3 16.1002 3 16.635 3.27248C17.1054 3.51217 17.4878 3.89462 17.7275 4.36502C18 4.8998 18 5.59987 18 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M16 15L15.7 15.4C15.1111 16.1851 14.8167 16.5777 14.3944 16.7889C13.9721 17 13.4814 17 12.5 17H11.5C10.5186 17 10.0279 17 9.60557 16.7889C9.18328 16.5777 8.88885 16.1851 8.3 15.4L8 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Go=[[`path`,{d:`M4.26781 18.8447C4.49269 20.515 5.87613 21.8235 7.55966 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.879 17.7547 20 16.6376 20 15.5C20 14.3624 19.879 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55966 9.09909C5.87613 9.17649 4.49269 10.485 4.26781 12.1553C4.12105 13.2453 4 14.3624 4 15.5C4 16.6376 4.12105 17.7547 4.26781 18.8447Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 9V6.5C7.5 4.01472 9.51472 2 12 2C14.4853 2 16.5 4.01472 16.5 6.5V9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 17.5V16C8 13.7909 9.79086 12 12 12C14.2091 12 16 13.7909 16 16V17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10.5 19V16C10.5 15.1716 11.1716 14.5 12 14.5C12.8284 14.5 13.5 15.1716 13.5 16M13.5 19V18`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],Ko=[[`path`,{d:`M3 11L5.5 8.5C6.51706 7.48294 7.02558 6.97442 7.63723 6.8616C7.87705 6.81737 8.12295 6.81737 8.36277 6.8616C8.97442 6.97442 9.48295 7.48295 10.5 8.5C11.5171 9.51705 12.0256 10.0256 12.6372 10.1384C12.8771 10.1826 13.1229 10.1826 13.3628 10.1384C13.9744 10.0256 14.4829 9.51705 15.5 8.5L21 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 15V21M9 13V21M15 16V21M21 9V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qo=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L10.5 15L16 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Jo=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Yo=[[`path`,{d:`M15 9V15H9V9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.3431 21 15 19.6569 15 18V15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9 15.002H6C4.34315 15.002 3 16.3451 3 18.002C3 19.6588 4.34315 21.002 6 21.002C7.65685 21.002 9 19.6588 9 18.002V15.002Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 9L15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M9 9V6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9H9Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Xo=[[`path`,{d:`M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zo=[[`path`,{d:`M2.79289 21.2071C3.08579 21.5 3.55719 21.5 4.5 21.5H14.5C15.4428 21.5 15.9142 21.5 16.2071 21.2071M2.79289 21.2071C2.5 20.9142 2.5 20.4428 2.5 19.5V9.5C2.5 8.55719 2.5 8.08579 2.79289 7.79289M2.79289 21.2071L8.79289 15.2071M16.2071 21.2071C16.5 20.9142 16.5 20.4428 16.5 19.5V9.5C16.5 8.55719 16.5 8.08579 16.2071 7.79289M16.2071 21.2071L21.2071 16.2071C21.5 15.9142 21.5 15.4428 21.5 14.5V4.5C21.5 3.55719 21.5 3.08579 21.2071 2.79289M16.2071 7.79289C15.9142 7.5 15.4428 7.5 14.5 7.5H4.5C3.55719 7.5 3.08579 7.5 2.79289 7.79289M16.2071 7.79289L21.2071 2.79289M2.79289 7.79289L7.79289 2.79289C8.08579 2.5 8.55719 2.5 9.5 2.5H19.5C20.4428 2.5 20.9142 2.5 21.2071 2.79289M8.79289 15.2071C9.08579 15.5 9.55719 15.5 10.5 15.5H14M8.79289 15.2071C8.5 14.9142 8.5 14.4428 8.5 13.5V10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Qo=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],$o=[[`path`,{d:`M18 18C18 18.4644 18 18.6965 17.978 18.8918C17.7952 20.5145 16.5145 21.7952 14.8919 21.978C14.6965 22 14.4644 22 14 22H11C7.70017 22 6.05025 22 5.02513 20.9749C4 19.9498 4 18.2998 4 15L4.00001 8.99998C4.00001 5.70016 4.00003 4.05024 5.02514 3.02512C6.05027 2 7.70018 2 11 2H14C14.4644 2 14.6965 2 14.8919 2.02201C16.5145 2.20483 17.7952 3.48547 17.978 5.10816C18 5.30347 18 5.53565 18 6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.07612 11.1183C8 11.3021 8 11.535 8 12.001C8 12.4669 8 12.6999 8.07612 12.8837C8.17761 13.1287 8.37229 13.3234 8.61732 13.4249C8.80109 13.501 9.03406 13.501 9.5 13.501H14.5C14.5002 15.2503 14.511 16.1299 15.0623 16.3858C15.0829 16.3954 15.1037 16.4042 15.1249 16.4124C15.7045 16.6353 16.3999 16.0139 17.7907 14.7711C19.2576 13.4602 19.9912 12.7851 20 11.957C19.9912 11.1289 19.2576 10.4538 17.7907 9.14301C16.3999 7.90018 15.7045 7.27876 15.1249 7.50171C15.1037 7.50985 15.0829 7.51869 15.0623 7.52822C14.5018 7.78844 14.5 8.69318 14.5 10.501H9.5C9.03406 10.501 8.80109 10.501 8.61732 10.5771C8.37229 10.6786 8.17761 10.8733 8.07612 11.1183Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],es=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ts=[[`path`,{d:`M17 17L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ns=[[`path`,{d:`M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],rs=[[`path`,{d:`M13.3382 10H10.6618C9.1273 10 8.36006 10 8.08543 9.49297C7.8108 8.98594 8.21743 8.32019 9.0307 6.9887L10.3689 4.79773C11.101 3.59924 11.467 3 12 3C12.533 3 12.899 3.59924 13.6311 4.79773L14.9693 6.9887C15.7826 8.32019 16.1892 8.98594 15.9146 9.49297C15.6399 10 14.8727 10 13.3382 10Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.66294 20.1111C10 19.6067 10 18.9045 10 17.5C10 16.0955 10 15.3933 9.66294 14.8889C9.51702 14.6705 9.32952 14.483 9.11114 14.3371C8.60669 14 7.90446 14 6.5 14C5.09554 14 4.39331 14 3.88886 14.3371C3.67048 14.483 3.48298 14.6705 3.33706 14.8889C3 15.3933 3 16.0955 3 17.5C3 18.9045 3 19.6067 3.33706 20.1111C3.48298 20.3295 3.67048 20.517 3.88886 20.6629C4.39331 21 5.09554 21 6.5 21C7.90446 21 8.60669 21 9.11114 20.6629C9.32952 20.517 9.51702 20.3295 9.66294 20.1111Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],is=[[`path`,{d:`M19.5576 4L20.4551 4.97574C20.8561 5.41165 21.0566 5.62961 20.9861 5.81481C20.9155 6 20.632 6 20.0649 6C18.7956 6 17.2771 5.79493 16.1111 6.4733C15.3903 6.89272 14.8883 7.62517 14.0392 9M3 18H4.58082C6.50873 18 7.47269 18 8.2862 17.5267C9.00708 17.1073 9.50904 16.3748 10.3582 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.5576 20L20.4551 19.0243C20.8561 18.5883 21.0566 18.3704 20.9861 18.1852C20.9155 18 20.632 18 20.0649 18C18.7956 18 17.2771 18.2051 16.1111 17.5267C15.2976 17.0534 14.7629 16.1815 13.6935 14.4376L10.7038 9.5624C9.63441 7.81853 9.0997 6.9466 8.2862 6.4733C7.47269 6 6.50873 6 4.58082 6H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],as=[[`path`,{d:`M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 3L9.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 7H6M5 10H6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],os=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2V3.5M12 20.5V22M19.0708 19.0713L18.0101 18.0106M5.98926 5.98926L4.9286 4.9286M22 12H20.5M3.5 12H2M19.0713 4.92871L18.0106 5.98937M5.98975 18.0107L4.92909 19.0714`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],ss=[[`path`,{d:`M19.439 15.439C20.3636 14.5212 21.0775 13.6091 21.544 12.955C21.848 12.5287 22 12.3155 22 12C22 11.6845 21.848 11.4713 21.544 11.045C20.1779 9.12944 16.6892 5 12 5C11.0922 5 10.2294 5.15476 9.41827 5.41827M6.74742 6.74742C4.73118 8.1072 3.24215 9.94266 2.45604 11.045C2.15201 11.4713 2 11.6845 2 12C2 12.3155 2.15201 12.5287 2.45604 12.955C3.8221 14.8706 7.31078 19 12 19C13.9908 19 15.7651 18.2557 17.2526 17.2526`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.85786 10C9.32783 10.53 9 11.2623 9 12.0711C9 13.6887 10.3113 15 11.9289 15C12.7377 15 13.47 14.6722 14 14.1421`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 3L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],cs=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],ls=[[`path`,{d:`M3 19C3 20.4142 3 21.1213 3.43934 21.5607C3.87868 22 4.58579 22 6 22C7.41421 22 8.12132 22 8.56066 21.5607C9 21.1213 9 20.4142 9 19C9 17.5858 9 16.8787 8.56066 16.4393C8.12132 16 7.41421 16 6 16C4.58579 16 3.87868 16 3.43934 16.4393C3 16.8787 3 17.5858 3 19Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5C3 6.41421 3 7.12132 3.43934 7.56066C3.87868 8 4.58579 8 6 8C7.41421 8 8.12132 8 8.56066 7.56066C9 7.12132 9 6.41421 9 5C9 3.58579 9 2.87868 8.56066 2.43934C8.12132 2 7.41421 2 6 2C4.58579 2 3.87868 2 3.43934 2.43934C3 2.87868 3 3.58579 3 5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 14C15 15.4142 15 16.1213 15.4393 16.5607C15.8787 17 16.5858 17 18 17C19.4142 17 20.1213 17 20.5607 16.5607C21 16.1213 21 15.4142 21 14C21 12.5858 21 11.8787 20.5607 11.4393C20.1213 11 19.4142 11 18 11C16.5858 11 15.8787 11 15.4393 11.4393C15 11.8787 15 12.5858 15 14Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 8V16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15 14H12C8.68629 14 6 11.3137 6 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],us=[.16,1,.3,1],ds={type:`spring`,stiffness:500,damping:30,mass:.6},fs={type:`spring`,stiffness:460,damping:30,mass:.55},ps={type:`spring`,stiffness:420,damping:40,mass:.5},ms={type:`spring`,stiffness:360,damping:32,mass:.6};function hs(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>{t(e.matches)};return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var gs=(0,D.createContext)({});function _s(e){let t=(0,D.useRef)(null);return t.current===null&&(t.current=e()),t.current}var vs=typeof window<`u`?D.useLayoutEffect:D.useEffect,ys=(0,D.createContext)(null);function bs(e,t){e.indexOf(t)===-1&&e.push(t)}function xs(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Ss=(e,t,n)=>n>t?t:n<e?e:n,Cs=()=>{},ws=()=>{},Ts={},Es=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ds=e=>typeof e==`object`&&!!e,Os=e=>/^0[^.\s]+$/u.test(e);function ks(e){let t;return()=>(t===void 0&&(t=e()),t)}var As=e=>e,js=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ms=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Ns=class{constructor(){this.subscriptions=[]}add(e){return bs(this.subscriptions,e),()=>this.remove(e)}remove(e){xs(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ps=e=>e*1e3,Fs=e=>e/1e3,Is=(e,t)=>t?1e3/t*e:0,Ls=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Rs=1e-7,zs=12;function Bs(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ls(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Rs&&++s<zs);return o}function Vs(e,t,n,r){if(e===t&&n===r)return As;let i=t=>Bs(t,0,1,e,n);return e=>e===0||e===1?e:Ls(i(e),t,r)}var Hs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Us=e=>t=>1-e(1-t),Ws=Vs(.33,1.53,.69,.99),Gs=Us(Ws),Ks=Hs(Gs),qs=e=>e>=1?1:(e*=2)<1?.5*Gs(e):.5*(2-2**(-10*(e-1))),Js=e=>1-Math.sin(Math.acos(e)),Ys=Us(Js),Xs=Hs(Js),Zs=Vs(.42,0,1,1),Qs=Vs(0,0,.58,1),$s=Vs(.42,0,.58,1),ec=e=>Array.isArray(e)&&typeof e[0]!=`number`,tc=e=>Array.isArray(e)&&typeof e[0]==`number`,nc={linear:As,easeIn:Zs,easeInOut:$s,easeOut:Qs,circIn:Js,circInOut:Xs,circOut:Ys,backIn:Gs,backInOut:Ks,backOut:Ws,anticipate:qs},rc=e=>typeof e==`string`,ic=e=>{if(tc(e)){e.length;let[t,n,r,i]=e;return Vs(t,n,r,i)}return rc(e)?(nc[e],`${e}`,nc[e]):e},ac=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function oc(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var sc=40;function cc(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ac.reduce((e,t)=>(e[t]=oc(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Ts.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,sc),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ac.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ac.length;t++)o[ac[t]].cancel(e)},state:i,steps:o}}var{schedule:N,cancel:lc,state:P,steps:uc}=cc(typeof requestAnimationFrame<`u`?requestAnimationFrame:As,!0),dc;function fc(){dc=void 0}var F={now:()=>(dc===void 0&&F.set(P.isProcessing||Ts.useManualTiming?P.timestamp:performance.now()),dc),set:e=>{dc=e,queueMicrotask(fc)}},pc=e=>Math.round(e*1e5)/1e5,mc=e=>t=>typeof t==`string`&&t.startsWith(e),hc=mc(`--`),gc=mc(`var(--`),_c=e=>gc(e)?vc.test(e.split(`/*`)[0].trim()):!1,vc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yc(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var bc={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},xc={...bc,transform:e=>Ss(0,1,e)},Sc={...bc,default:1},Cc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wc(e){return e==null}var Tc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ec=(e,t)=>n=>!!(typeof n==`string`&&Tc.test(n)&&n.startsWith(e)||t&&!wc(n)&&Object.prototype.hasOwnProperty.call(n,t)),Dc=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Cc);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Oc=e=>Ss(0,255,e),kc={...bc,transform:e=>Math.round(Oc(e))},Ac={test:Ec(`rgb`,`red`),parse:Dc(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+kc.transform(e)+`, `+kc.transform(t)+`, `+kc.transform(n)+`, `+pc(xc.transform(r))+`)`};function jc(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Mc={test:Ec(`#`),parse:jc,transform:Ac.transform},Nc=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pc=Nc(`deg`),Fc=Nc(`%`),I=Nc(`px`),Ic=Nc(`vh`),Lc=Nc(`vw`),Rc={...Fc,parse:e=>Fc.parse(e)/100,transform:e=>Fc.transform(e*100)},zc={test:Ec(`hsl`,`hue`),parse:Dc(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Fc.transform(pc(t))+`, `+Fc.transform(pc(n))+`, `+pc(xc.transform(r))+`)`},L={test:e=>Ac.test(e)||Mc.test(e)||zc.test(e),parse:e=>Ac.test(e)?Ac.parse(e):zc.test(e)?zc.parse(e):Mc.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ac.transform(e):zc.transform(e),getAnimatableNone:e=>{let t=L.parse(e);return t.alpha=0,L.transform(t)}},Bc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vc=new RegExp(Cc.source),Hc=new RegExp(Bc.source,`i`);function Uc(e){return isNaN(e)&&typeof e==`string`&&(Vc.test(e)||Hc.test(e))}var Wc=`number`,Gc=`color`,Kc=`var`,qc=`var(`,Jc="${}",Yc=/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 Xc(e){let t=e.toString();return Vc.test(t)||Hc.test(t)}function Zc(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Yc,e=>(L.test(e)?(r.color.push(a),i.push(Gc),n.push(L.parse(e))):e.startsWith(qc)?(r.var.push(a),i.push(Kc),n.push(e)):(r.number.push(a),i.push(Wc),n.push(parseFloat(e))),++a,Jc)).split(Jc),indexes:r,types:i}}function Qc(e){return Zc(e).values}function $c({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Wc?pc(r[a]):e===Gc?L.transform(r[a]):r[a]}return i}}function el(e){return $c(Zc(e))}var tl=e=>typeof e==`number`?0:L.test(e)?L.getAnimatableNone(e):e,nl=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:tl(e);function rl(e){let t=Zc(e);return $c(t)(t.values.map((e,n)=>nl(e,t.split[n])))}var il={test:Uc,parse:Qc,createTransformer:el,getAnimatableNone:rl};function al(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ol({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=al(s,r,e+1/3),a=al(s,r,e),o=al(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function sl(e,t){return n=>n>0?t:e}var R=(e,t,n)=>e+(t-e)*n,cl=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ll=[Mc,Ac,zc],ul=e=>ll.find(t=>t.test(e));function dl(e){let t=ul(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===zc&&(n=ol(n)),n}var fl=(e,t)=>{let n=dl(e),r=dl(t);if(!n||!r)return sl(e,t);let i={...n};return e=>(i.red=cl(n.red,r.red,e),i.green=cl(n.green,r.green,e),i.blue=cl(n.blue,r.blue,e),i.alpha=R(n.alpha,r.alpha,e),Ac.transform(i))},pl=new Set([`none`,`hidden`]);function ml(e,t){return pl.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hl(e,t){return n=>R(e,t,n)}function gl(e){return typeof e==`number`?hl:typeof e==`string`?_c(e)?sl:L.test(e)?fl:bl:Array.isArray(e)?_l:typeof e==`object`?L.test(e)?fl:vl:sl}function _l(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>gl(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function vl(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=gl(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function yl(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var bl=(e,t)=>{let n=il.createTransformer(t),r=Zc(e),i=Zc(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pl.has(e)&&!i.values.length||pl.has(t)&&!r.values.length?ml(e,t):js(_l(yl(r,i),i.values),n):(`${e}${t}`,sl(e,t))},xl=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Sl(e,t){let n=xl.exec(e);if(!n)return;let r=xl.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>pc(R(a,o,e))+i}function Cl(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return R(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Sl(e,t);if(n)return n}return gl(e)(e,t)}var wl=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>N.update(t,e),stop:()=>lc(t),now:()=>P.isProcessing?P.timestamp:F.now()}},Tl=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},El=2e4;function Dl(e,t=50,n=El,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Ol(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Dl(r),El);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Fs(i)}}var z={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function kl(e,t){return e*Math.sqrt(1-t*t)}var Al=12;function jl(e,t,n){let r=n;for(let n=1;n<Al;n++)r-=e(r)/t(r);return r}var Ml=.001;function Nl({duration:e=z.duration,bounce:t=z.bounce,velocity:n=z.velocity,mass:r=z.mass}){let i,a;z.maxDuration;let o=1-t;o=Ss(z.minDamping,z.maxDamping,o),e=Ss(z.minDuration,z.maxDuration,Fs(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=kl(t,o),c=Math.exp(-i);return Ml-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=kl(t*t,o);return(-i(t)+Ml>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=jl(i,a,s);if(e=Ps(e),isNaN(c))return{stiffness:z.stiffness,damping:z.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Pl=[`duration`,`bounce`],Fl=[`stiffness`,`damping`,`mass`];function Il(e,t){return t.some(t=>e[t]!==void 0)}function Ll(e){let t={velocity:z.velocity,stiffness:z.stiffness,damping:z.damping,mass:z.mass,isResolvedFromDuration:!1,...e};if(!Il(e,Fl)&&Il(e,Pl)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Ss(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:z.mass,stiffness:i,damping:a}}else{let n=Nl({...e,velocity:0});t={...t,...n,mass:z.mass},t.isResolvedFromDuration=!0}}return t}function Rl(e=z.visualDuration,t=z.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,velocity:u,isResolvedFromDuration:d}=Ll({...n,velocity:-Fs(n.velocity||0)}),f=s/(2*Math.sqrt(o*c)),p=Fs(Math.sqrt(o/c)),m=f*p,h={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},g=()=>{let e=Math.abs(h.delta)<5;h.restSpeed=n.restSpeed||(e?z.restSpeed.granular:z.restSpeed.default),h.restDelta=n.restDelta||(e?z.restDelta.granular:z.restDelta.default)};g();let _,v,y;if(f<1){let e=kl(p,f),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};y=()=>{t.A=(h.velocity+m*h.delta)/e,t.sinC=m*t.A+h.delta*e,t.cosC=m*h.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-m*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};_=e=>(n(e),h.target-t.env*(t.A*t.sin+h.delta*t.cos)),v=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(f===1){_=e=>h.target-Math.exp(-p*e)*(h.delta+(h.velocity+p*h.delta)*e);let e={C:0};y=()=>{e.C=h.velocity+p*h.delta},v=t=>Math.exp(-p*t)*(p*e.C*t-h.velocity)}else{let e=p*Math.sqrt(f*f-1);_=t=>{let n=Math.exp(-m*t),r=Math.min(e*t,300);return h.target-n*((h.velocity+m*h.delta)*Math.sinh(r)+e*h.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};y=()=>{t.P=(h.velocity+m*h.delta)/e,t.sinh=m*t.P-h.delta*e,t.cosh=m*h.delta-t.P*e},v=n=>{let r=Math.exp(-m*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}y();let b=!Il(n,Fl)&&Il(n,Pl),x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{h.target=e[e.length-1],h.delta=h.target-e[0],h.velocity=b?0:-Fs(t),n.restSpeed&&n.restDelta||g(),S.calculatedDuration=x,a.done=!1,y()},velocity:e=>Ps(v(e)),next:e=>{let t=_(e);if(d)a.done=e>=l;else{let n=Ps(v(e));a.done=Math.abs(n)<=h.restSpeed&&Math.abs(h.target-t)<=h.restDelta}return a.value=a.done?h.target:t,a},toString:()=>{let e=Math.min(Dl(S),El),t=Tl(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Rl.applyToOptions=e=>{let t=Ol(e,100,Rl);return e.ease=t.ease,e.duration=Ps(t.duration),e.type=`keyframes`,e};function zl({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Rl({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Bl(e,t,n){let r=[],i=n||Ts.mix||Cl,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=js(Array.isArray(t)?t[n]||As:t,a)),r.push(a)}return r}function Vl(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Bl(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Ms(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Ss(e[0],e[a-1],t)):l}function Hl(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ms(0,t,r);e.push(R(n,1,i))}}function Ul(e){let t=[0];return Hl(t,e.length-1),t}function Wl(e,t){return e.map(e=>e*t)}function Gl(e,t){return e.map(()=>t||$s).splice(0,e.length-1)}function Kl({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ec(r)?r.map(ic):ic(r)||$s,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Ts.mix||Cl)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Ss(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Vl(Wl(n&&n.length===t.length?n:Ul(t),e),t,{ease:Array.isArray(i)?i:Gl(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ql=5;function Jl(e,t,n){let r=Math.max(t-ql,0);return Is(n-e(r),t-r)}function Yl(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Jl(t=>e.next(t).value,t,e.next(t).value)}var Xl=e=>e!==null;function Zl(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Xl),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ql={decay:zl,inertia:zl,tween:Kl,keyframes:Kl,spring:Rl};function $l(e){typeof e.type==`string`&&(e.type=Ql[e.type])}function eu(e,t){return{kind:e,animation:t,timestamp:F.now(),frameTimestamp:P.timestamp,frameIsProcessing:P.isProcessing}}function tu(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...eu(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function nu(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...eu(`layout-animation-start`,e),node:t})}catch{}}var ru=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},iu=e=>e/100,au=class extends ru{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==F.now()&&this.tick(F.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),tu(this,this.options)}initAnimation(){let{options:e}=this;$l(e);let{type:t=Kl,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Kl;s!==Kl&&typeof o[0]!=`number`&&(this.mixKeyframes=js(iu,Cl(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Dl(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Ss(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==zl&&(b.value=Zl(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Fs(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(this.currentTime)}set time(e){e=Ps(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Yl(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(F.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Fs(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=wl,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(F.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},ou=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function su(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Cc)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ou.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var cu=/\b([a-z-]*)\(.*?\)/gu,lu={...il,getAnimatableNone:e=>{let t=e.match(cu);return t?t.map(su).join(` `):e}},uu={...il,getAnimatableNone:e=>{let t=il.parse(e);return il.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},du={...bc,transform:Math.round},fu={rotate:Pc,pathRotation:Pc,rotateX:Pc,rotateY:Pc,rotateZ:Pc,scale:Sc,scaleX:Sc,scaleY:Sc,scaleZ:Sc,skew:Pc,skewX:Pc,skewY:Pc,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:xc,originX:Rc,originY:Rc,originZ:I},pu={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,inset:I,insetBlock:I,insetBlockStart:I,insetBlockEnd:I,insetInline:I,insetInlineStart:I,insetInlineEnd:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockStart:I,paddingBlockEnd:I,paddingInline:I,paddingInlineStart:I,paddingInlineEnd:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockStart:I,marginBlockEnd:I,marginInline:I,marginInlineStart:I,marginInlineEnd:I,fontSize:I,backgroundPositionX:I,backgroundPositionY:I,...fu,zIndex:du,fillOpacity:xc,strokeOpacity:xc,numOctaves:du},mu={...pu,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:lu,WebkitFilter:lu,mask:uu,WebkitMask:uu},hu=e=>mu[e],gu=new Set([lu,uu]);function _u(e,t){let n=hu(e);return gu.has(n)||(n=il),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function vu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var yu=e=>e*180/Math.PI,bu=e=>Su(yu(Math.atan2(e[1],e[0]))),xu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bu,rotateZ:bu,skewX:e=>yu(Math.atan(e[1])),skewY:e=>yu(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Su=e=>(e%=360,e<0&&(e+=360),e),Cu=bu,wu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Eu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wu,scaleY:Tu,scale:e=>(wu(e)+Tu(e))/2,rotateX:e=>Su(yu(Math.atan2(e[6],e[5]))),rotateY:e=>Su(yu(Math.atan2(-e[2],e[0]))),rotateZ:Cu,rotate:Cu,skewX:e=>yu(Math.atan(e[4])),skewY:e=>yu(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Du(e){return+!!e.includes(`scale`)}function Ou(e,t){if(!e||e===`none`)return Du(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Eu,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xu,i=t}if(!i)return Du(t);let a=r[t],o=i[1].split(`,`).map(Au);return typeof a==`function`?a(o):o[a]}var ku=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ou(n,t)};function Au(e){return parseFloat(e.trim())}var ju=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Mu=new Set([...ju,`pathRotation`]),Nu=e=>e===bc||e===I,Pu=new Set([`x`,`y`,`z`]),Fu=ju.filter(e=>!Pu.has(e));function Iu(e){let t=[];return Fu.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Lu=new Set([`bottom`,`right`]);function Ru(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var zu={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ru(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ru(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ou(e,`x`),y:({transform:e})=>Ou(e,`y`)};zu.translateX=zu.x,zu.translateY=zu.y;var Bu=new Set,Vu=!1,Hu=!1,Uu=!1;function Wu(){if(Hu){let e=[],t=new Set,n=new Set;Bu.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Lu.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Iu(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Hu=!1,Vu=!1,Bu.forEach(e=>e.complete(Uu)),Bu.clear()}function Gu(){Bu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hu=!0)})}function Ku(){Uu=!0,Gu(),Wu(),Uu=!1}function qu(e,t,n){if(typeof e==`string`){if(Es(e)||Os(e))return parseFloat(e);if(!il.test(e)&&il.test(n))return _u(t,n)}return e??void 0}var Ju=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Bu.add(this),Vu||(Vu=!0,N.read(Gu),N.resolveKeyframes(Wu))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=qu(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vu(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bu.delete(this)}cancel(){this.state===`scheduled`&&(Bu.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Yu=e=>e.startsWith(`--`);function Xu(e,t,n){Yu(t)?e.style.setProperty(t,n):e.style[t]=n}var Zu={};function Qu(e,t){let n=ks(e);return()=>Zu[t]??n()}var $u=Qu(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ed=Qu(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),td=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nd={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:td([0,.65,.55,1]),circOut:td([.55,0,1,.45]),backIn:td([.31,.01,.66,-.59]),backOut:td([.33,1.53,.69,.99])};function rd(e,t){if(e)return typeof e==`function`?ed()?Tl(e,t):`ease-out`:tc(e)?td(e):Array.isArray(e)?e.map(e=>rd(e,t)||nd.easeOut):nd[e]}function id(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=rd(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function ad(e){return typeof e==`function`&&`applyToOptions`in e}function od({type:e,...t}){return ad(e)&&ed()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var sd=class extends ru{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=od(e);this.animation=id(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Zl(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Xu(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},tu(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Fs(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ps(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&$u()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),As):r(this)}},cd={anticipate:qs,backInOut:Ks,circInOut:Xs};function ld(e){return e in cd}function ud(e){typeof e.ease==`string`&&ld(e.ease)&&(e.ease=cd[e.ease])}var dd=10,fd=class extends sd{constructor(e){ud(e),$l(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new au({...a,autoplay:!1}),s=Math.max(dd,F.now()-this.startTime),c=Ss(0,dd,s-dd),l=o.sample(s).value,{name:u}=this.options;i&&u&&Xu(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},pd=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(il.test(e)||e===`0`)&&!e.startsWith(`url(`));function md(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hd(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=pd(i,t),s=pd(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):md(e)||(n===`spring`||ad(n))&&r}function gd(e){e.duration=0,e.type=`keyframes`}var _d=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),vd=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yd(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&vd.test(e[t]))return!0;return!1}var bd=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),xd=ks(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Sd(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(_d.has(n)||bd.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return xd()&&(_d.has(n)||bd.has(n)&&yd(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Cd=40,wd=class extends ru{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Ju;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=F.now();let u=!0;hd(e,i,a,o)||(u=!1,(Ts.instantAnimations||!s)&&l?.(Zl(e,n,t)),e[0]=e[e.length-1],gd(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>Cd?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&Sd(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new fd(n)}catch{m=new au(n)}}else m=new au(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ku()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Td(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ed=30,Dd=e=>!isNaN(parseFloat(e)),Od={current:void 0},kd=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=F.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Dd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Ns)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Ns,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){N.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Od.current&&Od.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ed)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ed);return Is(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ad(e,t){return new kd(e,t)}function jd(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Md(e,t){let n=e?.[t]??e?.default??e;return n===e?n:jd(n,e)}var Nd={type:`spring`,stiffness:500,damping:25,restSpeed:10},Pd=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fd={type:`keyframes`,duration:.8},Id={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ld=(e,{keyframes:t})=>t.length>2?Fd:Mu.has(e)?e.startsWith(`scale`)?Pd(t[1]):Nd:Id,Rd=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function zd(e){for(let t in e)if(!Rd.has(t))return!0;return!1}var Bd=(e,t,n,r={},i,a)=>o=>{let s=Md(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ps(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};zd(s)||Object.assign(u,Ld(e,u)),u.duration&&=Ps(u.duration),u.repeatDelay&&=Ps(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gd(u),u.delay===0&&(d=!0)),(Ts.instantAnimations||Ts.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,gd(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Zl(u.keyframes,s);if(e!==void 0){N.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new au(u):new wd(u)},Vd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hd(e){let t=Vd.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ud(e,t,n=1){`${e}`;let[r,i]=Hd(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Es(e)?parseFloat(e):e}return _c(i)?Ud(i,t,n+1):i}function Wd(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Gd(e,t,n,r){if(typeof t==`function`){let[i,a]=Wd(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Wd(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Kd(e,t,n){let r=e.getProps();return Gd(r,t,n===void 0?r.custom:n,e)}var qd=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...ju]),Jd=e=>Array.isArray(e);function Yd(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ad(n))}function Xd(e){return Jd(e)?e[e.length-1]||0:e}function Zd(e,t){let{transitionEnd:n={},transition:r={},...i}=Kd(e,t)||{};i={...i,...n};for(let t in i)Yd(e,t,Xd(i[t]))}var B=e=>!!(e&&e.getVelocity);function Qd(e){return!!(B(e)&&e.add)}function $d(e,t){let n=e.getValue(`willChange`);if(Qd(n))return n.add(t);if(!n&&Ts.WillChange){let n=new Ts.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function ef(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var tf=`data-`+ef(`framerAppearId`);function nf(e){return e.props[tf]}var rf=typeof window<`u`;function af({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function of(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?jd(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&af(f,t))continue;let o={delay:n,...Md(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){N.update(()=>r.set(i));continue}let p=!1;if(rf&&window.MotionHandoffAnimation){let n=nf(e);if(n){let e=window.MotionHandoffAnimation(n,t,N);e!==null&&(o.startTime=e,p=!0)}}$d(e,t);let m=l??e.shouldReduceMotion;r.start(Bd(t,r,i,m&&qd.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>N.update(()=>{o&&Zd(e,o)});d.length?Promise.all(d).then(t):t()}return d}function sf(e,t,n={}){let r=Kd(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(of(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return cf(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function cf(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(sf(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Td(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function lf(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>sf(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=sf(e,t,n);else{let i=typeof t==`function`?Kd(e,t,n.custom):t;r=Promise.all(of(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var uf={test:e=>e===`auto`,parse:e=>e},df=e=>t=>t.test(e),ff=[bc,I,Fc,Pc,Lc,Ic,uf],pf=e=>ff.find(df(e));function mf(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Os(e)}var hf=new Set([`auto`,`none`,`0`]);function gf(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!hf.has(t)&&Xc(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=_u(n,i))}var _f=class extends Ju{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),_c(r))){let i=Ud(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!qd.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=pf(r),o=pf(i);if(yc(r)!==yc(i)&&zu[n]){this.needsMeasurement=!0;return}if(a!==o){if(Nu(a)&&Nu(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zu[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||mf(e[t]))&&n.push(t);n.length&&gf(e,n,t)}measure(){let{element:e,name:t}=this;return zu[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},vf=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function yf(e){return Ds(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function bf(e){return Ds(e)&&`ownerSVGElement`in e}var xf=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Sf(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Cf={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wf=ju.length;function Tf(e,t,n){let r=``,i=!0;for(let a=0;a<wf;a++){let o=ju[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=xf(s,pu[o]);if(!c){i=!1;let t=Cf[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${xf(a,pu.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ef(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Mu.has(e)){o=!0;continue}if(hc(e)){i[e]=n;continue}{let t=xf(n,pu[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Tf(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Df={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Of={offset:`strokeDashoffset`,array:`strokeDasharray`};function kf(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Df:Of;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Af=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function jf(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ef(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Af)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&kf(d,i,a,o,!1)}function Mf({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Nf({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Pf(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ff(e){return e===void 0||e===1}function If({scale:e,scaleX:t,scaleY:n}){return!Ff(e)||!Ff(t)||!Ff(n)}function Lf(e){return If(e)||Rf(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rf(e){return zf(e.x)||zf(e.y)}function zf(e){return e&&e!==`0%`}function Bf(e,t,n){return n+t*(e-n)}function Vf(e,t,n,r,i){return i!==void 0&&(e=Bf(e,i,r)),Bf(e,n,r)+t}function Hf(e,t=0,n=1,r,i){e.min=Vf(e.min,t,n,r,i),e.max=Vf(e.max,t,n,r,i)}function Uf(e,{x:t,y:n}){Hf(e.x,t.translate,t.scale,t.originPoint),Hf(e.y,n.translate,n.scale,n.originPoint)}var Wf=.999999999999,Gf=1.0000000000001;function Kf(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(qf(e.x,-a.scroll.offset.x),qf(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Uf(e,o)),r&&Lf(a.latestValues)&&Xf(e,a.latestValues,a.layout?.layoutBox))}t.x<Gf&&t.x>Wf&&(t.x=1),t.y<Gf&&t.y>Wf&&(t.y=1)}function qf(e,t){e.min+=t,e.max+=t}function Jf(e,t,n,r,i=.5){Hf(e,t,n,R(e.min,e.max,i),r)}function Yf(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Xf(e,t,n){let r=n??e;Jf(e.x,Yf(t.x,r.x),t.scaleX,t.scale,t.originX),Jf(e.y,Yf(t.y,r.y),t.scaleY,t.scale,t.originY)}function Zf(e,t){return Mf(Pf(e.getBoundingClientRect(),t))}function Qf(e,t,n){let r=Zf(e,n),{scroll:i}=t;return i&&(qf(r.x,i.offset.x),qf(r.y,i.offset.y)),r}var{schedule:$f,cancel:ep}=cc(queueMicrotask,!1),tp={x:!1,y:!1};function np(){return tp.x||tp.y}function rp(e){return e===`x`||e===`y`?tp[e]?null:(tp[e]=!0,()=>{tp[e]=!1}):tp.x||tp.y?null:(tp.x=tp.y=!0,()=>{tp.x=tp.y=!1})}function ip(e,t){let n=Sf(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ap(e){return!(e.pointerType===`touch`||np())}function op(e,t,n={}){let[r,i,a]=ip(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!ap(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var sp=(e,t)=>t?e===t||sp(e,t.parentElement):!1,cp=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,lp=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function up(e){return lp.has(e.tagName)||e.isContentEditable===!0}var dp=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function fp(e){return dp.has(e.tagName)||e.isContentEditable===!0}var pp=new WeakSet;function mp(e){return t=>{t.key===`Enter`&&e(t)}}function hp(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var gp=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=mp(()=>{if(pp.has(n))return;hp(n,`down`);let e=mp(()=>{hp(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>hp(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function _p(e){return cp(e)&&!np()}var vp=new WeakSet;function yp(e,t,n={}){let[r,i,a]=ip(e,n),o=e=>{let r=e.currentTarget;if(!_p(e)||vp.has(e))return;pp.add(r),n.stopPropagation&&vp.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),pp.has(r)&&pp.delete(r),_p(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||sp(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),yf(e)&&(e.addEventListener(`focus`,e=>gp(e,i)),!up(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var bp=new WeakMap,xp,Sp=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:bf(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Cp=Sp(`inline`,`width`,`offsetWidth`),wp=Sp(`block`,`height`,`offsetHeight`);function Tp({target:e,borderBoxSize:t}){bp.get(e)?.forEach(n=>{n(e,{get width(){return Cp(e,t)},get height(){return wp(e,t)}})})}function Ep(e){e.forEach(Tp)}function Dp(){typeof ResizeObserver>`u`||(xp=new ResizeObserver(Ep))}function Op(e,t){xp||Dp();let n=Sf(e);return n.forEach(e=>{let n=bp.get(e);n||(n=new Set,bp.set(e,n)),n.add(t),xp?.observe(e)}),()=>{n.forEach(e=>{let n=bp.get(e);n?.delete(t),n?.size||xp?.unobserve(e)})}}var kp=new Set,Ap;function jp(){Ap=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};kp.forEach(t=>t(e))},window.addEventListener(`resize`,Ap)}function Mp(e){return kp.add(e),Ap||jp(),()=>{kp.delete(e),!kp.size&&typeof Ap==`function`&&(window.removeEventListener(`resize`,Ap),Ap=void 0)}}function Np(e,t){return typeof e==`function`?Mp(e):Op(e,t)}var Pp={value:null,addProjectionMetrics:null};function Fp(e){return bf(e)&&e.tagName===`svg`}var Ip=()=>({translate:0,scale:1,origin:0,originPoint:0}),Lp=()=>({x:Ip(),y:Ip()}),Rp=()=>({min:0,max:0}),V=()=>({x:Rp(),y:Rp()}),zp=new WeakMap;function Bp(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Vp(e){return typeof e==`string`||Array.isArray(e)}var Hp=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Up=[`initial`,...Hp];function Wp(e){if(Bp(e.animate))return!0;for(let t=0;t<Up.length;t++)if(Vp(e[Up[t]]))return!0;return!1}function Gp(e){return!!(Wp(e)||e.variants)}function Kp(e,t,n){for(let r in t){let i=t[r],a=n[r];if(B(i))e.addValue(r,i);else if(B(a))e.addValue(r,Ad(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ad(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var qp={current:null},Jp={current:!1},Yp=typeof window<`u`;function Xp(){if(Jp.current=!0,Yp){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>qp.current=e.matches;e.addEventListener(`change`,t),t()}else qp.current=!1}}var Zp=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Qp={};function $p(e){Qp=e}function em(){return Qp}var tm=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ju,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=F.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,N.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Wp(t),this.isVariantNode=Gp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&B(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,zp.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Jp.current||Xp(),this.shouldReduceMotion=qp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lc(this.notifyUpdate),lc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&_d.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new sd({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ps(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Mu.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&N.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Qp){let t=Qp[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):V()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Zp.length;t++){let n=Zp[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Kp(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Ad(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Es(n)||Os(n))?n=parseFloat(n):typeof n!=`number`&&!il.test(n)&&il.test(t)&&(n=_u(e,t)),this.setBaseTarget(e,B(n)?n.get():n)),B(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Gd(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!B(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Ns),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){$f.render(this.render)}},nm=class extends tm{constructor(){super(...arguments),this.KeyframeResolver=_f}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;B(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},rm=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function im(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function am(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var om={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(I.test(e))e=parseFloat(e);else return e}return`${am(e,t.target.x)}% ${am(e,t.target.y)}%`}},sm={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=il.parse(e);if(i.length>5)return r;let a=il.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=R(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},cm={borderRadius:{...om,applyTo:[...vf]},borderTopLeftRadius:om,borderTopRightRadius:om,borderBottomLeftRadius:om,borderBottomRightRadius:om,boxShadow:sm};function lm(e,{layout:t,layoutId:n}){return Mu.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!cm[e]||e===`opacity`)}function um(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(B(r[t])||i&&B(i[t])||lm(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function dm(e){return window.getComputedStyle(e)}var fm=class extends nm{constructor(){super(...arguments),this.type=`html`,this.renderInstance=im}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Mu.has(t))return this.projection?.isProjecting?Du(t):ku(e,t);{let n=dm(e),r=(hc(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zf(e,t)}build(e,t,n){Ef(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return um(e,t,n)}},pm=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`]),mm=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function hm(e,t,n,r){im(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(pm.has(n)?n:ef(n),t.attrs[n])}function gm(e,t,n){let r=um(e,t,n);for(let n in e)if(B(e[n])||B(t[n])){let t=ju.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var _m=class extends nm{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=V}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Mu.has(t)){let e=hu(t);return e&&e.default||0}if(Af.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=pm.has(t)?t:ef(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return gm(e,t,n)}build(e,t,n){jf(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){hm(e,t,n,r)}mount(e){this.isSVGTag=mm(e.tagName),super.mount(e)}},vm=Up.length;function ym(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ym(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<vm;n++){let r=Up[n],i=e.props[r];(Vp(i)||i===!1)&&(t[r]=i)}return t}function bm(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var xm=[...Hp].reverse(),Sm=Hp.length;function Cm(e){return t=>Promise.all(t.map(({animation:t,options:n})=>lf(e,t,n)))}function wm(e){let t=Cm(e),n=Dm(),r=!0,i=!1,a=t=>(n,r)=>{let i=Kd(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=ym(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Sm;t++){let p=xm[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Vp(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Bp(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Tm(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,ee={...w,...C},te=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in ee){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Jd(t)&&Jd(n)?!bm(t,n)||y:t!==n,r?t==null?u.add(e):te(e):t!==void 0&&u.has(e)?te(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ne=v&&y;b&&(!ne||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ne&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Kd(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Td(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Kd(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Dm(),i=!0}}}function Tm(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!bm(t,e):!1}function Em(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dm(){return{animate:Em(!0),whileInView:Em(),whileHover:Em(),whileTap:Em(),whileDrag:Em(),whileFocus:Em(),exit:Em()}}function Om(e,t){e.min=t.min,e.max=t.max}function km(e,t){Om(e.x,t.x),Om(e.y,t.y)}function Am(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var jm=.9999,Mm=1.0001,Nm=-.01,Pm=.01;function H(e){return e.max-e.min}function Fm(e,t,n){return Math.abs(e-t)<=n}function Im(e,t,n,r=.5){e.origin=r,e.originPoint=R(t.min,t.max,e.origin),e.scale=H(n)/H(t),e.translate=R(n.min,n.max,e.origin)-e.originPoint,(e.scale>=jm&&e.scale<=Mm||isNaN(e.scale))&&(e.scale=1),(e.translate>=Nm&&e.translate<=Pm||isNaN(e.translate))&&(e.translate=0)}function Lm(e,t,n,r){Im(e.x,t.x,n.x,r?r.originX:void 0),Im(e.y,t.y,n.y,r?r.originY:void 0)}function Rm(e,t,n,r=0){e.min=(r?R(n.min,n.max,r):n.min)+t.min,e.max=e.min+H(t)}function zm(e,t,n,r){Rm(e.x,t.x,n.x,r?.x),Rm(e.y,t.y,n.y,r?.y)}function Bm(e,t,n,r=0){let i=r?R(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+H(t)}function Vm(e,t,n,r){Bm(e.x,t.x,n.x,r?.x),Bm(e.y,t.y,n.y,r?.y)}function Hm(e,t,n,r,i){return e-=t,e=Bf(e,1/n,r),i!==void 0&&(e=Bf(e,1/i,r)),e}function Um(e,t=0,n=1,r=.5,i,a=e,o=e){if(Fc.test(t)&&(t=parseFloat(t),t=R(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=R(a.min,a.max,r);e===a&&(s-=t),e.min=Hm(e.min,t,n,s,i),e.max=Hm(e.max,t,n,s,i)}function Wm(e,t,[n,r,i],a,o){Um(e,t[n],t[r],t[i],t.scale,a,o)}var Gm=[`x`,`scaleX`,`originX`],Km=[`y`,`scaleY`,`originY`];function qm(e,t,n,r){Wm(e.x,t,Gm,n?n.x:void 0,r?r.x:void 0),Wm(e.y,t,Km,n?n.y:void 0,r?r.y:void 0)}function Jm(e){return e.translate===0&&e.scale===1}function Ym(e){return Jm(e.x)&&Jm(e.y)}function Xm(e,t){return e.min===t.min&&e.max===t.max}function Zm(e,t){return Xm(e.x,t.x)&&Xm(e.y,t.y)}function Qm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $m(e,t){return Qm(e.x,t.x)&&Qm(e.y,t.y)}function eh(e){return H(e.x)/H(e.y)}function th(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function nh(e){return[e(`x`),e(`y`)]}function rh(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var ih=vf.length,ah=e=>typeof e==`string`?parseFloat(e):e,oh=e=>typeof e==`number`||I.test(e);function sh(e,t,n,r,i,a){i?(e.opacity=R(0,n.opacity??1,lh(r)),e.opacityExit=R(t.opacity??1,0,uh(r))):a&&(e.opacity=R(t.opacity??1,n.opacity??1,r));for(let i=0;i<ih;i++){let a=vf[i],o=ch(t,a),s=ch(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||oh(o)===oh(s)?(e[a]=Math.max(R(ah(o),ah(s),r),0),(Fc.test(s)||Fc.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=R(t.rotate||0,n.rotate||0,r))}function ch(e,t){return e[t]===void 0?e.borderRadius:e[t]}var lh=dh(0,.5,Ys),uh=dh(.5,.95,As);function dh(e,t,n){return r=>r<e?0:r>t?1:n(Ms(e,t,r))}function fh(e,t,n){let r=B(e)?e:Ad(e);return r.start(Bd(``,r,t,n)),r.animation}function ph(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var mh=(e,t)=>e.depth-t.depth,hh=class{constructor(){this.children=[],this.isDirty=!1}add(e){bs(this.children,e),this.isDirty=!0}remove(e){xs(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mh),this.isDirty=!1,this.children.forEach(e)}};function gh(e,t){let n=F.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(lc(r),e(a-t))};return N.setup(r,!0),()=>lc(r)}function _h(e){return B(e)?e.get():e}var vh=class{constructor(){this.members=[]}add(e){bs(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(xs(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(xs(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},yh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},bh={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},xh=[``,`X`,`Y`,`Z`],Sh=1e3,Ch=0;function wh(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Th(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=nf(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,N,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Th(r)}function Eh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ch++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Pp.value&&(bh.nodes=bh.calculatedTargetDeltas=bh.calculatedProjections=0),this.nodes.forEach(kh),this.nodes.forEach(Rh),this.nodes.forEach(zh),this.nodes.forEach(Ah),Pp.addProjectionMetrics&&Pp.addProjectionMetrics(bh)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new hh)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ns),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=bf(t)&&!Fp(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;N.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=gh(i,250),yh.hasAnimatedSinceResize&&(yh.hasAnimatedSinceResize=!1,this.nodes.forEach(Lh)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Kh,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!$m(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Md(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Lh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lc(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(Bh),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Th(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Nh),this.nodes.forEach(Mh);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ph);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fh),this.nodes.forEach(Ih),this.nodes.forEach(Dh),this.nodes.forEach(Oh)):this.nodes.forEach(Ph),this.clearAllSnapshots();let e=F.now();P.delta=Ss(0,1e3/60,e-P.timestamp),P.timestamp=e,P.isProcessing=!0,uc.update.process(P),uc.preRender.process(P),uc.render.process(P),P.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$f.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jh),this.sharedNodes.forEach(Vh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!H(this.snapshot.measuredBox.x)&&!H(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=V(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ym(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Lf(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Xh(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return V();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Qh))){let{scroll:e}=this.root;e&&(qf(t.x,e.offset.x),qf(t.y,e.offset.y))}return t}removeElementScroll(e){let t=V();if(km(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&km(t,e),qf(t.x,i.offset.x),qf(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||V();km(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qf(r.x,-n.scroll.offset.x),qf(r.y,-n.scroll.offset.y)),Lf(n.latestValues)&&Xf(r,n.latestValues,n.layout?.layoutBox)}return Lf(this.latestValues)&&Xf(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=V();km(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Lf(n.latestValues))continue;let r;n.instance&&(If(n.latestValues)&&n.updateSnapshot(),r=V(),km(r,n.measurePageBox())),qm(t,n.latestValues,n.snapshot?.layoutBox,r)}return Lf(this.latestValues)&&qm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==P.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=P.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=V(),this.targetWithTransforms=V()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zm(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):km(this.target,this.layout.layoutBox),Uf(this.target,this.targetDelta)):km(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Pp.value&&bh.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||If(this.parent.latestValues)||Rf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=V(),this.relativeTargetOrigin=V(),Vm(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),km(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===P.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;km(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Kf(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=V());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Am(this.prevProjectionDelta.x,this.projectionDelta.x),Am(this.prevProjectionDelta.y,this.projectionDelta.y)),Lm(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!th(this.projectionDelta.x,this.prevProjectionDelta.x)||!th(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Pp.value&&bh.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Lp(),this.projectionDelta=Lp(),this.projectionDeltaWithTransform=Lp()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Lp();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=V(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Gh));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=R(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=R(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Hh(o.x,e.x,n),Hh(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vm(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Wh(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Zm(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=V(),km(f,this.relativeTarget)),c&&(this.animationValues=a,sh(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(lc(this.pendingAnimation),void 0),this.pendingAnimation=N.update(()=>{yh.hasAnimatedSinceResize=!0,this.motionValue||=Ad(0),this.motionValue.jump(0,!1),this.currentAnimation=fh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),nu(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Sh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Zh(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||V();let t=H(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=H(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}km(t,i),Xf(t,r),Lm(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new vh),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&wh(`z`,e,r,this.animationValues);for(let t=0;t<xh.length;t++)wh(`rotate${xh[t]}`,e,r,this.animationValues),wh(`skew${xh[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=_h(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=_h(t?.pointerEvents)||``),this.hasProjected&&!Lf(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=rh(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in cm){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=cm[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?_h(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Mh),this.root.sharedNodes.clear()}}}function Dh(e){e.updateLayout()}function Oh(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)nh(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=H(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Om(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Zh(i,t.layoutBox,n)&&nh(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=H(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Lp();Lm(o,n,t.layoutBox);let s=Lp();a?Lm(s,e.applyTransform(r,!0),t.measuredBox):Lm(s,n,t.layoutBox);let c=!Ym(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=V();Vm(s,t.layoutBox,i.layoutBox,o);let c=V();Vm(c,n,a.layoutBox,o),$m(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function kh(e){Pp.value&&bh.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ah(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function jh(e){e.clearSnapshot()}function Mh(e){e.clearMeasurements()}function Nh(e){e.isLayoutDirty=!0,e.updateLayout()}function Ph(e){e.isLayoutDirty=!1}function Fh(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Ih(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Lh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Rh(e){e.resolveTargetDelta()}function zh(e){e.calcProjection()}function Bh(e){e.resetSkewAndRotation()}function Vh(e){e.removeLeadSnapshot()}function Hh(e,t,n){e.translate=R(t.translate,0,n),e.scale=R(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Uh(e,t,n,r){e.min=R(t.min,n.min,r),e.max=R(t.max,n.max,r)}function Wh(e,t,n,r){Uh(e.x,t.x,n.x,r),Uh(e.y,t.y,n.y,r)}function Gh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Kh={duration:.45,ease:[.4,0,.1,1]},qh=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jh=qh(`applewebkit/`)&&!qh(`chrome/`)?Math.round:As;function Yh(e){e.min=Jh(e.min),e.max=Jh(e.max)}function Xh(e){Yh(e.x),Yh(e.y)}function Zh(e,t,n){return e===`position`||e===`preserve-aspect`&&!Fm(eh(t),eh(n),.2)}function Qh(e){return e!==e.root&&e.scroll?.wasRoot}var $h=Eh({attachResizeListener:(e,t)=>ph(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),eg={current:void 0},tg=Eh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!eg.current){let e=new $h({});e.mount(window),e.setOptions({layoutScroll:!0}),eg.current=e}return eg.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),ng=(0,D.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function rg(e=!0){let t=(0,D.useContext)(ys);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,D.useId)();(0,D.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,D.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ig=(0,D.createContext)({strict:!1}),ag={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`]},og=!1;function sg(){if(og)return;let e={};for(let t in ag)e[t]={isEnabled:e=>ag[t].some(t=>!!e[t])};$p(e),og=!0}function cg(){return sg(),em()}function lg(e){let t=cg();for(let n in e)t[n]={...t[n],...e[n]};$p(t)}var ug=(0,D.createContext)({});function dg(e,t){if(Wp(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Vp(t)?t:void 0,animate:Vp(n)?n:void 0}}return e.inherit===!1?{}:t}function fg(e){let{initial:t,animate:n}=dg(e,(0,D.useContext)(ug));return(0,D.useMemo)(()=>({initial:t,animate:n}),[pg(t),pg(n)])}function pg(e){return Array.isArray(e)?e.join(` `):e}var mg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hg(e,t,n){for(let r in t)!B(t[r])&&!lm(r,n)&&(e[r]=t[r])}function gg({transformTemplate:e},t){return(0,D.useMemo)(()=>{let n=mg();return Ef(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _g(e,t){let n=e.style||{},r={};return hg(r,n,e),Object.assign(r,gg(e,t)),r}function vg(e,t){let n={},r=_g(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var yg=()=>({...mg(),attrs:{}});function bg(e,t,n,r){let i=(0,D.useMemo)(()=>{let n=yg();return jf(n,t,mm(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};hg(t,e.style,e),i.style={...t,...i.style}}return i}var xg=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Sg(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||xg.has(e)}function Cg(e,t){return e.startsWith(`on`)?!Sg(e):t?.(e)??!Sg(e)}function wg(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(B(e[a])||(Cg(a,r)||n===!0&&Sg(a)||!t&&!Sg(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Tg=[`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 Eg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Tg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Dg(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Eg(e)?bg:vg)(t,r,i,e),l=wg(t,typeof e==`string`,a,s),u=e===D.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,D.useMemo)(()=>B(d)?d.get():d,[d]);return(0,D.createElement)(e,{...u,children:f})}function Og({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:kg(n,r,i,e),renderState:t()}}function kg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=_h(a[e]);let{initial:o,animate:s}=e,c=Wp(e),l=Gp(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Bp(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Gd(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Ag=e=>(t,n)=>{let r=(0,D.useContext)(ug),i=(0,D.useContext)(ys),a=()=>Og(e,t,r,i);return n?a():_s(a)},jg=Ag({scrapeMotionValuesFromProps:um,createRenderState:mg}),Mg=Ag({scrapeMotionValuesFromProps:gm,createRenderState:yg}),Ng=Symbol.for(`motionComponentSymbol`);function Pg(e,t,n){let r=(0,D.useRef)(n);(0,D.useInsertionEffect)(()=>{r.current=n});let i=(0,D.useRef)(null);return(0,D.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Fg=(0,D.createContext)({});function Ig(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Lg(e,t,n,r,i,a){let{visualElement:o}=(0,D.useContext)(ug),s=(0,D.useContext)(ig),c=(0,D.useContext)(ys),l=(0,D.useContext)(ng),u=l.reducedMotion,d=l.skipAnimations,f=(0,D.useRef)(null),p=(0,D.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,D.useContext)(Fg);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Rg(f.current,n,i,h);let g=(0,D.useRef)(!1);(0,D.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[tf],v=(0,D.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return vs(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,D.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Rg(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:zg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ig(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function zg(e){if(e)return e.options.allowProjection===!1?zg(e.parent):e.projection}function Bg(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&lg(r);let a=n?n===`svg`:Eg(e),o=a?Mg:jg;function s(n,s){let c,l={...(0,D.useContext)(ng),...n,layoutId:Vg(n)},{isStatic:u,isValidProp:d}=l,f=fg(n),p=o(n,u);if(!u&&typeof window<`u`){Hg(l,r);let t=Ug(l);c=t.MeasureLayout,f.visualElement=Lg(e,p,l,i,t.ProjectionNode,a)}return(0,A.jsxs)(ug.Provider,{value:f,children:[c&&f.visualElement?(0,A.jsx)(c,{visualElement:f.visualElement,...l}):null,Dg(e,n,Pg(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,D.forwardRef)(s);return c[Ng]=e,c}function Vg({layoutId:e}){let t=(0,D.useContext)(gs).id;return t&&e!==void 0?t+`-`+e:e}function Hg(e,t){(0,D.useContext)(ig).strict}function Ug(e){let{drag:t,layout:n}=cg();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Wg(e,t){if(typeof Proxy>`u`)return Bg;let n=new Map,r=(n,r)=>Bg(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Bg(a,void 0,e,t)),n.get(a))})}var Gg=(e,t)=>t.isSVG??Eg(e)?new _m(t):new fm(t,{allowProjection:e!==D.Fragment}),Kg=class extends rm{constructor(e){super(e),e.animationState||=wm(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Bp(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},qg=0,Jg={animation:{Feature:Kg},exit:{Feature:class extends rm{constructor(){super(...arguments),this.id=qg++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Kd(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Yg(e){return{point:{x:e.pageX,y:e.pageY}}}var Xg=e=>t=>cp(t)&&e(t,Yg(t));function Zg(e,t,n,r){return ph(e,t,Xg(n),r)}var Qg=({current:e})=>e?e.ownerDocument.defaultView:null,$g=(e,t)=>Math.abs(e-t);function e_(e,t){let n=$g(e.x,t.x),r=$g(e.y,t.y);return Math.sqrt(n**2+r**2)}var t_=new Set([`auto`,`scroll`]),n_=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=r_(this.lastRawMoveEventInfo,this.transformPagePoint));let e=a_(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=e_(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=P;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=r_(t,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=a_(e.type===`pointercancel`?this.lastMoveEventInfo:r_(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!cp(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=r_(Yg(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=P;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,a_(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=js(Zg(this.contextWindow,`pointermove`,this.handlePointerMove,d),Zg(this.contextWindow,`pointerup`,this.handlePointerUp,d),Zg(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(t_.has(e.overflowX)||t_.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),N.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),lc(this.updatePoint)}};function r_(e,t){return t?{point:t(e.point)}:e}function i_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function a_({point:e},t){return{point:e,delta:i_(e,s_(t)),offset:i_(e,o_(t)),velocity:c_(t,.1)}}function o_(e){return e[0]}function s_(e){return e[e.length-1]}function c_(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=s_(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ps(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ps(t)*2&&(r=e[1]);let a=Fs(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function l_(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?R(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?R(n,e,r.max):Math.min(e,n)),e}function u_(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function d_(e,{top:t,left:n,bottom:r,right:i}){return{x:u_(e.x,n,i),y:u_(e.y,t,r)}}function f_(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 p_(e,t){return{x:f_(e.x,t.x),y:f_(e.y,t.y)}}function m_(e,t){let n=.5,r=H(e),i=H(t);return i>r?n=Ms(t.min,t.max-r,e.min):r>i&&(n=Ms(e.min,e.max-i,t.min)),Ss(0,1,n)}function h_(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var g_=.35;function __(e=g_){return e===!1?e=0:e===!0&&(e=g_),{x:v_(e,`left`,`right`),y:v_(e,`top`,`bottom`)}}function v_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e==`number`?e:e[t]||0}var b_=new WeakMap,x_=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=V(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Yg(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rp(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nh(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Fc.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=H(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&N.update(()=>i(e,t),!1,!0),$d(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=T_(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&N.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new n_(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Qg(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&N.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!w_(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=l_(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Ig(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?d_(n.layoutBox,e):!1,this.elastic=__(t),r!==this.constraints&&!Ig(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&nh(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=h_(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ig(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Qf(n,r.root,this.visualElement.getTransformPagePoint()),a=p_(r.layout.layoutBox,i);if(t){let e=t(Nf(a));this.hasMutatedConstraints=!!e,e&&(a=Mf(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=nh(o=>{if(!w_(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return $d(this.visualElement,e),n.start(Bd(e,n,0,t,this.visualElement,!1))}stopAnimation(){nh(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){nh(t=>{let{drag:n}=this.getProps();if(!w_(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-R(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Ig(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};nh(e=>{let t=this.getAxisMotionValue(e).get();i[e]=m_({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),nh(t=>{let n=this.getAxisMotionValue(t);if(!w_(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(R(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;b_.set(this.visualElement,this);let e=this.visualElement.current,t=Zg(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&fp(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Ig(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=C_(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),N.read(r);let o=ph(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nh(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=g_,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function S_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function C_(e,t,n){let r=Np(e,S_(n)),i=Np(t,S_(n));return()=>{r(),i()}}function w_(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function T_(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var E_=class extends rm{constructor(e){super(e),this.removeGroupControls=As,this.removeListeners=As,this.controls=new x_(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||As}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},D_=e=>(t,n)=>{e&&N.update(()=>e(t,n),!1,!0)},O_=class extends rm{constructor(){super(...arguments),this.removePointerDownListener=As}onPointerDown(e){this.session=new n_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qg(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:D_(e),onStart:D_(t),onMove:D_(n),onEnd:(e,t)=>{delete this.session,r&&N.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Zg(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},k_=!1,A_=class extends D.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),k_&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),k_=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||N.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),$f.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;k_=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function j_(e){let[t,n]=rg(),r=(0,D.useContext)(gs);return(0,A.jsx)(A_,{...e,layoutGroup:r,switchLayoutGroup:(0,D.useContext)(Fg),isPresent:t,safeToRemove:n})}var M_={pan:{Feature:O_},drag:{Feature:E_,ProjectionNode:tg,MeasureLayout:j_}};function N_(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&N.postRender(()=>i(t,Yg(t)))}var P_=class extends rm{mount(){let{current:e}=this.node;e&&(this.unmount=op(e,(e,t)=>(N_(this.node,t,`Start`),e=>N_(this.node,e,`End`))))}unmount(){}},F_=class extends rm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=js(ph(this.node.current,`focus`,()=>this.onFocus()),ph(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function I_(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&N.postRender(()=>i(t,Yg(t)))}var L_=class extends rm{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=yp(e,(e,t)=>(I_(this.node,t,`Start`),(e,{success:t})=>I_(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},R_=new WeakMap,z_=new WeakMap,B_=e=>{let t=R_.get(e.target);t&&t(e)},V_=e=>{e.forEach(B_)};function H_({root:e,...t}){let n=e||document;z_.has(n)||z_.set(n,{});let r=z_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(V_,{root:e,...t})),r[i]}function U_(e,t,n){let r=H_(t);return R_.set(e,n),r.observe(e),()=>{R_.delete(e),r.unobserve(e)}}var W_={some:0,all:1},G_=class extends rm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:W_[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=U_(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(K_(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function K_({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var q_={inView:{Feature:G_},tap:{Feature:L_},focus:{Feature:F_},hover:{Feature:P_}},J_={layout:{ProjectionNode:tg,MeasureLayout:j_}},Y_=Wg({...Jg,...q_,...M_,...J_},Gg);function X_(){!Jp.current&&Xp();let[e]=(0,D.useState)(qp.current);return e}var Z_=Y_,Q_=[1,.78,.54,.32,.16],$_=36;function ev({className:e}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 20 28`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,A.jsx)(`circle`,{cx:`4`,cy:`4`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`10`,cy:`9`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`16`,cy:`14`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`10`,cy:`19`,r:`2`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`4`,cy:`24`,r:`2`,fill:`currentColor`})]})}var tv=(0,D.forwardRef)(function({children:e,className:t,accentClassName:n,labelClassName:r,expand:i=!0,disabled:a,onMouseEnter:o,onMouseLeave:s,onFocus:c,onBlur:l,...u},d){let p=X_(),m=hs(),[h,g]=(0,D.useState)(!1),[_,v]=(0,D.useState)(!1),y=!!(i&&!a&&(m&&h||_)),b=p?{duration:0}:ms;return(0,A.jsxs)(Z_.button,{ref:d,type:`button`,disabled:a,onMouseEnter:e=>{g(!0),o?.(e)},onMouseLeave:e=>{g(!1),s?.(e)},onFocus:e=>{v(!0),c?.(e)},onBlur:e=>{v(!1),l?.(e)},whileTap:p||a?void 0:{scale:.98},transition:ds,className:f(`relative inline-flex h-11 w-full items-center overflow-hidden rounded-none bg-primary p-1 text-primary-foreground select-none`,`outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,`disabled:pointer-events-none disabled:opacity-50`,t),...u,children:[i?(0,A.jsxs)(Z_.span,{layout:`size`,"aria-hidden":!0,transition:b,style:{width:y?`calc(100% - 8px)`:$_,borderRadius:0},className:f(`absolute inset-y-1 left-1 z-10 overflow-hidden bg-background text-foreground`,n),children:[(0,A.jsx)(Z_.span,{animate:{opacity:+!y},transition:{duration:p?0:.1,ease:us},className:`absolute inset-0 grid place-items-center`,children:(0,A.jsx)(ev,{className:`h-5 w-3.5`})}),(0,A.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-around px-3`,children:Q_.map((e,t)=>(0,A.jsx)(Z_.span,{animate:{opacity:y?e:0,transform:y&&!p?`translateX(0px)`:`translateX(-6px)`},transition:{duration:p?0:.18,delay:y&&!p?.04+t*.025:0,ease:us},className:`inline-grid place-items-center`,children:(0,A.jsx)(ev,{className:`h-5 w-3.5`})},e))})]}):null,(0,A.jsx)(Z_.span,{animate:{opacity:+!y,transform:y&&!p?`translateX(6px)`:`translateX(0px)`},transition:{duration:p?0:.12,ease:us},className:f(`relative z-0 flex w-full items-center justify-center text-sm font-medium text-primary-foreground`,i&&`pr-3 pl-11`,r),children:e})]})});function nv({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`skeleton`,className:f(`animate-pulse rounded-md bg-muted`,e),...t})}var rv=`flex w-full flex-col rounded-none border border-border bg-card text-card-foreground`,iv=`gap-0 border-t border-border/60`,av=`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 gap-y-1 border-b border-border/60 px-5 py-3.5 last:border-b-0 data-[invalid=true]:border-destructive`,ov=`h-8 rounded-none border-0 bg-transparent px-0 text-sm shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent autofill:bg-transparent autofill:shadow-none`,sv=`col-start-2 min-w-0`,cv=`text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase group-focus-within/field:text-foreground`;function lv(e){return e.pending?`loading`:e.success?`success`:e.error?`error`:`idle`}function uv({state:e=`idle`,children:t,loadingText:n=`Loading`,successText:r=`Done`,errorText:i=`Try again`,disabled:o,...s}){let c=e===`loading`,l=e===`loading`?n:e===`success`?r:e===`error`?i:t,u=e===`loading`?Qo:e===`success`?ee:e===`error`?be:null;return(0,A.jsx)(tv,{disabled:o||c,expand:e===`idle`,"aria-busy":c||void 0,"data-slot":`auth-submit`,...s,children:(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u?(0,A.jsx)(a,{icon:u,size:16,color:`currentColor`,strokeWidth:1.5,className:e===`loading`?`animate-spin`:void 0,"aria-hidden":!0}):null,l]})})}var dv={neutral:`bg-foreground/35`,open:`bg-foreground`,alert:`bg-destructive`};function fv({label:e,tone:t=`neutral`}){return(0,A.jsxs)(`p`,{className:f(cv,`flex h-10 shrink-0 items-center gap-1.5 border-b border-border/60 px-5 group-focus-within/field:text-muted-foreground`),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(`size-1.5 rounded-[1px]`,dv[t])}),e]})}var pv=`pointer-events-none absolute size-3 border-foreground/50`;function mv(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-top-1.5 -left-1.5 border-t border-l`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-top-1.5 -right-1.5 border-t border-r`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-bottom-1.5 -left-1.5 border-b border-l`)}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:f(pv,`-right-1.5 -bottom-1.5 border-r border-b`)})]})}function hv({title:e,description:t,status:n,children:r,footer:i,className:a}){let o=(0,D.useId)(),s=`auth-title-${o}`,c=t?`auth-desc-${o}`:void 0,l=X_()??!1;return(0,A.jsxs)(Z_.div,{"data-slot":`auth-card`,initial:!l&&{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:l?0:.42,ease:us},className:f(`relative flex w-full flex-col gap-4`,a),children:[(0,A.jsx)(mv,{}),(0,A.jsxs)(`div`,{"data-auth-layer":`0`,className:rv,children:[n?(0,A.jsx)(fv,{...n}):null,(0,A.jsxs)(`header`,{"data-auth-layer":`1`,className:f(`flex flex-col gap-3 px-5`,n?`pt-7`:`pt-6`),children:[(0,A.jsx)(`h1`,{id:s,className:`text-[1.75rem] leading-none font-semibold tracking-[-0.03em] text-foreground`,children:e}),t?(0,A.jsx)(`p`,{id:c,className:`text-[13px] leading-snug text-muted-foreground`,children:t}):null]}),(0,A.jsx)(`div`,{className:`mt-7 flex flex-col pb-1`,children:typeof r==`function`?r({titleId:s,descriptionId:c}):r})]}),i?(0,A.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:i}):null]})}function gv(){return(0,A.jsxs)(`div`,{"data-slot":`auth-card`,className:`relative flex w-full flex-col gap-4`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:`Checking setup…`}),(0,A.jsx)(mv,{}),(0,A.jsxs)(`div`,{"data-auth-layer":`0`,className:rv,children:[(0,A.jsx)(`div`,{className:`flex h-10 shrink-0 items-center border-b border-border/60 px-5`,children:(0,A.jsx)(nv,{className:`h-3 w-24 rounded-none`})}),(0,A.jsxs)(`header`,{"data-auth-layer":`1`,className:`flex flex-col gap-3 px-5 pt-7`,children:[(0,A.jsx)(nv,{className:`h-7 w-36 rounded-none`}),(0,A.jsx)(nv,{className:`h-4 w-full rounded-none`})]}),(0,A.jsx)(`div`,{className:`mt-7 flex flex-col border-t border-border/60 pb-1`,children:Array.from({length:2},(e,t)=>(0,A.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 border-b border-border/60 px-5 py-3.5 last:border-b-0`,children:[(0,A.jsx)(nv,{className:`h-3 w-14 rounded-none`}),(0,A.jsx)(nv,{className:`h-8 w-full rounded-none`})]},t))})]}),(0,A.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:(0,A.jsx)(nv,{className:`h-11 w-full rounded-none`})})]})}var _v=(0,D.createContext)({theme:`system`,setTheme:()=>null});function vv({children:e,defaultTheme:t=`system`,storageKey:n=`oke-console-theme`,...r}){let[i,a]=(0,D.useState)(()=>localStorage.getItem(n)||t);(0,D.useEffect)(()=>{let e=window.document.documentElement,t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let n=i===`system`?t.matches?`dark`:`light`:i;e.classList.remove(`light`,`dark`),e.classList.add(n)};if(n(),i===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[i]);let o={theme:i,setTheme:e=>{localStorage.setItem(n,e),a(e)}};return(0,A.jsx)(_v.Provider,{...r,value:o,children:e})}function yv(){let e=(0,D.useContext)(_v);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}var bv=[{value:`light`,label:`Light`,icon:os},{value:`dark`,label:`Dark`,icon:es},{value:`system`,label:`System`,icon:Xo}];function xv(){let{theme:e,setTheme:t}=yv();return(0,A.jsx)(`div`,{role:`group`,"aria-label":`Theme`,"data-slot":`mode-toggle`,className:`flex h-10 items-stretch`,children:bv.map(n=>{let r=e===n.value;return(0,A.jsxs)(l,{disabled:r,children:[(0,A.jsx)(p,{render:e=>(0,A.jsxs)(`button`,{...e,type:`button`,"aria-label":n.label,"aria-pressed":r,onClick:r=>{e.onClick?.(r),t(n.value)},className:f(je,`font-semibold tracking-[0.08em] uppercase`,r?Ge:bt,e.className),children:[(0,A.jsx)(a,{icon:n.icon,className:`size-3`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?n.label:null]})}),(0,A.jsx)(u,{side:`top`,sideOffset:6,children:n.label})]},n.value)})})}function Sv({className:e,...t}){return(0,A.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 327 87`,fill:`none`,role:`img`,"aria-label":`OKE`,className:f(`text-foreground`,e),...t,children:[(0,A.jsx)(`path`,{d:`M231.08 84.672V0H320.648V13.824H250.088V33.696H303.944V47.952H250.088V70.848H321.224L326.984 83.088C326.984 83.472 325.688 83.856 323.096 84.24C320.504 84.528 316.04 84.672 309.704 84.672H231.08Z`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M136.638 13.672V36.864H144.702C146.622 36.864 148.206 36.624 149.454 36.144C150.702 35.664 151.854 34.896 152.91 33.84C155.598 31.152 158.67 27.792 162.126 23.76C165.582 19.728 168.942 15.6 172.206 11.376C175.566 7.05599 178.446 3.264 180.846 0H204.174L198.27 8.64C195.582 11.424 192.702 14.448 189.63 17.712C186.558 20.976 183.534 24.192 180.558 27.36C177.582 30.432 174.894 33.168 172.494 35.568C170.094 37.872 168.318 39.552 167.166 40.608C169.758 41.472 172.11 42.576 174.222 43.92C176.43 45.264 179.118 47.232 182.286 49.824C184.686 51.744 186.99 53.712 189.198 55.728C191.502 57.744 194.142 60.144 197.118 62.928C200.478 66 203.646 68.256 206.622 69.696C209.598 71.136 212.094 72.048 214.11 72.432C216.222 72.816 217.566 73.008 218.142 73.008L215.262 84.672C214.974 84.96 214.11 85.248 212.67 85.536C211.23 85.92 209.166 86.112 206.478 86.112C201.774 86.112 197.694 85.152 194.238 83.232C190.782 81.312 187.374 78.72 184.014 75.456C180.366 71.616 175.95 67.2 170.766 62.208C168.366 59.712 165.918 57.648 163.422 56.016C160.926 54.384 158.094 53.136 154.926 52.272C151.854 51.408 148.014 50.976 143.406 50.976H136.638V70.672H117.63V13.672H136.638Z`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})]})}function Cv({className:e,...t}){return(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 95 85`,fill:`none`,role:`img`,"aria-label":`OKE`,className:f(`text-foreground`,e),...t,children:(0,A.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})})}function wv({children:e}){return(0,A.jsxs)(`div`,{className:`flex min-h-dvh w-full flex-col bg-background`,"data-slot":`console-chrome`,children:[(0,A.jsx)(`main`,{className:`mx-auto flex w-full max-w-md flex-1 flex-col justify-center px-4 py-10`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-stretch gap-10`,children:[(0,A.jsx)(Sv,{className:`h-7 w-auto self-center`}),e]})}),(0,A.jsxs)(`footer`,{className:`grid h-10 shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-stretch border-t border-border/60`,children:[(0,A.jsx)(`p`,{className:`flex min-w-0 items-center truncate px-2 text-[10px] font-medium text-muted-foreground`,children:`OKE | Console`}),(0,A.jsx)(xv,{}),(0,A.jsxs)(`p`,{className:`${nt} flex min-w-0 items-center justify-end gap-1.5 px-2`,children:[(0,A.jsx)(a,{icon:Zo,size:12,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),(0,A.jsxs)(`span`,{children:[`v`,`0.23.2`]})]})]})]})}function Tv(){return(0,A.jsx)(wv,{children:(0,A.jsxs)(`div`,{"data-slot":`not-found`,children:[(0,A.jsx)(`p`,{className:cv,children:`404`}),(0,A.jsx)(`h1`,{className:`mt-3 text-2xl font-semibold tracking-tight`,children:`Page not found`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`This URL is not a Console page.`})]})})}var Ev=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Dv(e,t){return new Ev(e,t).maybeExecute}var Ov=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},kv=new class extends Ov{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Av(e,t){return typeof e==`function`?e(t):e}function jv(e,t){return zv(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function Mv(e,t,n){let r=zv(t);function i(e){if(!r.length)return Av(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Nv(e,t){let n=zv(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Pv=46,Fv=91,Iv=93,Lv=48,Rv=57;function zv(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===Fv),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===Pv||s===Fv||s===Iv){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==Lv),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==Iv&&(a!==-1||s!==Iv)&&(a!==s||s!==Pv&&s!==Fv)&&n.push(``);r=o+1,i=!0}else(s<Lv||s>Rv)&&(i=!1);a=s}return n.length||n.push(``),n}function Bv(e){return!(Array.isArray(e)&&e.length===0)}function Vv(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Hv(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Uv=e=>!!e&&typeof e==`object`&&`fields`in e;function Wv(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Wv(e[i],t[i]))return!1;return!0}var Gv=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Kv=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function U(e,t){return e==null?t:{...e,...t}}for(var qv=256,Jv=[],Yv;qv--;)Jv[qv]=(qv+256).toString(16).substring(1);function Xv(){let e=0,t,n=``;if(!Yv||qv+16>256){for(Yv=Array(256),e=256;e--;)Yv[e]=256*Math.random()|0;e=0,qv=0}for(;e<16;e++)t=Yv[qv+e],n+=e===6?Jv[t&15|64]:e===8?Jv[t&63|128]:Jv[t],e&1&&e>1&&e<11&&(n+=`-`);return qv++,n}var Zv=Dv(e=>kv.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function Qv(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=Qv(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,Qv(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(Qv(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Qv(e[n]));return t}function $v(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var ey=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function ty(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var ny=(e,t)=>{let n=ty(e,t);return{form:n,fields:n}},ry={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:ny(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:ny(r.issues,e)}},iy=e=>!!e&&`~standard`in e,W={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function ay(e){function t(t){let n=e.getFieldMeta(t)??W;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>W;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function oy(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var sy=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Zv(this)}),t=kv.on(`request-form-state`,e=>{e.payload.id===this._formId&&kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=kv.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=kv.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),kv.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Wv(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Wv(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(j(()=>{this.baseStore.setState(()=>oy(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=ay(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}kv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=Mv(t,e.instance.name,e.instance.options.defaultValue))}),oy({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return j(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return j(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Vv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||ey}),r=!1,i={};return j(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=cy(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=ly(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=a?.[e],{newErrorValue:s,newSource:c}=Gv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=ly(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=ly(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=Hv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||ey});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=ly(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=cy(r);s&&(i=i?{...i,...s}:s);let c=ly(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=i?.[e],{newErrorValue:a,newSource:o}=Gv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),j(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}j(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),j(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),kv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>jv(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:Av(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=W,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;j(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:Mv(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Nv(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),ay(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],U(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),ay(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),U(r,{dontValidate:!0})),ay(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),U(n,{dontValidate:!0})),ay(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return Mv(Mv(e,`${t}`,i),`${n}`,r)},U(r,{dontValidate:!0})),ay(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},U(r,{dontValidate:!0})),ay(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],U(t,{dontValidate:!0})),ay(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=jv(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:W},values:i===void 0?t.values:Mv(t.values,e,i)}})},this.setErrorMap=e=>{j(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Uv(t)){let{formError:e,fieldErrors:r}=cy(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>ry.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>ry.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Xv(),this._devtoolsSubmissionOverride=!1;let t=oy({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Uv(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=Ii(t);let n;this.fieldMetaDerived=Ii(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=jv(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!Bv(u),f=!o.isDirty,p=Wv(l,this.getFieldInfo(a)?.instance?.options.defaultValue??jv(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=Ii(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!$v(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&$v(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let ee={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(ee,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=ee}return r});let r;this.store=Ii(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Uv(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Wv(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return iy(e.validate)?ry[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function cy(e){return e?Uv(e)?{formError:cy(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function ly(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var uy=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...W,isTouched:e.fieldMetaBase[this.name]?.isTouched??W.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??W.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??W.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Wv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,U(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Vv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||ey}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Vv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;j(()=>{let e=(e,n)=>{let r=fy(n.cause),a=n.validate?dy(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Kv({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=fy(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Hv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||ey}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=Hv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));j(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=fy(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=dy(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Kv({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),j(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[fy(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[fy(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>ry.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>ry.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)$v(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=Ii(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...W,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return iy(e.validate)?ry[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function dy(e){if(e)return e}function fy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function py(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function my(e){return{...W,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var hy=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??py({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Wv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...W,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??py({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;_y(t)&&(n=t.group,r=t.fields);let i=gy(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:py({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof uy&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&$v(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Gv({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=W)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Vv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||ey}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Vv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;j(()=>{let t=(t,r)=>{let i=yy(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&_y(s)&&(c=s.group,l=s.fields);let u=gy(c),d=n[i],{newErrorValue:f,newSource:p}=Kv({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=yy(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=Hv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||ey}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=Hv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||ey});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=yy(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&_y(o)&&(l=o.group,u=o.fields);let d=gy(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Kv({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return j(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[yy(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>$v(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),j(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}j(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),j(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=Ii(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??my(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(iy(e.validate)){let t=ry[e.type](e.value,e.validate);return e.type===`validate`?vy(t):t.then(vy)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function gy(e){if(e)return e}function _y(e){return!!e&&typeof e==`object`&&`fields`in e}function vy(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function yy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function by(e,t){if(!t)return;let n=Object.assign({},e,{state:Qv(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return j(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var xy=typeof window<`u`?D.useLayoutEffect:D.useEffect;function Sy(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new uy({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new uy({...e}),i(a),n({form:e.form,name:e.name}));let o=E(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=E(a.store,e=>e.meta.isTouched),c=E(a.store,e=>e.meta.isBlurred),l=E(a.store,e=>e.meta.isDirty),u=E(a.store,e=>e.meta.errorMap),d=E(a.store,e=>e.meta.errorSourceMap),f=E(a.store,e=>e.meta.isValidating),p=(0,D.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return xy(a.mount,[a]),xy(()=>{a.update(e)}),p}var Cy=(({children:e,...t})=>{let n=Sy(t),r=(0,D.useMemo)(()=>Av(e,n),[e,n]);return(0,A.jsx)(A.Fragment,{children:r})});function wy(){return(0,D.useState)(()=>Xv())[0]}var Ty=D,Ey=`19.3.0`.split(`.`)[0]===`17`?wy:Ty.useId;function Dy(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new hy({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new hy({...e})),n({form:e.form,name:e.name}));let a=E(r.store,e=>e.value),o=E(r.store,e=>e.meta.isTouched),s=E(r.store,e=>e.meta.isBlurred),c=E(r.store,e=>e.meta.isDirty),l=E(r.store,e=>e.meta.errorMap),u=E(r.store,e=>e.meta.errorSourceMap),d=E(r.store,e=>e.meta.isValidating),f=E(r.store,e=>e.meta.isSubmitting),p=E(r.store,e=>e.meta.isSubmitted),m=E(r.store,e=>e.meta.submissionAttempts),h=E(r.store,e=>e.meta.isSubmitSuccessful),g=E(r.store,e=>e.meta.canSubmit),_=E(r.store,e=>e.meta.isValid),v=E(r.store,e=>e.meta.isFieldsValid),y=E(r.store,e=>e.meta.isFieldsValidating),b=E(r.store,e=>e.meta.isGroupValid),x=(0,D.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return xy(r.mount,[r]),xy(()=>{r.update(e)}),x}var Oy=(({children:e,...t})=>{let n=Dy(t),r=(0,D.useMemo)(()=>Av(e,n),[e,n]);return(0,A.jsx)(A.Fragment,{children:r})});function ky({form:e,selector:t=e=>e,children:n}){let r=E(e.store,t);return(0,A.jsx)(A.Fragment,{children:Av(n,r)})}function Ay(e){let t=Ey(),[n,r]=(0,D.useState)(e?.formId),[i,a]=(0,D.useState)(()=>new sy({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new sy({...e,formId:n})),r(n)}let o=(0,D.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,A.jsx)(Cy,{...e,form:i})},e.FormGroup=function(e){return(0,A.jsx)(Oy,{...e,form:i})},e.Subscribe=function(e){return(0,A.jsx)(ky,{form:i,selector:e.selector,children:e.children})},e},[i]);xy(i.mount,[]),xy(()=>{i.update(e)});let s=(0,D.useRef)(!1);return xy(()=>{s.current&&e?.transform&&by(i,e.transform)},[i,e?.transform]),xy(()=>{s.current=!0}),o}function jy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function My(e,t=`|`){return e.map(e=>nb(e)).join(t)}function Ny(e,t){return typeof t==`bigint`?t.toString():t}var Py=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Fy(e){return new Py(e)}function Iy(e){return e==null}function Ly(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ry(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zy(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function By(e){return zy(e._zod.def)??e._zod.def.shape}function Vy(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ry(this,t,e),e},enumerable:!0,configurable:!0})}function Hy(e,t,n){t in e?Ry(e,t,n):e[t]=n}function Uy(e,t,n,r){let i=By(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Vy(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Hy(e,a,r?r(n.value,a):n.value))}}function Wy(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Vy(e,n,()=>t[n]):Hy(e,n,r.value))}}function Gy(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ky(e){return JSON.stringify(e)}function qy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Jy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Yy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Xy=Fy(()=>{if(Wb.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Zy(e){if(Yy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Yy(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Qy(e){return Zy(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var $y=new Set([`string`,`number`,`symbol`]);function eb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function tb(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 nb(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function rb(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ib={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ab={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ob(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Uy(i,e,sb(e,t)),tb(e,Gy(n,{shape:i,checks:[]}))}function sb(e,t){let n=By(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function cb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(sb(e,t)),a={};return Uy(a,e,Reflect.ownKeys(By(e)).filter(e=>!i.has(e))),tb(e,Gy(n,{shape:a,checks:[]}))}function lb(e,t){if(!Zy(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=By(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return tb(e,Gy(e._zod.def,{shape:ub(e,t)}))}function ub(e,t){let n={};return Uy(n,e,Reflect.ownKeys(By(e))),Wy(n,t),n}function db(e,t){if(!Zy(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return tb(e,Gy(e._zod.def,{shape:ub(e,t)}))}function fb(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Uy(n,e,Reflect.ownKeys(By(e))),Uy(n,t,Reflect.ownKeys(By(t))),tb(e,Gy(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function pb(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(sb(t,n)):void 0,o={};return Uy(o,t,Reflect.ownKeys(By(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),tb(t,Gy(t._zod.def,{shape:o,checks:[]}))}function mb(e,t,n){let r=n?new Set(sb(t,n)):void 0,i={};return Uy(i,t,Reflect.ownKeys(By(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),tb(t,Gy(t._zod.def,{shape:i}))}function hb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function gb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function _b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function vb(e){return typeof e==`string`?e:e?.message}function yb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function bb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:vb(e.inst?._zod.def?.error?.(e))??vb(a?.(e))??vb(t?.error?.(e))??vb(n.customError?.(e))??vb(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var xb=/[\uD800-\uDBFF]/;function Sb(e){let t=e.length;if(!xb.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Cb(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wb(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Tb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Eb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ab(e,n,r.value)}}function Db(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ob(e,t,n){return Db(e,t,n,!1)}function kb(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Db(this,n,r(this))},set(e){Db(this,n,e)}})}return t}function Ab(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Db(this,t,n.bind(this))},set(e){Db(this,t,e)}})}function jb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Mb,Nb=!1,Pb={configurable:!0,get(){Nb=!0}};function K(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Mb!==e._zod){Mb=void 0;return}Mb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Pb);let e=Nb;Nb=!1;try{let r=n(this);return Nb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Nb||=e,r}catch(n){throw delete this[t],Nb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Fb(e,t,n,r){let i=jb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ib=`~constantCatch`;function Lb(e){let t=()=>e;return t[Ib]=!0,t}var Rb,zb={value:void 0,enumerable:!1},Bb=`captureStackTrace`in Error?Error:null;function Vb(e){let t=Bb;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Bb=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function q(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){zb.value=new a(r);try{Object.defineProperty(n,"_zod",zb)}finally{zb.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Eb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Vb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Hb=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ub=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Rb=globalThis).__zod_globalConfig??(Rb.__zod_globalConfig={});var Wb=globalThis.__zod_globalConfig;function Gb(e){return e&&Object.assign(Wb,e),Wb}function Kb(){let e=this._zod;return e.message??=JSON.stringify(e.def,Ny,2),e.message}function qb(e){this._zod.message=e}var Jb={get:Kb,set:qb,enumerable:!0,configurable:!0},Yb={value:void 0,enumerable:!1},Xb=new WeakSet([Object.prototype,Error.prototype]),Zb=(e,t)=>{e.name=`$ZodError`,Yb.value=t,Object.defineProperty(e,"issues",Yb),Yb.value=void 0,Object.defineProperty(e,"message",Jb);let n=Object.getPrototypeOf(e);Xb.has(n)||(Xb.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Qb=q(`$ZodError`,Zb);q(`$ZodError`,Zb,void 0,{Parent:Error});function $b(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ex(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?$b(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function tx(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function nx(e,t){return{callee:t?.callee??e,Err:t?.Err}}var rx=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Hb;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>bb(e,o,Gb())));throw Jy(n,a?.callee??t),n}return s.value};return t},ix=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>bb(e,o,Gb())));throw Jy(n,a?.callee??t),n}return s.value};return t},ax=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Hb;return a.issues.length?ox(e,a.issues,i):{success:!0,data:a.value}};function ox(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>bb(e,n,Gb()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var sx=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?ox(e,a.issues,i):{success:!0,data:a.value}},cx=Symbol.for(`zod.compile.invalid`),lx=Symbol.for(`zod.compile.fallback`),ux=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==cx)return!0;if(r.definite===!0&&n===void 0)return!1}return dx(e,t,n)});function dx(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[lx]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Hb;return a.issues.length===0}var fx=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},px=e=>{let t=rx(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,nx(n,a))};return n},mx=e=>{let t=rx(e),n=(e,r,i,a)=>t(e,r,i,nx(n,a));return n},hx=e=>{let t=ix(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,nx(n,a))};return n},gx=e=>{let t=ix(e),n=async(e,r,i,a)=>await t(e,r,i,nx(n,a));return n},_x=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ax(e)(t,n,i)},vx=e=>(t,n,r)=>ax(e)(t,n,r),yx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return sx(e)(t,n,i)},bx=e=>async(t,n,r)=>sx(e)(t,n,r),xx=/^[cC][0-9a-z]{6,}$/,Sx=/^[0-9a-z]+$/,Cx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wx=/^[0-9a-vA-V]{20}$/,Tx=/^[A-Za-z0-9]{27}$/,Ex=/^[a-zA-Z0-9_-]{21}$/;function Dx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ox=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kx=/^([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})$/,Ax=e=>e?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)$/,jx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nx(){return new RegExp(Mx,`u`)}var Px=/^(?:(?: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])$/,Fx=/^(([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}|:))$/,Ix=/^((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])$/,Lx=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Bx=/^https?$/,Vx=/^\+[1-9]\d{6,14}$/,Hx=`(?:(?:\\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])))`;function Ux(e){return RegExp(`^${e}$`)}var Wx=Ux(Hx);function Gx(e){let 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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kx(e){return RegExp(`^${Gx(e)}$`)}function qx(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gx({precision:e.precision})}`:n;return RegExp(`^${Hx}T(?:${r})$`)}var Jx=/^[\s\S]{0,}$/,Yx=/^[^A-Z]*$/,Xx=/^[^a-z]*$/,Zx=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qx=e=>{let t=e.value;return!Iy(t)&&t.length!==void 0},$x=q(`$ZodCheckMaxLength`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Sb(r):i)<=t.maximum)return;let a=Cb(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eS=q(`$ZodCheckMinLength`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Sb(r):i)>=t.minimum)return;let a=Cb(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tS=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;Zx.init(e,t),(n=e._zod.def).when??(n.when=Qx),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Sb(r):i;if(a===t.length)return;let o=Cb(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nS=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Zx.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),rS=q(`$ZodCheckRegex`,(e,t)=>{nS.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})}}),iS=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yx,nS.init(e,t)}),aS=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xx,nS.init(e,t)}),oS=q(`$ZodCheckIncludes`,(e,t)=>{Zx.init(e,t);let n=eb(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),sS=q(`$ZodCheckStartsWith`,(e,t)=>{Zx.init(e,t);let n=RegExp(`^${eb(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),cS=q(`$ZodCheckEndsWith`,(e,t)=>{Zx.init(e,t);let n=RegExp(`.*${eb(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),lS=q(`$ZodCheckOverwrite`,(e,t)=>{Zx.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),uS=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
5
5
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
6
6
  `)}\n};`)(...Object.values(this.closed))}},dS={major:4,minor:6,patch:5},J=q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dS;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=hb(t),a;for(let o of n){if(o._zod.def.when){if(gb(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Hb;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(yb(t.issues,n,e),i||=hb(t,n))});else{if(t.issues.length===n)continue;yb(t.issues,n,e),i||=hb(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(hb(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Hb;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Hb;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ob(this,`~standard`,mS(this))},set"~standard"(e){Db(this,`~standard`,e)}}),fS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>bb(e,t,Gb()))}:{value:e.value};async function pS(e,t){let n={async:!0};return fS(await e._zod.run({value:t,issues:[]},n),n)}function mS(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return fS(r,n)}catch{}return pS(e,t)},vendor:`zod`,version:1}}var hS=q(`$ZodString`,(e,t)=>{J.init(e,t),e._zod.pattern=t.pattern??Jx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Y=q(`$ZodStringFormat`,(e,t)=>{nS.init(e,t),hS.init(e,t)}),gS=q(`$ZodGUID`,(e,t)=>{t.pattern??=kx,Y.init(e,t)}),_S=q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ax(e)}else t.pattern??=Ax();Y.init(e,t)}),vS=q(`$ZodEmail`,(e,t)=>{t.pattern??=jx,Y.init(e,t)});function yS(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function bS(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?yS(e)||2:xS(e,t)}function xS(e,t){if(!t.normalize&&t.protocol?.source===Bx.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var SS=/[\t\n\r]/g;function CS(e){return e.replace(SS,``)}function wS(e,t){return t.lastIndex=0,t.test(e.hostname)}function TS(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ES=q(`$ZodURL`,(e,t)=>{Y.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=bS(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=CS(r);return}t.hostname&&!wS(i,t.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&&!TS(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:CS(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),DS=q(`$ZodEmoji`,(e,t)=>{t.pattern??=Nx(),Y.init(e,t)}),OS=q(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Ex:Dx(t.length),Y.init(e,t)}),kS=q(`$ZodCUID`,(e,t)=>{t.pattern??=xx,Y.init(e,t)}),AS=q(`$ZodCUID2`,(e,t)=>{t.pattern??=Sx,Y.init(e,t)}),jS=q(`$ZodULID`,(e,t)=>{t.pattern??=Cx,Y.init(e,t)}),MS=q(`$ZodXID`,(e,t)=>{t.pattern??=wx,Y.init(e,t)}),NS=q(`$ZodKSUID`,(e,t)=>{t.pattern??=Tx,Y.init(e,t)}),PS=q(`$ZodISODateTime`,(e,t)=>{t.pattern??=qx(t),Y.init(e,t)}),FS=q(`$ZodISODate`,(e,t)=>{t.pattern??=Wx,Y.init(e,t)}),IS=q(`$ZodISOTime`,(e,t)=>{t.pattern??=Kx(t),Y.init(e,t)}),LS=q(`$ZodISODuration`,(e,t)=>{t.pattern??=Ox,Y.init(e,t)}),RS=q(`$ZodIPv4`,(e,t)=>{t.pattern??=Px,Y.init(e,t)}),zS=/^[0-9a-fA-F:.]+$/;function BS(e){return zS.test(e)?yS(`http://[${e}]`):!1}var VS=q(`$ZodIPv6`,(e,t)=>{t.pattern??=Fx,Y.init(e,t),e._zod.check=n=>{BS(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),HS=q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ix,Y.init(e,t)});function US(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:BS(n)}var WS=q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Lx,Y.init(e,t),e._zod.check=n=>{US(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function GS(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var KS=/^[0-9a-zA-Z+/]*={0,2}$/,qS=q(`$ZodBase64`,(e,t)=>{t.pattern??=KS,Y.init(e,t),e._zod.check=n=>{GS(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),JS=/^[A-Za-z0-9_-]*$/;function YS(e){if(!JS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return GS(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var XS=q(`$ZodBase64URL`,(e,t)=>{t.pattern??=JS,Y.init(e,t),e._zod.check=n=>{YS(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ZS=q(`$ZodE164`,(e,t)=>{t.pattern??=Vx,Y.init(e,t)});function QS(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var $S=q(`$ZodJWT`,(e,t)=>{Y.init(e,t),e._zod.check=n=>{QS(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),eC=q(`$ZodUnknown`,(e,t)=>{J.init(e,t),e._zod.parse=e=>e}),tC=q(`$ZodNever`,(e,t)=>{J.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function nC(e,t,n){e.issues.length&&t.issues.push(..._b(n,e.issues)),t.value[n]=e.value}var rC=q(`$ZodArray`,(e,t)=>{J.init(e,t);let n=Wb.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>nC(t,r,e)));else if(nC(c,r,e),s&&c.issues.length!==0&&hb(c))break}return o.length?Promise.all(o).then(()=>r):r}});function iC(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(..._b(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var aC=[];function oC(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:aC,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=rb(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function sC(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(hb(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>iC(e,n,i,t,d,f))):iC(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var cC=q(`$ZodObject`,(e,t)=>{J.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Fy(()=>oC(t));K(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Ry(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Yy,o=t.catchall,s,c=Wb.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(hb(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>iC(n,t,e,r,a,o))):iC(s,t,e,r,a,o)}return o?sC(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),lC=q(`$ZodObjectJIT`,(e,t)=>{cC.init(e,t);let n=e._zod.parse,r=Fy(()=>oC(t)),i=Wb.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new uS([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
7
7
  let ${e}_ab = false;
@@ -55,4 +55,4 @@ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,r as n,t as r}f
55
55
 
56
56
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Yy,c=!Wb.jitless,l=c&&Xy.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?sC([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function uC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!hb(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>bb(e,r,Gb())))}),t)}var dC=q(`$ZodUnion`,(e,t)=>{J.init(e,t),K(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),K(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),K(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),K(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ly(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>uC(t,r,e,i)):uC(o,r,e,i)}}),fC=q(`$ZodIntersection`,(e,t)=>{J.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mC(e,t,n)):mC(e,i,a)}});function pC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Zy(e)&&Zy(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=pC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=pC(t.value,n.value);if(!c.valid){if(hb(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var hC=q(`$ZodEnum`,(e,t)=>{J.init(e,t);let n=jy(t.entries),r=new Set(n);e._zod.values=r,K(e,`pattern`,e=>{let t=jy(e.def.entries).filter(e=>$y.has(typeof e));return RegExp(t.length?`^(${t.map(e=>eb(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),gC=q(`$ZodTransform`,(e,t)=>{J.init(e,t),e._zod.optin=`optional`,Wb.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ub(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Hb;return n.value=i,n}});function _C(e,t){return e.value=t.issues.length?void 0:t.value,e}var vC=q(`$ZodOptional`,(e,t)=>{J.init(e,t),K(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,K(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),K(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ly(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>_C(e,t)):_C(e,r)}return t.innerType._zod.run(e,n)}}),yC=q(`$ZodExactOptional`,(e,t)=>{vC.init(e,t),K(e,`values`,e=>e.def.innerType._zod.values),K(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),bC=q(`$ZodNullable`,(e,t)=>{J.init(e,t),K(e,`optin`,e=>e.def.innerType._zod.optin),K(e,`optout`,e=>e.def.innerType._zod.optout),K(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ly(t.source)}|null)$`):void 0}),K(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),xC=q(`$ZodDefault`,(e,t)=>{J.init(e,t),e._zod.optin=`defaulted`,K(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>SC(e,t)):SC(r,t)}});function SC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var CC=q(`$ZodPrefault`,(e,t)=>{J.init(e,t),e._zod.optin=`defaulted`,K(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),wC=q(`$ZodNonOptional`,(e,t)=>{J.init(e,t),K(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>TC(t,e)):TC(i,e)}});function TC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function EC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>bb(e,r,Gb()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var DC=q(`$ZodCatch`,(e,t)=>{J.init(e,t),K(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),K(e,`optout`,e=>e.def.innerType._zod.optout),K(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>EC(e,r,t,n)):EC(e,r,t,n)}}),OC=q(`$ZodPipe`,(e,t)=>{J.init(e,t),K(e,`values`,e=>e.def.in._zod.values),K(e,`optin`,e=>e.def.in._zod.optin),K(e,`optout`,e=>e.def.out._zod.optout),K(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>kC(e,t.in,n)):kC(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>kC(e,t.out,n)):kC(r,t.out,n)}});function kC(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var AC=q(`$ZodReadonly`,(e,t)=>{J.init(e,t),K(e,`propValues`,e=>e.def.innerType._zod.propValues),K(e,`values`,e=>e.def.innerType._zod.values),K(e,`optin`,e=>e.def.innerType?._zod?.optin),K(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(jC):jC(r)}});function jC(e){return e.memo||(e.value=Object.freeze(e.value)),e}var MC=q(`$ZodCustom`,(e,t)=>{Zx.init(e,t),J.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>NC(t,n,r,e));NC(i,n,r,e)}});function NC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Tb(e))}}var PC=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},FC=`~memo`,IC=[];function LC(e){return typeof e==`object`&&!!e}function RC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var zC=new WeakMap,BC=0,VC=1,HC=2;function UC(e,t,n){let r=zC.get(e);if(r!==void 0)return r?HC:BC;if(t.has(e))return HC;t.add(e);let i=BC,a=e=>{if(i!==HC&&e?._zod){let r=UC(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=BC;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?VC:o.value?._zod?UC(o.value,t,n):BC;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=zy(c);s(e?o(e,!0):VC),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?UC(r,t,!1):VC);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),WC(e,i)}function WC(e,t){return t!==VC&&zC.set(e,t===HC),t}function GC(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var KC,qC=[],JC={alloc(e,t,n){let r=KC;if(!r)return n;KC=void 0;let i={value:n,issues:null};return r.set(t.value,i),qC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&XC(n,e.value))throw new PC;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=UC(e,new Set,!1);if(i===BC)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===HC||r?n=!0:r=!0}let l=s.value;if(!LC(l))return t(s,c);let u=c[FC];u||(u={buckets:new WeakMap,backEdges:void 0},c[FC]=u);let d;i===c?d=a:(d=GC(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...RC(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;KC=d;let p=qC.length,m=t(s,c);KC=void 0;let h=qC.length>p?qC.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?RC(e.issues):IC),e)):(h&&(h.issues=m.issues.length?RC(m.issues):IC),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function YC(){return JC}function XC(e,t){let n=e[FC]?.backEdges;return n!==void 0&&LC(t)&&n.has(t)}var ZC=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(wb(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${nb(e.values[0])}`:`Invalid option: expected one of ${My(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${My(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function QC(){return{localeError:ZC()}}var $C,ew=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function tw(){return new ew}($C=globalThis).__zod_globalRegistry??($C.__zod_globalRegistry=tw());var nw=globalThis.__zod_globalRegistry;function rw(e){return e.checks&&=[...e.checks],e}function iw(e,t){return new e(rw({type:`string`,...G(t)}))}function aw(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}function ow(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}function sw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}function cw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}function lw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}function uw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}function dw(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}function fw(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}function pw(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}function mw(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}function hw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}function gw(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}function _w(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}function vw(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}function yw(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}function bw(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}function xw(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}function Sw(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}function Cw(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}function ww(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}function Tw(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}function Ew(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}function Dw(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}function Ow(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}function kw(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}function Aw(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}function jw(e){return new e({type:`unknown`})}function Mw(e,t){return new e({type:`never`,...G(t)})}function Nw(e,t){return new $x({check:`max_length`,...G(t),maximum:e})}function Pw(e,t){return new eS({check:`min_length`,...G(t),minimum:e})}function Fw(e,t){return new tS({check:`length_equals`,...G(t),length:e})}function Iw(e,t){return new rS({check:`string_format`,format:`regex`,...G(t),pattern:e})}function Lw(e){return new iS({check:`string_format`,format:`lowercase`,...G(e)})}function Rw(e){return new aS({check:`string_format`,format:`uppercase`,...G(e)})}function zw(e,t){return new oS({check:`string_format`,format:`includes`,...G(t),includes:e})}function Bw(e,t){return new sS({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}function Vw(e,t){return new cS({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}function Hw(e){return new lS({check:`overwrite`,tx:e})}function Uw(e){return Hw(t=>t.normalize(e))}function Ww(){return Hw(e=>e.trim())}function Gw(){return Hw(e=>e.toLowerCase())}function Kw(){return Hw(e=>e.toUpperCase())}function qw(){return Hw(e=>qy(e))}function Jw(e,t,n){return new e({type:`array`,element:t,...G(n)})}function Yw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}function Xw(e,t){let n=Zw(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Tb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Tb(r))}},e(t.value,t)),t);return n}function Zw(e,t){let n=new Zx({check:`custom`,...G(t)});return n._zod.check=e,n}function Qw(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ry(e,t,n[t]);return e}function $w(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??nw,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function eT(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function X(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,X(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Qw(o.schema,c),t.io===`input`&&Z(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function tT(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function nT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${tT(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+tT(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
57
57
 
58
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function rT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;rT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var iT=new Set([`type`,`properties`,`required`,`additionalProperties`]),aT=[`oneOf`,`anyOf`];function oT(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function sT(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!iT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??oT(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ry(n,r,e.length===1?e[0]:sT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=oT(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function cT(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iT)if(t in e)return;let n=t.filter(e=>aT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=sT(t);else{let e=n[0],i=aT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>sT([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Qw(e,r))}function lT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Qw(i,s),Qw(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())rT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])cT(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Qw(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ry(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:dT(t,`input`,e.processors),output:dT(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Z(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Z(r.element,n);if(r.type===`set`)return Z(r.valueType,n);if(r.type===`lazy`)return Z(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Z(r.innerType,n);if(r.type===`intersection`)return Z(r.left,n)||Z(r.right,n);if(r.type===`record`||r.type===`map`)return Z(r.keyType,n)||Z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Z(r.in,n)||Z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Z(e,n))return!0;return!!(r.rest&&Z(r.rest,n))}return!1}var uT=(e,t={})=>n=>{let r=$w({...n,processors:t});return X(e,r),nT(r,e),lT(r,e)},dT=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$w({...i??{},target:a,io:t,processors:n});return X(e,o),nT(o,e),lT(o,e)},fT=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},pT=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},mT=(e,t)=>{fT(e,`minimum`,t),pT(e,`maximum`,t)},hT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},gT=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},_T=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},vT=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},yT=(e,t)=>fT(e,`minimum`,t.minimum),bT=(e,t)=>pT(e,`maximum`,t.maximum),xT=e=>(t,n)=>{vT(t,n.format);let[r,i]=e[n.format];fT(t,`minimum`,r),pT(t,`maximum`,i)},ST={greater_than:(e,t)=>fT(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>pT(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>hT(e,t.value),number_format:xT(ib),bigint_format:xT(ab),min_length:yT,max_length:bT,length_equals:(e,t)=>mT(e,t.length),min_size:yT,max_size:bT,size_equals:(e,t)=>mT(e,t.size),string_format:(e,t)=>{vT(e,t.format),t.pattern&&gT(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>_T(e,t.mime)};function CT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ST[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&fT(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&fT(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&pT(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&pT(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&hT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&_T(t,i.mime);for(let e of i.patterns??[])gT(t,e);return t}var wT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},TT=new Map([[KS,Rx],[JS,zx]]),ET=e=>TT.get(e)??e,DT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=CT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=wT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(ET);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},OT=(e,t,n,r)=>{n.not={}},kT=(e,t,n,r)=>{let i=e._zod.def,a=jy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},AT=(e,t,n,r)=>{eT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},jT=(e,t,n,r)=>{eT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},MT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=CT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=X(a.element,t,{...r,path:[...r.path,`items`]})};function NT(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?NT(t.out):t.type===`catch`?NT(t.innerType):e._zod.optin}var PT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&eT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ry(i.properties,e,X(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?NT(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=X(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},FT=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>X(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},IT=(e,t,n,r)=>{let i=e._zod.def,a=X(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=X(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},LT=(e,t,n,r)=>{let i=e._zod.def,a=X(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},RT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zT=Symbol();function BT(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(eT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zT):JSON.parse(o)}var VT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=BT(i.defaultValue,e,t,n,r);o!==zT&&(n.default=o)},HT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=BT(i.defaultValue,e,t,n,r);o!==zT&&(n._prefault=o)},UT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{eT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},WT=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;X(o,t,r);let s=t.seen.get(e);s.ref=o},GT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},KT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qT=new WeakSet([Object.prototype,Error.prototype]);function JT(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var YT=q(`ZodError`,(e,t)=>{Qb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);qT.has(n)||(qT.add(n),JT(n,`format`,e=>t=>tx(e,t)),JT(n,`flatten`,e=>t=>ex(e,t)),JT(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ny,2)}),JT(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ny,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),XT=rx(YT),ZT=ix(YT),QT=ax(YT),$T=sx(YT),eE=px(YT),tE=mx(YT),nE=hx(YT),rE=gx(YT),iE=_x(YT),aE=vx(YT),oE=yx(YT),sE=bx(YT);function cE(){Wb.localeError||Gb(QC())}function lE(){Wb.memoizer||Gb({memoizer:YC()})}var Q=q(`ZodType`,(e,t)=>(cE(),J.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Gy(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return tb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_D(e,t))},superRefine(e,t){return this.check(vD(e,t))},overwrite(e){return this.check(Hw(e))},optional(){return $E(this)},exactOptional(){return tD(this)},nullable(){return rD(this)},nullish(){return $E(rD(this))},nonoptional(e){return lD(this,e)},array(){return VE(this)},or(e){return GE([this,e])},and(e){return qE(this,e)},transform(e){return pD(this,ZE(e))},default(e){return aD(this,e)},prefault(e){return sD(this,e)},catch(e){return dD(this,e)},pipe(e){return pD(this,e)},readonly(){return hD(this)},describe(e){let t=this.clone();return nw.add(t,{description:e}),t},meta(...e){if(e.length===0)return nw.get(this);let t=this.clone();return nw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ob(this,`~standard`,{...mS(this),jsonSchema:{input:dT(this,`input`),output:dT(this,`output`)}})},set"~standard"(e){Db(this,`~standard`,e)},parse:function e(t,n){return XT(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ZT(this,t,n,{callee:e})},safeParse(e,t){return QT(this,e,t)},async safeParseAsync(e,t){return $T(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Db(this,`spa`,e)},validate(e,t){return ux(this,e,t)},validateAsync(e,t){return fx(this,e,t)},encode:function e(t,n){return eE(this,t,n,{callee:e})},decode:function e(t,n){return tE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await nE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await rE(this,t,n,{callee:e})},safeEncode(e,t){return iE(this,e,t)},safeDecode(e,t){return aE(this,e,t)},async safeEncodeAsync(e,t){return oE(this,e,t)},async safeDecodeAsync(e,t){return sE(this,e,t)},toJSONSchema(e){return uT(this,{})(e)},get description(){return nw.get(this)?.description},get _def(){return this._zod.def}}),uE=q(`_ZodString`,(e,t)=>{hS.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DT(e,t,n,r)},kb({format:e=>CT(e).format??null,minLength:e=>CT(e).minimum??null,maxLength:e=>CT(e).maximum??null},{regex(...e){return this.check(Iw(...e))},includes(...e){return this.check(zw(...e))},startsWith(...e){return this.check(Bw(...e))},endsWith(...e){return this.check(Vw(...e))},min(...e){return this.check(Pw(...e))},max(...e){return this.check(Nw(...e))},length(...e){return this.check(Fw(...e))},nonempty(...e){return this.check(Pw(1,...e))},lowercase(e){return this.check(Lw(e))},uppercase(e){return this.check(Rw(e))},trim(){return this.check(Ww())},normalize(...e){return this.check(Uw(...e))},toLowerCase(){return this.check(Gw())},toUpperCase(){return this.check(Kw())},slugify(){return this.check(qw())}})),dE=q(`ZodString`,(e,t)=>{hS.init(e,t),uE.init(e,t)},{email(e){return this.check(aw(_E,e))},url(e){return this.check(dw(bE,e))},jwt(e){return this.check(Ew(FE,e))},emoji(e){return this.check(fw(xE,e))},guid(e){return this.check(ow(vE,e))},uuid(e){return this.check(sw(yE,e))},uuidv4(e){return this.check(cw(yE,e))},uuidv6(e){return this.check(lw(yE,e))},uuidv7(e){return this.check(uw(yE,e))},nanoid(e){return this.check(pw(SE,e))},cuid(e){return this.check(mw(CE,e))},cuid2(e){return this.check(hw(wE,e))},ulid(e){return this.check(gw(TE,e))},base64(e){return this.check(Cw(ME,e))},base64url(e){return this.check(ww(NE,e))},xid(e){return this.check(_w(EE,e))},ksuid(e){return this.check(vw(DE,e))},ipv4(e){return this.check(yw(OE,e))},ipv6(e){return this.check(bw(kE,e))},cidrv4(e){return this.check(xw(AE,e))},cidrv6(e){return this.check(Sw(jE,e))},e164(e){return this.check(Tw(PE,e))},datetime(e){return this.check(Dw(pE,e))},date(e){return this.check(Ow(mE,e))},time(e){return this.check(kw(hE,e))},duration(e){return this.check(Aw(gE,e))}});function fE(e){return iw(dE,e)}var $=q(`ZodStringFormat`,(e,t)=>{Y.init(e,t),uE.init(e,t)}),pE=q(`ZodISODateTime`,(e,t)=>{PS.init(e,t),$.init(e,t)}),mE=q(`ZodISODate`,(e,t)=>{FS.init(e,t),$.init(e,t)}),hE=q(`ZodISOTime`,(e,t)=>{IS.init(e,t),$.init(e,t)}),gE=q(`ZodISODuration`,(e,t)=>{LS.init(e,t),$.init(e,t)}),_E=q(`ZodEmail`,(e,t)=>{vS.init(e,t),$.init(e,t)}),vE=q(`ZodGUID`,(e,t)=>{gS.init(e,t),$.init(e,t)}),yE=q(`ZodUUID`,(e,t)=>{_S.init(e,t),$.init(e,t)}),bE=q(`ZodURL`,(e,t)=>{ES.init(e,t),$.init(e,t)}),xE=q(`ZodEmoji`,(e,t)=>{DS.init(e,t),$.init(e,t)}),SE=q(`ZodNanoID`,(e,t)=>{OS.init(e,t),$.init(e,t)}),CE=q(`ZodCUID`,(e,t)=>{kS.init(e,t),$.init(e,t)}),wE=q(`ZodCUID2`,(e,t)=>{AS.init(e,t),$.init(e,t)}),TE=q(`ZodULID`,(e,t)=>{jS.init(e,t),$.init(e,t)}),EE=q(`ZodXID`,(e,t)=>{MS.init(e,t),$.init(e,t)}),DE=q(`ZodKSUID`,(e,t)=>{NS.init(e,t),$.init(e,t)}),OE=q(`ZodIPv4`,(e,t)=>{RS.init(e,t),$.init(e,t)}),kE=q(`ZodIPv6`,(e,t)=>{VS.init(e,t),$.init(e,t)}),AE=q(`ZodCIDRv4`,(e,t)=>{HS.init(e,t),$.init(e,t)}),jE=q(`ZodCIDRv6`,(e,t)=>{WS.init(e,t),$.init(e,t)}),ME=q(`ZodBase64`,(e,t)=>{qS.init(e,t),$.init(e,t)}),NE=q(`ZodBase64URL`,(e,t)=>{XS.init(e,t),$.init(e,t)}),PE=q(`ZodE164`,(e,t)=>{ZS.init(e,t),$.init(e,t)}),FE=q(`ZodJWT`,(e,t)=>{$S.init(e,t),$.init(e,t)}),IE=q(`ZodUnknown`,(e,t)=>{eC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function LE(){return jw(IE)}var RE=q(`ZodNever`,(e,t)=>{tC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OT(e,t,n,r)});function zE(e){return Mw(RE,e)}var BE=q(`ZodArray`,(e,t)=>{lE(),rC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Pw(e,t))},nonempty(e){return this.check(Pw(1,e))},max(e,t){return this.check(Nw(e,t))},length(e,t){return this.check(Fw(e,t))},unwrap(){return this.element}});function VE(e,t){return Jw(BE,e,t)}var HE=q(`ZodObject`,(e,t)=>{lE(),lC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PT(e,t,n,r),Fb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return YE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Gy(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Gy(this._zod.def,{catchall:LE()}))},loose(){return this.clone(Gy(this._zod.def,{catchall:LE()}))},strict(){return this.clone(Gy(this._zod.def,{catchall:zE()}))},strip(){return this.clone(Gy(this._zod.def,{catchall:void 0}))},extend(e){return lb(this,e)},safeExtend(e){return db(this,e)},merge(e){return fb(this,e)},pick(e){return ob(this,e)},omit(e){return cb(this,e)},partial(...e){return pb(QE,this,e[0])},exactPartial(...e){return pb(eD,this,e[0],`exactPartial`)},required(...e){return mb(cD,this,e[0])}});function UE(e,t){return new HE({type:`object`,shape:e??{},...G(t)})}var WE=q(`ZodUnion`,(e,t)=>{dC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FT(e,t,n,r),e.options=t.options});function GE(e,t){return new WE({type:`union`,options:e,...G(t)})}var KE=q(`ZodIntersection`,(e,t)=>{fC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IT(e,t,n,r)});function qE(e,t){return new KE({type:`intersection`,left:e,right:t})}var JE=q(`ZodEnum`,(e,t)=>{hC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new JE({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new JE({...t,checks:[],...G(r),entries:i})}});function YE(e,t){return new JE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var XE=q(`ZodTransform`,(e,t)=>{lE(),gC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jT(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ub(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Tb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Tb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ZE(e){return new XE({type:`transform`,transform:e})}var QE=q(`ZodOptional`,(e,t)=>{vC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $E(e){return new QE({type:`optional`,innerType:e})}var eD=q(`ZodExactOptional`,(e,t)=>{yC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tD(e){return new eD({type:`optional`,innerType:e})}var nD=q(`ZodNullable`,(e,t)=>{bC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rD(e){return new nD({type:`nullable`,innerType:e})}var iD=q(`ZodDefault`,(e,t)=>{xC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function aD(e,t){return new iD({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Qy(t)}})}var oD=q(`ZodPrefault`,(e,t)=>{CC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sD(e,t){return new oD({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Qy(t)}})}var cD=q(`ZodNonOptional`,(e,t)=>{wC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lD(e,t){return new cD({type:`nonoptional`,innerType:e,...G(t)})}var uD=q(`ZodCatch`,(e,t)=>{DC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dD(e,t){return new uD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Lb(t)})}var fD=q(`ZodPipe`,(e,t)=>{OC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WT(e,t,n,r),e.in=t.in,e.out=t.out});function pD(e,t){return new fD({type:`pipe`,in:e,out:t})}var mD=q(`ZodReadonly`,(e,t)=>{AC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hD(e){return new mD({type:`readonly`,innerType:e})}var gD=q(`ZodCustom`,(e,t)=>{MC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AT(e,t,n,r)});function _D(e,t={}){return Yw(gD,e,t)}function vD(e,t){return Xw(e,t)}function yD({className:e,id:t,revealNonce:n,...r}){let[i,o]=(0,D.useState)(!1);(0,D.useEffect)(()=>{n!==void 0&&n>0&&o(!0)},[n]);let c=(0,D.useId)(),l=t??`password-${c}`,u=`${l}-visibility`,d=i?`text`:`password`;return(0,A.jsxs)(`div`,{className:`relative w-full min-w-0`,children:[(0,A.jsx)(s,{...r,id:l,type:d,inputMode:`text`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,className:f(`pr-10`,e)},d),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-label":i?`Hide password`:`Show password`,"aria-pressed":i,"aria-controls":l,"aria-describedby":u,className:f(vt,`absolute top-1/2 right-0 -translate-y-1/2`),children:(0,A.jsx)(a,{icon:i?ss:cs,size:16,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0})}),(0,A.jsx)(`span`,{id:u,className:`sr-only`,"aria-live":`polite`,children:i?`Password is visible`:`Password is hidden`})]})}function bD({className:e,...t}){return(0,A.jsx)(`label`,{"data-slot":`label`,className:f(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function xD({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`field-group`,className:f(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var SD=h(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function CD({className:e,orientation:t=`vertical`,...n}){return(0,A.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:f(SD({orientation:t}),e),...n})}function wD({className:e,...t}){return(0,A.jsx)(bD,{"data-slot":`field-label`,className:f(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function TD({className:e,children:t,errors:n,...r}){let i=(0,D.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,A.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,A.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,A.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:f(`text-sm font-normal text-destructive`,e),...r,children:i}):null}var ED=UE({email:fE().email(`Enter a valid email.`),password:fE().min(1,`Password is required.`)});function DD(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function OD(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,A.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function kD(){let e=o(),t=de(),n=Be({from:`/`}),[r,i]=(0,D.useState)(null),a=At({mutationFn:async e=>{let t=await tt(e);if(t.error)throw Error(Ye(t.error));if(!t.data)throw Error(`Empty login response`);return t.data},onSuccess:r=>{Ke(r),i(null),e.invalidateQueries({queryKey:[`console.setup.status`]}),window.setTimeout(()=>{Ho(t,n.next)},650)},onError:e=>{i(e.message)}}),c=Ay({defaultValues:{email:``,password:``},validators:{onSubmit:ED},onSubmit:async({value:e})=>{i(null),await a.mutateAsync(e)}});return(0,A.jsx)(hv,{title:`Sign in`,status:{label:`Setup closed`},description:`Sign in with an existing operator account.`,footer:(0,A.jsx)(uv,{type:`submit`,form:`login-form`,state:lv({pending:a.isPending,success:a.isSuccess,error:a.isError||r!==null}),loadingText:`Signing in`,successText:`Signed in`,errorText:`Try again`,children:`Sign in`}),children:({titleId:e,descriptionId:t})=>(0,A.jsxs)(`form`,{id:`login-form`,className:`flex flex-col`,autoComplete:`on`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":a.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),c.handleSubmit()},children:[(0,A.jsxs)(xD,{className:iv,role:`group`,"aria-label":`Operator credentials`,children:[(0,A.jsx)(c.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Email`,(0,A.jsx)(OD,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`username`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":DD(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(c.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Password`,(0,A.jsx)(OD,{})]}),(0,A.jsx)(yD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`current-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":DD(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}})]}),r?(0,A.jsx)(`p`,{id:`login-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})}function AD(e){return e.claimSucceeded?`claim`:e.setupClosed?`login`:`claim`}var jD=/[^A-Za-z0-9]/,MD={minLength:8,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function ND(e={}){return{minLength:e.minLength??MD.minLength,requireLetter:e.requireLetter??MD.requireLetter,requireNumber:e.requireNumber??MD.requireNumber,requireUppercase:e.requireUppercase??MD.requireUppercase,requireLowercase:e.requireLowercase??MD.requireLowercase,requireSpecial:e.requireSpecial??MD.requireSpecial}}function PD(e){return jD.test(e)}function FD(e,t={}){let n=ND(t),r=[];if(e.length<n.minLength&&r.push(`minLength ${n.minLength} (got ${e.length})`),n.requireLetter&&!/[A-Za-z]/.test(e)&&r.push(`requireLetter`),n.requireUppercase&&!/[A-Z]/.test(e)&&r.push(`requireUppercase`),n.requireLowercase&&!/[a-z]/.test(e)&&r.push(`requireLowercase`),n.requireNumber&&!/\d/.test(e)&&r.push(`requireNumber`),n.requireSpecial&&!PD(e)&&r.push(`requireSpecial`),r.length>0)throw new WD(r)}var ID=`ABCDEFGHJKLMNPQRSTUVWXYZ`,LD=`abcdefghijkmnpqrstuvwxyz`,RD=`23456789`,zD=`!@#$%^&*-_=+?`;function BD(e={}){let t=ND(e),n=e.length??Math.max(t.minLength,16);if(n<t.minLength)throw Error(`generatePassword: length ${n} is below minLength ${t.minLength}`);let r=[];t.requireUppercase&&r.push(ID),t.requireLowercase&&r.push(LD),t.requireLetter&&!t.requireUppercase&&!t.requireLowercase&&r.push(ID+LD),t.requireNumber&&r.push(RD),t.requireSpecial&&r.push(zD);let i=r.length>0?r.join(``):ID+LD+RD;if(n<r.length)throw Error(`generatePassword: length ${n} cannot cover ${r.length} classes`);let a=r.map(e=>VD(e));for(;a.length<n;)a.push(VD(i));HD(a);let o=a.join(``);return FD(o,t),o}function VD(e){return e[UD(e.length)]??e[0]}function HD(e){for(let t=e.length-1;t>0;t--){let n=UD(t+1),r=e[t];e[t]=e[n],e[n]=r}}function UD(e){if(!Number.isInteger(e)||e<=0)throw Error(`randomInt: maxExclusive must be a positive integer`);let t=e<=256?1:2,n=t===1?256:65536;if(e>n)throw Error(`randomInt: maxExclusive ${e} exceeds ${n}`);let r=n-n%e,i=new Uint8Array(t);for(;;){crypto.getRandomValues(i);let n=t===1?i[0]??0:(i[0]??0)<<8|(i[1]??0);if(n<r)return n%e}}var WD=class extends Error{reasons;constructor(e){super(`password policy failed: ${e.join(`, `)}`),this.name=`PasswordPolicyError`,this.reasons=e}},GD={minLength:12,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function KD(e){let t=ND(GD);return[{id:`length`,label:`At least ${t.minLength} characters`,met:e.length>=t.minLength},{id:`uppercase`,label:`Contains an uppercase letter`,met:/[A-Z]/.test(e)},{id:`lowercase`,label:`Contains a lowercase letter`,met:/[a-z]/.test(e)},{id:`number`,label:`Contains a number`,met:/\d/.test(e)},{id:`special`,label:`Contains a special character`,met:PD(e)}]}function qD(){return BD(GD)}function JD({onGenerate:e,disabled:t,copyText:n=async e=>{await navigator.clipboard.writeText(e)}}){let[r,i]=(0,D.useState)(!1),o=(0,D.useRef)(null);return(0,D.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),(0,A.jsxs)(we,{type:`button`,variant:`ghost`,size:`xs`,disabled:t,"data-slot":`generate-password`,"aria-label":r?`Password generated and copied`:`Generate a password and copy it`,className:`text-muted-foreground`,onClick:()=>{let t=qD();e(t),n(t).then(()=>{i(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>i(!1),1600)}).catch(()=>{i(!1)})},children:[(0,A.jsx)(a,{icon:r?ee:is,"data-icon":`inline-start`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?`Copied`:`Generate`]})}function YD(e){return KD(e)}function XD(e,t){if(e<=0)return{label:`Empty`,bar:`bg-muted-foreground/35`,text:`text-muted-foreground`};if(e===t)return{label:`Strong`,bar:`bg-emerald-500`,text:`text-emerald-600 dark:text-emerald-400`};let n=e/t;return n<=.4?{label:`Weak`,bar:`bg-destructive`,text:`text-destructive`}:n<=.6?{label:`Fair`,bar:`bg-amber-500`,text:`text-amber-600 dark:text-amber-400`}:{label:`Good`,bar:`bg-lime-500`,text:`text-lime-700 dark:text-lime-400`}}function ZD({password:e,id:t=`password-strength`}){let n=YD(e),r=n.filter(e=>e.met).length,i=Math.round(r/n.length*100),o=XD(r,n.length),s=e.length===0;return(0,A.jsxs)(`div`,{id:t,className:`flex flex-col gap-3`,"aria-live":`polite`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,id:`${t}-label`,children:`Password strength`}),(0,A.jsx)(`p`,{className:f(`text-xs tabular-nums font-medium`,s?`text-muted-foreground`:o.text),"aria-hidden":!0,children:s?`0/${n.length}`:`${o.label} · ${r}/${n.length}`})]}),(0,A.jsx)(`div`,{role:`progressbar`,"aria-labelledby":`${t}-label`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-valuetext":s?`No password entered`:`${o.label}: ${r} of ${n.length} requirements met`,className:`h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,A.jsx)(`div`,{className:f(`h-full rounded-full transition-[width,background-color] duration-200 ease-out`,s?`bg-muted-foreground/35`:o.bar),style:{width:`${s?0:Math.max(i,r>0?12:0)}%`}})})]}),(0,A.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"aria-label":`Password requirements`,children:n.map(e=>(0,A.jsxs)(`li`,{className:f(`flex items-center gap-2 text-xs transition-colors`,e.met?`text-foreground`:`text-muted-foreground`),children:[(0,A.jsx)(a,{icon:e.met?qo:Jo,size:14,color:`currentColor`,strokeWidth:1.5,className:f(e.met?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground/60`),"aria-hidden":!0}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`span`,{className:`sr-only`,children:e.met?`Met: `:`Not met: `}),e.label]})]},e.id))})]})}var QD=UE({claimCode:fE().min(1,`Claim code is required.`),name:fE().min(1,`Name is required.`),email:fE().email(`Enter a valid email.`),password:fE().min(12,`Password must be at least 12 characters.`).refine(e=>KD(e).every(e=>e.met),{message:`Password needs uppercase, lowercase, a number, and a special character.`})});function $D(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function eO(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,A.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function tO({children:e}){return(0,A.jsx)(wv,{children:e})}function nO(){let e=o(),t=de(),n=Be({from:`/`}),[r,i]=(0,D.useState)(null),[a,c]=(0,D.useState)(0),l=ge({queryKey:[`console.setup.status`],queryFn:async()=>{let e=await ct();if(e.error)throw Error(Ye(e.error));if(!e.data)throw Error(`Empty setup status`);return e.data},retry:2});(0,D.useEffect)(()=>{l.data?.claimRequired&&rt(null)},[l.data?.claimRequired]);let u=At({mutationFn:async e=>{let t=await at(e);if(t.error)throw Error(Ye(t.error));if(!t.data)throw Error(`Empty claim response`);return t.data},onSuccess:r=>{Ke(r),i(null),e.setQueryData([`console.setup.status`],{setupClosed:!0,claimRequired:!1}),window.setTimeout(()=>{Ho(t,n.next)},650)},onError:e=>{i(e.message)}}),d=Ay({defaultValues:{claimCode:``,name:``,email:``,password:``},validators:{onSubmit:QD},onSubmit:async({value:e})=>{i(null),await u.mutateAsync(e)}});return l.isLoading?(0,A.jsx)(tO,{children:(0,A.jsx)(gv,{})}):l.isError?(0,A.jsx)(tO,{children:(0,A.jsx)(hv,{title:`Console unreachable`,status:{label:`Offline`,tone:`alert`},description:`Could not reach the setup API.`,children:(0,A.jsx)(`p`,{className:`px-5 pb-6 text-sm text-muted-foreground`,role:`alert`,children:l.error instanceof Error?l.error.message:`Is the Console kernel running on :6533?`})})}):AD({setupClosed:l.data?.setupClosed===!0,claimSucceeded:u.isSuccess})===`login`?(0,A.jsx)(tO,{children:(0,A.jsx)(kD,{})}):(0,A.jsx)(tO,{children:(0,A.jsx)(hv,{title:`First admin`,status:{label:`Setup open`,tone:`open`},description:"Enter the claim code from the `oke dev` board, or run `oke console claim-code`. This wizard closes permanently after the first operator.",footer:(0,A.jsx)(uv,{type:`submit`,form:`claim-form`,state:lv({pending:u.isPending,success:u.isSuccess,error:u.isError||r!==null}),loadingText:`Creating`,successText:`Created`,errorText:`Try again`,children:`Create admin account`}),children:({titleId:e,descriptionId:t})=>(0,A.jsxs)(`form`,{id:`claim-form`,className:`flex flex-col`,autoComplete:`off`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":u.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),d.handleSubmit()},children:[(0,A.jsxs)(xD,{className:iv,role:`group`,"aria-label":`First admin details`,children:[(0,A.jsx)(d.Field,{name:`claimCode`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Claim code`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`text`,inputMode:`text`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,placeholder:`Claim code`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`name`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Name`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`text`,autoComplete:`name`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Name`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Email`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`email`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-strength`,r=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:f(av,`items-start`),children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 pt-1.5`,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Password`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(JD,{disabled:u.isPending,onGenerate:t=>{e.handleChange(t),c(e=>e+1)}})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,A.jsx)(yD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),revealNonce:a,minLength:12,autoComplete:`new-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(n,t&&r),required:!0,className:ov}),(0,A.jsx)(ZD,{id:n,password:e.state.value}),t?(0,A.jsx)(TD,{id:r,errors:e.state.meta.errors}):null]})]})}})]}),r?(0,A.jsx)(`p`,{id:`claim-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})})}var rO=`okengine Console`,iO={"/overview":`Overview`,"/flows":`Flows`,"/store":`Store`,"/observability":`Observability`,"/vault":`Vault`,"/access":`Access`,"/monitoring":`Observability`};function aO(e){if(e===`/`||e===``)return rO;let t=iO[e];return t?`${t} · ${rO}`:`Not found · ${rO}`}function oO(){let e=ka({select:e=>e.location.pathname});return(0,D.useEffect)(()=>{document.title=aO(e)},[e]),null}function sO(e){return g(e.defaultTagName??`div`,e,e)}var cO=768;function lO(){let[e,t]=D.useState(void 0);return D.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<cO)};return e.addEventListener(`change`,n),t(window.innerWidth<cO),()=>e.removeEventListener(`change`,n)},[]),!!e}var uO=`sidebar_state`,dO=604800,fO=`16rem`,pO=`18rem`,mO=`3rem`,hO=`b`,gO=D.createContext(null);function _O(){let e=D.useContext(gO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function vO({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=lO(),[c,l]=D.useState(!1),[u,d]=D.useState(e),p=t??u,m=D.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):d(t),document.cookie=`${uO}=${t}; path=/; max-age=${dO}`},[n,p]),h=D.useCallback(()=>s?l(e=>!e):m(e=>!e),[s,m,l]);D.useEffect(()=>{let e=e=>{e.key===hO&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=D.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:h}),[g,p,m,s,c,l,h]);return(0,A.jsx)(gO.Provider,{value:_,children:(0,A.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":fO,"--sidebar-width-icon":mO,...i},className:f(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function yO({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=_O();return n===`none`?(0,A.jsx)(`div`,{"data-slot":`sidebar`,className:f(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,A.jsx)(ae,{open:l,onOpenChange:u,...o,children:(0,A.jsxs)(fe,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":pO},side:e,children:[(0,A.jsxs)(se,{className:`sr-only`,children:[(0,A.jsx)(xe,{children:`Sidebar`}),(0,A.jsx)(_e,{children:`Displays the mobile sidebar.`})]}),(0,A.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,A.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,A.jsx)(`div`,{"data-slot":`sidebar-gap`,className:f(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,A.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:f(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,A.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function bO({className:e,onClick:t,...n}){let{toggleSidebar:r}=_O();return(0,A.jsxs)(we,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:f(e),onClick:e=>{t?.(e),r()},...n,children:[(0,A.jsx)(a,{icon:as,className:`cn-rtl-flip`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function xO({className:e,...t}){return(0,A.jsx)(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function SO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function CO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function wO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function TO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function EO({className:e,render:t,...n}){return sO({defaultTagName:`div`,props:c({className:f(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function DO({className:e,...t}){return(0,A.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function OO({className:e,...t}){return(0,A.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}var kO=h(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm text-muted-foreground ring-sidebar-ring outline-hidden transition-[width,height,padding,color] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function AO({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:d}=_O(),m=sO({defaultTagName:`button`,props:c({className:f(kO({variant:n,size:r}),a)},o),render:i?(0,A.jsx)(p,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,A.jsxs)(l,{children:[m,(0,A.jsx)(u,{side:`right`,align:`center`,hidden:d!==`collapsed`||s,...i})]})):m}function jO(e=globalThis.navigator){if(e===void 0)return!1;let t=e.userAgentData?.platform;return typeof t==`string`&&t.length>0?/mac/i.test(t):/Mac|iPhone|iPad|iPod/.test(`${e.platform??``} ${e.userAgent??``}`)}function MO(e){return jO(e)?`⌘`:`Ctrl`}function NO(e,t){return[MO(t),e]}function PO(e,t){return jO(t)?[MO(t),`⇧`,e]:[MO(t),`Shift`,e]}var FO={overview:`1`,flows:`2`,store:`3`,observability:`4`,vault:`5`,access:`6`};function IO(e){return NO(e===`fast`?`K`:e===`settings`?`,`:e===`logout`?`E`:FO[e])}var LO={1:`/overview`,2:`/flows`,3:`/store`,4:`/observability`,5:`/vault`,6:`/access`};function RO(e){if(e===null||typeof HTMLElement>`u`||!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.closest(`[role="dialog"], [data-slot="command-palette"]`)!==null}var zO=`rounded-none! justify-center data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`;function BO({onFast:e,onSettings:t,onLogout:n}){let{isMobile:r,setOpenMobile:i}=_O(),a=()=>{r&&i(!1)};return(0,A.jsxs)(DO,{className:`items-stretch gap-0`,children:[(0,A.jsx)(VO,{label:`Fast`,keys:IO(`fast`),icon:Yo,slot:`sidebar-fast`,onClick:()=>{a(),e()}}),(0,A.jsx)(VO,{label:`Settings`,keys:IO(`settings`),icon:ns,slot:`sidebar-settings`,onClick:()=>{a(),t()}}),(0,A.jsx)(VO,{label:`Logout`,keys:IO(`logout`),icon:$o,slot:`sidebar-logout`,danger:!0,onClick:()=>{a(),n()}})]})}function VO({label:e,keys:t,icon:n,slot:r,danger:i,onClick:o}){return(0,A.jsx)(OO,{className:`w-full`,children:(0,A.jsxs)(AO,{tooltip:t?{children:(0,A.jsx)(ue,{label:e,keys:t})}:e,onClick:o,"data-slot":r,className:f(zO,i?`hover:bg-destructive/10! hover:text-destructive`:`hover:bg-muted/50! hover:text-foreground`),children:[(0,A.jsx)(a,{icon:n}),(0,A.jsx)(`span`,{className:`sr-only`,children:e})]})})}var HO=[`/overview`,`/flows`,`/store`,`/observability`,`/vault`,`/access`],UO=`oke.console.last-module-search`;function WO(e){return HO.includes(e)}function GO(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:{...e}}function KO(e,t){if(e===void 0)return Object.keys(t).length===0;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function qO(e,t,n){let r=t===`/monitoring`?`/observability`:t;return!WO(r)||KO(e[r],n)?e:{...e,[r]:{...n}}}function JO(e,t){return e[t]??{}}function YO(e){if(e===null||e.length===0)return{};try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return{};let n={},r=t;for(let e of HO){let t=r[e];t&&typeof t==`object`&&!Array.isArray(t)&&(n[e]={...t})}let i=r[`/monitoring`];return n[`/observability`]===void 0&&i&&typeof i==`object`&&!Array.isArray(i)&&(n[`/observability`]={...i}),n}catch{return{}}}function XO(e=QO()){if(!e)return{};try{return YO(e.getItem(UO))}catch{return{}}}function ZO(e,t=QO()){if(t)try{t.setItem(UO,JSON.stringify(e))}catch{}}function QO(){try{return typeof sessionStorage>`u`?null:sessionStorage}catch{return null}}function $O(){let e=ka({select:e=>({pathname:e.location.pathname,search:e.location.search})}),[t,n]=(0,D.useState)(XO);return(0,D.useEffect)(()=>{if(!WO(e.pathname))return;let t=GO(e.search);n(n=>{let r=qO(n,e.pathname,t);return r===n?n:(ZO(r),r)})},[e.pathname,e.search]),t}var ek=`rounded-none! justify-center hover:bg-muted/50! hover:text-foreground data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`,tk=[{title:`Overview`,to:`/overview`,icon:ls,shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:rs,shortcut:`flows`},{title:`Store`,to:`/store`,icon:Wo,shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Ko,shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Uo,shortcut:`vault`},{title:`Access`,to:`/access`,icon:Go,shortcut:`access`}];function nk(){return(0,A.jsx)(`div`,{className:`flex w-full items-center justify-center px-0`,children:(0,A.jsx)(Cv,{className:`size-5`})})}function rk({onFast:e,onSettings:t,onLogout:n,...r}){let i=ka({select:e=>e.location.pathname}),o=$O();return(0,A.jsxs)(yO,{collapsible:`icon`,...r,children:[(0,A.jsx)(SO,{className:`h-10 justify-center border-b border-border/60 p-0`,children:(0,A.jsx)(nk,{})}),(0,A.jsx)(wO,{children:(0,A.jsxs)(TO,{className:`items-stretch p-0`,children:[(0,A.jsx)(EO,{children:`Console`}),(0,A.jsx)(DO,{className:`items-stretch gap-0`,children:tk.map(e=>(0,A.jsx)(OO,{className:`w-full`,children:(0,A.jsxs)(AO,{render:(0,A.jsx)(na,{to:e.to,search:JO(o,e.to)}),isActive:i===e.to,tooltip:{children:(0,A.jsx)(ue,{label:e.title,keys:IO(e.shortcut)})},className:ek,children:[(0,A.jsx)(a,{icon:e.icon}),(0,A.jsx)(`span`,{className:`sr-only`,children:e.title})]})},e.to))})]})}),(0,A.jsx)(CO,{className:`border-t border-border/60 p-0`,children:(0,A.jsx)(BO,{onFast:e,onSettings:t,onLogout:n})})]})}var ik=[{title:`Overview`,to:`/overview`,icon:ls,keywords:[`home`,`traces`],shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:rs,keywords:[`units`,`call`],shortcut:`flows`},{title:`Store`,to:`/store`,icon:Wo,keywords:[`sql`,`kv`,`files`],shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Ko,keywords:[`runs`,`metrics`,`monitoring`],shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Uo,keywords:[`secrets`,`contracts`],shortcut:`vault`},{title:`Access`,to:`/access`,icon:Go,keywords:[`keys`,`api`,`scopes`],shortcut:`access`}];function ak(e){let t=ik.map(t=>({id:`go:${t.to}`,label:t.title,group:`Navigate`,keys:IO(t.shortcut),keywords:t.keywords,icon:t.icon,onSelect:()=>e.go(t.to,JO(e.memory,t.to))})),n=[{id:`theme:light`,label:`Light`,group:`Appearance`,keywords:[`theme`,`day`],icon:os,onSelect:()=>e.setTheme(`light`)},{id:`theme:dark`,label:`Dark`,group:`Appearance`,keywords:[`theme`,`night`],icon:es,onSelect:()=>e.setTheme(`dark`)},{id:`theme:system`,label:`System`,group:`Appearance`,keywords:[`theme`,`auto`],icon:Xo,onSelect:()=>e.setTheme(`system`)}],r=[{id:`settings`,label:`Settings`,group:`Account`,keys:IO(`settings`),keywords:[`preferences`,`operator`],icon:ns,onSelect:e.openSettings},{id:`logout`,label:`Logout`,group:`Account`,keys:IO(`logout`),keywords:[`sign out`,`exit`],icon:$o,onSelect:e.logout}];return[...t,...n,...r]}var ok=e(t(),1);function sk(e,t){if(e.length===0)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r)if(e===n[i]&&(i+=1),i===n.length)return!0;return!1}function ck(e,t){return t.length===0?e:e.filter(e=>[e.label,e.group??``,...e.keywords??[]].some(e=>sk(t,e)))}var lk=`h-auto min-w-0 bg-transparent px-0 font-mono text-[10px] tracking-[0.08em] text-muted-foreground`,uk={type:`spring`,stiffness:560,damping:40,mass:.5};function dk({items:e,shortcut:t=`k`,placeholder:n=`Type a command or search…`,emptyMessage:r=`No results found.`,open:i,onOpenChange:o}){let[s,c]=(0,D.useState)(!1),l=i!==void 0,u=l?i:s,d=(0,D.useCallback)(e=>{l||c(e),o?.(e)},[l,o]),[p,m]=(0,D.useState)(``),[h,g]=(0,D.useState)(0),[_,v]=(0,D.useState)(!1);(0,D.useEffect)(()=>v(!0),[]);let y=(0,D.useId)(),b=X_(),x=(0,D.useCallback)(e=>{m(e),g(0)},[]),S=(0,D.useRef)(null),C=(0,D.useRef)(null);(0,D.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===t.toLowerCase()){e.preventDefault(),d(!u);return}e.key===`Escape`&&u&&(e.preventDefault(),d(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,t,d]),(0,D.useEffect)(()=>{u&&(x(``),g(0),requestAnimationFrame(()=>S.current?.focus()))},[u,x]),(0,D.useEffect)(()=>{if(!u)return;let e=document.documentElement,t=e.style.overflow,n=document.body.style.overflow;return e.style.overflow=`hidden`,document.body.style.overflow=`hidden`,()=>{e.style.overflow=t,document.body.style.overflow=n}},[u]);let w=(0,D.useMemo)(()=>ck(e,p),[e,p]),ee=(0,D.useMemo)(()=>e.some(e=>e.icon!==void 0),[e]),te=(0,D.useMemo)(()=>{let e=new Map;for(let t of w){let n=t.group??`Results`,r=e.get(n)??[];r.push(t),e.set(n,r)}return Array.from(e.entries())},[w]),ne=e=>{if(w.length!==0){if(e.key===`ArrowDown`)e.preventDefault(),g(e=>Math.min(w.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),g(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=w[h];t&&(t.onSelect(),d(!1))}}};if((0,D.useEffect)(()=>{u&&(C.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h,u]),!_)return null;let T=0,re=NO(t.toUpperCase());return(0,ok.createPortal)((0,A.jsxs)(`div`,{"aria-hidden":!u,inert:!u,"data-slot":`command-palette`,className:f(`fixed inset-0 z-100 flex items-start justify-center px-4 pt-[12vh]`,u?`pointer-events-auto`:`pointer-events-none`),children:[(0,A.jsx)(Z_.button,{type:`button`,"aria-label":`Close command palette`,initial:!1,animate:{opacity:+!!u},transition:{duration:u?.18:.12},onClick:()=>d(!1),className:f(`absolute inset-0 bg-black/20`,u?`pointer-events-auto`:`pointer-events-none`)}),(0,A.jsxs)(Z_.div,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,initial:!1,animate:{opacity:+!!u,y:u||b?0:-8,scale:u||b?1:.97},transition:b?{duration:.1}:u?uk:{duration:.12},onKeyDown:ne,className:f(`relative w-full max-w-xl overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-lg will-change-transform`,u?`pointer-events-auto`:`pointer-events-none`),children:[(0,A.jsxs)(`div`,{className:Ne,children:[(0,A.jsx)(`span`,{className:f(it,`pointer-events-none`),children:(0,A.jsx)(a,{icon:ts,className:st})}),(0,A.jsx)(`input`,{ref:S,value:p,onChange:e=>x(e.target.value),placeholder:n,tabIndex:u?0:-1,role:`combobox`,"aria-expanded":u,"aria-controls":`${y}-list`,"aria-activedescendant":w.length>0?`${y}-opt-${h}`:void 0,"aria-autocomplete":`list`,className:xt}),(0,A.jsxs)(`span`,{className:`flex h-full shrink-0 items-center gap-2 pr-2`,children:[(0,A.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:re.map(e=>(0,A.jsx)(he,{className:lk,children:e},e))}),(0,A.jsx)(he,{className:lk,children:`Esc`})]})]}),(0,A.jsx)(`div`,{ref:C,id:`${y}-list`,role:`listbox`,"aria-label":`Commands`,className:`max-h-[60vh] overflow-y-auto overscroll-contain`,children:w.length===0?(0,A.jsx)(`p`,{className:mt,children:r}):te.map(([e,t])=>(0,A.jsxs)(`div`,{className:`border-b border-border/60 last:border-b-0`,children:[(0,A.jsx)(`div`,{"aria-hidden":!0,className:f(Me,`px-2 py-1.5`),children:e}),t.map(e=>{let t=T;T+=1;let n=t===h,r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,id:`${y}-opt-${t}`,role:`option`,"aria-selected":n,"data-index":t,onMouseEnter:()=>g(t),onClick:()=>{e.onSelect(),d(!1)},tabIndex:u?0:-1,className:f(et,`border-b-0`,n&&`bg-muted/70 text-foreground`),children:[n?(0,A.jsx)(`span`,{className:f(lt,ut)}):null,r?(0,A.jsx)(a,{icon:r,className:`relative z-10 size-3.5 shrink-0 text-muted-foreground`}):ee?(0,A.jsx)(`span`,{className:`size-3.5 shrink-0`}):null,(0,A.jsx)(`span`,{className:`relative z-10 min-w-0 flex-1 truncate`,children:e.label}),e.badge?(0,A.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.badge}):null,e.keys&&e.keys.length>0?(0,A.jsx)(ye,{keys:e.keys,className:`relative z-10`}):e.hint?(0,A.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.hint}):null]},e.id)})]},e))})]})]}),document.body)}function fk({...e}){return(0,A.jsx)(te,{"data-slot":`dialog`,...e})}function pk({...e}){return(0,A.jsx)(re,{"data-slot":`dialog-portal`,...e})}function mk({className:e,...t}){return(0,A.jsx)(b,{"data-slot":`dialog-overlay`,className:f(`fixed inset-0 z-50 bg-black/20 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function hk({className:e,children:t,...n}){return(0,A.jsxs)(pk,{children:[(0,A.jsx)(mk,{}),(0,A.jsx)(_,{"data-slot":`dialog-content`,className:f(`fixed top-1/2 left-1/2 z-50 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-none border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none transition duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0`,e),...n,children:t})]})}function gk({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`dialog-header`,className:f(`flex flex-col gap-1 border-b border-border/60 px-4 py-3`,e),...t})}function _k({className:e,...t}){return(0,A.jsx)(C,{"data-slot":`dialog-title`,className:f(`text-sm font-medium text-foreground`,e),...t})}function vk({className:e,...t}){return(0,A.jsx)(Ee,{"data-slot":`dialog-description`,className:f(`text-[11px] text-muted-foreground`,e),...t})}function yk({open:e,onOpenChange:t,operator:n}){return(0,A.jsx)(fk,{open:e,onOpenChange:t,children:(0,A.jsxs)(hk,{"data-slot":`settings-dialog`,children:[(0,A.jsxs)(gk,{children:[(0,A.jsx)(_k,{children:`Settings`}),(0,A.jsx)(vk,{children:`Operator account and appearance.`})]}),(0,A.jsxs)(`dl`,{className:`flex flex-col`,children:[(0,A.jsx)(bk,{label:`Name`,value:n.name}),(0,A.jsx)(bk,{label:`Email`,value:n.email}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-2`,children:[(0,A.jsx)(`dt`,{className:Me,children:`Theme`}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(xv,{})})]})]})]})})}function bk({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-border/60 px-4 py-2`,children:[(0,A.jsx)(`dt`,{className:Me,children:e}),(0,A.jsx)(`dd`,{className:`min-w-0 truncate text-xs text-foreground`,children:t})]})}async function xk(){try{await pt()}finally{rt(null)}}function Sk(e){let t=(0,D.useRef)(e);t.current=e,(0,D.useEffect)(()=>{let e=e=>{let{enabled:n,go:r,openSettings:i,logout:a}=t.current;if(!n||e.repeat||RO(e.target)||!(e.metaKey||e.ctrlKey)||e.altKey)return;if(e.key===`,`){e.preventDefault(),i();return}if(e.key.toLowerCase()===`e`){e.preventDefault(),a();return}let o=LO[e.key];o&&(e.preventDefault(),r(o))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function Ck({operator:e}){let t=ka({select:e=>e.location.pathname}),n=de(),r=$O(),{setTheme:i}=yv(),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(!1),l=t===`/overview`||t===`/flows`||t===`/store`||t===`/vault`||t===`/access`||t===`/observability`,u=(0,D.useCallback)(()=>{xk().then(()=>{n({to:`/`})})},[n]),d=(0,D.useCallback)((e,t)=>{n({to:e,search:t})},[n]),p=(0,D.useMemo)(()=>ak({memory:r,go:d,openSettings:()=>o(!0),logout:u,setTheme:i}),[d,u,r,i]);return Sk({enabled:!s&&!a,go:e=>d(e,JO(r,e)),openSettings:()=>o(!0),logout:u}),(0,A.jsxs)(vO,{open:!1,className:l?`h-svh max-h-svh overflow-hidden`:void 0,children:[(0,A.jsx)(rk,{onFast:()=>c(!0),onSettings:()=>o(!0),onLogout:u}),(0,A.jsx)(xO,{className:l?`min-h-0 max-h-svh overflow-hidden`:void 0,children:(0,A.jsxs)(`div`,{className:f(`flex flex-col`,l?`h-svh max-h-svh min-h-0 overflow-hidden`:`flex-1 gap-4 p-4`),children:[(0,A.jsx)(bO,{className:`-ml-1 md:hidden`}),(0,A.jsx)(ya,{})]})}),(0,A.jsx)(yk,{open:a,onOpenChange:o,operator:e}),(0,A.jsx)(dk,{open:s,onOpenChange:c,items:p})]})}var wk=`modulepreload`,Tk=function(e){return`/`+e},Ek={},Dk=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=Tk(e,n),e=i(e),e in Ek)return;Ek[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:wk,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Ok({location:e}){let t=Bo(`${e.pathname}${e.searchStr}`);if(!Oe())throw mn({to:`/`,search:t});let n=await gt();if(n.error||!n.data)throw rt(null),mn({to:`/`,search:t});let r={operatorId:n.data.operatorId,email:n.data.email,name:n.data.name};return yt(r),{operator:r}}var kk=sa({component:function(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(oO,{}),(0,A.jsx)(ya,{})]})}}),Ak=aa({getParentRoute:()=>kk,path:`/`,validateSearch:zo,component:nO}),jk=aa({getParentRoute:()=>kk,id:`authenticated`,beforeLoad:Ok,component:function(){let{operator:e}=jk.useRouteContext();return(0,A.jsx)(Ck,{operator:e})}}),Mk=aa({getParentRoute:()=>jk,path:`/overview`,validateSearch:ho,component:ca(()=>Dk(()=>import(`./flows-page-ZaTJAhR9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),`FlowsPage`)}),Nk=aa({getParentRoute:()=>jk,path:`/flows`,validateSearch:yo,component:ca(()=>Dk(()=>import(`./units-page-CZOFZzay.js`),__vite__mapDeps([20,1,2,3,4,5,6,21,7,10,11,8,13,14,15,17,22,23,24,25,18])),`UnitsPage`)}),Pk=aa({getParentRoute:()=>jk,path:`/flows/decisions`,validateSearch:e=>{let t=typeof e.decision==`string`&&e.decision.length>0?e.decision:void 0;return{...t===void 0?{}:{decision:t}}},component:ca(()=>Dk(()=>import(`./decisions-page-D9twj8Xy.js`),__vite__mapDeps([26,1,2,3,4,6])),`DecisionsPage`)}),Fk=aa({getParentRoute:()=>jk,path:`/store`,validateSearch:_o,component:ca(()=>Dk(()=>import(`./store-page-8P6vGXnn.js`),__vite__mapDeps([27,1,2,3,4,5,6,21,7,8,12,13,28,29,11,17,22,23,30,16,24,25,31,19])),`StorePage`)}),Ik=aa({getParentRoute:()=>jk,path:`/vault`,validateSearch:ko,component:ca(()=>Dk(()=>import(`./vault-page-ki_ishmX.js`),__vite__mapDeps([32,1,2,3,4,5,6,7,8,29,30,16,15,23,24,25,31,33])),`VaultPage`)}),Lk=aa({getParentRoute:()=>jk,path:`/access`,validateSearch:jo,component:ca(()=>Dk(()=>import(`./access-page-C_N4qvai.js`),__vite__mapDeps([34,1,2,3,4,5,6,10,7,11,16,24,25,31])),`AccessPage`)}),Rk=aa({getParentRoute:()=>jk,path:`/observability`,validateSearch:Do,component:ca(()=>Dk(()=>import(`./observability-page-Cn6R_dXz.js`),__vite__mapDeps([35,1,2,3,4,5,6,21,7,8,9,10,11,12,13,14,15,16,28,29,24,33])),`ObservabilityPage`)}),zk=aa({getParentRoute:()=>jk,path:`/monitoring`,validateSearch:Do,beforeLoad:({search:e})=>{throw mn({to:`/observability`,search:e})}}),Bk=Ta({routeTree:kk.addChildren([Ak,jk.addChildren([Mk,Nk,Pk,Fk,Ik,Lk,Rk,zk])]),defaultNotFoundComponent:Tv,defaultPendingComponent:()=>(0,A.jsx)(`div`,{className:`grid min-h-dvh place-items-center text-sm text-muted-foreground`,children:`Loading…`})});dt(e=>{let t=e.split(`?`)[0]??``;t!==`/`&&t!==``&&Bk.navigate({to:`/`,search:Bo(e)})}),ft();var Vk=new kt({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}}),Hk=document.getElementById(`root`);if(!Hk)throw Error(`Missing #root`);(0,mo.createRoot)(Hk).render((0,A.jsx)(D.StrictMode,{children:(0,A.jsx)(vv,{defaultTheme:`system`,storageKey:`oke-console-theme`,children:(0,A.jsx)(d,{delay:0,children:(0,A.jsx)(m,{client:Vk,children:(0,A.jsx)(po,{children:(0,A.jsx)(Oa,{router:Bk})})})})})}));export{Ds as $,Yu as A,go as At,Ul as B,qd as C,xo as Ct,Od as D,Eo as Dt,kd as E,To as Et,fu as F,R as G,Vl as H,ru as I,N as J,F as K,$l as L,Mu as M,At as Mt,ku as N,Ad as O,bo as Ot,pu as P,Ms as Q,Yl as R,B as S,Oo as St,jd as T,Co as Tt,Rl as U,Hl as V,Ol as W,Us as X,ec as Y,Ps as Z,xf as _,Xo as _t,Sv as a,_s as at,_f as b,Mo as bt,Z_ as c,ms as ct,ng as d,fs as dt,ws as et,fh as f,cs as ft,Sf as g,Qo as gt,Af as h,ts as ht,sO as i,vs as it,ju as j,na as jt,ad as k,vo as kt,X_ as l,ps as lt,Zf as m,ns as mt,NO as n,xs as nt,yv as o,gs as ot,zp as p,ss as pt,lc as q,PO as r,ys as rt,nv as s,us as st,Dk as t,Cs as tt,rg as u,ds as ut,bf as v,Jo as vt,Bd as w,wo as wt,ef as x,Ao as xt,yf as y,qo as yt,Kl as z};
58
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function rT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;rT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var iT=new Set([`type`,`properties`,`required`,`additionalProperties`]),aT=[`oneOf`,`anyOf`];function oT(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function sT(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!iT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??oT(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ry(n,r,e.length===1?e[0]:sT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=oT(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function cT(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iT)if(t in e)return;let n=t.filter(e=>aT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=sT(t);else{let e=n[0],i=aT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>sT([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Qw(e,r))}function lT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Qw(i,s),Qw(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())rT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])cT(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Qw(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ry(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:dT(t,`input`,e.processors),output:dT(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Z(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Z(r.element,n);if(r.type===`set`)return Z(r.valueType,n);if(r.type===`lazy`)return Z(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Z(r.innerType,n);if(r.type===`intersection`)return Z(r.left,n)||Z(r.right,n);if(r.type===`record`||r.type===`map`)return Z(r.keyType,n)||Z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Z(r.in,n)||Z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Z(e,n))return!0;return!!(r.rest&&Z(r.rest,n))}return!1}var uT=(e,t={})=>n=>{let r=$w({...n,processors:t});return X(e,r),nT(r,e),lT(r,e)},dT=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$w({...i??{},target:a,io:t,processors:n});return X(e,o),nT(o,e),lT(o,e)},fT=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},pT=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},mT=(e,t)=>{fT(e,`minimum`,t),pT(e,`maximum`,t)},hT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},gT=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},_T=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},vT=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},yT=(e,t)=>fT(e,`minimum`,t.minimum),bT=(e,t)=>pT(e,`maximum`,t.maximum),xT=e=>(t,n)=>{vT(t,n.format);let[r,i]=e[n.format];fT(t,`minimum`,r),pT(t,`maximum`,i)},ST={greater_than:(e,t)=>fT(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>pT(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>hT(e,t.value),number_format:xT(ib),bigint_format:xT(ab),min_length:yT,max_length:bT,length_equals:(e,t)=>mT(e,t.length),min_size:yT,max_size:bT,size_equals:(e,t)=>mT(e,t.size),string_format:(e,t)=>{vT(e,t.format),t.pattern&&gT(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>_T(e,t.mime)};function CT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ST[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&fT(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&fT(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&pT(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&pT(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&hT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&_T(t,i.mime);for(let e of i.patterns??[])gT(t,e);return t}var wT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},TT=new Map([[KS,Rx],[JS,zx]]),ET=e=>TT.get(e)??e,DT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=CT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=wT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(ET);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},OT=(e,t,n,r)=>{n.not={}},kT=(e,t,n,r)=>{let i=e._zod.def,a=jy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},AT=(e,t,n,r)=>{eT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},jT=(e,t,n,r)=>{eT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},MT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=CT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=X(a.element,t,{...r,path:[...r.path,`items`]})};function NT(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?NT(t.out):t.type===`catch`?NT(t.innerType):e._zod.optin}var PT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&eT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ry(i.properties,e,X(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?NT(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=X(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},FT=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>X(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},IT=(e,t,n,r)=>{let i=e._zod.def,a=X(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=X(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},LT=(e,t,n,r)=>{let i=e._zod.def,a=X(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},RT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zT=Symbol();function BT(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(eT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zT):JSON.parse(o)}var VT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=BT(i.defaultValue,e,t,n,r);o!==zT&&(n.default=o)},HT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=BT(i.defaultValue,e,t,n,r);o!==zT&&(n._prefault=o)},UT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{eT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},WT=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;X(o,t,r);let s=t.seen.get(e);s.ref=o},GT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},KT=(e,t,n,r)=>{let i=e._zod.def;X(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qT=new WeakSet([Object.prototype,Error.prototype]);function JT(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var YT=q(`ZodError`,(e,t)=>{Qb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);qT.has(n)||(qT.add(n),JT(n,`format`,e=>t=>tx(e,t)),JT(n,`flatten`,e=>t=>ex(e,t)),JT(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ny,2)}),JT(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ny,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),XT=rx(YT),ZT=ix(YT),QT=ax(YT),$T=sx(YT),eE=px(YT),tE=mx(YT),nE=hx(YT),rE=gx(YT),iE=_x(YT),aE=vx(YT),oE=yx(YT),sE=bx(YT);function cE(){Wb.localeError||Gb(QC())}function lE(){Wb.memoizer||Gb({memoizer:YC()})}var Q=q(`ZodType`,(e,t)=>(cE(),J.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Gy(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return tb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_D(e,t))},superRefine(e,t){return this.check(vD(e,t))},overwrite(e){return this.check(Hw(e))},optional(){return $E(this)},exactOptional(){return tD(this)},nullable(){return rD(this)},nullish(){return $E(rD(this))},nonoptional(e){return lD(this,e)},array(){return VE(this)},or(e){return GE([this,e])},and(e){return qE(this,e)},transform(e){return pD(this,ZE(e))},default(e){return aD(this,e)},prefault(e){return sD(this,e)},catch(e){return dD(this,e)},pipe(e){return pD(this,e)},readonly(){return hD(this)},describe(e){let t=this.clone();return nw.add(t,{description:e}),t},meta(...e){if(e.length===0)return nw.get(this);let t=this.clone();return nw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ob(this,`~standard`,{...mS(this),jsonSchema:{input:dT(this,`input`),output:dT(this,`output`)}})},set"~standard"(e){Db(this,`~standard`,e)},parse:function e(t,n){return XT(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ZT(this,t,n,{callee:e})},safeParse(e,t){return QT(this,e,t)},async safeParseAsync(e,t){return $T(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Db(this,`spa`,e)},validate(e,t){return ux(this,e,t)},validateAsync(e,t){return fx(this,e,t)},encode:function e(t,n){return eE(this,t,n,{callee:e})},decode:function e(t,n){return tE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await nE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await rE(this,t,n,{callee:e})},safeEncode(e,t){return iE(this,e,t)},safeDecode(e,t){return aE(this,e,t)},async safeEncodeAsync(e,t){return oE(this,e,t)},async safeDecodeAsync(e,t){return sE(this,e,t)},toJSONSchema(e){return uT(this,{})(e)},get description(){return nw.get(this)?.description},get _def(){return this._zod.def}}),uE=q(`_ZodString`,(e,t)=>{hS.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DT(e,t,n,r)},kb({format:e=>CT(e).format??null,minLength:e=>CT(e).minimum??null,maxLength:e=>CT(e).maximum??null},{regex(...e){return this.check(Iw(...e))},includes(...e){return this.check(zw(...e))},startsWith(...e){return this.check(Bw(...e))},endsWith(...e){return this.check(Vw(...e))},min(...e){return this.check(Pw(...e))},max(...e){return this.check(Nw(...e))},length(...e){return this.check(Fw(...e))},nonempty(...e){return this.check(Pw(1,...e))},lowercase(e){return this.check(Lw(e))},uppercase(e){return this.check(Rw(e))},trim(){return this.check(Ww())},normalize(...e){return this.check(Uw(...e))},toLowerCase(){return this.check(Gw())},toUpperCase(){return this.check(Kw())},slugify(){return this.check(qw())}})),dE=q(`ZodString`,(e,t)=>{hS.init(e,t),uE.init(e,t)},{email(e){return this.check(aw(_E,e))},url(e){return this.check(dw(bE,e))},jwt(e){return this.check(Ew(FE,e))},emoji(e){return this.check(fw(xE,e))},guid(e){return this.check(ow(vE,e))},uuid(e){return this.check(sw(yE,e))},uuidv4(e){return this.check(cw(yE,e))},uuidv6(e){return this.check(lw(yE,e))},uuidv7(e){return this.check(uw(yE,e))},nanoid(e){return this.check(pw(SE,e))},cuid(e){return this.check(mw(CE,e))},cuid2(e){return this.check(hw(wE,e))},ulid(e){return this.check(gw(TE,e))},base64(e){return this.check(Cw(ME,e))},base64url(e){return this.check(ww(NE,e))},xid(e){return this.check(_w(EE,e))},ksuid(e){return this.check(vw(DE,e))},ipv4(e){return this.check(yw(OE,e))},ipv6(e){return this.check(bw(kE,e))},cidrv4(e){return this.check(xw(AE,e))},cidrv6(e){return this.check(Sw(jE,e))},e164(e){return this.check(Tw(PE,e))},datetime(e){return this.check(Dw(pE,e))},date(e){return this.check(Ow(mE,e))},time(e){return this.check(kw(hE,e))},duration(e){return this.check(Aw(gE,e))}});function fE(e){return iw(dE,e)}var $=q(`ZodStringFormat`,(e,t)=>{Y.init(e,t),uE.init(e,t)}),pE=q(`ZodISODateTime`,(e,t)=>{PS.init(e,t),$.init(e,t)}),mE=q(`ZodISODate`,(e,t)=>{FS.init(e,t),$.init(e,t)}),hE=q(`ZodISOTime`,(e,t)=>{IS.init(e,t),$.init(e,t)}),gE=q(`ZodISODuration`,(e,t)=>{LS.init(e,t),$.init(e,t)}),_E=q(`ZodEmail`,(e,t)=>{vS.init(e,t),$.init(e,t)}),vE=q(`ZodGUID`,(e,t)=>{gS.init(e,t),$.init(e,t)}),yE=q(`ZodUUID`,(e,t)=>{_S.init(e,t),$.init(e,t)}),bE=q(`ZodURL`,(e,t)=>{ES.init(e,t),$.init(e,t)}),xE=q(`ZodEmoji`,(e,t)=>{DS.init(e,t),$.init(e,t)}),SE=q(`ZodNanoID`,(e,t)=>{OS.init(e,t),$.init(e,t)}),CE=q(`ZodCUID`,(e,t)=>{kS.init(e,t),$.init(e,t)}),wE=q(`ZodCUID2`,(e,t)=>{AS.init(e,t),$.init(e,t)}),TE=q(`ZodULID`,(e,t)=>{jS.init(e,t),$.init(e,t)}),EE=q(`ZodXID`,(e,t)=>{MS.init(e,t),$.init(e,t)}),DE=q(`ZodKSUID`,(e,t)=>{NS.init(e,t),$.init(e,t)}),OE=q(`ZodIPv4`,(e,t)=>{RS.init(e,t),$.init(e,t)}),kE=q(`ZodIPv6`,(e,t)=>{VS.init(e,t),$.init(e,t)}),AE=q(`ZodCIDRv4`,(e,t)=>{HS.init(e,t),$.init(e,t)}),jE=q(`ZodCIDRv6`,(e,t)=>{WS.init(e,t),$.init(e,t)}),ME=q(`ZodBase64`,(e,t)=>{qS.init(e,t),$.init(e,t)}),NE=q(`ZodBase64URL`,(e,t)=>{XS.init(e,t),$.init(e,t)}),PE=q(`ZodE164`,(e,t)=>{ZS.init(e,t),$.init(e,t)}),FE=q(`ZodJWT`,(e,t)=>{$S.init(e,t),$.init(e,t)}),IE=q(`ZodUnknown`,(e,t)=>{eC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function LE(){return jw(IE)}var RE=q(`ZodNever`,(e,t)=>{tC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OT(e,t,n,r)});function zE(e){return Mw(RE,e)}var BE=q(`ZodArray`,(e,t)=>{lE(),rC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Pw(e,t))},nonempty(e){return this.check(Pw(1,e))},max(e,t){return this.check(Nw(e,t))},length(e,t){return this.check(Fw(e,t))},unwrap(){return this.element}});function VE(e,t){return Jw(BE,e,t)}var HE=q(`ZodObject`,(e,t)=>{lE(),lC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PT(e,t,n,r),Fb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return YE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Gy(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Gy(this._zod.def,{catchall:LE()}))},loose(){return this.clone(Gy(this._zod.def,{catchall:LE()}))},strict(){return this.clone(Gy(this._zod.def,{catchall:zE()}))},strip(){return this.clone(Gy(this._zod.def,{catchall:void 0}))},extend(e){return lb(this,e)},safeExtend(e){return db(this,e)},merge(e){return fb(this,e)},pick(e){return ob(this,e)},omit(e){return cb(this,e)},partial(...e){return pb(QE,this,e[0])},exactPartial(...e){return pb(eD,this,e[0],`exactPartial`)},required(...e){return mb(cD,this,e[0])}});function UE(e,t){return new HE({type:`object`,shape:e??{},...G(t)})}var WE=q(`ZodUnion`,(e,t)=>{dC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FT(e,t,n,r),e.options=t.options});function GE(e,t){return new WE({type:`union`,options:e,...G(t)})}var KE=q(`ZodIntersection`,(e,t)=>{fC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IT(e,t,n,r)});function qE(e,t){return new KE({type:`intersection`,left:e,right:t})}var JE=q(`ZodEnum`,(e,t)=>{hC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new JE({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new JE({...t,checks:[],...G(r),entries:i})}});function YE(e,t){return new JE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var XE=q(`ZodTransform`,(e,t)=>{lE(),gC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jT(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ub(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Tb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Tb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ZE(e){return new XE({type:`transform`,transform:e})}var QE=q(`ZodOptional`,(e,t)=>{vC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $E(e){return new QE({type:`optional`,innerType:e})}var eD=q(`ZodExactOptional`,(e,t)=>{yC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tD(e){return new eD({type:`optional`,innerType:e})}var nD=q(`ZodNullable`,(e,t)=>{bC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rD(e){return new nD({type:`nullable`,innerType:e})}var iD=q(`ZodDefault`,(e,t)=>{xC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function aD(e,t){return new iD({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Qy(t)}})}var oD=q(`ZodPrefault`,(e,t)=>{CC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sD(e,t){return new oD({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Qy(t)}})}var cD=q(`ZodNonOptional`,(e,t)=>{wC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lD(e,t){return new cD({type:`nonoptional`,innerType:e,...G(t)})}var uD=q(`ZodCatch`,(e,t)=>{DC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dD(e,t){return new uD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Lb(t)})}var fD=q(`ZodPipe`,(e,t)=>{OC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WT(e,t,n,r),e.in=t.in,e.out=t.out});function pD(e,t){return new fD({type:`pipe`,in:e,out:t})}var mD=q(`ZodReadonly`,(e,t)=>{AC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hD(e){return new mD({type:`readonly`,innerType:e})}var gD=q(`ZodCustom`,(e,t)=>{MC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AT(e,t,n,r)});function _D(e,t={}){return Yw(gD,e,t)}function vD(e,t){return Xw(e,t)}function yD({className:e,id:t,revealNonce:n,...r}){let[i,o]=(0,D.useState)(!1);(0,D.useEffect)(()=>{n!==void 0&&n>0&&o(!0)},[n]);let c=(0,D.useId)(),l=t??`password-${c}`,u=`${l}-visibility`,d=i?`text`:`password`;return(0,A.jsxs)(`div`,{className:`relative w-full min-w-0`,children:[(0,A.jsx)(s,{...r,id:l,type:d,inputMode:`text`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,className:f(`pr-10`,e)},d),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-label":i?`Hide password`:`Show password`,"aria-pressed":i,"aria-controls":l,"aria-describedby":u,className:f(vt,`absolute top-1/2 right-0 -translate-y-1/2`),children:(0,A.jsx)(a,{icon:i?ss:cs,size:16,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0})}),(0,A.jsx)(`span`,{id:u,className:`sr-only`,"aria-live":`polite`,children:i?`Password is visible`:`Password is hidden`})]})}function bD({className:e,...t}){return(0,A.jsx)(`label`,{"data-slot":`label`,className:f(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function xD({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`field-group`,className:f(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var SD=h(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function CD({className:e,orientation:t=`vertical`,...n}){return(0,A.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:f(SD({orientation:t}),e),...n})}function wD({className:e,...t}){return(0,A.jsx)(bD,{"data-slot":`field-label`,className:f(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function TD({className:e,children:t,errors:n,...r}){let i=(0,D.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,A.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,A.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,A.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:f(`text-sm font-normal text-destructive`,e),...r,children:i}):null}var ED=UE({email:fE().email(`Enter a valid email.`),password:fE().min(1,`Password is required.`)});function DD(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function OD(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,A.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function kD(){let e=o(),t=de(),n=Be({from:`/`}),[r,i]=(0,D.useState)(null),a=At({mutationFn:async e=>{let t=await tt(e);if(t.error)throw Error(Ye(t.error));if(!t.data)throw Error(`Empty login response`);return t.data},onSuccess:r=>{Ke(r),i(null),e.invalidateQueries({queryKey:[`console.setup.status`]}),window.setTimeout(()=>{Ho(t,n.next)},650)},onError:e=>{i(e.message)}}),c=Ay({defaultValues:{email:``,password:``},validators:{onSubmit:ED},onSubmit:async({value:e})=>{i(null),await a.mutateAsync(e)}});return(0,A.jsx)(hv,{title:`Sign in`,status:{label:`Setup closed`},description:`Sign in with an existing operator account.`,footer:(0,A.jsx)(uv,{type:`submit`,form:`login-form`,state:lv({pending:a.isPending,success:a.isSuccess,error:a.isError||r!==null}),loadingText:`Signing in`,successText:`Signed in`,errorText:`Try again`,children:`Sign in`}),children:({titleId:e,descriptionId:t})=>(0,A.jsxs)(`form`,{id:`login-form`,className:`flex flex-col`,autoComplete:`on`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":a.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),c.handleSubmit()},children:[(0,A.jsxs)(xD,{className:iv,role:`group`,"aria-label":`Operator credentials`,children:[(0,A.jsx)(c.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Email`,(0,A.jsx)(OD,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`username`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":DD(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(c.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Password`,(0,A.jsx)(OD,{})]}),(0,A.jsx)(yD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`current-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":DD(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}})]}),r?(0,A.jsx)(`p`,{id:`login-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})}function AD(e){return e.claimSucceeded?`claim`:e.setupClosed?`login`:`claim`}var jD=/[^A-Za-z0-9]/,MD={minLength:8,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function ND(e={}){return{minLength:e.minLength??MD.minLength,requireLetter:e.requireLetter??MD.requireLetter,requireNumber:e.requireNumber??MD.requireNumber,requireUppercase:e.requireUppercase??MD.requireUppercase,requireLowercase:e.requireLowercase??MD.requireLowercase,requireSpecial:e.requireSpecial??MD.requireSpecial}}function PD(e){return jD.test(e)}function FD(e,t={}){let n=ND(t),r=[];if(e.length<n.minLength&&r.push(`minLength ${n.minLength} (got ${e.length})`),n.requireLetter&&!/[A-Za-z]/.test(e)&&r.push(`requireLetter`),n.requireUppercase&&!/[A-Z]/.test(e)&&r.push(`requireUppercase`),n.requireLowercase&&!/[a-z]/.test(e)&&r.push(`requireLowercase`),n.requireNumber&&!/\d/.test(e)&&r.push(`requireNumber`),n.requireSpecial&&!PD(e)&&r.push(`requireSpecial`),r.length>0)throw new WD(r)}var ID=`ABCDEFGHJKLMNPQRSTUVWXYZ`,LD=`abcdefghijkmnpqrstuvwxyz`,RD=`23456789`,zD=`!@#$%^&*-_=+?`;function BD(e={}){let t=ND(e),n=e.length??Math.max(t.minLength,16);if(n<t.minLength)throw Error(`generatePassword: length ${n} is below minLength ${t.minLength}`);let r=[];t.requireUppercase&&r.push(ID),t.requireLowercase&&r.push(LD),t.requireLetter&&!t.requireUppercase&&!t.requireLowercase&&r.push(ID+LD),t.requireNumber&&r.push(RD),t.requireSpecial&&r.push(zD);let i=r.length>0?r.join(``):ID+LD+RD;if(n<r.length)throw Error(`generatePassword: length ${n} cannot cover ${r.length} classes`);let a=r.map(e=>VD(e));for(;a.length<n;)a.push(VD(i));HD(a);let o=a.join(``);return FD(o,t),o}function VD(e){return e[UD(e.length)]??e[0]}function HD(e){for(let t=e.length-1;t>0;t--){let n=UD(t+1),r=e[t];e[t]=e[n],e[n]=r}}function UD(e){if(!Number.isInteger(e)||e<=0)throw Error(`randomInt: maxExclusive must be a positive integer`);let t=e<=256?1:2,n=t===1?256:65536;if(e>n)throw Error(`randomInt: maxExclusive ${e} exceeds ${n}`);let r=n-n%e,i=new Uint8Array(t);for(;;){crypto.getRandomValues(i);let n=t===1?i[0]??0:(i[0]??0)<<8|(i[1]??0);if(n<r)return n%e}}var WD=class extends Error{reasons;constructor(e){super(`password policy failed: ${e.join(`, `)}`),this.name=`PasswordPolicyError`,this.reasons=e}},GD={minLength:12,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function KD(e){let t=ND(GD);return[{id:`length`,label:`At least ${t.minLength} characters`,met:e.length>=t.minLength},{id:`uppercase`,label:`Contains an uppercase letter`,met:/[A-Z]/.test(e)},{id:`lowercase`,label:`Contains a lowercase letter`,met:/[a-z]/.test(e)},{id:`number`,label:`Contains a number`,met:/\d/.test(e)},{id:`special`,label:`Contains a special character`,met:PD(e)}]}function qD(){return BD(GD)}function JD({onGenerate:e,disabled:t,copyText:n=async e=>{await navigator.clipboard.writeText(e)}}){let[r,i]=(0,D.useState)(!1),o=(0,D.useRef)(null);return(0,D.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),(0,A.jsxs)(we,{type:`button`,variant:`ghost`,size:`xs`,disabled:t,"data-slot":`generate-password`,"aria-label":r?`Password generated and copied`:`Generate a password and copy it`,className:`text-muted-foreground`,onClick:()=>{let t=qD();e(t),n(t).then(()=>{i(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>i(!1),1600)}).catch(()=>{i(!1)})},children:[(0,A.jsx)(a,{icon:r?ee:is,"data-icon":`inline-start`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?`Copied`:`Generate`]})}function YD(e){return KD(e)}function XD(e,t){if(e<=0)return{label:`Empty`,bar:`bg-muted-foreground/35`,text:`text-muted-foreground`};if(e===t)return{label:`Strong`,bar:`bg-emerald-500`,text:`text-emerald-600 dark:text-emerald-400`};let n=e/t;return n<=.4?{label:`Weak`,bar:`bg-destructive`,text:`text-destructive`}:n<=.6?{label:`Fair`,bar:`bg-amber-500`,text:`text-amber-600 dark:text-amber-400`}:{label:`Good`,bar:`bg-lime-500`,text:`text-lime-700 dark:text-lime-400`}}function ZD({password:e,id:t=`password-strength`}){let n=YD(e),r=n.filter(e=>e.met).length,i=Math.round(r/n.length*100),o=XD(r,n.length),s=e.length===0;return(0,A.jsxs)(`div`,{id:t,className:`flex flex-col gap-3`,"aria-live":`polite`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,id:`${t}-label`,children:`Password strength`}),(0,A.jsx)(`p`,{className:f(`text-xs tabular-nums font-medium`,s?`text-muted-foreground`:o.text),"aria-hidden":!0,children:s?`0/${n.length}`:`${o.label} · ${r}/${n.length}`})]}),(0,A.jsx)(`div`,{role:`progressbar`,"aria-labelledby":`${t}-label`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-valuetext":s?`No password entered`:`${o.label}: ${r} of ${n.length} requirements met`,className:`h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,A.jsx)(`div`,{className:f(`h-full rounded-full transition-[width,background-color] duration-200 ease-out`,s?`bg-muted-foreground/35`:o.bar),style:{width:`${s?0:Math.max(i,r>0?12:0)}%`}})})]}),(0,A.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"aria-label":`Password requirements`,children:n.map(e=>(0,A.jsxs)(`li`,{className:f(`flex items-center gap-2 text-xs transition-colors`,e.met?`text-foreground`:`text-muted-foreground`),children:[(0,A.jsx)(a,{icon:e.met?qo:Jo,size:14,color:`currentColor`,strokeWidth:1.5,className:f(e.met?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground/60`),"aria-hidden":!0}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`span`,{className:`sr-only`,children:e.met?`Met: `:`Not met: `}),e.label]})]},e.id))})]})}var QD=UE({claimCode:fE().min(1,`Claim code is required.`),name:fE().min(1,`Name is required.`),email:fE().email(`Enter a valid email.`),password:fE().min(12,`Password must be at least 12 characters.`).refine(e=>KD(e).every(e=>e.met),{message:`Password needs uppercase, lowercase, a number, and a special character.`})});function $D(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function eO(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,A.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function tO({children:e}){return(0,A.jsx)(wv,{children:e})}function nO(){let e=o(),t=de(),n=Be({from:`/`}),[r,i]=(0,D.useState)(null),[a,c]=(0,D.useState)(0),l=ge({queryKey:[`console.setup.status`],queryFn:async()=>{let e=await ct();if(e.error)throw Error(Ye(e.error));if(!e.data)throw Error(`Empty setup status`);return e.data},retry:2});(0,D.useEffect)(()=>{l.data?.claimRequired&&rt(null)},[l.data?.claimRequired]);let u=At({mutationFn:async e=>{let t=await at(e);if(t.error)throw Error(Ye(t.error));if(!t.data)throw Error(`Empty claim response`);return t.data},onSuccess:r=>{Ke(r),i(null),e.setQueryData([`console.setup.status`],{setupClosed:!0,claimRequired:!1}),window.setTimeout(()=>{Ho(t,n.next)},650)},onError:e=>{i(e.message)}}),d=Ay({defaultValues:{claimCode:``,name:``,email:``,password:``},validators:{onSubmit:QD},onSubmit:async({value:e})=>{i(null),await u.mutateAsync(e)}});return l.isLoading?(0,A.jsx)(tO,{children:(0,A.jsx)(gv,{})}):l.isError?(0,A.jsx)(tO,{children:(0,A.jsx)(hv,{title:`Console unreachable`,status:{label:`Offline`,tone:`alert`},description:`Could not reach the setup API.`,children:(0,A.jsx)(`p`,{className:`px-5 pb-6 text-sm text-muted-foreground`,role:`alert`,children:l.error instanceof Error?l.error.message:`Is the Console kernel running on :6533?`})})}):AD({setupClosed:l.data?.setupClosed===!0,claimSucceeded:u.isSuccess})===`login`?(0,A.jsx)(tO,{children:(0,A.jsx)(kD,{})}):(0,A.jsx)(tO,{children:(0,A.jsx)(hv,{title:`First admin`,status:{label:`Setup open`,tone:`open`},description:"Enter the claim code from the `oke dev` board, or run `oke console claim-code`. This wizard closes permanently after the first operator.",footer:(0,A.jsx)(uv,{type:`submit`,form:`claim-form`,state:lv({pending:u.isPending,success:u.isSuccess,error:u.isError||r!==null}),loadingText:`Creating`,successText:`Created`,errorText:`Try again`,children:`Create admin account`}),children:({titleId:e,descriptionId:t})=>(0,A.jsxs)(`form`,{id:`claim-form`,className:`flex flex-col`,autoComplete:`off`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":u.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),d.handleSubmit()},children:[(0,A.jsxs)(xD,{className:iv,role:`group`,"aria-label":`First admin details`,children:[(0,A.jsx)(d.Field,{name:`claimCode`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Claim code`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`text`,inputMode:`text`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,placeholder:`Claim code`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`name`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Name`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`text`,autoComplete:`name`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Name`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:av,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Email`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(s,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`email`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(t&&n),required:!0,className:ov}),t?(0,A.jsx)(TD,{id:n,className:sv,errors:e.state.meta.errors}):null]})}}),(0,A.jsx)(d.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-strength`,r=`${e.name}-error`;return(0,A.jsxs)(CD,{"data-invalid":t||void 0,className:f(av,`items-start`),children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 pt-1.5`,children:[(0,A.jsxs)(wD,{htmlFor:e.name,className:cv,children:[`Password`,(0,A.jsx)(eO,{})]}),(0,A.jsx)(JD,{disabled:u.isPending,onGenerate:t=>{e.handleChange(t),c(e=>e+1)}})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,A.jsx)(yD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),revealNonce:a,minLength:12,autoComplete:`new-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":$D(n,t&&r),required:!0,className:ov}),(0,A.jsx)(ZD,{id:n,password:e.state.value}),t?(0,A.jsx)(TD,{id:r,errors:e.state.meta.errors}):null]})]})}})]}),r?(0,A.jsx)(`p`,{id:`claim-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})})}var rO=`okengine Console`,iO={"/overview":`Overview`,"/flows":`Flows`,"/store":`Store`,"/observability":`Observability`,"/vault":`Vault`,"/access":`Access`,"/monitoring":`Observability`};function aO(e){if(e===`/`||e===``)return rO;let t=iO[e];return t?`${t} · ${rO}`:`Not found · ${rO}`}function oO(){let e=ka({select:e=>e.location.pathname});return(0,D.useEffect)(()=>{document.title=aO(e)},[e]),null}function sO(e){return g(e.defaultTagName??`div`,e,e)}var cO=768;function lO(){let[e,t]=D.useState(void 0);return D.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<cO)};return e.addEventListener(`change`,n),t(window.innerWidth<cO),()=>e.removeEventListener(`change`,n)},[]),!!e}var uO=`sidebar_state`,dO=604800,fO=`16rem`,pO=`18rem`,mO=`3rem`,hO=`b`,gO=D.createContext(null);function _O(){let e=D.useContext(gO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function vO({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=lO(),[c,l]=D.useState(!1),[u,d]=D.useState(e),p=t??u,m=D.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):d(t),document.cookie=`${uO}=${t}; path=/; max-age=${dO}`},[n,p]),h=D.useCallback(()=>s?l(e=>!e):m(e=>!e),[s,m,l]);D.useEffect(()=>{let e=e=>{e.key===hO&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=D.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:h}),[g,p,m,s,c,l,h]);return(0,A.jsx)(gO.Provider,{value:_,children:(0,A.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":fO,"--sidebar-width-icon":mO,...i},className:f(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function yO({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=_O();return n===`none`?(0,A.jsx)(`div`,{"data-slot":`sidebar`,className:f(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,A.jsx)(ae,{open:l,onOpenChange:u,...o,children:(0,A.jsxs)(fe,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":pO},side:e,children:[(0,A.jsxs)(se,{className:`sr-only`,children:[(0,A.jsx)(xe,{children:`Sidebar`}),(0,A.jsx)(_e,{children:`Displays the mobile sidebar.`})]}),(0,A.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,A.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,A.jsx)(`div`,{"data-slot":`sidebar-gap`,className:f(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,A.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:f(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,A.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function bO({className:e,onClick:t,...n}){let{toggleSidebar:r}=_O();return(0,A.jsxs)(we,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:f(e),onClick:e=>{t?.(e),r()},...n,children:[(0,A.jsx)(a,{icon:as,className:`cn-rtl-flip`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function xO({className:e,...t}){return(0,A.jsx)(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function SO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function CO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function wO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function TO({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function EO({className:e,render:t,...n}){return sO({defaultTagName:`div`,props:c({className:f(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function DO({className:e,...t}){return(0,A.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function OO({className:e,...t}){return(0,A.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}var kO=h(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm text-muted-foreground ring-sidebar-ring outline-hidden transition-[width,height,padding,color] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function AO({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:d}=_O(),m=sO({defaultTagName:`button`,props:c({className:f(kO({variant:n,size:r}),a)},o),render:i?(0,A.jsx)(p,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,A.jsxs)(l,{children:[m,(0,A.jsx)(u,{side:`right`,align:`center`,hidden:d!==`collapsed`||s,...i})]})):m}function jO(e=globalThis.navigator){if(e===void 0)return!1;let t=e.userAgentData?.platform;return typeof t==`string`&&t.length>0?/mac/i.test(t):/Mac|iPhone|iPad|iPod/.test(`${e.platform??``} ${e.userAgent??``}`)}function MO(e){return jO(e)?`⌘`:`Ctrl`}function NO(e,t){return[MO(t),e]}function PO(e,t){return jO(t)?[MO(t),`⇧`,e]:[MO(t),`Shift`,e]}var FO={overview:`1`,flows:`2`,store:`3`,observability:`4`,vault:`5`,access:`6`};function IO(e){return NO(e===`fast`?`K`:e===`settings`?`,`:e===`logout`?`E`:FO[e])}var LO={1:`/overview`,2:`/flows`,3:`/store`,4:`/observability`,5:`/vault`,6:`/access`};function RO(e){if(e===null||typeof HTMLElement>`u`||!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.closest(`[role="dialog"], [data-slot="command-palette"]`)!==null}var zO=`rounded-none! justify-center data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`;function BO({onFast:e,onSettings:t,onLogout:n}){let{isMobile:r,setOpenMobile:i}=_O(),a=()=>{r&&i(!1)};return(0,A.jsxs)(DO,{className:`items-stretch gap-0`,children:[(0,A.jsx)(VO,{label:`Fast`,keys:IO(`fast`),icon:Yo,slot:`sidebar-fast`,onClick:()=>{a(),e()}}),(0,A.jsx)(VO,{label:`Settings`,keys:IO(`settings`),icon:ns,slot:`sidebar-settings`,onClick:()=>{a(),t()}}),(0,A.jsx)(VO,{label:`Logout`,keys:IO(`logout`),icon:$o,slot:`sidebar-logout`,danger:!0,onClick:()=>{a(),n()}})]})}function VO({label:e,keys:t,icon:n,slot:r,danger:i,onClick:o}){return(0,A.jsx)(OO,{className:`w-full`,children:(0,A.jsxs)(AO,{tooltip:t?{children:(0,A.jsx)(ue,{label:e,keys:t})}:e,onClick:o,"data-slot":r,className:f(zO,i?`hover:bg-destructive/10! hover:text-destructive`:`hover:bg-muted/50! hover:text-foreground`),children:[(0,A.jsx)(a,{icon:n}),(0,A.jsx)(`span`,{className:`sr-only`,children:e})]})})}var HO=[`/overview`,`/flows`,`/store`,`/observability`,`/vault`,`/access`],UO=`oke.console.last-module-search`;function WO(e){return HO.includes(e)}function GO(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:{...e}}function KO(e,t){if(e===void 0)return Object.keys(t).length===0;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function qO(e,t,n){let r=t===`/monitoring`?`/observability`:t;return!WO(r)||KO(e[r],n)?e:{...e,[r]:{...n}}}function JO(e,t){return e[t]??{}}function YO(e){if(e===null||e.length===0)return{};try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return{};let n={},r=t;for(let e of HO){let t=r[e];t&&typeof t==`object`&&!Array.isArray(t)&&(n[e]={...t})}let i=r[`/monitoring`];return n[`/observability`]===void 0&&i&&typeof i==`object`&&!Array.isArray(i)&&(n[`/observability`]={...i}),n}catch{return{}}}function XO(e=QO()){if(!e)return{};try{return YO(e.getItem(UO))}catch{return{}}}function ZO(e,t=QO()){if(t)try{t.setItem(UO,JSON.stringify(e))}catch{}}function QO(){try{return typeof sessionStorage>`u`?null:sessionStorage}catch{return null}}function $O(){let e=ka({select:e=>({pathname:e.location.pathname,search:e.location.search})}),[t,n]=(0,D.useState)(XO);return(0,D.useEffect)(()=>{if(!WO(e.pathname))return;let t=GO(e.search);n(n=>{let r=qO(n,e.pathname,t);return r===n?n:(ZO(r),r)})},[e.pathname,e.search]),t}var ek=`rounded-none! justify-center hover:bg-muted/50! hover:text-foreground data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`,tk=[{title:`Overview`,to:`/overview`,icon:ls,shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:rs,shortcut:`flows`},{title:`Store`,to:`/store`,icon:Wo,shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Ko,shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Uo,shortcut:`vault`},{title:`Access`,to:`/access`,icon:Go,shortcut:`access`}];function nk(){return(0,A.jsx)(`div`,{className:`flex w-full items-center justify-center px-0`,children:(0,A.jsx)(Cv,{className:`size-5`})})}function rk({onFast:e,onSettings:t,onLogout:n,...r}){let i=ka({select:e=>e.location.pathname}),o=$O();return(0,A.jsxs)(yO,{collapsible:`icon`,...r,children:[(0,A.jsx)(SO,{className:`h-10 justify-center border-b border-border/60 p-0`,children:(0,A.jsx)(nk,{})}),(0,A.jsx)(wO,{children:(0,A.jsxs)(TO,{className:`items-stretch p-0`,children:[(0,A.jsx)(EO,{children:`Console`}),(0,A.jsx)(DO,{className:`items-stretch gap-0`,children:tk.map(e=>(0,A.jsx)(OO,{className:`w-full`,children:(0,A.jsxs)(AO,{render:(0,A.jsx)(na,{to:e.to,search:JO(o,e.to)}),isActive:i===e.to,tooltip:{children:(0,A.jsx)(ue,{label:e.title,keys:IO(e.shortcut)})},className:ek,children:[(0,A.jsx)(a,{icon:e.icon}),(0,A.jsx)(`span`,{className:`sr-only`,children:e.title})]})},e.to))})]})}),(0,A.jsx)(CO,{className:`border-t border-border/60 p-0`,children:(0,A.jsx)(BO,{onFast:e,onSettings:t,onLogout:n})})]})}var ik=[{title:`Overview`,to:`/overview`,icon:ls,keywords:[`home`,`traces`],shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:rs,keywords:[`units`,`call`],shortcut:`flows`},{title:`Store`,to:`/store`,icon:Wo,keywords:[`sql`,`kv`,`files`],shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Ko,keywords:[`runs`,`metrics`,`monitoring`],shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Uo,keywords:[`secrets`,`contracts`],shortcut:`vault`},{title:`Access`,to:`/access`,icon:Go,keywords:[`keys`,`api`,`scopes`],shortcut:`access`}];function ak(e){let t=ik.map(t=>({id:`go:${t.to}`,label:t.title,group:`Navigate`,keys:IO(t.shortcut),keywords:t.keywords,icon:t.icon,onSelect:()=>e.go(t.to,JO(e.memory,t.to))})),n=[{id:`theme:light`,label:`Light`,group:`Appearance`,keywords:[`theme`,`day`],icon:os,onSelect:()=>e.setTheme(`light`)},{id:`theme:dark`,label:`Dark`,group:`Appearance`,keywords:[`theme`,`night`],icon:es,onSelect:()=>e.setTheme(`dark`)},{id:`theme:system`,label:`System`,group:`Appearance`,keywords:[`theme`,`auto`],icon:Xo,onSelect:()=>e.setTheme(`system`)}],r=[{id:`settings`,label:`Settings`,group:`Account`,keys:IO(`settings`),keywords:[`preferences`,`operator`],icon:ns,onSelect:e.openSettings},{id:`logout`,label:`Logout`,group:`Account`,keys:IO(`logout`),keywords:[`sign out`,`exit`],icon:$o,onSelect:e.logout}];return[...t,...n,...r]}var ok=e(t(),1);function sk(e,t){if(e.length===0)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r)if(e===n[i]&&(i+=1),i===n.length)return!0;return!1}function ck(e,t){return t.length===0?e:e.filter(e=>[e.label,e.group??``,...e.keywords??[]].some(e=>sk(t,e)))}var lk=`h-auto min-w-0 bg-transparent px-0 font-mono text-[10px] tracking-[0.08em] text-muted-foreground`,uk={type:`spring`,stiffness:560,damping:40,mass:.5};function dk({items:e,shortcut:t=`k`,placeholder:n=`Type a command or search…`,emptyMessage:r=`No results found.`,open:i,onOpenChange:o}){let[s,c]=(0,D.useState)(!1),l=i!==void 0,u=l?i:s,d=(0,D.useCallback)(e=>{l||c(e),o?.(e)},[l,o]),[p,m]=(0,D.useState)(``),[h,g]=(0,D.useState)(0),[_,v]=(0,D.useState)(!1);(0,D.useEffect)(()=>v(!0),[]);let y=(0,D.useId)(),b=X_(),x=(0,D.useCallback)(e=>{m(e),g(0)},[]),S=(0,D.useRef)(null),C=(0,D.useRef)(null);(0,D.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===t.toLowerCase()){e.preventDefault(),d(!u);return}e.key===`Escape`&&u&&(e.preventDefault(),d(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,t,d]),(0,D.useEffect)(()=>{u&&(x(``),g(0),requestAnimationFrame(()=>S.current?.focus()))},[u,x]),(0,D.useEffect)(()=>{if(!u)return;let e=document.documentElement,t=e.style.overflow,n=document.body.style.overflow;return e.style.overflow=`hidden`,document.body.style.overflow=`hidden`,()=>{e.style.overflow=t,document.body.style.overflow=n}},[u]);let w=(0,D.useMemo)(()=>ck(e,p),[e,p]),ee=(0,D.useMemo)(()=>e.some(e=>e.icon!==void 0),[e]),te=(0,D.useMemo)(()=>{let e=new Map;for(let t of w){let n=t.group??`Results`,r=e.get(n)??[];r.push(t),e.set(n,r)}return Array.from(e.entries())},[w]),ne=e=>{if(w.length!==0){if(e.key===`ArrowDown`)e.preventDefault(),g(e=>Math.min(w.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),g(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=w[h];t&&(t.onSelect(),d(!1))}}};if((0,D.useEffect)(()=>{u&&(C.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h,u]),!_)return null;let T=0,re=NO(t.toUpperCase());return(0,ok.createPortal)((0,A.jsxs)(`div`,{"aria-hidden":!u,inert:!u,"data-slot":`command-palette`,className:f(`fixed inset-0 z-100 flex items-start justify-center px-4 pt-[12vh]`,u?`pointer-events-auto`:`pointer-events-none`),children:[(0,A.jsx)(Z_.button,{type:`button`,"aria-label":`Close command palette`,initial:!1,animate:{opacity:+!!u},transition:{duration:u?.18:.12},onClick:()=>d(!1),className:f(`absolute inset-0 bg-black/20`,u?`pointer-events-auto`:`pointer-events-none`)}),(0,A.jsxs)(Z_.div,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,initial:!1,animate:{opacity:+!!u,y:u||b?0:-8,scale:u||b?1:.97},transition:b?{duration:.1}:u?uk:{duration:.12},onKeyDown:ne,className:f(`relative w-full max-w-xl overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-lg will-change-transform`,u?`pointer-events-auto`:`pointer-events-none`),children:[(0,A.jsxs)(`div`,{className:Ne,children:[(0,A.jsx)(`span`,{className:f(it,`pointer-events-none`),children:(0,A.jsx)(a,{icon:ts,className:st})}),(0,A.jsx)(`input`,{ref:S,value:p,onChange:e=>x(e.target.value),placeholder:n,tabIndex:u?0:-1,role:`combobox`,"aria-expanded":u,"aria-controls":`${y}-list`,"aria-activedescendant":w.length>0?`${y}-opt-${h}`:void 0,"aria-autocomplete":`list`,className:xt}),(0,A.jsxs)(`span`,{className:`flex h-full shrink-0 items-center gap-2 pr-2`,children:[(0,A.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:re.map(e=>(0,A.jsx)(he,{className:lk,children:e},e))}),(0,A.jsx)(he,{className:lk,children:`Esc`})]})]}),(0,A.jsx)(`div`,{ref:C,id:`${y}-list`,role:`listbox`,"aria-label":`Commands`,className:`max-h-[60vh] overflow-y-auto overscroll-contain`,children:w.length===0?(0,A.jsx)(`p`,{className:mt,children:r}):te.map(([e,t])=>(0,A.jsxs)(`div`,{className:`border-b border-border/60 last:border-b-0`,children:[(0,A.jsx)(`div`,{"aria-hidden":!0,className:f(Me,`px-2 py-1.5`),children:e}),t.map(e=>{let t=T;T+=1;let n=t===h,r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,id:`${y}-opt-${t}`,role:`option`,"aria-selected":n,"data-index":t,onMouseEnter:()=>g(t),onClick:()=>{e.onSelect(),d(!1)},tabIndex:u?0:-1,className:f(et,`border-b-0`,n&&`bg-muted/70 text-foreground`),children:[n?(0,A.jsx)(`span`,{className:f(lt,ut)}):null,r?(0,A.jsx)(a,{icon:r,className:`relative z-10 size-3.5 shrink-0 text-muted-foreground`}):ee?(0,A.jsx)(`span`,{className:`size-3.5 shrink-0`}):null,(0,A.jsx)(`span`,{className:`relative z-10 min-w-0 flex-1 truncate`,children:e.label}),e.badge?(0,A.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.badge}):null,e.keys&&e.keys.length>0?(0,A.jsx)(ye,{keys:e.keys,className:`relative z-10`}):e.hint?(0,A.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.hint}):null]},e.id)})]},e))})]})]}),document.body)}function fk({...e}){return(0,A.jsx)(te,{"data-slot":`dialog`,...e})}function pk({...e}){return(0,A.jsx)(re,{"data-slot":`dialog-portal`,...e})}function mk({className:e,...t}){return(0,A.jsx)(b,{"data-slot":`dialog-overlay`,className:f(`fixed inset-0 z-50 bg-black/20 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function hk({className:e,children:t,...n}){return(0,A.jsxs)(pk,{children:[(0,A.jsx)(mk,{}),(0,A.jsx)(_,{"data-slot":`dialog-content`,className:f(`fixed top-1/2 left-1/2 z-50 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-none border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none transition duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0`,e),...n,children:t})]})}function gk({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`dialog-header`,className:f(`flex flex-col gap-1 border-b border-border/60 px-4 py-3`,e),...t})}function _k({className:e,...t}){return(0,A.jsx)(C,{"data-slot":`dialog-title`,className:f(`text-sm font-medium text-foreground`,e),...t})}function vk({className:e,...t}){return(0,A.jsx)(Ee,{"data-slot":`dialog-description`,className:f(`text-[11px] text-muted-foreground`,e),...t})}function yk({open:e,onOpenChange:t,operator:n}){return(0,A.jsx)(fk,{open:e,onOpenChange:t,children:(0,A.jsxs)(hk,{"data-slot":`settings-dialog`,children:[(0,A.jsxs)(gk,{children:[(0,A.jsx)(_k,{children:`Settings`}),(0,A.jsx)(vk,{children:`Operator account and appearance.`})]}),(0,A.jsxs)(`dl`,{className:`flex flex-col`,children:[(0,A.jsx)(bk,{label:`Name`,value:n.name}),(0,A.jsx)(bk,{label:`Email`,value:n.email}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-2`,children:[(0,A.jsx)(`dt`,{className:Me,children:`Theme`}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(xv,{})})]})]})]})})}function bk({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-border/60 px-4 py-2`,children:[(0,A.jsx)(`dt`,{className:Me,children:e}),(0,A.jsx)(`dd`,{className:`min-w-0 truncate text-xs text-foreground`,children:t})]})}async function xk(){try{await pt()}finally{rt(null)}}function Sk(e){let t=(0,D.useRef)(e);t.current=e,(0,D.useEffect)(()=>{let e=e=>{let{enabled:n,go:r,openSettings:i,logout:a}=t.current;if(!n||e.repeat||RO(e.target)||!(e.metaKey||e.ctrlKey)||e.altKey)return;if(e.key===`,`){e.preventDefault(),i();return}if(e.key.toLowerCase()===`e`){e.preventDefault(),a();return}let o=LO[e.key];o&&(e.preventDefault(),r(o))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function Ck({operator:e}){let t=ka({select:e=>e.location.pathname}),n=de(),r=$O(),{setTheme:i}=yv(),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(!1),l=t===`/overview`||t===`/flows`||t===`/store`||t===`/vault`||t===`/access`||t===`/observability`,u=(0,D.useCallback)(()=>{xk().then(()=>{n({to:`/`})})},[n]),d=(0,D.useCallback)((e,t)=>{n({to:e,search:t})},[n]),p=(0,D.useMemo)(()=>ak({memory:r,go:d,openSettings:()=>o(!0),logout:u,setTheme:i}),[d,u,r,i]);return Sk({enabled:!s&&!a,go:e=>d(e,JO(r,e)),openSettings:()=>o(!0),logout:u}),(0,A.jsxs)(vO,{open:!1,className:l?`h-svh max-h-svh overflow-hidden`:void 0,children:[(0,A.jsx)(rk,{onFast:()=>c(!0),onSettings:()=>o(!0),onLogout:u}),(0,A.jsx)(xO,{className:l?`min-h-0 max-h-svh overflow-hidden`:void 0,children:(0,A.jsxs)(`div`,{className:f(`flex flex-col`,l?`h-svh max-h-svh min-h-0 overflow-hidden`:`flex-1 gap-4 p-4`),children:[(0,A.jsx)(bO,{className:`-ml-1 md:hidden`}),(0,A.jsx)(ya,{})]})}),(0,A.jsx)(yk,{open:a,onOpenChange:o,operator:e}),(0,A.jsx)(dk,{open:s,onOpenChange:c,items:p})]})}var wk=`modulepreload`,Tk=function(e){return`/`+e},Ek={},Dk=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=Tk(e,n),e=i(e),e in Ek)return;Ek[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:wk,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Ok({location:e}){let t=Bo(`${e.pathname}${e.searchStr}`);if(!Oe())throw mn({to:`/`,search:t});let n=await gt();if(n.error||!n.data)throw rt(null),mn({to:`/`,search:t});let r={operatorId:n.data.operatorId,email:n.data.email,name:n.data.name};return yt(r),{operator:r}}var kk=sa({component:function(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(oO,{}),(0,A.jsx)(ya,{})]})}}),Ak=aa({getParentRoute:()=>kk,path:`/`,validateSearch:zo,component:nO}),jk=aa({getParentRoute:()=>kk,id:`authenticated`,beforeLoad:Ok,component:function(){let{operator:e}=jk.useRouteContext();return(0,A.jsx)(Ck,{operator:e})}}),Mk=aa({getParentRoute:()=>jk,path:`/overview`,validateSearch:ho,component:ca(()=>Dk(()=>import(`./flows-page-Bb9t1lu6.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),`FlowsPage`)}),Nk=aa({getParentRoute:()=>jk,path:`/flows`,validateSearch:yo,component:ca(()=>Dk(()=>import(`./units-page-07agasRA.js`),__vite__mapDeps([20,1,2,3,4,5,6,21,7,10,11,8,13,14,15,17,22,23,24,25,18])),`UnitsPage`)}),Pk=aa({getParentRoute:()=>jk,path:`/flows/decisions`,validateSearch:e=>{let t=typeof e.decision==`string`&&e.decision.length>0?e.decision:void 0;return{...t===void 0?{}:{decision:t}}},component:ca(()=>Dk(()=>import(`./decisions-page-DgB76m-X.js`),__vite__mapDeps([26,1,2,3,4,6])),`DecisionsPage`)}),Fk=aa({getParentRoute:()=>jk,path:`/store`,validateSearch:_o,component:ca(()=>Dk(()=>import(`./store-page-YmE806bJ.js`),__vite__mapDeps([27,1,2,3,4,5,6,21,7,8,12,13,28,29,11,17,22,23,30,16,24,25,31,19])),`StorePage`)}),Ik=aa({getParentRoute:()=>jk,path:`/vault`,validateSearch:ko,component:ca(()=>Dk(()=>import(`./vault-page-CHBck4n_.js`),__vite__mapDeps([32,1,2,3,4,5,6,7,8,29,30,16,15,23,24,25,31,33])),`VaultPage`)}),Lk=aa({getParentRoute:()=>jk,path:`/access`,validateSearch:jo,component:ca(()=>Dk(()=>import(`./access-page-zBMhZnFm.js`),__vite__mapDeps([34,1,2,3,4,5,6,10,7,11,16,24,25,31])),`AccessPage`)}),Rk=aa({getParentRoute:()=>jk,path:`/observability`,validateSearch:Do,component:ca(()=>Dk(()=>import(`./observability-page-BRfUILBq.js`),__vite__mapDeps([35,1,2,3,4,5,6,21,7,8,9,10,11,12,13,14,15,16,28,29,24,33])),`ObservabilityPage`)}),zk=aa({getParentRoute:()=>jk,path:`/monitoring`,validateSearch:Do,beforeLoad:({search:e})=>{throw mn({to:`/observability`,search:e})}}),Bk=Ta({routeTree:kk.addChildren([Ak,jk.addChildren([Mk,Nk,Pk,Fk,Ik,Lk,Rk,zk])]),defaultNotFoundComponent:Tv,defaultPendingComponent:()=>(0,A.jsx)(`div`,{className:`grid min-h-dvh place-items-center text-sm text-muted-foreground`,children:`Loading…`})});dt(e=>{let t=e.split(`?`)[0]??``;t!==`/`&&t!==``&&Bk.navigate({to:`/`,search:Bo(e)})}),ft();var Vk=new kt({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}}),Hk=document.getElementById(`root`);if(!Hk)throw Error(`Missing #root`);(0,mo.createRoot)(Hk).render((0,A.jsx)(D.StrictMode,{children:(0,A.jsx)(vv,{defaultTheme:`system`,storageKey:`oke-console-theme`,children:(0,A.jsx)(d,{delay:0,children:(0,A.jsx)(m,{client:Vk,children:(0,A.jsx)(po,{children:(0,A.jsx)(Oa,{router:Bk})})})})})}));export{Ds as $,Yu as A,go as At,Ul as B,qd as C,xo as Ct,Od as D,Eo as Dt,kd as E,To as Et,fu as F,R as G,Vl as H,ru as I,N as J,F as K,$l as L,Mu as M,At as Mt,ku as N,Ad as O,bo as Ot,pu as P,Ms as Q,Yl as R,B as S,Oo as St,jd as T,Co as Tt,Rl as U,Hl as V,Ol as W,Us as X,ec as Y,Ps as Z,xf as _,Xo as _t,Sv as a,_s as at,_f as b,Mo as bt,Z_ as c,ms as ct,ng as d,fs as dt,ws as et,fh as f,cs as ft,Sf as g,Qo as gt,Af as h,ts as ht,sO as i,vs as it,ju as j,na as jt,ad as k,vo as kt,X_ as l,ps as lt,Zf as m,ns as mt,NO as n,xs as nt,yv as o,gs as ot,zp as p,ss as pt,lc as q,PO as r,ys as rt,nv as s,us as st,Dk as t,Cs as tt,rg as u,ds as ut,bf as v,Jo as vt,Bd as w,wo as wt,ef as x,Ao as xt,yf as y,qo as yt,Kl as z};