ocean-brain 0.10.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.
Files changed (83) hide show
  1. package/dist/mcp.js +58 -32
  2. package/package.json +2 -2
  3. package/server/client/dist/assets/{ArrowRight.es-Bm-ZXpEC.js → ArrowRight.es-BEhnlwfe.js} +1 -1
  4. package/server/client/dist/assets/AuxiliaryPanelHeader-B1k7pZpn.js +1 -0
  5. package/server/client/dist/assets/Calendar-BR83066I.js +25 -0
  6. package/server/client/dist/assets/{Callout-CviyPHKO.js → Callout-BTd1BYtV.js} +1 -1
  7. package/server/client/dist/assets/{Copy.es-BPreRnP9.js → Copy.es-BoLjilxv.js} +1 -1
  8. package/server/client/dist/assets/File.es-Ct7fscBg.js +1 -0
  9. package/server/client/dist/assets/{Graph-yPE3ljW0.js → Graph-DYUb7gQb.js} +1 -1
  10. package/server/client/dist/assets/{Graph-vXQQ0a-Q.js → Graph-LY_IgMYy.js} +1 -1
  11. package/server/client/dist/assets/{Image.es-DnR3qc_c.js → Image.es-OYyN3BYt.js} +1 -1
  12. package/server/client/dist/assets/Note-DnXDfDTk.js +25 -0
  13. package/server/client/dist/assets/NotePropertiesPanel-CsaNhRnE.js +2 -0
  14. package/server/client/dist/assets/{PencilLine.es-B9V6u64t.js → PencilLine.es-0JpEgxFY.js} +1 -1
  15. package/server/client/dist/assets/{Plus.es-CRRp2u5J.js → Plus.es-DRfLW_bI.js} +1 -1
  16. package/server/client/dist/assets/{Reminders-BOtfNeYD.js → Reminders-COr1OHvF.js} +1 -1
  17. package/server/client/dist/assets/Search-BqPROwkA.js +31 -0
  18. package/server/client/dist/assets/{SurfaceCard-GMt5xM7v.js → SurfaceCard-t7pdfhEe.js} +1 -1
  19. package/server/client/dist/assets/Tag-C4fNi3KQ.js +1 -0
  20. package/server/client/dist/assets/TagNotes-BXgkwXMd.js +1 -0
  21. package/server/client/dist/assets/{Trash.es-svHOb5LN.js → Trash.es-Bo1VyK9Q.js} +1 -1
  22. package/server/client/dist/assets/ViewChip-DlCkL4z4.js +1 -0
  23. package/server/client/dist/assets/ViewNotes-BJPiV66I.js +1 -0
  24. package/server/client/dist/assets/ViewSectionDialog-DhH8harC.js +102 -0
  25. package/server/client/dist/assets/Views-DMizFO-d.js +1 -0
  26. package/server/client/dist/assets/app-1lOWtkRA.js +26 -0
  27. package/server/client/dist/assets/app-BHmwRmwM.css +1 -0
  28. package/server/client/dist/assets/{image.api-QmHYjp3z.js → image.api-CyQisInP.js} +1 -1
  29. package/server/client/dist/assets/index-BBzpADtD.js +1 -0
  30. package/server/client/dist/assets/manage-image-azmo5iVw.js +1 -0
  31. package/server/client/dist/assets/manage-image-detail-ojV6kSsu.js +1 -0
  32. package/server/client/dist/assets/{mcp-uFZkdhCi.js → mcp-CCaFd0zm.js} +1 -1
  33. package/server/client/dist/assets/mcp-admin-adapter-PMmgPupc.js +1 -0
  34. package/server/client/dist/assets/{note-ui-CxK8ymUc.js → note-ui-CtijppHK.js} +1 -1
  35. package/server/client/dist/assets/{note.api-BQovzEzd.js → note.api-D3oJmG3q.js} +2 -2
  36. package/server/client/dist/assets/{placeholder-D3b8lZGE.js → placeholder-DR75IAi_.js} +2 -2
  37. package/server/client/dist/assets/{properties-M-yWq1D7.js → properties-BrNJLkxR.js} +1 -1
  38. package/server/client/dist/assets/route-preload.js +2 -2
  39. package/server/client/dist/assets/search-D-xKTPdO.js +1 -0
  40. package/server/client/dist/assets/search-admin-adapter-CJnJmL6w.js +1 -0
  41. package/server/client/dist/assets/{tag.api-DUfjr8bg.js → tag.api-DNSQpqwk.js} +1 -1
  42. package/server/client/dist/assets/{time-CfAYZipR.js → time-D5LRMumI.js} +3 -3
  43. package/server/client/dist/assets/trash-X_dnKA9T.js +1 -0
  44. package/server/client/dist/assets/{useReminderMutate--omDLmBV.js → useReminderMutate-BrGO9M0o.js} +1 -1
  45. package/server/client/dist/index.html +5 -5
  46. package/server/dist/features/note/graphql/note.field.resolver.js +2 -0
  47. package/server/dist/features/note/graphql/note.mutation.resolver.js +19 -14
  48. package/server/dist/features/note/graphql/note.query.resolver.js +34 -14
  49. package/server/dist/features/note/graphql/note.type-defs.js +1 -0
  50. package/server/dist/features/note/services/authoring.js +15 -10
  51. package/server/dist/features/note/services/content-blocks.js +18 -20
  52. package/server/dist/features/note/services/note-reference-index.js +98 -0
  53. package/server/dist/features/note/services/search.js +5 -0
  54. package/server/dist/features/note/services/snapshot.js +4 -0
  55. package/server/dist/features/note/services/trash.js +2 -0
  56. package/server/dist/features/note/services/write.js +10 -3
  57. package/server/dist/features/search/graphql/resolver.js +13 -1
  58. package/server/dist/features/search/graphql/type-defs.js +7 -0
  59. package/server/dist/features/search/hybrid-ranking.js +4 -2
  60. package/server/dist/features/search/hybrid-search.js +4 -2
  61. package/server/dist/features/search/related-notes.js +186 -0
  62. package/server/dist/main.js +10 -3
  63. package/server/dist/paths.js +0 -1
  64. package/server/dist/routes/client.js +1 -1
  65. package/server/prisma/migrations/20260728090000_0019_note_reference_index/migration.sql +15 -0
  66. package/server/prisma/schema.prisma +16 -0
  67. package/server/client/dist/assets/Calendar-BsNs3NzO.js +0 -25
  68. package/server/client/dist/assets/Note-CmreVzvQ.js +0 -25
  69. package/server/client/dist/assets/NotePropertiesPanel-DXYgE8h2.js +0 -2
  70. package/server/client/dist/assets/Search-C-FB3pKf.js +0 -1
  71. package/server/client/dist/assets/Tag-lBxDRE77.js +0 -1
  72. package/server/client/dist/assets/TagNotes-Bgorp_rC.js +0 -1
  73. package/server/client/dist/assets/ViewNotes-C7d10VFf.js +0 -1
  74. package/server/client/dist/assets/ViewSectionDialog-Bhw-ILop.js +0 -102
  75. package/server/client/dist/assets/Views-C7V3saUo.js +0 -1
  76. package/server/client/dist/assets/app-DQBV36r_.js +0 -50
  77. package/server/client/dist/assets/app-ZgwR5t_I.css +0 -1
  78. package/server/client/dist/assets/index-CaF9d-zG.js +0 -1
  79. package/server/client/dist/assets/manage-image-DCDF8AM9.js +0 -1
  80. package/server/client/dist/assets/manage-image-detail-e0ViRAj-.js +0 -1
  81. package/server/client/dist/assets/mcp-admin-adapter-D39G3udJ.js +0 -1
  82. package/server/client/dist/assets/search-DFnzZKLd.js +0 -1
  83. package/server/client/dist/assets/trash-CClKfP1x.js +0 -1
@@ -1 +1 @@
1
- import{r as m,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{a as oe,b as K,M as q}from"./time-CfAYZipR.js";import{u as de,n as ce,q as x,o as ue,t as pe,v as me,P as he,T as s,B as o,M as d,I as v,w as xe,x as be,d as ve,f as ye}from"./note.api-BQovzEzd.js";import{a as ge}from"./url-9nrbQs7Z.js";const fe=ye(ge),W=[{value:"text",label:"Text",description:"Short status or label values."},{value:"url",label:"URL",description:"External sources, issues, docs, or references."},{value:"number",label:"Number",description:"Priority, score, or count values."},{value:"date",label:"Date",description:"Due dates and milestones."},{value:"boolean",label:"Boolean",description:"True or false flags."},{value:"select",label:"Select",description:"Choose one option from a controlled list."}],je=l=>!l.id&&!l.label.trim()&&!l.value.trim(),Ne=l=>(l.value.trim()||l.label.trim()).toLowerCase().replace(/\s+/g,"-"),Ce=l=>/^[a-z0-9][a-z0-9_-]*$/.test(l),X=l=>l.filter(r=>r.id||r.label.trim()).map((r,F)=>({...r.id?{id:r.id}:{},label:r.label.trim(),value:r.value.trim()||r.label.trim(),color:r.color??null,order:r.order??F}));function Ee(){const l=ve(),r=de(),F=fe.useSearch(),Z=Number(F.page??1),R=50,V=Math.max(0,Z-1)*R,[O,Q]=m.useState(""),[I,A]=m.useState(""),[y,$]=m.useState("text"),[D,j]=m.useState([{label:"",value:""}]),[u,N]=m.useState(null),[i,H]=m.useState(null),[k,L]=m.useState(""),[E,g]=m.useState([{label:"",value:""}]),[ee,C]=m.useState(!1),T=()=>{Q(""),A(""),$("text"),j([{label:"",value:""}])},ae=a=>{H(a),L(a.name),g(a.options.length>0?a.options.map(t=>({id:t.id,label:t.label,value:t.value,color:t.color,order:t.order})):[{label:"",value:""}])},S=()=>{H(null),L(""),g([{label:"",value:""}])},M=oe({queryKey:x.notes.propertyKeys({limit:R,offset:V}),queryFn:async()=>{const a=await ce({limit:R,offset:V});if(a.type==="error")throw a;return a.notePropertyKeys}}),w=K({mutationFn:async()=>ue({key:O,name:I||O,valueType:y,...y==="select"?{options:D.map((a,t)=>({label:a.label.trim(),value:a.value.trim()||a.label.trim(),order:t})).filter(a=>a.label)}:{}}),onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to create property.");return}T(),C(!1),r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),l("Property created.")},onError:()=>{l("Failed to create property.")}}),h=K({mutationFn:async()=>{if(!i)throw new Error("Property to edit is missing.");return pe({key:i.key,name:k||i.key,...i.valueType==="select"?{options:X(E)}:{}})},onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to update property.");return}S(),r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),r.invalidateQueries({queryKey:x.notes.all(),exact:!1}),r.invalidateQueries({queryKey:x.views.all(),exact:!1}),l("Property updated.")},onError:()=>{l("Failed to update property.")}}),f=K({mutationFn:async({propertyKey:a,confirmImpact:t})=>me({key:a.key,confirmImpact:t}),onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to delete property.");return}r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),r.invalidateQueries({queryKey:x.notes.all(),exact:!1}),r.invalidateQueries({queryKey:x.views.all(),exact:!1}),N(null),l(a.deleteNotePropertyKey.affectedNoteCount>0?`Property deleted from ${a.deleteNotePropertyKey.affectedNoteCount} note(s).`:"Property deleted.")},onError:()=>{l("Failed to delete property.")}}),P=M.data?.keys??[],se=y!=="select"||D.some(a=>a.label.trim()),z=i?.valueType==="select"?E.filter(a=>!je(a)):[],_=z.map(Ne),B=_.find((a,t)=>_.indexOf(a)!==t),U=_.find(a=>!Ce(a)),J=z.some(a=>!!a.id&&!a.label.trim()),Y=z.some(a=>!a.id&&!a.label.trim()),te=!i||i.valueType!=="select"||z.length>0&&!J&&!Y&&!B&&!U,le=!!i&&k.trim()!==i?.name,re=i?.valueType==="select"&&JSON.stringify(X(E))!==JSON.stringify(i.options.map(a=>({id:a.id,label:a.label,value:a.value,color:a.color??null,order:a.order}))),ie=le||!!re,G=J?"Existing option labels cannot be empty.":Y?"New options need a label.":B?`Option value “${B}” is duplicated.`:U?"Option values must use letters, numbers, dashes, or underscores.":"",ne=()=>{u&&f.mutate({propertyKey:u,confirmImpact:u.noteCount>0})};return e.jsxs(he,{title:"Properties",description:"Define shared note fields before using them in notes and future views.",headerRight:e.jsx(o,{type:"button",size:"md",variant:"primary",className:"w-full sm:w-auto",onClick:()=>C(!0),children:"New property"}),children:[e.jsxs("section",{className:"flex flex-col gap-3","aria-labelledby":"shared-properties-heading",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(s,{id:"shared-properties-heading",as:"h2",variant:"label",weight:"medium",className:"text-fg-tertiary",children:"Shared fields"}),!M.isLoading&&P.length>0&&e.jsxs(s,{as:"span",variant:"meta",tone:"tertiary",children:[P.length," field",P.length===1?"":"s"]})]}),M.isLoading?e.jsx(s,{as:"p",variant:"body",tone:"tertiary",className:"surface-base px-4 py-3.5",children:"Loading properties..."}):P.length===0?e.jsxs("div",{className:"surface-base border-dashed p-6 text-center",children:[e.jsx(s,{as:"p",variant:"body",weight:"medium",children:"No shared properties yet."}),e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Create one here, then attach it from the note screen."})]}):e.jsx("div",{className:"flex flex-col gap-3",children:P.map(a=>e.jsxs("article",{className:"surface-base grid gap-3 px-4 py-3.5 md:grid-cols-[minmax(0,1fr)_120px_120px_auto] md:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"h3",variant:"body",weight:"semibold",className:"truncate",children:a.name}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"font-mono",children:a.key}),a.options.length>0&&e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[a.options.slice(0,6).map(t=>e.jsx("span",{className:"rounded-full border border-border-subtle bg-subtle px-2 py-0.5 text-xs font-medium text-fg-secondary",children:t.label},t.id)),a.options.length>6&&e.jsxs("span",{className:"rounded-full border border-border-subtle bg-subtle px-2 py-0.5 text-xs font-medium text-fg-tertiary",children:["+",a.options.length-6]})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block md:hidden",children:"Type"}),e.jsx(s,{as:"span",variant:"label",tone:"secondary",className:"capitalize",children:a.valueType})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block md:hidden",children:"Used in"}),e.jsxs(s,{as:"span",variant:"label",tone:"tertiary",children:[a.noteCount," note",a.noteCount===1?"":"s"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-self-start md:justify-self-end",children:[e.jsx(o,{type:"button",size:"sm",variant:"subtle",disabled:h.isPending||f.isPending,onClick:()=>ae(a),children:"Edit"}),e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",disabled:f.isPending||h.isPending,onClick:()=>N(a),children:"Delete"})]})]},a.key))})]}),e.jsxs(d,{isOpen:ee,onClose:()=>{w.isPending||(C(!1),T())},variant:"form",children:[e.jsx(d.Header,{title:"New property",onClose:()=>{C(!1),T()}}),e.jsx(d.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Create a shared field that notes can use for values and future views."}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Key"}),e.jsx(v,{size:"md",placeholder:"status",value:O,onChange:a=>Q(a.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Name"}),e.jsx(v,{size:"md",placeholder:"Status",value:I,onChange:a=>A(a.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{id:"property-type-label",as:"span",variant:"label",weight:"medium",children:"Type"}),e.jsx(xe,{value:y,"aria-labelledby":"property-type-label",onValueChange:a=>$(a),children:W.map(a=>e.jsx(be,{value:a.value,children:a.label},a.value))})]}),y==="select"&&e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 p-3",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[e.jsx(s,{as:"span",variant:"label",weight:"semibold",children:"Options"}),e.jsx(o,{type:"button",size:"sm",variant:"subtle",onClick:()=>j(a=>[...a,{label:"",value:""}]),children:"Add option"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:D.map((a,t)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[e.jsx(v,{size:"sm",placeholder:"Label",value:a.label,onChange:c=>j(p=>p.map((n,b)=>b===t?{...n,label:c.target.value}:n))}),e.jsx(v,{size:"sm",placeholder:"value",value:a.value,onChange:c=>j(p=>p.map((n,b)=>b===t?{...n,value:c.target.value}:n))}),e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",onClick:()=>j(c=>c.filter((p,n)=>n!==t)),children:"Remove"})]},t))})]}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",children:W.find(a=>a.value===y)?.description})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:w.isPending,onClick:()=>{C(!1),T()},children:"Cancel"}),e.jsx(o,{type:"button",variant:"primary",size:"sm",disabled:!O.trim()||!se||w.isPending,isLoading:w.isPending,onClick:()=>w.mutate(),children:"Create property"})]})})]}),e.jsxs(d,{isOpen:!!i,onClose:()=>{h.isPending||S()},variant:"form",children:[e.jsx(d.Header,{title:"Edit property",onClose:()=>{h.isPending||S()}}),e.jsx(d.Body,{children:i&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Rename the display label or add select options. Key, type, and existing option values stay fixed so notes and views remain stable."}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 px-3 py-2",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block",children:"Key"}),e.jsx(s,{as:"span",variant:"label",weight:"medium",className:"font-mono",children:i.key})]}),e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 px-3 py-2",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block",children:"Type"}),e.jsx(s,{as:"span",variant:"label",weight:"medium",className:"capitalize",children:i.valueType})]})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Display name"}),e.jsx(v,{size:"md",placeholder:"Workflow state",value:k,onChange:a=>L(a.target.value)})]}),i.valueType==="select"&&e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 p-3",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(s,{as:"span",variant:"label",weight:"semibold",children:"Options"}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"mt-0.5",children:"Existing option values are locked. Removing existing options needs an impact-aware delete flow."})]}),e.jsx(o,{type:"button",size:"sm",variant:"subtle",onClick:()=>g(a=>[...a,{label:"",value:""}]),children:"Add option"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:E.map((a,t)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[e.jsx(v,{size:"sm",placeholder:"Label",value:a.label,onChange:c=>g(p=>p.map((n,b)=>b===t?{...n,label:c.target.value}:n))}),e.jsx(v,{size:"sm",placeholder:a.id?"Locked value":"value",value:a.value,disabled:!!a.id,onChange:c=>g(p=>p.map((n,b)=>b===t?{...n,value:c.target.value}:n))}),a.id?e.jsx(s,{as:"span",variant:"meta",tone:"tertiary",className:"flex h-8 items-center px-3",children:"Locked"}):e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",onClick:()=>g(c=>c.filter((p,n)=>n!==t)),children:"Remove"})]},a.id??`new-${t}`))}),G&&e.jsx(s,{as:"p",variant:"micro",tone:"error",className:"mt-2",children:G})]})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:h.isPending,onClick:S,children:"Cancel"}),e.jsx(o,{type:"button",variant:"primary",size:"sm",disabled:!k.trim()||!ie||!te||h.isPending,isLoading:h.isPending,onClick:()=>h.mutate(),children:"Save changes"})]})})]}),e.jsxs(d,{isOpen:!!u,onClose:()=>{f.isPending||N(null)},variant:"confirm",children:[e.jsx(d.Header,{title:"Delete property",onClose:()=>N(null)}),e.jsx(d.Body,{children:u&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(s,{as:"p",variant:"body",weight:"medium",children:["Delete “",u.name,"”?"]}),u.noteCount>0?e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle p-3",children:[e.jsxs(s,{as:"p",variant:"label",tone:"secondary",children:["This property is used by ",u.noteCount," note",u.noteCount===1?"":"s","."]}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"mt-1 leading-5",children:"Deleting it removes this value from those notes. Future views using this property will need configuration."})]}):e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"This property is not used by any note yet."})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:f.isPending,onClick:()=>N(null),children:"Cancel"}),e.jsx(o,{type:"button",variant:"danger",size:"sm",isLoading:f.isPending,onClick:ne,children:"Delete"})]})})]})]})}export{Ee as default};
1
+ import{r as m,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{a as oe,b as K,M as q}from"./time-D5LRMumI.js";import{u as de,o as ce,q as x,t as ue,v as pe,w as me,P as he,T as s,B as o,M as d,I as v,x as xe,y as be,e as ve,h as ye}from"./note.api-D3oJmG3q.js";import{a as ge}from"./url-9nrbQs7Z.js";const fe=ye(ge),W=[{value:"text",label:"Text",description:"Short status or label values."},{value:"url",label:"URL",description:"External sources, issues, docs, or references."},{value:"number",label:"Number",description:"Priority, score, or count values."},{value:"date",label:"Date",description:"Due dates and milestones."},{value:"boolean",label:"Boolean",description:"True or false flags."},{value:"select",label:"Select",description:"Choose one option from a controlled list."}],je=l=>!l.id&&!l.label.trim()&&!l.value.trim(),Ne=l=>(l.value.trim()||l.label.trim()).toLowerCase().replace(/\s+/g,"-"),Ce=l=>/^[a-z0-9][a-z0-9_-]*$/.test(l),X=l=>l.filter(r=>r.id||r.label.trim()).map((r,F)=>({...r.id?{id:r.id}:{},label:r.label.trim(),value:r.value.trim()||r.label.trim(),color:r.color??null,order:r.order??F}));function Ee(){const l=ve(),r=de(),F=fe.useSearch(),Z=Number(F.page??1),R=50,V=Math.max(0,Z-1)*R,[O,Q]=m.useState(""),[I,A]=m.useState(""),[y,$]=m.useState("text"),[D,j]=m.useState([{label:"",value:""}]),[u,N]=m.useState(null),[i,H]=m.useState(null),[k,L]=m.useState(""),[E,g]=m.useState([{label:"",value:""}]),[ee,C]=m.useState(!1),T=()=>{Q(""),A(""),$("text"),j([{label:"",value:""}])},ae=a=>{H(a),L(a.name),g(a.options.length>0?a.options.map(t=>({id:t.id,label:t.label,value:t.value,color:t.color,order:t.order})):[{label:"",value:""}])},S=()=>{H(null),L(""),g([{label:"",value:""}])},M=oe({queryKey:x.notes.propertyKeys({limit:R,offset:V}),queryFn:async()=>{const a=await ce({limit:R,offset:V});if(a.type==="error")throw a;return a.notePropertyKeys}}),w=K({mutationFn:async()=>ue({key:O,name:I||O,valueType:y,...y==="select"?{options:D.map((a,t)=>({label:a.label.trim(),value:a.value.trim()||a.label.trim(),order:t})).filter(a=>a.label)}:{}}),onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to create property.");return}T(),C(!1),r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),l("Property created.")},onError:()=>{l("Failed to create property.")}}),h=K({mutationFn:async()=>{if(!i)throw new Error("Property to edit is missing.");return pe({key:i.key,name:k||i.key,...i.valueType==="select"?{options:X(E)}:{}})},onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to update property.");return}S(),r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),r.invalidateQueries({queryKey:x.notes.all(),exact:!1}),r.invalidateQueries({queryKey:x.views.all(),exact:!1}),l("Property updated.")},onError:()=>{l("Failed to update property.")}}),f=K({mutationFn:async({propertyKey:a,confirmImpact:t})=>me({key:a.key,confirmImpact:t}),onSuccess:a=>{if(a.type==="error"){l(a.errors[0]?.message??"Failed to delete property.");return}r.invalidateQueries({queryKey:x.notes.propertyKeysAll(),exact:!1}),r.invalidateQueries({queryKey:x.notes.all(),exact:!1}),r.invalidateQueries({queryKey:x.views.all(),exact:!1}),N(null),l(a.deleteNotePropertyKey.affectedNoteCount>0?`Property deleted from ${a.deleteNotePropertyKey.affectedNoteCount} note(s).`:"Property deleted.")},onError:()=>{l("Failed to delete property.")}}),P=M.data?.keys??[],se=y!=="select"||D.some(a=>a.label.trim()),z=i?.valueType==="select"?E.filter(a=>!je(a)):[],_=z.map(Ne),B=_.find((a,t)=>_.indexOf(a)!==t),U=_.find(a=>!Ce(a)),J=z.some(a=>!!a.id&&!a.label.trim()),Y=z.some(a=>!a.id&&!a.label.trim()),te=!i||i.valueType!=="select"||z.length>0&&!J&&!Y&&!B&&!U,le=!!i&&k.trim()!==i?.name,re=i?.valueType==="select"&&JSON.stringify(X(E))!==JSON.stringify(i.options.map(a=>({id:a.id,label:a.label,value:a.value,color:a.color??null,order:a.order}))),ie=le||!!re,G=J?"Existing option labels cannot be empty.":Y?"New options need a label.":B?`Option value “${B}” is duplicated.`:U?"Option values must use letters, numbers, dashes, or underscores.":"",ne=()=>{u&&f.mutate({propertyKey:u,confirmImpact:u.noteCount>0})};return e.jsxs(he,{title:"Properties",description:"Define shared note fields before using them in notes and future views.",headerRight:e.jsx(o,{type:"button",size:"md",variant:"primary",className:"w-full sm:w-auto",onClick:()=>C(!0),children:"New property"}),children:[e.jsxs("section",{className:"flex flex-col gap-3","aria-labelledby":"shared-properties-heading",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(s,{id:"shared-properties-heading",as:"h2",variant:"label",weight:"medium",className:"text-fg-tertiary",children:"Shared fields"}),!M.isLoading&&P.length>0&&e.jsxs(s,{as:"span",variant:"meta",tone:"tertiary",children:[P.length," field",P.length===1?"":"s"]})]}),M.isLoading?e.jsx(s,{as:"p",variant:"body",tone:"tertiary",className:"surface-base px-4 py-3.5",children:"Loading properties..."}):P.length===0?e.jsxs("div",{className:"surface-base border-dashed p-6 text-center",children:[e.jsx(s,{as:"p",variant:"body",weight:"medium",children:"No shared properties yet."}),e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Create one here, then attach it from the note screen."})]}):e.jsx("div",{className:"flex flex-col gap-3",children:P.map(a=>e.jsxs("article",{className:"surface-base grid gap-3 px-4 py-3.5 md:grid-cols-[minmax(0,1fr)_120px_120px_auto] md:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"h3",variant:"body",weight:"semibold",className:"truncate",children:a.name}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"font-mono",children:a.key}),a.options.length>0&&e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[a.options.slice(0,6).map(t=>e.jsx("span",{className:"rounded-full border border-border-subtle bg-subtle px-2 py-0.5 text-xs font-medium text-fg-secondary",children:t.label},t.id)),a.options.length>6&&e.jsxs("span",{className:"rounded-full border border-border-subtle bg-subtle px-2 py-0.5 text-xs font-medium text-fg-tertiary",children:["+",a.options.length-6]})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block md:hidden",children:"Type"}),e.jsx(s,{as:"span",variant:"label",tone:"secondary",className:"capitalize",children:a.valueType})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block md:hidden",children:"Used in"}),e.jsxs(s,{as:"span",variant:"label",tone:"tertiary",children:[a.noteCount," note",a.noteCount===1?"":"s"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-self-start md:justify-self-end",children:[e.jsx(o,{type:"button",size:"sm",variant:"subtle",disabled:h.isPending||f.isPending,onClick:()=>ae(a),children:"Edit"}),e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",disabled:f.isPending||h.isPending,onClick:()=>N(a),children:"Delete"})]})]},a.key))})]}),e.jsxs(d,{isOpen:ee,onClose:()=>{w.isPending||(C(!1),T())},variant:"form",children:[e.jsx(d.Header,{title:"New property",onClose:()=>{C(!1),T()}}),e.jsx(d.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Create a shared field that notes can use for values and future views."}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Key"}),e.jsx(v,{size:"md",placeholder:"status",value:O,onChange:a=>Q(a.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Name"}),e.jsx(v,{size:"md",placeholder:"Status",value:I,onChange:a=>A(a.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{id:"property-type-label",as:"span",variant:"label",weight:"medium",children:"Type"}),e.jsx(xe,{value:y,"aria-labelledby":"property-type-label",onValueChange:a=>$(a),children:W.map(a=>e.jsx(be,{value:a.value,children:a.label},a.value))})]}),y==="select"&&e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 p-3",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[e.jsx(s,{as:"span",variant:"label",weight:"semibold",children:"Options"}),e.jsx(o,{type:"button",size:"sm",variant:"subtle",onClick:()=>j(a=>[...a,{label:"",value:""}]),children:"Add option"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:D.map((a,t)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[e.jsx(v,{size:"sm",placeholder:"Label",value:a.label,onChange:c=>j(p=>p.map((n,b)=>b===t?{...n,label:c.target.value}:n))}),e.jsx(v,{size:"sm",placeholder:"value",value:a.value,onChange:c=>j(p=>p.map((n,b)=>b===t?{...n,value:c.target.value}:n))}),e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",onClick:()=>j(c=>c.filter((p,n)=>n!==t)),children:"Remove"})]},t))})]}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",children:W.find(a=>a.value===y)?.description})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:w.isPending,onClick:()=>{C(!1),T()},children:"Cancel"}),e.jsx(o,{type:"button",variant:"primary",size:"sm",disabled:!O.trim()||!se||w.isPending,isLoading:w.isPending,onClick:()=>w.mutate(),children:"Create property"})]})})]}),e.jsxs(d,{isOpen:!!i,onClose:()=>{h.isPending||S()},variant:"form",children:[e.jsx(d.Header,{title:"Edit property",onClose:()=>{h.isPending||S()}}),e.jsx(d.Body,{children:i&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"Rename the display label or add select options. Key, type, and existing option values stay fixed so notes and views remain stable."}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 px-3 py-2",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block",children:"Key"}),e.jsx(s,{as:"span",variant:"label",weight:"medium",className:"font-mono",children:i.key})]}),e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 px-3 py-2",children:[e.jsx(s,{as:"span",variant:"micro",tone:"tertiary",className:"block",children:"Type"}),e.jsx(s,{as:"span",variant:"label",weight:"medium",className:"capitalize",children:i.valueType})]})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx(s,{as:"span",variant:"label",weight:"medium",children:"Display name"}),e.jsx(v,{size:"md",placeholder:"Workflow state",value:k,onChange:a=>L(a.target.value)})]}),i.valueType==="select"&&e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle/50 p-3",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(s,{as:"span",variant:"label",weight:"semibold",children:"Options"}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"mt-0.5",children:"Existing option values are locked. Removing existing options needs an impact-aware delete flow."})]}),e.jsx(o,{type:"button",size:"sm",variant:"subtle",onClick:()=>g(a=>[...a,{label:"",value:""}]),children:"Add option"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:E.map((a,t)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[e.jsx(v,{size:"sm",placeholder:"Label",value:a.label,onChange:c=>g(p=>p.map((n,b)=>b===t?{...n,label:c.target.value}:n))}),e.jsx(v,{size:"sm",placeholder:a.id?"Locked value":"value",value:a.value,disabled:!!a.id,onChange:c=>g(p=>p.map((n,b)=>b===t?{...n,value:c.target.value}:n))}),a.id?e.jsx(s,{as:"span",variant:"meta",tone:"tertiary",className:"flex h-8 items-center px-3",children:"Locked"}):e.jsx(o,{type:"button",size:"sm",variant:"soft-danger",onClick:()=>g(c=>c.filter((p,n)=>n!==t)),children:"Remove"})]},a.id??`new-${t}`))}),G&&e.jsx(s,{as:"p",variant:"micro",tone:"error",className:"mt-2",children:G})]})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:h.isPending,onClick:S,children:"Cancel"}),e.jsx(o,{type:"button",variant:"primary",size:"sm",disabled:!k.trim()||!ie||!te||h.isPending,isLoading:h.isPending,onClick:()=>h.mutate(),children:"Save changes"})]})})]}),e.jsxs(d,{isOpen:!!u,onClose:()=>{f.isPending||N(null)},variant:"confirm",children:[e.jsx(d.Header,{title:"Delete property",onClose:()=>N(null)}),e.jsx(d.Body,{children:u&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(s,{as:"p",variant:"body",weight:"medium",children:["Delete “",u.name,"”?"]}),u.noteCount>0?e.jsxs("div",{className:"rounded-[14px] border border-border-subtle bg-subtle p-3",children:[e.jsxs(s,{as:"p",variant:"label",tone:"secondary",children:["This property is used by ",u.noteCount," note",u.noteCount===1?"":"s","."]}),e.jsx(s,{as:"p",variant:"micro",tone:"tertiary",className:"mt-1 leading-5",children:"Deleting it removes this value from those notes. Future views using this property will need configuration."})]}):e.jsx(s,{as:"p",variant:"label",tone:"tertiary",children:"This property is not used by any note yet."})]})}),e.jsx(d.Footer,{children:e.jsxs(q,{children:[e.jsx(o,{type:"button",variant:"ghost",size:"sm",disabled:f.isPending,onClick:()=>N(null),children:"Cancel"}),e.jsx(o,{type:"button",variant:"danger",size:"sm",isLoading:f.isPending,onClick:ne,children:"Delete"})]})})]})]})}export{Ee as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Note-CmreVzvQ.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/note.api-BQovzEzd.js","assets/url-9nrbQs7Z.js","assets/time-CfAYZipR.js","assets/Callout-CviyPHKO.js","assets/NotePropertiesPanel-DXYgE8h2.js","assets/Plus.es-CRRp2u5J.js","assets/SurfaceCard-GMt5xM7v.js","assets/useReminderMutate--omDLmBV.js","assets/note-ui-CxK8ymUc.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/preload-helper-BXl3LOEh.js","assets/note-ui-DL8owV-U.css","assets/image.api-QmHYjp3z.js","assets/Copy.es-BPreRnP9.js","assets/PencilLine.es-B9V6u64t.js","assets/tag.api-DUfjr8bg.js","assets/Graph-yPE3ljW0.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/Graph-vXQQ0a-Q.js","assets/ArrowRight.es-Bm-ZXpEC.js"])))=>i.map(i=>d[i]);
2
- import{_ as r}from"./preload-helper-BXl3LOEh.js";import{A as n,N as a,G as _}from"./url-9nrbQs7Z.js";const l=new Set(Object.values(n).filter(t=>t!==a).map(t=>t.split("/")[1]).filter(t=>!!t)),s=t=>{const o=t.split("/").filter(Boolean);if(o.length!==1)return null;const[e]=o;return`/${e}`===_?"graph":!e||l.has(e)?null:"note"},i=s(window.location.pathname);i==="note"?r(()=>import("./Note-CmreVzvQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])).catch(()=>{}):i==="graph"&&r(()=>import("./Graph-yPE3ljW0.js"),__vite__mapDeps([19,1,2,3,20,21,22,23,24,25,26,27,28])).catch(()=>{});
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Note-DnXDfDTk.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/NotePropertiesPanel-CsaNhRnE.js","assets/AuxiliaryPanelHeader-B1k7pZpn.js","assets/Plus.es-DRfLW_bI.js","assets/SurfaceCard-t7pdfhEe.js","assets/useReminderMutate-BrGO9M0o.js","assets/note-ui-CtijppHK.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/preload-helper-BXl3LOEh.js","assets/note-ui-DL8owV-U.css","assets/image.api-CyQisInP.js","assets/Copy.es-BoLjilxv.js","assets/PencilLine.es-0JpEgxFY.js","assets/tag.api-DNSQpqwk.js","assets/File.es-Ct7fscBg.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/Graph-LY_IgMYy.js","assets/ArrowRight.es-BEhnlwfe.js"])))=>i.map(i=>d[i]);
2
+ import{_ as r}from"./preload-helper-BXl3LOEh.js";import{A as n,N as a,G as _}from"./url-9nrbQs7Z.js";const l=new Set(Object.values(n).filter(t=>t!==a).map(t=>t.split("/")[1]).filter(t=>!!t)),s=t=>{const o=t.split("/").filter(Boolean);if(o.length!==1)return null;const[e]=o;return`/${e}`===_?"graph":!e||l.has(e)?null:"note"},i=s(window.location.pathname);i==="note"?r(()=>import("./Note-DnXDfDTk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).catch(()=>{}):i==="graph"&&r(()=>import("./Graph-DYUb7gQb.js"),__vite__mapDeps([21,1,2,3,22,23,24,25,26,27,28,29,30])).catch(()=>{});
@@ -0,0 +1 @@
1
+ import{r as s,j as e}from"./floating-ui.react-dom-BWTnA00G.js";import{a as Ne,b as S}from"./time-D5LRMumI.js";import{A as ae,u as we,P as Ce,T as t,L as k,I as R,B as N,x as Ae,y as ke,s as ee,d as Ee,S as Me,J as Se,q as Ie,e as Le,f as Pe}from"./note.api-D3oJmG3q.js";import{f as Fe,s as Ze,a as qe,t as Ke,b as Be}from"./search-admin-adapter-CJnJmL6w.js";import{f as Re}from"./Graph-LY_IgMYy.js";import"./url-9nrbQs7Z.js";const Ue=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),Te=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),se=s.forwardRef((r,i)=>s.createElement(ae,{ref:i,...r,weights:Ue}));se.displayName="ArrowClockwiseIcon";const He=se,ne=s.forwardRef((r,i)=>s.createElement(ae,{ref:i,...r,weights:Te}));ne.displayName="CheckCircleIcon";const U=ne,$e={enabled:!1,baseUrl:"",model:"",queryInstruction:""},De={disabled:"Meaning search off","needs-connection":"Connection test needed","needs-index":"Index needed",indexing:"Building index",ready:"Meaning search ready",error:"Index error"},Ve=(r,i)=>r.enabled===i.enabled&&r.baseUrl===i.baseUrl&&r.model===i.model&&r.queryInstruction===i.queryInstruction,w=r=>{const i=r.trim();let o=i.length;for(;o>0&&i.charCodeAt(o-1)===47;)o-=1;return o===i.length?i:i.slice(0,o)},Qe=r=>/(^|[-_/])(embed|embedding|bge|e5|gte)([-_/.]|$)/i.test(r),ze=r=>{try{const i=new URL(r),o=i.hostname.toLowerCase(),l=o==="localhost"||o==="::1"||o==="[::1]"||o.startsWith("127.");return i.protocol==="http:"&&!l}catch{return!1}},Oe=({hasConnectionFields:r,enabled:i,savedConnectionValidated:o,dirty:l,phase:g,available:m})=>r?i?l?"Save this setting. You can test the model before or after saving.":g==="needs-connection"?"Test the selected model to make meaning search available.":m?"Meaning search is active.":"Build the local index to activate meaning search.":o?"Your saved connection is ready to turn on again.":"You can save this provider now and test it when you are ready.":"Connect an API and choose a model first.",C=(r,i)=>Pe.isAxiosError(r)?r.response?.data?.message??r.message??i:r instanceof Error?r.message:i,Ye=r=>{if(!r)return"Not built yet";const i=new Date(r);return Number.isNaN(i.getTime())?r:i.toLocaleString()},sa=()=>{const r=Le(),i=we(),o=Ie.search.adminStatus(),[l,g]=s.useState($e),[m,te]=s.useState(!1),[y,T]=s.useState([]),[re,H]=s.useState(""),[ie,$]=s.useState(""),[I,L]=s.useState(""),[f,P]=s.useState(!1),[le,D]=s.useState(0),F=a=>{const d=I.trim();return d?{...a,apiKey:d}:f?{...a,apiKey:null}:a},{data:n,error:V,isLoading:de}=Ne({queryKey:o,queryFn:Fe,refetchInterval:a=>a.state.data?.phase==="indexing"||(a.state.data?.pendingNoteCount??0)>0?1e3:!1});s.useEffect(()=>{n&&!m&&(g(n.config),te(!0))},[m,n]);const Q=S({mutationFn:Ze,onSuccess:a=>{i.setQueryData(o,a),g(a.config),L(""),P(!1),r("Search settings saved.")},onError:a=>{r(C(a,"Failed to save search settings."))}}),p=S({mutationFn:qe,onSuccess:({models:a},d)=>{const h=w(d.baseUrl);T(a),H(h),g(j=>{if(w(j.baseUrl)!==h||a.some(B=>B.id===j.model))return j;const J=a.filter(B=>B.likelyEmbedding),X=J.length===1?J[0]:a.length===1?a[0]:null;return X?{...j,model:X.id}:j})}}),u=S({mutationFn:({input:a})=>Ke(a),onSuccess:async({dimensions:a,model:d},{connectionKey:h})=>{$(h),r(`Connected to ${d} (${a} dimensions).`),await i.invalidateQueries({queryKey:o})},onError:a=>{r(C(a,"Could not connect to the embedding API."))}}),z=S({mutationFn:Be,onSuccess:({started:a,status:d})=>{i.setQueryData(o,d),r(a?"Search index build started.":d.needsReindex?"Search index is already updating.":"Search index is already up to date.")},onError:a=>{r(C(a,"Could not start the search index build."))}}),b=w(l.baseUrl),O=`${b}::${l.model.trim()}::${le}`,Y=!!(I.trim()||f),E=!!(n&&(!Ve(l,n.config)||Y)),c=n?.phase==="indexing",x=p.isPending||u.isPending,A=!!(b&&l.model.trim()),_=!!y.length&&re===b,oe=A&&ie===O,ce=!!(!!(A&&n&&w(n.config.baseUrl)===b&&n.config.model.trim()===l.model.trim())&&n?.connectionValidated&&!Y),Z=A,me=!!(m&&E&&!c&&!x&&(!l.enabled||Z)),he=!!(n?.config.enabled&&n.needsReindex&&!E&&!c),ue=ze(b),v=n?.progress,xe=n?De[n.phase]:de?"Loading":"Unavailable",ge=l.queryInstruction.trim()?"Customized":"Optional",pe=Oe({hasConnectionFields:A,enabled:l.enabled,savedConnectionValidated:ce,dirty:E,phase:n?.phase,available:n?.available}),W=s.useMemo(()=>{const a=[...y],d=l.model.trim();return d&&!a.some(h=>h.id===d)&&a.unshift({id:d,likelyEmbedding:Qe(d)}),a},[y,l.model]),M=(a,d)=>{g(h=>({...h,[a]:d}))},q=()=>{$(""),u.reset()},K=()=>{T([]),H(""),q(),p.reset()},be=a=>{const d=b!==w(a);g(h=>({...h,baseUrl:a,model:d?"":h.model})),d&&K()},ye=a=>{L(a),P(!1),D(d=>d+1),K()},fe=()=>{L(""),P(a=>!a),D(a=>a+1),K()},ve=()=>{const a=w(l.baseUrl);g(d=>({...d,baseUrl:a})),q(),p.mutate(F({baseUrl:a}))},G=a=>{M("model",a),q()},je=a=>{(!a||Z)&&M("enabled",a)};return e.jsx(Ce,{title:"Search",variant:"default",description:"Keyword search is always available. Add an embedding API only when you want meaning-based recall.",headerRight:e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:n?.phase==="error"?"error":"secondary",className:"rounded-full border border-border-subtle bg-muted px-3 py-1.5",children:xe}),children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("section",{className:"surface-base flex flex-col gap-4 p-4","aria-labelledby":"embedding-api-heading",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-semibold text-fg-secondary",children:"1"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(t,{id:"embedding-api-heading",as:"h2",variant:"label",weight:"medium",children:"Connect an embedding API"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"leading-relaxed",children:"Enter an OpenAI-compatible API URL and an API key when the provider requires one."})]})]}),e.jsxs("div",{className:"ml-0 space-y-2 sm:ml-10",children:[e.jsx(k,{htmlFor:"semantic-search-base-url",className:"font-medium text-fg-tertiary",children:"API base URL"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(R,{id:"semantic-search-base-url",inputMode:"url",placeholder:"http://127.0.0.1:1234/v1",value:l.baseUrl,disabled:!m||c||x,onChange:a=>be(a.target.value),className:"min-w-0 flex-1"}),e.jsxs(N,{type:"button",variant:"subtle",onClick:ve,isLoading:p.isPending,disabled:!b||c||u.isPending,className:"w-full sm:w-auto",children:[e.jsx(Re,{className:"h-4 w-4"}),"Find models"]})]}),ue&&e.jsx("div",{className:"rounded-[12px] border border-border-secondary/70 bg-muted px-3 py-2.5",children:e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"leading-relaxed",children:"This provider uses unencrypted HTTP. API credentials and note text can be read on the network."})}),e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsxs(k,{htmlFor:"semantic-search-api-key",className:"font-medium text-fg-tertiary",children:["API key ",e.jsx("span",{className:"font-normal text-fg-tertiary",children:"(optional)"})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(R,{id:"semantic-search-api-key",type:"password",autoComplete:"new-password",placeholder:f?"No API key":n?.apiKeyConfigured?"Saved API key":"Enter API key",value:I,disabled:!m||c||x||f,onChange:a=>ye(a.target.value),className:"min-w-0 flex-1"}),n?.apiKeyConfigured&&e.jsx(N,{type:"button",variant:"subtle",onClick:fe,disabled:c||x,className:"w-full sm:w-auto",children:f?"Keep saved key":"Remove saved key"})]}),f&&e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",children:"The saved key will be removed when you save."})]}),_&&e.jsxs("div",{className:"flex items-start gap-2 rounded-[12px] border border-border-subtle bg-accent-soft-success px-3 py-2.5",role:"status",children:[e.jsx(U,{className:"mt-0.5 h-4 w-4 shrink-0 text-accent-success"}),e.jsxs(t,{as:"p",variant:"meta",className:"leading-relaxed text-accent-success",children:["API connected. Found ",y.length," ",y.length===1?"model":"models","."]})]}),p.isError&&e.jsx("div",{className:"rounded-[12px] border border-border-error bg-accent-soft-danger/40 px-3 py-2.5",children:e.jsx(t,{as:"p",variant:"meta",tone:"error",className:"leading-relaxed",children:C(p.error,"Could not list models from this API.")})})]})]}),e.jsxs("section",{className:"surface-base flex flex-col gap-4 p-4","aria-labelledby":"embedding-model-heading",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-semibold text-fg-secondary",children:"2"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(t,{id:"embedding-model-heading",as:"h2",variant:"label",weight:"medium",children:"Choose and test a model"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"leading-relaxed",children:"Choose an embedding model and verify the connection."})]})]}),e.jsxs("div",{className:"ml-0 space-y-3 sm:ml-10",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(k,{htmlFor:"semantic-search-model",className:"font-medium text-fg-tertiary",children:"Embedding model"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(Ae,{id:"semantic-search-model",ariaLabel:"Embedding model",value:l.model,placeholder:p.isPending?"Loading models…":"Find models first",disabled:!W.length||!m||c||x,onValueChange:G,className:"min-w-0 flex-1",children:W.map(a=>e.jsxs(ke,{value:a.id,children:[a.id,a.likelyEmbedding?" · Embedding":""]},a.id))}),e.jsxs(N,{type:"button",variant:"subtle",onClick:()=>u.mutate({input:F(l),connectionKey:O}),isLoading:u.isPending,disabled:!A||c||p.isPending,className:"w-full sm:w-auto",children:[e.jsx(U,{className:"h-4 w-4"}),"Test selected model"]})]}),_&&y.every(a=>!a.likelyEmbedding)&&e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",className:"leading-relaxed",children:"None of these model names clearly identifies an embedding model. Choose one only if your provider documents it as an embedding model, then run the test."})]}),oe&&u.data&&e.jsxs("div",{className:"flex items-start gap-2 rounded-[12px] border border-border-subtle bg-accent-soft-success px-3 py-2.5",role:"status",children:[e.jsx(U,{className:"mt-0.5 h-4 w-4 shrink-0 text-accent-success"}),e.jsxs(t,{as:"p",variant:"meta",className:"leading-relaxed text-accent-success",children:["This model works · ",u.data.dimensions," dimensions"]})]}),u.isError&&e.jsx("div",{className:"rounded-[12px] border border-border-error bg-accent-soft-danger/40 px-3 py-2.5",children:e.jsx(t,{as:"p",variant:"meta",tone:"error",className:"leading-relaxed",children:C(u.error,"Could not connect to the embedding API.")})}),e.jsxs("details",{className:"group rounded-[12px] border border-border-subtle bg-muted",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2.5 marker:hidden",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:"Can't find the model? Enter its ID manually"}),e.jsx(ee,{className:"h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-open:rotate-180","aria-hidden":"true"})]}),e.jsxs("div",{className:"space-y-2 border-t border-border-subtle px-3 py-3",children:[e.jsx(k,{htmlFor:"semantic-search-manual-model",className:"font-medium text-fg-tertiary",children:"Model ID"}),e.jsx(R,{id:"semantic-search-manual-model",placeholder:"text-embedding-qwen3-embedding-0.6b",value:l.model,disabled:!m||c||x,onChange:a=>G(a.target.value)}),e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",children:"Use this fallback when a compatible API does not support model listing."})]})]}),e.jsxs("details",{className:"group rounded-[12px] border border-border-subtle bg-muted",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2.5 marker:hidden",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:"Advanced query instruction"}),e.jsxs(t,{as:"span",variant:"meta",tone:"tertiary",children:[" · ",ge]})]}),e.jsx(ee,{className:"h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-open:rotate-180","aria-hidden":"true"})]}),e.jsxs("div",{className:"space-y-3 border-t border-border-subtle px-3 py-3",children:[e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"leading-relaxed",children:"Leave this blank unless your embedding model documentation explicitly recommends a query instruction. Ocean Brain does not assume a language or retrieval prompt."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(k,{htmlFor:"semantic-search-instruction",className:"font-medium text-fg-tertiary",children:"Query instruction"}),e.jsx(Ee,{id:"semantic-search-instruction",rows:3,placeholder:"Leave blank unless your model recommends an instruction.",value:l.queryInstruction,disabled:!m||c||x,onChange:a=>M("queryInstruction",a.target.value)})]}),l.queryInstruction&&e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(N,{type:"button",size:"sm",variant:"ghost",disabled:c||x,onClick:()=>M("queryInstruction",""),children:"Clear"})}),e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",className:"leading-relaxed",children:"This is added only to the search query, never to note chunks. Changing it does not require rebuilding the index."})]})]})]})]}),e.jsxs("section",{className:"surface-base flex flex-col gap-4 p-4","aria-labelledby":"meaning-search-heading",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-semibold text-fg-secondary",children:"3"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx(t,{id:"meaning-search-heading",as:"h2",variant:"label",weight:"medium",children:"Turn on meaning search"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",className:"max-w-[44rem] leading-relaxed",children:"This adds Meaning and All modes to the full search page. Keyword search remains the default fallback and keeps working even when this feature is off."})]})]}),e.jsx("div",{className:"ml-0 rounded-[14px] border border-border-subtle bg-muted px-3.5 py-3 sm:ml-10",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(t,{as:"p",variant:"meta",weight:"medium",children:"Meaning search"}),e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",children:pe})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:l.enabled?"Enabled":"Disabled"}),e.jsx(Me,{"aria-label":"Meaning search",checked:l.enabled,disabled:!m||c||x||!l.enabled&&!Z,onCheckedChange:je})]})]})}),e.jsx("div",{className:"flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-4",children:e.jsx(N,{type:"button",variant:"primary",onClick:()=>Q.mutate(F(l)),isLoading:Q.isPending,disabled:!me,children:"Save settings"})})]}),e.jsxs("section",{className:"surface-base flex flex-col gap-4 p-4","aria-labelledby":"search-index-heading",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 basis-[28rem] space-y-1",children:[e.jsx(t,{id:"search-index-heading",as:"h2",variant:"label",weight:"medium",children:"Local search index"}),e.jsx(t,{as:"p",variant:"meta",tone:"secondary",children:n?.available?`${n.noteCount} notes · ${n.chunkCount} chunks · ${n.dimensions??0} dimensions`:"Keyword search works without this index."}),e.jsxs(t,{as:"p",variant:"meta",tone:"tertiary",children:["Last synced: ",Ye(n?.lastSyncedAt??n?.indexedAt??null)]}),(n?.pendingNoteCount??0)>0&&e.jsxs(t,{as:"p",variant:"meta",tone:"tertiary",role:"status",children:[n?.pendingNoteCount," ",n?.pendingNoteCount===1?"note is":"notes are"," waiting to sync. Recent edits are grouped before embedding."]})]}),e.jsxs(N,{type:"button",variant:"primary",onClick:()=>z.mutate(),isLoading:z.isPending,disabled:!he,children:[e.jsx(He,{className:"h-4 w-4"}),n?.available&&!n.needsReindex?"Index is up to date":"Build search index"]})]}),E&&e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",children:"Save these settings before building the index."}),c&&e.jsxs("div",{className:"space-y-2","aria-live":"polite",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:"Building embeddings"}),e.jsx(t,{as:"span",variant:"meta",tone:"tertiary",children:v&&v.totalChunks>0?`${v.processedChunks} / ${v.totalChunks} chunks`:"Preparing notes…"})]}),e.jsx(Se,{value:v?.processedChunks??0,max:Math.max(v?.totalChunks??0,1)})]}),n?.needsReindex&&!c&&n.phase!=="error"&&e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",children:"Build the index once to activate meaning search for this model."}),n?.error&&e.jsx("div",{className:"rounded-[14px] border border-border-error bg-accent-soft-danger/40 px-3.5 py-3",children:e.jsx(t,{as:"p",variant:"meta",tone:"error",className:"leading-relaxed",children:n.error})}),n?.syncError&&e.jsx("div",{className:"rounded-[14px] border border-border-error bg-accent-soft-danger/40 px-3.5 py-3",children:e.jsxs(t,{as:"p",variant:"meta",tone:"error",className:"leading-relaxed",children:["Automatic note sync will retry: ",n.syncError]})}),e.jsx(t,{as:"p",variant:"meta",tone:"tertiary",className:"leading-relaxed",children:"Note and query text is sent to the embedding API you configure."}),V&&e.jsx(t,{as:"p",variant:"meta",tone:"error",children:C(V,"Could not load search settings.")})]})]})})};export{sa as default};
@@ -0,0 +1 @@
1
+ import{f as s}from"./note.api-D3oJmG3q.js";const c=async()=>{const{data:a}=await s.get("/api/search-admin/status");return a},e=async a=>{const{data:t}=await s.post("/api/search-admin/config",a);return t},i=async a=>{const{data:t}=await s.post("/api/search-admin/models",a);return t},r=async a=>{const{data:t}=await s.post("/api/search-admin/test",a);return t},o=async()=>{const{data:a}=await s.post("/api/search-admin/reindex");return a};export{i as a,o as b,c as f,e as s,r as t};
@@ -1,4 +1,4 @@
1
- import{g as e}from"./note.api-BQovzEzd.js";function g({query:a="",limit:t=50,offset:n=0,sortBy:r="referenceCount",sortOrder:i="desc"}={}){return e(`query FetchTags(
1
+ import{g as e}from"./note.api-D3oJmG3q.js";function g({query:a="",limit:t=50,offset:n=0,sortBy:r="referenceCount",sortOrder:i="desc"}={}){return e(`query FetchTags(
2
2
  $searchFilter: SearchFilterInput,
3
3
  $pagination: PaginationInput
4
4
  ) {