ltcai 10.2.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +39 -44
  2. package/docs/CHANGELOG.md +48 -0
  3. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  4. package/docs/DEVELOPMENT.md +1 -1
  5. package/docs/MYPY_BACKLOG.md +98 -0
  6. package/docs/ONBOARDING.md +1 -1
  7. package/docs/OPERATIONS.md +1 -1
  8. package/docs/TRUST_MODEL.md +1 -1
  9. package/docs/WHY_LATTICE.md +1 -1
  10. package/docs/kg-schema.md +1 -1
  11. package/lattice_brain/__init__.py +1 -1
  12. package/lattice_brain/graph/_kg_fsutil.py +1 -1
  13. package/lattice_brain/runtime/agent_runtime.py +7 -2
  14. package/lattice_brain/runtime/hooks.py +1 -1
  15. package/lattice_brain/runtime/multi_agent.py +1 -1
  16. package/latticeai/__init__.py +1 -1
  17. package/latticeai/app_factory.py +43 -67
  18. package/latticeai/core/legacy_compatibility.py +1 -1
  19. package/latticeai/core/marketplace.py +1 -1
  20. package/latticeai/core/workspace_os_constants.py +1 -1
  21. package/latticeai/runtime/history_writer.py +138 -0
  22. package/latticeai/services/architecture_readiness.py +1 -1
  23. package/latticeai/services/product_readiness.py +1 -1
  24. package/package.json +4 -2
  25. package/scripts/check_current_release_docs.mjs +1 -1
  26. package/src-tauri/Cargo.lock +1 -1
  27. package/src-tauri/Cargo.toml +1 -1
  28. package/src-tauri/tauri.conf.json +1 -1
  29. package/static/app/asset-manifest.json +37 -37
  30. package/static/app/assets/{Act-CbdGD-2i.js → Act-DrKIGZeJ.js} +1 -1
  31. package/static/app/assets/{AdminConsole-LgCkXpnf.js → AdminConsole-CEV1VefA.js} +1 -1
  32. package/static/app/assets/{Brain-CoPGJI1L.js → Brain-BZSXnwWU.js} +1 -1
  33. package/static/app/assets/{BrainHome-gVnaxSwp.js → BrainHome-CEBd86k6.js} +1 -1
  34. package/static/app/assets/{BrainSignals-ChxAYHtj.js → BrainSignals-O4s6R7av.js} +1 -1
  35. package/static/app/assets/{Capture-DBtgkHZg.js → Capture-AGbOxsg-.js} +1 -1
  36. package/static/app/assets/{CommandPalette-Ovtv5I0Y.js → CommandPalette-CeqBjCn2.js} +1 -1
  37. package/static/app/assets/Library-CXnbNiQW.js +1 -0
  38. package/static/app/assets/{LivingBrain-CNz-6NSd.js → LivingBrain-D9Iei2ZJ.js} +1 -1
  39. package/static/app/assets/{ProductFlow-ePX-Y73J.js → ProductFlow-JlXiDfMM.js} +1 -1
  40. package/static/app/assets/{ReviewCard-C4mpvkwH.js → ReviewCard-QQly2bTV.js} +1 -1
  41. package/static/app/assets/{System-BvWNK1zc.js → System-Bp9ZY4ER.js} +1 -1
  42. package/static/app/assets/{activity-CiauPV_3.js → activity-CxRPOQ2F.js} +1 -1
  43. package/static/app/assets/{bot-Dwct-Q1x.js → bot-1bcsWB2s.js} +1 -1
  44. package/static/app/assets/{brain-BKDW1F0T.js → brain-CxaeKCRM.js} +1 -1
  45. package/static/app/assets/{button-CCB9Kuw7.js → button-ZYFqGan7.js} +1 -1
  46. package/static/app/assets/{circle-pause-DNa8WHC5.js → circle-pause-B5NOIqvk.js} +1 -1
  47. package/static/app/assets/{circle-play-8jmxn5mf.js → circle-play-BiJVFXf7.js} +1 -1
  48. package/static/app/assets/{cpu-mxvF3V1I.js → cpu-Vvq0OKTr.js} +1 -1
  49. package/static/app/assets/{download--SmCcx0p.js → download-SEcXzkx1.js} +1 -1
  50. package/static/app/assets/{folder-open-D4Wy5roo.js → folder-open-Dw1ff_Qa.js} +1 -1
  51. package/static/app/assets/{hard-drive-BwQcSPlS.js → hard-drive-B00fR7_r.js} +1 -1
  52. package/static/app/assets/index-CEkL4_M-.css +2 -0
  53. package/static/app/assets/{index-DDV2YZwM.js → index-Dm9VXl1o.js} +3 -3
  54. package/static/app/assets/{input-DFhSjmLS.js → input-DtdWYQEa.js} +1 -1
  55. package/static/app/assets/{network-Bts7VO94.js → network-CpjBu0kI.js} +1 -1
  56. package/static/app/assets/{primitives-BuSMEJY8.js → primitives-CwsudBwc.js} +1 -1
  57. package/static/app/assets/search-CwEJWBEA.js +1 -0
  58. package/static/app/assets/{shield-alert-BfTO6X_G.js → shield-alert-CpjBc-gQ.js} +1 -1
  59. package/static/app/assets/{textarea-BjctW1oh.js → textarea-DUPyjHQs.js} +1 -1
  60. package/static/app/assets/{useFocusTrap-CE43-LrA.js → useFocusTrap-BWcMtCWH.js} +1 -1
  61. package/static/app/assets/{useQuery-Bv3ejLL5.js → useQuery-Dg5fPqTS.js} +1 -1
  62. package/static/app/assets/{users-CsNqLZAj.js → users-BgcdTQGM.js} +1 -1
  63. package/static/app/assets/{utils-KFFdVG_t.js → utils-a3YXFtEO.js} +1 -1
  64. package/static/app/assets/{workspace-wdCvdyPF.js → workspace-BMUEiXUm.js} +1 -1
  65. package/static/app/index.html +4 -4
  66. package/static/sw.js +1 -1
  67. package/static/app/assets/Library-CBia2Fvm.js +0 -1
  68. package/static/app/assets/index-CQWdDU3z.css +0 -2
  69. package/static/app/assets/search-DZzxhWaQ.js +0 -1
@@ -1 +1 @@
1
- import{S as e,b as t,g as n,r,y as i}from"./utils-KFFdVG_t.js";var a=n(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=e(t()),s=i(),c=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`input`,{ref:n,className:r(`h-10 w-full rounded-md border border-input bg-background/70 px-3 text-sm outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));c.displayName=`Input`;export{a as n,c as t};
1
+ import{S as e,b as t,g as n,r,y as i}from"./utils-a3YXFtEO.js";var a=n(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=e(t()),s=i(),c=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`input`,{ref:n,className:r(`h-10 w-full rounded-md border border-input bg-background/70 px-3 text-sm outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));c.displayName=`Input`;export{a as n,c as t};
@@ -1 +1 @@
1
- import{g as e}from"./utils-KFFdVG_t.js";var t=e(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);export{t};
1
+ import{g as e}from"./utils-a3YXFtEO.js";var t=e(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);export{t};
@@ -1 +1 @@
1
- import{S as e,_ as t,a as n,b as r,c as i,g as a,i as o,l as s,m as c,o as l,r as u,s as d,t as f,y as p}from"./utils-KFFdVG_t.js";import{r as m}from"./useQuery-Bv3ejLL5.js";import{t as ee}from"./workspace-wdCvdyPF.js";import{n as h}from"./input-DFhSjmLS.js";import{t as g}from"./button-CCB9Kuw7.js";var _=a(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),v=a(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),y=a(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),b=a(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),x=e(r()),S=p(),C={default:`border-primary/25 bg-primary/12 text-primary`,success:`border-success/30 bg-success/12 text-success`,warning:`border-warning/30 bg-warning/12 text-warning`,muted:`border-border bg-muted/70 text-muted-foreground`,danger:`border-destructive/30 bg-destructive/12 text-destructive`};function w({className:e,variant:t=`default`,...n}){return(0,S.jsx)(`span`,{className:u(`inline-flex min-h-6 max-w-full items-center whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-semibold leading-none`,C[t],e),...n})}function T({className:e,...t}){return(0,S.jsx)(`section`,{className:u(`premium-surface rounded-lg text-card-foreground`,e),...t})}function E({className:e,...t}){return(0,S.jsx)(`div`,{className:u(`flex flex-col gap-1.5 p-5`,e),...t})}function D({className:e,...t}){return(0,S.jsx)(`h2`,{className:u(`text-base font-semibold tracking-normal`,e),...t})}function O({className:e,...t}){return(0,S.jsx)(`p`,{className:u(`text-sm leading-6 text-muted-foreground`,e),...t})}function k({className:e,...t}){return(0,S.jsx)(`div`,{className:u(`p-5 pt-0`,e),...t})}function A({result:e}){let n=t(e=>e.mode),r=t(e=>e.language);return e?e.source===`live`&&e.ok?(0,S.jsx)(w,{variant:`success`,children:n===`basic`?c(r,`ui.status.ready`):c(r,`ui.status.connected`)}):(0,S.jsx)(w,{variant:`warning`,children:n===`basic`?c(r,`ui.status.needsSetup`):c(r,`ui.status.unavailable`)}):(0,S.jsx)(w,{variant:`muted`,children:c(r,`ui.status.notLoaded`)})}function j({title:e,detail:n}){let r=t(e=>e.language);return(0,S.jsxs)(`div`,{className:`product-empty-state flex min-h-36 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted/24 p-6 text-center text-sm text-muted-foreground`,children:[(0,S.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-card`,children:(0,S.jsx)(b,{className:`h-5 w-5 text-primary`})}),(0,S.jsx)(`div`,{className:`text-base font-semibold text-foreground`,children:e||c(r,`ui.empty.title`)}),n?(0,S.jsx)(`div`,{className:`max-w-md leading-6`,children:n}):null]})}function M({title:e,description:n,result:r,children:i,className:a}){let o=t(e=>e.mode),s=t(e=>e.language);return(0,S.jsxs)(T,{className:u(`data-panel overflow-hidden`,a),children:[(0,S.jsxs)(E,{className:`flex-row items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(D,{children:e}),n?(0,S.jsx)(O,{children:n}):null]}),o===`basic`?null:(0,S.jsx)(A,{result:r})]}),(0,S.jsx)(k,{children:r?.ok?i(r.data):(0,S.jsx)(j,{detail:o===`basic`?c(s,`ui.empty.basicDetail`):r?.error||c(s,`ui.empty.advancedDetail`)})})]})}function N({title:e}){let n=t(e=>e.language);return(0,S.jsxs)(T,{children:[(0,S.jsx)(E,{children:(0,S.jsx)(D,{children:e})}),(0,S.jsx)(k,{children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(v,{className:`h-4 w-4 animate-spin`}),` `,c(n,`ui.loading`)]})})]})}function P({stats:e}){return(0,S.jsx)(`div`,{className:`data-stat-grid grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:e.map(e=>(0,S.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-4`,children:[(0,S.jsx)(`div`,{className:`text-xs uppercase text-muted-foreground`,children:e.label}),(0,S.jsx)(`div`,{className:`mt-2 text-2xl font-semibold leading-tight`,children:typeof e.value==`number`?o(e.value):String(e.value??`-`)}),e.hint?(0,S.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:e.hint}):null]},e.label))})}function F(e){return e==null||e===``?`-`:typeof e==`number`?Number.isFinite(e)?o(e):`-`:typeof e==`boolean`?e?`Enabled`:`Disabled`:String(e)}var I=/(^id$|_id$|token|secret|passphrase|fingerprint|public_key|private_key|dsn|schema|endpoint|base_url|localhost|127\.0\.0\.1|stack|trace|raw|runtime|engine|module|port|host|api|internal)/i;function L(e){return I.test(e)}var R=[`status`,`state`,`name`,`title`,`label`,`summary`,`version`,`ready`];function z(e){for(let t of R){let n=e[t];if(n==null||n===``||typeof n==`object`)continue;let r=F(n);if(r&&r!==`-`)return r.length>96?i(r,96):r}return``}function B(e){let t=F(e);return t===`-`||t.includes(`/`)||t.includes(`@`)||/\.[a-z0-9]{2,5}$/i.test(t)?t:s(t.replace(/^agent:/i,``).replace(/^tool:/i,``))}function V(e){for(let t of[`documents`,`sources`,`items`,`agents`,`workflows`,`runs`,`events`,`permissions`,`models`,`peers`,`invitations`,`roles`,`policies`,`hooks`,`tools`,`templates`,`plugins`,`recent_events`]){let n=f(e[t]);if(n.length)return n}return[]}function H({value:e}){let n=t(e=>e.language);if(typeof e==`boolean`)return(0,S.jsx)(w,{variant:e?`success`:`muted`,children:c(n,e?`ui.value.enabled`:`ui.value.disabled`)});if(Array.isArray(e))return e.length?e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))?(0,S.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,5).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:F(e)},`${String(e)}-${t}`)),e.length>5?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-5]}):null]}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.records`,{count:o(e.length)})}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.none`)});if(l(e)){let t=Object.keys(e);if(!t.length)return(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.noFields`)});let r=z(e);return r?(0,S.jsx)(`span`,{className:`break-words`,children:r}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.fields`,{count:o(t.length)})})}let r=F(e);return(0,S.jsx)(`span`,{className:`break-words`,children:r.length>96?i(r,96):r})}function U({data:e,limit:n=8}){let r=t(e=>e.mode),i=t(e=>e.language),a=Object.entries(e||{}).filter(([e])=>r!==`basic`||!L(e)).slice(0,n);return a.length?(0,S.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:a.map(([e,t])=>(0,S.jsxs)(`div`,{className:`grid grid-cols-[minmax(9rem,0.5fr)_1fr] gap-3 p-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:q(e,i)}),(0,S.jsx)(`span`,{className:`min-w-0 break-words`,children:(0,S.jsx)(H,{value:J(e,t)})})]},e))}):(0,S.jsx)(j,{title:c(i,`ui.noValues`)})}function W({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:i=8}){let a=t(e=>e.mode),o=t(e=>e.language);return a===`basic`?(0,S.jsx)(G,{value:e,titleKey:n,metaKey:r,limit:i}):Array.isArray(e)?e.length?e.every(e=>l(e))?(0,S.jsx)($,{items:e,titleKey:n,metaKey:r,limit:i}):(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background p-3`,children:[e.slice(0,i).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:F(e)},`${String(e)}-${t}`)),e.length>i?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-i]}):null]}):(0,S.jsx)(j,{detail:c(o,`ui.empty.listDetail`)}):l(e)?(0,S.jsx)(U,{data:e,limit:i}):(0,S.jsx)(`div`,{className:`rounded-md border border-border bg-background p-3 text-sm`,children:(0,S.jsx)(H,{value:e})})}function G({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:i=6}){let a=t(e=>e.language);if(Array.isArray(e))return e.length?e.every(e=>l(e))?(0,S.jsx)($,{items:e,titleKey:n,metaKey:r,limit:i}):(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background/55 p-3`,children:[e.slice(0,i).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:B(e)},`${String(e)}-${t}`)),e.length>i?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-i]}):null]}):(0,S.jsx)(j,{detail:c(a,`ui.empty.listDetail`)});if(l(e)){let t=V(e);return t.length?(0,S.jsx)($,{items:t,titleKey:n,metaKey:r,limit:i}):(0,S.jsx)(U,{data:Object.fromEntries(Object.entries(e).filter(([e])=>!L(e)).map(([e,t])=>[e,Array.isArray(t)?`${o(t.length)} items`:l(t)?`available`:t])),limit:i})}return(0,S.jsx)(`div`,{className:`rounded-md border border-border bg-background/55 p-3 text-sm`,children:B(e)})}function K({result:e,successLabel:n}){let r=t(e=>e.mode),i=t(e=>e.language);return e?e.ok?(0,S.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-background p-3`,children:[(0,S.jsx)(w,{variant:`success`,children:n||c(i,`ui.requestCompleted`)}),r===`basic`?(0,S.jsx)(G,{value:e.data}):(0,S.jsx)(W,{value:e.data})]}):(0,S.jsx)(j,{title:c(i,`ui.requestUnavailable`),detail:e.error||(0,S.jsx)(H,{value:e.data})}):null}function q(e,t){let n=`ui.field.${e.toLowerCase()}`,r=c(t,n);return r===n?s(e):r}function J(e,t){return/model/i.test(e)?typeof t==`string`&&t.includes(`/`)?n(t):Array.isArray(t)?t.map(e=>typeof e==`string`&&e.includes(`/`)?n(e):e):t:t}function Y(e,t){let n=F(e),r=n.charAt(0).toUpperCase()+n.slice(1).toLowerCase();for(let e of[n,r]){let n=`ui.entity.${e}`,r=c(t,n);if(r!==n)return r}return B(n)}function X(e,t,n,r){if(!e)return``;let i=[t.type,t.id,t.name].map(e=>String(e||``).toLowerCase().split(`:`).pop()||``).filter(Boolean);for(let t of i){let i=`${e}.${t}${n}`,a=c(r,i);if(a!==i)return a}return``}function Z(e,t,n,r){for(let n of[e[t],e.name,e.label,r===`basic`?``:e.id]){let e=d(n);if(e)return e}return`#${n+1}`}function Q(e,t,n,r){let i=Z(e,t,n,r);for(let t of[e.summary,e.description,e.path]){let e=d(t);if(e&&e!==i)return e}return``}function $({items:e,titleKey:n=`title`,metaKey:r=`type`,limit:a=8,labelPrefix:o}){let s=t(e=>e.mode),l=t(e=>e.language),u=f(e).slice(0,a);return u.length?(0,S.jsx)(`div`,{className:`entity-list grid gap-2`,children:u.map((e,t)=>{let a=X(o,e,``,l),c=a||Z(e,n,t,s),u=a?``:Y(e[r]||e.status||e.state||`ready`,l);return(0,S.jsxs)(`div`,{className:`entity-list-row rounded-lg border border-border bg-background/55 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,S.jsx)(`div`,{className:`font-medium`,children:c}),u&&u.toLowerCase()!==c.toLowerCase()?(0,S.jsx)(w,{variant:`muted`,children:u}):null]}),X(o,e,`.detail`,l)||Q(e,n,t,s)?(0,S.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:X(o,e,`.detail`,l)||Q(e,n,t,s)}):null,s!==`basic`&&e.id&&e[n]!==e.id?(0,S.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:i(e.id,48)}):null]},String(e.id||e.name||t))})}):(0,S.jsx)(j,{detail:c(l,`ui.empty.listDetail`)})}function te({title:e,detail:n,target:r=`advanced`}){let i=t(e=>e.setMode),a=t(e=>e.language);return(0,S.jsx)(T,{children:(0,S.jsxs)(k,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,S.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-background/70`,children:(0,S.jsx)(y,{className:`h-5 w-5 text-primary`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-lg font-semibold`,children:e||c(a,`ui.modeGate.title`)}),(0,S.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-muted-foreground`,children:n||c(a,`ui.modeGate.detail`)})]}),(0,S.jsx)(g,{onClick:()=>i(r),children:r===`admin`?c(a,`ui.modeGate.admin`):c(a,`ui.modeGate.advanced`)})]})})}function ne({label:e,successLabel:n,action:r,onSuccess:i,invalidate:a,variant:o=`outline`,disabled:s}){let l=m(),d=t(e=>e.language),f=n||c(d,`ui.done`),[p,y]=x.useState(null),b=ee({mutationFn:r,onSuccess:async e=>{y(e.ok?f:e.error||c(d,`ui.status.unavailable`)),e.ok&&(await i?.(e),a&&await Promise.all(a.map(e=>l.invalidateQueries({queryKey:[e]}))))}});return(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsxs)(g,{variant:o,disabled:s||b.isPending,onClick:()=>b.mutate(),children:[b.isPending?(0,S.jsx)(v,{className:`h-4 w-4 animate-spin`}):null,e]}),p?(0,S.jsxs)(`span`,{className:u(`inline-flex items-center gap-1 text-xs`,p===f?`text-success`:`text-warning`),children:[p===f?(0,S.jsx)(h,{className:`h-3.5 w-3.5`}):(0,S.jsx)(_,{className:`h-3.5 w-3.5`}),p]}):null]})}function re({tabs:e,value:t,onChange:n}){let r=x.useRef([]),i=(t,i)=>{let a=(t+i+e.length)%e.length;r.current[a]?.focus(),n(e[a].id)};return(0,S.jsx)(`div`,{className:`product-tabs inline-flex max-w-full flex-wrap gap-1 rounded-lg border border-border bg-muted/28 p-1`,role:`tablist`,children:e.map((a,o)=>(0,S.jsx)(`button`,{ref:e=>{r.current[o]=e},type:`button`,role:`tab`,"aria-selected":t===a.id,tabIndex:t===a.id?0:-1,onClick:()=>n(a.id),onKeyDown:t=>{t.key===`ArrowRight`||t.key===`ArrowDown`?(t.preventDefault(),i(o,1)):t.key===`ArrowLeft`||t.key===`ArrowUp`?(t.preventDefault(),i(o,-1)):t.key===`Home`?(t.preventDefault(),r.current[0]?.focus(),n(e[0].id)):t.key===`End`&&(t.preventDefault(),r.current[e.length-1]?.focus(),n(e[e.length-1].id))},className:u(`h-9 rounded-md px-3.5 text-sm font-semibold transition`,t===a.id?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:a.label},a.id))})}export{D as _,U as a,v as b,K as c,re as d,H as f,E as g,O as h,$ as i,P as l,k as m,M as n,N as o,T as p,j as r,te as s,ne as t,W as u,w as v,_ as x,b as y};
1
+ import{S as e,_ as t,a as n,b as r,c as i,g as a,i as o,l as s,m as c,o as l,r as u,s as d,t as f,y as p}from"./utils-a3YXFtEO.js";import{r as m}from"./useQuery-Dg5fPqTS.js";import{t as ee}from"./workspace-BMUEiXUm.js";import{n as h}from"./input-DtdWYQEa.js";import{t as g}from"./button-ZYFqGan7.js";var _=a(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),v=a(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),y=a(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),b=a(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),x=e(r()),S=p(),C={default:`border-primary/25 bg-primary/12 text-primary`,success:`border-success/30 bg-success/12 text-success`,warning:`border-warning/30 bg-warning/12 text-warning`,muted:`border-border bg-muted/70 text-muted-foreground`,danger:`border-destructive/30 bg-destructive/12 text-destructive`};function w({className:e,variant:t=`default`,...n}){return(0,S.jsx)(`span`,{className:u(`inline-flex min-h-6 max-w-full items-center whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-semibold leading-none`,C[t],e),...n})}function T({className:e,...t}){return(0,S.jsx)(`section`,{className:u(`premium-surface rounded-lg text-card-foreground`,e),...t})}function E({className:e,...t}){return(0,S.jsx)(`div`,{className:u(`flex flex-col gap-1.5 p-5`,e),...t})}function D({className:e,...t}){return(0,S.jsx)(`h2`,{className:u(`text-base font-semibold tracking-normal`,e),...t})}function O({className:e,...t}){return(0,S.jsx)(`p`,{className:u(`text-sm leading-6 text-muted-foreground`,e),...t})}function k({className:e,...t}){return(0,S.jsx)(`div`,{className:u(`p-5 pt-0`,e),...t})}function A({result:e}){let n=t(e=>e.mode),r=t(e=>e.language);return e?e.source===`live`&&e.ok?(0,S.jsx)(w,{variant:`success`,children:n===`basic`?c(r,`ui.status.ready`):c(r,`ui.status.connected`)}):(0,S.jsx)(w,{variant:`warning`,children:n===`basic`?c(r,`ui.status.needsSetup`):c(r,`ui.status.unavailable`)}):(0,S.jsx)(w,{variant:`muted`,children:c(r,`ui.status.notLoaded`)})}function j({title:e,detail:n}){let r=t(e=>e.language);return(0,S.jsxs)(`div`,{className:`product-empty-state flex min-h-36 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted/24 p-6 text-center text-sm text-muted-foreground`,children:[(0,S.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-card`,children:(0,S.jsx)(b,{className:`h-5 w-5 text-primary`})}),(0,S.jsx)(`div`,{className:`text-base font-semibold text-foreground`,children:e||c(r,`ui.empty.title`)}),n?(0,S.jsx)(`div`,{className:`max-w-md leading-6`,children:n}):null]})}function M({title:e,description:n,result:r,children:i,className:a}){let o=t(e=>e.mode),s=t(e=>e.language);return(0,S.jsxs)(T,{className:u(`data-panel overflow-hidden`,a),children:[(0,S.jsxs)(E,{className:`flex-row items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(D,{children:e}),n?(0,S.jsx)(O,{children:n}):null]}),o===`basic`?null:(0,S.jsx)(A,{result:r})]}),(0,S.jsx)(k,{children:r?.ok?i(r.data):(0,S.jsx)(j,{detail:o===`basic`?c(s,`ui.empty.basicDetail`):r?.error||c(s,`ui.empty.advancedDetail`)})})]})}function N({title:e}){let n=t(e=>e.language);return(0,S.jsxs)(T,{children:[(0,S.jsx)(E,{children:(0,S.jsx)(D,{children:e})}),(0,S.jsx)(k,{children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(v,{className:`h-4 w-4 animate-spin`}),` `,c(n,`ui.loading`)]})})]})}function P({stats:e}){return(0,S.jsx)(`div`,{className:`data-stat-grid grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:e.map(e=>(0,S.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-4`,children:[(0,S.jsx)(`div`,{className:`text-xs uppercase text-muted-foreground`,children:e.label}),(0,S.jsx)(`div`,{className:`mt-2 text-2xl font-semibold leading-tight`,children:typeof e.value==`number`?o(e.value):String(e.value??`-`)}),e.hint?(0,S.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:e.hint}):null]},e.label))})}function F(e){return e==null||e===``?`-`:typeof e==`number`?Number.isFinite(e)?o(e):`-`:typeof e==`boolean`?e?`Enabled`:`Disabled`:String(e)}var I=/(^id$|_id$|token|secret|passphrase|fingerprint|public_key|private_key|dsn|schema|endpoint|base_url|localhost|127\.0\.0\.1|stack|trace|raw|runtime|engine|module|port|host|api|internal)/i;function L(e){return I.test(e)}var R=[`status`,`state`,`name`,`title`,`label`,`summary`,`version`,`ready`];function z(e){for(let t of R){let n=e[t];if(n==null||n===``||typeof n==`object`)continue;let r=F(n);if(r&&r!==`-`)return r.length>96?i(r,96):r}return``}function B(e){let t=F(e);return t===`-`||t.includes(`/`)||t.includes(`@`)||/\.[a-z0-9]{2,5}$/i.test(t)?t:s(t.replace(/^agent:/i,``).replace(/^tool:/i,``))}function V(e){for(let t of[`documents`,`sources`,`items`,`agents`,`workflows`,`runs`,`events`,`permissions`,`models`,`peers`,`invitations`,`roles`,`policies`,`hooks`,`tools`,`templates`,`plugins`,`recent_events`]){let n=f(e[t]);if(n.length)return n}return[]}function H({value:e}){let n=t(e=>e.language);if(typeof e==`boolean`)return(0,S.jsx)(w,{variant:e?`success`:`muted`,children:c(n,e?`ui.value.enabled`:`ui.value.disabled`)});if(Array.isArray(e))return e.length?e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))?(0,S.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,5).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:F(e)},`${String(e)}-${t}`)),e.length>5?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-5]}):null]}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.records`,{count:o(e.length)})}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.none`)});if(l(e)){let t=Object.keys(e);if(!t.length)return(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.noFields`)});let r=z(e);return r?(0,S.jsx)(`span`,{className:`break-words`,children:r}):(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:c(n,`ui.value.fields`,{count:o(t.length)})})}let r=F(e);return(0,S.jsx)(`span`,{className:`break-words`,children:r.length>96?i(r,96):r})}function U({data:e,limit:n=8}){let r=t(e=>e.mode),i=t(e=>e.language),a=Object.entries(e||{}).filter(([e])=>r!==`basic`||!L(e)).slice(0,n);return a.length?(0,S.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:a.map(([e,t])=>(0,S.jsxs)(`div`,{className:`grid grid-cols-[minmax(9rem,0.5fr)_1fr] gap-3 p-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:q(e,i)}),(0,S.jsx)(`span`,{className:`min-w-0 break-words`,children:(0,S.jsx)(H,{value:J(e,t)})})]},e))}):(0,S.jsx)(j,{title:c(i,`ui.noValues`)})}function W({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:i=8}){let a=t(e=>e.mode),o=t(e=>e.language);return a===`basic`?(0,S.jsx)(G,{value:e,titleKey:n,metaKey:r,limit:i}):Array.isArray(e)?e.length?e.every(e=>l(e))?(0,S.jsx)($,{items:e,titleKey:n,metaKey:r,limit:i}):(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background p-3`,children:[e.slice(0,i).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:F(e)},`${String(e)}-${t}`)),e.length>i?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-i]}):null]}):(0,S.jsx)(j,{detail:c(o,`ui.empty.listDetail`)}):l(e)?(0,S.jsx)(U,{data:e,limit:i}):(0,S.jsx)(`div`,{className:`rounded-md border border-border bg-background p-3 text-sm`,children:(0,S.jsx)(H,{value:e})})}function G({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:i=6}){let a=t(e=>e.language);if(Array.isArray(e))return e.length?e.every(e=>l(e))?(0,S.jsx)($,{items:e,titleKey:n,metaKey:r,limit:i}):(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background/55 p-3`,children:[e.slice(0,i).map((e,t)=>(0,S.jsx)(w,{variant:`muted`,children:B(e)},`${String(e)}-${t}`)),e.length>i?(0,S.jsxs)(w,{variant:`muted`,children:[`+`,e.length-i]}):null]}):(0,S.jsx)(j,{detail:c(a,`ui.empty.listDetail`)});if(l(e)){let t=V(e);return t.length?(0,S.jsx)($,{items:t,titleKey:n,metaKey:r,limit:i}):(0,S.jsx)(U,{data:Object.fromEntries(Object.entries(e).filter(([e])=>!L(e)).map(([e,t])=>[e,Array.isArray(t)?`${o(t.length)} items`:l(t)?`available`:t])),limit:i})}return(0,S.jsx)(`div`,{className:`rounded-md border border-border bg-background/55 p-3 text-sm`,children:B(e)})}function K({result:e,successLabel:n}){let r=t(e=>e.mode),i=t(e=>e.language);return e?e.ok?(0,S.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-background p-3`,children:[(0,S.jsx)(w,{variant:`success`,children:n||c(i,`ui.requestCompleted`)}),r===`basic`?(0,S.jsx)(G,{value:e.data}):(0,S.jsx)(W,{value:e.data})]}):(0,S.jsx)(j,{title:c(i,`ui.requestUnavailable`),detail:e.error||(0,S.jsx)(H,{value:e.data})}):null}function q(e,t){let n=`ui.field.${e.toLowerCase()}`,r=c(t,n);return r===n?s(e):r}function J(e,t){return/model/i.test(e)?typeof t==`string`&&t.includes(`/`)?n(t):Array.isArray(t)?t.map(e=>typeof e==`string`&&e.includes(`/`)?n(e):e):t:t}function Y(e,t){let n=F(e),r=n.charAt(0).toUpperCase()+n.slice(1).toLowerCase();for(let e of[n,r]){let n=`ui.entity.${e}`,r=c(t,n);if(r!==n)return r}return B(n)}function X(e,t,n,r){if(!e)return``;let i=[t.type,t.id,t.name].map(e=>String(e||``).toLowerCase().split(`:`).pop()||``).filter(Boolean);for(let t of i){let i=`${e}.${t}${n}`,a=c(r,i);if(a!==i)return a}return``}function Z(e,t,n,r){for(let n of[e[t],e.name,e.label,r===`basic`?``:e.id]){let e=d(n);if(e)return e}return`#${n+1}`}function Q(e,t,n,r){let i=Z(e,t,n,r);for(let t of[e.summary,e.description,e.path]){let e=d(t);if(e&&e!==i)return e}return``}function $({items:e,titleKey:n=`title`,metaKey:r=`type`,limit:a=8,labelPrefix:o}){let s=t(e=>e.mode),l=t(e=>e.language),u=f(e).slice(0,a);return u.length?(0,S.jsx)(`div`,{className:`entity-list grid gap-2`,children:u.map((e,t)=>{let a=X(o,e,``,l),c=a||Z(e,n,t,s),u=a?``:Y(e[r]||e.status||e.state||`ready`,l);return(0,S.jsxs)(`div`,{className:`entity-list-row rounded-lg border border-border bg-background/55 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,S.jsx)(`div`,{className:`font-medium`,children:c}),u&&u.toLowerCase()!==c.toLowerCase()?(0,S.jsx)(w,{variant:`muted`,children:u}):null]}),X(o,e,`.detail`,l)||Q(e,n,t,s)?(0,S.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:X(o,e,`.detail`,l)||Q(e,n,t,s)}):null,s!==`basic`&&e.id&&e[n]!==e.id?(0,S.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:i(e.id,48)}):null]},String(e.id||e.name||t))})}):(0,S.jsx)(j,{detail:c(l,`ui.empty.listDetail`)})}function te({title:e,detail:n,target:r=`advanced`}){let i=t(e=>e.setMode),a=t(e=>e.language);return(0,S.jsx)(T,{children:(0,S.jsxs)(k,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,S.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-background/70`,children:(0,S.jsx)(y,{className:`h-5 w-5 text-primary`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-lg font-semibold`,children:e||c(a,`ui.modeGate.title`)}),(0,S.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-muted-foreground`,children:n||c(a,`ui.modeGate.detail`)})]}),(0,S.jsx)(g,{onClick:()=>i(r),children:r===`admin`?c(a,`ui.modeGate.admin`):c(a,`ui.modeGate.advanced`)})]})})}function ne({label:e,successLabel:n,action:r,onSuccess:i,invalidate:a,variant:o=`outline`,disabled:s}){let l=m(),d=t(e=>e.language),f=n||c(d,`ui.done`),[p,y]=x.useState(null),b=ee({mutationFn:r,onSuccess:async e=>{y(e.ok?f:e.error||c(d,`ui.status.unavailable`)),e.ok&&(await i?.(e),a&&await Promise.all(a.map(e=>l.invalidateQueries({queryKey:[e]}))))}});return(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsxs)(g,{variant:o,disabled:s||b.isPending,onClick:()=>b.mutate(),children:[b.isPending?(0,S.jsx)(v,{className:`h-4 w-4 animate-spin`}):null,e]}),p?(0,S.jsxs)(`span`,{className:u(`inline-flex items-center gap-1 text-xs`,p===f?`text-success`:`text-warning`),children:[p===f?(0,S.jsx)(h,{className:`h-3.5 w-3.5`}):(0,S.jsx)(_,{className:`h-3.5 w-3.5`}),p]}):null]})}function re({tabs:e,value:t,onChange:n}){let r=x.useRef([]),i=(t,i)=>{let a=(t+i+e.length)%e.length;r.current[a]?.focus(),n(e[a].id)};return(0,S.jsx)(`div`,{className:`product-tabs inline-flex max-w-full flex-wrap gap-1 rounded-lg border border-border bg-muted/28 p-1`,role:`tablist`,children:e.map((a,o)=>(0,S.jsx)(`button`,{ref:e=>{r.current[o]=e},type:`button`,role:`tab`,"aria-selected":t===a.id,tabIndex:t===a.id?0:-1,onClick:()=>n(a.id),onKeyDown:t=>{t.key===`ArrowRight`||t.key===`ArrowDown`?(t.preventDefault(),i(o,1)):t.key===`ArrowLeft`||t.key===`ArrowUp`?(t.preventDefault(),i(o,-1)):t.key===`Home`?(t.preventDefault(),r.current[0]?.focus(),n(e[0].id)):t.key===`End`&&(t.preventDefault(),r.current[e.length-1]?.focus(),n(e[e.length-1].id))},className:u(`h-9 rounded-md px-3.5 text-sm font-semibold transition`,t===a.id?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:a.label},a.id))})}export{D as _,U as a,v as b,K as c,re as d,H as f,E as g,O as h,$ as i,P as l,k as m,M as n,N as o,T as p,j as r,te as s,ne as t,W as u,w as v,_ as x,b as y};
@@ -0,0 +1 @@
1
+ import{g as e}from"./utils-a3YXFtEO.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -1 +1 @@
1
- import{g as e}from"./utils-KFFdVG_t.js";var t=e(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]);export{t};
1
+ import{g as e}from"./utils-a3YXFtEO.js";var t=e(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]);export{t};
@@ -1 +1 @@
1
- import{S as e,b as t,r as n,y as r}from"./utils-KFFdVG_t.js";var i=e(t()),a=r(),o=i.forwardRef(({className:e,...t},r)=>(0,a.jsx)(`textarea`,{ref:r,className:n(`min-h-28 w-full resize-y rounded-md border border-input bg-background/70 px-3 py-3 text-sm leading-6 outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));o.displayName=`Textarea`;export{o as t};
1
+ import{S as e,b as t,r as n,y as r}from"./utils-a3YXFtEO.js";var i=e(t()),a=r(),o=i.forwardRef(({className:e,...t},r)=>(0,a.jsx)(`textarea`,{ref:r,className:n(`min-h-28 w-full resize-y rounded-md border border-input bg-background/70 px-3 py-3 text-sm leading-6 outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));o.displayName=`Textarea`;export{o as t};
@@ -1 +1 @@
1
- import{S as e,b as t,g as n}from"./utils-KFFdVG_t.js";var r=n(`sunrise`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]),i=e(t()),a=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`[tabindex]:not([tabindex="-1"])`].join(`, `);function o(e){return Array.from(e.querySelectorAll(a)).filter(e=>!e.closest(`[hidden]`)&&e.getAttribute(`aria-hidden`)!==`true`)}function s(e,t=!0){let n=i.useRef(null),r=i.useRef(e);return r.current=e,i.useEffect(()=>{if(!t)return;let e=n.current;if(!e)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null;e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`-1`),(o(e)[0]||e).focus();let a=t=>{if(t.key===`Escape`&&r.current){t.preventDefault(),t.stopPropagation(),r.current();return}if(t.key!==`Tab`)return;let n=o(e);if(!n.length){t.preventDefault(),e.focus();return}let i=n[0],a=n[n.length-1],s=document.activeElement;t.shiftKey?(s===i||s===e||!e.contains(s))&&(t.preventDefault(),a.focus()):(s===a||!e.contains(s))&&(t.preventDefault(),i.focus())};return e.addEventListener(`keydown`,a),()=>{e.removeEventListener(`keydown`,a),i?.focus?.()}},[t]),n}export{r as n,s as t};
1
+ import{S as e,b as t,g as n}from"./utils-a3YXFtEO.js";var r=n(`sunrise`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]),i=e(t()),a=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`[tabindex]:not([tabindex="-1"])`].join(`, `);function o(e){return Array.from(e.querySelectorAll(a)).filter(e=>!e.closest(`[hidden]`)&&e.getAttribute(`aria-hidden`)!==`true`)}function s(e,t=!0){let n=i.useRef(null),r=i.useRef(e);return r.current=e,i.useEffect(()=>{if(!t)return;let e=n.current;if(!e)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null;e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`-1`),(o(e)[0]||e).focus();let a=t=>{if(t.key===`Escape`&&r.current){t.preventDefault(),t.stopPropagation(),r.current();return}if(t.key!==`Tab`)return;let n=o(e);if(!n.length){t.preventDefault(),e.focus();return}let i=n[0],a=n[n.length-1],s=document.activeElement;t.shiftKey?(s===i||s===e||!e.contains(s))&&(t.preventDefault(),a.focus()):(s===a||!e.contains(s))&&(t.preventDefault(),i.focus())};return e.addEventListener(`keydown`,a),()=>{e.removeEventListener(`keydown`,a),i?.focus?.()}},[t]),n}export{r as n,s as t};
@@ -1 +1 @@
1
- import{S as e,b as t,y as n}from"./utils-KFFdVG_t.js";var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(e){setTimeout(e,0)}var c=typeof window>`u`||`Deno`in globalThis;function l(){}function u(e,t){return typeof e==`function`?e(t):e}function d(e){return typeof e==`number`&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==_(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function g(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(a))return!1}else if(!y(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function y(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>y(e[n],t[n])):!1}var b=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=C(e)&&C(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:b.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!T(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!T(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function T(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{o.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>c;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=s;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ae(),N=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function P(e){return(e??`online`)===`online`?N.isOnline():!0}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,a=j(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new F(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>i.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>P(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let i=e.retry??(A.isServer()?0:3),a=e.retryDelay??oe,s=typeof a==`function`?a(n,r):a,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(o.clearTimeout(this.#e),this.#e=void 0)}};function se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{re(e,()=>t.signal,()=>n=!0)},u=O(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ne:te;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ce:R,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:R(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function R(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var le=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=V(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=V(this.options);e.data!==void 0&&(this.setState(B(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=E(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>m(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>p(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=O(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...z(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...B(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function z(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function B(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function V(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var H=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),W(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof m(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&K(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||p(this.options.staleTime,this.#t)!==p(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l)),t}#g(){this.#b();let e=p(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!d(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=o.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||m(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=o.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(o.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(o.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&W(e,t),o=i&&K(e,n,t,r);(a||o)&&(l={...l,...z(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:h}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,d=E(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=E(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=d!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:q(e,t),refetch:this.refetch,promise:this.#o,isEnabled:m(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=j())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!S(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function U(e,t){return m(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&m(t.retryOnMount,e)===!1)}function W(e,t){return U(e,t)||e.state.data!==void 0&&G(e,t,t.refetchOnMount)}function G(e,t,n){if(m(t.enabled,e)!==!1&&p(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&q(e,t)}return!1}function K(e,t,n,r){return(e!==t||m(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&q(e,n)}function q(e,t){return m(t.enabled,e)!==!1&&e.isStaleByTime(p(t.staleTime,e))}function ue(e,t){return!S(e.getCurrentResult(),t)}var J=e(t(),1),de=n(),Y=J.createContext(void 0),X=e=>{let t=J.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},fe=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,de.jsx)(Y.Provider,{value:e,children:t})),Z=J.createContext(!1),pe=()=>J.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Q=J.createContext(me()),he=()=>J.useContext(Q),ge=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_e=e=>{J.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,xe=(e,t)=>e?.suspense&&t.isPending,$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Se(e,t,n){let r=pe(),i=he(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ye(o),ge(o,i,s),_e(i);let u=!a.getQueryCache().get(o.queryHash),[d]=J.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=p?d.subscribe(M.batchCalls(e)):l;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),J.useEffect(()=>{d.setOptions(o)},[o,d]),xe(o,f))throw $(o,d,i);if(ve({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!A.isServer()&&be(f,r)&&(u?$(o,d,i):s?.promise)?.catch(l).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Ce(e,t){return Se(e,H,t)}export{S as _,L as a,i as b,M as c,_ as d,g as f,p as g,y as h,le as i,u as l,l as m,fe as n,I as o,h as p,X as r,N as s,Ce as t,v as u,k as v,r as x,D as y};
1
+ import{S as e,b as t,y as n}from"./utils-a3YXFtEO.js";var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(e){setTimeout(e,0)}var c=typeof window>`u`||`Deno`in globalThis;function l(){}function u(e,t){return typeof e==`function`?e(t):e}function d(e){return typeof e==`number`&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==_(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function g(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(a))return!1}else if(!y(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function y(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>y(e[n],t[n])):!1}var b=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=C(e)&&C(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:b.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!T(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!T(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function T(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{o.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>c;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=s;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ae(),N=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function P(e){return(e??`online`)===`online`?N.isOnline():!0}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,a=j(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new F(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>i.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>P(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let i=e.retry??(A.isServer()?0:3),a=e.retryDelay??oe,s=typeof a==`function`?a(n,r):a,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(o.clearTimeout(this.#e),this.#e=void 0)}};function se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{re(e,()=>t.signal,()=>n=!0)},u=O(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ne:te;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ce:R,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:R(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function R(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var le=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=V(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=V(this.options);e.data!==void 0&&(this.setState(B(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=E(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>m(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>p(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=O(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...z(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...B(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function z(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function B(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function V(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var H=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),W(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof m(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&K(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||p(this.options.staleTime,this.#t)!==p(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l)),t}#g(){this.#b();let e=p(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!d(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=o.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||m(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=o.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(o.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(o.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&W(e,t),o=i&&K(e,n,t,r);(a||o)&&(l={...l,...z(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:h}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,d=E(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=E(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=d!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:q(e,t),refetch:this.refetch,promise:this.#o,isEnabled:m(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=j())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!S(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function U(e,t){return m(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&m(t.retryOnMount,e)===!1)}function W(e,t){return U(e,t)||e.state.data!==void 0&&G(e,t,t.refetchOnMount)}function G(e,t,n){if(m(t.enabled,e)!==!1&&p(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&q(e,t)}return!1}function K(e,t,n,r){return(e!==t||m(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&q(e,n)}function q(e,t){return m(t.enabled,e)!==!1&&e.isStaleByTime(p(t.staleTime,e))}function ue(e,t){return!S(e.getCurrentResult(),t)}var J=e(t(),1),de=n(),Y=J.createContext(void 0),X=e=>{let t=J.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},fe=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,de.jsx)(Y.Provider,{value:e,children:t})),Z=J.createContext(!1),pe=()=>J.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Q=J.createContext(me()),he=()=>J.useContext(Q),ge=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_e=e=>{J.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,xe=(e,t)=>e?.suspense&&t.isPending,$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Se(e,t,n){let r=pe(),i=he(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ye(o),ge(o,i,s),_e(i);let u=!a.getQueryCache().get(o.queryHash),[d]=J.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=p?d.subscribe(M.batchCalls(e)):l;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),J.useEffect(()=>{d.setOptions(o)},[o,d]),xe(o,f))throw $(o,d,i);if(ve({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!A.isServer()&&be(f,r)&&(u?$(o,d,i):s?.promise)?.catch(l).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Ce(e,t){return Se(e,H,t)}export{S as _,L as a,i as b,M as c,_ as d,g as f,p as g,y as h,le as i,u as l,l as m,fe as n,I as o,h as p,X as r,N as s,Ce as t,v as u,k as v,r as x,D as y};
@@ -1 +1 @@
1
- import{g as e}from"./utils-KFFdVG_t.js";var t=e(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);export{t};
1
+ import{g as e}from"./utils-a3YXFtEO.js";var t=e(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);export{t};
@@ -1,4 +1,4 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=o(((e,t)=>{t.exports=d()})),p=c(u(),1),m=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},h=(e=>e?m(e):m),g=e=>e;function _(e,t=g){let n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}var v=e=>{let t=h(e),n=e=>_(t,e);return Object.assign(n,t),n},y=(e=>e?v(e):v);function b(){try{let e=localStorage.getItem(`lattice.theme`);if(e===`light`||e===`dark`)return e}catch{}return`light`}function x(){try{let e=localStorage.getItem(`lattice.mode`);if(e===`basic`||e===`advanced`||e===`admin`)return e}catch{}return`basic`}function S(){try{return localStorage.getItem(`lattice.workspace`)||null}catch{}return null}function C(){try{let e=localStorage.getItem(`lattice.language`);if(e===`ko`||e===`en`)return e}catch{}return(typeof navigator<`u`?navigator.language.toLowerCase():``).startsWith(`ko`)?`ko`:`en`}var w=y(e=>({theme:b(),mode:x(),workspaceId:S(),apiBase:null,language:C(),setTheme:t=>{document.documentElement.dataset.theme=t;try{localStorage.setItem(`lattice.theme`,t)}catch{}e({theme:t})},setMode:t=>{try{localStorage.setItem(`lattice.mode`,t)}catch{}e({mode:t})},setWorkspaceId:t=>{if(t)try{localStorage.setItem(`lattice.workspace`,t)}catch{}else try{localStorage.removeItem(`lattice.workspace`)}catch{}e({workspaceId:t})},setApiBase:t=>e({apiBase:t}),setLanguage:t=>{document.documentElement.lang=t===`ko`?`ko`:`en`;try{localStorage.setItem(`lattice.language`,t)}catch{}e({language:t})}})),T=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),E=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),D=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),O=e=>{let t=D(e);return t.charAt(0).toUpperCase()+t.slice(1)},k={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},A=(0,p.createContext)({}),j=()=>(0,p.useContext)(A),M=(0,p.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:m=``}=j()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,p.createElement)(`svg`,{ref:c,...k,width:t??l??k.width,height:t??l??k.height,stroke:e??f,strokeWidth:h,className:T(`lucide`,m,i),...!a&&!ee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),N=(e,t)=>{let n=(0,p.forwardRef)(({className:n,...r},i)=>(0,p.createElement)(M,{ref:i,iconNode:t,className:T(`lucide-${E(O(e))}`,`lucide-${e}`,n),...r}));return n.displayName=O(e),n},P=/\{[^{}]+\}/g,F=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function te(){return Math.random().toString(36).slice(2,11)}function ne(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:o,headers:s,requestInitExt:c=void 0,...l}={...e};c=F()?c:void 0,t=ce(t);let u=[];async function d(e,d){let{baseUrl:f,fetch:p=r,Request:m=n,headers:h,params:g={},parseAs:_=`json`,querySerializer:v,bodySerializer:y=a??oe,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=ce(f)??t);let T=typeof i==`function`?i:L(i);v&&(T=typeof v==`function`?v:L({...typeof i==`object`?i:{},...v}));let E=b||o||ae,D=x===void 0?void 0:y(x,se(s,h,g.header)),O=se(D===void 0||D instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),k=[...u,...S],ee={redirect:`follow`,...l,...C,body:D,headers:O},A,j,M=new m(R(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:E}),ee),N;for(let e in C)e in M||(M[e]=C[e]);if(k.length){A=te(),j=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:E});for(let t of k)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:M,schemaPath:e,params:g,options:j,id:A});if(n)if(n instanceof m)M=n;else if(n instanceof Response){N=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}if(!N){try{N=await p(M,c)}catch(t){let n=t;if(k.length)for(let t=k.length-1;t>=0;t--){let r=k[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:M,error:n,schemaPath:e,params:g,options:j,id:A});if(t){if(t instanceof Response){n=void 0,N=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(k.length)for(let t=k.length-1;t>=0;t--){let n=k[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:M,response:N,schemaPath:e,params:g,options:j,id:A});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);N=t}}}}let P=N.headers.get(`Content-Length`);if(N.status===204||M.method===`HEAD`||P===`0`&&!N.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return N.ok?{data:void 0,response:N}:{error:void 0,response:N};if(N.ok)return{data:await(async()=>{if(_===`stream`)return N.body;if(_===`json`&&!P){let e=await N.text();return e?JSON.parse(e):void 0}return await N[_]()})(),response:N};let F=await N.text();try{F=JSON.parse(F)}catch{}return{error:F,response:N}}return{request(e,t,n){return d(t,{...n,method:e.toUpperCase()})},GET(e,t){return d(e,{...t,method:`GET`})},PUT(e,t){return d(e,{...t,method:`PUT`})},POST(e,t){return d(e,{...t,method:`POST`})},DELETE(e,t){return d(e,{...t,method:`DELETE`})},OPTIONS(e,t){return d(e,{...t,method:`OPTIONS`})},HEAD(e,t){return d(e,{...t,method:`HEAD`})},PATCH(e,t){return d(e,{...t,method:`PATCH`})},TRACE(e,t){return d(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(t)}},eject(...e){for(let t of e){let e=u.indexOf(t);e!==-1&&u.splice(e,1)}}}}function re(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function ie(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(re(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function I(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(re(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function L(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(I(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(ie(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(re(r,i,e))}}return n.join(`&`)}}function ae(e,t){let n=e;for(let r of e.match(P)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,I(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,ie(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${re(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function oe(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function R(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function se(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function ce(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var z={ko:{},en:{}},le=new Set;function ue(e){le.has(e)||(le.add(e),Object.assign(z.ko,e.ko),Object.assign(z.en,e.en))}ue({ko:{"brain.title":`Lattice Brain`,"language.label":`언어`,"language.ko":`한국어`,"language.en":`English`,"shell.route.brain":`대화`,"shell.route.capture":`자료`,"shell.route.memory":`기억`,"shell.route.library":`AI 모델`,"shell.route.system":`설정`,"shell.route.act":`작업`,"shell.skip":`본문으로 건너뛰기`,"shell.menu.open":`메뉴 열기`,"shell.menu.close":`메뉴 닫기`,"shell.menu.title":`더보기`,"shell.theme.toLight":`밝은 화면으로 바꾸기`,"shell.theme.toDark":`어두운 화면으로 바꾸기`,"shell.menu.nav":`화면 이동`,"shell.menu.workspace":`작업 공간`,"shell.loading":`Brain 작업공간을 여는 중...`,"shell.workspace.label":`작업공간 및 프로필`,"shell.workspace.current":`현재 작업공간`,"shell.workspace.switch":`전환`,"shell.workspace.active":`사용 중`,"shell.workspace.empty":`아직 작업공간이 없습니다`,"shell.workspace.personal":`개인 Brain`,"shell.workspace.manageSpaces":`작업공간 관리`,"shell.workspace.close":`닫기`,"shell.profile.label":`프로필`,"shell.profile.owner":`소유자`,"shell.profile.signedOut":`로그인하지 않음`,"shell.profile.you":`내 계정`,"shell.profile.manage":`계정 설정 열기`,"shell.admin.label":`관리자`,"shell.admin.open":`관리자 콘솔 열기`,"shell.admin.tooltip":`설정, 에이전트, 도구 레지스트리 관리`,"shell.admin.needsMode":`관리자 콘솔은 고급 또는 관리자 모드에서만 사용할 수 있습니다`,"shell.admin.enable":`관리자 모드로 전환`,"shell.mode.label":`모드`,"shell.mode.basic":`기본`,"shell.mode.advanced":`고급`,"shell.mode.admin":`관리자`,"shell.mode.info":`모드는 표시되는 도구와 관리자 화면의 범위를 정합니다`,"shell.account.aria":`계정과 워크스페이스`,"shell.account.workspaceLabel":`워크스페이스`,"shell.account.personal":`개인 Brain`,"shell.account.modeLabel":`보기 모드`,"shell.account.mode.basic":`기본`,"shell.account.mode.advanced":`고급`,"shell.account.mode.admin":`관리자`,"shell.account.open":`계정·워크스페이스 메뉴 열기`,"shell.account.menuAria":`계정과 워크스페이스 메뉴`,"shell.account.profile":`프로필과 계정`,"shell.account.workspaces":`워크스페이스 전환`,"shell.account.admin":`관리자 콘솔`,"shell.account.settings":`설정 열기`,"shell.sync.aria":`VS Code 확장 연동 상태`,"shell.sync.label":`VS Code`,"shell.sync.connected":`연결됨`,"shell.sync.indexing":`인덱싱 중`,"shell.sync.synced":`동기화됨`,"shell.sync.offline":`연결 안 됨`,"shell.sync.checking":`확인 중`,"shell.sync.detail":`확장과 메인 앱이 같은 Brain을 공유합니다.`,"shell.sync.detailOffline":`VS Code 확장이 아직 이 Brain에 연결되지 않았습니다.`,"feedback.retry":`다시 시도`,"service.unavailable.title":`로컬 Lattice 서비스를 사용할 수 없습니다`,"service.unavailable.detail":`빈 Brain으로 표시하지 않았습니다. 연결을 확인한 뒤 다시 시도하세요. ({detail})`,"feedback.error.title":`문제가 생겼어요`,"feedback.error.body":`잠시 후 다시 시도하거나 설정에서 연결을 확인하세요.`,"ui.status.notLoaded":`확인 전`,"ui.status.ready":`사용 가능`,"ui.status.connected":`연결됨`,"ui.status.needsSetup":`준비 필요`,"ui.status.unavailable":`응답 없음`,"ui.empty.title":`아직 비어 있어요`,"ui.empty.basicDetail":`자료를 넣거나 준비가 끝나면 여기에 내용이 나타납니다.`,"ui.empty.advancedDetail":`이 기능이 지금 응답하지 않습니다.`,"ui.empty.listDetail":`새 항목이 생기면 여기에 표시됩니다.`,"ui.loading":`불러오는 중…`,"ui.cancel":`취소`,"ui.done":`완료`,"ui.requestCompleted":`요청이 완료되었습니다`,"ui.requestUnavailable":`요청을 처리하지 못했어요`,"ui.noValues":`표시할 값이 없어요`,"ui.value.enabled":`활성화됨`,"ui.value.disabled":`비활성화됨`,"ui.value.none":`없음`,"ui.value.records":`레코드 {count}개`,"ui.value.noFields":`필드 없음`,"ui.value.fields":`내용 {count}가지`,"ui.entity.Task":`할 일`,"ui.entity.Concept":`주제`,"ui.entity.Document":`문서`,"ui.entity.Chunk":`문서 조각`,"ui.entity.Source":`출처`,"ui.entity.Chat":`대화`,"ui.entity.Message":`메시지`,"ui.entity.AIResponse":`Brain 답변`,"ui.entity.Person":`사람`,"ui.entity.Event":`일정`,"ui.entity.Place":`장소`,"ui.entity.Organization":`조직`,"ui.field.status":`상태`,"ui.field.state":`상태`,"ui.field.version":`버전`,"ui.field.mode":`모드`,"ui.field.platform":`플랫폼`,"ui.field.device":`장치`,"ui.field.current_model":`지금 쓰는 모델`,"ui.field.loaded_models":`불러온 모델`,"ui.field.model":`모델`,"ui.field.model_id":`모델 이름`,"ui.field.provider":`제공자`,"ui.field.requested_provider":`요청한 제공자`,"ui.field.active_provider":`실제 제공자`,"ui.field.dimensions":`벡터 차원`,"ui.field.grade":`품질 등급`,"ui.field.runtime":`실행 환경`,"ui.field.health":`상태 점검`,"ui.field.ready":`사용 준비`,"ui.field.execution_mode":`실행 방식`,"ui.field.roles":`역할`,"ui.field.agents":`에이전트`,"ui.field.runs":`실행 기록`,"ui.field.contracts":`계약`,"ui.field.checks":`점검 항목`,"ui.field.cpu_pct":`CPU 사용률`,"ui.field.ram_pct":`메모리 사용률`,"ui.field.gpu_mem_pct":`GPU 메모리 사용률`,"ui.field.gpu_mem_gb":`GPU 메모리`,"ui.field.features":`기능 설정`,"ui.entity.Indexed":`정리 완료`,"ui.entity.Ready":`준비됨`,"ui.entity.Pending":`대기 중`,"ui.entity.Queued":`대기 중`,"ui.entity.Running":`진행 중`,"ui.entity.Complete":`완료`,"ui.entity.Completed":`완료`,"ui.entity.Failed":`실패`,"ui.entity.Error":`오류`,"ui.entity.Ok":`정상`,"ui.entity.Record":`항목`,"ui.entity.Active":`사용 중`,"ui.entity.Disabled":`꺼짐`,"ui.entity.Enabled":`켜짐`,"ui.field.available":`사용 가능`,"ui.field.directory":`저장 위치`,"ui.field.count":`개수`,"ui.field.latest":`가장 최근`,"ui.field.latest_bytes":`최근 파일 크기`,"ui.field.encrypted_archives":`암호화된 백업`,"ui.field.zip_backups":`압축 백업`,"ui.field.last_verified":`마지막 확인`,"ui.field.failure":`실패`,"ui.field.enabled":`사용`,"ui.field.capabilities":`할 수 있는 일`,"ui.field.engine":`저장 엔진`,"ui.field.detail":`설명`,"ui.field.description":`설명`,"ui.field.summary":`요약`,"ui.field.name":`이름`,"ui.field.title":`제목`,"ui.field.type":`종류`,"ui.field.id":`식별자`,"ui.field.path":`경로`,"ui.field.size_bytes":`크기`,"ui.field.total_items":`전체 항목`,"ui.field.sources":`출처`,"ui.field.approved":`승인됨`,"ui.field.approved_at":`승인 시각`,"ui.field.approved_by":`승인한 사람`,"ui.field.created_at":`만든 시각`,"ui.field.updated_at":`수정 시각`,"ui.field.backup_health":`백업 상태`,"ui.field.reason":`이유`,"ui.field.message":`메시지`,"ui.field.scopes":`허용 폴더`,"ui.field.running":`실행 중`,"ui.field.armed":`예약됨`,"ui.field.tick_seconds":`확인 주기(초)`,"ui.field.tz":`표준시`,"ui.field.activities":`활동`,"ui.field.notice":`안내`,"ui.field.kind":`종류`,"ui.field.source":`출처`,"ui.field.enabled_at":`켠 시각`,"ui.field.disabled":`꺼짐`,"ui.modeGate.title":`고급 설정`,"ui.modeGate.detail":`진단이나 관리 기능이 필요할 때 모드를 전환하세요. 기본 모드는 일상 사용에 집중합니다.`,"ui.modeGate.advanced":`고급 모드로 전환`,"ui.modeGate.admin":`관리자 콘솔로 전환`,"command.title":`명령 팔레트`,"command.shortcutKey":`K`,"command.placeholder":`검색하거나 이동할 곳을 입력하세요...`,"command.results":`검색 결과`,"command.searching":`Brain에서 찾는 중...`,"command.empty":`일치하는 항목이 없습니다`,"command.footer":`↑↓로 이동, Enter로 선택, Esc로 닫기`,"command.group.pages":`화면 이동`,"command.group.knowledge":`지식`,"command.group.conversation":`지난 대화`,"command.group.automation":`자동화`,"command.automation.enabled":`켜짐`,"command.automation.draft":`초안`,"command.page.review":`검토함`,"briefing.title":`오늘의 브리핑`,"briefing.subtitle":`Brain이 정리한 오늘의 현황과 다음 할 일`,"briefing.loading":`브리핑을 준비하는 중...`,"briefing.stat.questions":`질문`,"briefing.stat.automations":`자동화 켜짐`,"briefing.stat.review":`검토 대기`,"briefing.stat.health":`Brain 건강`,"briefing.recent":`최근 담긴 지식`,"briefing.suggestions":`나를 위한 자동화 제안 {count}개가 기다리고 있어요`,"briefing.action.reviewPending":`검토 대기 {count}건 확인하기`,"briefing.action.enableDrafts":`꺼져 있는 자동화 초안 {count}개 살펴보기`,"briefing.action.installSuggestion":`추천 자동화 {count}개 보러 가기`,"briefing.action.connectKnowledge":`지식 폴더 연결하기`,"briefing.action.checkHealth":`Brain 건강 점검하기`,"briefing.action.askBrain":`Brain에게 질문하기`,"briefing.empty":`아직 보여드릴 브리핑이 없어요. 자료를 넣고 대화를 시작하면 이곳에 하루 요약이 쌓입니다.`,"command.proactive.title":`지금 바로`,"command.proactive.briefing":`오늘의 브리핑 열기`,"command.proactive.review":`검토 대기 항목 보기`,"command.proactive.suggestions":`오늘의 제안 {count}개`,"command.proactive.pending":`{count}건 대기 중`,"proposals.title":`변경 제안`,"proposals.subtitle":`기존 파일을 바꾸는 작업은 검토 후 적용됩니다`,"proposals.loading":`제안을 불러오는 중...`,"proposals.empty":`대기 중인 변경 제안이 없습니다`,"proposals.diff":`변경 내용 미리보기`,"proposals.tier.small":`작은 수정`,"proposals.tier.large":`큰 수정`,"proposals.kind.delete":`삭제`,"proposals.approve":`승인하고 적용`,"proposals.reject":`거절`,"proposals.note":`새 파일 생성은 바로 실행되고, 기존 내용 수정과 삭제만 여기에서 검토합니다. 승인 전에는 아무것도 바뀌지 않습니다.`,"proposals.conflict.title":`파일이 그 사이 변경되었습니다`,"proposals.conflict.detail":`제안을 만든 뒤 파일 내용이 바뀌어 그대로 적용하면 최근 수정이 사라질 수 있어요. 현재 파일을 다시 읽어 새 제안으로 만들 수 있습니다.`,"proposals.conflict.rebase":`다시 읽어서 재적용`,"proposals.conflict.rebasing":`현재 파일을 다시 읽는 중…`,"proposals.conflict.rebased":`현재 파일 기준으로 새 제안을 만들었어요. 새 변경 내용을 확인해 주세요.`,"proposals.conflict.alreadyApplied":`이미 같은 내용이 반영되어 있어 이 제안을 정리했어요.`,"proposals.conflict.failed":`다시 적용을 준비하지 못했어요: {reason}`},en:{"brain.title":`Lattice Brain`,"language.label":`Language`,"language.ko":`한국어`,"language.en":`English`,"shell.route.brain":`Chat`,"shell.route.capture":`Sources`,"shell.route.memory":`Memory`,"shell.route.library":`AI model`,"shell.route.system":`Settings`,"shell.route.act":`Work`,"shell.skip":`Skip to content`,"shell.menu.open":`Open menu`,"shell.menu.close":`Close menu`,"shell.menu.title":`More`,"shell.theme.toLight":`Switch to the light screen`,"shell.theme.toDark":`Switch to the dark screen`,"shell.menu.nav":`Go to`,"shell.menu.workspace":`Workspace`,"shell.loading":`Loading Brain workspace...`,"shell.workspace.label":`Workspace and profile`,"shell.workspace.current":`Current workspace`,"shell.workspace.switch":`Switch`,"shell.workspace.active":`Active`,"shell.workspace.empty":`No workspaces yet`,"shell.workspace.personal":`Personal Brain`,"shell.workspace.manageSpaces":`Manage workspaces`,"shell.workspace.close":`Close`,"shell.profile.label":`Profile`,"shell.profile.owner":`Owner`,"shell.profile.signedOut":`Not signed in`,"shell.profile.you":`You`,"shell.profile.manage":`Open account settings`,"shell.admin.label":`Admin`,"shell.admin.open":`Open Admin Console`,"shell.admin.tooltip":`Manage settings, agents, and the tool registry`,"shell.admin.needsMode":`Admin Console is available in Advanced or Admin mode`,"shell.admin.enable":`Switch to Admin mode`,"shell.mode.label":`Mode`,"shell.mode.basic":`Basic`,"shell.mode.advanced":`Advanced`,"shell.mode.admin":`Admin`,"shell.mode.info":`Mode sets which tools and admin surfaces are shown`,"shell.account.aria":`Account and workspace`,"shell.account.workspaceLabel":`Workspace`,"shell.account.personal":`Personal Brain`,"shell.account.modeLabel":`View mode`,"shell.account.mode.basic":`Basic`,"shell.account.mode.advanced":`Advanced`,"shell.account.mode.admin":`Admin`,"shell.account.open":`Open account and workspace menu`,"shell.account.menuAria":`Account and workspace menu`,"shell.account.profile":`Profile & account`,"shell.account.workspaces":`Switch workspace`,"shell.account.admin":`Admin console`,"shell.account.settings":`Open settings`,"shell.sync.aria":`VS Code extension link status`,"shell.sync.label":`VS Code`,"shell.sync.connected":`Connected`,"shell.sync.indexing":`Indexing`,"shell.sync.synced":`Synced`,"shell.sync.offline":`Not connected`,"shell.sync.checking":`Checking`,"shell.sync.detail":`The extension and main app share the same Brain.`,"shell.sync.detailOffline":`The VS Code extension is not linked to this Brain yet.`,"feedback.retry":`Retry`,"service.unavailable.title":`The local Lattice service is unavailable`,"service.unavailable.detail":`This is not being shown as an empty Brain. Check the connection and retry. ({detail})`,"feedback.error.title":`Something went wrong`,"feedback.error.body":`Try again shortly or check the connection in Settings.`,"ui.status.notLoaded":`Not loaded`,"ui.status.ready":`Ready`,"ui.status.connected":`Connected`,"ui.status.needsSetup":`Needs setup`,"ui.status.unavailable":`Not responding`,"ui.empty.title":`Nothing here yet`,"ui.empty.basicDetail":`Add material or finish setup and content will appear here.`,"ui.empty.advancedDetail":`This capability is not reporting right now.`,"ui.empty.listDetail":`New items will appear here when Lattice has something to show.`,"ui.loading":`Loading…`,"ui.cancel":`Cancel`,"ui.done":`Done`,"ui.requestCompleted":`Request completed`,"ui.requestUnavailable":`Request could not be completed`,"ui.noValues":`No values to show`,"ui.value.enabled":`enabled`,"ui.value.disabled":`disabled`,"ui.value.none":`None`,"ui.value.records":`{count} records`,"ui.value.noFields":`No fields`,"ui.value.fields":`{count} details`,"ui.entity.Task":`Task`,"ui.entity.Concept":`Topic`,"ui.entity.Document":`Document`,"ui.entity.Chunk":`Excerpt`,"ui.entity.Source":`Source`,"ui.entity.Chat":`Conversation`,"ui.entity.Message":`Message`,"ui.entity.AIResponse":`Brain reply`,"ui.entity.Person":`Person`,"ui.entity.Event":`Event`,"ui.entity.Place":`Place`,"ui.entity.Organization":`Organization`,"ui.field.status":`Status`,"ui.field.state":`State`,"ui.field.version":`Version`,"ui.field.mode":`Mode`,"ui.field.platform":`Platform`,"ui.field.device":`Device`,"ui.field.current_model":`Model in use`,"ui.field.loaded_models":`Loaded models`,"ui.field.model":`Model`,"ui.field.model_id":`Model name`,"ui.field.provider":`Provider`,"ui.field.requested_provider":`Requested provider`,"ui.field.active_provider":`Active provider`,"ui.field.dimensions":`Vector size`,"ui.field.grade":`Quality grade`,"ui.field.runtime":`Runtime`,"ui.field.health":`Health check`,"ui.field.ready":`Ready`,"ui.field.execution_mode":`Execution`,"ui.field.roles":`Roles`,"ui.field.agents":`Agents`,"ui.field.runs":`Runs`,"ui.field.contracts":`Contracts`,"ui.field.checks":`Checks`,"ui.field.cpu_pct":`CPU use`,"ui.field.ram_pct":`Memory use`,"ui.field.gpu_mem_pct":`GPU memory use`,"ui.field.gpu_mem_gb":`GPU memory`,"ui.field.features":`Feature settings`,"ui.entity.Indexed":`Indexed`,"ui.entity.Ready":`Ready`,"ui.entity.Pending":`Pending`,"ui.entity.Queued":`Queued`,"ui.entity.Running":`Running`,"ui.entity.Complete":`Complete`,"ui.entity.Completed":`Complete`,"ui.entity.Failed":`Failed`,"ui.entity.Error":`Error`,"ui.entity.Ok":`OK`,"ui.entity.Record":`Item`,"ui.entity.Active":`Active`,"ui.entity.Disabled":`Off`,"ui.entity.Enabled":`On`,"ui.field.available":`Available`,"ui.field.directory":`Location`,"ui.field.count":`Count`,"ui.field.latest":`Most recent`,"ui.field.latest_bytes":`Latest size`,"ui.field.encrypted_archives":`Encrypted backups`,"ui.field.zip_backups":`Zip backups`,"ui.field.last_verified":`Last verified`,"ui.field.failure":`Failure`,"ui.field.enabled":`Enabled`,"ui.field.capabilities":`Can do`,"ui.field.engine":`Storage engine`,"ui.field.detail":`Detail`,"ui.field.description":`Description`,"ui.field.summary":`Summary`,"ui.field.name":`Name`,"ui.field.title":`Title`,"ui.field.type":`Type`,"ui.field.id":`Identifier`,"ui.field.path":`Path`,"ui.field.size_bytes":`Size`,"ui.field.total_items":`Total items`,"ui.field.sources":`Sources`,"ui.field.approved":`Approved`,"ui.field.approved_at":`Approved at`,"ui.field.approved_by":`Approved by`,"ui.field.created_at":`Created`,"ui.field.updated_at":`Updated`,"ui.field.backup_health":`Backup health`,"ui.field.reason":`Reason`,"ui.field.message":`Message`,"ui.field.scopes":`Allowed folders`,"ui.field.running":`Running`,"ui.field.armed":`Armed`,"ui.field.tick_seconds":`Check interval (s)`,"ui.field.tz":`Time zone`,"ui.field.activities":`Activity`,"ui.field.notice":`Notice`,"ui.field.kind":`Kind`,"ui.field.source":`Source`,"ui.field.enabled_at":`Turned on`,"ui.field.disabled":`Off`,"ui.modeGate.title":`Advanced controls`,"ui.modeGate.detail":`Switch modes when you want diagnostics or administrative controls. Basic mode keeps the product focused on everyday use.`,"ui.modeGate.advanced":`Switch to Advanced`,"ui.modeGate.admin":`Switch to Admin Console`,"command.title":`Command palette`,"command.shortcutKey":`K`,"command.placeholder":`Search or jump anywhere...`,"command.results":`Search results`,"command.searching":`Searching your Brain...`,"command.empty":`No matches found`,"command.footer":`↑↓ to move, Enter to select, Esc to close`,"command.group.pages":`Go to`,"command.group.knowledge":`Knowledge`,"command.group.conversation":`Past conversations`,"command.group.automation":`Automations`,"command.automation.enabled":`Enabled`,"command.automation.draft":`Draft`,"command.page.review":`Review inbox`,"briefing.title":`Today's briefing`,"briefing.subtitle":`What your Brain sees today, and what to do next`,"briefing.loading":`Preparing your briefing...`,"briefing.stat.questions":`Questions`,"briefing.stat.automations":`Automations on`,"briefing.stat.review":`Awaiting review`,"briefing.stat.health":`Brain health`,"briefing.recent":`Recently added knowledge`,"briefing.suggestions":`{count} automation suggestions are waiting for you`,"briefing.action.reviewPending":`Check {count} items awaiting review`,"briefing.action.enableDrafts":`Look at {count} disabled automation drafts`,"briefing.action.installSuggestion":`See {count} suggested automations`,"briefing.action.connectKnowledge":`Connect a knowledge folder`,"briefing.action.checkHealth":`Check Brain health`,"briefing.action.askBrain":`Ask your Brain`,"briefing.empty":`Nothing to brief yet. Add some knowledge and start a conversation — your daily summary will build up here.`,"command.proactive.title":`Right now`,"command.proactive.briefing":`Open today's briefing`,"command.proactive.review":`See items awaiting review`,"command.proactive.suggestions":`{count} suggestions today`,"command.proactive.pending":`{count} waiting`,"proposals.title":`Change proposals`,"proposals.subtitle":`Changes to existing files apply only after your review`,"proposals.loading":`Loading proposals...`,"proposals.empty":`No pending change proposals`,"proposals.diff":`Change preview`,"proposals.tier.small":`Small change`,"proposals.tier.large":`Large change`,"proposals.kind.delete":`Deletion`,"proposals.approve":`Approve & apply`,"proposals.reject":`Reject`,"proposals.note":`Creating new files runs immediately; only edits and deletions of existing content are reviewed here. Nothing changes until you approve.`,"proposals.conflict.title":`The file changed in the meantime`,"proposals.conflict.detail":`The file was edited after this proposal was staged, so applying it as-is could erase recent changes. You can re-read the current file and stage a fresh proposal against it.`,"proposals.conflict.rebase":`Re-read & re-apply`,"proposals.conflict.rebasing":`Re-reading the current file…`,"proposals.conflict.rebased":`Staged a fresh proposal against the current file. Please review the new changes.`,"proposals.conflict.alreadyApplied":`The file already contains this change, so the proposal was retired.`,"proposals.conflict.failed":`Could not prepare the re-apply: {reason}`}});var de=`10.2.0`,fe={ko:`한국어`,en:`English`};function pe(e,t,n){let r=z[e]?.[t]||z.ko[t]||t,i={version:de,...n||{}};for(let[e,t]of Object.entries(i))r=r.replaceAll(`{${e}}`,String(t));return r}var me=`modulepreload`,he=function(e){return`/static/app/`+e},ge={},_e=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=he(t,n),t in ge)return;ge[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:me,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ve=1e4,ye=new Map,be=null;function xe(){return``}function Se(){return!!(window.__TAURI_INTERNALS__||window.__TAURI__?.core?.invoke)}async function Ce(){return Se()?(be||=_e(async()=>{let{invoke:e}=await import(`./core-CwxXejkd.js`);return{invoke:e}},[]).then(({invoke:e})=>e(`backend_origin`)).then(e=>e||null).catch(()=>null),be):null}async function we(e,t){let n=window.__TAURI__?.core?.invoke;if(n)try{return await n(e,t)}catch{return null}if(!window.__TAURI_INTERNALS__)return null;try{let{invoke:n}=await _e(async()=>{let{invoke:e}=await import(`./core-CwxXejkd.js`);return{invoke:e}},[]);return await n(e,t)}catch{return null}}async function Te(){let e=await we(`select_folder`);if(e)return e;try{return await window.latticeDesktop?.selectFolder?.()||null}catch{return null}}async function B(){let e=w.getState().apiBase;if(e)return e;let t=await Ce();return t?(w.getState().setApiBase(t),t):xe()}function Ee(e){return ye.has(e)||ye.set(e,ne({baseUrl:e,credentials:`include`})),ye.get(e)}function De(e){return Array.isArray(e)?[]:e&&typeof e==`object`?{...e}:e}function V(){let e=w.getState().workspaceId;return e?{"X-Workspace-Id":e}:{}}function Oe(){try{return w.getState().language}catch{return`ko`}}function ke(){return pe(Oe(),`api.error.unreachable`)}function Ae(e){return pe(Oe(),`api.error.request`,{status:e})}function H(e,t){if(!e)return t;let n=typeof e==`object`&&e?e:null,r=n?.detail;if(typeof r==`string`)return r;let i=typeof r==`object`&&r?r:null;if(i){let e=i.user_message||i.reason||i.action||i.status;if(e)return String(e)}let a=n?.message||n?.error;return a?String(a):t}function je(e,t){let n=e instanceof Error?e.message:String(e);return/not valid JSON|Unexpected token|JSON/i.test(n)?t:/aborted|abort|timed?\s?out/i.test(n)?pe(Oe(),`api.error.timeout`):/failed to fetch|load failed|networkerror|network request failed/i.test(n)?pe(Oe(),`api.error.unreachable`):n||t}async function Me(e,t,n){let r=Ee(await B()),i=new AbortController,a=window.setTimeout(()=>i.abort(),ve);try{let a={body:n.body,params:{query:n.query||{}},headers:{...V(),...n.headers||{}},signal:i.signal},{data:o,error:s,response:c}=await(e===`GET`?r.GET:e===`POST`?r.POST:e===`PATCH`?r.PATCH:r.DELETE)(t,a);return c.ok&&o!==void 0?{ok:!0,status:c.status,data:o,source:`live`}:{ok:!1,status:c.status,data:De(n.shape),source:`unavailable`,error:H(s,Ae(c.status))}}catch(e){return{ok:!1,status:0,data:De(n.shape),source:`unavailable`,error:je(e,ke())}}finally{window.clearTimeout(a)}}async function Ne(e,t){let n=Ee(await B()),r=new AbortController,i=window.setTimeout(()=>r.abort(),ve);try{let{data:i,error:a,response:o}=await t(n,r.signal);return o.ok&&i!==void 0?{ok:!0,status:o.status,data:i,source:`live`}:{ok:!1,status:o.status,data:De(e),source:`unavailable`,error:H(a,Ae(o.status))}}catch(t){return{ok:!1,status:0,data:De(e),source:`unavailable`,error:je(t,ke())}}finally{window.clearTimeout(i)}}function U(e,t,n){return Me(`GET`,e,{query:n,shape:t})}function W(e,t,n){return Me(`POST`,e,{body:t,shape:n})}function Pe(e,t,n){return Me(`PATCH`,e,{body:t,shape:n})}function Fe(e,t){return Me(`DELETE`,e,{shape:t})}function Ie(){return{id:``,status:`pending`,effective_status:`pending`,title:``,summary:``,source:`workflow_run`,kind:`suggestion`,payload:{},provenance:{}}}function Le(){return{items:[]}}function Re(e){return Ne(Le(),(t,n)=>t.GET(`/automation/reviews`,{params:{query:e||{}},headers:V(),signal:n}))}function ze(e,t){return Ne(Ie(),(n,r)=>{let i={params:{path:{item_id:e}},headers:V(),signal:r};return t===`approve`?n.POST(`/automation/reviews/{item_id}/approve`,i):t===`dismiss`?n.POST(`/automation/reviews/{item_id}/dismiss`,i):t===`run_now`?n.POST(`/automation/reviews/{item_id}/run_now`,i):n.POST(`/automation/reviews/{item_id}/unsnooze`,i)})}function Be(e,t){return Ne(Ie(),(n,r)=>n.POST(`/automation/reviews/{item_id}/snooze`,{params:{path:{item_id:e}},body:{until:t},headers:V(),signal:r}))}async function Ve(e){let t=await B(),n=new FormData;n.append(`file`,e);try{let e=await fetch(`${t}/upload/document`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,...V()},body:n}),r=await e.json().catch(()=>null);return{ok:e.ok,status:e.status,data:r,source:e.ok?`live`:`unavailable`,error:e.ok?void 0:H(r,e.statusText||`Upload failed`)}}catch(e){return{ok:!1,status:0,data:null,source:`unavailable`,error:String(e)}}}async function He(e,t={}){let n=await B(),r=await fetch(`${n}/engines/prepare-model/stream`,{method:`POST`,credentials:`include`,signal:t.signal,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,...V()},body:JSON.stringify({engine:null,allow_download:!1,...e})});if(!r.ok||!r.body||!(r.headers.get(`content-type`)||``).includes(`text/event-stream`)){let e=await r.json().catch(()=>null),n=e?.detail&&typeof e.detail==`object`?e.detail:e,i=H(e,r.statusText);return t.onError?.({status:`error`,user_message:i,...n||{}}),{source:`live`,ok:!1,status:r.status,data:n||{},error:i}}let i=r.body.getReader(),a=new TextDecoder,o=``,s=`message`,c={};for(;;){let{done:e,value:n}=await i.read();if(e)break;o+=a.decode(n,{stream:!0});let r=o.split(`
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=o(((e,t)=>{t.exports=d()})),p=c(u(),1),m=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},h=(e=>e?m(e):m),g=e=>e;function _(e,t=g){let n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}var v=e=>{let t=h(e),n=e=>_(t,e);return Object.assign(n,t),n},y=(e=>e?v(e):v);function b(){try{let e=localStorage.getItem(`lattice.theme`);if(e===`light`||e===`dark`)return e}catch{}return`light`}function x(){try{let e=localStorage.getItem(`lattice.mode`);if(e===`basic`||e===`advanced`||e===`admin`)return e}catch{}return`basic`}function S(){try{return localStorage.getItem(`lattice.workspace`)||null}catch{}return null}function C(){try{let e=localStorage.getItem(`lattice.language`);if(e===`ko`||e===`en`)return e}catch{}return(typeof navigator<`u`?navigator.language.toLowerCase():``).startsWith(`ko`)?`ko`:`en`}var w=y(e=>({theme:b(),mode:x(),workspaceId:S(),apiBase:null,language:C(),setTheme:t=>{document.documentElement.dataset.theme=t;try{localStorage.setItem(`lattice.theme`,t)}catch{}e({theme:t})},setMode:t=>{try{localStorage.setItem(`lattice.mode`,t)}catch{}e({mode:t})},setWorkspaceId:t=>{if(t)try{localStorage.setItem(`lattice.workspace`,t)}catch{}else try{localStorage.removeItem(`lattice.workspace`)}catch{}e({workspaceId:t})},setApiBase:t=>e({apiBase:t}),setLanguage:t=>{document.documentElement.lang=t===`ko`?`ko`:`en`;try{localStorage.setItem(`lattice.language`,t)}catch{}e({language:t})}})),T=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),E=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),D=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),O=e=>{let t=D(e);return t.charAt(0).toUpperCase()+t.slice(1)},k={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},A=(0,p.createContext)({}),j=()=>(0,p.useContext)(A),M=(0,p.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:m=``}=j()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,p.createElement)(`svg`,{ref:c,...k,width:t??l??k.width,height:t??l??k.height,stroke:e??f,strokeWidth:h,className:T(`lucide`,m,i),...!a&&!ee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),N=(e,t)=>{let n=(0,p.forwardRef)(({className:n,...r},i)=>(0,p.createElement)(M,{ref:i,iconNode:t,className:T(`lucide-${E(O(e))}`,`lucide-${e}`,n),...r}));return n.displayName=O(e),n},P=/\{[^{}]+\}/g,F=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function te(){return Math.random().toString(36).slice(2,11)}function ne(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:o,headers:s,requestInitExt:c=void 0,...l}={...e};c=F()?c:void 0,t=ce(t);let u=[];async function d(e,d){let{baseUrl:f,fetch:p=r,Request:m=n,headers:h,params:g={},parseAs:_=`json`,querySerializer:v,bodySerializer:y=a??oe,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=ce(f)??t);let T=typeof i==`function`?i:L(i);v&&(T=typeof v==`function`?v:L({...typeof i==`object`?i:{},...v}));let E=b||o||ae,D=x===void 0?void 0:y(x,se(s,h,g.header)),O=se(D===void 0||D instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),k=[...u,...S],ee={redirect:`follow`,...l,...C,body:D,headers:O},A,j,M=new m(R(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:E}),ee),N;for(let e in C)e in M||(M[e]=C[e]);if(k.length){A=te(),j=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:E});for(let t of k)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:M,schemaPath:e,params:g,options:j,id:A});if(n)if(n instanceof m)M=n;else if(n instanceof Response){N=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}if(!N){try{N=await p(M,c)}catch(t){let n=t;if(k.length)for(let t=k.length-1;t>=0;t--){let r=k[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:M,error:n,schemaPath:e,params:g,options:j,id:A});if(t){if(t instanceof Response){n=void 0,N=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(k.length)for(let t=k.length-1;t>=0;t--){let n=k[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:M,response:N,schemaPath:e,params:g,options:j,id:A});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);N=t}}}}let P=N.headers.get(`Content-Length`);if(N.status===204||M.method===`HEAD`||P===`0`&&!N.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return N.ok?{data:void 0,response:N}:{error:void 0,response:N};if(N.ok)return{data:await(async()=>{if(_===`stream`)return N.body;if(_===`json`&&!P){let e=await N.text();return e?JSON.parse(e):void 0}return await N[_]()})(),response:N};let F=await N.text();try{F=JSON.parse(F)}catch{}return{error:F,response:N}}return{request(e,t,n){return d(t,{...n,method:e.toUpperCase()})},GET(e,t){return d(e,{...t,method:`GET`})},PUT(e,t){return d(e,{...t,method:`PUT`})},POST(e,t){return d(e,{...t,method:`POST`})},DELETE(e,t){return d(e,{...t,method:`DELETE`})},OPTIONS(e,t){return d(e,{...t,method:`OPTIONS`})},HEAD(e,t){return d(e,{...t,method:`HEAD`})},PATCH(e,t){return d(e,{...t,method:`PATCH`})},TRACE(e,t){return d(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(t)}},eject(...e){for(let t of e){let e=u.indexOf(t);e!==-1&&u.splice(e,1)}}}}function re(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function ie(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(re(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function I(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(re(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function L(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(I(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(ie(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(re(r,i,e))}}return n.join(`&`)}}function ae(e,t){let n=e;for(let r of e.match(P)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,I(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,ie(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${re(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function oe(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function R(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function se(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function ce(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var z={ko:{},en:{}},le=new Set;function ue(e){le.has(e)||(le.add(e),Object.assign(z.ko,e.ko),Object.assign(z.en,e.en))}ue({ko:{"brain.title":`Lattice Brain`,"language.label":`언어`,"language.ko":`한국어`,"language.en":`English`,"shell.route.brain":`대화`,"shell.route.capture":`자료`,"shell.route.memory":`기억`,"shell.route.library":`AI 모델`,"shell.route.system":`설정`,"shell.route.act":`작업`,"shell.skip":`본문으로 건너뛰기`,"shell.menu.open":`메뉴 열기`,"shell.menu.close":`메뉴 닫기`,"shell.menu.title":`더보기`,"shell.theme.toLight":`밝은 화면으로 바꾸기`,"shell.theme.toDark":`어두운 화면으로 바꾸기`,"shell.menu.nav":`화면 이동`,"shell.menu.workspace":`작업 공간`,"shell.loading":`Brain 작업공간을 여는 중...`,"shell.workspace.label":`작업공간 및 프로필`,"shell.workspace.current":`현재 작업공간`,"shell.workspace.switch":`전환`,"shell.workspace.active":`사용 중`,"shell.workspace.empty":`아직 작업공간이 없습니다`,"shell.workspace.personal":`개인 Brain`,"shell.workspace.manageSpaces":`작업공간 관리`,"shell.workspace.close":`닫기`,"shell.profile.label":`프로필`,"shell.profile.owner":`소유자`,"shell.profile.signedOut":`로그인하지 않음`,"shell.profile.you":`내 계정`,"shell.profile.manage":`계정 설정 열기`,"shell.admin.label":`관리자`,"shell.admin.open":`관리자 콘솔 열기`,"shell.admin.tooltip":`설정, 에이전트, 도구 레지스트리 관리`,"shell.admin.needsMode":`관리자 콘솔은 고급 또는 관리자 모드에서만 사용할 수 있습니다`,"shell.admin.enable":`관리자 모드로 전환`,"shell.mode.label":`모드`,"shell.mode.basic":`기본`,"shell.mode.advanced":`고급`,"shell.mode.admin":`관리자`,"shell.mode.info":`모드는 표시되는 도구와 관리자 화면의 범위를 정합니다`,"shell.account.aria":`계정과 워크스페이스`,"shell.account.workspaceLabel":`워크스페이스`,"shell.account.personal":`개인 Brain`,"shell.account.modeLabel":`보기 모드`,"shell.account.mode.basic":`기본`,"shell.account.mode.advanced":`고급`,"shell.account.mode.admin":`관리자`,"shell.account.open":`계정·워크스페이스 메뉴 열기`,"shell.account.menuAria":`계정과 워크스페이스 메뉴`,"shell.account.profile":`프로필과 계정`,"shell.account.workspaces":`워크스페이스 전환`,"shell.account.admin":`관리자 콘솔`,"shell.account.settings":`설정 열기`,"shell.sync.aria":`VS Code 확장 연동 상태`,"shell.sync.label":`VS Code`,"shell.sync.connected":`연결됨`,"shell.sync.indexing":`인덱싱 중`,"shell.sync.synced":`동기화됨`,"shell.sync.offline":`연결 안 됨`,"shell.sync.checking":`확인 중`,"shell.sync.detail":`확장과 메인 앱이 같은 Brain을 공유합니다.`,"shell.sync.detailOffline":`VS Code 확장이 아직 이 Brain에 연결되지 않았습니다.`,"feedback.retry":`다시 시도`,"service.unavailable.title":`로컬 Lattice 서비스를 사용할 수 없습니다`,"service.unavailable.detail":`빈 Brain으로 표시하지 않았습니다. 연결을 확인한 뒤 다시 시도하세요. ({detail})`,"feedback.error.title":`문제가 생겼어요`,"feedback.error.body":`잠시 후 다시 시도하거나 설정에서 연결을 확인하세요.`,"ui.status.notLoaded":`확인 전`,"ui.status.ready":`사용 가능`,"ui.status.connected":`연결됨`,"ui.status.needsSetup":`준비 필요`,"ui.status.unavailable":`응답 없음`,"ui.empty.title":`아직 비어 있어요`,"ui.empty.basicDetail":`자료를 넣거나 준비가 끝나면 여기에 내용이 나타납니다.`,"ui.empty.advancedDetail":`이 기능이 지금 응답하지 않습니다.`,"ui.empty.listDetail":`새 항목이 생기면 여기에 표시됩니다.`,"ui.loading":`불러오는 중…`,"ui.cancel":`취소`,"ui.done":`완료`,"ui.requestCompleted":`요청이 완료되었습니다`,"ui.requestUnavailable":`요청을 처리하지 못했어요`,"ui.noValues":`표시할 값이 없어요`,"ui.value.enabled":`활성화됨`,"ui.value.disabled":`비활성화됨`,"ui.value.none":`없음`,"ui.value.records":`레코드 {count}개`,"ui.value.noFields":`필드 없음`,"ui.value.fields":`내용 {count}가지`,"ui.entity.Task":`할 일`,"ui.entity.Concept":`주제`,"ui.entity.Document":`문서`,"ui.entity.Chunk":`문서 조각`,"ui.entity.Source":`출처`,"ui.entity.Chat":`대화`,"ui.entity.Message":`메시지`,"ui.entity.AIResponse":`Brain 답변`,"ui.entity.Person":`사람`,"ui.entity.Event":`일정`,"ui.entity.Place":`장소`,"ui.entity.Organization":`조직`,"ui.field.status":`상태`,"ui.field.state":`상태`,"ui.field.version":`버전`,"ui.field.mode":`모드`,"ui.field.platform":`플랫폼`,"ui.field.device":`장치`,"ui.field.current_model":`지금 쓰는 모델`,"ui.field.loaded_models":`불러온 모델`,"ui.field.model":`모델`,"ui.field.model_id":`모델 이름`,"ui.field.provider":`제공자`,"ui.field.requested_provider":`요청한 제공자`,"ui.field.active_provider":`실제 제공자`,"ui.field.dimensions":`벡터 차원`,"ui.field.grade":`품질 등급`,"ui.field.runtime":`실행 환경`,"ui.field.health":`상태 점검`,"ui.field.ready":`사용 준비`,"ui.field.execution_mode":`실행 방식`,"ui.field.roles":`역할`,"ui.field.agents":`에이전트`,"ui.field.runs":`실행 기록`,"ui.field.contracts":`계약`,"ui.field.checks":`점검 항목`,"ui.field.cpu_pct":`CPU 사용률`,"ui.field.ram_pct":`메모리 사용률`,"ui.field.gpu_mem_pct":`GPU 메모리 사용률`,"ui.field.gpu_mem_gb":`GPU 메모리`,"ui.field.features":`기능 설정`,"ui.entity.Indexed":`정리 완료`,"ui.entity.Ready":`준비됨`,"ui.entity.Pending":`대기 중`,"ui.entity.Queued":`대기 중`,"ui.entity.Running":`진행 중`,"ui.entity.Complete":`완료`,"ui.entity.Completed":`완료`,"ui.entity.Failed":`실패`,"ui.entity.Error":`오류`,"ui.entity.Ok":`정상`,"ui.entity.Record":`항목`,"ui.entity.Active":`사용 중`,"ui.entity.Disabled":`꺼짐`,"ui.entity.Enabled":`켜짐`,"ui.field.available":`사용 가능`,"ui.field.directory":`저장 위치`,"ui.field.count":`개수`,"ui.field.latest":`가장 최근`,"ui.field.latest_bytes":`최근 파일 크기`,"ui.field.encrypted_archives":`암호화된 백업`,"ui.field.zip_backups":`압축 백업`,"ui.field.last_verified":`마지막 확인`,"ui.field.failure":`실패`,"ui.field.enabled":`사용`,"ui.field.capabilities":`할 수 있는 일`,"ui.field.engine":`저장 엔진`,"ui.field.detail":`설명`,"ui.field.description":`설명`,"ui.field.summary":`요약`,"ui.field.name":`이름`,"ui.field.title":`제목`,"ui.field.type":`종류`,"ui.field.id":`식별자`,"ui.field.path":`경로`,"ui.field.size_bytes":`크기`,"ui.field.total_items":`전체 항목`,"ui.field.sources":`출처`,"ui.field.approved":`승인됨`,"ui.field.approved_at":`승인 시각`,"ui.field.approved_by":`승인한 사람`,"ui.field.created_at":`만든 시각`,"ui.field.updated_at":`수정 시각`,"ui.field.backup_health":`백업 상태`,"ui.field.reason":`이유`,"ui.field.message":`메시지`,"ui.field.scopes":`허용 폴더`,"ui.field.running":`실행 중`,"ui.field.armed":`예약됨`,"ui.field.tick_seconds":`확인 주기(초)`,"ui.field.tz":`표준시`,"ui.field.activities":`활동`,"ui.field.notice":`안내`,"ui.field.kind":`종류`,"ui.field.source":`출처`,"ui.field.enabled_at":`켠 시각`,"ui.field.disabled":`꺼짐`,"ui.modeGate.title":`고급 설정`,"ui.modeGate.detail":`진단이나 관리 기능이 필요할 때 모드를 전환하세요. 기본 모드는 일상 사용에 집중합니다.`,"ui.modeGate.advanced":`고급 모드로 전환`,"ui.modeGate.admin":`관리자 콘솔로 전환`,"command.title":`명령 팔레트`,"command.shortcutKey":`K`,"command.placeholder":`검색하거나 이동할 곳을 입력하세요...`,"command.results":`검색 결과`,"command.searching":`Brain에서 찾는 중...`,"command.empty":`일치하는 항목이 없습니다`,"command.footer":`↑↓로 이동, Enter로 선택, Esc로 닫기`,"command.group.pages":`화면 이동`,"command.group.knowledge":`지식`,"command.group.conversation":`지난 대화`,"command.group.automation":`자동화`,"command.automation.enabled":`켜짐`,"command.automation.draft":`초안`,"command.page.review":`검토함`,"briefing.title":`오늘의 브리핑`,"briefing.subtitle":`Brain이 정리한 오늘의 현황과 다음 할 일`,"briefing.loading":`브리핑을 준비하는 중...`,"briefing.stat.questions":`질문`,"briefing.stat.automations":`자동화 켜짐`,"briefing.stat.review":`검토 대기`,"briefing.stat.health":`Brain 건강`,"briefing.recent":`최근 담긴 지식`,"briefing.suggestions":`나를 위한 자동화 제안 {count}개가 기다리고 있어요`,"briefing.action.reviewPending":`검토 대기 {count}건 확인하기`,"briefing.action.enableDrafts":`꺼져 있는 자동화 초안 {count}개 살펴보기`,"briefing.action.installSuggestion":`추천 자동화 {count}개 보러 가기`,"briefing.action.connectKnowledge":`지식 폴더 연결하기`,"briefing.action.checkHealth":`Brain 건강 점검하기`,"briefing.action.askBrain":`Brain에게 질문하기`,"briefing.empty":`아직 보여드릴 브리핑이 없어요. 자료를 넣고 대화를 시작하면 이곳에 하루 요약이 쌓입니다.`,"command.proactive.title":`지금 바로`,"command.proactive.briefing":`오늘의 브리핑 열기`,"command.proactive.review":`검토 대기 항목 보기`,"command.proactive.suggestions":`오늘의 제안 {count}개`,"command.proactive.pending":`{count}건 대기 중`,"proposals.title":`변경 제안`,"proposals.subtitle":`기존 파일을 바꾸는 작업은 검토 후 적용됩니다`,"proposals.loading":`제안을 불러오는 중...`,"proposals.empty":`대기 중인 변경 제안이 없습니다`,"proposals.diff":`변경 내용 미리보기`,"proposals.tier.small":`작은 수정`,"proposals.tier.large":`큰 수정`,"proposals.kind.delete":`삭제`,"proposals.approve":`승인하고 적용`,"proposals.reject":`거절`,"proposals.note":`새 파일 생성은 바로 실행되고, 기존 내용 수정과 삭제만 여기에서 검토합니다. 승인 전에는 아무것도 바뀌지 않습니다.`,"proposals.conflict.title":`파일이 그 사이 변경되었습니다`,"proposals.conflict.detail":`제안을 만든 뒤 파일 내용이 바뀌어 그대로 적용하면 최근 수정이 사라질 수 있어요. 현재 파일을 다시 읽어 새 제안으로 만들 수 있습니다.`,"proposals.conflict.rebase":`다시 읽어서 재적용`,"proposals.conflict.rebasing":`현재 파일을 다시 읽는 중…`,"proposals.conflict.rebased":`현재 파일 기준으로 새 제안을 만들었어요. 새 변경 내용을 확인해 주세요.`,"proposals.conflict.alreadyApplied":`이미 같은 내용이 반영되어 있어 이 제안을 정리했어요.`,"proposals.conflict.failed":`다시 적용을 준비하지 못했어요: {reason}`},en:{"brain.title":`Lattice Brain`,"language.label":`Language`,"language.ko":`한국어`,"language.en":`English`,"shell.route.brain":`Chat`,"shell.route.capture":`Sources`,"shell.route.memory":`Memory`,"shell.route.library":`AI model`,"shell.route.system":`Settings`,"shell.route.act":`Work`,"shell.skip":`Skip to content`,"shell.menu.open":`Open menu`,"shell.menu.close":`Close menu`,"shell.menu.title":`More`,"shell.theme.toLight":`Switch to the light screen`,"shell.theme.toDark":`Switch to the dark screen`,"shell.menu.nav":`Go to`,"shell.menu.workspace":`Workspace`,"shell.loading":`Loading Brain workspace...`,"shell.workspace.label":`Workspace and profile`,"shell.workspace.current":`Current workspace`,"shell.workspace.switch":`Switch`,"shell.workspace.active":`Active`,"shell.workspace.empty":`No workspaces yet`,"shell.workspace.personal":`Personal Brain`,"shell.workspace.manageSpaces":`Manage workspaces`,"shell.workspace.close":`Close`,"shell.profile.label":`Profile`,"shell.profile.owner":`Owner`,"shell.profile.signedOut":`Not signed in`,"shell.profile.you":`You`,"shell.profile.manage":`Open account settings`,"shell.admin.label":`Admin`,"shell.admin.open":`Open Admin Console`,"shell.admin.tooltip":`Manage settings, agents, and the tool registry`,"shell.admin.needsMode":`Admin Console is available in Advanced or Admin mode`,"shell.admin.enable":`Switch to Admin mode`,"shell.mode.label":`Mode`,"shell.mode.basic":`Basic`,"shell.mode.advanced":`Advanced`,"shell.mode.admin":`Admin`,"shell.mode.info":`Mode sets which tools and admin surfaces are shown`,"shell.account.aria":`Account and workspace`,"shell.account.workspaceLabel":`Workspace`,"shell.account.personal":`Personal Brain`,"shell.account.modeLabel":`View mode`,"shell.account.mode.basic":`Basic`,"shell.account.mode.advanced":`Advanced`,"shell.account.mode.admin":`Admin`,"shell.account.open":`Open account and workspace menu`,"shell.account.menuAria":`Account and workspace menu`,"shell.account.profile":`Profile & account`,"shell.account.workspaces":`Switch workspace`,"shell.account.admin":`Admin console`,"shell.account.settings":`Open settings`,"shell.sync.aria":`VS Code extension link status`,"shell.sync.label":`VS Code`,"shell.sync.connected":`Connected`,"shell.sync.indexing":`Indexing`,"shell.sync.synced":`Synced`,"shell.sync.offline":`Not connected`,"shell.sync.checking":`Checking`,"shell.sync.detail":`The extension and main app share the same Brain.`,"shell.sync.detailOffline":`The VS Code extension is not linked to this Brain yet.`,"feedback.retry":`Retry`,"service.unavailable.title":`The local Lattice service is unavailable`,"service.unavailable.detail":`This is not being shown as an empty Brain. Check the connection and retry. ({detail})`,"feedback.error.title":`Something went wrong`,"feedback.error.body":`Try again shortly or check the connection in Settings.`,"ui.status.notLoaded":`Not loaded`,"ui.status.ready":`Ready`,"ui.status.connected":`Connected`,"ui.status.needsSetup":`Needs setup`,"ui.status.unavailable":`Not responding`,"ui.empty.title":`Nothing here yet`,"ui.empty.basicDetail":`Add material or finish setup and content will appear here.`,"ui.empty.advancedDetail":`This capability is not reporting right now.`,"ui.empty.listDetail":`New items will appear here when Lattice has something to show.`,"ui.loading":`Loading…`,"ui.cancel":`Cancel`,"ui.done":`Done`,"ui.requestCompleted":`Request completed`,"ui.requestUnavailable":`Request could not be completed`,"ui.noValues":`No values to show`,"ui.value.enabled":`enabled`,"ui.value.disabled":`disabled`,"ui.value.none":`None`,"ui.value.records":`{count} records`,"ui.value.noFields":`No fields`,"ui.value.fields":`{count} details`,"ui.entity.Task":`Task`,"ui.entity.Concept":`Topic`,"ui.entity.Document":`Document`,"ui.entity.Chunk":`Excerpt`,"ui.entity.Source":`Source`,"ui.entity.Chat":`Conversation`,"ui.entity.Message":`Message`,"ui.entity.AIResponse":`Brain reply`,"ui.entity.Person":`Person`,"ui.entity.Event":`Event`,"ui.entity.Place":`Place`,"ui.entity.Organization":`Organization`,"ui.field.status":`Status`,"ui.field.state":`State`,"ui.field.version":`Version`,"ui.field.mode":`Mode`,"ui.field.platform":`Platform`,"ui.field.device":`Device`,"ui.field.current_model":`Model in use`,"ui.field.loaded_models":`Loaded models`,"ui.field.model":`Model`,"ui.field.model_id":`Model name`,"ui.field.provider":`Provider`,"ui.field.requested_provider":`Requested provider`,"ui.field.active_provider":`Active provider`,"ui.field.dimensions":`Vector size`,"ui.field.grade":`Quality grade`,"ui.field.runtime":`Runtime`,"ui.field.health":`Health check`,"ui.field.ready":`Ready`,"ui.field.execution_mode":`Execution`,"ui.field.roles":`Roles`,"ui.field.agents":`Agents`,"ui.field.runs":`Runs`,"ui.field.contracts":`Contracts`,"ui.field.checks":`Checks`,"ui.field.cpu_pct":`CPU use`,"ui.field.ram_pct":`Memory use`,"ui.field.gpu_mem_pct":`GPU memory use`,"ui.field.gpu_mem_gb":`GPU memory`,"ui.field.features":`Feature settings`,"ui.entity.Indexed":`Indexed`,"ui.entity.Ready":`Ready`,"ui.entity.Pending":`Pending`,"ui.entity.Queued":`Queued`,"ui.entity.Running":`Running`,"ui.entity.Complete":`Complete`,"ui.entity.Completed":`Complete`,"ui.entity.Failed":`Failed`,"ui.entity.Error":`Error`,"ui.entity.Ok":`OK`,"ui.entity.Record":`Item`,"ui.entity.Active":`Active`,"ui.entity.Disabled":`Off`,"ui.entity.Enabled":`On`,"ui.field.available":`Available`,"ui.field.directory":`Location`,"ui.field.count":`Count`,"ui.field.latest":`Most recent`,"ui.field.latest_bytes":`Latest size`,"ui.field.encrypted_archives":`Encrypted backups`,"ui.field.zip_backups":`Zip backups`,"ui.field.last_verified":`Last verified`,"ui.field.failure":`Failure`,"ui.field.enabled":`Enabled`,"ui.field.capabilities":`Can do`,"ui.field.engine":`Storage engine`,"ui.field.detail":`Detail`,"ui.field.description":`Description`,"ui.field.summary":`Summary`,"ui.field.name":`Name`,"ui.field.title":`Title`,"ui.field.type":`Type`,"ui.field.id":`Identifier`,"ui.field.path":`Path`,"ui.field.size_bytes":`Size`,"ui.field.total_items":`Total items`,"ui.field.sources":`Sources`,"ui.field.approved":`Approved`,"ui.field.approved_at":`Approved at`,"ui.field.approved_by":`Approved by`,"ui.field.created_at":`Created`,"ui.field.updated_at":`Updated`,"ui.field.backup_health":`Backup health`,"ui.field.reason":`Reason`,"ui.field.message":`Message`,"ui.field.scopes":`Allowed folders`,"ui.field.running":`Running`,"ui.field.armed":`Armed`,"ui.field.tick_seconds":`Check interval (s)`,"ui.field.tz":`Time zone`,"ui.field.activities":`Activity`,"ui.field.notice":`Notice`,"ui.field.kind":`Kind`,"ui.field.source":`Source`,"ui.field.enabled_at":`Turned on`,"ui.field.disabled":`Off`,"ui.modeGate.title":`Advanced controls`,"ui.modeGate.detail":`Switch modes when you want diagnostics or administrative controls. Basic mode keeps the product focused on everyday use.`,"ui.modeGate.advanced":`Switch to Advanced`,"ui.modeGate.admin":`Switch to Admin Console`,"command.title":`Command palette`,"command.shortcutKey":`K`,"command.placeholder":`Search or jump anywhere...`,"command.results":`Search results`,"command.searching":`Searching your Brain...`,"command.empty":`No matches found`,"command.footer":`↑↓ to move, Enter to select, Esc to close`,"command.group.pages":`Go to`,"command.group.knowledge":`Knowledge`,"command.group.conversation":`Past conversations`,"command.group.automation":`Automations`,"command.automation.enabled":`Enabled`,"command.automation.draft":`Draft`,"command.page.review":`Review inbox`,"briefing.title":`Today's briefing`,"briefing.subtitle":`What your Brain sees today, and what to do next`,"briefing.loading":`Preparing your briefing...`,"briefing.stat.questions":`Questions`,"briefing.stat.automations":`Automations on`,"briefing.stat.review":`Awaiting review`,"briefing.stat.health":`Brain health`,"briefing.recent":`Recently added knowledge`,"briefing.suggestions":`{count} automation suggestions are waiting for you`,"briefing.action.reviewPending":`Check {count} items awaiting review`,"briefing.action.enableDrafts":`Look at {count} disabled automation drafts`,"briefing.action.installSuggestion":`See {count} suggested automations`,"briefing.action.connectKnowledge":`Connect a knowledge folder`,"briefing.action.checkHealth":`Check Brain health`,"briefing.action.askBrain":`Ask your Brain`,"briefing.empty":`Nothing to brief yet. Add some knowledge and start a conversation — your daily summary will build up here.`,"command.proactive.title":`Right now`,"command.proactive.briefing":`Open today's briefing`,"command.proactive.review":`See items awaiting review`,"command.proactive.suggestions":`{count} suggestions today`,"command.proactive.pending":`{count} waiting`,"proposals.title":`Change proposals`,"proposals.subtitle":`Changes to existing files apply only after your review`,"proposals.loading":`Loading proposals...`,"proposals.empty":`No pending change proposals`,"proposals.diff":`Change preview`,"proposals.tier.small":`Small change`,"proposals.tier.large":`Large change`,"proposals.kind.delete":`Deletion`,"proposals.approve":`Approve & apply`,"proposals.reject":`Reject`,"proposals.note":`Creating new files runs immediately; only edits and deletions of existing content are reviewed here. Nothing changes until you approve.`,"proposals.conflict.title":`The file changed in the meantime`,"proposals.conflict.detail":`The file was edited after this proposal was staged, so applying it as-is could erase recent changes. You can re-read the current file and stage a fresh proposal against it.`,"proposals.conflict.rebase":`Re-read & re-apply`,"proposals.conflict.rebasing":`Re-reading the current file…`,"proposals.conflict.rebased":`Staged a fresh proposal against the current file. Please review the new changes.`,"proposals.conflict.alreadyApplied":`The file already contains this change, so the proposal was retired.`,"proposals.conflict.failed":`Could not prepare the re-apply: {reason}`}});var de=`10.3.0`,fe={ko:`한국어`,en:`English`};function pe(e,t,n){let r=z[e]?.[t]||z.ko[t]||t,i={version:de,...n||{}};for(let[e,t]of Object.entries(i))r=r.replaceAll(`{${e}}`,String(t));return r}var me=`modulepreload`,he=function(e){return`/static/app/`+e},ge={},_e=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=he(t,n),t in ge)return;ge[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:me,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ve=1e4,ye=new Map,be=null;function xe(){return``}function Se(){return!!(window.__TAURI_INTERNALS__||window.__TAURI__?.core?.invoke)}async function Ce(){return Se()?(be||=_e(async()=>{let{invoke:e}=await import(`./core-CwxXejkd.js`);return{invoke:e}},[]).then(({invoke:e})=>e(`backend_origin`)).then(e=>e||null).catch(()=>null),be):null}async function we(e,t){let n=window.__TAURI__?.core?.invoke;if(n)try{return await n(e,t)}catch{return null}if(!window.__TAURI_INTERNALS__)return null;try{let{invoke:n}=await _e(async()=>{let{invoke:e}=await import(`./core-CwxXejkd.js`);return{invoke:e}},[]);return await n(e,t)}catch{return null}}async function Te(){let e=await we(`select_folder`);if(e)return e;try{return await window.latticeDesktop?.selectFolder?.()||null}catch{return null}}async function B(){let e=w.getState().apiBase;if(e)return e;let t=await Ce();return t?(w.getState().setApiBase(t),t):xe()}function Ee(e){return ye.has(e)||ye.set(e,ne({baseUrl:e,credentials:`include`})),ye.get(e)}function De(e){return Array.isArray(e)?[]:e&&typeof e==`object`?{...e}:e}function V(){let e=w.getState().workspaceId;return e?{"X-Workspace-Id":e}:{}}function Oe(){try{return w.getState().language}catch{return`ko`}}function ke(){return pe(Oe(),`api.error.unreachable`)}function Ae(e){return pe(Oe(),`api.error.request`,{status:e})}function H(e,t){if(!e)return t;let n=typeof e==`object`&&e?e:null,r=n?.detail;if(typeof r==`string`)return r;let i=typeof r==`object`&&r?r:null;if(i){let e=i.user_message||i.reason||i.action||i.status;if(e)return String(e)}let a=n?.message||n?.error;return a?String(a):t}function je(e,t){let n=e instanceof Error?e.message:String(e);return/not valid JSON|Unexpected token|JSON/i.test(n)?t:/aborted|abort|timed?\s?out/i.test(n)?pe(Oe(),`api.error.timeout`):/failed to fetch|load failed|networkerror|network request failed/i.test(n)?pe(Oe(),`api.error.unreachable`):n||t}async function Me(e,t,n){let r=Ee(await B()),i=new AbortController,a=window.setTimeout(()=>i.abort(),ve);try{let a={body:n.body,params:{query:n.query||{}},headers:{...V(),...n.headers||{}},signal:i.signal},{data:o,error:s,response:c}=await(e===`GET`?r.GET:e===`POST`?r.POST:e===`PATCH`?r.PATCH:r.DELETE)(t,a);return c.ok&&o!==void 0?{ok:!0,status:c.status,data:o,source:`live`}:{ok:!1,status:c.status,data:De(n.shape),source:`unavailable`,error:H(s,Ae(c.status))}}catch(e){return{ok:!1,status:0,data:De(n.shape),source:`unavailable`,error:je(e,ke())}}finally{window.clearTimeout(a)}}async function Ne(e,t){let n=Ee(await B()),r=new AbortController,i=window.setTimeout(()=>r.abort(),ve);try{let{data:i,error:a,response:o}=await t(n,r.signal);return o.ok&&i!==void 0?{ok:!0,status:o.status,data:i,source:`live`}:{ok:!1,status:o.status,data:De(e),source:`unavailable`,error:H(a,Ae(o.status))}}catch(t){return{ok:!1,status:0,data:De(e),source:`unavailable`,error:je(t,ke())}}finally{window.clearTimeout(i)}}function U(e,t,n){return Me(`GET`,e,{query:n,shape:t})}function W(e,t,n){return Me(`POST`,e,{body:t,shape:n})}function Pe(e,t,n){return Me(`PATCH`,e,{body:t,shape:n})}function Fe(e,t){return Me(`DELETE`,e,{shape:t})}function Ie(){return{id:``,status:`pending`,effective_status:`pending`,title:``,summary:``,source:`workflow_run`,kind:`suggestion`,payload:{},provenance:{}}}function Le(){return{items:[]}}function Re(e){return Ne(Le(),(t,n)=>t.GET(`/automation/reviews`,{params:{query:e||{}},headers:V(),signal:n}))}function ze(e,t){return Ne(Ie(),(n,r)=>{let i={params:{path:{item_id:e}},headers:V(),signal:r};return t===`approve`?n.POST(`/automation/reviews/{item_id}/approve`,i):t===`dismiss`?n.POST(`/automation/reviews/{item_id}/dismiss`,i):t===`run_now`?n.POST(`/automation/reviews/{item_id}/run_now`,i):n.POST(`/automation/reviews/{item_id}/unsnooze`,i)})}function Be(e,t){return Ne(Ie(),(n,r)=>n.POST(`/automation/reviews/{item_id}/snooze`,{params:{path:{item_id:e}},body:{until:t},headers:V(),signal:r}))}async function Ve(e){let t=await B(),n=new FormData;n.append(`file`,e);try{let e=await fetch(`${t}/upload/document`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`,...V()},body:n}),r=await e.json().catch(()=>null);return{ok:e.ok,status:e.status,data:r,source:e.ok?`live`:`unavailable`,error:e.ok?void 0:H(r,e.statusText||`Upload failed`)}}catch(e){return{ok:!1,status:0,data:null,source:`unavailable`,error:String(e)}}}async function He(e,t={}){let n=await B(),r=await fetch(`${n}/engines/prepare-model/stream`,{method:`POST`,credentials:`include`,signal:t.signal,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,...V()},body:JSON.stringify({engine:null,allow_download:!1,...e})});if(!r.ok||!r.body||!(r.headers.get(`content-type`)||``).includes(`text/event-stream`)){let e=await r.json().catch(()=>null),n=e?.detail&&typeof e.detail==`object`?e.detail:e,i=H(e,r.statusText);return t.onError?.({status:`error`,user_message:i,...n||{}}),{source:`live`,ok:!1,status:r.status,data:n||{},error:i}}let i=r.body.getReader(),a=new TextDecoder,o=``,s=`message`,c={};for(;;){let{done:e,value:n}=await i.read();if(e)break;o+=a.decode(n,{stream:!0});let r=o.split(`
2
2
 
3
3
  `);o=r.pop()||``;for(let e of r){let n=e.split(`
4
4
  `);s=n.find(e=>e.startsWith(`event:`))?.slice(6).trim()||`message`;let r=n.find(e=>e.startsWith(`data:`));if(!r)continue;let i=r.slice(5).trim(),a=i?JSON.parse(i):{};if(s===`progress`&&t.onProgress?.(a),s===`error`){let e=typeof a.detail==`object`&&a.detail!==null?a.detail:a;return t.onError?.(e),{source:`live`,ok:!1,status:Number(a.status_code||500),data:e,error:H({detail:e},`Model setup failed`)}}s===`done`&&(c=a,t.onDone?.(a))}}return{source:`live`,ok:!0,status:200,data:c}}async function Ue(e,t={}){let n=await B(),r=await fetch(`${n}/chat`,{method:`POST`,credentials:`include`,signal:t.signal,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,...V()},body:JSON.stringify({stream:!0,max_tokens:2048,temperature:.2,...e})});if(!r.ok||!r.body||!(r.headers.get(`content-type`)||``).includes(`text/event-stream`)){let e=await r.json().catch(()=>null);return{source:`live`,text:``,trace:null,error:e?.error||e?.detail||r.statusText}}let i=r.body.getReader(),a=new TextDecoder,o=``,s=``,c=null,l=null,u=null,d=null;for(;;){let{done:e,value:n}=await i.read();if(e)break;o+=a.decode(n,{stream:!0});let r=o.split(`