ocean-brain 0.12.2 → 0.13.0

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 (71) hide show
  1. package/package.json +1 -1
  2. package/server/client/dist/assets/{ArrowRight.es-CD1IMhU2.js → ArrowRight.es-BlNsZQFs.js} +1 -1
  3. package/server/client/dist/assets/AuxiliaryPanelHeader-HAttwVby.js +1 -0
  4. package/server/client/dist/assets/Calendar-CaeK7gTz.js +25 -0
  5. package/server/client/dist/assets/Callout-CcYyvHQP.js +1 -0
  6. package/server/client/dist/assets/CaretUp.es-C8iY5OlB.js +1 -0
  7. package/server/client/dist/assets/{CheckCircle.es-C7fkzE3t.js → CheckCircle.es-Dqr3WImn.js} +1 -1
  8. package/server/client/dist/assets/{Copy.es-D6rl6b78.js → Copy.es-fMv0ETir.js} +1 -1
  9. package/server/client/dist/assets/{File.es-CcjtzE38.js → File.es-CHtXXafR.js} +1 -1
  10. package/server/client/dist/assets/FileText.es-DPIwDCEe.js +1 -0
  11. package/server/client/dist/assets/{FlowArrow.es-CAIThqWk.js → FlowArrow.es-Dxee98ir.js} +1 -1
  12. package/server/client/dist/assets/Graph-CdEu8eAn.js +46 -0
  13. package/server/client/dist/assets/Graph-hVj6vAYJ.js +1 -0
  14. package/server/client/dist/assets/{Image.es-BDpo5R66.js → Image.es-CjXY1JVf.js} +1 -1
  15. package/server/client/dist/assets/Info.es-CYxg-Vku.js +1 -0
  16. package/server/client/dist/assets/LinkSimple.es-B-P-7Iem.js +1 -0
  17. package/server/client/dist/assets/{Note-Dq2Szaxd.js → Note-CGI-Y1__.js} +4 -4
  18. package/server/client/dist/assets/{NotePropertiesPanel-Cu3RgDic.js → NotePropertiesPanel-6P7UfRBR.js} +2 -2
  19. package/server/client/dist/assets/{Plus.es-P9Fjwtud.js → Plus.es-Dy6onD-Z.js} +1 -1
  20. package/server/client/dist/assets/Reminders-DnuALBL6.js +1 -0
  21. package/server/client/dist/assets/{Search-DVROxY_B.js → Search-DAYHxAml.js} +2 -2
  22. package/server/client/dist/assets/{SurfaceCard-D_OU_Oy6.js → SurfaceCard-D5QxOte_.js} +1 -1
  23. package/server/client/dist/assets/Tag-CG8b0l1j.js +1 -0
  24. package/server/client/dist/assets/TagNotes-COyaVsdn.js +1 -0
  25. package/server/client/dist/assets/{Trash.es-BeR1sZMe.js → Trash.es-XEcWG_aq.js} +1 -1
  26. package/server/client/dist/assets/{ViewChip-D-Ax5PdL.js → ViewChip-BVkZAXyx.js} +1 -1
  27. package/server/client/dist/assets/Views-BPxlw3vk.js +1 -0
  28. package/server/client/dist/assets/app-BezcjTfd.js +151 -0
  29. package/server/client/dist/assets/app-DjDwGe0t.css +1 -0
  30. package/server/client/dist/assets/calendar-data-wB0ifXdo.js +1 -0
  31. package/server/client/dist/assets/{image.api-CtfyPwkV.js → image.api-ChvlfuZg.js} +1 -1
  32. package/server/client/dist/assets/index-CzZFedXj.js +1 -0
  33. package/server/client/dist/assets/{manage-image-m-7v_Z1W.js → manage-image-CSJ3Flgc.js} +1 -1
  34. package/server/client/dist/assets/manage-image-detail-9hRTiAsR.js +1 -0
  35. package/server/client/dist/assets/{mcp-admin-adapter-Cw6w5mfg.js → mcp-admin-adapter-D0R8p9az.js} +1 -1
  36. package/server/client/dist/assets/{mcp-B-aGeAQD.js → mcp-ugdCKa6H.js} +1 -1
  37. package/server/client/dist/assets/{note-ui-CYsZc3DI.js → note-ui-BaqzP-YU.js} +1 -1
  38. package/server/client/dist/assets/placeholder-CZoqs4S3.js +34 -0
  39. package/server/client/dist/assets/{properties-B93_V2uD.js → properties-B7Fv95qY.js} +1 -1
  40. package/server/client/dist/assets/route-preload.js +2 -2
  41. package/server/client/dist/assets/{search-admin-adapter-Dj0KKKrJ.js → search-admin-adapter-Daf7e2YQ.js} +1 -1
  42. package/server/client/dist/assets/search-ddYl3qH-.js +1 -0
  43. package/server/client/dist/assets/{tag.api-BJ6eaHui.js → tag.api-DEUROVKQ.js} +1 -1
  44. package/server/client/dist/assets/time-PxWila4-.js +361 -0
  45. package/server/client/dist/assets/trash-BHida7BG.js +1 -0
  46. package/server/client/dist/assets/{url-BvjSC8PU.js → url-DKUMNVCI.js} +1 -1
  47. package/server/client/dist/assets/useNoteMutate-BjvZUmtX.js +9 -0
  48. package/server/client/dist/assets/{useReminderMutate-kTBRSjYc.js → useReminderMutate-C5n-5LM-.js} +2 -2
  49. package/server/client/dist/index.html +6 -6
  50. package/server/dist/features/note/services/properties.js +32 -8
  51. package/server/dist/features/view/graphql/view.query.resolver.js +20 -0
  52. package/server/dist/features/view/graphql/view.type-defs.js +17 -0
  53. package/server/dist/features/view/services/workspace.js +116 -1
  54. package/server/client/dist/assets/AuxiliaryPanelHeader-zoJGsYWR.js +0 -1
  55. package/server/client/dist/assets/Calendar-6otw_EJn.js +0 -25
  56. package/server/client/dist/assets/Callout-C1QiCWCa.js +0 -1
  57. package/server/client/dist/assets/Graph-BHsmPDPh.js +0 -46
  58. package/server/client/dist/assets/Reminders-DKm0GFI2.js +0 -1
  59. package/server/client/dist/assets/Tag-wMHTRwlF.js +0 -1
  60. package/server/client/dist/assets/TagNotes-BRza6i14.js +0 -1
  61. package/server/client/dist/assets/Views-CL7rC05G.js +0 -1
  62. package/server/client/dist/assets/app-CyQtGTtn.js +0 -139
  63. package/server/client/dist/assets/app-DGFNtdpS.css +0 -1
  64. package/server/client/dist/assets/index-BEfKfbvr.js +0 -1
  65. package/server/client/dist/assets/manage-image-detail-BNYOCSmu.js +0 -1
  66. package/server/client/dist/assets/placeholder-C5fNzKrL.js +0 -34
  67. package/server/client/dist/assets/search-BmXuuK26.js +0 -1
  68. package/server/client/dist/assets/sortable.esm-DgSW3bAA.js +0 -5
  69. package/server/client/dist/assets/time-DI902Sxa.js +0 -361
  70. package/server/client/dist/assets/trash-GulvRh9f.js +0 -1
  71. package/server/client/dist/assets/useNoteMutate-xEIypxi5.js +0 -9
@@ -0,0 +1,151 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-CaeK7gTz.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/time-PxWila4-.js","assets/url-DKUMNVCI.js","assets/useNoteMutate-BjvZUmtX.js","assets/calendar-data-wB0ifXdo.js","assets/FileText.es-DPIwDCEe.js","assets/Callout-CcYyvHQP.js","assets/Info.es-CYxg-Vku.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-hVj6vAYJ.js","assets/Views-BPxlw3vk.js","assets/tag.api-DEUROVKQ.js","assets/SurfaceCard-D5QxOte_.js","assets/ViewChip-BVkZAXyx.js","assets/ArrowRight.es-BlNsZQFs.js","assets/CheckCircle.es-Dqr3WImn.js","assets/Plus.es-Dy6onD-Z.js","assets/Reminders-DnuALBL6.js","assets/useReminderMutate-C5n-5LM-.js","assets/Graph-CdEu8eAn.js","assets/transform-BUB79_za.js","assets/isObject-U9U2HXiq.js","assets/toNumber-DE3J3kMD.js","assets/ordinal-Cboi1Yqb.js","assets/init-Gi6I4Gst.js","assets/colors-Cc3OSVma.js","assets/min-tv6RD-6E.js","assets/FlowArrow.es-Dxee98ir.js","assets/CaretUp.es-C8iY5OlB.js","assets/LinkSimple.es-B-P-7Iem.js","assets/Search-DAYHxAml.js","assets/AuxiliaryPanelHeader-HAttwVby.js","assets/search-admin-adapter-Daf7e2YQ.js","assets/File.es-CHtXXafR.js","assets/Tag-CG8b0l1j.js","assets/Note-CGI-Y1__.js","assets/NotePropertiesPanel-6P7UfRBR.js","assets/note-ui-BaqzP-YU.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/note-ui-DL8owV-U.css","assets/image.api-ChvlfuZg.js","assets/Copy.es-fMv0ETir.js","assets/TagNotes-COyaVsdn.js","assets/index-CzZFedXj.js","assets/mcp-admin-adapter-D0R8p9az.js","assets/Image.es-CjXY1JVf.js","assets/Trash.es-XEcWG_aq.js","assets/mcp-ugdCKa6H.js","assets/search-ddYl3qH-.js","assets/trash-BHida7BG.js","assets/manage-image-CSJ3Flgc.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-9hRTiAsR.js","assets/properties-B7Fv95qY.js","assets/placeholder-CZoqs4S3.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,r as d,b as G,a as ut}from"./floating-ui.react-dom-BWTnA00G.js";import{q as As,t as Is,v as Ts,w as Ds,x as Ns,l as js,u as Vs,a as Os,b as ks,e as ar,o as Fs,s as Hs,j as Bs,n as $s,d as bo,m as Zs,h as zs,R as Us}from"./useNoteMutate-BjvZUmtX.js";import{aw as ze,ax as bt,ay as te,az as X,aA as yt,aB as We,aC as ir,aD as Ks,aE as Gs,aF as Ws,aG as qs,aH as Xs,aI as Ys,aJ as Qs,aK as Ue,aL as yo,aM as Js,aN as vn,aO as ea,aP as xo,aQ as ae,aR as wo,aS as ct,aT as ta,aU as na,aV as Ct,aW as oa,aX as V,aY as So,aZ as ra,a_ as sa,a$ as aa,b0 as ia,al as Ee,ah as Hn,b1 as ca,b2 as Ro,b3 as pe,b4 as bn,b5 as Ot,b6 as Bn,b7 as la,b8 as da,A as _t,f as qe,u as $n,b9 as ua,ba as ha,bb as fa,bc as pa,T as ne,x as yn,bd as cr,y as lt,be as lr,bf as ma,L as ga,K as va,g as B,c as ie,F as ba,q as xt,e as ya,i as dr,Q as ur,av as xa,l as ht,D as Gt,bg as wa,J as Sa,ar as Ra,O as Ea,N as Ca,h as _a,P as Pa,k as Ma,E as La,bh as Aa,bi as Ia,bj as Ta,bk as $,bl as Da,a1 as Pn,bm as Eo,bn as Na}from"./time-PxWila4-.js";import{_ as z}from"./preload-helper-BXl3LOEh.js";import{f as Pt,N as Zn,H as rn,V as zn,G as hr,C as fr,R as pr,e as mr,i as gr,T as vr,j as ja,g as Va,h as Oa,S as ka,c as Fa,b as Ha,d as Ba,a as $a}from"./url-DKUMNVCI.js";import{f as br,G as Za}from"./Graph-hVj6vAYJ.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const Un={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},yr=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Kn=(e,t,n=!0)=>{const o=yr(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},za=(e,t=!0)=>Kn(Un.DARK,e,t),Ua=(e,t,n=!0)=>Kn(Un.RESPONSIVE(e),t,n),Ka={MEDIA_QUERY:Un,listenThemeChange:za,listenResponsiveChange:Ua,createMediaQuery:yr,listenMediaQueryChange:Kn};var N=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(N||{});function xr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,u,h){const f=u.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:u.deps;if(m!==void 0&&m.dep===c){m.version=h,u.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===u)return;const v=u.depsTail=c.subsTail={version:h,dep:c,sub:u,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:u.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,u=c.sub){const h=c.dep,f=c.prevDep,m=c.nextDep,g=c.nextSub,v=c.prevSub;return m!==void 0?m.prevDep=f:u.depsTail=f,f!==void 0?f.nextDep=m:u.deps=m,g!==void 0?g.prevSub=v:h.subsTail=v,v!==void 0?v.nextSub=g:(h.subs=g)===void 0&&n(h),m}function s(c){let u=c.nextSub,h;e:do{const f=c.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&l(c,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&t(f),m&1){const g=f.subs;if(g!==void 0){const v=(c=g).nextSub;v!==void 0&&(h={value:u,prev:h},u=v);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function a(c,u){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(u.flags&16)m=!0;else if((v&17)===17){if(e(g)){const b=g.subs;b.nextSub!==void 0&&i(b),m=!0}}else if((v&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(h={value:c,prev:h}),c=g.deps,u=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=u.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(u)){y&&i(b),u=c.sub;continue}m=!1}else u.flags&=-33;u=c.sub;const w=c.nextDep;if(w!==void 0){c=w;continue e}}return m}while(!0)}function i(c){do{const u=c.sub,h=u.flags;(h&48)===32&&(u.flags=h|16,(h&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let h=u.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let Gn=0,je=0,ft=0;const we=[],{link:ih,unlink:wr,propagate:ch,checkDirty:Ga,shallowPropagate:lh}=xr({update(e){return e.depsTail!==void 0?Ya(e):Qa(e)},notify(e){let t=ft,n=t;do if(we[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ft=t;n<--t;){const o=we[n];we[n++]=we[t],we[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,sn(e)):ti.call(e)}});function Wa(){return Gn}function qa(){++Gn}function Xa(){--Gn||ei()}function Ya(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,sn(e)}}function Qa(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Ja(e){const t=e.flags;if(t&16||t&32&&Ga(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,sn(e)}}else e.flags=2}function ei(){try{for(;je<ft;){const e=we[je];we[je++]=void 0,Ja(e)}}finally{for(;je<ft;){const e=we[je];we[je++]=void 0,e.flags|=10}je=0,ft=0}}function ti(){this.depsTail=void 0,this.flags=0,sn(this);const e=this.subs;e!==void 0&&wr(e)}function sn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=wr(n,e)}function Wn(e,t,n){const o=typeof e=="object",r=o?e:void 0;return{next:(o?e.next:e)?.bind(r),error:(o?e.error:t)?.bind(r),complete:(o?e.complete:n)?.bind(r)}}const Mn=[];let zt=0;const{link:Co,unlink:ni,propagate:oi,checkDirty:Sr,shallowPropagate:_o}=xr({update(e){return e._update()},notify(e){Mn[Ln++]=e,e.flags&=~N.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=N.Mutable|N.Dirty,Wt(e))}});let kt=0,Ln=0,fe;function Wt(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=ni(n,e)}function Rr(){if(!(Wa()>0)){for(;kt<Ln;){const e=Mn[kt];Mn[kt++]=void 0,e.notify()}kt=0,Ln=0}}function Er(e,t){const n=typeof e=="function",o=e,r={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?N.None:N.Mutable,get(){return fe!==void 0&&Co(r,fe,zt),r._snapshot},subscribe(s){const a=Wn(s),i={current:!1},l=ri(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=fe,i=Object.is;if(n)fe=r,++zt,r.depsTail=void 0;else if(s===void 0)return!1;n&&(r.flags=N.Mutable|N.RecursedCheck);try{const l=r._snapshot,c=typeof s=="function"?s(l):s===void 0&&n?o(l):s;return l===void 0||!i(l,c)?(r._snapshot=c,!0):!1}finally{fe=a,n&&(r.flags&=~N.RecursedCheck),Wt(r)}}};return n?(r.flags=N.Mutable|N.Dirty,r.get=function(){const s=r.flags;if(s&N.Dirty||s&N.Pending&&Sr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&_o(a)}}else s&N.Pending&&(r.flags=s&~N.Pending);return fe!==void 0&&Co(r,fe,zt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(oi(a),_o(a),Rr())}},r}function ri(e){const t=()=>{const o=fe;fe=n,++zt,n.depsTail=void 0,n.flags=N.Watching|N.RecursedCheck;try{return e()}finally{fe=o,n.flags&=~N.RecursedCheck,Wt(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:N.Watching|N.RecursedCheck,notify(){const o=this.flags;o&N.Dirty||o&N.Pending&&Sr(this.deps,this)?t():this.flags=N.Watching},stop(){this.flags=N.None,this.depsTail=void 0,Wt(this)}};return t(),n}class si{constructor(t){this.atom=Er(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Wn(t))}}class ai{constructor(t){this.atom=Er(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Wn(t))}}function ii(e){return typeof e=="function"?new ai(e):new si(e)}function ci(e){try{qa(),e()}finally{Xa(),Rr()}}const De="__TSR_index",Po="popstate",Mo="beforeunload";function li(e){let t=e.getLocation();const n=new Set,o=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},r=a=>{e.notifyOnIndexChange??!0?o(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const u=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const m=qt(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const c=t.state[De];i=Lo(c+1,i),s({task:()=>{e.pushState(a,i),o({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const c=t.state[De];i=Lo(c,i),s({task:()=>{e.replaceState(a,i),o({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),r({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[De]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(c=>c!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function Lo(e,t){t||(t={});const n=qn();return{...t,key:n,__TSR_key:n,[De]:e}}function di(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=x=>r=x,i=(x=>x),l=(()=>qt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=qn();t.history.replaceState({[De]:0,key:x,__TSR_key:x},"")}let c=l(),u,h=!1,f=!1,m=!1,g=!1;const v=()=>c;let b,y;const w=()=>{b&&(E._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),E._ignoreSubscribers=!1,b=void 0,y=void 0,u=void 0)},R=(x,C,I)=>{const P=i(C);y||(u=c),c=qt(C,I),b={href:P,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{c=l(),E.notify({type:x})},_=async()=>{if(f){f=!1;return}const x=l(),C=x.state[De]-c.state[De],I=C===1,P=C===-1,L=!I&&!P||h;h=!1;const K=L?"GO":P?"BACK":"FORWARD",D=L?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const le=s();if(typeof document<"u"&&le.length){for(const W of le)if(await W.blockerFn({currentLocation:c,nextLocation:x,action:K})){f=!0,t.history.go(1),E.notify(D);return}}}c=l(),E.notify(D)},M=x=>{if(g){g=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const P of I){const L=P.enableBeforeUnload??!0;if(L===!0){C=!0;break}if(typeof L=="function"&&L()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=li({getLocation:v,getLength:()=>t.history.length,pushState:(x,C)=>R("push",x,C),replaceState:(x,C)=>R("replace",x,C),back:x=>(x&&(m=!0),g=!0,t.history.back()),forward:x=>{x&&(m=!0),g=!0,t.history.forward()},go:x=>{h=!0,t.history.go(x)},createHref:x=>i(x),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(Mo,M,{capture:!0}),t.removeEventListener(Po,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(Mo,M,{capture:!0}),t.addEventListener(Po,_),t.history.pushState=function(...x){const C=n.apply(t.history,x);return E._ignoreSubscribers||S("PUSH"),C},t.history.replaceState=function(...x){const C=o.apply(t.history,x);return E._ignoreSubscribers||S("REPLACE"),C},E}function ui(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function qt(e,t){const n=ui(e),o=n.indexOf("#"),r=n.indexOf("?"),s=qn();return{href:n,pathname:n.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:n.length),hash:o>-1?n.substring(o):"",search:r>-1?n.slice(r,o===-1?void 0:o):"",state:t||{[De]:0,key:s,__TSR_key:s}}}function qn(){return(Math.random()+1).toString(36).substring(7)}const hi=!1;function pt(e){let t;return ci(()=>{t=e()}),t}function fi(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const An="tsr-scroll-restoration-v1_3",pi=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function mi(){const e=fi();if(!e)return null;const t=e.getItem(An);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=ze(o,n)||n;try{e.setItem(An,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ft=mi(),gi=e=>e.state.__TSR_key||e.href;function vi(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Xt=!1;function bi({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:r,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(c){console.error(c);return}const i=t||window.history.state?.__TSR_key,l=a[i];Xt=!0;e:{if(o&&l&&Object.keys(l).length>0){for(const h in l){const f=l[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=f.scrollX,m.scrollTop=f.scrollY)}}break e}const c=(s??window.location).hash.split("#",2)[1];if(c){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(c);f&&f.scrollIntoView(h)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Xt=!1}function yi(e,t){if(!Ft||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ft))return;e.isScrollRestorationSetup=!0,Xt=!1;const o=e.options.getScrollRestorationKey||gi;window.history.scrollRestoration="manual";const r=s=>{if(Xt||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const l=s.target.getAttribute("data-scroll-restoration-id");l?a=`[data-scroll-restoration-id="${l}"]`:a=vi(s.target)}const i=o(e.state.location);Ft.set(l=>{const c=l[i]||={},u=c[a]||={};if(a==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",pi(r,100),!0),e.subscribe("onRendered",s=>{const a=o(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(bi({storageKey:An,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ft.set(i=>(i[a]||={},i)))})}function xi(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function wi(e,t=String){const n=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&n.set(o,t(r))}return n.toString()}function xn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Si(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=xn(r):Array.isArray(s)?s.push(xn(r)):n[o]=[s,xn(r)]}return n}const Ri=Ci(JSON.parse),Ei=_i(JSON.stringify,JSON.parse);function Ci(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Si(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function _i(e,t){const n=typeof t=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(n&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const s=wi(r,o);return s?`?${s}`:""}}const In=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},an=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Ke=(e,t,n=!0)=>{const o={...e.router.options.context??{}},r=n?t:t-1;for(let s=0;s<=r;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(o,i.__routeContext,i.__beforeLoadContext)}return o},Ao=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),r=o>=0?o:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=r);for(let a=s;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return n?s:r},Te=(e,t,n)=>{if(!(!te(n)&&!X(n)))throw te(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:te(n)?"redirected":o.status==="pending"?"success":o.status,context:Ke(e,t.index),isFetching:!1,error:n})),X(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),te(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Cr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,dt=(e,t,n,o)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??=t,Te(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Te(e,e.router.getMatch(r),n)}e.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!te(n)&&!X(n)&&(e.serialError??=n)},_r=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!an(e,t)&&(n.options.loader||n.options.beforeLoad||Mr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{In(e)},r);o._nonReactive.pendingTimeout=a}},Pi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;_r(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Te(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},Mi=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=We(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&dt(e,n,a,"PARSE_PARAMS"),i&&dt(e,n,i,"VALIDATE_SEARCH"),_r(e,t,o,r);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:l})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!o.options.beforeLoad){pt(()=>{u(),h()});return}r._nonReactive.beforeLoadPromise=We();const f={...Ke(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=an(e,t),y={search:m,abortController:l,params:g,preload:b,context:f,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){pt(()=>{u(),h()});return}(te(S)||X(S))&&(u(),dt(e,n,S,"BEFORE_LOAD")),pt(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),bt(R))return u(),R.catch(S=>{dt(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){u(),dt(e,n,S,"BEFORE_LOAD")}w(R)},Li=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>Mi(e,n,t,r),i=()=>{if(Cr(e,n))return;const l=Pi(e,n,r);return bt(l)?l.then(a):a()};return s()},Ai=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(r),n.options.scripts?.(r),n.options.headers?.(r)]).then(([s,a,i])=>{const l=s?.meta,c=s?.links,u=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:u,headers:i,scripts:a,styles:h}})},Pr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),u=Ke(e,o),h=an(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:u,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Io=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(hi??e.router.isServer)||s.ssr===!0)&&Yt(r);const a=r.options.loader?.(Pr(e,t,n,o,r)),i=r.options.loader&&bt(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,u=>({...u,isFetching:"loader"})),r.options.loader){const u=i?await a:a;Te(e,e.router.getMatch(n),u),u!==void 0&&e.updateMatch(n,h=>({...h,loaderData:u}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,u=>({...u,error:void 0,context:Ke(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let i=a;if(i?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:Ke(e,o)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,X(a)&&await r.options.notFoundComponent?.preload?.(),Te(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Te(e,e.router.getMatch(n),c)}e.updateMatch(n,c=>({...c,error:i,context:Ke(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Te(e,a,s)}},Ii=async(e,t,n)=>{async function o(h,f,m,g){const v=Date.now()-f.updatedAt,b=h?g.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??e.router.options.defaultStaleTime??0,y=g.options.shouldReload,w=typeof y=="function"?y(Pr(e,t,r,n,g)):y,{status:R,invalid:S}=m;a=R==="success"&&(S||(w??v>b)),h&&g.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Io(e,t,r,n,g);const _=e.router.getMatch(r);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){te(_)&&await e.router.navigate(_.options)}})()):(R!=="success"||a&&e.sync)&&await Io(e,t,r,n,g))}const{id:r,routeId:s}=e.matches[n];let a=!1,i=!1;const l=e.router.looseRoutesById[s];if(!Cr(e,r)){const h=e.router.getMatch(r),f=an(e,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(r),g=m._nonReactive.error||m.error;g&&Te(e,m,g),m.status==="pending"&&await o(f,h,m,l)}else{const m=f&&!e.router.state.matches.some(v=>v.id===r),g=e.router.getMatch(r);g._nonReactive.loaderPromise=We(),m!==g.preload&&e.updateMatch(r,v=>({...v,preload:m})),await o(f,h,g,l)}}const c=e.router.getMatch(r);i||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const u=i?c.isFetching:!1;return u!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:u,invalid:!1})),e.router.getMatch(r)):c};async function To(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&In(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=Li(t,f);bt(m)&&await m}catch(m){if(te(m))throw m;if(X(m))o=m;else if(!t.preload)throw m;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,s=o&&!t.preload?Ao(t,o):void 0,a=o&&t.preload?0:s!==void 0?Math.min(s+1,r):r;let i,l;for(let f=0;f<a;f++)n.push(Ii(t,n,f));try{await Promise.all(n)}catch{const f=await Promise.allSettled(n);for(const m of f){if(m.status!=="rejected")continue;const g=m.reason;if(te(g))throw g;X(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=Ao(t,c);yt(f!==void 0);const m=t.matches[f],g=t.router.looseRoutesById[m.routeId],v=t.router.options?.defaultNotFoundComponent;!g.options.notFoundComponent&&v&&(g.options.notFoundComponent=v),c.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,y=>({...y,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=f,await Yt(g)}else if(!t.preload){const f=t.matches[0];f.globalNotFound||t.router.getMatch(f.id)?.globalNotFound&&t.updateMatch(f.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const f=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Yt(f)}for(let f=0;f<=u;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=Ai(t,g,b);if(y){const w=await y;t.updateMatch(g,R=>({...R,...w}))}}catch(y){console.error(`Error executing head for route ${v}:`,y)}}const h=In(t);if(bt(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Yt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const o of Lr){const r=e.options[o]?.preload;r&&n.push(r())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Mr(e){for(const t of Lr)if(e.options[t]?.preload)return!0;return!1}const Lr=["component","errorComponent","pendingComponent","notFoundComponent"];function Ti(e){return{input:({url:t})=>{for(const n of e)t=Tn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ar(e[n],t);return t}}}function Di(e){const t=ir(e.basepath),n=`/${t}`,o=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?o:o.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===r?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Ks(["/",t,a.pathname]),a)}}function Tn(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ar(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ve(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,r=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:r,hashChanged:s}}function Ni(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class ji{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const o=this.options,r=this.basepath??o?.basepath??"/",s=this.basepath===void 0,a=o?.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Gs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=di()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Ws(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=ii(Oi(this.latestLocation)),yi(this));let i=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(s||r!==l||a!==c){this.basepath=l;const f=[],m=ir(l);m&&m!=="/"&&f.push(Di({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Ti(f),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=qs(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&Xs(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:l,search:c,hash:u,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const w=this.options.parseSearch(c),R=this.options.stringifySearch(w);return{href:l+R+u,publicHref:h,pathname:ct(l).path,external:!1,searchStr:R,search:ae(o?.search,w),hash:ct(u.slice(1)).path,state:ae(o?.state,f)}}const m=new URL(h,this.origin),g=Tn(this.rewrite,m),v=this.options.parseSearch(g.search),b=this.options.stringifySearch(v);return g.search=b,{href:g.href.replace(g.origin,""),publicHref:h,pathname:ct(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:ae(o?.search,v),hash:ct(g.hash.slice(1)).path,state:ae(o?.state,f)}},s=r(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const l=r(a);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,o)=>Ys({base:n,to:Qs(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,r)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},r):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>ki({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),o=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const o=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,c=this.resolvePathWithBase(l,"."),u=i.search,h={...i.params},f=s.to?this.resolvePathWithBase(c,`${s.to}`):this.resolvePathWithBase(c,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,ze(s.params,h)),g=this.getMatchedRoutes(f);let v=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(v=[...v,this.options.notFoundRoute]),Object.keys(m).length>0)for(const P of v){const L=P.options.params?.stringify??P.options.stringifyParams;if(L)try{Object.assign(m,L(m))}catch{}}const y=n.leaveParams?f:ct(xo({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const P={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(P,Ut(L.options.validateSearch,{...P,...w}))}catch{}}),w=P}w=Fi({search:w,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),w=ae(u,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?ze(s.hash,a.hash):void 0,_=S?`#${S}`:"";let M=s.state===!0?a.state:s.state?ze(s.state,a.state):{};M=ae(a.state,M);const E=`${y}${R}${_}`;let x,C,I=!1;if(this.rewrite){const P=new URL(E,this.origin),L=Ar(this.rewrite,P);x=P.href.replace(P.origin,""),L.origin!==this.origin?(C=L.href,I=!0):C=L.pathname+L.search+L.hash}else x=oa(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:M,hash:S??"",external:I,unmaskOnReload:s.unmaskOnReload}},r=(s={},a)=>{const i=o(s);let l=a?o(a):void 0;if(!l){const c={};if(this.options.routeMasks){const u=ta(i.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:h,params:f,...m}=u.route,g=f===!1||f===null?{}:(f??!0)===!0?c:Object.assign(c,ze(f,c));a={from:n.from,...m,params:g},l=o(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...r})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{r.state[u]=this.latestLocation.state[u]});const c=vn(r.state,this.latestLocation.state);return l.forEach(u=>{delete r.state[u]}),c},a=Ue(this.latestLocation.href)===Ue(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=We(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=r;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const h=this.history.location.state.__TSR_index,f=qt(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=Tn(this.rewrite,m);l.to=g.pathname,l.search=this.options.parseSearch(f.search),l.hash=f.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:o,href:r,publicHref:s,...a})=>{let i=!1;if(r)try{new URL(`${r}`),i=!0}catch{}if(i&&!o&&(o=!0),o){if(n!==void 0||!r){const c=this.buildLocation({to:n,...a});r=r??c.publicHref,s=s??c.publicHref}const l=!i&&s?s:r;if(yo(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const h of u)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(s=>s.id===r.id))}))},this.load=async n=>{let o,r,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,c=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ve({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...Ve({resolvedLocation:c,location:l})}),await To({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[],m=[];pt(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return u=v.filter(y=>!b.some(w=>w.id===y.id)),h=v.filter(y=>!b.some(w=>w.routeId===y.routeId)),f=b.filter(y=>!v.some(w=>w.routeId===y.routeId)),m=b.filter(y=>v.some(w=>w.routeId===y.routeId)),{...g,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...g.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound"&&y.status!=="redirected")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[m,"onStay"]].forEach(([g,v])=>{g.forEach(b=>{this.looseRoutesById[b.routeId].options[v]?.(b)})})})})}})}catch(l){te(l)?(o=l,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):X(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(u=>u.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof o.types=="function"?o.types(Ve({resolvedLocation:a,location:s})):o.types;if(i===!1){n();return}r={update:n,types:i}}else r=n;document.startViewTransition(r)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Ni(s.cachedMatches.map(a=>a.id===n?o(a):a))})):this.__store.setState(s=>({...s,[r]:s[r]?.map(a=>a.id===n?o(a):a)})))})},this.getMatch=n=>{const o=r=>r.id===n;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=n=>{const o=r=>n?.filter?.(r)??!0?{...r,invalid:!0,...n?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(o),cachedMatches:r.cachedMatches.map(o),pendingMatches:r.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const r=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(r);n.options.href=s,n.headers.set("Location",s)}else if(o)try{const r=new URL(o);if(this.origin&&r.origin===this.origin){const s=r.pathname+r.search+r.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&yo(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n?.filter;o!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(s=>!o(s))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const r=this.looseRoutesById[o.routeId];if(!r.options.loader)return!0;const s=(o.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=Yt,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let r=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...s,...this.state.cachedMatches.map(i=>i.id)]);pt(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return r=await To({router:this,matches:r,location:o,preload:!0,updateMatch:(i,l)=>{s.has(i)?r=r.map(c=>c.id===i?l(c):c):this.updateMatch(i,l)}}),r}catch(i){if(te(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});X(i)||console.error(i);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const i=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=Js(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!vn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?vn(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Ei,parseSearch:t.parseSearch??Ri,protocolAllowlist:t.protocolAllowlist??ea}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:o}){this.routesById=t,this.routesByPath=n,this.processedTree=o;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s,parsedParams:a}=o;let{matchedRoutes:i}=o,l=!1;(r?r.path!=="/"&&s["**"]:Ue(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?Bi(this.options.notFoundMode,i):void 0,u=new Array(i.length),h=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<i.length;f++){const m=i[f],g=u[f-1];let v,b,y;{const D=g?.search??t.search,le=g?._strictSearch??void 0;try{const W=Ut(m.options.validateSearch,{...D})??void 0;v={...D,...W},b={...le,...W},y=void 0}catch(W){let k=W;if(W instanceof Qt||(k=new Qt(W.message,{cause:W})),n?.throwOnError)throw k;v=D,b={},y=k}}const w=m.options.loaderDeps?.({search:v})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:_}=xo({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),M=m.id+S+R,E=this.getMatch(M),x=h.get(m.id),C=E?._strictParams??_;let I;if(!E)try{Do(m,_,a,C)}catch(D){if(X(D)||te(D)?I=D:I=new Vi(D.message,{cause:D}),n?.throwOnError)throw I}Object.assign(s,C);const P=x?"stay":"enter";let L;if(E)L={...E,cause:P,params:x?.params??s,_strictParams:C,search:x?ae(x.search,v):ae(E.search,v),_strictSearch:b};else{const D=m.options.loader||m.options.beforeLoad||m.lazyFn||Mr(m)?"pending":"success";L={id:M,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?ae(x.search,v):v,_strictSearch:b,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:We()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:x?ae(x.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(L.globalNotFound=c===m.id),L.searchError=y;const K=this.getParentContext(g);L.context={...K,...L.__routeContext,...L.__beforeLoadContext},u[f]=L}for(let f=0;f<u.length;f++){const m=u[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?ae(b.params,s):s,!v){const y=u[f-1],w=this.getParentContext(y);if(g.options.context){const R={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:u,routeId:g.id};m.__routeContext=g.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=wo(n),a={...t.search};for(const u of n)try{Object.assign(a,Ut(u.options.validateSearch,a))}catch{}const i=wo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const u={...o};for(const h of n)try{Do(h,o,r??{},u)}catch{}c=u}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class Qt extends Error{}class Vi extends Error{}function Oi(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ut(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Qt("Async validation not supported");if(n.issues)throw new Qt(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 ki({pathname:e,routesById:t,processedTree:n}){const o={},r=Ue(e);let s,a;const i=na(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Ct]],routeParams:o,foundRoute:s,parsedParams:a}}function Fi({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Hi(n)(e,t,o??!1)}function Hi(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(l=r.options.preSearchFilters.reduce((u,h)=>h(u),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((u,h)=>h(u),c):c};t.middlewares.push(s)}if(r.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...Ut(r.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(s)}}const n=({search:r})=>{const s=t.dest;return s.search?s.search===!0?r:ze(s.search,r):{}};t.middlewares.push(n);const o=(r,s,a)=>{if(r>=a.length)return s;const i=a[r];return i({search:s,next:c=>o(r+1,c,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,o(0,s,t.middlewares)}}function Bi(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return Ct}function Do(e,t,n,o){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(o[s]=n[s]);else{const s=r(o);Object.assign(o,s)}}function Xn(e){const t=e.errorComponent??Yn;return p.jsx($i,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?d.createElement(t,{error:n,reset:o}):e.children})}class $i extends d.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Yn({error:e}){const[t,n]=d.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function No(e){return typeof e=="object"?new jo(e,{silent:!0}).createRoute(e):new jo(e,{silent:!0}).createRoute}class jo{constructor(t,n){this.path=t,this.createRoute=o=>{const r=V(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Vo{constructor(t){this.useMatch=n=>So({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>So({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>ra({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>sa({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>aa({...n,from:this.options.id}),this.useLoaderData=n=>ia({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ee();return Hn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Oo(e){return typeof e=="object"?new Vo(e):t=>new Vo({id:e,...t})}function U(e,t){let n,o,r,s;const a=()=>(n||(n=e().then(l=>{n=void 0,o=l.default}).catch(l=>{if(r=l,ca(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const c=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(c)||(sessionStorage.setItem(c,"1"),s=!0)}})),n),i=function(c){if(s)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!o)if(Ro)Ro(a());else throw a();return d.createElement(o,c)};return i.preload=a,i}function Zi(){const e=Ee(),t=d.useRef({router:e,mounted:!1}),[n,o]=d.useState(!1),{hasPendingMatches:r,isLoading:s}=pe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=bn(s),i=s||n||r,l=bn(i),c=s||r,u=bn(c);return e.startTransition=h=>{o(!0),d.startTransition(()=>{h(),o(!1)})},d.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ue(e.latestLocation.publicHref)!==Ue(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Ot(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),Ot(()=>{a&&!s&&e.emit({type:"onLoad",...Ve(e.state)})},[a,e,s]),Ot(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...Ve(e.state)})},[c,u,e]),Ot(()=>{if(l&&!i){const h=Ve(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&xi(e)}},[i,l,e]),null}function zi(e){const t=pe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Xn,{getResetKey:()=>t,onCatch:(n,o)=>{if(X(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(X(n))return e.fallback?.(n);throw n},children:e.children})}function Ui(){return p.jsx("p",{children:"Not Found"})}function Ze(e){return p.jsx(p.Fragment,{children:e.children})}function Ir(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Ui,{})}function Ki(){return Ee().isScrollRestoring,null}const Tr=d.memo(function({matchId:t}){const n=Ee(),o=pe({select:v=>{const b=v.matches.findIndex(w=>w.id===t),y=v.matches[b];return yt(y),{routeId:y.routeId,ssr:y.ssr,_displayPending:y._displayPending,resetKey:v.loadedAt,parentRouteId:v.matches[b-1]?.routeId}},structuralSharing:!0}),r=n.routesById[o.routeId],s=r.options.pendingComponent??n.options.defaultPendingComponent,a=s?p.jsx(s,{}):null,i=r.options.errorComponent??n.options.defaultErrorComponent,l=r.options.onCatch??n.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??n.options.notFoundRoute?.options.component:r.options.notFoundComponent,u=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||u)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||u))?d.Suspense:Ze,f=i?Xn:Ze,m=c?zi:Ze,g=r.isRoot?r.options.shellComponent??Ze:Ze;return p.jsxs(g,{children:[p.jsx(Bn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||Yn,onCatch:(v,b)=>{if(X(v))throw v;l?.(v,b)},children:p.jsx(m,{fallback:v=>{if(!c||v.routeId&&v.routeId!==o.routeId||!v.routeId&&!r.isRoot)throw v;return d.createElement(c,v)},children:u||o._displayPending?p.jsx(la,{fallback:a,children:p.jsx(ko,{matchId:t})}):p.jsx(ko,{matchId:t})})})})}),o.parentRouteId===Ct&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Gi,{}),p.jsx(Ki,{})]}):null]})});function Gi(){const e=Ee(),t=d.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ve(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ko=d.memo(function({matchId:t}){const n=Ee(),{match:o,key:r,routeId:s}=pe({select:l=>{const c=l.matches.find(g=>g.id===t),u=c.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:c.id,status:c.status,error:c.error,invalid:c.invalid,_forcePending:c._forcePending,_displayPending:c._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=d.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(Dr,{})},[r,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const c=n.getMatch(o.id);if(c&&!c._nonReactive.minPendingPromise){const u=We();c._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return yt(X(o.error)),Ir(n,a,o.error);if(o.status==="redirected")throw yt(te(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),Dr=d.memo(function(){const t=Ee(),n=d.useContext(Bn),o=pe({select:c=>c.matches.find(u=>u.id===n)?.routeId}),r=t.routesById[o],s=pe({select:c=>{const h=c.matches.find(f=>f.id===n);return yt(h),h.globalNotFound}}),a=pe({select:c=>{const u=c.matches,h=u.findIndex(f=>f.id===n);return u[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Ir(t,r,void 0);if(!a)return null;const l=p.jsx(Tr,{matchId:a});return o===Ct?p.jsx(d.Suspense,{fallback:i,children:l}):l});function Wi(){const e=Ee(),n=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?Ze:d.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Zi,{}),p.jsx(qi,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function qi(){const e=Ee(),t=pe({select:r=>r.matches[0]?.id}),n=pe({select:r=>r.loadedAt}),o=t?p.jsx(Tr,{matchId:t}):null;return p.jsx(Bn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Xn,{getResetKey:()=>n,errorComponent:Yn,onCatch:void 0,children:o})})}const Xi=e=>new Yi(e);class Yi extends ji{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=No,globalThis.createLazyFileRoute=Oo):typeof window<"u"&&(window.createFileRoute=No,window.createLazyFileRoute=Oo);function Qi({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=p.jsx(da.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function Ji({router:e,...t}){return p.jsx(Qi,{router:e,...t,children:p.jsx(Wi,{})})}function cn(e){return pe({select:t=>e?.select?e.select(t.location):t.location})}const ec=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Zm60-80v56a12,12,0,0,1-24,0V143.32a12,12,0,0,1-9.37-22l16-8A12,12,0,0,1,112,124Zm61.49,33.88L163.9,168H168a12,12,0,0,1,0,24H136a12,12,0,0,1-8.71-20.25L155.45,142a4,4,0,0,0,.55-2,4,4,0,0,0-7.47-2,12,12,0,0,1-20.78-12A28,28,0,0,1,180,140a27.77,27.77,0,0,1-5.64,16.86A10.63,10.63,0,0,1,173.49,157.88Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,34H182V24a6,6,0,0,0-12,0V34H86V24a6,6,0,0,0-12,0V34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H74V56a6,6,0,0,0,12,0V46h84V56a6,6,0,0,0,12,0V46h26a2,2,0,0,1,2,2V82H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V94H210V208A2,2,0,0,1,208,210Zm-98-90v64a6,6,0,0,1-12,0V129.71l-7.32,3.66a6,6,0,1,1-5.36-10.74l16-8A6,6,0,0,1,110,120Zm59.57,29.25L148,178h20a6,6,0,0,1,0,12H136a6,6,0,0,1-4.8-9.6L160,142a10,10,0,1,0-16.65-11A6,6,0,1,1,133,125a22,22,0,1,1,36.62,24.26Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,36H180V24a4,4,0,0,0-8,0V36H84V24a4,4,0,0,0-8,0V36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H76V56a4,4,0,0,0,8,0V44h88V56a4,4,0,0,0,8,0V44h28a4,4,0,0,1,4,4V84H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V92H212V208A4,4,0,0,1,208,212ZM108,120v64a4,4,0,0,1-8,0V126.47l-10.21,5.11a4,4,0,0,1-3.58-7.16l16-8A4,4,0,0,1,108,120Zm60,28-24,32h24a4,4,0,0,1,0,8H136a4,4,0,0,1-3.2-6.4l28.78-38.37A11.88,11.88,0,0,0,164,136a12,12,0,0,0-22.4-6,4,4,0,0,1-6.92-4A20,20,0,0,1,172,136,19.79,19.79,0,0,1,168,148Z"}))]]),tc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]),nc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),oc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),rc=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24h68A12,12,0,0,1,128,128ZM48,76H180a12,12,0,0,0,0-24H48a12,12,0,0,0,0,24Zm52,104H48a12,12,0,0,0,0,24h52a12,12,0,0,0,0-24Zm132.49-20.49a12,12,0,0,0-17,0L196,179V112a12,12,0,0,0-24,0v67l-19.51-19.52a12,12,0,0,0-17,17l40,40a12,12,0,0,0,17,0l40-40A12,12,0,0,0,232.49,159.51Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,72h96a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16Zm40,112H72a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Zm8-48H72a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm77.66,29.66-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L160,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M126,128a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12h72A6,6,0,0,1,126,128ZM48,70H184a6,6,0,0,0,0-12H48a6,6,0,0,0,0,12Zm56,116H48a6,6,0,0,0,0,12h56a6,6,0,0,0,0-12Zm124.24-22.24a6,6,0,0,0-8.48,0L190,193.51V112a6,6,0,0,0-12,0v81.51l-29.76-29.75a6,6,0,0,0-8.48,8.48l40,40a6,6,0,0,0,8.48,0l40-40A6,6,0,0,0,228.24,163.76Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M124,128a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8h72A4,4,0,0,1,124,128ZM48,68H184a4,4,0,0,0,0-8H48a4,4,0,0,0,0,8Zm56,120H48a4,4,0,0,0,0,8h56a4,4,0,0,0,0-8Zm122.83-22.83a4,4,0,0,0-5.66,0L188,198.34V112a4,4,0,0,0-8,0v86.34l-33.17-33.17a4,4,0,0,0-5.66,5.66l40,40a4,4,0,0,0,5.66,0l40-40A4,4,0,0,0,226.83,165.17Z"}))]]),Nr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:ec}));Nr.displayName="CalendarIcon";const sc=Nr,jr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:tc}));jr.displayName="DotsSixVerticalIcon";const ac=jr,Vr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:nc}));Vr.displayName="GridFourIcon";const Or=Vr,kr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:oc}));kr.displayName="PencilSimpleIcon";const ic=kr,Fr=d.forwardRef((e,t)=>d.createElement(_t,{ref:t,...e,weights:rc}));Fr.displayName="SortAscendingIcon";const cc=Fr,Qn="/login",lc="/api/auth/";let Fo=!1;const dc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Qn}?next=${encodeURIComponent(t)}`},uc=e=>{if(!qe.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(lc)&&t!==Qn},Hr=(e=window.location)=>{Fo||e.pathname===Qn||(Fo=!0,e.assign(dc(e)))},hc="X-Ocean-Brain-Session-Generation";let Ho=!1,Ht;const fc=e=>!!(e.authRequired&&!e.authenticated),pc=e=>{const t=e.headers.get(hc);return t?Ht?Ht===t?!1:(Ht=t,!0):(Ht=t,!1):!1},mc=(e=window.location)=>{Ho||(Ho=!0,e.reload())},Jt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=pc(t),o=await t.json();return fc(o)?(Hr(),"expired"):n?(mc(),"reloading"):"active"},gc=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Ts(t.data);!n||n.type!==e||Ds(n)},vc=()=>{const e=$n();return d.useEffect(()=>As(t=>{Ns(e,t)}),[e]),d.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Jt()},r=()=>{n&&(n=!1,Jt())},s=Is.map(a=>{const i=gc(a);return t.addEventListener(a,i),()=>{t.removeEventListener(a,i)}});return t.addEventListener("error",o),t.addEventListener("open",r),()=>{s.forEach(a=>{a()}),t.removeEventListener("error",o),t.removeEventListener("open",r),t.close()}},[]),null},bc=({children:e})=>p.jsx(ua,{client:ha,children:p.jsx(fa,{children:p.jsxs(pa,{children:[p.jsx(vc,{}),e]})})}),Bo=({children:e,fallback:t})=>e||t;function yc({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:o,sortOrder:r,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Or,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(yn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);ma(c)&&t(c)},variant:"ghost",size:"sm",children:cr.map(l=>p.jsx(lt,{value:String(l),children:l===lr?`Default (${l})`:l},l))})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(cc,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(yn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"updatedAt",children:"Updated"}),p.jsx(lt,{value:"createdAt",children:"Created"})]}),p.jsxs(yn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"desc",children:"Newest"}),p.jsx(lt,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(ga,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(va,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const xc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},wn=new Map;function wc(){const e=cn({select:n=>n.pathname}),t=d.useRef(null);return d.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){wn.set(e,s);return}wn.delete(e)},r=xc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=wn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const Jn=`
3
+ id
4
+ tabId
5
+ title
6
+ displayType
7
+ displayOptions {
8
+ tableColumns
9
+ tablePropertyKeys
10
+ boardGroupByPropertyKey
11
+ calendarDateField
12
+ calendarDatePropertyKey
13
+ }
14
+ tagNames
15
+ mode
16
+ propertyFilters {
17
+ key
18
+ name
19
+ valueType
20
+ operator
21
+ value
22
+ }
23
+ sortBy
24
+ sortOrder
25
+ limit
26
+ order
27
+ `;function dh(){return B(`query FetchViewWorkspace {
28
+ viewWorkspace {
29
+ activeTabId
30
+ tabs {
31
+ id
32
+ title
33
+ order
34
+ sections {
35
+ ${Jn}
36
+ }
37
+ }
38
+ }
39
+ }`)}function Sc(e){return B(`query FetchViewSection($id: ID!) {
40
+ viewSection(id: $id) {
41
+ ${Jn}
42
+ }
43
+ }`,{id:e})}function uh(e,{limit:t=25,offset:n=0,sortBy:o,sortOrder:r}={}){return B(`query FetchViewSectionNotes(
44
+ $id: ID!
45
+ $pagination: PaginationInput
46
+ $sortBy: ViewSortBy
47
+ $sortOrder: ViewSortOrder
48
+ ) {
49
+ viewSectionNotes(id: $id, pagination: $pagination, sortBy: $sortBy, sortOrder: $sortOrder) {
50
+ totalCount
51
+ notes {
52
+ id
53
+ title
54
+ pinned
55
+ tags {
56
+ id
57
+ name
58
+ }
59
+ createdAt
60
+ updatedAt
61
+ properties {
62
+ key
63
+ name
64
+ value
65
+ valueType
66
+ option { id label value color order }
67
+ createdAt
68
+ updatedAt
69
+ }
70
+ }
71
+ }
72
+ }`,{id:e,pagination:{limit:t,offset:n},sortBy:o,sortOrder:r})}function hh(e,t){return B(`query FetchViewSectionCalendarNotes($id: ID!, $dateRange: DateRangeInput!) {
73
+ viewSectionCalendarNotes(id: $id, dateRange: $dateRange) {
74
+ id
75
+ title
76
+ calendarDate
77
+ }
78
+ }`,{id:e,dateRange:t})}function fh(e,{optionValue:t,limit:n=5,offset:o=0}){return B(`query FetchViewSectionBoardColumn($id: ID!, $optionValue: String, $pagination: PaginationInput) {
79
+ viewSectionBoardColumn(id: $id, optionValue: $optionValue, pagination: $pagination) {
80
+ totalCount
81
+ notes {
82
+ id
83
+ title
84
+ updatedAt
85
+ }
86
+ }
87
+ }`,{id:e,optionValue:t,pagination:{limit:n,offset:o}})}function ph(e){return B(`mutation CreateViewTab($title: String!) {
88
+ createViewTab(title: $title) {
89
+ id
90
+ }
91
+ }`,{title:e})}function mh(e,t){return B(`mutation UpdateViewTab($id: ID!, $title: String!) {
92
+ updateViewTab(id: $id, title: $title) {
93
+ id
94
+ }
95
+ }`,{id:e,title:t})}function gh(e){return B(`mutation DeleteViewTab($id: ID!) {
96
+ deleteViewTab(id: $id)
97
+ }`,{id:e})}function vh(e){return B(`mutation SetActiveViewTab($id: ID!) {
98
+ setActiveViewTab(id: $id) {
99
+ activeTabId
100
+ tabs {
101
+ id
102
+ title
103
+ order
104
+ sections {
105
+ ${Jn}
106
+ }
107
+ }
108
+ }
109
+ }`,{id:e})}function bh(e){return B(`mutation ReorderViewTabs($tabIds: [ID!]!) {
110
+ reorderViewTabs(tabIds: $tabIds) {
111
+ id
112
+ }
113
+ }`,{tabIds:e})}function yh(e,t){return B(`mutation CreateViewSection($tabId: ID!, $input: ViewSectionInput!) {
114
+ createViewSection(tabId: $tabId, input: $input) {
115
+ id
116
+ }
117
+ }`,{tabId:e,input:t})}function xh(e,t){return B(`mutation UpdateViewSection($id: ID!, $input: ViewSectionInput!) {
118
+ updateViewSection(id: $id, input: $input) {
119
+ id
120
+ }
121
+ }`,{id:e,input:t})}function wh(e){return B(`mutation DeleteViewSection($id: ID!) {
122
+ deleteViewSection(id: $id)
123
+ }`,{id:e})}function Sh(e,t){return B(`mutation ReorderViewSections($tabId: ID!, $sectionIds: [ID!]!) {
124
+ reorderViewSections(tabId: $tabId, sectionIds: $sectionIds) {
125
+ id
126
+ }
127
+ }`,{tabId:e,sectionIds:t})}const Rc=()=>null,Ec=e=>e instanceof Element?e instanceof HTMLElement&&(e.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(e.tagName))?!0:!!e.closest('button, [role="button"], [role="dialog"], [role="menu"], [role="menuitem"], [role="listbox"]'):!1,Cc=()=>{const e=Hn();return d.useEffect(()=>{const t=n=>{n.defaultPrevented||!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!=="k"||Ec(n.target)||(n.preventDefault(),e({to:Pt,search:{query:"",page:1,mode:"hybrid"}}))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),null},_c="flex h-dvh min-h-0 w-full flex-row overflow-hidden",Pc=ie("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),Mc=ie("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","sm:w-[300px]","sm:border-r","min-[1000px]:static","min-[1000px]:w-auto","min-[1000px]:translate-x-0","min-[1000px]:pb-0","min-[1000px]:pointer-events-auto"),Lc="pointer-events-none -translate-x-full",Ac="pointer-events-auto translate-x-0",Ic=ie("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),Tc=ie("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-[999px]:after:content-['']","max-[999px]:after:pointer-events-none","max-[999px]:after:absolute","max-[999px]:after:inset-y-0","max-[999px]:after:right-0","max-[999px]:after:w-12","max-[999px]:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),Dc=ie("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Nc=ie("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-[999px]:after:h-24"),jc=({sidebar:e,topNavigation:t,children:n})=>{const o=cn({select:i=>i.pathname}),[r,s]=d.useState(!1),a="site-layout-sidebar";return d.useEffect(()=>{s(!1)},[o]),p.jsxs("div",{className:_c,children:[p.jsx(Cc,{}),p.jsx("div",{className:"min-[1000px]:hidden",children:p.jsx("button",{type:"button",className:Pc,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":r,onClick:()=>s(i=>!i),children:p.jsx(js,{className:"h-6 w-6"})})}),p.jsx("aside",{id:a,className:ie(Mc,r?Ac:Lc),children:e}),p.jsxs("main",{className:Ic,children:[p.jsx("div",{className:Tc,children:p.jsx("div",{className:Dc,children:t})}),p.jsx("div",{className:Nc,children:n}),p.jsx(wc,{})]})]})},Br=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",$r=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),Vc=async e=>{try{const t=await B(`
128
+ query GetServerCache($key: String!) {
129
+ cache(key: $key) {
130
+ value
131
+ }
132
+ }
133
+ `,{key:e});if(t.type==="error")throw t;if(!Br(t.cache))throw $r("cache",t);return t.cache.value}catch{return""}},Oc=async(e,t)=>{const n=await B(`
134
+ mutation SetServerCache($key: String!, $value: String!) {
135
+ setCache(key: $key, value: $value) {
136
+ value
137
+ }
138
+ }
139
+ `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:Br(n.setCache)?{...n,setCache:n.setCache}:$r("setCache",n)},kc=()=>{const e=Vs(),t=ya(),n=$n(),{data:o}=Os({queryKey:xt.ui.heroBanner(),async queryFn(){return Vc("heroBanner")}});return o?p.jsx("div",{className:"p-3 pb-0",children:p.jsxs("div",{className:"surface-base group relative overflow-hidden",children:[p.jsx("img",{alt:"Studio atmosphere banner",className:"w-full object-cover transition duration-500 group-hover:scale-[1.01] group-hover:opacity-90 dark:brightness-[0.85] dark:saturate-[0.9]",src:o}),p.jsx("button",{type:"button","aria-label":"Remove sidebar banner",title:"Remove banner",className:"focus-ring-soft absolute right-2 top-2 inline-flex h-8 w-8 items-center justify-center rounded-[10px] border border-white/14 bg-black/24 text-white/85 opacity-0 outline-none backdrop-blur-sm transition-opacity hover:bg-black/34 hover:text-white focus-visible:opacity-100 group-hover:opacity-100",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const r=await Oc("heroBanner","");if(r.type==="error"){t(r.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:xt.ui.heroBanner(),exact:!0})}},children:p.jsx(ba,{className:"h-4 w-4",weight:"bold"})})]})}):null};function Fc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>o=>{t.forEach(r=>r(o))},t)}const ln=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ye(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function eo(e){return"nodeType"in e}function Y(e){var t,n;return e?Ye(e)?e:eo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function to(e){const{Document:t}=Y(e);return e instanceof t}function Mt(e){return Ye(e)?!1:e instanceof Y(e).HTMLElement}function Zr(e){return e instanceof Y(e).SVGElement}function Qe(e){return e?Ye(e)?e.document:eo(e)?to(e)?e:Mt(e)||Zr(e)?e.ownerDocument:document:document:document}const me=ln?d.useLayoutEffect:d.useEffect;function no(e){const t=d.useRef(e);return me(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Hc(){const e=d.useRef(null),t=d.useCallback((o,r)=>{e.current=setInterval(o,r)},[]),n=d.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function wt(e,t){t===void 0&&(t=[e]);const n=d.useRef(e);return me(()=>{n.current!==e&&(n.current=e)},t),n}function Lt(e,t){const n=d.useRef();return d.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function en(e){const t=no(e),n=d.useRef(null),o=d.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function Dn(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}let Sn={};function At(e,t){return d.useMemo(()=>{if(t)return t;const n=Sn[e]==null?0:Sn[e]+1;return Sn[e]=n,e+"-"+n},[e,t])}function zr(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((s,a)=>{const i=Object.entries(a);for(const[l,c]of i){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const Ge=zr(1),St=zr(-1);function Bc(e){return"clientX"in e&&"clientY"in e}function oo(e){if(!e)return!1;const{KeyboardEvent:t}=Y(e.target);return t&&e instanceof t}function $c(e){if(!e)return!1;const{TouchEvent:t}=Y(e.target);return t&&e instanceof t}function Nn(e){if($c(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Bc(e)?{x:e.clientX,y:e.clientY}:null}const Rt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Rt.Translate.toString(e),Rt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),$o="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Zc(e){return e.matches($o)?e:e.querySelector($o)}const zc={display:"none"};function Uc(e){let{id:t,value:n}=e;return G.createElement("div",{id:t,style:zc},n)}function Kc(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return G.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function Gc(){const[e,t]=d.useState("");return{announce:d.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Ur=d.createContext(null);function Wc(e){const t=d.useContext(Ur);d.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qc(){const[e]=d.useState(()=>new Set),t=d.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[d.useCallback(o=>{let{type:r,event:s}=o;e.forEach(a=>{var i;return(i=a[r])==null?void 0:i.call(a,s)})},[e]),t]}const Xc={draggable:`
140
+ To pick up a draggable item, press the space bar.
141
+ While dragging, use the arrow keys to move the item.
142
+ Press space again to drop the item in its new position, or press escape to cancel.
143
+ `},Yc={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Qc(e){let{announcements:t=Yc,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=Xc}=e;const{announce:s,announcement:a}=Gc(),i=At("DndLiveRegion"),[l,c]=d.useState(!1);if(d.useEffect(()=>{c(!0)},[]),Wc(d.useMemo(()=>({onDragStart(h){let{active:f}=h;s(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:m}=h;t.onDragMove&&s(t.onDragMove({active:f,over:m}))},onDragOver(h){let{active:f,over:m}=h;s(t.onDragOver({active:f,over:m}))},onDragEnd(h){let{active:f,over:m}=h;s(t.onDragEnd({active:f,over:m}))},onDragCancel(h){let{active:f,over:m}=h;s(t.onDragCancel({active:f,over:m}))}}),[s,t])),!l)return null;const u=G.createElement(G.Fragment,null,G.createElement(Uc,{id:o,value:r.draggable}),G.createElement(Kc,{id:i,announcement:a}));return n?ut.createPortal(u,n):u}var j;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(j||(j={}));function tn(){}function Zo(e,t){return d.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Jc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const ce=Object.freeze({x:0,y:0});function Kr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gr(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function el(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function zo(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Wr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Uo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const tl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Uo(t,t.left,t.top),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Kr(Uo(l),r);s.push({id:i,data:{droppableContainer:a,value:c}})}}return s.sort(Gr)},nl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=zo(t),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=zo(l),u=r.reduce((f,m,g)=>f+Kr(c[g],m),0),h=Number((u/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:h}})}}return s.sort(Gr)};function ol(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=r-o,i=s-n;if(o<r&&n<s){const l=t.width*t.height,c=e.width*e.height,u=a*i,h=u/(l+c-u);return Number(h.toFixed(4))}return 0}const rl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const s of o){const{id:a}=s,i=n.get(a);if(i){const l=ol(i,t);l>0&&r.push({id:a,data:{droppableContainer:s,value:l}})}}return r.sort(el)};function sl(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function qr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ce}function al(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];return r.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...n})}}const il=al(1);function cl(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ll(e,t,n){const o=cl(t);if(!o)return e;const{scaleX:r,scaleY:s,x:a,y:i}=o,l=e.left-a-(1-r)*parseFloat(n),c=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width/r:e.width,h=s?e.height/s:e.height;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l}}const dl={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=dl);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Y(e).getComputedStyle(e);c&&(n=ll(n,c,u))}const{top:o,left:r,width:s,height:a,bottom:i,right:l}=n;return{top:o,left:r,width:s,height:a,bottom:i,right:l}}function Ko(e){return Je(e,{ignoreTransform:!0})}function ul(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function hl(e,t){return t===void 0&&(t=Y(e).getComputedStyle(e)),t.position==="fixed"}function fl(e,t){t===void 0&&(t=Y(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const s=t[r];return typeof s=="string"?n.test(s):!1})}function dn(e,t){const n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(to(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Mt(r)||Zr(r)||n.includes(r))return n;const s=Y(e).getComputedStyle(r);return r!==e&&fl(r,s)&&n.push(r),hl(r,s)?n:o(r.parentNode)}return e?o(e):n}function Xr(e){const[t]=dn(e,1);return t??null}function Rn(e){return!ln||!e?null:Ye(e)?e:eo(e)?to(e)||e===Qe(e).scrollingElement?window:Mt(e)?e:null:null}function Yr(e){return Ye(e)?e.scrollX:e.scrollLeft}function Qr(e){return Ye(e)?e.scrollY:e.scrollTop}function jn(e){return{x:Yr(e),y:Qr(e)}}var F;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(F||(F={}));function Jr(e){return!ln||!e?!1:e===document.scrollingElement}function es(e){const t={x:0,y:0},n=Jr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=o.y,i=e.scrollLeft>=o.x;return{isTop:r,isLeft:s,isBottom:a,isRight:i,maxScroll:o,minScroll:t}}const pl={x:.2,y:.2};function ml(e,t,n,o,r){let{top:s,left:a,right:i,bottom:l}=n;o===void 0&&(o=10),r===void 0&&(r=pl);const{isTop:c,isBottom:u,isLeft:h,isRight:f}=es(e),m={x:0,y:0},g={x:0,y:0},v={height:t.height*r.y,width:t.width*r.x};return!c&&s<=t.top+v.height?(m.y=F.Backward,g.y=o*Math.abs((t.top+v.height-s)/v.height)):!u&&l>=t.bottom-v.height&&(m.y=F.Forward,g.y=o*Math.abs((t.bottom-v.height-l)/v.height)),!f&&i>=t.right-v.width?(m.x=F.Forward,g.x=o*Math.abs((t.right-v.width-i)/v.width)):!h&&a<=t.left+v.width&&(m.x=F.Backward,g.x=o*Math.abs((t.left+v.width-a)/v.width)),{direction:m,speed:g}}function gl(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ts(e){return e.reduce((t,n)=>Ge(t,jn(n)),ce)}function vl(e){return e.reduce((t,n)=>t+Yr(n),0)}function bl(e){return e.reduce((t,n)=>t+Qr(n),0)}function yl(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:o,bottom:r,right:s}=t(e);Xr(e)&&(r<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const xl=[["x",["left","right"],vl],["y",["top","bottom"],bl]];class ro{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=dn(n),r=ts(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of xl)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=i(o),u=r[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mt{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function wl(e){const{EventTarget:t}=Y(e);return e instanceof t?e:Qe(e)}function En(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Go(e){e.preventDefault()}function Sl(e){e.stopPropagation()}var A;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(A||(A={}));const ns={start:[A.Space,A.Enter],cancel:[A.Esc],end:[A.Space,A.Enter,A.Tab]},Rl=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case A.Right:return{...n,x:n.x+25};case A.Left:return{...n,x:n.x-25};case A.Down:return{...n,y:n.y+25};case A.Up:return{...n,y:n.y-25}}};class so{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new mt(Qe(n)),this.windowListeners=new mt(Y(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&yl(o),n(ce)}handleKeyDown(t){if(oo(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=ns,coordinateGetter:a=Rl,scrollBehavior:i="smooth"}=r,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=o.current,u=c?{x:c.left,y:c.top}:ce;this.referenceCoordinates||(this.referenceCoordinates=u);const h=a(t,{active:n,context:o.current,currentCoordinates:u});if(h){const f=St(h,u),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const v of g){const b=t.code,{isTop:y,isRight:w,isLeft:R,isBottom:S,maxScroll:_,minScroll:M}=es(v),E=gl(v),x={x:Math.min(b===A.Right?E.right-E.width/2:E.right,Math.max(b===A.Right?E.left:E.left+E.width/2,h.x)),y:Math.min(b===A.Down?E.bottom-E.height/2:E.bottom,Math.max(b===A.Down?E.top:E.top+E.height/2,h.y))},C=b===A.Right&&!w||b===A.Left&&!R,I=b===A.Down&&!S||b===A.Up&&!y;if(C&&x.x!==h.x){const P=v.scrollLeft+f.x,L=b===A.Right&&P<=_.x||b===A.Left&&P>=M.x;if(L&&!f.y){v.scrollTo({left:P,behavior:i});return}L?m.x=v.scrollLeft-P:m.x=b===A.Right?v.scrollLeft-_.x:v.scrollLeft-M.x,m.x&&v.scrollBy({left:-m.x,behavior:i});break}else if(I&&x.y!==h.y){const P=v.scrollTop+f.y,L=b===A.Down&&P<=_.y||b===A.Up&&P>=M.y;if(L&&!f.x){v.scrollTo({top:P,behavior:i});return}L?m.y=v.scrollTop-P:m.y=b===A.Down?v.scrollTop-_.y:v.scrollTop-M.y,m.y&&v.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Ge(St(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}so.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=ns,onActivation:r}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function Wo(e){return!!(e&&"distance"in e)}function qo(e){return!!(e&&"delay"in e)}class ao{constructor(t,n,o){var r;o===void 0&&(o=wl(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Qe(a),this.documentListeners=new mt(this.document),this.listeners=new mt(o),this.windowListeners=new mt(Y(a)),this.initialCoordinates=(r=Nn(s))!=null?r:ce,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Go),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Go),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qo(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Wo(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,Sl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!r)return;const l=(n=Nn(t))!=null?n:ce,c=St(r,l);if(!o&&i){if(Wo(i)){if(i.tolerance!=null&&En(c,i.tolerance))return this.handleCancel();if(En(c,i.distance))return this.handleStart()}if(qo(i)&&En(c,i.tolerance))return this.handleCancel();this.handlePending(i,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===A.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const El={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class io extends ao{constructor(t){const{event:n}=t,o=Qe(n.target);super(t,El,o)}}io.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];const Cl={move:{name:"mousemove"},end:{name:"mouseup"}};var Vn;(function(e){e[e.RightClick=2]="RightClick"})(Vn||(Vn={}));class _l extends ao{constructor(t){super(t,Cl,Qe(t.event.target))}}_l.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===Vn.RightClick?!1:(o?.({event:n}),!0)}}];const Cn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Pl extends ao{constructor(t){super(t,Cn)}static setup(){return window.addEventListener(Cn.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Cn.move.name,t)};function t(){}}}Pl.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var gt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(gt||(gt={}));var nn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nn||(nn={}));function Ml(e){let{acceleration:t,activator:n=gt.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:a=5,order:i=nn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:h,threshold:f}=e;const m=Al({delta:h,disabled:!s}),[g,v]=Hc(),b=d.useRef({x:0,y:0}),y=d.useRef({x:0,y:0}),w=d.useMemo(()=>{switch(n){case gt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case gt.DraggableRect:return r}},[n,r,l]),R=d.useRef(null),S=d.useCallback(()=>{const M=R.current;if(!M)return;const E=b.current.x*y.current.x,x=b.current.y*y.current.y;M.scrollBy(E,x)},[]),_=d.useMemo(()=>i===nn.TreeOrder?[...c].reverse():c,[i,c]);d.useEffect(()=>{if(!s||!c.length||!w){v();return}for(const M of _){if(o?.(M)===!1)continue;const E=c.indexOf(M),x=u[E];if(!x)continue;const{direction:C,speed:I}=ml(M,x,w,t,f);for(const P of["x","y"])m[P][C[P]]||(I[P]=0,C[P]=0);if(I.x>0||I.y>0){v(),R.current=M,g(S,a),b.current=I,y.current=C;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,S,o,v,s,a,JSON.stringify(w),JSON.stringify(m),g,c,_,u,JSON.stringify(f)])}const Ll={x:{[F.Backward]:!1,[F.Forward]:!1},y:{[F.Backward]:!1,[F.Forward]:!1}};function Al(e){let{delta:t,disabled:n}=e;const o=Dn(t);return Lt(r=>{if(n||!o||!r)return Ll;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[F.Backward]:r.x[F.Backward]||s.x===-1,[F.Forward]:r.x[F.Forward]||s.x===1},y:{[F.Backward]:r.y[F.Backward]||s.y===-1,[F.Forward]:r.y[F.Forward]||s.y===1}}},[n,t,o])}function Il(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Lt(r=>{var s;return t==null?null:(s=o??r)!=null?s:null},[o,t])}function Tl(e,t){return d.useMemo(()=>e.reduce((n,o)=>{const{sensor:r}=o,s=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,o)}));return[...n,...s]},[]),[e,t])}var Et;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Et||(Et={}));var On;(function(e){e.Optimized="optimized"})(On||(On={}));const Xo=new Map;function Dl(e,t){let{dragging:n,dependencies:o,config:r}=t;const[s,a]=d.useState(null),{frequency:i,measure:l,strategy:c}=r,u=d.useRef(e),h=b(),f=wt(h),m=d.useCallback(function(y){y===void 0&&(y=[]),!f.current&&a(w=>w===null?y:w.concat(y.filter(R=>!w.includes(R))))},[f]),g=d.useRef(null),v=Lt(y=>{if(h&&!n)return Xo;if(!y||y===Xo||u.current!==e||s!=null){const w=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){w.set(R.id,R.rect.current);continue}const S=R.node.current,_=S?new ro(l(S),S):null;R.rect.current=_,_&&w.set(R.id,_)}return w}return y},[e,s,n,h,l]);return d.useEffect(()=>{u.current=e},[e]),d.useEffect(()=>{h||m()},[n,h]),d.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),d.useEffect(()=>{h||typeof i!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},i))},[i,h,m,...o]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:s!=null};function b(){switch(c){case Et.Always:return!1;case Et.BeforeDragging:return n;default:return!n}}}function os(e,t){return Lt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nl(e,t){return os(e,t)}function jl(e){let{callback:t,disabled:n}=e;const o=no(t),r=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return d.useEffect(()=>()=>r?.disconnect(),[r]),r}function un(e){let{callback:t,disabled:n}=e;const o=no(t),r=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return d.useEffect(()=>()=>r?.disconnect(),[r]),r}function Vl(e){return new ro(Je(e),e)}function Yo(e,t,n){t===void 0&&(t=Vl);const[o,r]=d.useState(null);function s(){r(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const a=jl({callback(l){if(e)for(const c of l){const{type:u,target:h}=c;if(u==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),i=un({callback:s});return me(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),o}function Ol(e){const t=os(e);return qr(e,t)}const Qo=[];function kl(e){const t=d.useRef(e),n=Lt(o=>e?o&&o!==Qo&&e&&t.current&&e.parentNode===t.current.parentNode?o:dn(e):Qo,[e]);return d.useEffect(()=>{t.current=e},[e]),n}function Fl(e){const[t,n]=d.useState(null),o=d.useRef(e),r=d.useCallback(s=>{const a=Rn(s.target);a&&n(i=>i?(i.set(a,jn(a)),new Map(i)):null)},[]);return d.useEffect(()=>{const s=o.current;if(e!==s){a(s);const i=e.map(l=>{const c=Rn(l);return c?(c.addEventListener("scroll",r,{passive:!0}),[c,jn(c)]):null}).filter(l=>l!=null);n(i.length?new Map(i):null),o.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(l=>{const c=Rn(l);c?.removeEventListener("scroll",r)})}},[r,e]),d.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Ge(s,a),ce):ts(e):ce,[e,t])}function Jo(e,t){t===void 0&&(t=[]);const n=d.useRef(null);return d.useEffect(()=>{n.current=null},t),d.useEffect(()=>{const o=e!==ce;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?St(e,n.current):ce}function Hl(e){d.useEffect(()=>{if(!ln)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Bl(e,t){return d.useMemo(()=>e.reduce((n,o)=>{let{eventName:r,handler:s}=o;return n[r]=a=>{s(a,t)},n},{}),[e,t])}function rs(e){return d.useMemo(()=>e?ul(e):null,[e])}const er=[];function $l(e,t){t===void 0&&(t=Je);const[n]=e,o=rs(n?Y(n):null),[r,s]=d.useState(er);function a(){s(()=>e.length?e.map(l=>Jr(l)?o:new ro(t(l),l)):er)}const i=un({callback:a});return me(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),r}function Zl(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Mt(t)?t:e}function zl(e){let{measure:t}=e;const[n,o]=d.useState(null),r=d.useCallback(c=>{for(const{target:u}of c)if(Mt(u)){o(h=>{const f=t(u);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),s=un({callback:r}),a=d.useCallback(c=>{const u=Zl(c);s?.disconnect(),u&&s?.observe(u),o(u?t(u):null)},[t,s]),[i,l]=en(a);return d.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const Ul=[{sensor:io,options:{}},{sensor:so,options:{}}],Kl={current:{}},Kt={draggable:{measure:Ko},droppable:{measure:Ko,strategy:Et.WhileDragging,frequency:On.Optimized},dragOverlay:{measure:Je}};class vt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const Gl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kt,measureDroppableContainers:tn,windowRect:null,measuringScheduled:!1},Wl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tn,draggableNodes:new Map,over:null,measureDroppableContainers:tn},hn=d.createContext(Wl),ss=d.createContext(Gl);function ql(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vt}}}function Xl(e,t){switch(t.type){case j.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case j.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case j.DragEnd:case j.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case j.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new vt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case j.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,s=e.droppable.containers.get(n);if(!s||o!==s.key)return e;const a=new vt(e.droppable.containers);return a.set(n,{...s,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case j.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const s=new vt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Yl(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=d.useContext(hn),s=Dn(o),a=Dn(n?.id);return d.useEffect(()=>{if(!t&&!o&&s&&a!=null){if(!oo(s)||document.activeElement===s.target)return;const i=r.get(a);if(!i)return;const{activatorNode:l,node:c}=i;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const h=Zc(u);if(h){h.focus();break}}})}},[o,t,r,a,s]),null}function Ql(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,s)=>s({transform:r,...o}),n):n}function Jl(e){return d.useMemo(()=>({draggable:{...Kt.draggable,...e?.draggable},droppable:{...Kt.droppable,...e?.droppable},dragOverlay:{...Kt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ed(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const s=d.useRef(!1),{x:a,y:i}=typeof r=="boolean"?{x:r,y:r}:r;me(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!o)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const u=n(c),h=qr(u,o);if(a||(h.x=0),i||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const f=Xr(c);f&&f.scrollBy({top:h.y,left:h.x})}},[t,a,i,o,n])}const as=d.createContext({...ce,scaleX:1,scaleY:1});var Ie;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ie||(Ie={}));const td=d.memo(function(t){var n,o,r,s;let{id:a,accessibility:i,autoScroll:l=!0,children:c,sensors:u=Ul,collisionDetection:h=rl,measuring:f,modifiers:m,...g}=t;const v=d.useReducer(Xl,void 0,ql),[b,y]=v,[w,R]=qc(),[S,_]=d.useState(Ie.Uninitialized),M=S===Ie.Initialized,{draggable:{active:E,nodes:x,translate:C},droppable:{containers:I}}=b,P=E!=null?x.get(E):null,L=d.useRef({initial:null,translated:null}),K=d.useMemo(()=>{var Z;return E!=null?{id:E,data:(Z=P?.data)!=null?Z:Kl,rect:L}:null},[E,P]),D=d.useRef(null),[le,W]=d.useState(null),[k,Tt]=d.useState(null),ge=wt(g,Object.values(g)),tt=At("DndDescribedBy",a),Dt=d.useMemo(()=>I.getEnabled(),[I]),q=Jl(f),{droppableRects:ve,measureDroppableContainers:Ne,measuringScheduled:nt}=Dl(Dt,{dragging:M,dependencies:[C.x,C.y],config:q.droppable}),oe=Il(x,E),Nt=d.useMemo(()=>k?Nn(k):null,[k]),Ce=Ls(),be=Nl(oe,q.draggable.measure);ed({activeNode:E!=null?x.get(E):null,config:Ce.layoutShiftCompensation,initialRect:be,measure:q.draggable.measure});const T=Yo(oe,q.draggable.measure,be),ot=Yo(oe?oe.parentElement:null),de=d.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=I.getNodeFor((n=de.current.over)==null?void 0:n.id),ye=zl({measure:q.dragOverlay.measure}),ke=(o=ye.nodeRef.current)!=null?o:oe,Fe=M?(r=ye.rect)!=null?r:T:null,lo=!!(ye.nodeRef.current&&ye.rect),uo=Ol(lo?null:T),pn=rs(ke?Y(ke):null),_e=kl(M?Oe??oe:null),jt=$l(_e),Vt=Ql(m,{transform:{x:C.x-uo.x,y:C.y-uo.y,scaleX:1,scaleY:1},activatorEvent:k,active:K,activeNodeRect:T,containerNodeRect:ot,draggingNodeRect:Fe,over:de.current.over,overlayNodeRect:ye.rect,scrollableAncestors:_e,scrollableAncestorRects:jt,windowRect:pn}),ho=Nt?Ge(Nt,C):null,fo=Fl(_e),Ss=Jo(fo),Rs=Jo(fo,[T]),He=Ge(Vt,Ss),Be=Fe?il(Fe,Vt):null,rt=K&&Be?h({active:K,collisionRect:Be,droppableRects:ve,droppableContainers:Dt,pointerCoordinates:ho}):null,po=Wr(rt,"id"),[Pe,mo]=d.useState(null),Es=lo?Vt:Ge(Vt,Rs),Cs=sl(Es,(s=Pe?.rect)!=null?s:null,T),mn=d.useRef(null),go=d.useCallback((Z,Q)=>{let{sensor:J,options:Me}=Q;if(D.current==null)return;const re=x.get(D.current);if(!re)return;const ee=Z.nativeEvent,ue=new J({active:D.current,activeNode:re,event:ee,options:Me,context:de,onAbort(H){if(!x.get(H))return;const{onDragAbort:he}=ge.current,xe={id:H};he?.(xe),w({type:"onDragAbort",event:xe})},onPending(H,Le,he,xe){if(!x.get(H))return;const{onDragPending:at}=ge.current,Ae={id:H,constraint:Le,initialCoordinates:he,offset:xe};at?.(Ae),w({type:"onDragPending",event:Ae})},onStart(H){const Le=D.current;if(Le==null)return;const he=x.get(Le);if(!he)return;const{onDragStart:xe}=ge.current,st={activatorEvent:ee,active:{id:Le,data:he.data,rect:L}};ut.unstable_batchedUpdates(()=>{xe?.(st),_(Ie.Initializing),y({type:j.DragStart,initialCoordinates:H,active:Le}),w({type:"onDragStart",event:st}),W(mn.current),Tt(ee)})},onMove(H){y({type:j.DragMove,coordinates:H})},onEnd:$e(j.DragEnd),onCancel:$e(j.DragCancel)});mn.current=ue;function $e(H){return async function(){const{active:he,collisions:xe,over:st,scrollAdjustedTranslate:at}=de.current;let Ae=null;if(he&&at){const{cancelDrop:it}=ge.current;Ae={activatorEvent:ee,active:he,collisions:xe,delta:at,over:st},H===j.DragEnd&&typeof it=="function"&&await Promise.resolve(it(Ae))&&(H=j.DragCancel)}D.current=null,ut.unstable_batchedUpdates(()=>{y({type:H}),_(Ie.Uninitialized),mo(null),W(null),Tt(null),mn.current=null;const it=H===j.DragEnd?"onDragEnd":"onDragCancel";if(Ae){const gn=ge.current[it];gn?.(Ae),w({type:it,event:Ae})}})}}},[x]),_s=d.useCallback((Z,Q)=>(J,Me)=>{const re=J.nativeEvent,ee=x.get(Me);if(D.current!==null||!ee||re.dndKit||re.defaultPrevented)return;const ue={active:ee};Z(J,Q.options,ue)===!0&&(re.dndKit={capturedBy:Q.sensor},D.current=Me,go(J,Q))},[x,go]),vo=Tl(u,_s);Hl(u),me(()=>{T&&S===Ie.Initializing&&_(Ie.Initialized)},[T,S]),d.useEffect(()=>{const{onDragMove:Z}=ge.current,{active:Q,activatorEvent:J,collisions:Me,over:re}=de.current;if(!Q||!J)return;const ee={active:Q,activatorEvent:J,collisions:Me,delta:{x:He.x,y:He.y},over:re};ut.unstable_batchedUpdates(()=>{Z?.(ee),w({type:"onDragMove",event:ee})})},[He.x,He.y]),d.useEffect(()=>{const{active:Z,activatorEvent:Q,collisions:J,droppableContainers:Me,scrollAdjustedTranslate:re}=de.current;if(!Z||D.current==null||!Q||!re)return;const{onDragOver:ee}=ge.current,ue=Me.get(po),$e=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,H={active:Z,activatorEvent:Q,collisions:J,delta:{x:re.x,y:re.y},over:$e};ut.unstable_batchedUpdates(()=>{mo($e),ee?.(H),w({type:"onDragOver",event:H})})},[po]),me(()=>{de.current={activatorEvent:k,active:K,activeNode:oe,collisionRect:Be,collisions:rt,droppableRects:ve,draggableNodes:x,draggingNode:ke,draggingNodeRect:Fe,droppableContainers:I,over:Pe,scrollableAncestors:_e,scrollAdjustedTranslate:He},L.current={initial:Fe,translated:Be}},[K,oe,rt,Be,x,ke,Fe,ve,I,Pe,_e,He]),Ml({...Ce,delta:C,draggingRect:Be,pointerCoordinates:ho,scrollableAncestors:_e,scrollableAncestorRects:jt});const Ps=d.useMemo(()=>({active:K,activeNode:oe,activeNodeRect:T,activatorEvent:k,collisions:rt,containerNodeRect:ot,dragOverlay:ye,draggableNodes:x,droppableContainers:I,droppableRects:ve,over:Pe,measureDroppableContainers:Ne,scrollableAncestors:_e,scrollableAncestorRects:jt,measuringConfiguration:q,measuringScheduled:nt,windowRect:pn}),[K,oe,T,k,rt,ot,ye,x,I,ve,Pe,Ne,_e,jt,q,nt,pn]),Ms=d.useMemo(()=>({activatorEvent:k,activators:vo,active:K,activeNodeRect:T,ariaDescribedById:{draggable:tt},dispatch:y,draggableNodes:x,over:Pe,measureDroppableContainers:Ne}),[k,vo,K,T,y,tt,x,Pe,Ne]);return G.createElement(Ur.Provider,{value:R},G.createElement(hn.Provider,{value:Ms},G.createElement(ss.Provider,{value:Ps},G.createElement(as.Provider,{value:Cs},c)),G.createElement(Yl,{disabled:i?.restoreFocus===!1})),G.createElement(Qc,{...i,hiddenTextDescribedById:tt}));function Ls(){const Z=le?.autoScrollEnabled===!1,Q=typeof l=="object"?l.enabled===!1:l===!1,J=M&&!Z&&!Q;return typeof l=="object"?{...l,enabled:J}:{enabled:J}}}),nd=d.createContext(null),tr="button",od="Draggable";function rd(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const s=At(od),{activators:a,activatorEvent:i,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:h,over:f}=d.useContext(hn),{role:m=tr,roleDescription:g="draggable",tabIndex:v=0}=r??{},b=l?.id===t,y=d.useContext(b?as:nd),[w,R]=en(),[S,_]=en(),M=Bl(a,t),E=wt(n);me(()=>(h.set(t,{id:t,key:s,node:w,activatorNode:S,data:E}),()=>{const C=h.get(t);C&&C.key===s&&h.delete(t)}),[h,t]);const x=d.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":o,"aria-pressed":b&&m===tr?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[o,m,v,b,g,u.draggable]);return{active:l,activatorEvent:i,activeNodeRect:c,attributes:x,isDragging:b,listeners:o?void 0:M,node:w,over:f,setNodeRef:R,setActivatorNodeRef:_,transform:y}}function sd(){return d.useContext(ss)}const ad="Droppable",id={timeout:25};function cd(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const s=At(ad),{active:a,dispatch:i,over:l,measureDroppableContainers:c}=d.useContext(hn),u=d.useRef({disabled:n}),h=d.useRef(!1),f=d.useRef(null),m=d.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:b}={...id,...r},y=wt(v??o),w=d.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),R=un({callback:w,disabled:g||!a}),S=d.useCallback((x,C)=>{R&&(C&&(R.unobserve(C),h.current=!1),x&&R.observe(x))},[R]),[_,M]=en(S),E=wt(t);return d.useEffect(()=>{!R||!_.current||(R.disconnect(),h.current=!1,R.observe(_.current))},[_,R]),d.useEffect(()=>(i({type:j.RegisterDroppable,element:{id:o,key:s,disabled:n,node:_,rect:f,data:E}}),()=>i({type:j.UnregisterDroppable,key:s,id:o})),[o]),d.useEffect(()=>{n!==u.current.disabled&&(i({type:j.SetDroppableDisabled,id:o,key:s,disabled:n}),u.current.disabled=n)},[o,s,n,i]),{active:a,rect:f,isOver:l?.id===o,node:_,over:l,setNodeRef:M}}const Rh=e=>{let{transform:t}=e;return{...t,y:0}},ld=e=>{let{transform:t}=e;return{...t,x:0}};function is(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function dd(e,t){return e.reduce((n,o,r)=>{const s=t.get(o);return s&&(n[r]=s),n},Array(e.length))}function Bt(e){return e!==null&&e>=0}function ud(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function hd(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const $t={scaleX:1,scaleY:1},Eh=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:s,index:a}=e;const i=(t=n[r])!=null?t:o;if(!i)return null;const l=fd(n,a,r);if(a===r){const c=n[s];return c?{x:r<s?c.left+c.width-(i.left+i.width):c.left-i.left,y:0,...$t}:null}return a>r&&a<=s?{x:-i.width-l,y:0,...$t}:a<r&&a>=s?{x:i.width+l,y:0,...$t}:{x:0,y:0,...$t}};function fd(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return!o||!r&&!s?0:n<t?r?o.left-(r.left+r.width):s.left-(o.left+o.width):s?s.left-(o.left+o.width):o.left-(r.left+r.width)}const cs=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const s=is(t,o,n),a=t[r],i=s[r];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Zt={scaleX:1,scaleY:1},pd=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:o;if(!i)return null;if(r===n){const c=s[a];return c?{x:0,y:n<a?c.top+c.height-(i.top+i.height):c.top-i.top,...Zt}:null}const l=md(s,r,n);return r>n&&r<=a?{x:0,y:-i.height-l,...Zt}:r<n&&r>=a?{x:0,y:i.height+l,...Zt}:{x:0,y:0,...Zt}};function md(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return o?n<t?r?o.top-(r.top+r.height):s?s.top-(o.top+o.height):0:s?s.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}const ls="Sortable",ds=G.createContext({activeIndex:-1,containerId:ls,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cs,disabled:{draggable:!1,droppable:!1}});function gd(e){let{children:t,id:n,items:o,strategy:r=cs,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:c,measureDroppableContainers:u}=sd(),h=At(ls,n),f=i.rect!==null,m=d.useMemo(()=>o.map(M=>typeof M=="object"&&"id"in M?M.id:M),[o]),g=a!=null,v=a?m.indexOf(a.id):-1,b=c?m.indexOf(c.id):-1,y=d.useRef(m),w=!ud(m,y.current),R=b!==-1&&v===-1||w,S=hd(s);me(()=>{w&&g&&u(m)},[w,m,g,u]),d.useEffect(()=>{y.current=m},[m]);const _=d.useMemo(()=>({activeIndex:v,containerId:h,disabled:S,disableTransforms:R,items:m,overIndex:b,useDragOverlay:f,sortedRects:dd(m,l),strategy:r}),[v,h,S.draggable,S.droppable,R,m,b,l,f,r]);return G.createElement(ds.Provider,{value:_},t)}const vd=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return is(n,o,r).indexOf(t)},bd=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:s,newIndex:a,previousItems:i,previousContainerId:l,transition:c}=e;return!c||!o||i!==s&&r===a?!1:n?!0:a!==r&&t===l},yd={duration:200,easing:"ease"},us="transform",xd=Rt.Transition.toString({property:us,duration:0,easing:"linear"}),wd={roleDescription:"sortable"};function Sd(e){let{disabled:t,index:n,node:o,rect:r}=e;const[s,a]=d.useState(null),i=d.useRef(n);return me(()=>{if(!t&&n!==i.current&&o.current){const l=r.current;if(l){const c=Je(o.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&a(u)}}n!==i.current&&(i.current=n)},[t,n,o,r]),d.useEffect(()=>{s&&a(null)},[s]),s}function Rd(e){let{animateLayoutChanges:t=bd,attributes:n,disabled:o,data:r,getNewIndex:s=vd,id:a,strategy:i,resizeObserverConfig:l,transition:c=yd}=e;const{items:u,containerId:h,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:w}=d.useContext(ds),R=Ed(o,m),S=u.indexOf(a),_=d.useMemo(()=>({sortable:{containerId:h,index:S,items:u},...r}),[h,r,S,u]),M=d.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:E,node:x,isOver:C,setNodeRef:I}=cd({id:a,data:_,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...l}}),{active:P,activatorEvent:L,activeNodeRect:K,attributes:D,setNodeRef:le,listeners:W,isDragging:k,over:Tt,setActivatorNodeRef:ge,transform:tt}=rd({id:a,data:_,attributes:{...wd,...n},disabled:R.draggable}),Dt=Fc(I,le),q=!!P,ve=q&&!g&&Bt(f)&&Bt(b),Ne=!y&&k,nt=Ne&&ve?tt:null,Nt=ve?nt??(i??w)({rects:v,activeNodeRect:K,activeIndex:f,overIndex:b,index:S}):null,Ce=Bt(f)&&Bt(b)?s({id:a,items:u,activeIndex:f,overIndex:b}):S,be=P?.id,T=d.useRef({activeId:be,items:u,newIndex:Ce,containerId:h}),ot=u!==T.current.items,de=t({active:P,containerId:h,isDragging:k,isSorting:q,id:a,index:S,items:u,newIndex:T.current.newIndex,previousItems:T.current.items,previousContainerId:T.current.containerId,transition:c,wasDragging:T.current.activeId!=null}),Oe=Sd({disabled:!de,index:S,node:x,rect:E});return d.useEffect(()=>{q&&T.current.newIndex!==Ce&&(T.current.newIndex=Ce),h!==T.current.containerId&&(T.current.containerId=h),u!==T.current.items&&(T.current.items=u)},[q,Ce,h,u]),d.useEffect(()=>{if(be===T.current.activeId)return;if(be!=null&&T.current.activeId==null){T.current.activeId=be;return}const ke=setTimeout(()=>{T.current.activeId=be},50);return()=>clearTimeout(ke)},[be]),{active:P,activeIndex:f,attributes:D,data:_,rect:E,index:S,newIndex:Ce,items:u,isOver:C,isSorting:q,isDragging:k,listeners:W,node:x,overIndex:b,over:Tt,setNodeRef:Dt,setActivatorNodeRef:ge,setDroppableNodeRef:I,setDraggableNodeRef:le,transform:Oe??Nt,transition:ye()};function ye(){if(Oe||ot&&T.current.newIndex===S)return xd;if(!(Ne&&!oo(L)||!c)&&(q||de))return Rt.Transition.toString({...c,property:us})}}function Ed(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}function on(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Cd=[A.Down,A.Right,A.Up,A.Left],_d=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(Cd.includes(e.code)){if(e.preventDefault(),!n||!o)return;const l=[];s.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=r.get(h.id);if(f)switch(e.code){case A.Down:o.top<f.top&&l.push(h);break;case A.Up:o.top>f.top&&l.push(h);break;case A.Left:o.left>f.left&&l.push(h);break;case A.Right:o.left<f.left&&l.push(h);break}});const c=nl({collisionRect:o,droppableRects:r,droppableContainers:l});let u=Wr(c,"id");if(u===a?.id&&c.length>1&&(u=c[1].id),u!=null){const h=s.get(n.id),f=s.get(u),m=f?r.get(f.id):null,g=f?.node.current;if(g&&m&&h&&f){const b=dn(g).some((M,E)=>i[E]!==M),y=hs(h,f),w=Pd(h,f),R=b||!y?{x:0,y:0}:{x:w?o.width-m.width:0,y:w?o.height-m.height:0},S={x:m.left,y:m.top};return R.x&&R.y?S:St(S,R)}}}};function hs(e,t){return!on(e)||!on(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Pd(e,t){return!on(e)||!on(t)||!hs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Md=e=>{const{data:t}=dr({queryKey:xt.notes.pinned(),async queryFn(){const n=await B(`
144
+ query FetchPinnedNotes {
145
+ pinnedNotes {
146
+ id
147
+ title
148
+ order
149
+ }
150
+ }
151
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},Ld="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",Ad="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",Id=(e,t,n)=>{if(t===n)return null;const o=e.findIndex(i=>i.id===t),r=e.findIndex(i=>i.id===n);if(o<0||r<0)return null;const s=[...e],[a]=s.splice(o,1);return a?(s.splice(r,0,a),{nextItems:s,orders:s.map((i,l)=>({id:i.id,order:l}))}):null};function Td({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:u}=Rd({id:e}),h={transform:Rt.Transform.toString(l),transition:c,opacity:u?.5:1};return p.jsxs("div",{ref:a,style:h,className:ie("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ie(Ld,u?"cursor-grabbing":"cursor-grab"),children:p.jsx(ac,{className:"size-4"})}),p.jsx(ne,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Dd({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){d.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(td,{sensors:s,collisionDetection:tl,onDragEnd:r,modifiers:[ld],children:p.jsx(gd,{items:a.map(i=>i.id),strategy:pd,children:a.map(i=>p.jsx(Td,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(Gt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Ad,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Zn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Nd=()=>{const e=cn({select:i=>i.pathname}),t=$n(),[n,o]=d.useState([]),r=ks({mutationFn:wa,onSuccess:()=>{t.invalidateQueries({queryKey:xt.notes.pinned(),exact:!0})}}),s=Jc(Zo(io,{activationConstraint:{distance:8}}),Zo(so,{coordinateGetter:_d})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(u=>{const h=Id(u,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):u})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(ur,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ht,{height:"40px",opacity:.4}),p.jsx(ht,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(xa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(Md,{render:i=>i.length>0?p.jsx(Dd,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(ne,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},jd=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Nd,{})}),Vd="p-3 pb-0",Od="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",kd="flex items-center gap-2.5",Fd="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Hd="flex flex-col",Bd="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",$d=()=>{const{onCreate:e}=ar();return p.jsx("div",{className:Vd,children:p.jsxs("button",{type:"button",className:Od,onClick:()=>e(),children:[p.jsxs("span",{className:kd,children:[p.jsx("span",{className:Fd,children:p.jsx(ic,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Hd,children:[p.jsx(ne,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(ne,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(Sa,{className:Bd,weight:"bold"})]})})},Zd=/Mac|iPhone|iPad|iPod/i,zd=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,fs=(e=zd())=>Zd.test(e)?"⌘K":"Ctrl+K",Ud="focus-ring-soft surface-base group flex min-h-14 w-full items-center justify-between gap-3 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",Kd=()=>{const e=Hn(),t=fs(),n=()=>{e({to:Pt,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:Ud,"aria-label":"Open detailed search","aria-keyshortcuts":"Meta+K Control+K",onClick:n,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[p.jsx("span",{className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-muted text-fg-secondary transition-colors group-hover:text-fg-default",children:p.jsx(br,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(ne,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(ne,{as:"span",variant:"label",tone:"secondary",children:"Find a memory"})]})]}),p.jsx("span",{className:"shrink-0 rounded-[8px] bg-muted px-1.5 py-1 text-label font-medium text-fg-tertiary",children:t})]})},Gd=()=>p.jsx("div",{className:"p-3",children:p.jsx(Kd,{})}),Wd=[{name:"Search",path:Pt,icon:br},{name:"Notes",path:rn,icon:Or},{name:"Views",path:zn,icon:Fs},{name:"Graph",path:hr,icon:Za},{name:"Calendar",path:fr,icon:sc},{name:"Reminders",path:pr,icon:Hs},{name:"Tags",path:mr,icon:Bs},{name:"Setting",path:gr,icon:$s}],qd=()=>{const e=cn({select:n=>n.pathname}),t=fs();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Wd.map((n,o)=>{const r=e===n.path||n.path!==rn&&e.startsWith(`${n.path}/`),s=n.path===Pt?t:void 0;return p.jsxs(d.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(Gt,{to:n.path,"aria-keyshortcuts":s?"Meta+K Control+K":void 0,title:s?`${n.name} (${s})`:void 0,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(n.icon,{className:"size-5",weight:r?"fill":"regular"}),p.jsx(ne,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Xd=({children:e})=>p.jsx(jc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(kc,{}),p.jsx($d,{}),p.jsx(Gd,{}),p.jsx(jd,{}),p.jsx(Rc,{})]}),topNavigation:p.jsx(qd,{}),children:e}),ps=100,ms=[50,ps,200];function Ch(e){return ms.includes(e)}const kn=1,Yd=100,Qd=100,Jd=256,gs=1e5,eu=50,tu=1970,nu=9999,nr=25,Xe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),co=e=>e.length>0&&e.length<=Jd,ou=e=>typeof e=="number"&&Number.isInteger(e)&&e>1&&e<=gs?e:void 0,ru=e=>typeof e=="number"&&Number.isInteger(e)&&e>1?Math.min(e,eu):void 0,su=e=>{if(!Xe(e))return;const t=e.by,n=e.order;if(!(t!=="title"&&t!=="createdAt"&&t!=="updatedAt"||n!=="asc"&&n!=="desc"))return{by:t,order:n}},au=e=>{if(!Xe(e))return;const t=e.year,n=e.month;if(!(typeof t!="number"||!Number.isInteger(t)||t<tu||t>nu||typeof n!="number"||!Number.isInteger(n)||n<1||n>12))return{year:t,month:n}},vs=e=>{if(!Xe(e))return;const t=ou(e.page),n=su(e.sort),o=au(e.calendar),r=Xe(e.columns)?Object.fromEntries(Object.entries(e.columns).filter(([s])=>co(s)).slice(0,Qd).flatMap(([s,a])=>{const i=ru(a);return i===void 0?[]:[[s,i]]})):{};if(!(t===void 0&&Object.keys(r).length===0&&n===void 0&&o===void 0))return{...t===void 0?{}:{page:t},...Object.keys(r).length===0?{}:{columns:r},...n===void 0?{}:{sort:n},...o===void 0?{}:{calendar:o}}},Fn=e=>{if(!Xe(e)||e.version!==kn||!Xe(e.sections))return;const t=Object.fromEntries(Object.entries(e.sections).filter(([n])=>co(n)).slice(0,Yd).flatMap(([n,o])=>{const r=vs(o);return r===void 0?[]:[[n,r]]}));return Object.keys(t).length===0?void 0:{version:kn,sections:t}},iu=(e,t)=>e?.sections[t]??{},cu=(e,t,n)=>{if(!co(t))return Fn(e);const o=Fn(e),r=iu(o,t),s=vs(typeof n=="function"?n(r):n),a=Object.fromEntries(Object.entries({...o?.sections??{},[t]:s}).filter(i=>i[1]!==void 0));return Object.keys(a).length===0?void 0:{version:kn,sections:a}},lu=(e,t,n)=>{if(!Number.isSafeInteger(t)||t<=1)return;const o=Number.isSafeInteger(n)&&n>0?n:nr,r=Math.min(Number.MAX_SAFE_INTEGER,(t-1)*nr),s=Math.min(gs,Math.floor(r/o)+1);return cu(void 0,e,{page:s})},du=["updatedAt","createdAt"],uu=["referenceCount","name"],bs=["asc","desc"],hu=["create","update"],fu=["hybrid","lexical","semantic"],pu=["open","completed"],mu=["all","overdue","today","upcoming"],gu=["all","high","medium","low"],fn=e=>Array.isArray(e)?e[0]:e,Re=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=fn(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ys=(e,t,n)=>{const o=Re(e,Number.NaN);return t.includes(o)?o:n},vu=(e,t=!1)=>{const n=fn(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},It=(e,t="")=>{const n=fn(e);return typeof n=="string"?n:t},Se=(e,t,n)=>{const o=fn(e);return typeof o!="string"?n:t.includes(o)?o:n},bu=e=>({page:Re(e.page,1),limit:ys(e.limit,cr,lr),sortBy:Se(e.sortBy,du,"updatedAt"),sortOrder:Se(e.sortOrder,bs,"desc"),pinnedFirst:vu(e.pinnedFirst,!1)}),et=e=>({page:Re(e.page,1)}),yu=e=>{const t=Se(e.status,pu,"open"),n=Se(e.scope,mu,"all");return{page:Re(e.page,1),status:t,scope:t==="completed"?"all":n,priority:Se(e.priority,gu,"all")}},xu=e=>({page:Re(e.page,1),query:It(e.query,""),mode:Se(e.mode,fu,"hybrid")}),wu=e=>({page:Re(e.page,1),query:It(e.query,""),limit:ys(e.limit,ms,ps),sortBy:Se(e.sortBy,uu,"referenceCount"),sortOrder:Se(e.sortOrder,bs,"desc")}),Su=e=>({year:Re(e.year,bo().year(),{min:1970,max:9999}),month:Re(e.month,bo().month()+1,{min:1,max:12}),type:Se(e.type,hu,"create")}),Ru=e=>{const t=It(e.selected,"").trim();return t?{selected:t}:{}},Eu=e=>{const t=It(e.tab,"").trim(),n=Fn(e.state);return{...t?{tab:t}:{},...n?{state:n}:{}}},Cu=e=>({page:Re(e.page,1),sectionId:It(e.sectionId,"")}),_u=e=>{const{data:t}=dr({queryKey:xt.notes.list(e.searchParams),async queryFn(){const n=await Ra(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Pu({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Ea(Number(r));return p.jsxs("div",{className:ie("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[o&&p.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:p.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[p.jsx(Zs,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(Ca,{button:p.jsx(zs,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(ne,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(Gt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Zn,params:{id:e},children:t||"Untitled"})}),n.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>p.jsx(Gt,{to:vr,params:{id:l.id},search:{page:1},children:p.jsx(ne,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}const or=_a(rn);function Mu(){const e=or.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=or.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=ar(),c=u=>{e({search:h=>({...h,...u})})};return p.jsxs(Pa,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(yc,{itemsPerPage:t,onItemsPerPageChange:u=>c({limit:u,page:1}),sortBy:o,onSortByChange:u=>c({sortBy:u,page:1}),sortOrder:r,onSortOrderChange:u=>c({sortOrder:u,page:1}),pinnedFirst:s,onPinnedFirstChange:u=>c({pinnedFirst:u,page:1})}),p.jsx(ur,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"}),p.jsx(ht,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(_u,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:u,totalCount:h})=>p.jsx(Bo,{fallback:p.jsx(La,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:u.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:u.map(f=>p.jsx(Pu,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Bo,{fallback:null,children:h&&t<h&&p.jsx(Ma,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const O=Aa({component:()=>p.jsx(Xd,{children:p.jsx(Dr,{})}),errorComponent:Ta,notFoundComponent:Ia}),Lu=V({getParentRoute:()=>O,path:rn,component:Mu,validateSearch:bu}),Au=V({getParentRoute:()=>O,path:fr,component:U(()=>z(()=>import("./Calendar-CaeK7gTz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:Su}),Iu=V({getParentRoute:()=>O,path:zn,component:U(()=>z(()=>import("./Views-BPxlw3vk.js"),__vite__mapDeps([11,1,4,2,3,12,13,14,5,6,15,16,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading views",description:"Preparing your saved dashboards."}),validateSearch:Eu}),Tu=V({getParentRoute:()=>O,path:pr,component:U(()=>z(()=>import("./Reminders-DnuALBL6.js"),__vite__mapDeps([18,1,2,3,4,19,15]))),pendingComponent:()=>p.jsx($,{title:"Loading reminders",description:"Preparing your reminder workspace."}),validateSearch:yu}),Du=V({getParentRoute:()=>O,path:hr,component:U(()=>z(()=>import("./Graph-CdEu8eAn.js"),__vite__mapDeps([20,1,2,3,21,22,23,24,25,26,27,10,15,28,29,6,8,30]))),pendingComponent:()=>p.jsx($,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Ru}),Nu=V({getParentRoute:()=>O,path:Pt,component:U(()=>z(()=>import("./Search-DAYHxAml.js"),__vite__mapDeps([31,1,4,2,3,32,10,15,14,33,30,34,9]))),pendingComponent:()=>p.jsx($,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:xu}),ju=V({getParentRoute:()=>O,path:mr,component:U(()=>z(()=>import("./Tag-CG8b0l1j.js"),__vite__mapDeps([35,1,2,3,12,10,4,9]))),pendingComponent:()=>p.jsx($,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:wu}),Vu=V({getParentRoute:()=>O,path:Zn,component:U(()=>z(()=>import("./Note-CGI-Y1__.js"),__vite__mapDeps([36,1,2,3,4,7,8,37,32,30,17,13,19,38,39,40,9,41,42,28,43,12,34]))),pendingComponent:()=>p.jsx($,{title:"Loading note",description:"Preparing the editor and note content."})}),Ou=V({getParentRoute:()=>O,path:vr,component:U(()=>z(()=>import("./TagNotes-COyaVsdn.js"),__vite__mapDeps([44,1,2,3,37,4,32,30,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:et}),ku=V({getParentRoute:()=>O,path:ja,validateSearch:Cu,beforeLoad:async({search:e})=>{const t=e.sectionId?await Sc(e.sectionId).catch(()=>null):null,n=t?.type==="success"?t.viewSection:null;throw Da({to:zn,search:{tab:n?.tabId,state:n?lu(n.id,e.page,n.limit):void 0},replace:!0})}}),Fu=V({getParentRoute:()=>O,path:gr,component:U(()=>z(()=>import("./index-CzZFedXj.js"),__vite__mapDeps([45,1,4,2,3,46,47,48,10,9]))),pendingComponent:()=>p.jsx($,{title:"Loading settings",description:"Preparing workspace preferences."})}),Hu=V({getParentRoute:()=>O,path:Oa,component:U(()=>z(()=>import("./mcp-ugdCKa6H.js"),__vite__mapDeps([49,1,4,2,3,46,43]))),pendingComponent:()=>p.jsx($,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),Bu=V({getParentRoute:()=>O,path:Va,component:U(()=>z(()=>import("./search-ddYl3qH-.js"),__vite__mapDeps([50,1,4,2,3,33,10,16]))),pendingComponent:()=>p.jsx($,{title:"Loading search settings",description:"Preparing semantic search controls."})}),$u=V({getParentRoute:()=>O,path:ka,component:U(()=>z(()=>import("./trash-BHida7BG.js"),__vite__mapDeps([51,1,4,2,3,13,37,32,30,17]))),pendingComponent:()=>p.jsx($,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:et}),Zu=V({getParentRoute:()=>O,path:Fa,component:U(()=>z(()=>import("./manage-image-CSJ3Flgc.js"),__vite__mapDeps([52,1,2,3,4,42,53,13,48]))),pendingComponent:()=>p.jsx($,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:et}),zu=V({getParentRoute:()=>O,path:Ha,component:U(()=>z(()=>import("./manage-image-detail-9hRTiAsR.js"),__vite__mapDeps([54,1,2,3,4,42,53,13,37,32,30,17,48,47,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading image detail",description:"Preparing references for the selected image."}),validateSearch:et}),Uu=V({getParentRoute:()=>O,path:$a,component:U(()=>z(()=>import("./properties-B7Fv95qY.js"),__vite__mapDeps([55,1,4,2,3]))),pendingComponent:()=>p.jsx($,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:et}),Ku=V({getParentRoute:()=>O,path:Ba,component:U(()=>z(()=>import("./placeholder-CZoqs4S3.js"),__vite__mapDeps([56,1,4,2,3,13,29,17,9,10]))),pendingComponent:()=>p.jsx($,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:et}),Gu=O.addChildren([Lu,Iu,Au,Tu,Du,Nu,ju,Vu,Ou,ku,Fu,Bu,Hu,$u,Zu,zu,Ku,Uu]),Wu=Xi({routeTree:Gu,defaultPreload:"intent",scrollRestoration:!0,defaultPendingComponent:()=>p.jsx($,{title:"Loading page",description:"Preparing the next route."})});function qu(){const e=Pn(n=>n.setSystemTheme),t=Pn(n=>n.setTheme);return d.useEffect(()=>{const n=Eo();return n&&t(n),Ka.listenThemeChange(o=>{Eo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(bc,{children:p.jsx(Ji,{router:Wu})})}const xs="__oceanBrainCsrfRetry";let _n;const Xu=e=>!qe.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",ws=e=>{if(!Xu(e)||!qe.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[xs])},Yu=()=>(_n??=Jt().finally(()=>{_n=void 0}),_n),rr=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Qu=e=>{rr(e.headers,"X-XSRF-TOKEN"),rr(e.headers,"x-xsrf-token")},Ju=async e=>{if(!ws(e)||!qe.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[xs]=!0,await Yu()!=="active"?Promise.reject(e):(Qu(t),qe.request(t))};let sr;const eh=()=>{sr===void 0&&(sr=qe.interceptors.response.use(e=>e,e=>{if(uc(e))Hr();else if(ws(e))return Ju(e);return Promise.reject(e)}))};Pn.setState({theme:Na()});eh();Jt();Us.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(qu,{})}));export{ph as A,mh as B,Rt as C,td as D,gh as E,Bo as F,yh as G,xh as H,wh as I,bh as J,so as K,Sh as L,_l as M,Pu as N,io as P,gd as S,ms as T,ps as a,cc as b,Oc as c,sc as d,ic as e,hh as f,Zo as g,tl as h,Ch as i,cd as j,fh as k,rd as l,ac as m,uh as n,_d as o,Eh as p,Rd as q,Rh as r,Or as s,dh as t,Jc as u,cu as v,ld as w,pd as x,iu as y,vh as z};