ltcai 9.9.1 → 9.9.3

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 (97) hide show
  1. package/README.md +40 -39
  2. package/docs/CHANGELOG.md +80 -0
  3. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  4. package/docs/DEVELOPMENT.md +1 -1
  5. package/docs/ONBOARDING.md +1 -1
  6. package/docs/OPERATIONS.md +1 -1
  7. package/docs/TRUST_MODEL.md +1 -1
  8. package/docs/WHY_LATTICE.md +1 -1
  9. package/docs/kg-schema.md +1 -1
  10. package/lattice_brain/__init__.py +1 -1
  11. package/lattice_brain/graph/curator.py +141 -0
  12. package/lattice_brain/graph/documents.py +111 -0
  13. package/lattice_brain/graph/fusion.py +179 -0
  14. package/lattice_brain/graph/projection.py +161 -0
  15. package/lattice_brain/graph/retrieval.py +19 -1
  16. package/lattice_brain/ingestion.py +66 -0
  17. package/lattice_brain/runtime/multi_agent.py +1 -1
  18. package/latticeai/__init__.py +1 -1
  19. package/latticeai/api/automation_intelligence.py +159 -0
  20. package/latticeai/api/browser.py +15 -4
  21. package/latticeai/api/chat.py +30 -2
  22. package/latticeai/api/chat_agent_http.py +193 -4
  23. package/latticeai/api/chat_contracts.py +7 -1
  24. package/latticeai/api/chat_helpers.py +147 -0
  25. package/latticeai/api/chat_intents.py +319 -8
  26. package/latticeai/api/chat_stream.py +17 -1
  27. package/latticeai/api/funnel_metrics.py +31 -0
  28. package/latticeai/api/knowledge_graph.py +30 -0
  29. package/latticeai/api/local_files.py +90 -0
  30. package/latticeai/api/setup.py +134 -1
  31. package/latticeai/api/tools.py +33 -3
  32. package/latticeai/app_factory.py +15 -0
  33. package/latticeai/core/agent.py +205 -11
  34. package/latticeai/core/agent_eval.py +107 -0
  35. package/latticeai/core/file_generation.py +337 -2
  36. package/latticeai/core/legacy_compatibility.py +1 -1
  37. package/latticeai/core/marketplace.py +1 -1
  38. package/latticeai/core/workspace_os.py +1 -1
  39. package/latticeai/runtime/persistence_runtime.py +19 -1
  40. package/latticeai/runtime/router_registration.py +8 -1
  41. package/latticeai/services/app_context.py +6 -0
  42. package/latticeai/services/architecture_readiness.py +1 -1
  43. package/latticeai/services/automation_execution.py +266 -0
  44. package/latticeai/services/automation_intelligence.py +7 -0
  45. package/latticeai/services/command_center.py +20 -1
  46. package/latticeai/services/folder_watch.py +391 -0
  47. package/latticeai/services/funnel_metrics.py +202 -0
  48. package/latticeai/services/product_readiness.py +6 -1
  49. package/latticeai/services/search_service.py +17 -1
  50. package/latticeai/services/tool_dispatch.py +36 -0
  51. package/latticeai/setup/demo_corpus.py +98 -0
  52. package/latticeai/tools/filesystem.py +38 -1
  53. package/package.json +1 -1
  54. package/scripts/bench_models.py +234 -5
  55. package/scripts/check_current_release_docs.mjs +1 -1
  56. package/src-tauri/Cargo.lock +1 -1
  57. package/src-tauri/Cargo.toml +1 -1
  58. package/src-tauri/tauri.conf.json +1 -1
  59. package/static/app/asset-manifest.json +28 -27
  60. package/static/app/assets/Act-DmdruVKV.js +1 -0
  61. package/static/app/assets/{Brain-CSCDZEHd.js → Brain-DEY9jLVt.js} +2 -2
  62. package/static/app/assets/BrainHome-CeNaxjP1.js +2 -0
  63. package/static/app/assets/BrainSignals-CStjIqYi.js +1 -0
  64. package/static/app/assets/{Capture-BiuerOio.js → Capture-CVZ09QXi.js} +1 -1
  65. package/static/app/assets/CommandPalette-DepwOQFv.js +1 -0
  66. package/static/app/assets/Library-Bp0n-HlW.js +1 -0
  67. package/static/app/assets/{LivingBrain-6FvA0H5T.js → LivingBrain-DxP4efJF.js} +1 -1
  68. package/static/app/assets/{ProductFlow-Cr8bkQPw.js → ProductFlow-DRbm7NEq.js} +1 -1
  69. package/static/app/assets/ReviewCard-C4HAO7A3.js +3 -0
  70. package/static/app/assets/{System-D6uJacqu.js → System-ByQcmJW-.js} +1 -1
  71. package/static/app/assets/{bot-DgC7xgUl.js → bot-BNDyZLR7.js} +1 -1
  72. package/static/app/assets/circle-play-BkhdcHgd.js +1 -0
  73. package/static/app/assets/{cpu-DDGb4XHl.js → cpu-C6jjYm6i.js} +1 -1
  74. package/static/app/assets/{folder-open-BbVuSO9M.js → folder-open-DjGIvDBQ.js} +1 -1
  75. package/static/app/assets/{hard-drive-yDZR6XYz.js → hard-drive-BlSbwSaT.js} +1 -1
  76. package/static/app/assets/index-Bge3DXW7.css +2 -0
  77. package/static/app/assets/{index-DrZSkwrE.js → index-CHu7cgj3.js} +3 -3
  78. package/static/app/assets/{input-DPIkTs9n.js → input-DVDI0YR3.js} +1 -1
  79. package/static/app/assets/{navigation-B1mkmyUe.js → navigation-BddhEWA0.js} +1 -1
  80. package/static/app/assets/{network-0XDI1Uf_.js → network-pYQt5oBu.js} +1 -1
  81. package/static/app/assets/{primitives-sIQYKyf5.js → primitives-D7gCdEvS.js} +1 -1
  82. package/static/app/assets/shield-alert-K9RKGQeg.js +1 -0
  83. package/static/app/assets/{textarea-DvnwpnqS.js → textarea-sqQmoBKL.js} +1 -1
  84. package/static/app/assets/useFocusTrap-7EV9dFP2.js +1 -0
  85. package/static/app/assets/utils-uQYKXNeq.js +7 -0
  86. package/static/app/index.html +4 -4
  87. package/static/sw.js +1 -1
  88. package/static/app/assets/Act-CcSWTQsx.js +0 -1
  89. package/static/app/assets/BrainHome-B5QpJ1Fx.js +0 -2
  90. package/static/app/assets/BrainSignals-CmFD8PWk.js +0 -1
  91. package/static/app/assets/CommandPalette-BrqpT7K2.js +0 -1
  92. package/static/app/assets/Library-BcaiPbum.js +0 -1
  93. package/static/app/assets/ReviewCard-D56TMypk.js +0 -1
  94. package/static/app/assets/download-C-Ei3GFa.js +0 -1
  95. package/static/app/assets/index-CFRhNBuH.css +0 -2
  96. package/static/app/assets/sunrise-DXMjueec.js +0 -1
  97. package/static/app/assets/utils-BrfFHAJl.js +0 -7
@@ -1 +1 @@
1
- import{_ as e,b as t,f as n,h as r,m as i,p as a,t as o,u as s,v as c}from"./utils-BrfFHAJl.js";import{i as l,r as u,t as d}from"./LivingBrain-6FvA0H5T.js";import{n as f,t as p}from"./input-DPIkTs9n.js";import{t as m}from"./cpu-DDGb4XHl.js";import{S as h,c as g,i as _}from"./index-DrZSkwrE.js";var v=i(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),y=i(`shield`,[[`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`}]]),b=i(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),x=i(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),S=t(c());function C(e){let t=M(e?.models),n=[...o(t.recommended),...o(t.catalog)],r=M(e?.recommendations?.recommendations),i=o(r.models),a=M(r.top_pick),s=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&s.set(t,{...s.get(t)||{},...e})}a.id&&!s.has(String(a.id))&&s.set(String(a.id),a);let c=Array.from(s.values()).map(T).filter(e=>e.id),l=c.filter(e=>e.supported),u=l.length?l:c,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=u.find(e=>e.id!==d?.id&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id),p=u.find(e=>e.id!==d?.id&&e.id!==f?.id&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id&&e.id!==f?.id);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,f?{...f,role:`faster`,reason:f.reason||`faster`}:null,p?{...p,role:`advanced`,reason:p.reason||`advanced`}:null].filter(Boolean)}function ee(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=C(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function w(){return{id:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,loadId:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,engine:`local_mlx`,name:`Qwen3-VL 8B`,shortName:`Qwen 3`,family:`Qwen 3`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:8}}function T(e){let t=M(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=O(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:j(i||n),family:j(String(e.family||i||`local_brain`)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?A(e):``,estimatedDownloadMinutes:o?D(s):0,estimatedFirstResponseSeconds:k(c),parameterBillions:c}}function E(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function D(e){let t=E(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function O(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function k(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function A(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function j(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function M(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var N=e();function te({model:e}){let t=r(e=>e.language),n=e.downloadRequired?[{label:a(t,`flow.consent.size`),value:e.downloadSize||a(t,`flow.consent.sizeUnknown`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:e.externalHost||a(t,`flow.consent.externalUnknown`)}]:[{label:a(t,`flow.consent.state`),value:a(t,`flow.consent.stateReady`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:a(t,`flow.consent.externalNone`)}],i=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,N.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":a(t,i),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:a(t,i)}),(0,N.jsx)(`p`,{children:e.downloadRequired?a(t,`flow.consent.body`):a(t,`flow.consent.ready`)})]}),(0,N.jsx)(`dl`,{children:n.map(e=>(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`dt`,{children:e.label}),(0,N.jsx)(`dd`,{children:e.value})]},e.label))})]})}function P({model:e,onBack:t,onComplete:n,onLater:i}){let o=r(e=>e.language),[c,l]=S.useState(!1),[u,p]=S.useState(`idle`),[m,h]=S.useState(0),[g,v]=S.useState(a(o,`flow.install.wait`)),[y,b]=S.useState(null);async function x(){l(!0),b(null),p(`install`),h(8),v(a(o,`flow.install.prepare`));let t=await s.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=L(String(e.stage||``));p(t),h(Number(e.percent||R(t))),v(z(e,t,o))},onDone:()=>{p(`done`),h(100),v(a(o,`flow.install.done`))},onError:e=>{p(`error`),b(U(e))}});l(!1),t.ok?(p(`done`),h(100),v(a(o,`flow.install.done`)),window.setTimeout(n,700)):(p(`error`),b(U(t.data)))}let C=u===`download`?`thinking`:u===`validate`?`recalling`:u===`load`?`synthesizing`:u===`done`?`idle`:`listening`;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(o,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,N.jsxs)(`div`,{className:`ritual-subtitle`,children:[(0,N.jsx)(`strong`,{children:e.shortName}),` — `,e.reason,`.`,(0,N.jsx)(`br`,{}),a(o,e.downloadRequired?`flow.install.body`:`flow.install.body.ready`)]}),(0,N.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":a(o,`flow.install.expectedTitle`),children:[(0,N.jsx)(`div`,{className:`ritual-fact-label`,children:a(o,`flow.install.expectedTitle`)}),(0,N.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:F(e,o)}),(0,N.jsx)(`ol`,{className:`ritual-timeline`,children:I(e,o).map(e=>(0,N.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,N.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,N.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(o,`flow.install.expectedCompletion`)})]}),(0,N.jsx)(`div`,{className:`ritual-install-brain`,children:(0,N.jsx)(d,{state:C,intensity:u===`download`||u===`load`?.96:.82,size:`normal`})}),(0,N.jsx)(te,{model:e}),(0,N.jsxs)(`div`,{className:`ritual-progress`,children:[(0,N.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`validate`,`load`].map(t=>(0,N.jsxs)(`div`,{className:`ritual-stage ${H(u,t)}`,children:[(0,N.jsx)(f,{className:`ritual-stage-icon`}),(0,N.jsx)(`span`,{children:B(t,o,e)})]},t))}),(0,N.jsx)(`div`,{className:`ritual-bar`,children:(0,N.jsx)(`span`,{className:`ritual-bar-fill ${V(m)}`})})]}),(0,N.jsx)(`div`,{className:`ritual-status`,children:g}),(0,N.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:a(o,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),y&&(0,N.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,N.jsx)(`div`,{className:`ritual-error-detail`,children:a(o,`flow.install.retry`)})]}),(0,N.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:t,disabled:c,children:a(o,`flow.install.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:i,disabled:c,children:a(o,`flow.install.later`)}),u===`done`?(0,N.jsx)(_,{onClick:n,children:a(o,`flow.install.enter`)}):(0,N.jsx)(_,{onClick:x,disabled:c||!e.supported,children:c?a(o,`flow.install.busy`):a(o,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]}),(0,N.jsx)(`div`,{className:`ritual-local-note`,children:a(o,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})}function F(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.install.expected.unknown`,{response:n}):a(t,`flow.install.expected`,{download:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function I(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?a(t,`flow.install.timelineApprox`,{time:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):a(t,`flow.install.timelineQuick`);return[{key:`download`,name:a(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:a(t,`flow.install.timelineStep.validate`),time:a(t,`flow.install.timelineQuick`)},{key:`load`,name:a(t,`flow.install.timelineStep.load`),time:a(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function L(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function R(e){return e===`install`?20:e===`download`?55:e===`validate`?82:e===`load`?94:e===`done`?100:8}function z(e,t,n){let r={install:a(n,`flow.install.prepare`),download:a(n,`flow.install.stage.download`),validate:a(n,`flow.install.stage.validate`),load:a(n,`flow.install.stage.load`),done:a(n,`flow.install.done`),idle:a(n,`flow.install.wait`),error:a(n,`flow.install.stage.error`)}[t];return W(String(e.user_message||e.message||r))}function B(e,t,n){return e===`download`&&!n.downloadRequired?a(t,`flow.install.step.ready`):a(t,`flow.install.step.${e}`)}function V(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function H(e,t){let n=[`idle`,`install`,`download`,`validate`,`load`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function U(e){let t=M(e),n=o(t.recovery_guidance).map(W).filter(Boolean);return[W(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function W(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function G(){let e=r(e=>e.language),t=r(e=>e.setLanguage);return(0,N.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":a(e,`language.label`),children:[`ko`,`en`].map(r=>(0,N.jsx)(`button`,{type:`button`,className:e===r?`is-active`:``,onClick:()=>t(r),"aria-pressed":e===r,children:n[r]},r))})}var K=`lattice.productFlow.user`;function q(){try{let e=localStorage.getItem(K);return e?JSON.parse(e):null}catch{}return null}function J({onSuccess:e}){let t=r(e=>e.language),[n,i]=S.useState(()=>q()?.email||`you@local`),[o,c]=S.useState(``),[l,u]=S.useState(()=>q()?.name||`You`),[d,f]=S.useState(!1),[m,h]=S.useState(null);async function g(r){r.preventDefault();let i=n.trim(),c=o.trim(),u=l.trim()||i.split(`@`)[0]||`You`;if(!i||!c){h(a(t,`flow.login.missing`));return}f(!0),h(null);let d=q(),p=await s.login(i,c);if(!p.ok){if((await s.profile()).ok&&(!d?.email||d.email===i)){try{localStorage.setItem(K,JSON.stringify({email:i,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==i){f(!1),h(a(t,`flow.login.otherEmail`));return}if(d?.email===i){f(!1),h(a(t,`flow.login.wrongPassword`));return}(await s.register({email:i,password:c,name:u,nickname:u})).ok&&(p=await s.login(i,c))}if(!p.ok){f(!1),h(a(t,`flow.login.unavailable`));return}try{localStorage.setItem(K,JSON.stringify({email:i,name:u}))}catch{}f(!1),e()}return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(t,`flow.login.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(t,`flow.login.body`)}),(0,N.jsx)(Y,{}),(0,N.jsxs)(`form`,{onSubmit:g,className:`ritual-card ritual-form`,children:[(0,N.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.name`)}),(0,N.jsx)(p,{value:l,onChange:e=>u(e.target.value),placeholder:a(t,`flow.name.placeholder`),autoComplete:`name`})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.email`)}),(0,N.jsx)(p,{value:n,onChange:e=>i(e.target.value),type:`email`,placeholder:a(t,`flow.email.placeholder`),autoComplete:`email`})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.password`)}),(0,N.jsx)(p,{value:o,onChange:e=>c(e.target.value),type:`password`,placeholder:a(t,`flow.password.placeholder`),autoComplete:`current-password`})]})]}),m&&(0,N.jsx)(`div`,{className:`ritual-error`,role:`alert`,children:m}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(t,`flow.login.passwordLocal`)}),(0,N.jsx)(_,{type:`submit`,disabled:d||!n.trim()||!o.trim(),className:`ritual-full-button`,children:d?a(t,`flow.login.busy`):a(t,`flow.login.submit`)}),(0,N.jsx)(`div`,{className:`ritual-note`,children:a(t,`flow.login.note`)})]})]})}function Y(){let e=r(e=>e.language);return(0,N.jsxs)(`div`,{className:`ritual-promise`,"aria-label":a(e,`flow.promise.aria`),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.memory.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.memory.v`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.model.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.model.v`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.ownership.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.ownership.v`)})]})]})}function X({status:e,reason:t,recommendations:n,analysis:i,onBack:o,onRetry:s,onSkipModel:c,onSelect:d}){let f=r(e=>e.language);if(e===`loading`)return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,N.jsx)(`span`,{children:a(f,`flow.recommend.loading`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:c,children:a(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=t===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":a(f,`flow.recommend.unavailable.aria`),children:(0,N.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,N.jsx)(g,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-strong-text`,children:a(f,`flow.recommend.unavailable.title`)}),(0,N.jsx)(`div`,{className:`ritual-muted-text`,children:a(f,e)})]})]})}),(0,N.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:s,children:[(0,N.jsx)(u,{size:16}),` `,a(f,`flow.recommend.unavailable.retry`)]}),(0,N.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:c,children:a(f,`flow.recommend.skip`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.unavailable.hint`)})]})]})}let p=n;function m(e,t){if(!e)return(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,N.jsx)(`span`,{children:a(t,`flow.analysis.checking`)})]});let n=M(e.recommendations?.recommendations),r=M(e.setup?.environment),i=M(e.recommendations?.profile),o={...r,...i},s=Number(n.ram_gb||Number(o.ram_mb||0)/1024||0);return n.apple_silicon||String(o.arch||``).includes(`arm`)?(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,N.jsx)(`span`,{children:a(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,N.jsx)(`span`,{children:a(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),m(i,f),(0,N.jsxs)(`div`,{className:`ritual-model-list`,children:[p[0]?.supported?(0,N.jsxs)(`div`,{className:`ritual-primary-cta`,children:[(0,N.jsxs)(_,{onClick:()=>d(p[0]),className:`ritual-primary-model-button`,children:[a(f,`flow.recommend.primary`),` `,(0,N.jsx)(l,{size:16})]}),(0,N.jsx)(`div`,{className:`ritual-time-estimate ritual-primary-note`,children:re(p[0],f)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint ritual-next-hint`,children:a(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)})]}):null,p.slice(0,3).map((e,t)=>{let n=e.role===`best`?b:e.role===`faster`?x:v;return(0,N.jsxs)(`button`,{className:`ritual-model-card`,onClick:()=>e.supported&&d(e),disabled:!e.supported,children:[(0,N.jsxs)(`div`,{className:`ritual-model-heading`,children:[(0,N.jsx)(n,{size:16}),(0,N.jsx)(`div`,{className:`role`,children:ie(e.role,t,f)})]}),(0,N.jsx)(`div`,{className:`name`,children:e.shortName}),(0,N.jsxs)(`div`,{className:`reason`,children:[e.reason,` · `,e.size||a(f,`flow.recommend.sizeReady`),Q(e.role,f)?(0,N.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,Q(e.role,f)]}):null]}),(0,N.jsx)(`div`,{className:`ritual-model-stats`,children:(0,N.jsx)(`span`,{className:`ritual-time-estimate`,children:ne(e,f)})}),e.supported?(0,N.jsxs)(`span`,{className:`ritual-model-choose`,children:[a(f,`flow.recommend.choose`),` `,(0,N.jsx)(l,{size:14})]}):(0,N.jsx)(`div`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]},`${e.role}-${e.id}`)}),(0,N.jsx)(`div`,{className:`ritual-time-note`,children:a(f,`flow.recommend.timeNote`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:c,children:a(f,`flow.recommend.skip`)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.hint`)})]})]})}function Z(e,t){return a(t,`flow.recommend.minutes`,{count:e})}function ne(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.timeEstimate.unknown`,{response:n}):a(t,`flow.recommend.timeEstimate`,{download:Z(e.estimatedDownloadMinutes,t),response:n})}function re(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.primaryNote.unknown`):a(t,`flow.recommend.primaryNote`,{time:Z(e.estimatedDownloadMinutes,t)})}function Q(e,t){return e===`faster`?a(t,`flow.recommend.comparison.faster`):e===`advanced`?a(t,`flow.recommend.comparison.advanced`):``}function ie(e,t,n){return e===`best`?a(n,`flow.recommend.rank.best`):e===`faster`?a(n,`flow.recommend.rank.faster`):e===`advanced`?a(n,`flow.recommend.rank.advanced`):a(n,`flow.recommend.rank.choice`,{index:t+1})}function ae({onComplete:e}){let t=r(e=>e.language),[n,i]=S.useState(`wake`),[o,c]=S.useState(null),[l,u]=S.useState(null),[f,p]=S.useState(0),[m,h]=S.useState(null),g=S.useMemo(()=>ee({analysis:o,endpoints:l}),[o,l]);S.useEffect(()=>{let e=!1;async function t(){let[t,n,r,i]=await Promise.all([s.setupScan(),s.modelRecommendations(`local_mlx`),s.models(),s.sysinfo()]);e||(c({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:r.ok?r.data:null,sysinfo:i.ok?i.data:null}),u({setup:t.ok,recommendations:n.ok,models:r.ok,sysinfo:i.ok}))}return t(),()=>{e=!0}},[f]);let _=S.useCallback(()=>{c(null),u(null),p(e=>e+1)},[]);return(0,N.jsx)(`div`,{className:`ritual-shell`,"aria-label":a(t,`flow.shell`),children:(0,N.jsxs)(`div`,{className:`ritual-container`,children:[(0,N.jsx)(G,{}),(0,N.jsxs)(`div`,{className:`ritual-brain`,children:[(0,N.jsx)(d,{state:se(n),intensity:n===`install`?.92:.7,size:`large`,showLabel:!1}),(0,N.jsx)(`div`,{className:`ritual-edition`,title:a(t,`brain.edition.tip`),children:a(t,`brain.edition`)})]}),n===`wake`&&(0,N.jsx)(oe,{onWake:()=>i(`login`),onUseExisting:()=>$(e)}),n===`login`&&(0,N.jsx)(J,{onSuccess:()=>i(`recommend`)}),n===`recommend`&&(0,N.jsx)(X,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:o,onBack:()=>i(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),i(`install`)}}),n===`install`&&(0,N.jsx)(P,{model:m||g.recommendations[0]||w(),onBack:()=>i(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function oe({onWake:e,onUseExisting:t}){let n=r(e=>e.language),i=[{icon:y,label:a(n,`flow.wake.value.local.k`),body:a(n,`flow.wake.value.local.v`)},{icon:x,label:a(n,`flow.wake.value.instant.k`),body:a(n,`flow.wake.value.instant.v`)},{icon:m,label:a(n,`flow.wake.value.brain.k`),body:a(n,`flow.wake.value.brain.v`)}];return(0,N.jsxs)(`section`,{className:`ritual-wake`,"aria-label":a(n,`flow.wake.aria`),children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(n,`flow.wake.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(n,`flow.wake.body`)}),(0,N.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":a(n,`flow.wake.value.aria`),children:i.map(e=>{let t=e.icon;return(0,N.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,N.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,N.jsx)(t,{size:14}),` `,e.label]}),(0,N.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,N.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":a(n,`flow.wake.plan.aria`),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`1`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.identity`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`2`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.check`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`3`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.voice`)})]})]}),(0,N.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[a(n,`flow.wake.primary`),` `,(0,N.jsx)(l,{size:18})]}),(0,N.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:t,children:a(n,`flow.wake.existing`)})]}),(0,N.jsx)(`div`,{className:`ritual-start-note`,children:a(n,`flow.wake.startNote`)})]})}function $(e){h(),e()}function se(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{ae as ProductFlow};
1
+ import{_ as e,b as t,f as n,h as r,m as i,p as a,t as o,u as s,v as c}from"./utils-uQYKXNeq.js";import{i as l,r as u,t as d}from"./LivingBrain-DxP4efJF.js";import{n as f,t as p}from"./input-DVDI0YR3.js";import{t as m}from"./cpu-C6jjYm6i.js";import{S as h,c as g,i as _}from"./index-CHu7cgj3.js";var v=i(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),y=i(`shield`,[[`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`}]]),b=i(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),x=i(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),S=t(c());function C(e){let t=M(e?.models),n=[...o(t.recommended),...o(t.catalog)],r=M(e?.recommendations?.recommendations),i=o(r.models),a=M(r.top_pick),s=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&s.set(t,{...s.get(t)||{},...e})}a.id&&!s.has(String(a.id))&&s.set(String(a.id),a);let c=Array.from(s.values()).map(T).filter(e=>e.id),l=c.filter(e=>e.supported),u=l.length?l:c,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=u.find(e=>e.id!==d?.id&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id),p=u.find(e=>e.id!==d?.id&&e.id!==f?.id&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id&&e.id!==f?.id);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,f?{...f,role:`faster`,reason:f.reason||`faster`}:null,p?{...p,role:`advanced`,reason:p.reason||`advanced`}:null].filter(Boolean)}function ee(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=C(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function w(){return{id:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,loadId:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,engine:`local_mlx`,name:`Qwen3-VL 8B`,shortName:`Qwen 3`,family:`Qwen 3`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:8}}function T(e){let t=M(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=O(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:j(i||n),family:j(String(e.family||i||`local_brain`)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?A(e):``,estimatedDownloadMinutes:o?D(s):0,estimatedFirstResponseSeconds:k(c),parameterBillions:c}}function E(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function D(e){let t=E(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function O(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function k(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function A(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function j(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function M(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var N=e();function te({model:e}){let t=r(e=>e.language),n=e.downloadRequired?[{label:a(t,`flow.consent.size`),value:e.downloadSize||a(t,`flow.consent.sizeUnknown`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:e.externalHost||a(t,`flow.consent.externalUnknown`)}]:[{label:a(t,`flow.consent.state`),value:a(t,`flow.consent.stateReady`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:a(t,`flow.consent.externalNone`)}],i=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,N.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":a(t,i),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:a(t,i)}),(0,N.jsx)(`p`,{children:e.downloadRequired?a(t,`flow.consent.body`):a(t,`flow.consent.ready`)})]}),(0,N.jsx)(`dl`,{children:n.map(e=>(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`dt`,{children:e.label}),(0,N.jsx)(`dd`,{children:e.value})]},e.label))})]})}function P({model:e,onBack:t,onComplete:n,onLater:i}){let o=r(e=>e.language),[c,l]=S.useState(!1),[u,p]=S.useState(`idle`),[m,h]=S.useState(0),[g,v]=S.useState(a(o,`flow.install.wait`)),[y,b]=S.useState(null);async function x(){l(!0),b(null),p(`install`),h(8),v(a(o,`flow.install.prepare`));let t=await s.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=L(String(e.stage||``));p(t),h(Number(e.percent||R(t))),v(z(e,t,o))},onDone:()=>{p(`done`),h(100),v(a(o,`flow.install.done`))},onError:e=>{p(`error`),b(U(e))}});l(!1),t.ok?(p(`done`),h(100),v(a(o,`flow.install.done`)),window.setTimeout(n,700)):(p(`error`),b(U(t.data)))}let C=u===`download`?`thinking`:u===`validate`?`recalling`:u===`load`?`synthesizing`:u===`done`?`idle`:`listening`;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(o,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,N.jsxs)(`div`,{className:`ritual-subtitle`,children:[(0,N.jsx)(`strong`,{children:e.shortName}),` — `,e.reason,`.`,(0,N.jsx)(`br`,{}),a(o,e.downloadRequired?`flow.install.body`:`flow.install.body.ready`)]}),(0,N.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":a(o,`flow.install.expectedTitle`),children:[(0,N.jsx)(`div`,{className:`ritual-fact-label`,children:a(o,`flow.install.expectedTitle`)}),(0,N.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:F(e,o)}),(0,N.jsx)(`ol`,{className:`ritual-timeline`,children:I(e,o).map(e=>(0,N.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,N.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,N.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(o,`flow.install.expectedCompletion`)})]}),(0,N.jsx)(`div`,{className:`ritual-install-brain`,children:(0,N.jsx)(d,{state:C,intensity:u===`download`||u===`load`?.96:.82,size:`normal`})}),(0,N.jsx)(te,{model:e}),(0,N.jsxs)(`div`,{className:`ritual-progress`,children:[(0,N.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`validate`,`load`].map(t=>(0,N.jsxs)(`div`,{className:`ritual-stage ${H(u,t)}`,children:[(0,N.jsx)(f,{className:`ritual-stage-icon`}),(0,N.jsx)(`span`,{children:B(t,o,e)})]},t))}),(0,N.jsx)(`div`,{className:`ritual-bar`,children:(0,N.jsx)(`span`,{className:`ritual-bar-fill ${V(m)}`})})]}),(0,N.jsx)(`div`,{className:`ritual-status`,children:g}),(0,N.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:a(o,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),y&&(0,N.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,N.jsx)(`div`,{className:`ritual-error-detail`,children:a(o,`flow.install.retry`)})]}),(0,N.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:t,disabled:c,children:a(o,`flow.install.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:i,disabled:c,children:a(o,`flow.install.later`)}),u===`done`?(0,N.jsx)(_,{onClick:n,children:a(o,`flow.install.enter`)}):(0,N.jsx)(_,{onClick:x,disabled:c||!e.supported,children:c?a(o,`flow.install.busy`):a(o,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]}),(0,N.jsx)(`div`,{className:`ritual-local-note`,children:a(o,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})}function F(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.install.expected.unknown`,{response:n}):a(t,`flow.install.expected`,{download:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function I(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?a(t,`flow.install.timelineApprox`,{time:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):a(t,`flow.install.timelineQuick`);return[{key:`download`,name:a(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:a(t,`flow.install.timelineStep.validate`),time:a(t,`flow.install.timelineQuick`)},{key:`load`,name:a(t,`flow.install.timelineStep.load`),time:a(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function L(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function R(e){return e===`install`?20:e===`download`?55:e===`validate`?82:e===`load`?94:e===`done`?100:8}function z(e,t,n){let r={install:a(n,`flow.install.prepare`),download:a(n,`flow.install.stage.download`),validate:a(n,`flow.install.stage.validate`),load:a(n,`flow.install.stage.load`),done:a(n,`flow.install.done`),idle:a(n,`flow.install.wait`),error:a(n,`flow.install.stage.error`)}[t];return W(String(e.user_message||e.message||r))}function B(e,t,n){return e===`download`&&!n.downloadRequired?a(t,`flow.install.step.ready`):a(t,`flow.install.step.${e}`)}function V(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function H(e,t){let n=[`idle`,`install`,`download`,`validate`,`load`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function U(e){let t=M(e),n=o(t.recovery_guidance).map(W).filter(Boolean);return[W(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function W(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function G(){let e=r(e=>e.language),t=r(e=>e.setLanguage);return(0,N.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":a(e,`language.label`),children:[`ko`,`en`].map(r=>(0,N.jsx)(`button`,{type:`button`,className:e===r?`is-active`:``,onClick:()=>t(r),"aria-pressed":e===r,children:n[r]},r))})}var K=`lattice.productFlow.user`;function q(){try{let e=localStorage.getItem(K);return e?JSON.parse(e):null}catch{}return null}function J({onSuccess:e}){let t=r(e=>e.language),[n,i]=S.useState(()=>q()?.email||`you@local`),[o,c]=S.useState(``),[l,u]=S.useState(()=>q()?.name||`You`),[d,f]=S.useState(!1),[m,h]=S.useState(null);async function g(r){r.preventDefault();let i=n.trim(),c=o.trim(),u=l.trim()||i.split(`@`)[0]||`You`;if(!i||!c){h(a(t,`flow.login.missing`));return}f(!0),h(null);let d=q(),p=await s.login(i,c);if(!p.ok){if((await s.profile()).ok&&(!d?.email||d.email===i)){try{localStorage.setItem(K,JSON.stringify({email:i,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==i){f(!1),h(a(t,`flow.login.otherEmail`));return}if(d?.email===i){f(!1),h(a(t,`flow.login.wrongPassword`));return}(await s.register({email:i,password:c,name:u,nickname:u})).ok&&(p=await s.login(i,c))}if(!p.ok){f(!1),h(a(t,`flow.login.unavailable`));return}try{localStorage.setItem(K,JSON.stringify({email:i,name:u}))}catch{}f(!1),e()}return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(t,`flow.login.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(t,`flow.login.body`)}),(0,N.jsx)(Y,{}),(0,N.jsxs)(`form`,{onSubmit:g,className:`ritual-card ritual-form`,children:[(0,N.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.name`)}),(0,N.jsx)(p,{value:l,onChange:e=>u(e.target.value),placeholder:a(t,`flow.name.placeholder`),autoComplete:`name`})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.email`)}),(0,N.jsx)(p,{value:n,onChange:e=>i(e.target.value),type:`email`,placeholder:a(t,`flow.email.placeholder`),autoComplete:`email`})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-field-label`,children:a(t,`flow.password`)}),(0,N.jsx)(p,{value:o,onChange:e=>c(e.target.value),type:`password`,placeholder:a(t,`flow.password.placeholder`),autoComplete:`current-password`})]})]}),m&&(0,N.jsx)(`div`,{className:`ritual-error`,role:`alert`,children:m}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(t,`flow.login.passwordLocal`)}),(0,N.jsx)(_,{type:`submit`,disabled:d||!n.trim()||!o.trim(),className:`ritual-full-button`,children:d?a(t,`flow.login.busy`):a(t,`flow.login.submit`)}),(0,N.jsx)(`div`,{className:`ritual-note`,children:a(t,`flow.login.note`)})]})]})}function Y(){let e=r(e=>e.language);return(0,N.jsxs)(`div`,{className:`ritual-promise`,"aria-label":a(e,`flow.promise.aria`),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.memory.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.memory.v`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.model.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.model.v`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:a(e,`flow.promise.ownership.k`)}),(0,N.jsx)(`strong`,{children:a(e,`flow.promise.ownership.v`)})]})]})}function X({status:e,reason:t,recommendations:n,analysis:i,onBack:o,onRetry:s,onSkipModel:c,onSelect:d}){let f=r(e=>e.language);if(e===`loading`)return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,N.jsx)(`span`,{children:a(f,`flow.recommend.loading`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:c,children:a(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=t===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":a(f,`flow.recommend.unavailable.aria`),children:(0,N.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,N.jsx)(g,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-strong-text`,children:a(f,`flow.recommend.unavailable.title`)}),(0,N.jsx)(`div`,{className:`ritual-muted-text`,children:a(f,e)})]})]})}),(0,N.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:s,children:[(0,N.jsx)(u,{size:16}),` `,a(f,`flow.recommend.unavailable.retry`)]}),(0,N.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:c,children:a(f,`flow.recommend.skip`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.unavailable.hint`)})]})]})}let p=n;function m(e,t){if(!e)return(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,N.jsx)(`span`,{children:a(t,`flow.analysis.checking`)})]});let n=M(e.recommendations?.recommendations),r=M(e.setup?.environment),i=M(e.recommendations?.profile),o={...r,...i},s=Number(n.ram_gb||Number(o.ram_mb||0)/1024||0);return n.apple_silicon||String(o.arch||``).includes(`arm`)?(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,N.jsx)(`span`,{children:a(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,N.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,N.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,N.jsx)(`span`,{children:a(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),m(i,f),(0,N.jsxs)(`div`,{className:`ritual-model-list`,children:[p[0]?.supported?(0,N.jsxs)(`div`,{className:`ritual-primary-cta`,children:[(0,N.jsxs)(_,{onClick:()=>d(p[0]),className:`ritual-primary-model-button`,children:[a(f,`flow.recommend.primary`),` `,(0,N.jsx)(l,{size:16})]}),(0,N.jsx)(`div`,{className:`ritual-time-estimate ritual-primary-note`,children:re(p[0],f)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint ritual-next-hint`,children:a(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)})]}):null,p.slice(0,3).map((e,t)=>{let n=e.role===`best`?b:e.role===`faster`?x:v;return(0,N.jsxs)(`button`,{className:`ritual-model-card`,onClick:()=>e.supported&&d(e),disabled:!e.supported,children:[(0,N.jsxs)(`div`,{className:`ritual-model-heading`,children:[(0,N.jsx)(n,{size:16}),(0,N.jsx)(`div`,{className:`role`,children:ie(e.role,t,f)})]}),(0,N.jsx)(`div`,{className:`name`,children:e.shortName}),(0,N.jsxs)(`div`,{className:`reason`,children:[e.reason,` · `,e.size||a(f,`flow.recommend.sizeReady`),Q(e.role,f)?(0,N.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,Q(e.role,f)]}):null]}),(0,N.jsx)(`div`,{className:`ritual-model-stats`,children:(0,N.jsx)(`span`,{className:`ritual-time-estimate`,children:ne(e,f)})}),e.supported?(0,N.jsxs)(`span`,{className:`ritual-model-choose`,children:[a(f,`flow.recommend.choose`),` `,(0,N.jsx)(l,{size:14})]}):(0,N.jsx)(`div`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]},`${e.role}-${e.id}`)}),(0,N.jsx)(`div`,{className:`ritual-time-note`,children:a(f,`flow.recommend.timeNote`)})]}),(0,N.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,N.jsx)(_,{variant:`ghost`,onClick:o,children:a(f,`flow.recommend.back`)}),(0,N.jsx)(_,{variant:`outline`,onClick:c,children:a(f,`flow.recommend.skip`)}),(0,N.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.hint`)})]})]})}function Z(e,t){return a(t,`flow.recommend.minutes`,{count:e})}function ne(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.timeEstimate.unknown`,{response:n}):a(t,`flow.recommend.timeEstimate`,{download:Z(e.estimatedDownloadMinutes,t),response:n})}function re(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.primaryNote.unknown`):a(t,`flow.recommend.primaryNote`,{time:Z(e.estimatedDownloadMinutes,t)})}function Q(e,t){return e===`faster`?a(t,`flow.recommend.comparison.faster`):e===`advanced`?a(t,`flow.recommend.comparison.advanced`):``}function ie(e,t,n){return e===`best`?a(n,`flow.recommend.rank.best`):e===`faster`?a(n,`flow.recommend.rank.faster`):e===`advanced`?a(n,`flow.recommend.rank.advanced`):a(n,`flow.recommend.rank.choice`,{index:t+1})}function ae({onComplete:e}){let t=r(e=>e.language),[n,i]=S.useState(`wake`),[o,c]=S.useState(null),[l,u]=S.useState(null),[f,p]=S.useState(0),[m,h]=S.useState(null),g=S.useMemo(()=>ee({analysis:o,endpoints:l}),[o,l]);S.useEffect(()=>{let e=!1;async function t(){let[t,n,r,i]=await Promise.all([s.setupScan(),s.modelRecommendations(`local_mlx`),s.models(),s.sysinfo()]);e||(c({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:r.ok?r.data:null,sysinfo:i.ok?i.data:null}),u({setup:t.ok,recommendations:n.ok,models:r.ok,sysinfo:i.ok}))}return t(),()=>{e=!0}},[f]);let _=S.useCallback(()=>{c(null),u(null),p(e=>e+1)},[]);return(0,N.jsx)(`div`,{className:`ritual-shell`,"aria-label":a(t,`flow.shell`),children:(0,N.jsxs)(`div`,{className:`ritual-container`,children:[(0,N.jsx)(G,{}),(0,N.jsxs)(`div`,{className:`ritual-brain`,children:[(0,N.jsx)(d,{state:se(n),intensity:n===`install`?.92:.7,size:`large`,showLabel:!1}),(0,N.jsx)(`div`,{className:`ritual-edition`,title:a(t,`brain.edition.tip`),children:a(t,`brain.edition`)})]}),n===`wake`&&(0,N.jsx)(oe,{onWake:()=>i(`login`),onUseExisting:()=>$(e)}),n===`login`&&(0,N.jsx)(J,{onSuccess:()=>i(`recommend`)}),n===`recommend`&&(0,N.jsx)(X,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:o,onBack:()=>i(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),i(`install`)}}),n===`install`&&(0,N.jsx)(P,{model:m||g.recommendations[0]||w(),onBack:()=>i(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function oe({onWake:e,onUseExisting:t}){let n=r(e=>e.language),i=[{icon:y,label:a(n,`flow.wake.value.local.k`),body:a(n,`flow.wake.value.local.v`)},{icon:x,label:a(n,`flow.wake.value.instant.k`),body:a(n,`flow.wake.value.instant.v`)},{icon:m,label:a(n,`flow.wake.value.brain.k`),body:a(n,`flow.wake.value.brain.v`)}];return(0,N.jsxs)(`section`,{className:`ritual-wake`,"aria-label":a(n,`flow.wake.aria`),children:[(0,N.jsx)(`div`,{className:`ritual-title`,children:a(n,`flow.wake.title`)}),(0,N.jsx)(`div`,{className:`ritual-subtitle`,children:a(n,`flow.wake.body`)}),(0,N.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":a(n,`flow.wake.value.aria`),children:i.map(e=>{let t=e.icon;return(0,N.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,N.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,N.jsx)(t,{size:14}),` `,e.label]}),(0,N.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,N.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":a(n,`flow.wake.plan.aria`),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`1`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.identity`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`2`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.check`)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`span`,{children:`3`}),(0,N.jsx)(`strong`,{children:a(n,`flow.wake.step.voice`)})]})]}),(0,N.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[a(n,`flow.wake.primary`),` `,(0,N.jsx)(l,{size:18})]}),(0,N.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:t,children:a(n,`flow.wake.existing`)})]}),(0,N.jsx)(`div`,{className:`ritual-start-note`,children:a(n,`flow.wake.startNote`)})]})}function $(e){h(),e()}function se(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{ae as ProductFlow};
@@ -0,0 +1,3 @@
1
+ import{_ as e,a as t,b as n,h as r,m as i,p as a,u as o,v as s}from"./utils-uQYKXNeq.js";import{a as c}from"./navigation-BddhEWA0.js";import{a as l,t as u,v as d}from"./primitives-D7gCdEvS.js";import{t as f}from"./input-DVDI0YR3.js";import{f as p,i as m,w as h}from"./index-CHu7cgj3.js";var g=i(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_=i(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),v=i(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),y=n(s()),b=400,x=40,S=400;function C(e){return new TextEncoder().encode(e).length}async function w(e){let t=globalThis.crypto?.subtle;if(!t)return``;let n=await t.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function T(e,t,n){let r=[`--- a/${n}`,`+++ b/${n}`],i=e.length?e.split(`
2
+ `):[],a=t.length?t.split(`
3
+ `):[];if(i.length>S||a.length>S)return[...r,...i.map(e=>`-${e}`),...a.map(e=>`+${e}`)].slice(0,b);let o=i.length,s=a.length,c=Array.from({length:o+1},()=>new Uint32Array(s+1));for(let e=o-1;e>=0;--e)for(let t=s-1;t>=0;--t)c[e][t]=i[e]===a[t]?c[e+1][t+1]+1:Math.max(c[e+1][t],c[e][t+1]);let l=[],u=0,d=0;for(;u<o&&d<s;)i[u]===a[d]?(u+=1,d+=1):c[u+1][d]>=c[u][d+1]?(l.push(`-${i[u]}`),u+=1):(l.push(`+${a[d]}`),d+=1);for(;u<o;)l.push(`-${i[u++]}`);for(;d<s;)l.push(`+${a[d++]}`);return l.length?[...r,...l].slice(0,b):[]}async function E(e){let n=await o.proposalDetail(e);if(!n.ok)throw Error(n.error||`HTTP ${n.status}`);let r=n.data,i=t(r.payload)?r.payload:{},a=typeof i.path==`string`?i.path:``,s=typeof r.kind==`string`&&r.kind?r.kind:`file_update`;if(!a)throw Error(`proposal payload has no path`);let c=typeof i.new_content==`string`?i.new_content:``,l=await o.readWorkspaceFile(a);if(!l.ok&&l.status!==404)throw Error(l.error||`HTTP ${l.status}`);let u=l.ok,d=l.ok?l.data.content:``;if(s===`file_update`&&u&&d===c)return await o.rejectProposal(e,`rebase: content already applied`),`already_applied`;if(s===`file_delete`&&!u)return await o.rejectProposal(e,`rebase: file already deleted`),`already_applied`;let f=s===`file_delete`?``:c,p=T(d,f,a),m=u?await w(d):``,h=await o.createReviewItem({title:typeof r.title==`string`&&r.title?r.title:a,summary:typeof r.summary==`string`?r.summary:``,source:`change_proposal`,kind:s,payload:{path:a,diff:p,...s===`file_delete`?{}:{new_content:c},tier:s===`file_delete`?`large`:p.length<=x?`small`:`large`,before_bytes:C(d),after_bytes:C(f),...m||!u?{base_exists:u,base_sha256:m}:{}},provenance:{proposed_by:`user_rebase`,reason:`rebased_from:${e}`,source_detail:`proposal_conflict_rebase`}});if(!h.ok)throw Error(h.error||`HTTP ${h.status}`);let g=String(h.data.id||``);return await o.rejectProposal(e,g?`rebased_to:${g}`:`rebased`),`rebased`}var D=e();function O({language:e,itemId:t,onResolved:n}){let r=c(),[i,o]=y.useState(null),s=h({mutationFn:()=>E(t),onSuccess:async e=>{o(e),await Promise.all([r.invalidateQueries({queryKey:[`pendingProposals`]}),r.invalidateQueries({queryKey:[`proposalCounts`]}),r.invalidateQueries({queryKey:[`automationReviews`]}),r.invalidateQueries({queryKey:[`reviewItems`]})]),n?.(e)}});return(0,D.jsxs)(`div`,{className:`proposal-conflict-note`,role:`alert`,"data-testid":`proposal-conflict-note`,children:[(0,D.jsxs)(`div`,{className:`proposal-conflict-head`,children:[(0,D.jsx)(g,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,D.jsx)(`strong`,{children:a(e,`proposals.conflict.title`)})]}),(0,D.jsx)(`p`,{children:a(e,`proposals.conflict.detail`)}),i===`rebased`?(0,D.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:a(e,`proposals.conflict.rebased`)}):i===`already_applied`?(0,D.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:a(e,`proposals.conflict.alreadyApplied`)}):(0,D.jsxs)(`button`,{type:`button`,className:`proposal-conflict-rebase`,disabled:s.isPending,onClick:()=>s.mutate(),children:[(0,D.jsx)(p,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),s.isPending?a(e,`proposals.conflict.rebasing`):a(e,`proposals.conflict.rebase`)]}),s.isError?(0,D.jsx)(`small`,{className:`proposal-conflict-error`,children:a(e,`proposals.conflict.failed`,{reason:s.error instanceof Error?s.error.message:String(s.error)})}):null]})}var k=[{id:`pending`,labelKey:`review.filter.status.pending`},{id:`snoozed`,labelKey:`review.filter.status.snoozed`},{id:`all`,labelKey:`review.filter.status.all`},{id:`approved`,labelKey:`review.filter.status.approved`},{id:`dismissed`,labelKey:`review.filter.status.dismissed`}],A=[{id:`all`,labelKey:`review.filter.source.all`},{id:`workflow_run`,labelKey:`review.filter.source.workflow_run`},{id:`trigger`,labelKey:`review.filter.source.trigger`},{id:`kg_change_digest`,labelKey:`review.filter.source.kg_change_digest`},{id:`chat_followup`,labelKey:`review.filter.source.chat_followup`},{id:`agent_followup`,labelKey:`review.filter.source.agent_followup`},{id:`change_proposal`,labelKey:`review.filter.source.change_proposal`}];function j(e){return e===`pending`?`warning`:e===`snoozed`?`muted`:e===`approved`?`success`:e===`dismissed`?`danger`:`muted`}var M={pending:`review.itemStatus.pending`,snoozed:`review.itemStatus.snoozed`,approved:`review.itemStatus.approved`,dismissed:`review.itemStatus.dismissed`};function N(e,t){let n=M[t];return n?a(e,n):t}var P={workflow_run:`review.source.workflow_run`,trigger:`review.source.trigger`,kg_change_digest:`review.source.kg_change_digest`,chat_followup:`review.source.chat_followup`,agent_followup:`review.source.agent_followup`,change_proposal:`review.source.change_proposal`};function F(e,t){let n=t?P[t]:void 0;return n?a(e,n):t||a(e,`review.source.automation`)}function I(e,t,n){let r=t.source_detail;if(r!=null&&String(r).trim())return String(r);let i=t.trigger_id;return i!=null&&String(i).trim()?String(i):F(e,n)}var L={read:`review.risk.read`,write:`review.risk.write`,write_scoped:`review.risk.write_scoped`,exec:`review.risk.exec`,destructive:`review.risk.destructive`};function R(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=L[n];return r?a(e,r):n}var z={read:`review.change.read`,additive:`review.change.additive`,mutation:`review.change.mutation`,destructive:`review.change.destructive`,exec:`review.change.exec`};function B(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=z[n];return r?a(e,r):n}function V(){let e=new Date;return e.setDate(e.getDate()+1),e.toISOString()}function H(e,t){if(!t)return a(e,`review.snoozed.badge`);let n=new Date(t);return Number.isNaN(n.getTime())?a(e,`review.snoozed.until`,{value:t}):a(e,`review.snoozed.until`,{value:new Intl.DateTimeFormat(e===`ko`?`ko-KR`:`en-US`,{dateStyle:`medium`,timeStyle:`short`}).format(n)})}function U(e){return e.effective_status===`pending`||e.effective_status===`snoozed`}function W(e){let t=e.payload||{},n=e.provenance||{};return!!(t.last_run_id||n.run_id)}var G=24;function K({language:e,diff:t,path:n,className:r=``}){if(!t.length)return null;let i=t.slice(0,G),o=t.length-i.length;return(0,D.jsxs)(`figure`,{className:`m-0 grid gap-1 ${r}`,children:[(0,D.jsxs)(`figcaption`,{className:`flex flex-wrap items-baseline gap-2 text-xs text-muted-foreground`,children:[(0,D.jsx)(`strong`,{className:`font-medium text-foreground`,children:a(e,`proposals.diff.header`)}),n?(0,D.jsx)(`code`,{className:`break-all`,children:n}):null]}),(0,D.jsx)(`pre`,{className:`pending-proposal-diff`,"aria-label":a(e,`proposals.diff`),children:i.map((e,t)=>(0,D.jsx)(`span`,{className:`block ${q(e)}`,children:e||` `},t))}),o>0?(0,D.jsx)(`small`,{className:`text-xs text-muted-foreground`,children:a(e,`proposals.diff.more`,{count:o})}):null]})}function q(e){return/^\+(?!\+\+)/.test(e)?`text-success`:/^-(?!--)/.test(e)?`text-destructive`:``}function J({item:e,feedback:t,onAction:n}){let i=r(e=>e.mode),o=r(e=>e.language),[s,c]=y.useState(``),h=e.provenance||{},g=e.payload||{},_=W(e),v=e.effective_status===`snoozed`,b=U(e),x=e.source===`change_proposal`,S=e.source!==`chat_followup`&&e.source!==`agent_followup`&&!x,C=Array.isArray(g.diff)?g.diff:[],w=String(g.tier||`small`),T=typeof g.path==`string`&&g.path.trim()?g.path:void 0,E=R(o,h.risk),k=B(o,h.change_class),A=typeof h.tool==`string`&&h.tool.trim()?h.tool:``,M=typeof h.proposed_by==`string`&&h.proposed_by.trim()?h.proposed_by:``;return(0,D.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-4`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`div`,{className:`font-medium`,children:e.title}),e.summary?(0,D.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.summary}):null]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(d,{variant:`muted`,children:F(o,e.source)}),x?(0,D.jsx)(d,{variant:`muted`,children:a(o,e.kind===`file_delete`?`proposals.kind.delete`:w===`large`?`proposals.tier.large`:`proposals.tier.small`)}):null,(0,D.jsx)(d,{variant:j(e.effective_status),children:N(o,e.effective_status)})]})]}),x&&C.length>0?(0,D.jsx)(K,{language:o,diff:C,path:T,className:`mt-3`}):null,v?(0,D.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-3 rounded-md border border-border bg-muted/24 p-3 text-sm`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`font-medium`,children:H(o,e.snoozed_until)}),(0,D.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:a(o,`review.snoozed.detail`)})]}),(0,D.jsxs)(m,{size:`sm`,variant:`outline`,onClick:()=>n(e,`unsnooze`),disabled:!b,children:[(0,D.jsx)(p,{className:`h-3.5 w-3.5`}),` `,a(o,`review.unsnooze`)]})]}):null,E||k||A||M?(0,D.jsxs)(`div`,{className:`mt-3 grid gap-2`,children:[k||E?(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[k?(0,D.jsx)(d,{variant:`muted`,children:k}):null,E?(0,D.jsx)(d,{variant:`muted`,children:E}):null]}):null,A?(0,D.jsxs)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:[(0,D.jsx)(`span`,{className:`font-medium text-foreground`,children:a(o,`review.summary.tool`)}),` · `,A]}):null,M?(0,D.jsxs)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:[(0,D.jsx)(`span`,{className:`font-medium text-foreground`,children:a(o,`review.summary.proposedBy`)}),` · `,M]}):null]}):null,i===`basic`?null:(0,D.jsxs)(`details`,{className:`mt-3 rounded-md border border-border`,children:[(0,D.jsx)(`summary`,{className:`cursor-pointer select-none p-3 text-sm font-medium text-muted-foreground`,children:a(o,`review.technical.title`)}),(0,D.jsx)(`div`,{className:`p-3 pt-0`,children:(0,D.jsx)(l,{data:{workflow:h.workflow_id,trigger:h.trigger_id,run:g.last_run_id||h.run_id,...x?{path:g.path}:{},source_detail:I(o,h,e.source),snoozed_until:e.snoozed_until,created_at:e.created_at,updated_at:e.updated_at},limit:x?12:8})})]}),b?(0,D.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,D.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:a(o,S?`review.runNow.detail`:x?`review.proposal.detail`:e.source===`agent_followup`?`review.agent.detail`:`review.chat.detail`)}),x?(0,D.jsx)(f,{value:s,onChange:e=>c(e.target.value),placeholder:a(o,`review.proposal.rejectReason`),"aria-label":a(o,`review.proposal.rejectReason`)}):null,(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,"aria-label":a(o,`review.actions.aria`),children:[S?(0,D.jsx)(u,{label:a(o,`review.runNow`),successLabel:_?a(o,`review.regenerated`):a(o,`review.executed`),action:()=>n(e,`run_now`,_),invalidate:[]}):null,(0,D.jsx)(u,{label:a(o,x?`proposals.approve`:`review.approve`),action:()=>n(e,`approve`),invalidate:[]}),v?null:(0,D.jsx)(u,{label:a(o,`review.snoozeDay`),action:()=>n(e,`snooze`),invalidate:[]}),(0,D.jsx)(u,{label:a(o,x?`proposals.reject`:`review.dismiss`),action:()=>n(e,`dismiss`,!1,x?s:void 0),invalidate:[],variant:`destructive`})]})]}):null,t?.conflict&&x?(0,D.jsx)(O,{language:o,itemId:e.id}):t?(0,D.jsxs)(`p`,{className:`mt-2 text-xs ${t.tone===`error`?`text-warning`:`text-success`}`,children:[t.message,` - `,a(o,`review.feedback.open`),t.detail&&t.detail!==t.message?(0,D.jsx)(`span`,{className:`mt-0.5 block text-[11px] opacity-75`,children:t.detail}):null]}):null]})}export{k as a,_ as c,A as i,J as n,O as o,V as r,v as s,K as t};
@@ -1 +1 @@
1
- import{_ as e,a as t,b as n,h as r,p as i,s as a,t as o,u as s,v as c}from"./utils-BrfFHAJl.js";import{a as l,n as u,r as d}from"./navigation-B1mkmyUe.js";import{_ as f,a as p,c as m,d as h,g,h as _,i as v,l as y,m as b,n as x,p as S,r as C,s as w,t as T,u as E,v as D}from"./primitives-sIQYKyf5.js";import{t as O}from"./input-DPIkTs9n.js";import{t as k}from"./network-0XDI1Uf_.js";import{_ as A,i as j,l as M,s as N,t as P,w as F}from"./index-DrZSkwrE.js";var I=n(c()),L=e(),R=[{id:`account`,labelKey:`system.tab.account`},{id:`workspaces`,labelKey:`system.tab.workspaces`},{id:`snapshots`,labelKey:`system.tab.snapshots`},{id:`activity`,labelKey:`system.tab.activity`},{id:`network`,labelKey:`system.tab.network`},{id:`settings`,labelKey:`system.tab.settings`},{id:`admin`,labelKey:`system.tab.admin`}];function z({initialTab:e}){let t=r(e=>e.mode),n=r(e=>e.language),[a,o]=I.useState(e||`account`);I.useEffect(()=>{R.some(t=>t.id===e)&&o(e)},[e]);let s=e=>{o(e),u(`/`+{account:`account`,workspaces:`workspace-admin`,snapshots:`snapshots`,activity:`activity`,network:`network`,settings:`settings`,admin:`system-admin`}[e])};return(0,L.jsxs)(`div`,{className:`product-page settings-page space-y-5`,children:[(0,L.jsxs)(`header`,{className:`page-hero`,children:[(0,L.jsxs)(`div`,{className:`page-kicker`,children:[(0,L.jsx)(M,{className:`h-4 w-4`}),` `,i(n,`system.kicker`)]}),(0,L.jsx)(`h1`,{className:`page-title`,children:i(n,`system.title`)}),(0,L.jsx)(`p`,{className:`page-copy`,children:i(n,`system.body`)})]}),(0,L.jsx)(h,{tabs:(t===`basic`?R.filter(e=>e.id===`account`||e.id===`workspaces`||e.id===`snapshots`||e.id===`settings`):R).map(e=>({id:e.id,label:i(n,e.labelKey)})),value:a,onChange:e=>s(e)}),a===`account`?(0,L.jsx)(B,{}):null,a===`workspaces`?(0,L.jsx)(V,{}):null,a===`snapshots`?(0,L.jsx)(ee,{}):null,a===`activity`?(0,L.jsx)(H,{}):null,a===`network`?(0,L.jsx)(te,{}):null,a===`settings`?(0,L.jsx)(U,{}):null,a===`admin`?(0,L.jsx)(X,{}):null]})}function B(){let e=l(),t=r(e=>e.language),n=r(e=>e.setWorkspaceId),a=d({queryKey:[`profile`],queryFn:s.profile}),o=d({queryKey:[`sso`],queryFn:s.ssoConfig}),[c,u]=I.useState(``),[h,v]=I.useState(``),[y,C]=I.useState(``),[w,D]=I.useState(``),[k,M]=I.useState(``),N=e=>{e.ok&&(P(),n(null))},R=F({mutationFn:()=>s.login(c,h),onSuccess:N}),z=F({mutationFn:()=>s.register({email:c,password:h,name:y,nickname:w}),onSuccess:N}),B=F({mutationFn:()=>s.updateProfile({name:y,nickname:w}),onSuccess:()=>e.invalidateQueries({queryKey:[`profile`]})}),V=F({mutationFn:()=>s.changePassword(h,k)});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(t,`system.account.profile`),result:a.data,children:e=>(0,L.jsx)(p,{data:e})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(A,{className:`h-4 w-4`}),` `,i(t,`system.account.title`)]}),(0,L.jsx)(_,{children:i(t,`system.account.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:c,onChange:e=>u(e.target.value),placeholder:i(t,`system.account.email`)}),(0,L.jsx)(O,{type:`password`,value:h,onChange:e=>v(e.target.value),placeholder:i(t,`system.account.password`)}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(O,{value:y,onChange:e=>C(e.target.value),placeholder:i(t,`system.account.name`)}),(0,L.jsx)(O,{value:w,onChange:e=>D(e.target.value),placeholder:i(t,`system.account.nickname`)})]}),(0,L.jsx)(O,{type:`password`,value:k,onChange:e=>M(e.target.value),placeholder:i(t,`system.account.newPassword`)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{onClick:()=>R.mutate(),disabled:!c||!h||R.isPending,children:i(t,`system.account.login`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>z.mutate(),disabled:!c||!h||z.isPending,children:i(t,`system.account.register`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>B.mutate(),disabled:B.isPending,children:i(t,`system.account.save`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>V.mutate(),disabled:!h||!k||V.isPending,children:i(t,`system.account.changePassword`)}),(0,L.jsx)(T,{label:i(t,`system.account.logout`),action:()=>s.logout(),onSuccess:N})]}),[R.data,z.data,B.data,V.data].filter(Boolean).map((e,n)=>(0,L.jsx)(m,{result:e,successLabel:i(t,`system.account.requestDone`)},n))]})]}),(0,L.jsx)(x,{title:i(t,`system.account.signInOptions`),result:o.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(E,{value:e})})]})}function V(){let e=l(),t=r(e=>e.language),{setWorkspaceId:n}=r(),a=d({queryKey:[`workspaceRegistry`],queryFn:s.workspaceRegistry}),c=d({queryKey:[`invitations`],queryFn:s.invitations}),[u,p]=I.useState(``),[m,h]=I.useState(``),[y,C]=I.useState(``),w=F({mutationFn:()=>s.createOrg(u),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),E=F({mutationFn:()=>s.createInvitation({email:m||null,role:`member`,expires_hours:168}),onSuccess:()=>e.invalidateQueries({queryKey:[`invitations`]})}),D=F({mutationFn:()=>s.acceptInvitation(y),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),k=o(a.data?.data?.workspaces);return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,L.jsx)(x,{title:i(t,`system.workspace.yours`),result:a.data,children:()=>(0,L.jsx)(`div`,{className:`grid gap-2`,children:k.map(e=>{let r=String(e.workspace_id||e.id);return(0,L.jsx)(`div`,{className:`rounded-md border border-border p-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(e.name||r)}),(0,L.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[String(e.type||``),` · `,String(e.your_role||e.role||``)]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:`outline`,onClick:()=>n(r),children:i(t,`system.workspace.use`)}),(0,L.jsx)(T,{label:i(t,`system.workspace.activate`),action:()=>s.activateWorkspace(r),invalidate:[`workspaceRegistry`]}),(0,L.jsx)(T,{label:i(t,`system.workspace.archive`),action:()=>s.archiveWorkspace(r),invalidate:[`workspaceRegistry`],variant:`destructive`})]})]})},r)})})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(N,{className:`h-4 w-4`}),` `,i(t,`system.workspace.organizations`)]}),(0,L.jsx)(_,{children:i(t,`system.workspace.organizationsHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:u,onChange:e=>p(e.target.value),placeholder:i(t,`system.workspace.orgPlaceholder`)}),(0,L.jsx)(j,{disabled:!u.trim()||w.isPending,onClick:()=>w.mutate(),children:i(t,`system.workspace.createOrg`)}),(0,L.jsx)(O,{value:m,onChange:e=>h(e.target.value),placeholder:i(t,`system.workspace.inviteeEmail`)}),(0,L.jsx)(j,{variant:`outline`,disabled:E.isPending,onClick:()=>E.mutate(),children:i(t,`system.workspace.createInvite`)}),(0,L.jsx)(O,{value:y,onChange:e=>C(e.target.value),placeholder:i(t,`system.workspace.inviteToken`)}),(0,L.jsx)(j,{variant:`outline`,disabled:!y.trim()||D.isPending,onClick:()=>D.mutate(),children:i(t,`system.workspace.acceptInvite`)}),(0,L.jsx)(x,{title:i(t,`system.workspace.invitations`),result:c.data,children:e=>(0,L.jsx)(v,{items:e.invitations,titleKey:`token`,metaKey:`role`})})]})]})]})}function ee(){let e=r(e=>e.language),t=d({queryKey:[`snapshots`],queryFn:s.snapshots}),n=d({queryKey:[`timeMachine`],queryFn:s.timeMachine}),[a,c]=I.useState(``),[l,u]=I.useState(``),[p,h]=I.useState(``),y=F({mutationFn:()=>s.createSnapshot(a||i(e,`system.snapshots.defaultName`))}),C=F({mutationFn:()=>s.compareSnapshots(l,p)}),w=o(t.data?.data?.snapshots);return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(e,`system.snapshots.title`),result:t.data,children:()=>(0,L.jsx)(`div`,{className:`space-y-2`,children:w.map(t=>{let n=String(t.id||t.snapshot_id);return(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(t.name||n)}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,L.jsx)(T,{label:i(e,`system.snapshots.export`),action:()=>s.exportSnapshot(n)}),(0,L.jsx)(T,{label:i(e,`system.snapshots.mergeRestore`),action:()=>s.restoreSnapshot(n),variant:`outline`})]})]},n)})})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(e,`system.snapshots.actions`)}),(0,L.jsx)(_,{children:i(e,`system.snapshots.actionsHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:a,onChange:e=>c(e.target.value),placeholder:i(e,`system.snapshots.namePlaceholder`)}),(0,L.jsx)(j,{onClick:()=>y.mutate(),disabled:y.isPending,children:i(e,`system.snapshots.create`)}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(O,{value:l,onChange:e=>u(e.target.value),placeholder:i(e,`system.snapshots.beforeId`)}),(0,L.jsx)(O,{value:p,onChange:e=>h(e.target.value),placeholder:i(e,`system.snapshots.afterId`)})]}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>C.mutate(),disabled:!l||!p||C.isPending,children:i(e,`system.snapshots.compare`)}),C.data?(0,L.jsx)(m,{result:C.data,successLabel:i(e,`system.snapshots.compareDone`)}):null]})]}),(0,L.jsx)(x,{title:i(e,`system.snapshots.timeline`),result:n.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(v,{items:e.events||e,titleKey:`event`,metaKey:`type`,limit:14})})]})}function H(){let e=r(e=>e.language),t=d({queryKey:[`realtimeFeed`],queryFn:s.realtimeFeed}),n=d({queryKey:[`presence`],queryFn:s.presence});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(e,`system.activity.feed`),result:t.data,children:e=>(0,L.jsx)(v,{items:e.events,titleKey:`event_type`,metaKey:`area`,limit:14})}),(0,L.jsx)(x,{title:i(e,`system.activity.presence`),result:n.data,children:e=>(0,L.jsx)(G,{data:e})})]})}function te(){let e=l(),t=r(e=>e.language),n=d({queryKey:[`networkIdentity`],queryFn:s.networkIdentity}),a=d({queryKey:[`networkPeers`],queryFn:s.networkPeers}),[c,u]=I.useState(``),[p,h]=I.useState(``),[v,y]=I.useState(``),C=F({mutationFn:()=>s.pairPeer({name:c,base_url:p,public_key:v}),onSuccess:()=>e.invalidateQueries({queryKey:[`networkPeers`]})});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.8fr_1.2fr]`,children:[(0,L.jsx)(x,{title:i(t,`system.network.identity`),result:n.data,children:e=>(0,L.jsx)(K,{data:e})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(k,{className:`h-4 w-4`}),` `,i(t,`system.network.pair`)]}),(0,L.jsx)(_,{children:i(t,`system.network.pairHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:c,onChange:e=>u(e.target.value),placeholder:i(t,`system.network.deviceName`)}),(0,L.jsx)(O,{value:p,onChange:e=>h(e.target.value),placeholder:i(t,`system.network.address`)}),(0,L.jsx)(O,{value:v,onChange:e=>y(e.target.value),placeholder:i(t,`system.network.publicKey`)}),(0,L.jsx)(j,{disabled:!c||!p||!v||C.isPending,onClick:()=>C.mutate(),children:i(t,`system.network.pair`)}),C.data?(0,L.jsx)(m,{result:C.data,successLabel:i(t,`system.network.pairDone`)}):null]})]}),(0,L.jsx)(x,{title:i(t,`system.network.peers`),result:a.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(`div`,{className:`grid gap-2`,children:o(e.peers).map(e=>{let n=String(e.peer_id||e.id);return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(e.name||n)}),(0,L.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.base_url||``)})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(T,{label:i(t,`system.network.pushWorkspace`),action:()=>s.pushPeer(n,r.getState().workspaceId)}),(0,L.jsx)(T,{label:i(t,`system.network.unpair`),action:()=>s.unpairPeer(n),invalidate:[`networkPeers`],variant:`destructive`})]})]},n)})})})]})}function U(){let e=l(),{theme:t,setTheme:n,mode:a,setMode:o}=r(),c=r(e=>e.language),u=d({queryKey:[`health`],queryFn:s.health}),p=d({queryKey:[`sysinfo`],queryFn:s.sysinfo}),h=d({queryKey:[`computerMemory`],queryFn:s.computerMemory}),v=d({queryKey:[`brainStorage`],queryFn:s.brainStorage}),C=d({queryKey:[`backupHealth`],queryFn:s.backupHealth}),[w,D]=I.useState(``),[k,A]=I.useState(`lattice_brain`),[M,N]=I.useState(!1),[P,R]=I.useState(``),[z,B]=I.useState(``),[V,ee]=I.useState(``),[H,te]=I.useState(!1),[U,W]=I.useState(!1),G=F({mutationFn:e=>s.dockerPostgres({consent:e,dry_run:!e,port:5432})}),K=F({mutationFn:()=>s.migratePostgres({dsn:w,schema_name:k||`lattice_brain`,dry_run:!0})}),q=F({mutationFn:()=>s.brainArchive({path:P.trim()||null,passphrase:V}),onSuccess:()=>e.invalidateQueries({queryKey:[`backupHealth`]})}),J=F({mutationFn:()=>s.brainArchiveInspect({path:z,passphrase:V||null})}),Y=F({mutationFn:()=>s.brainArchiveVerify({path:z,passphrase:V})}),X=F({mutationFn:()=>s.brainArchiveRestore({path:z,passphrase:V,dry_run:!0,confirm:!1})}),Z=F({mutationFn:()=>s.brainArchiveRestore({path:z,passphrase:V,dry_run:!1,confirm:H}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}}),Q=F({mutationFn:()=>s.brainArchiveImport({path:z,passphrase:V,dry_run:!0,confirm:!1})}),$=F({mutationFn:()=>s.brainArchiveImport({path:z,passphrase:V,dry_run:!1,confirm:U}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:[(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.panel.appearance`)}),(0,L.jsx)(_,{children:i(c,`system.panel.appearance.hint`)})]}),(0,L.jsxs)(b,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:t===`dark`?`default`:`outline`,onClick:()=>n(`dark`),children:i(c,`system.theme.dark`)}),(0,L.jsx)(j,{variant:t===`light`?`default`:`outline`,onClick:()=>n(`light`),children:i(c,`system.theme.light`)}),[`basic`,`advanced`,`admin`].map(e=>(0,L.jsx)(j,{variant:a===e?`default`:`outline`,onClick:()=>o(e),children:i(c,`shell.mode.${e}`)},e))]})]}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.panel.brainStatus`):i(c,`system.panel.serverHealth`),result:u.data,children:e=>(0,L.jsx)(ne,{data:e})}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.panel.readiness`):i(c,`system.panel.hostTelemetry`),result:p.data,children:e=>a===`basic`?(0,L.jsx)(y,{stats:[{label:i(c,`system.stat.cpu`),value:`${String(e.cpu_pct||`0`)}%`},{label:i(c,`system.stat.memory`),value:`${String(e.ram_pct||`0`)}%`},{label:i(c,`system.stat.gpu`),value:`${String(e.gpu_mem_pct||`0`)}%`},{label:i(c,`system.stat.localStatus`),value:i(c,`system.stat.ready`)}]}):(0,L.jsx)(E,{value:e})}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.storage.title`):i(c,`system.panel.brainStorage`),result:v.data,className:`xl:col-span-3`,children:e=>(0,L.jsx)(re,{data:e,mode:a,language:c})}),a===`basic`?null:(0,L.jsx)(x,{title:i(c,`system.backup.health`),result:C.data,className:`xl:col-span-3`,children:e=>(0,L.jsx)(ie,{data:e})}),a===`basic`?null:(0,L.jsxs)(S,{className:`xl:col-span-3`,children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.archive.title`)}),(0,L.jsx)(_,{children:i(c,`system.archive.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_1fr]`,children:[(0,L.jsx)(O,{value:P,onChange:e=>R(e.target.value),placeholder:i(c,`system.archive.exportPath`)}),(0,L.jsx)(O,{value:z,onChange:e=>B(e.target.value),placeholder:i(c,`system.archive.restorePath`)})]}),(0,L.jsx)(O,{type:`password`,value:V,onChange:e=>ee(e.target.value),placeholder:i(c,`system.archive.passphrase`)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{onClick:()=>q.mutate(),disabled:!V||q.isPending,children:i(c,`system.archive.export`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>J.mutate(),disabled:!z||J.isPending,children:i(c,`system.archive.inspect`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>Y.mutate(),disabled:!z||!V||Y.isPending,children:i(c,`system.archive.verify`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>X.mutate(),disabled:!z||!V||X.isPending,children:i(c,`system.archive.restoreDryRun`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>Q.mutate(),disabled:!z||!V||Q.isPending,children:i(c,`system.archive.importDryRun`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>te(e.target.checked)}),i(c,`system.archive.confirmRestore`)]}),(0,L.jsx)(j,{variant:`destructive`,onClick:()=>Z.mutate(),disabled:!z||!V||!H||Z.isPending,children:i(c,`system.archive.restore`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked)}),i(c,`system.archive.confirmImport`)]}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>$.mutate(),disabled:!z||!V||!U||$.isPending,children:i(c,`system.archive.import`)})]}),[q.data,J.data,Y.data,X.data,Z.data,Q.data,$.data].filter(Boolean).map((e,t)=>(0,L.jsx)(m,{result:e,successLabel:i(c,`system.archive.requestDone`)},t))]})]}),a===`basic`?null:(0,L.jsxs)(S,{className:`xl:col-span-3`,children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.scale.title`)}),(0,L.jsx)(_,{children:i(c,`system.scale.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_220px]`,children:[(0,L.jsx)(O,{value:w,onChange:e=>D(e.target.value),placeholder:i(c,`system.scale.dsn`)}),(0,L.jsx)(O,{value:k,onChange:e=>A(e.target.value),placeholder:i(c,`system.scale.schema`)})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:`outline`,onClick:()=>G.mutate(!1),disabled:G.isPending,children:i(c,`system.scale.dockerPlan`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),i(c,`system.scale.dockerConsent`)]}),(0,L.jsx)(j,{onClick:()=>G.mutate(!0),disabled:!M||G.isPending,children:i(c,`system.scale.dockerStart`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>K.mutate(),disabled:!w||K.isPending,children:i(c,`system.scale.migrationPlan`)})]}),G.data?(0,L.jsx)(m,{result:G.data,successLabel:i(c,`system.scale.dockerDone`)}):null,K.data?(0,L.jsx)(m,{result:K.data,successLabel:i(c,`system.scale.migrationDone`)}):null]})]}),a===`basic`?null:(0,L.jsx)(x,{title:i(c,`system.computerMemory.title`),result:h.data,className:`xl:col-span-3`,children:e=>(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(E,{value:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(T,{label:i(c,`system.computerMemory.enable`),action:()=>s.setComputerMemory(!0),invalidate:[`computerMemory`]}),(0,L.jsx)(T,{label:i(c,`system.computerMemory.disable`),action:()=>s.setComputerMemory(!1),invalidate:[`computerMemory`],variant:`destructive`})]})]})})]})}function W(e,t,n=i(e,`system.value.notReported`)){return t==null||t===``?n:typeof t==`boolean`?i(e,t?`system.value.enabled`:`system.value.disabled`):String(t)}function G({data:e}){let t=r(e=>e.language),n=o(e.presence||e.clients||e);return n.length?(0,L.jsx)(v,{items:n,titleKey:`user`,metaKey:`workspace_id`}):(0,L.jsx)(C,{title:i(t,`system.presence.empty`),detail:i(t,`system.presence.emptyDetail`)})}function K({data:e}){let t=r(e=>e.mode),n=r(e=>e.language),o=W(n,e.public_key,``);return t===`basic`?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(q,{title:i(n,`system.device.thisMac`),status:i(n,`system.value.trusted`),detail:i(n,`system.device.thisMacDetail`)}),(0,L.jsx)(D,{variant:`muted`,children:W(n,e.algorithm,i(n,`system.value.localIdentity`))})]}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(D,{variant:`success`,children:i(n,`system.value.localDevice`)}),(0,L.jsx)(D,{variant:`muted`,children:W(n,e.algorithm,i(n,`system.value.identityKey`))})]}),(0,L.jsx)(p,{data:{device_id:e.device_id||e.id||i(n,`system.value.notReported`),fingerprint:e.fingerprint||i(n,`system.value.notReported`),public_key:o?a(o.replace(/\s+/g,` `),72):i(n,`system.value.notReported`)}})]})}function ne({data:e}){let t=r(e=>e.mode),n=r(e=>e.language);return t===`basic`?(0,L.jsx)(q,{title:i(n,`system.health.title`),status:i(n,`system.health.ok`),detail:i(n,`system.health.detail`)}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.health.status`),value:e.status||e.ok||i(n,`system.value.reported`)},{label:i(n,`system.health.version`),value:e.version||i(n,`system.value.notReported`)},{label:i(n,`system.health.mode`),value:e.mode||e.environment||i(n,`system.value.local`)},{label:i(n,`system.health.port`),value:e.port||e.backend_port||i(n,`system.value.configured`)}]}),(0,L.jsx)(E,{value:e})]})}function re({data:e,mode:n=`advanced`,language:r=`en`}){let a=t(e.active)?e.active:e,o=t(e.postgres)?e.postgres:{},s=t(e.backup_health)?e.backup_health:{},c=a.vector_search||a.vector||e.vector_search||e.sqlite_vec,l=!!(o.available||o.connected||o.enabled),u=!!c&&String(c).toLowerCase()!==`not reported`;return n===`basic`?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(q,{title:i(r,`system.storage.local.title`),status:i(r,`system.storage.local.badge`),detail:i(r,`system.storage.local.detail`)}),(0,L.jsx)(q,{title:i(r,`system.storage.search.title`),status:u?i(r,`system.storage.search.on`):i(r,`system.storage.search.pending`),detail:u?i(r,`system.storage.search.detailOn`):i(r,`system.storage.search.detailPending`)})]}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(y,{stats:[{label:i(r,`system.storage.activeEngine`),value:a.engine||e.engine||i(r,`system.storage.sqlite`)},{label:i(r,`system.storage.sqliteDefault`),value:a.engine===`postgres`?i(r,`system.value.scaleMode`):i(r,`system.value.enabled`)},{label:i(r,`system.storage.vector`),value:c||i(r,`system.value.notReported`)},{label:i(r,`system.storage.postgres`),value:l?i(r,`system.value.available`):i(r,`system.value.optional`)}]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,L.jsx)(q,{title:i(r,`system.storage.sqlite`),status:a.available===!1?i(r,`system.value.unavailable`):i(r,`system.value.default`),detail:W(r,a.reason||a.path||e.path,i(r,`system.storage.sqliteDetail`))}),(0,L.jsx)(q,{title:i(r,`system.storage.vector`),status:W(r,c,i(r,`system.value.reported`)),detail:W(r,a.vector_reason||a.sqlite_vec_reason||e.vector_reason,i(r,`system.storage.vectorDetail`))}),(0,L.jsx)(q,{title:i(r,`system.storage.postgres`),status:l?i(r,`system.value.available`):i(r,`system.value.notEnabled`),detail:W(r,o.reason||o.dsn||o.status,i(r,`system.storage.postgresDetail`))})]}),Object.keys(s).length?(0,L.jsx)(E,{value:{backup_health:s}}):null]})}function ie({data:e}){let t=r(e=>e.language);return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(t,`system.backup.available`),value:e.available===!1?i(t,`system.value.no`):i(t,`system.value.yes`)},{label:i(t,`system.backup.backups`),value:e.count||e.backups||0},{label:i(t,`system.backup.encrypted`),value:e.encrypted_archives||0},{label:i(t,`system.backup.zip`),value:e.zip_backups||0}]}),(0,L.jsx)(p,{data:{directory:e.directory||i(t,`system.value.notReported`),latest:e.latest||i(t,`system.value.noneReported`),last_verified:e.last_verified||e.verified_at||i(t,`system.value.notReported`),failure:e.error||e.reason||i(t,`system.value.noneReported`)}})]})}function q({title:e,status:t,detail:n}){let r=/unavailable|failed|denied|disabled|not enabled|사용 불가|실패|거부|비활성|활성화되지 않음/i.test(t)?`warning`:`success`;return(0,L.jsxs)(`div`,{className:`rounded-md border border-border bg-background p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`font-medium`,children:e}),(0,L.jsx)(D,{variant:r,children:t})]}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:n})]})}function J({data:e}){let n=r(e=>e.language),a=t(e.startup)?e.startup:{},o=t(e.privacy)?e.privacy:{},s=t(e.storage)?e.storage:{},c=t(e.backup)?e.backup:{},l=t(e.device_identity)?e.device_identity:{},u=t(e.permissions)?e.permissions:{};return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.hardening.version`),value:e.version||i(n,`system.value.reported`)},{label:i(n,`system.hardening.localOnly`),value:o.local_only_default??a.local_only_default??i(n,`system.value.reported`)},{label:i(n,`system.hardening.storage`),value:t(s.active)?s.active.engine:i(n,`system.value.reported`)},{label:i(n,`system.hardening.backups`),value:c.count||c.available||i(n,`system.value.reported`)}]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,L.jsx)(q,{title:i(n,`system.hardening.startup`),status:i(n,a.network_exposed?`system.value.networkExposed`:`system.value.localOnly`),detail:i(n,`system.hardening.startupDetail`)}),(0,L.jsx)(q,{title:i(n,`system.hardening.integrations`),status:i(n,o.local_only_default===!1?`system.value.reviewRequired`:`system.value.optIn`),detail:i(n,`system.hardening.integrationsDetail`)}),(0,L.jsx)(q,{title:i(n,`system.hardening.identity`),status:W(n,l.algorithm||l.fingerprint,i(n,`system.value.reported`)),detail:W(n,l.storage,i(n,`system.hardening.identityStorage`))}),(0,L.jsx)(q,{title:i(n,`system.hardening.permissions`),status:i(n,u.destructive_restore_requires_confirmation===!1?`system.value.reviewRequired`:`system.value.guarded`),detail:i(n,`system.hardening.permissionsDetail`)})]})]})}function Y({data:e}){let n=r(e=>e.language),a=t(e.cards)?e.cards:{},o=t(e.severity_counts)?e.severity_counts:{};return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.security.eventsToday`),value:a.events_today||0},{label:i(n,`system.security.highRisk`),value:a.high_risk_events||o.high||0},{label:i(n,`system.security.review`),value:a.review_required||0},{label:i(n,`system.security.riskRate`),value:e.risk_rate||0}]}),(0,L.jsx)(E,{value:{severity_counts:o,sensitive_fields:e.field_counts||{}}})]})}function X(){let e=r(e=>e.mode),t=r(e=>e.language),n=d({queryKey:[`adminSummary`],queryFn:s.adminSummary}),a=d({queryKey:[`adminUsers`],queryFn:s.adminUsers}),o=d({queryKey:[`adminAudit`],queryFn:()=>s.adminAudit()}),c=d({queryKey:[`adminRoles`],queryFn:s.adminRoles}),l=d({queryKey:[`adminPolicies`],queryFn:s.adminPolicies}),u=d({queryKey:[`adminProductHardening`],queryFn:s.adminProductHardening}),f=d({queryKey:[`adminSecurity`],queryFn:s.adminSecurity}),m=d({queryKey:[`vpcStatus`],queryFn:s.vpcStatus});return e===`admin`?(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(t,`system.admin.summary`),result:n.data,children:e=>(0,L.jsx)(p,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.users`),result:a.data,children:e=>(0,L.jsx)(v,{items:e,titleKey:`email`,metaKey:`role`})}),(0,L.jsx)(x,{title:i(t,`system.admin.audit`),result:o.data,children:e=>(0,L.jsx)(v,{items:e.recent_events||e,titleKey:`act`,metaKey:`sev`})}),(0,L.jsx)(x,{title:i(t,`system.admin.roles`),result:c.data,children:e=>(0,L.jsx)(v,{items:e.roles||e,titleKey:`role`,metaKey:`members`})}),(0,L.jsx)(x,{title:i(t,`system.admin.policies`),result:l.data,children:e=>(0,L.jsx)(v,{items:e.policies||e,titleKey:`label`,metaKey:`enforced`})}),(0,L.jsx)(x,{title:i(t,`system.admin.hardening`),result:u.data,children:e=>(0,L.jsx)(J,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.security`),result:f.data,children:e=>(0,L.jsx)(Y,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.vpc`),result:m.data,className:`xl:col-span-2`,children:e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(D,{variant:`muted`,children:i(t,`system.admin.communityUnavailable`)}),(0,L.jsx)(E,{value:e})]})})]}):(0,L.jsx)(w,{title:i(t,`system.admin.controls`),detail:i(t,`system.admin.controlsDetail`),target:`admin`})}export{z as SystemPage};
1
+ import{_ as e,a as t,b as n,h as r,p as i,s as a,t as o,u as s,v as c}from"./utils-uQYKXNeq.js";import{a as l,n as u,r as d}from"./navigation-BddhEWA0.js";import{_ as f,a as p,c as m,d as h,g,h as _,i as v,l as y,m as b,n as x,p as S,r as C,s as w,t as T,u as E,v as D}from"./primitives-D7gCdEvS.js";import{t as O}from"./input-DVDI0YR3.js";import{t as k}from"./network-pYQt5oBu.js";import{_ as A,i as j,l as M,s as N,t as P,w as F}from"./index-CHu7cgj3.js";var I=n(c()),L=e(),R=[{id:`account`,labelKey:`system.tab.account`},{id:`workspaces`,labelKey:`system.tab.workspaces`},{id:`snapshots`,labelKey:`system.tab.snapshots`},{id:`activity`,labelKey:`system.tab.activity`},{id:`network`,labelKey:`system.tab.network`},{id:`settings`,labelKey:`system.tab.settings`},{id:`admin`,labelKey:`system.tab.admin`}];function z({initialTab:e}){let t=r(e=>e.mode),n=r(e=>e.language),[a,o]=I.useState(e||`account`);I.useEffect(()=>{R.some(t=>t.id===e)&&o(e)},[e]);let s=e=>{o(e),u(`/`+{account:`account`,workspaces:`workspace-admin`,snapshots:`snapshots`,activity:`activity`,network:`network`,settings:`settings`,admin:`system-admin`}[e])};return(0,L.jsxs)(`div`,{className:`product-page settings-page space-y-5`,children:[(0,L.jsxs)(`header`,{className:`page-hero`,children:[(0,L.jsxs)(`div`,{className:`page-kicker`,children:[(0,L.jsx)(M,{className:`h-4 w-4`}),` `,i(n,`system.kicker`)]}),(0,L.jsx)(`h1`,{className:`page-title`,children:i(n,`system.title`)}),(0,L.jsx)(`p`,{className:`page-copy`,children:i(n,`system.body`)})]}),(0,L.jsx)(h,{tabs:(t===`basic`?R.filter(e=>e.id===`account`||e.id===`workspaces`||e.id===`snapshots`||e.id===`settings`):R).map(e=>({id:e.id,label:i(n,e.labelKey)})),value:a,onChange:e=>s(e)}),a===`account`?(0,L.jsx)(B,{}):null,a===`workspaces`?(0,L.jsx)(V,{}):null,a===`snapshots`?(0,L.jsx)(ee,{}):null,a===`activity`?(0,L.jsx)(H,{}):null,a===`network`?(0,L.jsx)(te,{}):null,a===`settings`?(0,L.jsx)(U,{}):null,a===`admin`?(0,L.jsx)(X,{}):null]})}function B(){let e=l(),t=r(e=>e.language),n=r(e=>e.setWorkspaceId),a=d({queryKey:[`profile`],queryFn:s.profile}),o=d({queryKey:[`sso`],queryFn:s.ssoConfig}),[c,u]=I.useState(``),[h,v]=I.useState(``),[y,C]=I.useState(``),[w,D]=I.useState(``),[k,M]=I.useState(``),N=e=>{e.ok&&(P(),n(null))},R=F({mutationFn:()=>s.login(c,h),onSuccess:N}),z=F({mutationFn:()=>s.register({email:c,password:h,name:y,nickname:w}),onSuccess:N}),B=F({mutationFn:()=>s.updateProfile({name:y,nickname:w}),onSuccess:()=>e.invalidateQueries({queryKey:[`profile`]})}),V=F({mutationFn:()=>s.changePassword(h,k)});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(t,`system.account.profile`),result:a.data,children:e=>(0,L.jsx)(p,{data:e})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(A,{className:`h-4 w-4`}),` `,i(t,`system.account.title`)]}),(0,L.jsx)(_,{children:i(t,`system.account.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:c,onChange:e=>u(e.target.value),placeholder:i(t,`system.account.email`)}),(0,L.jsx)(O,{type:`password`,value:h,onChange:e=>v(e.target.value),placeholder:i(t,`system.account.password`)}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(O,{value:y,onChange:e=>C(e.target.value),placeholder:i(t,`system.account.name`)}),(0,L.jsx)(O,{value:w,onChange:e=>D(e.target.value),placeholder:i(t,`system.account.nickname`)})]}),(0,L.jsx)(O,{type:`password`,value:k,onChange:e=>M(e.target.value),placeholder:i(t,`system.account.newPassword`)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{onClick:()=>R.mutate(),disabled:!c||!h||R.isPending,children:i(t,`system.account.login`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>z.mutate(),disabled:!c||!h||z.isPending,children:i(t,`system.account.register`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>B.mutate(),disabled:B.isPending,children:i(t,`system.account.save`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>V.mutate(),disabled:!h||!k||V.isPending,children:i(t,`system.account.changePassword`)}),(0,L.jsx)(T,{label:i(t,`system.account.logout`),action:()=>s.logout(),onSuccess:N})]}),[R.data,z.data,B.data,V.data].filter(Boolean).map((e,n)=>(0,L.jsx)(m,{result:e,successLabel:i(t,`system.account.requestDone`)},n))]})]}),(0,L.jsx)(x,{title:i(t,`system.account.signInOptions`),result:o.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(E,{value:e})})]})}function V(){let e=l(),t=r(e=>e.language),{setWorkspaceId:n}=r(),a=d({queryKey:[`workspaceRegistry`],queryFn:s.workspaceRegistry}),c=d({queryKey:[`invitations`],queryFn:s.invitations}),[u,p]=I.useState(``),[m,h]=I.useState(``),[y,C]=I.useState(``),w=F({mutationFn:()=>s.createOrg(u),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),E=F({mutationFn:()=>s.createInvitation({email:m||null,role:`member`,expires_hours:168}),onSuccess:()=>e.invalidateQueries({queryKey:[`invitations`]})}),D=F({mutationFn:()=>s.acceptInvitation(y),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),k=o(a.data?.data?.workspaces);return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,L.jsx)(x,{title:i(t,`system.workspace.yours`),result:a.data,children:()=>(0,L.jsx)(`div`,{className:`grid gap-2`,children:k.map(e=>{let r=String(e.workspace_id||e.id);return(0,L.jsx)(`div`,{className:`rounded-md border border-border p-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(e.name||r)}),(0,L.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[String(e.type||``),` · `,String(e.your_role||e.role||``)]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:`outline`,onClick:()=>n(r),children:i(t,`system.workspace.use`)}),(0,L.jsx)(T,{label:i(t,`system.workspace.activate`),action:()=>s.activateWorkspace(r),invalidate:[`workspaceRegistry`]}),(0,L.jsx)(T,{label:i(t,`system.workspace.archive`),action:()=>s.archiveWorkspace(r),invalidate:[`workspaceRegistry`],variant:`destructive`})]})]})},r)})})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(N,{className:`h-4 w-4`}),` `,i(t,`system.workspace.organizations`)]}),(0,L.jsx)(_,{children:i(t,`system.workspace.organizationsHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:u,onChange:e=>p(e.target.value),placeholder:i(t,`system.workspace.orgPlaceholder`)}),(0,L.jsx)(j,{disabled:!u.trim()||w.isPending,onClick:()=>w.mutate(),children:i(t,`system.workspace.createOrg`)}),(0,L.jsx)(O,{value:m,onChange:e=>h(e.target.value),placeholder:i(t,`system.workspace.inviteeEmail`)}),(0,L.jsx)(j,{variant:`outline`,disabled:E.isPending,onClick:()=>E.mutate(),children:i(t,`system.workspace.createInvite`)}),(0,L.jsx)(O,{value:y,onChange:e=>C(e.target.value),placeholder:i(t,`system.workspace.inviteToken`)}),(0,L.jsx)(j,{variant:`outline`,disabled:!y.trim()||D.isPending,onClick:()=>D.mutate(),children:i(t,`system.workspace.acceptInvite`)}),(0,L.jsx)(x,{title:i(t,`system.workspace.invitations`),result:c.data,children:e=>(0,L.jsx)(v,{items:e.invitations,titleKey:`token`,metaKey:`role`})})]})]})]})}function ee(){let e=r(e=>e.language),t=d({queryKey:[`snapshots`],queryFn:s.snapshots}),n=d({queryKey:[`timeMachine`],queryFn:s.timeMachine}),[a,c]=I.useState(``),[l,u]=I.useState(``),[p,h]=I.useState(``),y=F({mutationFn:()=>s.createSnapshot(a||i(e,`system.snapshots.defaultName`))}),C=F({mutationFn:()=>s.compareSnapshots(l,p)}),w=o(t.data?.data?.snapshots);return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(e,`system.snapshots.title`),result:t.data,children:()=>(0,L.jsx)(`div`,{className:`space-y-2`,children:w.map(t=>{let n=String(t.id||t.snapshot_id);return(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(t.name||n)}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,L.jsx)(T,{label:i(e,`system.snapshots.export`),action:()=>s.exportSnapshot(n)}),(0,L.jsx)(T,{label:i(e,`system.snapshots.mergeRestore`),action:()=>s.restoreSnapshot(n),variant:`outline`})]})]},n)})})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(e,`system.snapshots.actions`)}),(0,L.jsx)(_,{children:i(e,`system.snapshots.actionsHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:a,onChange:e=>c(e.target.value),placeholder:i(e,`system.snapshots.namePlaceholder`)}),(0,L.jsx)(j,{onClick:()=>y.mutate(),disabled:y.isPending,children:i(e,`system.snapshots.create`)}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(O,{value:l,onChange:e=>u(e.target.value),placeholder:i(e,`system.snapshots.beforeId`)}),(0,L.jsx)(O,{value:p,onChange:e=>h(e.target.value),placeholder:i(e,`system.snapshots.afterId`)})]}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>C.mutate(),disabled:!l||!p||C.isPending,children:i(e,`system.snapshots.compare`)}),C.data?(0,L.jsx)(m,{result:C.data,successLabel:i(e,`system.snapshots.compareDone`)}):null]})]}),(0,L.jsx)(x,{title:i(e,`system.snapshots.timeline`),result:n.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(v,{items:e.events||e,titleKey:`event`,metaKey:`type`,limit:14})})]})}function H(){let e=r(e=>e.language),t=d({queryKey:[`realtimeFeed`],queryFn:s.realtimeFeed}),n=d({queryKey:[`presence`],queryFn:s.presence});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(e,`system.activity.feed`),result:t.data,children:e=>(0,L.jsx)(v,{items:e.events,titleKey:`event_type`,metaKey:`area`,limit:14})}),(0,L.jsx)(x,{title:i(e,`system.activity.presence`),result:n.data,children:e=>(0,L.jsx)(G,{data:e})})]})}function te(){let e=l(),t=r(e=>e.language),n=d({queryKey:[`networkIdentity`],queryFn:s.networkIdentity}),a=d({queryKey:[`networkPeers`],queryFn:s.networkPeers}),[c,u]=I.useState(``),[p,h]=I.useState(``),[v,y]=I.useState(``),C=F({mutationFn:()=>s.pairPeer({name:c,base_url:p,public_key:v}),onSuccess:()=>e.invalidateQueries({queryKey:[`networkPeers`]})});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.8fr_1.2fr]`,children:[(0,L.jsx)(x,{title:i(t,`system.network.identity`),result:n.data,children:e=>(0,L.jsx)(K,{data:e})}),(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(k,{className:`h-4 w-4`}),` `,i(t,`system.network.pair`)]}),(0,L.jsx)(_,{children:i(t,`system.network.pairHint`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsx)(O,{value:c,onChange:e=>u(e.target.value),placeholder:i(t,`system.network.deviceName`)}),(0,L.jsx)(O,{value:p,onChange:e=>h(e.target.value),placeholder:i(t,`system.network.address`)}),(0,L.jsx)(O,{value:v,onChange:e=>y(e.target.value),placeholder:i(t,`system.network.publicKey`)}),(0,L.jsx)(j,{disabled:!c||!p||!v||C.isPending,onClick:()=>C.mutate(),children:i(t,`system.network.pair`)}),C.data?(0,L.jsx)(m,{result:C.data,successLabel:i(t,`system.network.pairDone`)}):null]})]}),(0,L.jsx)(x,{title:i(t,`system.network.peers`),result:a.data,className:`xl:col-span-2`,children:e=>(0,L.jsx)(`div`,{className:`grid gap-2`,children:o(e.peers).map(e=>{let n=String(e.peer_id||e.id);return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium`,children:String(e.name||n)}),(0,L.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.base_url||``)})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(T,{label:i(t,`system.network.pushWorkspace`),action:()=>s.pushPeer(n,r.getState().workspaceId)}),(0,L.jsx)(T,{label:i(t,`system.network.unpair`),action:()=>s.unpairPeer(n),invalidate:[`networkPeers`],variant:`destructive`})]})]},n)})})})]})}function U(){let e=l(),{theme:t,setTheme:n,mode:a,setMode:o}=r(),c=r(e=>e.language),u=d({queryKey:[`health`],queryFn:s.health}),p=d({queryKey:[`sysinfo`],queryFn:s.sysinfo}),h=d({queryKey:[`computerMemory`],queryFn:s.computerMemory}),v=d({queryKey:[`brainStorage`],queryFn:s.brainStorage}),C=d({queryKey:[`backupHealth`],queryFn:s.backupHealth}),[w,D]=I.useState(``),[k,A]=I.useState(`lattice_brain`),[M,N]=I.useState(!1),[P,R]=I.useState(``),[z,B]=I.useState(``),[V,ee]=I.useState(``),[H,te]=I.useState(!1),[U,W]=I.useState(!1),G=F({mutationFn:e=>s.dockerPostgres({consent:e,dry_run:!e,port:5432})}),K=F({mutationFn:()=>s.migratePostgres({dsn:w,schema_name:k||`lattice_brain`,dry_run:!0})}),q=F({mutationFn:()=>s.brainArchive({path:P.trim()||null,passphrase:V}),onSuccess:()=>e.invalidateQueries({queryKey:[`backupHealth`]})}),J=F({mutationFn:()=>s.brainArchiveInspect({path:z,passphrase:V||null})}),Y=F({mutationFn:()=>s.brainArchiveVerify({path:z,passphrase:V})}),X=F({mutationFn:()=>s.brainArchiveRestore({path:z,passphrase:V,dry_run:!0,confirm:!1})}),Z=F({mutationFn:()=>s.brainArchiveRestore({path:z,passphrase:V,dry_run:!1,confirm:H}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}}),Q=F({mutationFn:()=>s.brainArchiveImport({path:z,passphrase:V,dry_run:!0,confirm:!1})}),$=F({mutationFn:()=>s.brainArchiveImport({path:z,passphrase:V,dry_run:!1,confirm:U}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}});return(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:[(0,L.jsxs)(S,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.panel.appearance`)}),(0,L.jsx)(_,{children:i(c,`system.panel.appearance.hint`)})]}),(0,L.jsxs)(b,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:t===`dark`?`default`:`outline`,onClick:()=>n(`dark`),children:i(c,`system.theme.dark`)}),(0,L.jsx)(j,{variant:t===`light`?`default`:`outline`,onClick:()=>n(`light`),children:i(c,`system.theme.light`)}),[`basic`,`advanced`,`admin`].map(e=>(0,L.jsx)(j,{variant:a===e?`default`:`outline`,onClick:()=>o(e),children:i(c,`shell.mode.${e}`)},e))]})]}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.panel.brainStatus`):i(c,`system.panel.serverHealth`),result:u.data,children:e=>(0,L.jsx)(ne,{data:e})}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.panel.readiness`):i(c,`system.panel.hostTelemetry`),result:p.data,children:e=>a===`basic`?(0,L.jsx)(y,{stats:[{label:i(c,`system.stat.cpu`),value:`${String(e.cpu_pct||`0`)}%`},{label:i(c,`system.stat.memory`),value:`${String(e.ram_pct||`0`)}%`},{label:i(c,`system.stat.gpu`),value:`${String(e.gpu_mem_pct||`0`)}%`},{label:i(c,`system.stat.localStatus`),value:i(c,`system.stat.ready`)}]}):(0,L.jsx)(E,{value:e})}),(0,L.jsx)(x,{title:a===`basic`?i(c,`system.storage.title`):i(c,`system.panel.brainStorage`),result:v.data,className:`xl:col-span-3`,children:e=>(0,L.jsx)(re,{data:e,mode:a,language:c})}),a===`basic`?null:(0,L.jsx)(x,{title:i(c,`system.backup.health`),result:C.data,className:`xl:col-span-3`,children:e=>(0,L.jsx)(ie,{data:e})}),a===`basic`?null:(0,L.jsxs)(S,{className:`xl:col-span-3`,children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.archive.title`)}),(0,L.jsx)(_,{children:i(c,`system.archive.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_1fr]`,children:[(0,L.jsx)(O,{value:P,onChange:e=>R(e.target.value),placeholder:i(c,`system.archive.exportPath`)}),(0,L.jsx)(O,{value:z,onChange:e=>B(e.target.value),placeholder:i(c,`system.archive.restorePath`)})]}),(0,L.jsx)(O,{type:`password`,value:V,onChange:e=>ee(e.target.value),placeholder:i(c,`system.archive.passphrase`)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{onClick:()=>q.mutate(),disabled:!V||q.isPending,children:i(c,`system.archive.export`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>J.mutate(),disabled:!z||J.isPending,children:i(c,`system.archive.inspect`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>Y.mutate(),disabled:!z||!V||Y.isPending,children:i(c,`system.archive.verify`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>X.mutate(),disabled:!z||!V||X.isPending,children:i(c,`system.archive.restoreDryRun`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>Q.mutate(),disabled:!z||!V||Q.isPending,children:i(c,`system.archive.importDryRun`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>te(e.target.checked)}),i(c,`system.archive.confirmRestore`)]}),(0,L.jsx)(j,{variant:`destructive`,onClick:()=>Z.mutate(),disabled:!z||!V||!H||Z.isPending,children:i(c,`system.archive.restore`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked)}),i(c,`system.archive.confirmImport`)]}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>$.mutate(),disabled:!z||!V||!U||$.isPending,children:i(c,`system.archive.import`)})]}),[q.data,J.data,Y.data,X.data,Z.data,Q.data,$.data].filter(Boolean).map((e,t)=>(0,L.jsx)(m,{result:e,successLabel:i(c,`system.archive.requestDone`)},t))]})]}),a===`basic`?null:(0,L.jsxs)(S,{className:`xl:col-span-3`,children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(f,{children:i(c,`system.scale.title`)}),(0,L.jsx)(_,{children:i(c,`system.scale.detail`)})]}),(0,L.jsxs)(b,{className:`grid gap-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_220px]`,children:[(0,L.jsx)(O,{value:w,onChange:e=>D(e.target.value),placeholder:i(c,`system.scale.dsn`)}),(0,L.jsx)(O,{value:k,onChange:e=>A(e.target.value),placeholder:i(c,`system.scale.schema`)})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(j,{variant:`outline`,onClick:()=>G.mutate(!1),disabled:G.isPending,children:i(c,`system.scale.dockerPlan`)}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),i(c,`system.scale.dockerConsent`)]}),(0,L.jsx)(j,{onClick:()=>G.mutate(!0),disabled:!M||G.isPending,children:i(c,`system.scale.dockerStart`)}),(0,L.jsx)(j,{variant:`outline`,onClick:()=>K.mutate(),disabled:!w||K.isPending,children:i(c,`system.scale.migrationPlan`)})]}),G.data?(0,L.jsx)(m,{result:G.data,successLabel:i(c,`system.scale.dockerDone`)}):null,K.data?(0,L.jsx)(m,{result:K.data,successLabel:i(c,`system.scale.migrationDone`)}):null]})]}),a===`basic`?null:(0,L.jsx)(x,{title:i(c,`system.computerMemory.title`),result:h.data,className:`xl:col-span-3`,children:e=>(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(E,{value:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(T,{label:i(c,`system.computerMemory.enable`),action:()=>s.setComputerMemory(!0),invalidate:[`computerMemory`]}),(0,L.jsx)(T,{label:i(c,`system.computerMemory.disable`),action:()=>s.setComputerMemory(!1),invalidate:[`computerMemory`],variant:`destructive`})]})]})})]})}function W(e,t,n=i(e,`system.value.notReported`)){return t==null||t===``?n:typeof t==`boolean`?i(e,t?`system.value.enabled`:`system.value.disabled`):String(t)}function G({data:e}){let t=r(e=>e.language),n=o(e.presence||e.clients||e);return n.length?(0,L.jsx)(v,{items:n,titleKey:`user`,metaKey:`workspace_id`}):(0,L.jsx)(C,{title:i(t,`system.presence.empty`),detail:i(t,`system.presence.emptyDetail`)})}function K({data:e}){let t=r(e=>e.mode),n=r(e=>e.language),o=W(n,e.public_key,``);return t===`basic`?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(q,{title:i(n,`system.device.thisMac`),status:i(n,`system.value.trusted`),detail:i(n,`system.device.thisMacDetail`)}),(0,L.jsx)(D,{variant:`muted`,children:W(n,e.algorithm,i(n,`system.value.localIdentity`))})]}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(D,{variant:`success`,children:i(n,`system.value.localDevice`)}),(0,L.jsx)(D,{variant:`muted`,children:W(n,e.algorithm,i(n,`system.value.identityKey`))})]}),(0,L.jsx)(p,{data:{device_id:e.device_id||e.id||i(n,`system.value.notReported`),fingerprint:e.fingerprint||i(n,`system.value.notReported`),public_key:o?a(o.replace(/\s+/g,` `),72):i(n,`system.value.notReported`)}})]})}function ne({data:e}){let t=r(e=>e.mode),n=r(e=>e.language);return t===`basic`?(0,L.jsx)(q,{title:i(n,`system.health.title`),status:i(n,`system.health.ok`),detail:i(n,`system.health.detail`)}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.health.status`),value:e.status||e.ok||i(n,`system.value.reported`)},{label:i(n,`system.health.version`),value:e.version||i(n,`system.value.notReported`)},{label:i(n,`system.health.mode`),value:e.mode||e.environment||i(n,`system.value.local`)},{label:i(n,`system.health.port`),value:e.port||e.backend_port||i(n,`system.value.configured`)}]}),(0,L.jsx)(E,{value:e})]})}function re({data:e,mode:n=`advanced`,language:r=`en`}){let a=t(e.active)?e.active:e,o=t(e.postgres)?e.postgres:{},s=t(e.backup_health)?e.backup_health:{},c=a.vector_search||a.vector||e.vector_search||e.sqlite_vec,l=!!(o.available||o.connected||o.enabled),u=!!c&&String(c).toLowerCase()!==`not reported`;return n===`basic`?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(q,{title:i(r,`system.storage.local.title`),status:i(r,`system.storage.local.badge`),detail:i(r,`system.storage.local.detail`)}),(0,L.jsx)(q,{title:i(r,`system.storage.search.title`),status:u?i(r,`system.storage.search.on`):i(r,`system.storage.search.pending`),detail:u?i(r,`system.storage.search.detailOn`):i(r,`system.storage.search.detailPending`)})]}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(y,{stats:[{label:i(r,`system.storage.activeEngine`),value:a.engine||e.engine||i(r,`system.storage.sqlite`)},{label:i(r,`system.storage.sqliteDefault`),value:a.engine===`postgres`?i(r,`system.value.scaleMode`):i(r,`system.value.enabled`)},{label:i(r,`system.storage.vector`),value:c||i(r,`system.value.notReported`)},{label:i(r,`system.storage.postgres`),value:l?i(r,`system.value.available`):i(r,`system.value.optional`)}]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,L.jsx)(q,{title:i(r,`system.storage.sqlite`),status:a.available===!1?i(r,`system.value.unavailable`):i(r,`system.value.default`),detail:W(r,a.reason||a.path||e.path,i(r,`system.storage.sqliteDetail`))}),(0,L.jsx)(q,{title:i(r,`system.storage.vector`),status:W(r,c,i(r,`system.value.reported`)),detail:W(r,a.vector_reason||a.sqlite_vec_reason||e.vector_reason,i(r,`system.storage.vectorDetail`))}),(0,L.jsx)(q,{title:i(r,`system.storage.postgres`),status:l?i(r,`system.value.available`):i(r,`system.value.notEnabled`),detail:W(r,o.reason||o.dsn||o.status,i(r,`system.storage.postgresDetail`))})]}),Object.keys(s).length?(0,L.jsx)(E,{value:{backup_health:s}}):null]})}function ie({data:e}){let t=r(e=>e.language);return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(t,`system.backup.available`),value:e.available===!1?i(t,`system.value.no`):i(t,`system.value.yes`)},{label:i(t,`system.backup.backups`),value:e.count||e.backups||0},{label:i(t,`system.backup.encrypted`),value:e.encrypted_archives||0},{label:i(t,`system.backup.zip`),value:e.zip_backups||0}]}),(0,L.jsx)(p,{data:{directory:e.directory||i(t,`system.value.notReported`),latest:e.latest||i(t,`system.value.noneReported`),last_verified:e.last_verified||e.verified_at||i(t,`system.value.notReported`),failure:e.error||e.reason||i(t,`system.value.noneReported`)}})]})}function q({title:e,status:t,detail:n}){let r=/unavailable|failed|denied|disabled|not enabled|사용 불가|실패|거부|비활성|활성화되지 않음/i.test(t)?`warning`:`success`;return(0,L.jsxs)(`div`,{className:`rounded-md border border-border bg-background p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`font-medium`,children:e}),(0,L.jsx)(D,{variant:r,children:t})]}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:n})]})}function J({data:e}){let n=r(e=>e.language),a=t(e.startup)?e.startup:{},o=t(e.privacy)?e.privacy:{},s=t(e.storage)?e.storage:{},c=t(e.backup)?e.backup:{},l=t(e.device_identity)?e.device_identity:{},u=t(e.permissions)?e.permissions:{};return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.hardening.version`),value:e.version||i(n,`system.value.reported`)},{label:i(n,`system.hardening.localOnly`),value:o.local_only_default??a.local_only_default??i(n,`system.value.reported`)},{label:i(n,`system.hardening.storage`),value:t(s.active)?s.active.engine:i(n,`system.value.reported`)},{label:i(n,`system.hardening.backups`),value:c.count||c.available||i(n,`system.value.reported`)}]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,L.jsx)(q,{title:i(n,`system.hardening.startup`),status:i(n,a.network_exposed?`system.value.networkExposed`:`system.value.localOnly`),detail:i(n,`system.hardening.startupDetail`)}),(0,L.jsx)(q,{title:i(n,`system.hardening.integrations`),status:i(n,o.local_only_default===!1?`system.value.reviewRequired`:`system.value.optIn`),detail:i(n,`system.hardening.integrationsDetail`)}),(0,L.jsx)(q,{title:i(n,`system.hardening.identity`),status:W(n,l.algorithm||l.fingerprint,i(n,`system.value.reported`)),detail:W(n,l.storage,i(n,`system.hardening.identityStorage`))}),(0,L.jsx)(q,{title:i(n,`system.hardening.permissions`),status:i(n,u.destructive_restore_requires_confirmation===!1?`system.value.reviewRequired`:`system.value.guarded`),detail:i(n,`system.hardening.permissionsDetail`)})]})]})}function Y({data:e}){let n=r(e=>e.language),a=t(e.cards)?e.cards:{},o=t(e.severity_counts)?e.severity_counts:{};return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(y,{stats:[{label:i(n,`system.security.eventsToday`),value:a.events_today||0},{label:i(n,`system.security.highRisk`),value:a.high_risk_events||o.high||0},{label:i(n,`system.security.review`),value:a.review_required||0},{label:i(n,`system.security.riskRate`),value:e.risk_rate||0}]}),(0,L.jsx)(E,{value:{severity_counts:o,sensitive_fields:e.field_counts||{}}})]})}function X(){let e=r(e=>e.mode),t=r(e=>e.language),n=d({queryKey:[`adminSummary`],queryFn:s.adminSummary}),a=d({queryKey:[`adminUsers`],queryFn:s.adminUsers}),o=d({queryKey:[`adminAudit`],queryFn:()=>s.adminAudit()}),c=d({queryKey:[`adminRoles`],queryFn:s.adminRoles}),l=d({queryKey:[`adminPolicies`],queryFn:s.adminPolicies}),u=d({queryKey:[`adminProductHardening`],queryFn:s.adminProductHardening}),f=d({queryKey:[`adminSecurity`],queryFn:s.adminSecurity}),m=d({queryKey:[`vpcStatus`],queryFn:s.vpcStatus});return e===`admin`?(0,L.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,L.jsx)(x,{title:i(t,`system.admin.summary`),result:n.data,children:e=>(0,L.jsx)(p,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.users`),result:a.data,children:e=>(0,L.jsx)(v,{items:e,titleKey:`email`,metaKey:`role`})}),(0,L.jsx)(x,{title:i(t,`system.admin.audit`),result:o.data,children:e=>(0,L.jsx)(v,{items:e.recent_events||e,titleKey:`act`,metaKey:`sev`})}),(0,L.jsx)(x,{title:i(t,`system.admin.roles`),result:c.data,children:e=>(0,L.jsx)(v,{items:e.roles||e,titleKey:`role`,metaKey:`members`})}),(0,L.jsx)(x,{title:i(t,`system.admin.policies`),result:l.data,children:e=>(0,L.jsx)(v,{items:e.policies||e,titleKey:`label`,metaKey:`enforced`})}),(0,L.jsx)(x,{title:i(t,`system.admin.hardening`),result:u.data,children:e=>(0,L.jsx)(J,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.security`),result:f.data,children:e=>(0,L.jsx)(Y,{data:e})}),(0,L.jsx)(x,{title:i(t,`system.admin.vpc`),result:m.data,className:`xl:col-span-2`,children:e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(D,{variant:`muted`,children:i(t,`system.admin.communityUnavailable`)}),(0,L.jsx)(E,{value:e})]})})]}):(0,L.jsx)(w,{title:i(t,`system.admin.controls`),detail:i(t,`system.admin.controlsDetail`),target:`admin`})}export{z as SystemPage};
@@ -1 +1 @@
1
- import{m as e}from"./utils-BrfFHAJl.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
1
+ import{m as e}from"./utils-uQYKXNeq.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{m as e}from"./utils-uQYKXNeq.js";var t=e(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]);export{t};
@@ -1 +1 @@
1
- import{m as e}from"./utils-BrfFHAJl.js";var t=e(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]);export{t};
1
+ import{m as e}from"./utils-uQYKXNeq.js";var t=e(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]);export{t};
@@ -1 +1 @@
1
- import{m as e}from"./utils-BrfFHAJl.js";var t=e(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]);export{t};
1
+ import{m as e}from"./utils-uQYKXNeq.js";var t=e(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]);export{t};
@@ -1 +1 @@
1
- import{m as e}from"./utils-BrfFHAJl.js";var t=e(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),n=e(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),r=e(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]);export{n,t as r,r as t};
1
+ import{m as e}from"./utils-uQYKXNeq.js";var t=e(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),n=e(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),r=e(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]);export{n,t as r,r as t};