ocean-brain 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/client/dist/assets/{Calendar-D7QJsAlg.js → Calendar-BR83066I.js} +1 -1
- package/server/client/dist/assets/{Note-DsMhwrHw.js → Note-DnXDfDTk.js} +1 -1
- package/server/client/dist/assets/{NotePropertiesPanel-aCKXAe5F.js → NotePropertiesPanel-CsaNhRnE.js} +1 -1
- package/server/client/dist/assets/{Search-Ctkx0BQk.js → Search-BqPROwkA.js} +1 -1
- package/server/client/dist/assets/{Tag-BjxtrIQW.js → Tag-C4fNi3KQ.js} +1 -1
- package/server/client/dist/assets/{TagNotes-DV_fdRbg.js → TagNotes-BXgkwXMd.js} +1 -1
- package/server/client/dist/assets/{ViewNotes-wWWeFJyU.js → ViewNotes-BJPiV66I.js} +1 -1
- package/server/client/dist/assets/{Views-CWE99SnI.js → Views-DMizFO-d.js} +1 -1
- package/server/client/dist/assets/{app-BpSMjzET.js → app-1lOWtkRA.js} +2 -2
- package/server/client/dist/assets/app-BHmwRmwM.css +1 -0
- package/server/client/dist/assets/{index-B-E1Ilh9.js → index-BBzpADtD.js} +1 -1
- package/server/client/dist/assets/{manage-image-detail-BF-uSqb_.js → manage-image-detail-ojV6kSsu.js} +1 -1
- package/server/client/dist/assets/{placeholder-AusSo8p9.js → placeholder-DR75IAi_.js} +1 -1
- package/server/client/dist/assets/route-preload.js +2 -2
- package/server/client/dist/assets/{trash-D4-9sv8q.js → trash-X_dnKA9T.js} +1 -1
- package/server/client/dist/index.html +2 -2
- package/server/dist/features/note/graphql/note.query.resolver.js +19 -9
- package/server/dist/features/note/services/content-blocks.js +18 -20
- package/server/dist/paths.js +0 -1
- package/server/dist/routes/client.js +1 -1
- package/server/client/dist/assets/app-B9WZRrAH.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{i as T,q as S,P as k,T as f,H as P,x as j,y as g,Q as E,F as R,k as q,E as C,l as x,h as I}from"./note.api-D3oJmG3q.js";import{s as A,T as O,a as L,i as F,b as Q,F as v}from"./app-
|
|
1
|
+
import{r as c,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{i as T,q as S,P as k,T as f,H as P,x as j,y as g,Q as E,F as R,k as q,E as C,l as x,h as I}from"./note.api-D3oJmG3q.js";import{s as A,T as O,a as L,i as F,b as Q,F as v}from"./app-1lOWtkRA.js";import{T as _,b as M}from"./url-9nrbQs7Z.js";import{f as B}from"./tag.api-DNSQpqwk.js";import{f as D}from"./Graph-LY_IgMYy.js";import"./time-D5LRMumI.js";import"./preload-helper-BXl3LOEh.js";const z=s=>{const{data:d}=T({queryKey:S.tags.list(s.searchParams),async queryFn(){const t=await B({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit,sortBy:s.searchParams.sortBy,sortOrder:s.searchParams.sortOrder});if(t.type==="error")throw t;return t.allTags}});return s.render(d)},G=s=>{const[d,t]=c.useState(!1),r=c.useRef(null),n=c.useRef(!0),u=c.useRef(0),o=c.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);c.useEffect(()=>(n.current=!0,()=>{n.current=!1,o()}),[o]);const m=c.useCallback(p=>{u.current+=1;const i=u.current;o(),n.current&&t(!0),r.current=setTimeout(()=>{r.current=null,Promise.resolve().then(p).catch(()=>{}).finally(()=>{n.current&&u.current===i&&t(!1)})},s)},[o,s]);return[d,m]},b=I(M);function X(){const s=b.useNavigate(),{page:d,query:t,limit:r,sortBy:n,sortOrder:u}=b.useSearch(),[o,m]=c.useState(t),[,p]=G(350),i=t.trim();c.useEffect(()=>{m(t)},[t]),c.useEffect(()=>{const a=o.trim();a!==i&&p(()=>{s({search:l=>({...l,page:1,query:a})})})},[o,s,i,p]);const y=a=>{s({search:l=>({...l,...a})})},w=()=>{m(""),y({page:1,query:""})};return e.jsxs(k,{title:"Tags",description:"Find tags you added with @ across your notes",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"surface-base flex min-w-0 items-center gap-2 rounded-[16px] px-3.5 py-2.5 lg:w-72",children:[e.jsx(D,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(f,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Search"}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsx("input",{"aria-label":"Search tags",placeholder:"Search tags",value:o,onChange:a=>m(a.target.value),className:"h-8 min-w-0 flex-1 bg-transparent text-sm font-medium text-fg-default outline-none placeholder:text-xs placeholder:font-medium placeholder:text-fg-placeholder"}),(o||i)&&e.jsx("button",{type:"button","aria-label":"Clear tag search",className:"focus-ring-soft flex h-7 w-7 shrink-0 items-center justify-center rounded-[10px] text-fg-tertiary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",onClick:w,children:e.jsx(P,{className:"h-3.5 w-3.5",weight:"bold"})})]}),e.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(f,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),e.jsx(j,{value:String(r),onValueChange:a=>{const l=Number(a);F(l)&&y({limit:l,page:1})},variant:"ghost",size:"sm",children:O.map(a=>e.jsx(g,{value:String(a),children:a===L?`Default (${a})`:a},a))})]}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(f,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),e.jsxs(j,{value:n,onValueChange:a=>y({sortBy:a,page:1}),variant:"ghost",size:"sm",children:[e.jsx(g,{value:"referenceCount",children:"Usage"}),e.jsx(g,{value:"name",children:"Name"})]}),e.jsxs(j,{value:u,onValueChange:a=>y({sortOrder:a,page:1}),variant:"ghost",size:"sm",children:[e.jsx(g,{value:"desc",children:n==="name"?"Z to A":"Most used"}),e.jsx(g,{value:"asc",children:n==="name"?"A to Z":"Least used"})]})]})]})]}),e.jsx(E,{fallback:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(x,{width:"90px",height:"36px"}),e.jsx(x,{width:"120px",height:"36px"}),e.jsx(x,{width:"80px",height:"36px"}),e.jsx(x,{width:"100px",height:"36px"}),e.jsx(x,{width:"110px",height:"36px"}),e.jsx(x,{width:"70px",height:"36px"})]}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[d,r,i,n,u],children:e.jsx(z,{searchParams:{query:i,offset:(d-1)*r,limit:r,sortBy:n,sortOrder:u},render:({tags:a,totalCount:l})=>e.jsx(v,{fallback:e.jsx(C,{title:i?"No matching tags":"No tags yet",description:i?"Try another tag name":"Add @tags inside notes and they will appear here"}),children:a.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:a.map(h=>e.jsxs(R,{to:_,params:{id:h.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(f,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:h.name}),e.jsx(f,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:h.referenceCount})]},h.id))}),e.jsx(v,{fallback:null,children:l&&r<l&&e.jsx(q,{page:d,last:Math.ceil(l/r),onChange:h=>{s({search:N=>({...N,page:h,query:i,limit:r,sortBy:n,sortOrder:u})})}})})]})})})})]})}export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{i as x,C as N,q as j,Q as y,P as c,k as P,E as T,l as o,h as v}from"./note.api-D3oJmG3q.js";import{F as h,N as k}from"./app-
|
|
1
|
+
import{j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{i as x,C as N,q as j,Q as y,P as c,k as P,E as T,l as o,h as v}from"./note.api-D3oJmG3q.js";import{F as h,N as k}from"./app-1lOWtkRA.js";import{T as q}from"./url-9nrbQs7Z.js";import"./NotePropertiesPanel-CsaNhRnE.js";import{e as w}from"./time-D5LRMumI.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-LY_IgMYy.js";import"./AuxiliaryPanelHeader-B1k7pZpn.js";import"./Plus.es-DRfLW_bI.js";const R=s=>{const{data:r}=x({queryKey:j.notes.tagList(s.searchParams),async queryFn(){const t=await N({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},g=v(q);function A(){const s=g.useNavigate(),{id:r}=g.useParams(),{page:t}=g.useSearch(),i=25,{onDelete:m,onPinned:u,deleteWarningDialog:f}=w();return e.jsxs(y,{fallback:e.jsx(c,{title:"Tagged Notes",heading:e.jsx(o,{width:148,height:24,className:"rounded-full"}),description:e.jsx(o,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:[e.jsx(R,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:l,totalCount:n})=>{const d=l.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(c,{title:d??"Tagged Notes",heading:d?n>0?`${d} (${n})`:d:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(T,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:l.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:l.map(a=>e.jsx(k,{...a,onPinned:()=>u(a.id,a.pinned),onDelete:()=>m(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(P,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:p=>({...p,page:a})})}})})]})})})}}),f]})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as t}from"./floating-ui.react-dom-BWTnA00G.js";import{e as z,a as P}from"./time-D5LRMumI.js";import{A as G,P as j,E as K,Q as J,l as p,h as X,u as Y,i as T,q as l,o as ee,k as te,B as q,F as se,T as ae,e as re}from"./note.api-D3oJmG3q.js";import{f as ie}from"./tag.api-DNSQpqwk.js";import{f as ne,a as oe,g as le,V as ce,b as de,c as pe,u as C,d as ue}from"./ViewSectionDialog-DhH8harC.js";import{F as A,N as he}from"./app-
|
|
1
|
+
import{r as s,j as t}from"./floating-ui.react-dom-BWTnA00G.js";import{e as z,a as P}from"./time-D5LRMumI.js";import{A as G,P as j,E as K,Q as J,l as p,h as X,u as Y,i as T,q as l,o as ee,k as te,B as q,F as se,T as ae,e as re}from"./note.api-D3oJmG3q.js";import{f as ie}from"./tag.api-DNSQpqwk.js";import{f as ne,a as oe,g as le,V as ce,b as de,c as pe,u as C,d as ue}from"./ViewSectionDialog-DhH8harC.js";import{F as A,N as he}from"./app-1lOWtkRA.js";import{V as me,c as ge}from"./url-9nrbQs7Z.js";import"./NotePropertiesPanel-CsaNhRnE.js";import{V as v}from"./ViewChip-DlCkL4z4.js";import{m as fe}from"./PencilLine.es-0JpEgxFY.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-LY_IgMYy.js";import"./AuxiliaryPanelHeader-B1k7pZpn.js";import"./Plus.es-DRfLW_bI.js";const ye=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),M=s.forwardRef((n,o)=>s.createElement(G,{ref:o,...n,weights:ye}));M.displayName="ArrowLeftIcon";const xe=M,b=X(me);function we(){const n=b.useNavigate(),o=Y(),N=re(),{page:u,sectionId:d}=b.useSearch(),{onDelete:k,onPinned:L,deleteWarningDialog:R}=z(),[S,g]=s.useState(!1),[f,y]=s.useState(!1),i=25,{data:a}=T({queryKey:l.views.section(d),async queryFn(){const e=await ne(d);if(e.type==="error")throw e;if(!e.viewSection)throw new Error("View section not found.");return e.viewSection}}),{data:r}=T({queryKey:l.views.sectionNotes(d,{limit:i,offset:(u-1)*i}),async queryFn(){const e=await oe(d,{limit:i,offset:(u-1)*i});if(e.type==="error")throw e;return e.viewSectionNotes}}),{data:D,isPending:H}=P({queryKey:l.tags.list({limit:200}),enabled:f,async queryFn(){const e=await ie({limit:200});if(e.type==="error")throw e;return e.allTags}}),{data:I,isPending:O}=P({queryKey:l.notes.propertyKeys({limit:100}),enabled:f,async queryFn(){const e=await ee({limit:100});if(e.type==="error")throw e;return e.notePropertyKeys}}),x=a.title,h=a.tagNames,Q=a.mode,w=a.propertyFilters,Z=h.length>0,E=w.length>0,V=h.length>1?` · ${le(Q)}`:"",$=Z?E?`Property and tag filters${V}`:`Tag filters${V}`:E?"Property filters":"All notes",F=t.jsx(A,{fallback:null,children:r.totalCount&&i<r.totalCount&&t.jsx(te,{page:u,last:Math.ceil(r.totalCount/i),onChange:e=>{n({search:c=>({...c,page:e})})}})}),B=D?.tags??[],U=I?.keys??[],W=async e=>{if(S)return;const c=a.sortBy===e?a.sortOrder==="asc"?"desc":"asc":e==="title"?"asc":"desc";g(!0);const m=await C(a.id,ue(a,{sortBy:e,sortOrder:c}));if(m.type==="error"){N(m.errors[0]?.message??"Failed to update table sort."),g(!1);return}await o.invalidateQueries({queryKey:l.views.all(),exact:!1}),g(!1)},_=async e=>{const c=await C(a.id,e);if(c.type==="error"){N(c.errors[0]?.message??"Failed to update section.");return}await o.invalidateQueries({queryKey:l.views.all(),exact:!1}),n({search:m=>({...m,page:1})}),y(!1)};return t.jsxs(t.Fragment,{children:[t.jsxs(j,{title:x,heading:r.totalCount>0?`${x} (${r.totalCount})`:x,description:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ae,{as:"span",variant:"meta",tone:"tertiary",children:$}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.map(e=>t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:e},e)),w.map(e=>t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:de(e)},`${e.key}-${e.operator}-${e.value??""}`)),h.length===0&&w.length===0&&t.jsx(v,{className:"max-w-full border-border-subtle bg-hover-subtle text-fg-secondary",children:"All notes"})]})]}),headerRight:t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(q,{asChild:!0,variant:"ghost",size:"sm",children:t.jsxs(se,{to:ge,children:[t.jsx(xe,{className:"h-4 w-4"}),"Back to Views"]})}),t.jsxs(q,{type:"button",variant:"subtle",size:"sm",onClick:()=>y(!0),children:[t.jsx(fe,{className:"h-4 w-4"}),"Edit section"]})]}),children:[t.jsx(A,{fallback:t.jsx(K,{title:"No notes match this saved view",description:"Adjust this view's filters or keep writing until matching notes appear."}),children:r.notes.length>0&&a.displayType==="table"?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(ce,{section:a,notes:r.notes,isPending:!1,isError:!1,surface:"card",onRetry:()=>{o.invalidateQueries({queryKey:l.views.sectionNotes(d,{limit:i,offset:(u-1)*i})})},onSortChange:W,isSortPending:S}),F]}):r.notes.length>0?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx("div",{className:"grid-auto-cards grid gap-5",children:r.notes.map(e=>t.jsx(he,{...e,onPinned:()=>L(e.id,e.pinned),onDelete:()=>k(e.id)},e.id))}),F]}):null}),R]}),t.jsx(pe,{open:f,mode:"edit",initialSection:a,availableTags:B,availableProperties:U,isTagsLoading:H,isPropertiesLoading:O,onClose:()=>y(!1),onSubmit:_})]})}function Me(){const{sectionId:n,page:o}=b.useSearch();return n?t.jsx(J,{fallback:t.jsx(j,{title:"View Notes",heading:t.jsx(p,{width:180,height:24,className:"rounded-full"}),description:t.jsx(p,{width:220,height:16,className:"rounded-full"}),children:t.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[t.jsx(p,{height:"112px"}),t.jsx(p,{height:"112px"}),t.jsx(p,{height:"112px"})]})}),errorTitle:"Failed to load view notes",errorDescription:"Retry loading notes for this saved view section",resetKeys:[o,n],children:t.jsx(we,{})}):t.jsx(j,{title:"View Notes",description:"Saved view note lists require a section id.",children:t.jsx(K,{title:"No section selected",description:"Return to Views and open a section from there."})})}export{Me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as T}from"./floating-ui.react-dom-BWTnA00G.js";import{u as G,d as E,e as H,K as Y,M as ge,D as J,r as we,f as X,S as Z,h as ye,g as ee,C as te,P as ve,j as je,v as Ne,m as Se}from"./app-BpSMjzET.js";import{t as ke,a as D,f as se,M as Te,u as Ce}from"./time-D5LRMumI.js";import{T as h,B as y,F as K,u as ae,q as g,G as re,e as ie,c as z,M as V,L as Ve,I as De,o as Ee,P as Re,l as I,E as _}from"./note.api-D3oJmG3q.js";import{f as We}from"./tag.api-DNSQpqwk.js";import{V as qe,e as Ae,a as Fe,h as Pe,i as Ie,b as Ke,u as ne,d as oe,j as ze,k as Me,E as Le,c as Oe,r as Qe,m as $e,s as _e,l as Ue,n as Be,o as Ge,p as He,q as Ye,t as Je,v as U,w as Xe,x as Ze,y as et}from"./ViewSectionDialog-DhH8harC.js";import{S as M}from"./SurfaceCard-t7pdfhEe.js";import{N as tt,V as B}from"./url-9nrbQs7Z.js";import{V as S}from"./ViewChip-DlCkL4z4.js";import{s as st}from"./ArrowRight.es-BEhnlwfe.js";import{n as L}from"./Plus.es-DRfLW_bI.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-LY_IgMYy.js";const at="group flex min-h-[64px] items-start justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-hover-subtle",rt=s=>{const i=s.tags.slice(0,2),n=s.tags.length-i.length;return i.length===0?null:e.jsxs(e.Fragment,{children:[i.map(c=>e.jsx(S,{size:"compact",className:"max-w-[116px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:c.name},c.id)),n>0&&e.jsxs(S,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function it({notes:s,isPending:i,isError:n,onRetry:c}){return i?e.jsxs("div",{className:"overflow-hidden bg-transparent",children:[e.jsx("div",{className:"h-[64px] animate-pulse bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"})]}):n?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Retry"})})]}):s.length===0?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):e.jsx("div",{className:"divide-y divide-border-subtle/70 bg-transparent",children:s.map(o=>e.jsxs(K,{to:tt,params:{id:o.id},className:at,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:o.title||"Untitled"}),e.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-wrap items-center gap-1.5",children:[e.jsxs(h,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"mr-0.5",children:["Updated ",ke(Number(o.updatedAt))]}),rt(o)]})]}),e.jsx(st,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5"})]},o.id))})}function nt({onEdit:s}){return e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-subtle/40 px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"This display type is unavailable"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Switch this section to List or Table to preview the saved query here."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:s,children:"Change display"})})]})}function ot({section:s,notes:i,isPending:n,isError:c,onRetry:o,onEdit:d,onSortChange:l,isSortPending:b}){return s.displayType==="table"?e.jsx(qe,{section:s,notes:i,isPending:n,isError:c,onRetry:o,onSortChange:l,isSortPending:b}):s.displayType==="calendar"?e.jsx(nt,{onEdit:d}):e.jsx(it,{notes:i,isPending:n,isError:c,onRetry:o})}function lt({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:l}){const b=ae(),v=ie(),[w,j]=T.useState(!1),u=Ae(s),{data:r,isPending:N,isError:R,refetch:W}=D({queryKey:g.views.sectionNotes(s.id,{limit:s.limit,offset:0}),async queryFn(){const m=await Fe(s.id,{limit:s.limit,offset:0});if(m.type==="error")throw m;return m.viewSectionNotes}}),C=r?.notes??[],q=r?.totalCount??0,A=Pe(s.mode),F=s.tagNames.length>0||s.propertyFilters.length>0,P=async m=>{if(w)return;const f=s.sortBy===m?s.sortOrder==="asc"?"desc":"asc":m==="title"?"asc":"desc";j(!0);const k=await ne(s.id,oe(s,{sortBy:m,sortOrder:f}));if(k.type==="error"){v(k.errors[0]?.message??"Failed to update table sort."),j(!1);return}await b.invalidateQueries({queryKey:g.views.all(),exact:!1}),j(!1)};return e.jsxs(M,{flush:!0,className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border-subtle/75 px-4 py-3.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[l&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:l}),e.jsx("div",{className:"min-w-0",children:e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(K,{to:B,search:u,className:"truncate hover:text-fg-default/85",children:s.title})})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-elevated text-fg-secondary",children:Ie(s.displayType)}),s.tagNames.map((m,f)=>e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:A}),e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-secondary",children:m})]},m)),s.propertyFilters.map(m=>e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-subtle text-fg-secondary",children:Ke(m)},`${m.key}-${m.operator}-${m.value??""}`)),!F&&e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-tertiary",children:"All notes"})]})]}),e.jsx(re,{button:e.jsx(se,{label:"Section actions"}),items:[...o?[{name:"Move up",onClick:o}]:[],...d?[{name:"Move down",onClick:d}]:[],...o||d?[{type:"separator"}]:[],{name:"Edit section",onClick:i},{name:"Duplicate section",onClick:n},{type:"separator"},{name:"Delete section",onClick:c}]})]}),e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsx(ot,{section:s,notes:C,isPending:N,isError:R,onRetry:()=>{W()},onEdit:i,onSortChange:P,isSortPending:w})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/75 px-4 py-3",children:[e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:N?"Loading notes...":`Showing ${C.length} of ${q} notes`}),e.jsx(y,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(K,{to:B,search:u,children:"Open results"})})]})]})}const ct="group flex h-10 max-w-[72vw] shrink-0 items-center rounded-[12px] border transition-[background-color,border-color,color,box-shadow] sm:max-w-[176px]",dt="focus-ring-soft inline-flex h-full min-w-0 flex-1 touch-pan-x items-center gap-1 rounded-[11px] px-3 text-[13px] font-medium outline-none transition-colors";function mt({tab:s,isActive:i,onSelect:n}){const{attributes:c,listeners:o,setNodeRef:d,setActivatorNodeRef:l,transform:b,transition:v,isDragging:w}=ee({id:s.id});return e.jsx("div",{ref:d,style:{transform:te.Translate.toString(b),transition:v,opacity:w?.6:1},className:z(ct,i?"border-border-secondary/80 bg-elevated text-fg-default shadow-[0_8px_18px_-18px_rgba(15,18,24,0.28)]":"border-transparent bg-transparent text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default"),children:e.jsxs("button",{type:"button",ref:l,...c,...o,role:"tab","aria-selected":i,title:`${s.title}. Drag to reorder.`,className:z(dt,i?"text-fg-default":"text-fg-secondary group-hover:text-fg-default",w?"cursor-grabbing":"cursor-pointer"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:s.sections.length})]})})}function pt({tabs:s,activeTabId:i,onSelectTab:n,onReorderTabs:c,onCreateTab:o}){const d=G(E(ge,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:H}));return e.jsx("div",{className:"-mx-1 rounded-[16px] border border-border-subtle/75 bg-subtle/50 p-1 sm:mx-0",children:e.jsx(J,{sensors:d,collisionDetection:X,modifiers:[we],autoScroll:!1,onDragEnd:l=>{c(l)},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Z,{items:s.map(l=>l.id),strategy:ye,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden",children:s.map(l=>e.jsx(mt,{tab:l,isActive:l.id===i,onSelect:()=>{n(l)}},l.id))})}),e.jsxs(y,{type:"button","aria-label":"New view tab",variant:"ghost",size:"sm",className:"h-10 w-10 shrink-0 rounded-[12px] border-transparent bg-transparent px-0 text-[13px] text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default sm:w-auto sm:px-2.5",onClick:o,children:[e.jsx(L,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"hidden sm:inline",children:"New view tab"})]})]})})})}function ut({open:s,mode:i,initialTitle:n="",onClose:c,onSubmit:o}){const[d,l]=T.useState(n);return T.useEffect(()=>{s&&l(n)},[n,s]),e.jsxs(V,{isOpen:s,onClose:c,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(V.Header,{title:i==="create"?"Create view tab":"Rename view tab",onClose:c}),e.jsx(V.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:b=>{b.preventDefault(),o(d)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Ve,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(De,{id:"view-tab-title",value:d,onChange:b=>l(b.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(V.Footer,{children:e.jsxs(Te,{children:[e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Cancel"}),e.jsx(y,{type:"submit",size:"sm",form:"view-tab-form",children:i==="create"?"Create tab":"Save tab"})]})})]})}const xt="Save reusable note queries with tags, shared properties, and sorting.",ht="focus-ring-soft hidden h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default sm:inline-flex touch-none",bt=({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d})=>{const{attributes:l,listeners:b,setNodeRef:v,setActivatorNodeRef:w,transform:j,transition:u,isDragging:r}=ee({id:s.id});return e.jsx("div",{ref:v,style:{transform:te.Translate.toString(j),transition:u,opacity:r?.6:1},children:e.jsx(lt,{section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:e.jsx("button",{type:"button",ref:w,"aria-label":`Reorder section ${s.title}`,...l,...b,className:z(ht,r?"cursor-grabbing":"cursor-grab"),children:e.jsx(Se,{className:"size-4"})})})})};function Et(){const s=Ce(),i=ie(),n=ae(),[c,o]=T.useState(null),[d,l]=T.useState(null),{data:b,isPending:v,isError:w,refetch:j}=D({queryKey:g.views.workspace(),async queryFn(){const t=await ze();if(t.type==="error")throw t;return t.viewWorkspace}}),u=b??Le,r=Me(u),N=r?u.tabs.findIndex(t=>t.id===r.id):-1,{data:R,isPending:W}=D({queryKey:g.tags.list({limit:200}),async queryFn(){const t=await We({limit:200});if(t.type==="error")throw t;return t.allTags}}),C=G(E(ve,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:H})),q=R?.tags??[],{data:A,isPending:F}=D({queryKey:g.notes.propertyKeys({limit:100}),async queryFn(){const t=await Ee({limit:100});if(t.type==="error")throw t;return t.notePropertyKeys}}),P=A?.keys??[],m=t=>{n.setQueryData(g.views.workspace(),t)},f=async()=>{await n.invalidateQueries({queryKey:g.views.all(),exact:!1})},k=async(t,a)=>{m(a);const p=await Ze(a.tabs.map(x=>x.id));if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},le=async({active:t,over:a})=>{if(!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Qe(p,String(t.id),String(a.id));await k(p,x)},O=async t=>{if(!r)return;const a=n.getQueryData(g.views.workspace())??u,p=$e(a,r.id,t);p!==a&&await k(a,p)},ce=async t=>{const a=n.getQueryData(g.views.workspace())??u,p=_e(a,t.id);m(p);const x=await Ue(t.id);if(x.type==="error"){m(a),i(x.errors[0].message);return}m(x.setActiveViewTab)},Q=async(t,a)=>{if(!r)return;m(a);const p=await et(r.id,a.tabs.find(x=>x.id===r.id)?.sections.map(x=>x.id)??[]);if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},de=async({active:t,over:a})=>{if(!r||!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Be(p,r.id,String(t.id),String(a.id));await Q(p,x)},$=async(t,a)=>{if(!r)return;const p=n.getQueryData(g.views.workspace())??u,x=Ge(p,r.id,t,a);x!==p&&await Q(p,x)},me=async t=>{const a=await He(t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},pe=async t=>{if(!r)return;const a=await Ye(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},ue=async()=>{if(!r||!await s("Delete this view tab and all of its sections?"))return;const t=await Je(r.id);if(t.type==="error"){i(t.errors[0].message);return}await f()},xe=async t=>{if(!r)return;const a=await U(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},he=async t=>{if(!r||!d||d.mode!=="edit")return;const a=await ne(d.section.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},be=async t=>{const a=await U(t.tabId,{...oe(t),title:`${t.title} copy`});if(a.type==="error"){i(a.errors[0].message);return}await f(),i("Section duplicated.")},fe=async t=>{if(!r||!await s("Delete this section from the current view tab?"))return;const a=await Xe(t);if(a.type==="error"){i(a.errors[0].message);return}await f()};return e.jsxs(e.Fragment,{children:[e.jsx(Re,{title:"Views",description:xt,children:v&&!b?e.jsx(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{height:20,width:180,className:"rounded-full"}),e.jsx(I,{height:16,width:260,className:"rounded-full"}),e.jsx(I,{height:44,width:140,className:"rounded-[12px]"})]})}):w?e.jsxs(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j()},children:"Retry"})})]}):u.tabs.length===0?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_,{title:"Create your first view tab",description:"Start with a saved view tab, then add sections that query notes by tags, properties, or both.",className:"h-[320px]"}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(y,{type:"button",onClick:()=>o({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(pt,{tabs:u.tabs,activeTabId:r?.id??null,onSelectTab:ce,onReorderTabs:le,onCreateTab:()=>o({mode:"create"})}),r&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-border-subtle/80 px-1 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",truncate:!0,children:r.title}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:r.sections.length>0?`${r.sections.length} section${r.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 self-start sm:self-center",children:[e.jsxs(y,{type:"button",size:"sm",onClick:()=>l({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Add section"]}),e.jsx(re,{button:e.jsx(se,{label:"View tab actions"}),items:[...N>0?[{name:"Move tab left",onClick:()=>{O("previous")}}]:[],...N>=0&&N<u.tabs.length-1?[{name:"Move tab right",onClick:()=>{O("next")}}]:[],...u.tabs.length>1?[{type:"separator"}]:[],{name:"Rename tab",onClick:()=>o({mode:"edit",tab:r})},{type:"separator"},{name:"Delete tab",onClick:()=>{ue()}}]})]})]}),r.sections.length===0?e.jsx(_,{title:"Add the first section to this tab",description:"Sections can pull notes by tags, properties, or both.",className:"h-[300px]"}):e.jsx("div",{className:"flex flex-col",children:e.jsx(J,{sensors:C,collisionDetection:X,modifiers:[je],onDragEnd:de,children:e.jsx(Z,{items:r.sections.map(t=>t.id),strategy:Ne,children:e.jsx("div",{className:"flex flex-col gap-4",children:r.sections.map((t,a)=>e.jsx(bt,{section:t,onEdit:()=>l({mode:"edit",section:t}),onDuplicate:()=>{be(t)},onDelete:()=>{fe(t.id)},onMoveUp:a>0?()=>{$(t.id,"previous")}:void 0,onMoveDown:a<r.sections.length-1?()=>{$(t.id,"next")}:void 0},t.id))})})})})]})]})}),e.jsx(ut,{open:c!==null,mode:c?.mode??"create",initialTitle:c?.mode==="edit"?c.tab.title:"",onClose:()=>o(null),onSubmit:t=>{if(c?.mode==="edit"){pe(t);return}me(t)}}),e.jsx(Oe,{open:d!==null,mode:d?.mode??"create",initialSection:d?.mode==="edit"?d.section:null,availableTags:q,availableProperties:P,isTagsLoading:W,isPropertiesLoading:F,onClose:()=>l(null),onSubmit:t=>{if(d?.mode==="edit"){he(t);return}xe(t)}})]})}export{Et as default};
|
|
1
|
+
import{j as e,r as T}from"./floating-ui.react-dom-BWTnA00G.js";import{u as G,d as E,e as H,K as Y,M as ge,D as J,r as we,f as X,S as Z,h as ye,g as ee,C as te,P as ve,j as je,v as Ne,m as Se}from"./app-1lOWtkRA.js";import{t as ke,a as D,f as se,M as Te,u as Ce}from"./time-D5LRMumI.js";import{T as h,B as y,F as K,u as ae,q as g,G as re,e as ie,c as z,M as V,L as Ve,I as De,o as Ee,P as Re,l as I,E as _}from"./note.api-D3oJmG3q.js";import{f as We}from"./tag.api-DNSQpqwk.js";import{V as qe,e as Ae,a as Fe,h as Pe,i as Ie,b as Ke,u as ne,d as oe,j as ze,k as Me,E as Le,c as Oe,r as Qe,m as $e,s as _e,l as Ue,n as Be,o as Ge,p as He,q as Ye,t as Je,v as U,w as Xe,x as Ze,y as et}from"./ViewSectionDialog-DhH8harC.js";import{S as M}from"./SurfaceCard-t7pdfhEe.js";import{N as tt,V as B}from"./url-9nrbQs7Z.js";import{V as S}from"./ViewChip-DlCkL4z4.js";import{s as st}from"./ArrowRight.es-BEhnlwfe.js";import{n as L}from"./Plus.es-DRfLW_bI.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-LY_IgMYy.js";const at="group flex min-h-[64px] items-start justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-hover-subtle",rt=s=>{const i=s.tags.slice(0,2),n=s.tags.length-i.length;return i.length===0?null:e.jsxs(e.Fragment,{children:[i.map(c=>e.jsx(S,{size:"compact",className:"max-w-[116px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:c.name},c.id)),n>0&&e.jsxs(S,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function it({notes:s,isPending:i,isError:n,onRetry:c}){return i?e.jsxs("div",{className:"overflow-hidden bg-transparent",children:[e.jsx("div",{className:"h-[64px] animate-pulse bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"})]}):n?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Retry"})})]}):s.length===0?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):e.jsx("div",{className:"divide-y divide-border-subtle/70 bg-transparent",children:s.map(o=>e.jsxs(K,{to:tt,params:{id:o.id},className:at,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:o.title||"Untitled"}),e.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-wrap items-center gap-1.5",children:[e.jsxs(h,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"mr-0.5",children:["Updated ",ke(Number(o.updatedAt))]}),rt(o)]})]}),e.jsx(st,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5"})]},o.id))})}function nt({onEdit:s}){return e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-subtle/40 px-4 py-5",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"This display type is unavailable"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Switch this section to List or Table to preview the saved query here."}),e.jsx("div",{className:"mt-3",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:s,children:"Change display"})})]})}function ot({section:s,notes:i,isPending:n,isError:c,onRetry:o,onEdit:d,onSortChange:l,isSortPending:b}){return s.displayType==="table"?e.jsx(qe,{section:s,notes:i,isPending:n,isError:c,onRetry:o,onSortChange:l,isSortPending:b}):s.displayType==="calendar"?e.jsx(nt,{onEdit:d}):e.jsx(it,{notes:i,isPending:n,isError:c,onRetry:o})}function lt({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:l}){const b=ae(),v=ie(),[w,j]=T.useState(!1),u=Ae(s),{data:r,isPending:N,isError:R,refetch:W}=D({queryKey:g.views.sectionNotes(s.id,{limit:s.limit,offset:0}),async queryFn(){const m=await Fe(s.id,{limit:s.limit,offset:0});if(m.type==="error")throw m;return m.viewSectionNotes}}),C=r?.notes??[],q=r?.totalCount??0,A=Pe(s.mode),F=s.tagNames.length>0||s.propertyFilters.length>0,P=async m=>{if(w)return;const f=s.sortBy===m?s.sortOrder==="asc"?"desc":"asc":m==="title"?"asc":"desc";j(!0);const k=await ne(s.id,oe(s,{sortBy:m,sortOrder:f}));if(k.type==="error"){v(k.errors[0]?.message??"Failed to update table sort."),j(!1);return}await b.invalidateQueries({queryKey:g.views.all(),exact:!1}),j(!1)};return e.jsxs(M,{flush:!0,className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border-subtle/75 px-4 py-3.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[l&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:l}),e.jsx("div",{className:"min-w-0",children:e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(K,{to:B,search:u,className:"truncate hover:text-fg-default/85",children:s.title})})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-elevated text-fg-secondary",children:Ie(s.displayType)}),s.tagNames.map((m,f)=>e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:A}),e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-secondary",children:m})]},m)),s.propertyFilters.map(m=>e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-subtle text-fg-secondary",children:Ke(m)},`${m.key}-${m.operator}-${m.value??""}`)),!F&&e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-tertiary",children:"All notes"})]})]}),e.jsx(re,{button:e.jsx(se,{label:"Section actions"}),items:[...o?[{name:"Move up",onClick:o}]:[],...d?[{name:"Move down",onClick:d}]:[],...o||d?[{type:"separator"}]:[],{name:"Edit section",onClick:i},{name:"Duplicate section",onClick:n},{type:"separator"},{name:"Delete section",onClick:c}]})]}),e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsx(ot,{section:s,notes:C,isPending:N,isError:R,onRetry:()=>{W()},onEdit:i,onSortChange:P,isSortPending:w})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/75 px-4 py-3",children:[e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:N?"Loading notes...":`Showing ${C.length} of ${q} notes`}),e.jsx(y,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(K,{to:B,search:u,children:"Open results"})})]})]})}const ct="group flex h-10 max-w-[72vw] shrink-0 items-center rounded-[12px] border transition-[background-color,border-color,color,box-shadow] sm:max-w-[176px]",dt="focus-ring-soft inline-flex h-full min-w-0 flex-1 touch-pan-x items-center gap-1 rounded-[11px] px-3 text-[13px] font-medium outline-none transition-colors";function mt({tab:s,isActive:i,onSelect:n}){const{attributes:c,listeners:o,setNodeRef:d,setActivatorNodeRef:l,transform:b,transition:v,isDragging:w}=ee({id:s.id});return e.jsx("div",{ref:d,style:{transform:te.Translate.toString(b),transition:v,opacity:w?.6:1},className:z(ct,i?"border-border-secondary/80 bg-elevated text-fg-default shadow-[0_8px_18px_-18px_rgba(15,18,24,0.28)]":"border-transparent bg-transparent text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default"),children:e.jsxs("button",{type:"button",ref:l,...c,...o,role:"tab","aria-selected":i,title:`${s.title}. Drag to reorder.`,className:z(dt,i?"text-fg-default":"text-fg-secondary group-hover:text-fg-default",w?"cursor-grabbing":"cursor-pointer"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:s.sections.length})]})})}function pt({tabs:s,activeTabId:i,onSelectTab:n,onReorderTabs:c,onCreateTab:o}){const d=G(E(ge,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:H}));return e.jsx("div",{className:"-mx-1 rounded-[16px] border border-border-subtle/75 bg-subtle/50 p-1 sm:mx-0",children:e.jsx(J,{sensors:d,collisionDetection:X,modifiers:[we],autoScroll:!1,onDragEnd:l=>{c(l)},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Z,{items:s.map(l=>l.id),strategy:ye,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden",children:s.map(l=>e.jsx(mt,{tab:l,isActive:l.id===i,onSelect:()=>{n(l)}},l.id))})}),e.jsxs(y,{type:"button","aria-label":"New view tab",variant:"ghost",size:"sm",className:"h-10 w-10 shrink-0 rounded-[12px] border-transparent bg-transparent px-0 text-[13px] text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default sm:w-auto sm:px-2.5",onClick:o,children:[e.jsx(L,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"hidden sm:inline",children:"New view tab"})]})]})})})}function ut({open:s,mode:i,initialTitle:n="",onClose:c,onSubmit:o}){const[d,l]=T.useState(n);return T.useEffect(()=>{s&&l(n)},[n,s]),e.jsxs(V,{isOpen:s,onClose:c,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(V.Header,{title:i==="create"?"Create view tab":"Rename view tab",onClose:c}),e.jsx(V.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:b=>{b.preventDefault(),o(d)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Ve,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(De,{id:"view-tab-title",value:d,onChange:b=>l(b.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(V.Footer,{children:e.jsxs(Te,{children:[e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Cancel"}),e.jsx(y,{type:"submit",size:"sm",form:"view-tab-form",children:i==="create"?"Create tab":"Save tab"})]})})]})}const xt="Save reusable note queries with tags, shared properties, and sorting.",ht="focus-ring-soft hidden h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default sm:inline-flex touch-none",bt=({section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d})=>{const{attributes:l,listeners:b,setNodeRef:v,setActivatorNodeRef:w,transform:j,transition:u,isDragging:r}=ee({id:s.id});return e.jsx("div",{ref:v,style:{transform:te.Translate.toString(j),transition:u,opacity:r?.6:1},children:e.jsx(lt,{section:s,onEdit:i,onDuplicate:n,onDelete:c,onMoveUp:o,onMoveDown:d,dragHandle:e.jsx("button",{type:"button",ref:w,"aria-label":`Reorder section ${s.title}`,...l,...b,className:z(ht,r?"cursor-grabbing":"cursor-grab"),children:e.jsx(Se,{className:"size-4"})})})})};function Et(){const s=Ce(),i=ie(),n=ae(),[c,o]=T.useState(null),[d,l]=T.useState(null),{data:b,isPending:v,isError:w,refetch:j}=D({queryKey:g.views.workspace(),async queryFn(){const t=await ze();if(t.type==="error")throw t;return t.viewWorkspace}}),u=b??Le,r=Me(u),N=r?u.tabs.findIndex(t=>t.id===r.id):-1,{data:R,isPending:W}=D({queryKey:g.tags.list({limit:200}),async queryFn(){const t=await We({limit:200});if(t.type==="error")throw t;return t.allTags}}),C=G(E(ve,{activationConstraint:{distance:8}}),E(Y,{coordinateGetter:H})),q=R?.tags??[],{data:A,isPending:F}=D({queryKey:g.notes.propertyKeys({limit:100}),async queryFn(){const t=await Ee({limit:100});if(t.type==="error")throw t;return t.notePropertyKeys}}),P=A?.keys??[],m=t=>{n.setQueryData(g.views.workspace(),t)},f=async()=>{await n.invalidateQueries({queryKey:g.views.all(),exact:!1})},k=async(t,a)=>{m(a);const p=await Ze(a.tabs.map(x=>x.id));if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},le=async({active:t,over:a})=>{if(!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Qe(p,String(t.id),String(a.id));await k(p,x)},O=async t=>{if(!r)return;const a=n.getQueryData(g.views.workspace())??u,p=$e(a,r.id,t);p!==a&&await k(a,p)},ce=async t=>{const a=n.getQueryData(g.views.workspace())??u,p=_e(a,t.id);m(p);const x=await Ue(t.id);if(x.type==="error"){m(a),i(x.errors[0].message);return}m(x.setActiveViewTab)},Q=async(t,a)=>{if(!r)return;m(a);const p=await et(r.id,a.tabs.find(x=>x.id===r.id)?.sections.map(x=>x.id)??[]);if(p.type==="error"){m(t),i(p.errors[0].message);return}await f()},de=async({active:t,over:a})=>{if(!r||!a||t.id===a.id)return;const p=n.getQueryData(g.views.workspace())??u,x=Be(p,r.id,String(t.id),String(a.id));await Q(p,x)},$=async(t,a)=>{if(!r)return;const p=n.getQueryData(g.views.workspace())??u,x=Ge(p,r.id,t,a);x!==p&&await Q(p,x)},me=async t=>{const a=await He(t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},pe=async t=>{if(!r)return;const a=await Ye(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),o(null)},ue=async()=>{if(!r||!await s("Delete this view tab and all of its sections?"))return;const t=await Je(r.id);if(t.type==="error"){i(t.errors[0].message);return}await f()},xe=async t=>{if(!r)return;const a=await U(r.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},he=async t=>{if(!r||!d||d.mode!=="edit")return;const a=await ne(d.section.id,t);if(a.type==="error"){i(a.errors[0].message);return}await f(),l(null)},be=async t=>{const a=await U(t.tabId,{...oe(t),title:`${t.title} copy`});if(a.type==="error"){i(a.errors[0].message);return}await f(),i("Section duplicated.")},fe=async t=>{if(!r||!await s("Delete this section from the current view tab?"))return;const a=await Xe(t);if(a.type==="error"){i(a.errors[0].message);return}await f()};return e.jsxs(e.Fragment,{children:[e.jsx(Re,{title:"Views",description:xt,children:v&&!b?e.jsx(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{height:20,width:180,className:"rounded-full"}),e.jsx(I,{height:16,width:260,className:"rounded-full"}),e.jsx(I,{height:44,width:140,className:"rounded-[12px]"})]})}):w?e.jsxs(M,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j()},children:"Retry"})})]}):u.tabs.length===0?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_,{title:"Create your first view tab",description:"Start with a saved view tab, then add sections that query notes by tags, properties, or both.",className:"h-[320px]"}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(y,{type:"button",onClick:()=>o({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(pt,{tabs:u.tabs,activeTabId:r?.id??null,onSelectTab:ce,onReorderTabs:le,onCreateTab:()=>o({mode:"create"})}),r&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-border-subtle/80 px-1 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(h,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",truncate:!0,children:r.title}),e.jsx(h,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:r.sections.length>0?`${r.sections.length} section${r.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 self-start sm:self-center",children:[e.jsxs(y,{type:"button",size:"sm",onClick:()=>l({mode:"create"}),children:[e.jsx(L,{className:"h-4 w-4"}),"Add section"]}),e.jsx(re,{button:e.jsx(se,{label:"View tab actions"}),items:[...N>0?[{name:"Move tab left",onClick:()=>{O("previous")}}]:[],...N>=0&&N<u.tabs.length-1?[{name:"Move tab right",onClick:()=>{O("next")}}]:[],...u.tabs.length>1?[{type:"separator"}]:[],{name:"Rename tab",onClick:()=>o({mode:"edit",tab:r})},{type:"separator"},{name:"Delete tab",onClick:()=>{ue()}}]})]})]}),r.sections.length===0?e.jsx(_,{title:"Add the first section to this tab",description:"Sections can pull notes by tags, properties, or both.",className:"h-[300px]"}):e.jsx("div",{className:"flex flex-col",children:e.jsx(J,{sensors:C,collisionDetection:X,modifiers:[je],onDragEnd:de,children:e.jsx(Z,{items:r.sections.map(t=>t.id),strategy:Ne,children:e.jsx("div",{className:"flex flex-col gap-4",children:r.sections.map((t,a)=>e.jsx(bt,{section:t,onEdit:()=>l({mode:"edit",section:t}),onDuplicate:()=>{be(t)},onDelete:()=>{fe(t.id)},onMoveUp:a>0?()=>{$(t.id,"previous")}:void 0,onMoveDown:a<r.sections.length-1?()=>{$(t.id,"next")}:void 0},t.id))})})})})]})]})}),e.jsx(ut,{open:c!==null,mode:c?.mode??"create",initialTitle:c?.mode==="edit"?c.tab.title:"",onClose:()=>o(null),onSubmit:t=>{if(c?.mode==="edit"){pe(t);return}me(t)}}),e.jsx(Oe,{open:d!==null,mode:d?.mode??"create",initialSection:d?.mode==="edit"?d.section:null,availableTags:q,availableProperties:P,isTagsLoading:W,isPropertiesLoading:F,onClose:()=>l(null),onSubmit:t=>{if(d?.mode==="edit"){he(t);return}xe(t)}})]})}export{Et as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BR83066I.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/note.api-D3oJmG3q.js","assets/url-9nrbQs7Z.js","assets/time-D5LRMumI.js","assets/Callout-BTd1BYtV.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-LY_IgMYy.js","assets/Views-DMizFO-d.js","assets/tag.api-DNSQpqwk.js","assets/ViewSectionDialog-DhH8harC.js","assets/ViewChip-DlCkL4z4.js","assets/SurfaceCard-t7pdfhEe.js","assets/ArrowRight.es-BEhnlwfe.js","assets/Plus.es-DRfLW_bI.js","assets/Reminders-COr1OHvF.js","assets/useReminderMutate-BrGO9M0o.js","assets/Graph-DYUb7gQb.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/Search-BqPROwkA.js","assets/AuxiliaryPanelHeader-B1k7pZpn.js","assets/search-admin-adapter-CJnJmL6w.js","assets/File.es-Ct7fscBg.js","assets/Tag-C4fNi3KQ.js","assets/Note-DnXDfDTk.js","assets/NotePropertiesPanel-CsaNhRnE.js","assets/note-ui-CtijppHK.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/note-ui-DL8owV-U.css","assets/image.api-CyQisInP.js","assets/Copy.es-BoLjilxv.js","assets/PencilLine.es-0JpEgxFY.js","assets/TagNotes-BXgkwXMd.js","assets/ViewNotes-BJPiV66I.js","assets/index-BBzpADtD.js","assets/mcp-admin-adapter-PMmgPupc.js","assets/Image.es-OYyN3BYt.js","assets/Trash.es-Bo1VyK9Q.js","assets/mcp-CCaFd0zm.js","assets/search-D-xKTPdO.js","assets/trash-X_dnKA9T.js","assets/manage-image-azmo5iVw.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-ojV6kSsu.js","assets/properties-BrNJLkxR.js","assets/placeholder-DR75IAi_.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{j as p,r as u,b as K,a as lt}from"./floating-ui.react-dom-BWTnA00G.js";import{v as Ss,x as Rs,y as Es,z as Cs,A as Ps,l as _s,u as Ls,a as Ms,b as As,e as Jo,o as Is,s as Ts,j as Ds,n as Ns,d as ho,t as js,m as Os,f as ks,R as Vs}from"./time-D5LRMumI.js";import{ao as Ze,ap as gt,aq as ee,ar as q,as as vt,at as Ke,au as er,av as Fs,aw as Hs,ax as Bs,ay as Zs,az as $s,aA as zs,aB as Us,aC as $e,aD as fo,aE as Ks,aF as mn,aG as Gs,aH as po,aI as se,aJ as mo,aK as at,aL as Ws,aM as qs,aN as Rt,aO as Xs,aP as O,aQ as go,aR as Ys,aS as Qs,aT as Js,aU as ea,af as we,ab as On,aV as ta,aW as vo,aX as fe,aY as gn,aZ as Nt,a_ as kn,a$ as na,b0 as oa,A as Et,f as Ge,u as Vn,b1 as ra,b2 as sa,b3 as aa,b4 as ia,T as te,x as vn,b5 as tr,y as it,b6 as nr,b7 as ca,L as la,D as ua,c as ae,g as Fn,H as da,q as bt,e as ha,i as or,Q as rr,an as fa,l as ut,F as zt,b8 as pa,a0 as ma,aj as ga,G as va,h as ba,P as ya,k as xa,E as wa,b9 as Sa,ba as Ra,bb as Ea,bc as H,$ as Cn,bd as bo,be as Ca}from"./note.api-D3oJmG3q.js";import{_ as Z}from"./preload-helper-BXl3LOEh.js";import{g as Ct,N as Hn,H as tn,c as sr,G as ar,C as ir,R as cr,b as lr,j as ur,T as dr,V as Pa,h as _a,i as La,S as Ma,e as Aa,d as Ia,f as Ta,a as Da}from"./url-9nrbQs7Z.js";import{f as hr,G as Na}from"./Graph-LY_IgMYy.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 Bn={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},fr=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Zn=(e,t,n=!0)=>{const o=fr(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},ja=(e,t=!0)=>Zn(Bn.DARK,e,t),Oa=(e,t,n=!0)=>Zn(Bn.RESPONSIVE(e),t,n),ka={MEDIA_QUERY:Bn,listenThemeChange:ja,listenResponsiveChange:Oa,createMediaQuery:fr,listenMediaQueryChange:Zn};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 pr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,d,h){const f=d.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===c){m.version=h,d.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===d)return;const v=d.depsTail=c.subsTail={version:h,dep:c,sub:d,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:d.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,d=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:d.depsTail=f,f!==void 0?f.nextDep=m:d.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 d=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:d,prev:h},d=v);continue}}if((c=d)!==void 0){d=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){d=c.nextSub;continue e}break}while(!0)}function a(c,d){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(d.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,d=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=d.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(d)){y&&i(b),d=c.sub;continue}m=!1}else d.flags&=-33;d=c.sub;const w=c.nextDep;if(w!==void 0){c=w;continue e}}return m}while(!0)}function i(c){do{const d=c.sub,h=d.flags;(h&48)===32&&(d.flags=h|16,(h&6)===2&&t(d))}while((c=c.nextSub)!==void 0)}function l(c,d){let h=d.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let $n=0,De=0,dt=0;const xe=[],{link:Dd,unlink:mr,propagate:Nd,checkDirty:Va,shallowPropagate:jd}=pr({update(e){return e.depsTail!==void 0?Za(e):$a(e)},notify(e){let t=dt,n=t;do if(xe[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(dt=t;n<--t;){const o=xe[n];xe[n++]=xe[t],xe[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,nn(e)):Ka.call(e)}});function Fa(){return $n}function Ha(){++$n}function Ba(){--$n||Ua()}function Za(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,nn(e)}}function $a(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function za(e){const t=e.flags;if(t&16||t&32&&Va(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,nn(e)}}else e.flags=2}function Ua(){try{for(;De<dt;){const e=xe[De];xe[De++]=void 0,za(e)}}finally{for(;De<dt;){const e=xe[De];xe[De++]=void 0,e.flags|=10}De=0,dt=0}}function Ka(){this.depsTail=void 0,this.flags=0,nn(this);const e=this.subs;e!==void 0&&mr(e)}function nn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=mr(n,e)}function zn(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 Pn=[];let Bt=0;const{link:yo,unlink:Ga,propagate:Wa,checkDirty:gr,shallowPropagate:xo}=pr({update(e){return e._update()},notify(e){Pn[_n++]=e,e.flags&=~N.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=N.Mutable|N.Dirty,Ut(e))}});let jt=0,_n=0,he;function Ut(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Ga(n,e)}function vr(){if(!(Fa()>0)){for(;jt<_n;){const e=Pn[jt];Pn[jt++]=void 0,e.notify()}jt=0,_n=0}}function br(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 he!==void 0&&yo(r,he,Bt),r._snapshot},subscribe(s){const a=zn(s),i={current:!1},l=qa(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=he,i=Object.is;if(n)he=r,++Bt,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{he=a,n&&(r.flags&=~N.RecursedCheck),Ut(r)}}};return n?(r.flags=N.Mutable|N.Dirty,r.get=function(){const s=r.flags;if(s&N.Dirty||s&N.Pending&&gr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&xo(a)}}else s&N.Pending&&(r.flags=s&~N.Pending);return he!==void 0&&yo(r,he,Bt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(Wa(a),xo(a),vr())}},r}function qa(e){const t=()=>{const o=he;he=n,++Bt,n.depsTail=void 0,n.flags=N.Watching|N.RecursedCheck;try{return e()}finally{he=o,n.flags&=~N.RecursedCheck,Ut(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&&gr(this.deps,this)?t():this.flags=N.Watching},stop(){this.flags=N.None,this.depsTail=void 0,Ut(this)}};return t(),n}class Xa{constructor(t){this.atom=br(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}class Ya{constructor(t){this.atom=br(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}function Qa(e){return typeof e=="function"?new Ya(e):new Xa(e)}function Ja(e){try{Ha(),e()}finally{Ba(),vr()}}const Ae="__TSR_index",wo="popstate",So="beforeunload";function ei(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 d=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const f of d){const m=Kt(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[Ae];i=Ro(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[Ae];i=Ro(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[Ae]!==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 Ro(e,t){t||(t={});const n=Un();return{...t,key:n,__TSR_key:n,[Ae]:e}}function ti(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=(()=>Kt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=Un();t.history.replaceState({[Ae]:0,key:x,__TSR_key:x},"")}let c=l(),d,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,d=void 0)},R=(x,C,I)=>{const _=i(C);y||(d=c),c=Kt(C,I),b={href:_,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{c=l(),E.notify({type:x})},P=async()=>{if(f){f=!1;return}const x=l(),C=x.state[Ae]-c.state[Ae],I=C===1,_=C===-1,M=!I&&!_||h;h=!1;const U=M?"GO":_?"BACK":"FORWARD",D=M?{type:"GO",index:C}:{type:_?"BACK":"FORWARD"};if(m)m=!1;else{const ce=s();if(typeof document<"u"&&ce.length){for(const G of ce)if(await G.blockerFn({currentLocation:c,nextLocation:x,action:U})){f=!0,t.history.go(1),E.notify(D);return}}}c=l(),E.notify(D)},L=x=>{if(g){g=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const _ of I){const M=_.enableBeforeUnload??!0;if(M===!0){C=!0;break}if(typeof M=="function"&&M()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=ei({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(So,L,{capture:!0}),t.removeEventListener(wo,P)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(So,L,{capture:!0}),t.addEventListener(wo,P),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 ni(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Kt(e,t){const n=ni(e),o=n.indexOf("#"),r=n.indexOf("?"),s=Un();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||{[Ae]:0,key:s,__TSR_key:s}}}function Un(){return(Math.random()+1).toString(36).substring(7)}const oi=!1;function ht(e){let t;return Ja(()=>{t=e()}),t}function ri(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ln="tsr-scroll-restoration-v1_3",si=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function ai(){const e=ri();if(!e)return null;const t=e.getItem(Ln);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=Ze(o,n)||n;try{e.setItem(Ln,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ot=ai(),ii=e=>e.state.__TSR_key||e.href;function ci(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 Gt=!1;function li({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];Gt=!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 d={top:0,left:0,behavior:n};if(window.scrollTo(d),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(d)}}Gt=!1}function ui(e,t){if(!Ot||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ot))return;e.isScrollRestorationSetup=!0,Gt=!1;const o=e.options.getScrollRestorationKey||ii;window.history.scrollRestoration="manual";const r=s=>{if(Gt||!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=ci(s.target)}const i=o(e.state.location);Ot.set(l=>{const c=l[i]||={},d=c[a]||={};if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",si(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})||(li({storageKey:Ln,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ot.set(i=>(i[a]||={},i)))})}function di(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 hi(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 bn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function fi(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=bn(r):Array.isArray(s)?s.push(bn(r)):n[o]=[s,bn(r)]}return n}const pi=gi(JSON.parse),mi=vi(JSON.stringify,JSON.parse);function gi(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=fi(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function vi(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=hi(r,o);return s?`?${s}`:""}}const Mn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},on=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),ze=(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},Eo=(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},Me=(e,t,n)=>{if(!(!ee(n)&&!q(n)))throw ee(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:ee(n)?"redirected":o.status==="pending"?"success":o.status,context:ze(e,t.index),isFetching:!1,error:n})),q(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ee(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},yr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ct=(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,Me(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Me(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&&!ee(n)&&!q(n)&&(e.serialError??=n)},xr=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!on(e,t)&&(n.options.loader||n.options.beforeLoad||Sr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{Mn(e)},r);o._nonReactive.pendingTimeout=a}},bi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;xr(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Me(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},yi=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ke(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&ct(e,n,a,"PARSE_PARAMS"),i&&ct(e,n,i,"VALIDATE_SEARCH"),xr(e,t,o,r);const l=new AbortController;let c=!1;const d=()=>{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){ht(()=>{d(),h()});return}r._nonReactive.beforeLoadPromise=Ke();const f={...ze(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=on(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){ht(()=>{d(),h()});return}(ee(S)||q(S))&&(d(),ct(e,n,S,"BEFORE_LOAD")),ht(()=>{d(),e.updateMatch(t,P=>({...P,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),gt(R))return d(),R.catch(S=>{ct(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){d(),ct(e,n,S,"BEFORE_LOAD")}w(R)},xi=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>yi(e,n,t,r),i=()=>{if(yr(e,n))return;const l=bi(e,n,r);return gt(l)?l.then(a):a()};return s()},wi=(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,d=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:d,headers:i,scripts:a,styles:h}})},wr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),d=ze(e,o),h=on(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Co=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(oi??e.router.isServer)||s.ssr===!0)&&Wt(r);const a=r.options.loader?.(wr(e,t,n,o,r)),i=r.options.loader&>(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,d=>({...d,isFetching:"loader"})),r.options.loader){const d=i?await a:a;Me(e,e.router.getMatch(n),d),d!==void 0&&e.updateMatch(n,h=>({...h,loaderData:d}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,d=>({...d,error:void 0,context:ze(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:ze(e,o)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,q(a)&&await r.options.notFoundComponent?.preload?.(),Me(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Me(e,e.router.getMatch(n),c)}e.updateMatch(n,c=>({...c,error:i,context:ze(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Me(e,a,s)}},Si=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(wr(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 Co(e,t,r,n,g);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){ee(P)&&await e.router.navigate(P.options)}})()):(R!=="success"||a&&e.sync)&&await Co(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(!yr(e,r)){const h=e.router.getMatch(r),f=on(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&&Me(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=Ke(),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 d=i?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(r)):c};async function Po(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&Mn(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=xi(t,f);gt(m)&&await m}catch(m){if(ee(m))throw m;if(q(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?Eo(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(Si(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(ee(g))throw g;q(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=Eo(t,c);vt(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})),d=f,await Wt(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 Wt(f)}for(let f=0;f<=d;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=wi(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=Mn(t);if(gt(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Wt(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 Rr){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 Sr(e){for(const t of Rr)if(e.options[t]?.preload)return!0;return!1}const Rr=["component","errorComponent","pendingComponent","notFoundComponent"];function Ri(e){return{input:({url:t})=>{for(const n of e)t=An(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Er(e[n],t);return t}}}function Ei(e){const t=er(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=Fs(["/",t,a.pathname]),a)}}function An(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 Er(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 Ne(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 Ci(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class Pi{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=Hs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ti()),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=Bs(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=Qa(Li(this.latestLocation)),ui(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=er(l);m&&m!=="/"&&f.push(Ei({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Ri(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=Zs(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&$s(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:d,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+d,publicHref:h,pathname:at(l).path,external:!1,searchStr:R,search:se(o?.search,w),hash:at(d.slice(1)).path,state:se(o?.state,f)}}const m=new URL(h,this.origin),g=An(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:at(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:se(o?.search,v),hash:at(g.hash.slice(1)).path,state:se(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)=>zs({base:n,to:Us(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=>Mi({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,"."),d=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 _ of v){const M=_.options.params?.stringify??_.options.stringifyParams;if(M)try{Object.assign(m,M(m))}catch{}}const y=n.leaveParams?f:at(po({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=d;if(n._includeValidateSearch&&this.options.search?.strict){const _={};v.forEach(M=>{if(M.options.validateSearch)try{Object.assign(_,Zt(M.options.validateSearch,{..._,...w}))}catch{}}),w=_}w=Ai({search:w,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),w=se(d,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?Ze(s.hash,a.hash):void 0,P=S?`#${S}`:"";let L=s.state===!0?a.state:s.state?Ze(s.state,a.state):{};L=se(a.state,L);const E=`${y}${R}${P}`;let x,C,I=!1;if(this.rewrite){const _=new URL(E,this.origin),M=Er(this.rewrite,_);x=_.href.replace(_.origin,""),M.origin!==this.origin?(C=M.href,I=!0):C=M.pathname+M.search+M.hash}else x=Xs(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:L,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 d=Ws(i.pathname,this.processedTree);if(d){Object.assign(c,d.rawParams);const{from:h,params:f,...m}=d.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(d=>{r.state[d]=this.latestLocation.state[d]});const c=mn(r.state,this.latestLocation.state);return l.forEach(d=>{delete r.state[d]}),c},a=$e(this.latestLocation.href)===$e(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Ke(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...d}=r;l&&(d={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](d.publicHref,d.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=Kt(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=An(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 d=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),d},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(fo(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)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",...Ne({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...Ne({resolvedLocation:c,location:l})}),await Po({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],f=[],m=[];ht(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return d=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,...d.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){ee(l)?(o=l,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):q(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(d=>d.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(Ne({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:Ci(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&&fo(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=Wt,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)]);ht(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return r=await Po({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(ee(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});q(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=Ks(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!mn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?mn(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??mi,parseSearch:t.parseSearch??pi,protocolAllowlist:t.protocolAllowlist??Gs}),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["**"]:$e(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?Ti(this.options.notFoundMode,i):void 0,d=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=d[f-1];let v,b,y;{const D=g?.search??t.search,ce=g?._strictSearch??void 0;try{const G=Zt(m.options.validateSearch,{...D})??void 0;v={...D,...G},b={...ce,...G},y=void 0}catch(G){let V=G;if(G instanceof qt||(V=new qt(G.message,{cause:G})),n?.throwOnError)throw V;v=D,b={},y=V}}const w=m.options.loaderDeps?.({search:v})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:P}=po({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),L=m.id+S+R,E=this.getMatch(L),x=h.get(m.id),C=E?._strictParams??P;let I;if(!E)try{_o(m,P,a,C)}catch(D){if(q(D)||ee(D)?I=D:I=new _i(D.message,{cause:D}),n?.throwOnError)throw I}Object.assign(s,C);const _=x?"stay":"enter";let M;if(E)M={...E,cause:_,params:x?.params??s,_strictParams:C,search:x?se(x.search,v):se(E.search,v),_strictSearch:b};else{const D=m.options.loader||m.options.beforeLoad||m.lazyFn||Sr(m)?"pending":"success";M={id:L,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?se(x.search,v):v,_strictSearch:b,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ke()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:_,loaderDeps:x?se(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||(M.globalNotFound=c===m.id),M.searchError=y;const U=this.getParentContext(g);M.context={...U,...M.__routeContext,...M.__beforeLoadContext},d[f]=M}for(let f=0;f<d.length;f++){const m=d[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?se(b.params,s):s,!v){const y=d[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:d,routeId:g.id};m.__routeContext=g.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=mo(n),a={...t.search};for(const d of n)try{Object.assign(a,Zt(d.options.validateSearch,a))}catch{}const i=mo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const d={...o};for(const h of n)try{_o(h,o,r??{},d)}catch{}c=d}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class qt extends Error{}class _i extends Error{}function Li(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Zt(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 Mi({pathname:e,routesById:t,processedTree:n}){const o={},r=$e(e);let s,a;const i=qs(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Rt]],routeParams:o,foundRoute:s,parsedParams:a}}function Ai({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Ii(n)(e,t,o??!1)}function Ii(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((d,h)=>h(d),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((d,h)=>h(d),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,...Zt(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 Ti(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 Rt}function _o(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 Kn(e){const t=e.errorComponent??Gn;return p.jsx(Di,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?u.createElement(t,{error:n,reset:o}):e.children})}class Di extends u.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 Gn({error:e}){const[t,n]=u.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 Lo(e){return typeof e=="object"?new Mo(e,{silent:!0}).createRoute(e):new Mo(e,{silent:!0}).createRoute}class Mo{constructor(t,n){this.path=t,this.createRoute=o=>{const r=O(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Ao{constructor(t){this.useMatch=n=>go({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>go({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ys({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Qs({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Js({...n,from:this.options.id}),this.useLoaderData=n=>ea({...n,from:this.options.id}),this.useNavigate=()=>{const n=we();return On({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Io(e){return typeof e=="object"?new Ao(e):t=>new Ao({id:e,...t})}function $(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,ta(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(vo)vo(a());else throw a();return u.createElement(o,c)};return i.preload=a,i}function Ni(){const e=we(),t=u.useRef({router:e,mounted:!1}),[n,o]=u.useState(!1),{hasPendingMatches:r,isLoading:s}=fe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=gn(s),i=s||n||r,l=gn(i),c=s||r,d=gn(c);return e.startTransition=h=>{o(!0),u.startTransition(()=>{h(),o(!1)})},u.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 $e(e.latestLocation.publicHref)!==$e(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Nt(()=>{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]),Nt(()=>{a&&!s&&e.emit({type:"onLoad",...Ne(e.state)})},[a,e,s]),Nt(()=>{d&&!c&&e.emit({type:"onBeforeRouteMount",...Ne(e.state)})},[c,d,e]),Nt(()=>{if(l&&!i){const h=Ne(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&di(e)}},[i,l,e]),null}function ji(e){const t=fe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Kn,{getResetKey:()=>t,onCatch:(n,o)=>{if(q(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(q(n))return e.fallback?.(n);throw n},children:e.children})}function Oi(){return p.jsx("p",{children:"Not Found"})}function Be(e){return p.jsx(p.Fragment,{children:e.children})}function Cr(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Oi,{})}function ki(){return we().isScrollRestoring,null}const Pr=u.memo(function({matchId:t}){const n=we(),o=fe({select:v=>{const b=v.matches.findIndex(w=>w.id===t),y=v.matches[b];return vt(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,d=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||d)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||d))?u.Suspense:Be,f=i?Kn:Be,m=c?ji:Be,g=r.isRoot?r.options.shellComponent??Be:Be;return p.jsxs(g,{children:[p.jsx(kn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||Gn,onCatch:(v,b)=>{if(q(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 u.createElement(c,v)},children:d||o._displayPending?p.jsx(na,{fallback:a,children:p.jsx(To,{matchId:t})}):p.jsx(To,{matchId:t})})})})}),o.parentRouteId===Rt&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Vi,{}),p.jsx(ki,{})]}):null]})});function Vi(){const e=we(),t=u.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",...Ne(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const To=u.memo(function({matchId:t}){const n=we(),{match:o,key:r,routeId:s}=fe({select:l=>{const c=l.matches.find(g=>g.id===t),d=c.routeId,f=(n.routesById[d].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:d,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:d,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=u.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(_r,{})},[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 d=Ke();c._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return vt(q(o.error)),Cr(n,a,o.error);if(o.status==="redirected")throw vt(ee(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),_r=u.memo(function(){const t=we(),n=u.useContext(kn),o=fe({select:c=>c.matches.find(d=>d.id===n)?.routeId}),r=t.routesById[o],s=fe({select:c=>{const h=c.matches.find(f=>f.id===n);return vt(h),h.globalNotFound}}),a=fe({select:c=>{const d=c.matches,h=d.findIndex(f=>f.id===n);return d[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Cr(t,r,void 0);if(!a)return null;const l=p.jsx(Pr,{matchId:a});return o===Rt?p.jsx(u.Suspense,{fallback:i,children:l}):l});function Fi(){const e=we(),n=e.routesById[Rt].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?Be:u.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Ni,{}),p.jsx(Hi,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function Hi(){const e=we(),t=fe({select:r=>r.matches[0]?.id}),n=fe({select:r=>r.loadedAt}),o=t?p.jsx(Pr,{matchId:t}):null;return p.jsx(kn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Kn,{getResetKey:()=>n,errorComponent:Gn,onCatch:void 0,children:o})})}const Bi=e=>new Zi(e);class Zi extends Pi{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Lo,globalThis.createLazyFileRoute=Io):typeof window<"u"&&(window.createFileRoute=Lo,window.createLazyFileRoute=Io);function $i({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(oa.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function zi({router:e,...t}){return p.jsx($i,{router:e,...t,children:p.jsx(Fi,{})})}function rn(e){return fe({select:t=>e?.select?e.select(t.location):t.location})}const Ui=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Ki=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Gi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Wi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),qi=new Map([["bold",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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",u.createElement(u.Fragment,null,u.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"}))]]),Lr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Ui}));Lr.displayName="CalendarIcon";const Xi=Lr,Mr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Ki}));Mr.displayName="DotsSixVerticalIcon";const Yi=Mr,Ar=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Gi}));Ar.displayName="GridFourIcon";const Ir=Ar,Tr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Wi}));Tr.displayName="PencilSimpleIcon";const Qi=Tr,Dr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:qi}));Dr.displayName="SortAscendingIcon";const Ji=Dr,Wn="/login",ec="/api/auth/";let Do=!1;const tc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Wn}?next=${encodeURIComponent(t)}`},nc=e=>{if(!Ge.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(ec)&&t!==Wn},Nr=(e=window.location)=>{Do||e.pathname===Wn||(Do=!0,e.assign(tc(e)))},oc="X-Ocean-Brain-Session-Generation";let No=!1,kt;const rc=e=>!!(e.authRequired&&!e.authenticated),sc=e=>{const t=e.headers.get(oc);return t?kt?kt===t?!1:(kt=t,!0):(kt=t,!1):!1},ac=(e=window.location)=>{No||(No=!0,e.reload())},Xt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=sc(t),o=await t.json();return rc(o)?(Nr(),"expired"):n?(ac(),"reloading"):"active"},ic=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Es(t.data);!n||n.type!==e||Cs(n)},cc=()=>{const e=Vn();return u.useEffect(()=>Ss(t=>{Ps(e,t)}),[e]),u.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Xt()},r=()=>{n&&(n=!1,Xt())},s=Rs.map(a=>{const i=ic(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},lc=({children:e})=>p.jsx(ra,{client:sa,children:p.jsx(aa,{children:p.jsxs(ia,{children:[p.jsx(cc,{}),e]})})}),jo=({children:e,fallback:t})=>e||t;function uc({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(Ir,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(te,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(vn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);ca(c)&&t(c)},variant:"ghost",size:"sm",children:tr.map(l=>p.jsx(it,{value:String(l),children:l===nr?`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(Ji,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(te,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(vn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(it,{value:"updatedAt",children:"Updated"}),p.jsx(it,{value:"createdAt",children:"Created"})]}),p.jsxs(vn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(it,{value:"desc",children:"Newest"}),p.jsx(it,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(la,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(ua,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const dc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},yn=new Map;function hc(){const e=rn({select:n=>n.pathname}),t=u.useRef(null);return u.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){yn.set(e,s);return}yn.delete(e)},r=dc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=yn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const fc=()=>null,pc=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,mc=()=>{const e=On();return u.useEffect(()=>{const t=n=>{n.defaultPrevented||!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!=="k"||pc(n.target)||(n.preventDefault(),e({to:Ct,search:{query:"",page:1,mode:"hybrid"}}))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),null},gc="flex h-dvh min-h-0 w-full flex-row overflow-hidden",vc=ae("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"),bc=ae("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","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),yc="pointer-events-none -translate-x-full",xc="pointer-events-auto translate-x-0",wc=ae("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),Sc=ae("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),Rc=ae("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Ec=ae("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-md:after:h-24"),Cc=({sidebar:e,topNavigation:t,children:n})=>{const o=rn({select:i=>i.pathname}),[r,s]=u.useState(!1),a="site-layout-sidebar";return u.useEffect(()=>{s(!1)},[o]),p.jsxs("div",{className:gc,children:[p.jsx(mc,{}),p.jsx("div",{className:"md:hidden",children:p.jsx("button",{type:"button",className:vc,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":r,onClick:()=>s(i=>!i),children:p.jsx(_s,{className:"h-6 w-6"})})}),p.jsx("aside",{id:a,className:ae(bc,r?xc:yc),children:e}),p.jsxs("main",{className:wc,children:[p.jsx("div",{className:Sc,children:p.jsx("div",{className:Rc,children:t})}),p.jsx("div",{className:Ec,children:n}),p.jsx(hc,{})]})]})},jr=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Or=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),Pc=async e=>{try{const t=await Fn(`
|
|
3
3
|
query GetServerCache($key: String!) {
|
|
4
4
|
cache(key: $key) {
|
|
@@ -23,4 +23,4 @@ import{j as p,r as u,b as K,a as lt}from"./floating-ui.react-dom-BWTnA00G.js";im
|
|
|
23
23
|
order
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},yu="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",xu="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",wu=(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 Su({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:d}=fu({id:e}),h={transform:wt.Transform.toString(l),transition:c,opacity:d?.5:1};return p.jsxs("div",{ref:a,style:h,className:ae("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:ae(yu,d?"cursor-grabbing":"cursor-grab"),children:p.jsx(Yi,{className:"size-4"})}),p.jsx(te,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Ru({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){u.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(Ul,{sensors:s,collisionDetection:Uc,onDragEnd:r,modifiers:[Jl],children:p.jsx(au,{items:a.map(i=>i.id),strategy:ru,children:a.map(i=>p.jsx(Su,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(zt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ae(xu,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Hn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Eu=()=>{const e=rn({select:i=>i.pathname}),t=Vn(),[n,o]=u.useState([]),r=As({mutationFn:pa,onSuccess:()=>{t.invalidateQueries({queryKey:bt.notes.pinned(),exact:!0})}}),s=$c(ko(no,{activationConstraint:{distance:8}}),ko(eo,{coordinateGetter:gu})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(d=>{const h=wu(d,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):d})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(rr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ut,{height:"40px",opacity:.4}),p.jsx(ut,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(fa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(bu,{render:i=>i.length>0?p.jsx(Ru,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(te,{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."})})})})},Cu=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Eu,{})}),Pu="p-3 pb-0",_u="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",Lu="flex items-center gap-2.5",Mu="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Au="flex flex-col",Iu="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Tu=()=>{const{onCreate:e}=Jo();return p.jsx("div",{className:Pu,children:p.jsxs("button",{type:"button",className:_u,onClick:()=>e(),children:[p.jsxs("span",{className:Lu,children:[p.jsx("span",{className:Mu,children:p.jsx(Qi,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Au,children:[p.jsx(te,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(te,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(ma,{className:Iu,weight:"bold"})]})})},Du=/Mac|iPhone|iPad|iPod/i,Nu=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,is=(e=Nu())=>Du.test(e)?"⌘K":"Ctrl+K",ju="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",Ou=()=>{const e=On(),t=is(),n=()=>{e({to:Ct,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:ju,"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(hr,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(te,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(te,{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})]})},ku=()=>p.jsx("div",{className:"p-3",children:p.jsx(Ou,{})}),Vu=[{name:"Search",path:Ct,icon:hr},{name:"Notes",path:tn,icon:Ir},{name:"Views",path:sr,icon:Is},{name:"Graph",path:ar,icon:Na},{name:"Calendar",path:ir,icon:Xi},{name:"Reminders",path:cr,icon:Ts},{name:"Tags",path:lr,icon:Ds},{name:"Setting",path:ur,icon:Ns}],Fu=()=>{const e=rn({select:n=>n.pathname}),t=is();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Vu.map((n,o)=>{const r=e===n.path||n.path!==tn&&e.startsWith(`${n.path}/`),s=n.path===Ct?t:void 0;return p.jsxs(u.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(zt,{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(te,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Hu=({children:e})=>p.jsx(Cc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(Lc,{}),p.jsx(Tu,{}),p.jsx(ku,{}),p.jsx(Cu,{}),p.jsx(fc,{})]}),topNavigation:p.jsx(Fu,{}),children:e}),cs=100,ls=[50,cs,200];function Vd(e){return ls.includes(e)}const Bu=["updatedAt","createdAt"],Zu=["referenceCount","name"],us=["asc","desc"],$u=["create","update"],zu=["hybrid","lexical","semantic"],un=e=>Array.isArray(e)?e[0]:e,Ie=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=un(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ds=(e,t,n)=>{const o=Ie(e,Number.NaN);return t.includes(o)?o:n},Uu=(e,t=!1)=>{const n=un(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},dn=(e,t="")=>{const n=un(e);return typeof n=="string"?n:t},We=(e,t,n)=>{const o=un(e);return typeof o!="string"?n:t.includes(o)?o:n},Ku=e=>({page:Ie(e.page,1),limit:ds(e.limit,tr,nr),sortBy:We(e.sortBy,Bu,"updatedAt"),sortOrder:We(e.sortOrder,us,"desc"),pinnedFirst:Uu(e.pinnedFirst,!1)}),Qe=e=>({page:Ie(e.page,1)}),Gu=e=>({page:Ie(e.page,1),query:dn(e.query,""),mode:We(e.mode,zu,"hybrid")}),Wu=e=>({page:Ie(e.page,1),query:dn(e.query,""),limit:ds(e.limit,ls,cs),sortBy:We(e.sortBy,Zu,"referenceCount"),sortOrder:We(e.sortOrder,us,"desc")}),qu=e=>({year:Ie(e.year,ho().year(),{min:1970,max:9999}),month:Ie(e.month,ho().month()+1,{min:1,max:12}),type:We(e.type,$u,"create")}),Xu=e=>{const t=dn(e.selected,"").trim();return t?{selected:t}:{}},Yu=e=>({page:Ie(e.page,1),sectionId:dn(e.sectionId,"")}),Qu=e=>{const{data:t}=or({queryKey:bt.notes.list(e.searchParams),async queryFn(){const n=await ga(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Ju({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=js(Number(r));return p.jsxs("div",{className:ae("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(Os,{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(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(va,{button:p.jsx(ks,{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(te,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(zt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Hn,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(zt,{to:dr,params:{id:l.id},search:{page:1},children:p.jsx(te,{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 Xo=ba(tn);function ed(){const e=Xo.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=Xo.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=Jo(),c=d=>{e({search:h=>({...h,...d})})};return p.jsxs(ya,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(uc,{itemsPerPage:t,onItemsPerPageChange:d=>c({limit:d,page:1}),sortBy:o,onSortByChange:d=>c({sortBy:d,page:1}),sortOrder:r,onSortOrderChange:d=>c({sortOrder:d,page:1}),pinnedFirst:s,onPinnedFirstChange:d=>c({pinnedFirst:d,page:1})}),p.jsx(rr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(Qu,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:d,totalCount:h})=>p.jsx(jo,{fallback:p.jsx(wa,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:d.map(f=>p.jsx(Ju,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(jo,{fallback:null,children:h&&t<h&&p.jsx(xa,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const k=Sa({component:()=>p.jsx(Hu,{children:p.jsx(_r,{})}),errorComponent:Ea,notFoundComponent:Ra}),td=O({getParentRoute:()=>k,path:tn,component:ed,validateSearch:Ku}),nd=O({getParentRoute:()=>k,path:ir,component:$(()=>Z(()=>import("./Calendar-D7QJsAlg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:qu}),od=O({getParentRoute:()=>k,path:sr,component:$(()=>Z(()=>import("./Views-CWE99SnI.js"),__vite__mapDeps([8,1,4,2,3,9,10,11,12,13,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading views",description:"Preparing your saved dashboards."})}),rd=O({getParentRoute:()=>k,path:cr,component:$(()=>Z(()=>import("./Reminders-COr1OHvF.js"),__vite__mapDeps([15,1,2,3,16,4]))),pendingComponent:()=>p.jsx(H,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:Qe}),sd=O({getParentRoute:()=>k,path:ar,component:$(()=>Z(()=>import("./Graph-DYUb7gQb.js"),__vite__mapDeps([17,1,2,3,18,19,20,21,22,23,24,7,13]))),pendingComponent:()=>p.jsx(H,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Xu}),ad=O({getParentRoute:()=>k,path:Ct,component:$(()=>Z(()=>import("./Search-Ctkx0BQk.js"),__vite__mapDeps([25,1,4,2,3,26,7,11,27,28,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:Gu}),id=O({getParentRoute:()=>k,path:lr,component:$(()=>Z(()=>import("./Tag-BjxtrIQW.js"),__vite__mapDeps([29,1,2,3,9,7,4,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Wu}),cd=O({getParentRoute:()=>k,path:Hn,component:$(()=>Z(()=>import("./Note-DsMhwrHw.js"),__vite__mapDeps([30,1,2,3,4,5,31,26,14,12,16,32,33,34,6,35,36,37,38,9,28]))),pendingComponent:()=>p.jsx(H,{title:"Loading note",description:"Preparing the editor and note content."})}),ld=O({getParentRoute:()=>k,path:dr,component:$(()=>Z(()=>import("./TagNotes-DV_fdRbg.js"),__vite__mapDeps([39,1,2,3,31,4,26,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:Qe}),ud=O({getParentRoute:()=>k,path:Pa,component:$(()=>Z(()=>import("./ViewNotes-wWWeFJyU.js"),__vite__mapDeps([40,1,4,2,3,9,10,11,31,26,14,38,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:Yu}),dd=O({getParentRoute:()=>k,path:ur,component:$(()=>Z(()=>import("./index-B-E1Ilh9.js"),__vite__mapDeps([41,1,4,2,3,42,43,44,7,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading settings",description:"Preparing workspace preferences."})}),hd=O({getParentRoute:()=>k,path:La,component:$(()=>Z(()=>import("./mcp-CCaFd0zm.js"),__vite__mapDeps([45,1,4,2,3,42,37]))),pendingComponent:()=>p.jsx(H,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),fd=O({getParentRoute:()=>k,path:_a,component:$(()=>Z(()=>import("./search-D-xKTPdO.js"),__vite__mapDeps([46,1,4,2,3,27,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading search settings",description:"Preparing semantic search controls."})}),pd=O({getParentRoute:()=>k,path:Ma,component:$(()=>Z(()=>import("./trash-D4-9sv8q.js"),__vite__mapDeps([47,1,4,2,3,12,31,26,14]))),pendingComponent:()=>p.jsx(H,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:Qe}),md=O({getParentRoute:()=>k,path:Aa,component:$(()=>Z(()=>import("./manage-image-azmo5iVw.js"),__vite__mapDeps([48,1,2,3,4,36,49,12,44]))),pendingComponent:()=>p.jsx(H,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:Qe}),gd=O({getParentRoute:()=>k,path:Ia,component:$(()=>Z(()=>import("./manage-image-detail-BF-uSqb_.js"),__vite__mapDeps([50,1,2,3,4,36,49,12,31,26,14,44,43,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading image detail",description:"Preparing references for the selected image."})}),vd=O({getParentRoute:()=>k,path:Da,component:$(()=>Z(()=>import("./properties-BrNJLkxR.js"),__vite__mapDeps([51,1,4,2,3]))),pendingComponent:()=>p.jsx(H,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:Qe}),bd=O({getParentRoute:()=>k,path:Ta,component:$(()=>Z(()=>import("./placeholder-AusSo8p9.js"),__vite__mapDeps([52,1,4,2,3,12,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:Qe}),yd=k.addChildren([td,od,nd,rd,sd,ad,id,cd,ld,ud,dd,fd,hd,pd,md,gd,bd,vd]),xd=Bi({routeTree:yd,defaultPreload:"intent",defaultPendingComponent:()=>p.jsx(H,{title:"Loading page",description:"Preparing the next route."})});function wd(){const e=Cn(n=>n.setSystemTheme),t=Cn(n=>n.setTheme);return u.useEffect(()=>{const n=bo();return n&&t(n),ka.listenThemeChange(o=>{bo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(lc,{children:p.jsx(zi,{router:xd})})}const hs="__oceanBrainCsrfRetry";let En;const Sd=e=>!Ge.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",fs=e=>{if(!Sd(e)||!Ge.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[hs])},Rd=()=>(En??=Xt().finally(()=>{En=void 0}),En),Yo=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Ed=e=>{Yo(e.headers,"X-XSRF-TOKEN"),Yo(e.headers,"x-xsrf-token")},Cd=async e=>{if(!fs(e)||!Ge.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[hs]=!0,await Rd()!=="active"?Promise.reject(e):(Ed(t),Ge.request(t))};let Qo;const Pd=()=>{Qo===void 0&&(Qo=Ge.interceptors.response.use(e=>e,e=>{if(nc(e))Nr();else if(fs(e))return Cd(e);return Promise.reject(e)}))};Cn.setState({theme:Ca()});Pd();Xt();Vs.createRoot(document.getElementById("root")).render(p.jsx(K.StrictMode,{children:p.jsx(wd,{})}));export{wt as C,Ul as D,jo as F,eo as K,gl as M,Ju as N,no as P,au as S,ls as T,cs as a,Ji as b,_c as c,ko as d,gu as e,Uc as f,fu as g,kd as h,Vd as i,Jl as j,Qi as k,Xi as l,Yi as m,Od as r,Ir as s,$c as u,ru as v};
|
|
26
|
+
`);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},yu="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",xu="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",wu=(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 Su({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:d}=fu({id:e}),h={transform:wt.Transform.toString(l),transition:c,opacity:d?.5:1};return p.jsxs("div",{ref:a,style:h,className:ae("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:ae(yu,d?"cursor-grabbing":"cursor-grab"),children:p.jsx(Yi,{className:"size-4"})}),p.jsx(te,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Ru({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){u.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(Ul,{sensors:s,collisionDetection:Uc,onDragEnd:r,modifiers:[Jl],children:p.jsx(au,{items:a.map(i=>i.id),strategy:ru,children:a.map(i=>p.jsx(Su,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(zt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ae(xu,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Hn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Eu=()=>{const e=rn({select:i=>i.pathname}),t=Vn(),[n,o]=u.useState([]),r=As({mutationFn:pa,onSuccess:()=>{t.invalidateQueries({queryKey:bt.notes.pinned(),exact:!0})}}),s=$c(ko(no,{activationConstraint:{distance:8}}),ko(eo,{coordinateGetter:gu})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(d=>{const h=wu(d,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):d})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(rr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ut,{height:"40px",opacity:.4}),p.jsx(ut,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(fa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(bu,{render:i=>i.length>0?p.jsx(Ru,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(te,{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."})})})})},Cu=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Eu,{})}),Pu="p-3 pb-0",_u="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",Lu="flex items-center gap-2.5",Mu="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Au="flex flex-col",Iu="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Tu=()=>{const{onCreate:e}=Jo();return p.jsx("div",{className:Pu,children:p.jsxs("button",{type:"button",className:_u,onClick:()=>e(),children:[p.jsxs("span",{className:Lu,children:[p.jsx("span",{className:Mu,children:p.jsx(Qi,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Au,children:[p.jsx(te,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(te,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(ma,{className:Iu,weight:"bold"})]})})},Du=/Mac|iPhone|iPad|iPod/i,Nu=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,is=(e=Nu())=>Du.test(e)?"⌘K":"Ctrl+K",ju="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",Ou=()=>{const e=On(),t=is(),n=()=>{e({to:Ct,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:ju,"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(hr,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(te,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(te,{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})]})},ku=()=>p.jsx("div",{className:"p-3",children:p.jsx(Ou,{})}),Vu=[{name:"Search",path:Ct,icon:hr},{name:"Notes",path:tn,icon:Ir},{name:"Views",path:sr,icon:Is},{name:"Graph",path:ar,icon:Na},{name:"Calendar",path:ir,icon:Xi},{name:"Reminders",path:cr,icon:Ts},{name:"Tags",path:lr,icon:Ds},{name:"Setting",path:ur,icon:Ns}],Fu=()=>{const e=rn({select:n=>n.pathname}),t=is();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Vu.map((n,o)=>{const r=e===n.path||n.path!==tn&&e.startsWith(`${n.path}/`),s=n.path===Ct?t:void 0;return p.jsxs(u.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(zt,{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(te,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Hu=({children:e})=>p.jsx(Cc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(Lc,{}),p.jsx(Tu,{}),p.jsx(ku,{}),p.jsx(Cu,{}),p.jsx(fc,{})]}),topNavigation:p.jsx(Fu,{}),children:e}),cs=100,ls=[50,cs,200];function Vd(e){return ls.includes(e)}const Bu=["updatedAt","createdAt"],Zu=["referenceCount","name"],us=["asc","desc"],$u=["create","update"],zu=["hybrid","lexical","semantic"],un=e=>Array.isArray(e)?e[0]:e,Ie=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=un(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ds=(e,t,n)=>{const o=Ie(e,Number.NaN);return t.includes(o)?o:n},Uu=(e,t=!1)=>{const n=un(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},dn=(e,t="")=>{const n=un(e);return typeof n=="string"?n:t},We=(e,t,n)=>{const o=un(e);return typeof o!="string"?n:t.includes(o)?o:n},Ku=e=>({page:Ie(e.page,1),limit:ds(e.limit,tr,nr),sortBy:We(e.sortBy,Bu,"updatedAt"),sortOrder:We(e.sortOrder,us,"desc"),pinnedFirst:Uu(e.pinnedFirst,!1)}),Qe=e=>({page:Ie(e.page,1)}),Gu=e=>({page:Ie(e.page,1),query:dn(e.query,""),mode:We(e.mode,zu,"hybrid")}),Wu=e=>({page:Ie(e.page,1),query:dn(e.query,""),limit:ds(e.limit,ls,cs),sortBy:We(e.sortBy,Zu,"referenceCount"),sortOrder:We(e.sortOrder,us,"desc")}),qu=e=>({year:Ie(e.year,ho().year(),{min:1970,max:9999}),month:Ie(e.month,ho().month()+1,{min:1,max:12}),type:We(e.type,$u,"create")}),Xu=e=>{const t=dn(e.selected,"").trim();return t?{selected:t}:{}},Yu=e=>({page:Ie(e.page,1),sectionId:dn(e.sectionId,"")}),Qu=e=>{const{data:t}=or({queryKey:bt.notes.list(e.searchParams),async queryFn(){const n=await ga(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Ju({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=js(Number(r));return p.jsxs("div",{className:ae("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(Os,{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(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(va,{button:p.jsx(ks,{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(te,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(zt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Hn,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(zt,{to:dr,params:{id:l.id},search:{page:1},children:p.jsx(te,{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 Xo=ba(tn);function ed(){const e=Xo.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=Xo.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=Jo(),c=d=>{e({search:h=>({...h,...d})})};return p.jsxs(ya,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(uc,{itemsPerPage:t,onItemsPerPageChange:d=>c({limit:d,page:1}),sortBy:o,onSortByChange:d=>c({sortBy:d,page:1}),sortOrder:r,onSortOrderChange:d=>c({sortOrder:d,page:1}),pinnedFirst:s,onPinnedFirstChange:d=>c({pinnedFirst:d,page:1})}),p.jsx(rr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(Qu,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:d,totalCount:h})=>p.jsx(jo,{fallback:p.jsx(wa,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:d.map(f=>p.jsx(Ju,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(jo,{fallback:null,children:h&&t<h&&p.jsx(xa,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const k=Sa({component:()=>p.jsx(Hu,{children:p.jsx(_r,{})}),errorComponent:Ea,notFoundComponent:Ra}),td=O({getParentRoute:()=>k,path:tn,component:ed,validateSearch:Ku}),nd=O({getParentRoute:()=>k,path:ir,component:$(()=>Z(()=>import("./Calendar-BR83066I.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:qu}),od=O({getParentRoute:()=>k,path:sr,component:$(()=>Z(()=>import("./Views-DMizFO-d.js"),__vite__mapDeps([8,1,4,2,3,9,10,11,12,13,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading views",description:"Preparing your saved dashboards."})}),rd=O({getParentRoute:()=>k,path:cr,component:$(()=>Z(()=>import("./Reminders-COr1OHvF.js"),__vite__mapDeps([15,1,2,3,16,4]))),pendingComponent:()=>p.jsx(H,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:Qe}),sd=O({getParentRoute:()=>k,path:ar,component:$(()=>Z(()=>import("./Graph-DYUb7gQb.js"),__vite__mapDeps([17,1,2,3,18,19,20,21,22,23,24,7,13]))),pendingComponent:()=>p.jsx(H,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Xu}),ad=O({getParentRoute:()=>k,path:Ct,component:$(()=>Z(()=>import("./Search-BqPROwkA.js"),__vite__mapDeps([25,1,4,2,3,26,7,11,27,28,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:Gu}),id=O({getParentRoute:()=>k,path:lr,component:$(()=>Z(()=>import("./Tag-C4fNi3KQ.js"),__vite__mapDeps([29,1,2,3,9,7,4,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Wu}),cd=O({getParentRoute:()=>k,path:Hn,component:$(()=>Z(()=>import("./Note-DnXDfDTk.js"),__vite__mapDeps([30,1,2,3,4,5,31,26,14,12,16,32,33,34,6,35,36,37,38,9,28]))),pendingComponent:()=>p.jsx(H,{title:"Loading note",description:"Preparing the editor and note content."})}),ld=O({getParentRoute:()=>k,path:dr,component:$(()=>Z(()=>import("./TagNotes-BXgkwXMd.js"),__vite__mapDeps([39,1,2,3,31,4,26,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:Qe}),ud=O({getParentRoute:()=>k,path:Pa,component:$(()=>Z(()=>import("./ViewNotes-BJPiV66I.js"),__vite__mapDeps([40,1,4,2,3,9,10,11,31,26,14,38,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:Yu}),dd=O({getParentRoute:()=>k,path:ur,component:$(()=>Z(()=>import("./index-BBzpADtD.js"),__vite__mapDeps([41,1,4,2,3,42,43,44,7,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading settings",description:"Preparing workspace preferences."})}),hd=O({getParentRoute:()=>k,path:La,component:$(()=>Z(()=>import("./mcp-CCaFd0zm.js"),__vite__mapDeps([45,1,4,2,3,42,37]))),pendingComponent:()=>p.jsx(H,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),fd=O({getParentRoute:()=>k,path:_a,component:$(()=>Z(()=>import("./search-D-xKTPdO.js"),__vite__mapDeps([46,1,4,2,3,27,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading search settings",description:"Preparing semantic search controls."})}),pd=O({getParentRoute:()=>k,path:Ma,component:$(()=>Z(()=>import("./trash-X_dnKA9T.js"),__vite__mapDeps([47,1,4,2,3,12,31,26,14]))),pendingComponent:()=>p.jsx(H,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:Qe}),md=O({getParentRoute:()=>k,path:Aa,component:$(()=>Z(()=>import("./manage-image-azmo5iVw.js"),__vite__mapDeps([48,1,2,3,4,36,49,12,44]))),pendingComponent:()=>p.jsx(H,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:Qe}),gd=O({getParentRoute:()=>k,path:Ia,component:$(()=>Z(()=>import("./manage-image-detail-ojV6kSsu.js"),__vite__mapDeps([50,1,2,3,4,36,49,12,31,26,14,44,43,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading image detail",description:"Preparing references for the selected image."})}),vd=O({getParentRoute:()=>k,path:Da,component:$(()=>Z(()=>import("./properties-BrNJLkxR.js"),__vite__mapDeps([51,1,4,2,3]))),pendingComponent:()=>p.jsx(H,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:Qe}),bd=O({getParentRoute:()=>k,path:Ta,component:$(()=>Z(()=>import("./placeholder-DR75IAi_.js"),__vite__mapDeps([52,1,4,2,3,12,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:Qe}),yd=k.addChildren([td,od,nd,rd,sd,ad,id,cd,ld,ud,dd,fd,hd,pd,md,gd,bd,vd]),xd=Bi({routeTree:yd,defaultPreload:"intent",defaultPendingComponent:()=>p.jsx(H,{title:"Loading page",description:"Preparing the next route."})});function wd(){const e=Cn(n=>n.setSystemTheme),t=Cn(n=>n.setTheme);return u.useEffect(()=>{const n=bo();return n&&t(n),ka.listenThemeChange(o=>{bo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(lc,{children:p.jsx(zi,{router:xd})})}const hs="__oceanBrainCsrfRetry";let En;const Sd=e=>!Ge.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",fs=e=>{if(!Sd(e)||!Ge.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[hs])},Rd=()=>(En??=Xt().finally(()=>{En=void 0}),En),Yo=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Ed=e=>{Yo(e.headers,"X-XSRF-TOKEN"),Yo(e.headers,"x-xsrf-token")},Cd=async e=>{if(!fs(e)||!Ge.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[hs]=!0,await Rd()!=="active"?Promise.reject(e):(Ed(t),Ge.request(t))};let Qo;const Pd=()=>{Qo===void 0&&(Qo=Ge.interceptors.response.use(e=>e,e=>{if(nc(e))Nr();else if(fs(e))return Cd(e);return Promise.reject(e)}))};Cn.setState({theme:Ca()});Pd();Xt();Vs.createRoot(document.getElementById("root")).render(p.jsx(K.StrictMode,{children:p.jsx(wd,{})}));export{wt as C,Ul as D,jo as F,eo as K,gl as M,Ju as N,no as P,au as S,ls as T,cs as a,Ji as b,_c as c,ko as d,gu as e,Uc as f,fu as g,kd as h,Vd as i,Jl as j,Qi as k,Xi as l,Yi as m,Od as r,Ir as s,$c as u,ru as v};
|