@runeya/runeya 2.0.163 → 2.0.165

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 (111) hide show
  1. package/{chat-PK7AGEMQ.js → chat-V7WLWBKC.js} +3 -3
  2. package/{chunk-7EDWDQDE.js → chunk-45VWJES2.js} +11 -4
  3. package/chunk-45VWJES2.js.map +1 -0
  4. package/{chunk-MA5PMG6C.js → chunk-5OQ535SJ.js} +25 -6
  5. package/chunk-5OQ535SJ.js.map +1 -0
  6. package/{companion-TZBQ6QS7.js → companion-S2TNQTLR.js} +4 -2
  7. package/index.js +7 -7
  8. package/{install-gate-BLAAYFUO.js → install-gate-572K6MYI.js} +2 -2
  9. package/package.json +1 -1
  10. package/{src-4SDXJP3Q.js → src-ZVPNMMK3.js} +5 -4
  11. package/src-ZVPNMMK3.js.map +1 -0
  12. package/web/assets/{AgentScalarChatInterface.vue-CWploeDO.js → AgentScalarChatInterface.vue-XwKooHuS.js} +1 -1
  13. package/web/assets/{AgentTerminalPage-DDHkXcbl.js → AgentTerminalPage-yRB_ecJI.js} +1 -1
  14. package/web/assets/{AiChatModals-TIc0t8Cs.js → AiChatModals-D1yRQMh8.js} +2 -2
  15. package/web/assets/AppLayout-D_DMmcQ_.js +1 -0
  16. package/web/assets/AppLayout-jK59lNI7.css +1 -0
  17. package/web/assets/AuditPage-CTfXPJXj.js +1 -0
  18. package/web/assets/CloudAccountPage-69TgsAkH.js +1 -0
  19. package/web/assets/CloudMessagingPage-CUc4VuBI.js +2 -0
  20. package/web/assets/CloudMessagingPage-Dc9H34Kx.css +1 -0
  21. package/web/assets/{DashboardPage-CbpfUPoS.js → DashboardPage-CxvT8kYn.js} +1 -1
  22. package/web/assets/{DirectoryPickerDialog-D2p5F7JN.js → DirectoryPickerDialog-B12uXo7l.js} +1 -1
  23. package/web/assets/{EditorIcon-DYGui0zm.js → EditorIcon-Ca1Xckfj.js} +1 -1
  24. package/web/assets/{EnvironmentForm-CoUhUbMb.js → EnvironmentForm-CopKlo6q.js} +1 -1
  25. package/web/assets/{EnvironmentFormPage-CixPsRNC.js → EnvironmentFormPage-Cz6YAx-U.js} +1 -1
  26. package/web/assets/{EnvironmentListPage-F6QmEixL.js → EnvironmentListPage-BS40ed1P.js} +1 -1
  27. package/web/assets/{FlagChip-DBj0fpJC.js → FlagChip-CM65ij7k.js} +1 -1
  28. package/web/assets/{KanbanListPage-DzelnkLg.js → KanbanListPage-oCMzi-up.js} +1 -1
  29. package/web/assets/{KnowledgeListPage-CTDl1lQZ.js → KnowledgeListPage-DXc22GWH.js} +1 -1
  30. package/web/assets/{KnowledgePagePage-B1wS_THR.js → KnowledgePagePage-CNbOVHck.js} +1 -1
  31. package/web/assets/{LaunchProjectPage-DxesorHd.js → LaunchProjectPage-AIYk8dGc.js} +1 -1
  32. package/web/assets/{LaunchServicesPage-BwknHlfT.js → LaunchServicesPage-CZhKFYNl.js} +1 -1
  33. package/web/assets/{LaunchShell-DY29IY1u.js → LaunchShell-D_XB2573.js} +1 -1
  34. package/web/assets/LogViewer-CbMt1k2q.js +3 -0
  35. package/web/assets/{OrgKeyPrompt-DSFh5x8d.js → OrgKeyPrompt-DIVl9Gty.js} +1 -1
  36. package/web/assets/{ProcessControls-CuP-yhBs.js → ProcessControls-xb3eKh_B.js} +1 -1
  37. package/web/assets/{ProcessDetailPage-RLN365IN.js → ProcessDetailPage-DmUYI53O.js} +1 -1
  38. package/web/assets/{ProcessMetrics-CAiB2nbb.js → ProcessMetrics-AGxoq56e.js} +1 -1
  39. package/web/assets/{ProjectCreateDialog-CVLIwNp4.js → ProjectCreateDialog-B4CxGj-L.js} +1 -1
  40. package/web/assets/{ProjectLocationGate-CKxNLg8l.js → ProjectLocationGate-U5Bui-hK.js} +1 -1
  41. package/web/assets/{ProjectPublishDialog-Bc9KSvbz.js → ProjectPublishDialog-CWIDRZjr.js} +1 -1
  42. package/web/assets/{RandomJobTestPage-CI1VZQld.js → RandomJobTestPage-8e9DnxU1.js} +1 -1
  43. package/web/assets/ScenarioEditorPage-Avu3w8g_.js +14 -0
  44. package/web/assets/{SendToChatDialog-Df7wMccw.js → SendToChatDialog-BMtNa_QR.js} +1 -1
  45. package/web/assets/{ServiceControlsBar-BBJr0I6Y.js → ServiceControlsBar-C1_QRdUe.js} +1 -1
  46. package/web/assets/ServiceDetailPage-B8Vg-PRp.js +2 -0
  47. package/web/assets/ServiceFormPage-C7OwEHJX.js +1 -0
  48. package/web/assets/{SettingsPage-Cq7CsBFs.js → SettingsPage-Bdn2BbwW.js} +9 -9
  49. package/web/assets/{UnlockPage-CmUScGJ0.js → UnlockPage-DUbZyfro.js} +1 -1
  50. package/web/assets/{VaultMigrationPage-CmPMpmug.js → VaultMigrationPage-BRZ_EUuH.js} +1 -1
  51. package/web/assets/{VersionBadge-CbXK3uSs.js → VersionBadge-DN2Ho-8Q.js} +1 -1
  52. package/web/assets/{WikiPage-CKnso3xR.js → WikiPage-BT8PeGYT.js} +1 -1
  53. package/web/assets/{WikiView-CMy_JgEf.js → WikiView-DWl168iH.js} +1 -1
  54. package/web/assets/{agent.store-TNybFdDu.js → agent.store-BrQmTiUs.js} +1 -1
  55. package/web/assets/{auth-P2oqhfLJ.js → auth-Bn1t6v9Z.js} +2 -2
  56. package/web/assets/cloud-chat.store-PQ_0vP9-.js +1 -0
  57. package/web/assets/cloud-client-C3E2yyUu.js +2 -0
  58. package/web/assets/{cloud-session-BSRFBtW5.js → cloud-session-BGrDhQyl.js} +2 -2
  59. package/web/assets/i18n-YdGGLQ4Z.js +17 -0
  60. package/web/assets/{index-CNvxC2Zv.js → index-CJqaFgn7.js} +7 -7
  61. package/web/assets/index-DPyBKb-x.css +1 -0
  62. package/web/assets/{knowledge-host-BEXhduq-.js → knowledge-host-CkkSWmXA.js} +4 -4
  63. package/web/assets/{notification.store-B150rmMZ.js → notification.store-ChNT9swL.js} +1 -1
  64. package/web/assets/{project-launch.store-9PE0nYa6.js → project-launch.store-uVIdI1FE.js} +1 -1
  65. package/web/assets/{project.store-DS9yZmd1.js → project.store-BGgsly35.js} +1 -1
  66. package/web/assets/{scenario.store-D8PzqAes.js → scenario.store-BOxwE9Nf.js} +2 -2
  67. package/web/assets/{service.store-BGU4aO6x.js → service.store-BUl1mZ8r.js} +1 -1
  68. package/web/assets/{settings-scope-BLpz3gLZ.js → settings-scope-DPiKHU9X.js} +1 -1
  69. package/web/assets/{settings.store-9C1gV1zX.js → settings.store-CFW7A0nw.js} +1 -1
  70. package/web/assets/{src-D_HTzAKM.js → src-BQgMiizJ.js} +3 -3
  71. package/web/assets/src-ByZ6iA0V.css +1 -0
  72. package/web/assets/src-CVBn8NuP.js +525 -0
  73. package/web/assets/{src-C1pDBhwJ.js → src-D6Id_6yT.js} +43 -43
  74. package/web/assets/src-D9bzjqzP.css +1 -0
  75. package/web/assets/{src-ZDBDx6hs.css → src-EQeZO9eV.css} +1 -1
  76. package/web/assets/src-q8L6Eojs.js +3 -0
  77. package/web/assets/src-zpuGtnBZ.css +1 -0
  78. package/web/assets/{trpc--XNiYHQf.js → trpc-_B70IpnV.js} +3 -3
  79. package/web/assets/useEnvVarAutocomplete-Cr7IlfC5.js +1 -0
  80. package/web/assets/{useProjectCatalog-B6E7VPMS.js → useProjectCatalog-BLPIZIFK.js} +1 -1
  81. package/web/assets/{useProjectCloudOrg-33pCxtnH.js → useProjectCloudOrg-eL8syIRO.js} +1 -1
  82. package/web/assets/{useServiceUrlHost-ck54ZREf.js → useServiceUrlHost-DkHZRri8.js} +1 -1
  83. package/web/assets/uuid-DA_69zxD.js +1 -0
  84. package/web/index.html +26 -26
  85. package/chunk-7EDWDQDE.js.map +0 -1
  86. package/chunk-MA5PMG6C.js.map +0 -1
  87. package/src-4SDXJP3Q.js.map +0 -1
  88. package/web/assets/AppLayout-B6ReNlOU.css +0 -1
  89. package/web/assets/AppLayout-BAFe_QtB.js +0 -1
  90. package/web/assets/AuditPage-BAmQQbvl.js +0 -1
  91. package/web/assets/CloudAccountPage-CaGxEyyk.js +0 -1
  92. package/web/assets/CloudMessagingPage-CBXU2DPE.js +0 -2
  93. package/web/assets/CloudMessagingPage-wkdPo1JF.css +0 -1
  94. package/web/assets/LogViewer-gA3SH_DA.js +0 -3
  95. package/web/assets/ScenarioEditorPage-CfFkDdGL.js +0 -14
  96. package/web/assets/ServiceDetailPage-BhCGAC2M.js +0 -2
  97. package/web/assets/ServiceFormPage-CBgzk0w-.js +0 -1
  98. package/web/assets/cloud-chat.store-DI81m7nJ.js +0 -1
  99. package/web/assets/cloud-client-f1uf6_f0.js +0 -2
  100. package/web/assets/i18n-CPWEaCn9.js +0 -17
  101. package/web/assets/index-CSsNTonn.css +0 -1
  102. package/web/assets/src-B1nAsOcw.js +0 -3
  103. package/web/assets/src-BR35jQnn.css +0 -1
  104. package/web/assets/src-C1M5hNGI.css +0 -1
  105. package/web/assets/src-DwxqtlGt.js +0 -1
  106. package/web/assets/src-dOj6pCsH.css +0 -1
  107. package/web/assets/useEnvVarAutocomplete-BDwIJgwj.js +0 -1
  108. package/web/assets/uuid-D2uso58z.js +0 -1
  109. /package/{chat-PK7AGEMQ.js.map → chat-V7WLWBKC.js.map} +0 -0
  110. /package/{companion-TZBQ6QS7.js.map → companion-S2TNQTLR.js.map} +0 -0
  111. /package/{install-gate-BLAAYFUO.js.map → install-gate-572K6MYI.js.map} +0 -0
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,_ as i,b as a,ct as o,en as s,g as ee,k as c,mt as l,o as u,qt as d,rn as f,tt as p,v as m,y as h}from"./runtime-core.esm-bundler-DujKY9QV.js";import{w as te}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ne}from"./vue-i18n-o7yraQpR.js";import{g as re,h as ie}from"./useApi-s_02lHjl-DZYO2tHU.js";import{J as ae,W as oe,dt as se,ft as g,w as ce}from"./src-B1nAsOcw.js";import{t as _}from"./trpc--XNiYHQf.js";import{d as v,l as y,n as b,u as x}from"./auth-P2oqhfLJ.js";import{t as S}from"./notification.store-B150rmMZ.js";import{a as C,c as w,o as T}from"./index-CNvxC2Zv.js";import{n as E,t as D}from"./VersionBadge-CbXK3uSs.js";var O={class:`unlock-container`},k={class:`unlock-header`},A={class:`unlock-mark`,"aria-hidden":`true`},j={class:`unlock-mark__badge`},M={class:`unlock-title`,"data-testid":`unlock-title`},le={class:`unlock-subtitle`},N={class:`field`},P={for:`masterPassword`},F={key:0,class:`field`},I={for:`encryptionKey`},L={class:`field-help`},R={key:2,class:`machine-warning`},z=g(c({__name:`UnlockPage`,setup(c){let g=re(),z=ie(),{t:B}=ne(),V=w(),H=S(),U=t(``),W=t(``),G=t(``),K=t(!1),q=t(null),J=t(null),Y=t(null);async function ue(){let e=Y.value;if(!e||typeof e.animate!=`function`)return;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,n=t?{opacity:0}:{opacity:0,transform:`translateY(-8px) scale(0.98)`,filter:`blur(4px)`};try{await e.animate([{},n],{duration:t?120:180,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,fill:`forwards`}).finished}catch{}}function X(){p(()=>{(J.value?.$el?.querySelector(`input`))?.focus()})}let Z=ee(()=>q.value?.state===`setup`);o(async()=>{X();try{q.value=await b(),q.value.state===`unlocked`&&await $()}catch{G.value=B(`unlockPage.serverUnreachable`)}});async function Q(){G.value=``,K.value=!0;try{let e;if(q.value?.state===`setup`){let t=q.value.hasVerifyFile&&!q.value.isLegacyMigration&&W.value||void 0;e=await x(U.value,t)}else e=await v(U.value);y(e),await T({loadPreferences:()=>H.loadPreferences(),initTrpcWs:_,startStatusStream:()=>V.startStatusStream(),startDataStream:()=>C()}),await ue(),await $()}catch(e){Y.value?.getAnimations?.().forEach(e=>e.cancel()),G.value=e instanceof Error?e.message:B(`unlockPage.unknownError`),X()}finally{K.value=!1}}async function $(){try{if((await b()).legacyVault){await g.push({name:`migrate-vault`});return}}catch{}let e=z.query.redirect;e&&e.startsWith(`/`)?await g.push(e):await g.push({name:`launch-project`})}return(t,o)=>(l(),a(`div`,O,[i(`div`,{ref_key:`cardRef`,ref:Y,class:`unlock-card`},[i(`div`,k,[i(`div`,A,[n(E),i(`span`,j,[i(`i`,{class:s(Z.value?`ti ti-shield`:`ti ti-lock`)},null,2)])]),i(`h1`,M,f(Z.value?e(B)(`unlockPage.titleSetup`):e(B)(`unlockPage.titleLocked`)),1),i(`p`,le,[Z.value&&q.value?.isLegacyMigration?(l(),a(u,{key:0},[r(f(e(B)(`unlockPage.subtitleLegacyMigration`)),1)],64)):Z.value&&q.value?.hasVerifyFile?(l(),a(u,{key:1},[r(f(e(B)(`unlockPage.subtitleHasVerifyFile`)),1)],64)):Z.value?(l(),a(u,{key:2},[r(f(e(B)(`unlockPage.subtitleSetup`)),1)],64)):(l(),a(u,{key:3},[r(f(e(B)(`unlockPage.subtitleUnlock`)),1)],64))])]),i(`form`,{onSubmit:te(Q,[`prevent`]),class:`unlock-form`},[i(`div`,N,[i(`label`,P,f(e(B)(`unlockPage.masterPasswordLabel`)),1),n(e(ce),{ref_key:`passwordRef`,ref:J,id:`masterPassword`,"data-testid":`master-password-input`,modelValue:U.value,"onUpdate:modelValue":o[0]||=e=>U.value=e,feedback:Z.value,toggleMask:``,fluid:``,disabled:K.value,autocomplete:Z.value?`new-password`:`current-password`,placeholder:e(B)(`unlockPage.masterPasswordPlaceholder`)},null,8,[`modelValue`,`feedback`,`disabled`,`autocomplete`,`placeholder`])]),Z.value&&q.value?.hasVerifyFile&&!q.value?.isLegacyMigration?(l(),a(`div`,F,[i(`label`,I,f(e(B)(`unlockPage.encryptionKeyLabel`)),1),n(e(ae),{id:`encryptionKey`,"data-testid":`encryption-key-input`,modelValue:W.value,"onUpdate:modelValue":o[1]||=e=>W.value=e,fluid:``,disabled:K.value,placeholder:e(B)(`unlockPage.encryptionKeyPlaceholder`),autocomplete:`off`},null,8,[`modelValue`,`disabled`,`placeholder`]),i(`small`,L,f(e(B)(`unlockPage.encryptionKeyHelp`)),1)])):h(``,!0),G.value?(l(),m(e(oe),{key:1,severity:`error`,"data-testid":`unlock-error`},{default:d(()=>[r(f(G.value),1)]),_:1})):h(``,!0),n(e(se),{type:`submit`,class:`unlock-submit`,"data-testid":`unlock-submit-btn`,label:K.value?e(B)(`unlockPage.pleaseWait`):Z.value?e(B)(`unlockPage.configure`):e(B)(`unlockPage.unlock`),disabled:K.value||!U.value,loading:K.value,fluid:``},null,8,[`label`,`disabled`,`loading`]),Z.value?(l(),a(`p`,R,[o[2]||=i(`i`,{class:`ti ti-info-circle`,"aria-hidden":`true`},null,-1),i(`span`,null,f(e(B)(`unlockPage.machineWarning`)),1)])):h(``,!0)],32)],512),n(D)]))}}),[[`__scopeId`,`data-v-af0b3bc7`]]);export{z as default};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,_ as i,b as a,ct as o,en as s,g as ee,k as c,mt as l,o as u,qt as d,rn as f,tt as p,v as m,y as h}from"./runtime-core.esm-bundler-DujKY9QV.js";import{w as te}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ne}from"./vue-i18n-o7yraQpR.js";import{g as re,h as ie}from"./useApi-s_02lHjl-DZYO2tHU.js";import{J as ae,W as oe,b as se,dt as ce,ft as g}from"./src-q8L6Eojs.js";import{t as _}from"./trpc-_B70IpnV.js";import{d as v,l as y,n as b,u as x}from"./auth-Bn1t6v9Z.js";import{t as S}from"./notification.store-ChNT9swL.js";import{a as C,c as w,o as T}from"./index-CJqaFgn7.js";import{n as E,t as D}from"./VersionBadge-DN2Ho-8Q.js";var O={class:`unlock-container`},k={class:`unlock-header`},A={class:`unlock-mark`,"aria-hidden":`true`},j={class:`unlock-mark__badge`},M={class:`unlock-title`,"data-testid":`unlock-title`},le={class:`unlock-subtitle`},N={class:`field`},P={for:`masterPassword`},F={key:0,class:`field`},I={for:`encryptionKey`},L={class:`field-help`},R={key:2,class:`machine-warning`},z=g(c({__name:`UnlockPage`,setup(c){let g=re(),z=ie(),{t:B}=ne(),V=w(),H=S(),U=t(``),W=t(``),G=t(``),K=t(!1),q=t(null),J=t(null),Y=t(null);async function ue(){let e=Y.value;if(!e||typeof e.animate!=`function`)return;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,n=t?{opacity:0}:{opacity:0,transform:`translateY(-8px) scale(0.98)`,filter:`blur(4px)`};try{await e.animate([{},n],{duration:t?120:180,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,fill:`forwards`}).finished}catch{}}function X(){p(()=>{(J.value?.$el?.querySelector(`input`))?.focus()})}let Z=ee(()=>q.value?.state===`setup`);o(async()=>{X();try{q.value=await b(),q.value.state===`unlocked`&&await $()}catch{G.value=B(`unlockPage.serverUnreachable`)}});async function Q(){G.value=``,K.value=!0;try{let e;if(q.value?.state===`setup`){let t=q.value.hasVerifyFile&&!q.value.isLegacyMigration&&W.value||void 0;e=await x(U.value,t)}else e=await v(U.value);y(e),await T({loadPreferences:()=>H.loadPreferences(),initTrpcWs:_,startStatusStream:()=>V.startStatusStream(),startDataStream:()=>C()}),await ue(),await $()}catch(e){Y.value?.getAnimations?.().forEach(e=>e.cancel()),G.value=e instanceof Error?e.message:B(`unlockPage.unknownError`),X()}finally{K.value=!1}}async function $(){try{if((await b()).legacyVault){await g.push({name:`migrate-vault`});return}}catch{}let e=z.query.redirect;e&&e.startsWith(`/`)?await g.push(e):await g.push({name:`launch-project`})}return(t,o)=>(l(),a(`div`,O,[i(`div`,{ref_key:`cardRef`,ref:Y,class:`unlock-card`},[i(`div`,k,[i(`div`,A,[n(E),i(`span`,j,[i(`i`,{class:s(Z.value?`ti ti-shield`:`ti ti-lock`)},null,2)])]),i(`h1`,M,f(Z.value?e(B)(`unlockPage.titleSetup`):e(B)(`unlockPage.titleLocked`)),1),i(`p`,le,[Z.value&&q.value?.isLegacyMigration?(l(),a(u,{key:0},[r(f(e(B)(`unlockPage.subtitleLegacyMigration`)),1)],64)):Z.value&&q.value?.hasVerifyFile?(l(),a(u,{key:1},[r(f(e(B)(`unlockPage.subtitleHasVerifyFile`)),1)],64)):Z.value?(l(),a(u,{key:2},[r(f(e(B)(`unlockPage.subtitleSetup`)),1)],64)):(l(),a(u,{key:3},[r(f(e(B)(`unlockPage.subtitleUnlock`)),1)],64))])]),i(`form`,{onSubmit:te(Q,[`prevent`]),class:`unlock-form`},[i(`div`,N,[i(`label`,P,f(e(B)(`unlockPage.masterPasswordLabel`)),1),n(e(se),{ref_key:`passwordRef`,ref:J,id:`masterPassword`,"data-testid":`master-password-input`,modelValue:U.value,"onUpdate:modelValue":o[0]||=e=>U.value=e,feedback:Z.value,toggleMask:``,fluid:``,disabled:K.value,autocomplete:Z.value?`new-password`:`current-password`,placeholder:e(B)(`unlockPage.masterPasswordPlaceholder`)},null,8,[`modelValue`,`feedback`,`disabled`,`autocomplete`,`placeholder`])]),Z.value&&q.value?.hasVerifyFile&&!q.value?.isLegacyMigration?(l(),a(`div`,F,[i(`label`,I,f(e(B)(`unlockPage.encryptionKeyLabel`)),1),n(e(ae),{id:`encryptionKey`,"data-testid":`encryption-key-input`,modelValue:W.value,"onUpdate:modelValue":o[1]||=e=>W.value=e,fluid:``,disabled:K.value,placeholder:e(B)(`unlockPage.encryptionKeyPlaceholder`),autocomplete:`off`},null,8,[`modelValue`,`disabled`,`placeholder`]),i(`small`,L,f(e(B)(`unlockPage.encryptionKeyHelp`)),1)])):h(``,!0),G.value?(l(),m(e(oe),{key:1,severity:`error`,"data-testid":`unlock-error`},{default:d(()=>[r(f(G.value),1)]),_:1})):h(``,!0),n(e(ce),{type:`submit`,class:`unlock-submit`,"data-testid":`unlock-submit-btn`,label:K.value?e(B)(`unlockPage.pleaseWait`):Z.value?e(B)(`unlockPage.configure`):e(B)(`unlockPage.unlock`),disabled:K.value||!U.value,loading:K.value,fluid:``},null,8,[`label`,`disabled`,`loading`]),Z.value?(l(),a(`p`,R,[o[2]||=i(`i`,{class:`ti ti-info-circle`,"aria-hidden":`true`},null,-1),i(`span`,null,f(e(B)(`unlockPage.machineWarning`)),1)])):h(``,!0)],32)],512),n(D)]))}}),[[`__scopeId`,`data-v-af0b3bc7`]]);export{z as default};
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,_ as i,b as a,bt as o,ct as s,k as c,mt as l,o as u,qt as d,rn as f,v as p,y as m}from"./runtime-core.esm-bundler-DujKY9QV.js";import{w as h}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as g}from"./vue-i18n-o7yraQpR.js";import{g as _}from"./useApi-s_02lHjl-DZYO2tHU.js";import{W as v,dt as y,ft as b,w as x}from"./src-B1nAsOcw.js";import{f as S,n as C}from"./auth-P2oqhfLJ.js";import{n as w}from"./error-DpF7X5iu.js";var T={class:`migration-page`,"data-testid":`page-content`},E={class:`migration-card`},D={class:`migration-title`,"data-testid":`vault-migration-title`},O={class:`migration-lead`},k={class:`migration-path`},A={for:`legacyMasterPassword`},j={class:`migration-report`},M={key:0},N={key:1,class:`migration-report__warn`},P={class:`migration-backup`},F=b(c({__name:`VaultMigrationPage`,setup(c){let b=_(),{t:F}=g(),I=t(null),L=t(``),R=t(!1),z=t(``),B=t(null);s(async()=>{try{let e=await C();I.value=e.legacyVault??null,I.value||await b.replace({name:`launch-project`})}catch{z.value=F(`vaultMigration.statusError`)}});async function V(){if(L.value){R.value=!0,z.value=``;try{B.value=await S(L.value),L.value=``}catch(e){z.value=w(e)??F(`vaultMigration.failed`)}finally{R.value=!1}}}async function H(){await b.replace({name:`launch-project`})}return(t,s)=>(l(),a(`div`,T,[i(`div`,E,[i(`h1`,D,f(e(F)(`vaultMigration.title`)),1),B.value?(l(),a(u,{key:1},[n(e(v),{severity:`success`,"data-testid":`vault-migration-done`},{default:d(()=>[r(f(e(F)(`vaultMigration.done`)),1)]),_:1}),i(`ul`,j,[(l(!0),a(u,null,o(B.value.rekeyed,t=>(l(),a(`li`,{key:t.file},f(e(F)(`vaultMigration.rekeyed`,{file:t.file,count:t.values})),1))),128)),B.value.moved.length?(l(),a(`li`,M,f(e(F)(`vaultMigration.moved`,{files:B.value.moved.join(`, `)})),1)):m(``,!0),B.value.skipped.length?(l(),a(`li`,N,f(e(F)(`vaultMigration.skipped`,{files:B.value.skipped.join(`, `)})),1)):m(``,!0)]),i(`p`,P,[r(f(e(F)(`vaultMigration.backupKept`))+` `,1),i(`code`,null,f(B.value.backupDir),1)]),n(e(y),{"data-testid":`vault-migration-continue`,label:e(F)(`vaultMigration.continue`),onClick:H},null,8,[`label`])],64)):(l(),a(u,{key:0},[i(`p`,O,f(e(F)(`vaultMigration.lead`)),1),i(`p`,k,[i(`code`,null,f(I.value),1)]),n(e(v),{severity:`info`,class:`migration-note`},{default:d(()=>[r(f(e(F)(`vaultMigration.backupNote`)),1)]),_:1}),i(`form`,{class:`migration-form`,onSubmit:h(V,[`prevent`])},[i(`label`,A,f(e(F)(`vaultMigration.oldPasswordLabel`)),1),n(e(x),{id:`legacyMasterPassword`,modelValue:L.value,"onUpdate:modelValue":s[0]||=e=>L.value=e,"data-testid":`legacy-master-password-input`,feedback:!1,"toggle-mask":``,autocomplete:`current-password`,disabled:R.value,fluid:``},null,8,[`modelValue`,`disabled`]),z.value?(l(),p(e(v),{key:0,severity:`error`,"data-testid":`vault-migration-error`},{default:d(()=>[r(f(z.value),1)]),_:1})):m(``,!0),n(e(y),{type:`submit`,"data-testid":`vault-migration-submit`,label:R.value?e(F)(`vaultMigration.migrating`):e(F)(`vaultMigration.migrate`),loading:R.value,disabled:R.value||!L.value},null,8,[`label`,`loading`,`disabled`])],32)],64))])]))}}),[[`__scopeId`,`data-v-a3510ba2`]]);export{F as default};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,_ as i,b as a,bt as o,ct as s,k as c,mt as l,o as u,qt as d,rn as f,v as p,y as m}from"./runtime-core.esm-bundler-DujKY9QV.js";import{w as h}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as g}from"./vue-i18n-o7yraQpR.js";import{g as _}from"./useApi-s_02lHjl-DZYO2tHU.js";import{W as v,b as y,dt as b,ft as x}from"./src-q8L6Eojs.js";import{f as S,n as C}from"./auth-Bn1t6v9Z.js";import{n as w}from"./error-DpF7X5iu.js";var T={class:`migration-page`,"data-testid":`page-content`},E={class:`migration-card`},D={class:`migration-title`,"data-testid":`vault-migration-title`},O={class:`migration-lead`},k={class:`migration-path`},A={for:`legacyMasterPassword`},j={class:`migration-report`},M={key:0},N={key:1,class:`migration-report__warn`},P={class:`migration-backup`},F=x(c({__name:`VaultMigrationPage`,setup(c){let x=_(),{t:F}=g(),I=t(null),L=t(``),R=t(!1),z=t(``),B=t(null);s(async()=>{try{let e=await C();I.value=e.legacyVault??null,I.value||await x.replace({name:`launch-project`})}catch{z.value=F(`vaultMigration.statusError`)}});async function V(){if(L.value){R.value=!0,z.value=``;try{B.value=await S(L.value),L.value=``}catch(e){z.value=w(e)??F(`vaultMigration.failed`)}finally{R.value=!1}}}async function H(){await x.replace({name:`launch-project`})}return(t,s)=>(l(),a(`div`,T,[i(`div`,E,[i(`h1`,D,f(e(F)(`vaultMigration.title`)),1),B.value?(l(),a(u,{key:1},[n(e(v),{severity:`success`,"data-testid":`vault-migration-done`},{default:d(()=>[r(f(e(F)(`vaultMigration.done`)),1)]),_:1}),i(`ul`,j,[(l(!0),a(u,null,o(B.value.rekeyed,t=>(l(),a(`li`,{key:t.file},f(e(F)(`vaultMigration.rekeyed`,{file:t.file,count:t.values})),1))),128)),B.value.moved.length?(l(),a(`li`,M,f(e(F)(`vaultMigration.moved`,{files:B.value.moved.join(`, `)})),1)):m(``,!0),B.value.skipped.length?(l(),a(`li`,N,f(e(F)(`vaultMigration.skipped`,{files:B.value.skipped.join(`, `)})),1)):m(``,!0)]),i(`p`,P,[r(f(e(F)(`vaultMigration.backupKept`))+` `,1),i(`code`,null,f(B.value.backupDir),1)]),n(e(b),{"data-testid":`vault-migration-continue`,label:e(F)(`vaultMigration.continue`),onClick:H},null,8,[`label`])],64)):(l(),a(u,{key:0},[i(`p`,O,f(e(F)(`vaultMigration.lead`)),1),i(`p`,k,[i(`code`,null,f(I.value),1)]),n(e(v),{severity:`info`,class:`migration-note`},{default:d(()=>[r(f(e(F)(`vaultMigration.backupNote`)),1)]),_:1}),i(`form`,{class:`migration-form`,onSubmit:h(V,[`prevent`])},[i(`label`,A,f(e(F)(`vaultMigration.oldPasswordLabel`)),1),n(e(y),{id:`legacyMasterPassword`,modelValue:L.value,"onUpdate:modelValue":s[0]||=e=>L.value=e,"data-testid":`legacy-master-password-input`,feedback:!1,"toggle-mask":``,autocomplete:`current-password`,disabled:R.value,fluid:``},null,8,[`modelValue`,`disabled`]),z.value?(l(),p(e(v),{key:0,severity:`error`,"data-testid":`vault-migration-error`},{default:d(()=>[r(f(z.value),1)]),_:1})):m(``,!0),n(e(b),{type:`submit`,"data-testid":`vault-migration-submit`,label:R.value?e(F)(`vaultMigration.migrating`):e(F)(`vaultMigration.migrate`),loading:R.value,disabled:R.value||!L.value},null,8,[`label`,`loading`,`disabled`])],32)],64))])]))}}),[[`__scopeId`,`data-v-a3510ba2`]]);export{F as default};
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{b as n,ct as r,k as i,mt as a,rn as o,v as s,y as c}from"./runtime-core.esm-bundler-DujKY9QV.js";import{ft as l}from"./src-B1nAsOcw.js";import{r as u}from"./trpc--XNiYHQf.js";import{n as d}from"./index-CNvxC2Zv.js";var f=l(i({__name:`RuneyaMark`,props:{size:{default:40}},setup(t){return(n,r)=>(a(),s(e(d),{class:`runeya-mark`,size:t.size},null,8,[`size`]))}}),[[`__scopeId`,`data-v-203dbae4`]]),p={key:0,class:`version-badge`,"data-testid":`version-badge`},m=l(i({__name:`VersionBadge`,setup(e){let i=t(``);return r(()=>{u.health.check.query().then(e=>{i.value=e.version}).catch(()=>{})}),(e,t)=>i.value?(a(),n(`span`,p,`v`+o(i.value),1)):c(``,!0)}}),[[`__scopeId`,`data-v-f94beae8`]]);export{f as n,m as t};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{b as n,ct as r,k as i,mt as a,rn as o,v as s,y as c}from"./runtime-core.esm-bundler-DujKY9QV.js";import{ft as l}from"./src-q8L6Eojs.js";import{r as u}from"./trpc-_B70IpnV.js";import{n as d}from"./index-CJqaFgn7.js";var f=l(i({__name:`RuneyaMark`,props:{size:{default:40}},setup(t){return(n,r)=>(a(),s(e(d),{class:`runeya-mark`,size:t.size},null,8,[`size`]))}}),[[`__scopeId`,`data-v-203dbae4`]]),p={key:0,class:`version-badge`,"data-testid":`version-badge`},m=l(i({__name:`VersionBadge`,setup(e){let i=t(``);return r(()=>{u.health.check.query().then(e=>{i.value=e.version}).catch(()=>{})}),(e,t)=>i.value?(a(),n(`span`,p,`v`+o(i.value),1)):c(``,!0)}}),[[`__scopeId`,`data-v-f94beae8`]]);export{f as n,m as t};
@@ -1 +1 @@
1
- import{k as e,mt as t,v as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{t as r}from"./WikiView-CMy_JgEf.js";var i=e({__name:`WikiPage`,setup(e){return(e,i)=>(t(),n(r,{scope:`global`}))}});export{i as default};
1
+ import{k as e,mt as t,v as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{t as r}from"./WikiView-DWl168iH.js";var i=e({__name:`WikiPage`,setup(e){return(e,i)=>(t(),n(r,{scope:`global`}))}});export{i as default};
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,Ht as i,St as a,_ as o,b as s,bt as c,ct as l,en as u,g as d,it as f,k as p,mt as m,o as h,qt as g,rn as _,v as ee,y as v}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as y,w as b}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{g as te}from"./useApi-s_02lHjl-DZYO2tHU.js";import{J as x,Y as S,dt as C,ft as w,j as ne}from"./src-B1nAsOcw.js";import{r as T}from"./trpc--XNiYHQf.js";import{t as re}from"./src-D_HTzAKM.js";var E={class:`fs-node`},D=[`title`],O={class:`fs-node__name`},k=[`title`],A={class:`fs-node__name`},j={key:2,class:`fs-node__actions`},M={key:0,class:`fs-node__children`},ie=p({__name:`FsNode`,props:{entry:{},selectedPath:{},expanded:{},editable:{type:Boolean}},emits:[`toggle`,`select`,`create-child`,`rename`,`delete`],setup(e,{emit:t}){let r=e,i=t,l=d(()=>r.entry.type===`dir`&&r.expanded.has(r.entry.path)),f=d(()=>r.entry.type===`file`&&r.selectedPath===r.entry.path);return(t,r)=>{let d=a(`FsNode`,!0);return m(),s(`div`,E,[o(`div`,{class:u([`fs-node__row`,{"fs-node__row--selected":f.value}])},[e.entry.type===`dir`?(m(),s(`button`,{key:0,class:`fs-node__main`,title:e.entry.path,onClick:r[0]||=t=>i(`toggle`,e.entry.path)},[o(`i`,{class:u(`ti ${l.value?`ti-chevron-down`:`ti-chevron-right`} fs-node__caret`)},null,2),o(`i`,{class:u(`ti ${l.value?`ti-folder-open`:`ti-folder`} fs-node__icon fs-node__icon--folder`)},null,2),o(`span`,O,_(e.entry.name),1)],8,D)):(m(),s(`button`,{key:1,class:`fs-node__main`,title:e.entry.path,onClick:r[1]||=t=>i(`select`,e.entry.path)},[r[11]||=o(`span`,{class:`fs-node__caret-spacer`},null,-1),r[12]||=o(`i`,{class:`ti ti-file fs-node__icon`},null,-1),o(`span`,A,_(e.entry.name),1)],8,k)),e.editable?(m(),s(`div`,j,[e.entry.type===`dir`?(m(),s(`button`,{key:0,class:`fs-node__action`,title:`Nouveau fichier`,onClick:r[2]||=b(t=>i(`create-child`,e.entry.path,`file`),[`stop`])},[...r[13]||=[o(`i`,{class:`ti ti-file-plus`},null,-1)]])):v(``,!0),e.entry.type===`dir`?(m(),s(`button`,{key:1,class:`fs-node__action`,title:`Nouveau dossier`,onClick:r[3]||=b(t=>i(`create-child`,e.entry.path,`dir`),[`stop`])},[...r[14]||=[o(`i`,{class:`ti ti-folder-plus`},null,-1)]])):v(``,!0),o(`button`,{class:`fs-node__action`,title:`Renommer`,onClick:r[4]||=b(t=>i(`rename`,e.entry.path,e.entry.type===`dir`),[`stop`])},[...r[15]||=[o(`i`,{class:`ti ti-pencil`},null,-1)]]),o(`button`,{class:`fs-node__action fs-node__action--danger`,title:`Supprimer`,onClick:r[5]||=b(t=>i(`delete`,e.entry.path,e.entry.type===`dir`),[`stop`])},[...r[16]||=[o(`i`,{class:`ti ti-trash`},null,-1)]])])):v(``,!0)],2),e.entry.type===`dir`&&l.value?(m(),s(`ul`,M,[(m(!0),s(h,null,c(e.entry.children,t=>(m(),s(`li`,{key:t.path},[n(d,{entry:t,"selected-path":e.selectedPath,expanded:e.expanded,editable:e.editable,onToggle:r[6]||=e=>i(`toggle`,e),onSelect:r[7]||=e=>i(`select`,e),onCreateChild:r[8]||=(e,t)=>i(`create-child`,e,t),onRename:r[9]||=(e,t)=>i(`rename`,e,t),onDelete:r[10]||=(e,t)=>i(`delete`,e,t)},null,8,[`entry`,`selected-path`,`expanded`,`editable`])]))),128))])):v(``,!0)])}}}),ae={key:0,class:`wiki__not-configured`},oe={key:1,class:`wiki__not-configured`},se={key:0},ce={key:1},le={key:2,class:`wiki`},ue={class:`wiki__sidebar`},de={class:`wiki__sidebar-header`},fe=[`title`],pe={class:`wiki__sidebar-actions`},me={key:0,class:`wiki__loading`},he={key:1,class:`wiki__error`},ge={key:2,class:`wiki__empty`},_e={key:3,class:`wiki__tree`},ve={class:`wiki__main`},ye={class:`wiki__title-row`},be={class:`wiki__title-path`},xe={key:0,class:`wiki__status`},Se={key:0},Ce={key:1},we={key:2,class:`wiki__status-saved`},Te={key:1,class:`wiki__status wiki__status-readonly`},Ee={key:0,class:`wiki__editor-actions`},De={key:1,class:`wiki__loading`},Oe={key:1,class:`wiki__placeholder`},ke={class:`wiki__prompt-body`},Ae={for:`wiki-prompt-input`,class:`wiki__prompt-label`},je={class:`wiki__link-list`},Me=[`onClick`],Ne={class:`wiki__link-path`},Pe={key:0,class:`wiki__link-empty`},N=w(p({__name:`WikiView`,props:{scope:{}},setup(a){let p=te(),w=a,E=ne(),D=t(``),O=t([]),k=t(!1),A=t(null),j=t(!1),M=t(null),N=t(!1),P=t(new Set),F=t(null),I=t(``),L=t(!1),R=t(!1),z=t(!1),B=null,V=``,Fe=t(null),H=t(!1),U=t(``),W=t({open:!1,title:``,label:``,value:``,placeholder:``,resolve:null});function Ie(e){return new Promise(t=>{W.value={open:!0,title:e.title,label:e.label,value:e.initialValue??``,placeholder:e.placeholder??``,resolve:t}})}function Le(){let e=W.value.value.trim();W.value.resolve?.(e||null),W.value.open=!1}function G(){W.value.resolve?.(null),W.value.open=!1}let Re=d(()=>{let e=[],t=n=>{for(let r of n)r.type===`file`?e.push({path:r.path,name:r.name}):t(r.children)};return t(O.value),e}),ze=d(()=>{let e=U.value.trim().toLowerCase();return Re.value.filter(e=>e.path!==F.value).filter(t=>!e||t.path.toLowerCase().includes(e))});async function K(){k.value=!0,A.value=null,j.value=!1,M.value=null;try{let e=await T.wiki.list.query({scope:w.scope});D.value=e.root,O.value=e.entries}catch(e){let t=e.message;if(/Aucun dossier de docs|globalDocsPath|docsPath|Aucun cwd/i.test(t))j.value=!0;else{let e=t.match(/Dossier introuvable:\s*(.+)$/);e?M.value=e[1].trim():A.value=t}}finally{k.value=!1}}async function Be(){N.value=!0;try{await T.wiki.ensureRoot.mutate({scope:w.scope}),M.value=null,await K()}catch(e){A.value=e.message}finally{N.value=!1}}let q=d(()=>w.scope===`global`),Ve=d(()=>w.scope.startsWith(`service:`)),He=d(()=>Ve.value?w.scope.slice(8):null);function Ue(){q.value?p.push({name:`settings`,query:{section:`general`}}):He.value&&p.push(`/services/${He.value}/config?configTab=general`)}function We(e){P.value.has(e)?P.value.delete(e):P.value.add(e),P.value=new Set(P.value)}async function J(e){X(),z.value=!1,F.value=e,L.value=!0,I.value=``;try{let t=await T.wiki.read.query({scope:w.scope,path:e});I.value=t.content,V=t.content;let n=e.split(`/`);for(n.pop();n.length;)P.value.add(n.join(`/`)),n.pop();P.value=new Set(P.value)}catch(e){A.value=e.message}finally{L.value=!1}}function Ge(){B&&clearTimeout(B),B=setTimeout(()=>{Y()},800)}async function Y(){if(!F.value||I.value===V)return;let e=F.value,t=I.value;R.value=!0;try{await T.wiki.write.mutate({scope:w.scope,path:e,content:t}),V=t}catch(e){A.value=e.message}finally{R.value=!1}}function X(){B&&(clearTimeout(B),B=null,Y())}i(I,()=>{F.value&&z.value&&Ge()});function Ke(){z.value?(X(),z.value=!1):z.value=!0}async function Z(e,t){let n=await Ie({title:t===`file`?`Nouveau fichier`:`Nouveau dossier`,label:t===`file`?`Nom du fichier (sans extension)`:`Nom du dossier`,initialValue:t===`file`?`nouveau`:`nouveau-dossier`});if(!n)return;let r=n.trim().replace(/[^A-Za-z0-9_./-]/g,`-`);if(!r)return;let i=t===`file`&&!/\.(md|markdown)$/i.test(r)?`${r}.md`:r,a=e?`${e}/${i}`:i;try{t===`file`?(await T.wiki.createFile.mutate({scope:w.scope,path:a}),await K(),J(a)):(await T.wiki.createDir.mutate({scope:w.scope,path:a}),P.value.add(a),P.value=new Set(P.value),await K())}catch(e){A.value=e.message}}async function qe(e,t){let n=e.split(`/`),r=n[n.length-1],i=await Ie({title:`Renommer`,label:`Nouveau nom`,initialValue:r});if(!i||i===r)return;let a=i.trim().replace(/[^A-Za-z0-9_./-]/g,`-`);if(!a)return;let o=!t&&!/\.(md|markdown)$/i.test(a)?`${a}.md`:a;n[n.length-1]=o;let s=n.join(`/`);try{await T.wiki.rename.mutate({scope:w.scope,fromPath:e,toPath:s}),F.value===e&&(F.value=s),await K()}catch(e){A.value=e.message}}function Je(e,t){E.require({message:`Supprimer "${e}" ${t?`(et tout son contenu)`:``} ?`,header:`Confirmation`,icon:`ti ti-alert-triangle`,rejectProps:{label:`Annuler`},acceptProps:{label:`Supprimer`,severity:`danger`},accept:async()=>{try{await T.wiki.delete.mutate({scope:w.scope,path:e}),(F.value===e||t&&F.value?.startsWith(e+`/`))&&(F.value=null,I.value=``),await K()}catch(e){A.value=e.message}}})}function Ye(){U.value=``,H.value=!0}function Xe(e){let t=Ze(F.value??``,e.path);Fe.value?.insertWikiLink?.(t,e.name.replace(/\.(md|markdown)$/i,``)),H.value=!1}function Ze(e,t){let n=e.split(`/`);n.pop();let r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.length-i,o=r.slice(i);return(a===0?`./`:`../`.repeat(a))+o.join(`/`)}function Qe(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`mailto:`)){window.open(e,`_blank`,`noopener,noreferrer`);return}if(e.startsWith(`#`)||!/\.(md|markdown)(#|\?|$)/i.test(e))return;let t=e.split(`#`)[0].split(`?`)[0],n=$e(F.value??``,t);Re.value.some(e=>e.path===n)?J(n):A.value=`Fichier introuvable: ${n}`}function $e(e,t){if(t.startsWith(`/`))return t.replace(/^\/+/,``);let n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)).split(`/`).filter(Boolean):[];for(let e of t.split(`/`))e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return n.join(`/`)}function Q(){F.value&&J(F.value)}function $(){document.visibilityState===`visible`&&Q()}return i(()=>w.scope,()=>{F.value=null,I.value=``,O.value=[],K()}),l(()=>{K(),window.addEventListener(`focus`,Q),document.addEventListener(`visibilitychange`,$)}),f(()=>{X(),window.removeEventListener(`focus`,Q),document.removeEventListener(`visibilitychange`,$)}),(t,i)=>M.value?(m(),s(`div`,ae,[i[8]||=o(`i`,{class:`ti ti-folder-open wiki__not-configured-icon`},null,-1),i[9]||=o(`h2`,null,`Le dossier de documentation n'existe pas encore`,-1),o(`p`,null,[i[7]||=r(` Chemin attendu : `,-1),o(`code`,null,_(M.value),1)]),n(e(C),{icon:`ti ti-plus`,label:`Créer le dossier`,loading:N.value,onClick:Be},null,8,[`loading`])])):j.value?(m(),s(`div`,oe,[i[11]||=o(`i`,{class:`ti ti-settings wiki__not-configured-icon`},null,-1),o(`h2`,null,_(q.value?`Wiki global non configuré`:`Documentation du service non configurée`),1),q.value?(m(),s(`p`,se,` Le wiki global a besoin d'un chemin absolu vers un dossier sur disque pour fonctionner. `)):(m(),s(`p`,ce,[...i[10]||=[r(` Ce service n'a pas de `,-1),o(`code`,null,`cwd`,-1),r(` ni de `,-1),o(`code`,null,`docsPath`,-1),r(` renseigné. `,-1)]])),n(e(C),{icon:`ti ti-arrow-right`,label:q.value?`Configurer le wiki global`:`Configurer le service`,onClick:Ue},null,8,[`label`])])):(m(),s(`div`,le,[o(`aside`,ue,[o(`div`,de,[o(`span`,{class:`wiki__sidebar-title`,title:D.value},_(D.value||`Pages`),9,fe),o(`div`,pe,[n(e(C),{icon:`ti ti-folder-plus`,size:`small`,variant:`text`,rounded:``,title:`Nouveau dossier racine`,onClick:i[0]||=e=>Z(``,`dir`)}),n(e(C),{icon:`ti ti-file-plus`,size:`small`,variant:`text`,rounded:``,title:`Nouveau fichier racine`,onClick:i[1]||=e=>Z(``,`file`)}),n(e(C),{icon:`ti ti-refresh`,size:`small`,variant:`text`,rounded:``,title:`Rafraîchir`,onClick:K})])]),k.value?(m(),s(`div`,me,`Chargement…`)):A.value?(m(),s(`div`,he,_(A.value),1)):O.value.length===0?(m(),s(`div`,ge,` Aucun fichier. Utilisez les boutons en haut pour créer un fichier ou un dossier. `)):(m(),s(`ul`,_e,[(m(!0),s(h,null,c(O.value,e=>(m(),s(`li`,{key:e.path},[n(ie,{entry:e,"selected-path":F.value,expanded:P.value,editable:!0,onToggle:We,onSelect:J,onCreateChild:Z,onRename:qe,onDelete:Je},null,8,[`entry`,`selected-path`,`expanded`])]))),128))]))]),o(`section`,ve,[F.value?(m(),s(h,{key:0},[o(`div`,ye,[i[16]||=o(`i`,{class:`ti ti-file wiki__title-icon`},null,-1),o(`span`,be,_(F.value),1),z.value?(m(),s(`span`,xe,[R.value?(m(),s(`span`,Se,[...i[12]||=[o(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),r(` Sauvegarde…`,-1)]])):I.value===e(V)?(m(),s(`span`,we,[...i[14]||=[o(`i`,{class:`ti ti-check`},null,-1),r(` Sauvegardé`,-1)]])):(m(),s(`span`,Ce,[...i[13]||=[o(`i`,{class:`ti ti-circle-filled wiki__status-pending`},null,-1),r(` Modifié`,-1)]]))])):(m(),s(`span`,Te,[...i[15]||=[o(`i`,{class:`ti ti-eye`},null,-1),r(` Lecture seule `,-1)]])),n(e(C),{icon:z.value?`ti ti-check`:`ti ti-pencil`,label:z.value?`Terminer`:`Modifier`,size:`small`,severity:z.value?`success`:`secondary`,variant:z.value?`filled`:`outlined`,onClick:Ke},null,8,[`icon`,`label`,`severity`,`variant`]),n(e(C),{icon:`ti ti-refresh`,size:`small`,variant:`text`,rounded:``,title:`Recharger depuis le disque`,loading:L.value,onClick:Q},null,8,[`loading`])]),z.value?(m(),s(`div`,Ee,[n(e(C),{icon:`ti ti-link`,label:`Lier un fichier`,size:`small`,variant:`text`,onClick:Ye})])):v(``,!0),L.value?(m(),s(`div`,De,`Chargement du fichier…`)):(m(),ee(e(re),{key:2,ref_key:`editorRef`,ref:Fe,modelValue:I.value,"onUpdate:modelValue":i[2]||=e=>I.value=e,markdown:``,editable:z.value,class:u([`wiki__editor`,{"wiki__editor--readonly":!z.value}]),placeholder:`Écrivez le contenu de la page…`,onLinkClick:Qe},null,8,[`modelValue`,`editable`,`class`]))],64)):(m(),s(`div`,Oe,[...i[17]||=[o(`i`,{class:`ti ti-book wiki__placeholder-icon`},null,-1),o(`p`,null,`Sélectionnez un fichier ou créez-en un nouveau.`,-1)]]))]),n(e(S),{visible:W.value.open,"onUpdate:visible":i[4]||=e=>W.value.open=e,header:W.value.title,modal:``,style:{width:`420px`},"close-on-escape":!0,onHide:G},{footer:g(()=>[n(e(C),{label:`Annuler`,severity:`secondary`,variant:`outlined`,size:`small`,onClick:G}),n(e(C),{label:`OK`,size:`small`,disabled:!W.value.value.trim(),onClick:Le},null,8,[`disabled`])]),default:g(()=>[o(`div`,ke,[o(`label`,Ae,_(W.value.label),1),n(e(x),{id:`wiki-prompt-input`,modelValue:W.value.value,"onUpdate:modelValue":i[3]||=e=>W.value.value=e,class:`wiki__prompt-input`,placeholder:W.value.placeholder,autofocus:``,onKeydown:[y(b(Le,[`prevent`]),[`enter`]),y(G,[`escape`])]},null,8,[`modelValue`,`placeholder`,`onKeydown`])])]),_:1},8,[`visible`,`header`]),n(e(S),{visible:H.value,"onUpdate:visible":i[6]||=e=>H.value=e,header:`Insérer un lien vers un fichier`,modal:``,style:{width:`500px`}},{default:g(()=>[n(e(x),{modelValue:U.value,"onUpdate:modelValue":i[5]||=e=>U.value=e,placeholder:`Rechercher un fichier…`,class:`wiki__link-search`,autofocus:``},null,8,[`modelValue`]),o(`div`,je,[(m(!0),s(h,null,c(ze.value,e=>(m(),s(`button`,{key:e.path,class:`wiki__link-item`,onClick:t=>Xe(e)},[i[18]||=o(`i`,{class:`ti ti-file`},null,-1),o(`span`,Ne,_(e.path),1)],8,Me))),128)),ze.value.length===0?(m(),s(`div`,Pe,` Aucun fichier disponible. `)):v(``,!0)])]),_:1},8,[`visible`])]))}}),[[`__scopeId`,`data-v-41cacdea`]]);export{N as t};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{D as n,E as r,Ht as i,St as a,_ as o,b as s,bt as c,ct as l,en as u,g as d,it as f,k as p,mt as m,o as h,qt as g,rn as _,v as ee,y as v}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as y,w as b}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{g as te}from"./useApi-s_02lHjl-DZYO2tHU.js";import{D as ne,J as x,Y as S,dt as C,ft as w}from"./src-q8L6Eojs.js";import{r as T}from"./trpc-_B70IpnV.js";import{t as re}from"./src-BQgMiizJ.js";var E={class:`fs-node`},D=[`title`],O={class:`fs-node__name`},k=[`title`],A={class:`fs-node__name`},j={key:2,class:`fs-node__actions`},M={key:0,class:`fs-node__children`},ie=p({__name:`FsNode`,props:{entry:{},selectedPath:{},expanded:{},editable:{type:Boolean}},emits:[`toggle`,`select`,`create-child`,`rename`,`delete`],setup(e,{emit:t}){let r=e,i=t,l=d(()=>r.entry.type===`dir`&&r.expanded.has(r.entry.path)),f=d(()=>r.entry.type===`file`&&r.selectedPath===r.entry.path);return(t,r)=>{let d=a(`FsNode`,!0);return m(),s(`div`,E,[o(`div`,{class:u([`fs-node__row`,{"fs-node__row--selected":f.value}])},[e.entry.type===`dir`?(m(),s(`button`,{key:0,class:`fs-node__main`,title:e.entry.path,onClick:r[0]||=t=>i(`toggle`,e.entry.path)},[o(`i`,{class:u(`ti ${l.value?`ti-chevron-down`:`ti-chevron-right`} fs-node__caret`)},null,2),o(`i`,{class:u(`ti ${l.value?`ti-folder-open`:`ti-folder`} fs-node__icon fs-node__icon--folder`)},null,2),o(`span`,O,_(e.entry.name),1)],8,D)):(m(),s(`button`,{key:1,class:`fs-node__main`,title:e.entry.path,onClick:r[1]||=t=>i(`select`,e.entry.path)},[r[11]||=o(`span`,{class:`fs-node__caret-spacer`},null,-1),r[12]||=o(`i`,{class:`ti ti-file fs-node__icon`},null,-1),o(`span`,A,_(e.entry.name),1)],8,k)),e.editable?(m(),s(`div`,j,[e.entry.type===`dir`?(m(),s(`button`,{key:0,class:`fs-node__action`,title:`Nouveau fichier`,onClick:r[2]||=b(t=>i(`create-child`,e.entry.path,`file`),[`stop`])},[...r[13]||=[o(`i`,{class:`ti ti-file-plus`},null,-1)]])):v(``,!0),e.entry.type===`dir`?(m(),s(`button`,{key:1,class:`fs-node__action`,title:`Nouveau dossier`,onClick:r[3]||=b(t=>i(`create-child`,e.entry.path,`dir`),[`stop`])},[...r[14]||=[o(`i`,{class:`ti ti-folder-plus`},null,-1)]])):v(``,!0),o(`button`,{class:`fs-node__action`,title:`Renommer`,onClick:r[4]||=b(t=>i(`rename`,e.entry.path,e.entry.type===`dir`),[`stop`])},[...r[15]||=[o(`i`,{class:`ti ti-pencil`},null,-1)]]),o(`button`,{class:`fs-node__action fs-node__action--danger`,title:`Supprimer`,onClick:r[5]||=b(t=>i(`delete`,e.entry.path,e.entry.type===`dir`),[`stop`])},[...r[16]||=[o(`i`,{class:`ti ti-trash`},null,-1)]])])):v(``,!0)],2),e.entry.type===`dir`&&l.value?(m(),s(`ul`,M,[(m(!0),s(h,null,c(e.entry.children,t=>(m(),s(`li`,{key:t.path},[n(d,{entry:t,"selected-path":e.selectedPath,expanded:e.expanded,editable:e.editable,onToggle:r[6]||=e=>i(`toggle`,e),onSelect:r[7]||=e=>i(`select`,e),onCreateChild:r[8]||=(e,t)=>i(`create-child`,e,t),onRename:r[9]||=(e,t)=>i(`rename`,e,t),onDelete:r[10]||=(e,t)=>i(`delete`,e,t)},null,8,[`entry`,`selected-path`,`expanded`,`editable`])]))),128))])):v(``,!0)])}}}),ae={key:0,class:`wiki__not-configured`},oe={key:1,class:`wiki__not-configured`},se={key:0},ce={key:1},le={key:2,class:`wiki`},ue={class:`wiki__sidebar`},de={class:`wiki__sidebar-header`},fe=[`title`],pe={class:`wiki__sidebar-actions`},me={key:0,class:`wiki__loading`},he={key:1,class:`wiki__error`},ge={key:2,class:`wiki__empty`},_e={key:3,class:`wiki__tree`},ve={class:`wiki__main`},ye={class:`wiki__title-row`},be={class:`wiki__title-path`},xe={key:0,class:`wiki__status`},Se={key:0},Ce={key:1},we={key:2,class:`wiki__status-saved`},Te={key:1,class:`wiki__status wiki__status-readonly`},Ee={key:0,class:`wiki__editor-actions`},De={key:1,class:`wiki__loading`},Oe={key:1,class:`wiki__placeholder`},ke={class:`wiki__prompt-body`},Ae={for:`wiki-prompt-input`,class:`wiki__prompt-label`},je={class:`wiki__link-list`},Me=[`onClick`],Ne={class:`wiki__link-path`},Pe={key:0,class:`wiki__link-empty`},N=w(p({__name:`WikiView`,props:{scope:{}},setup(a){let p=te(),w=a,E=ne(),D=t(``),O=t([]),k=t(!1),A=t(null),j=t(!1),M=t(null),N=t(!1),P=t(new Set),F=t(null),I=t(``),L=t(!1),R=t(!1),z=t(!1),B=null,V=``,Fe=t(null),H=t(!1),U=t(``),W=t({open:!1,title:``,label:``,value:``,placeholder:``,resolve:null});function Ie(e){return new Promise(t=>{W.value={open:!0,title:e.title,label:e.label,value:e.initialValue??``,placeholder:e.placeholder??``,resolve:t}})}function Le(){let e=W.value.value.trim();W.value.resolve?.(e||null),W.value.open=!1}function G(){W.value.resolve?.(null),W.value.open=!1}let Re=d(()=>{let e=[],t=n=>{for(let r of n)r.type===`file`?e.push({path:r.path,name:r.name}):t(r.children)};return t(O.value),e}),ze=d(()=>{let e=U.value.trim().toLowerCase();return Re.value.filter(e=>e.path!==F.value).filter(t=>!e||t.path.toLowerCase().includes(e))});async function K(){k.value=!0,A.value=null,j.value=!1,M.value=null;try{let e=await T.wiki.list.query({scope:w.scope});D.value=e.root,O.value=e.entries}catch(e){let t=e.message;if(/Aucun dossier de docs|globalDocsPath|docsPath|Aucun cwd/i.test(t))j.value=!0;else{let e=t.match(/Dossier introuvable:\s*(.+)$/);e?M.value=e[1].trim():A.value=t}}finally{k.value=!1}}async function Be(){N.value=!0;try{await T.wiki.ensureRoot.mutate({scope:w.scope}),M.value=null,await K()}catch(e){A.value=e.message}finally{N.value=!1}}let q=d(()=>w.scope===`global`),Ve=d(()=>w.scope.startsWith(`service:`)),He=d(()=>Ve.value?w.scope.slice(8):null);function Ue(){q.value?p.push({name:`settings`,query:{section:`general`}}):He.value&&p.push(`/services/${He.value}/config?configTab=general`)}function We(e){P.value.has(e)?P.value.delete(e):P.value.add(e),P.value=new Set(P.value)}async function J(e){X(),z.value=!1,F.value=e,L.value=!0,I.value=``;try{let t=await T.wiki.read.query({scope:w.scope,path:e});I.value=t.content,V=t.content;let n=e.split(`/`);for(n.pop();n.length;)P.value.add(n.join(`/`)),n.pop();P.value=new Set(P.value)}catch(e){A.value=e.message}finally{L.value=!1}}function Ge(){B&&clearTimeout(B),B=setTimeout(()=>{Y()},800)}async function Y(){if(!F.value||I.value===V)return;let e=F.value,t=I.value;R.value=!0;try{await T.wiki.write.mutate({scope:w.scope,path:e,content:t}),V=t}catch(e){A.value=e.message}finally{R.value=!1}}function X(){B&&(clearTimeout(B),B=null,Y())}i(I,()=>{F.value&&z.value&&Ge()});function Ke(){z.value?(X(),z.value=!1):z.value=!0}async function Z(e,t){let n=await Ie({title:t===`file`?`Nouveau fichier`:`Nouveau dossier`,label:t===`file`?`Nom du fichier (sans extension)`:`Nom du dossier`,initialValue:t===`file`?`nouveau`:`nouveau-dossier`});if(!n)return;let r=n.trim().replace(/[^A-Za-z0-9_./-]/g,`-`);if(!r)return;let i=t===`file`&&!/\.(md|markdown)$/i.test(r)?`${r}.md`:r,a=e?`${e}/${i}`:i;try{t===`file`?(await T.wiki.createFile.mutate({scope:w.scope,path:a}),await K(),J(a)):(await T.wiki.createDir.mutate({scope:w.scope,path:a}),P.value.add(a),P.value=new Set(P.value),await K())}catch(e){A.value=e.message}}async function qe(e,t){let n=e.split(`/`),r=n[n.length-1],i=await Ie({title:`Renommer`,label:`Nouveau nom`,initialValue:r});if(!i||i===r)return;let a=i.trim().replace(/[^A-Za-z0-9_./-]/g,`-`);if(!a)return;let o=!t&&!/\.(md|markdown)$/i.test(a)?`${a}.md`:a;n[n.length-1]=o;let s=n.join(`/`);try{await T.wiki.rename.mutate({scope:w.scope,fromPath:e,toPath:s}),F.value===e&&(F.value=s),await K()}catch(e){A.value=e.message}}function Je(e,t){E.require({message:`Supprimer "${e}" ${t?`(et tout son contenu)`:``} ?`,header:`Confirmation`,icon:`ti ti-alert-triangle`,rejectProps:{label:`Annuler`},acceptProps:{label:`Supprimer`,severity:`danger`},accept:async()=>{try{await T.wiki.delete.mutate({scope:w.scope,path:e}),(F.value===e||t&&F.value?.startsWith(e+`/`))&&(F.value=null,I.value=``),await K()}catch(e){A.value=e.message}}})}function Ye(){U.value=``,H.value=!0}function Xe(e){let t=Ze(F.value??``,e.path);Fe.value?.insertWikiLink?.(t,e.name.replace(/\.(md|markdown)$/i,``)),H.value=!1}function Ze(e,t){let n=e.split(`/`);n.pop();let r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.length-i,o=r.slice(i);return(a===0?`./`:`../`.repeat(a))+o.join(`/`)}function Qe(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`mailto:`)){window.open(e,`_blank`,`noopener,noreferrer`);return}if(e.startsWith(`#`)||!/\.(md|markdown)(#|\?|$)/i.test(e))return;let t=e.split(`#`)[0].split(`?`)[0],n=$e(F.value??``,t);Re.value.some(e=>e.path===n)?J(n):A.value=`Fichier introuvable: ${n}`}function $e(e,t){if(t.startsWith(`/`))return t.replace(/^\/+/,``);let n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)).split(`/`).filter(Boolean):[];for(let e of t.split(`/`))e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return n.join(`/`)}function Q(){F.value&&J(F.value)}function $(){document.visibilityState===`visible`&&Q()}return i(()=>w.scope,()=>{F.value=null,I.value=``,O.value=[],K()}),l(()=>{K(),window.addEventListener(`focus`,Q),document.addEventListener(`visibilitychange`,$)}),f(()=>{X(),window.removeEventListener(`focus`,Q),document.removeEventListener(`visibilitychange`,$)}),(t,i)=>M.value?(m(),s(`div`,ae,[i[8]||=o(`i`,{class:`ti ti-folder-open wiki__not-configured-icon`},null,-1),i[9]||=o(`h2`,null,`Le dossier de documentation n'existe pas encore`,-1),o(`p`,null,[i[7]||=r(` Chemin attendu : `,-1),o(`code`,null,_(M.value),1)]),n(e(C),{icon:`ti ti-plus`,label:`Créer le dossier`,loading:N.value,onClick:Be},null,8,[`loading`])])):j.value?(m(),s(`div`,oe,[i[11]||=o(`i`,{class:`ti ti-settings wiki__not-configured-icon`},null,-1),o(`h2`,null,_(q.value?`Wiki global non configuré`:`Documentation du service non configurée`),1),q.value?(m(),s(`p`,se,` Le wiki global a besoin d'un chemin absolu vers un dossier sur disque pour fonctionner. `)):(m(),s(`p`,ce,[...i[10]||=[r(` Ce service n'a pas de `,-1),o(`code`,null,`cwd`,-1),r(` ni de `,-1),o(`code`,null,`docsPath`,-1),r(` renseigné. `,-1)]])),n(e(C),{icon:`ti ti-arrow-right`,label:q.value?`Configurer le wiki global`:`Configurer le service`,onClick:Ue},null,8,[`label`])])):(m(),s(`div`,le,[o(`aside`,ue,[o(`div`,de,[o(`span`,{class:`wiki__sidebar-title`,title:D.value},_(D.value||`Pages`),9,fe),o(`div`,pe,[n(e(C),{icon:`ti ti-folder-plus`,size:`small`,variant:`text`,rounded:``,title:`Nouveau dossier racine`,onClick:i[0]||=e=>Z(``,`dir`)}),n(e(C),{icon:`ti ti-file-plus`,size:`small`,variant:`text`,rounded:``,title:`Nouveau fichier racine`,onClick:i[1]||=e=>Z(``,`file`)}),n(e(C),{icon:`ti ti-refresh`,size:`small`,variant:`text`,rounded:``,title:`Rafraîchir`,onClick:K})])]),k.value?(m(),s(`div`,me,`Chargement…`)):A.value?(m(),s(`div`,he,_(A.value),1)):O.value.length===0?(m(),s(`div`,ge,` Aucun fichier. Utilisez les boutons en haut pour créer un fichier ou un dossier. `)):(m(),s(`ul`,_e,[(m(!0),s(h,null,c(O.value,e=>(m(),s(`li`,{key:e.path},[n(ie,{entry:e,"selected-path":F.value,expanded:P.value,editable:!0,onToggle:We,onSelect:J,onCreateChild:Z,onRename:qe,onDelete:Je},null,8,[`entry`,`selected-path`,`expanded`])]))),128))]))]),o(`section`,ve,[F.value?(m(),s(h,{key:0},[o(`div`,ye,[i[16]||=o(`i`,{class:`ti ti-file wiki__title-icon`},null,-1),o(`span`,be,_(F.value),1),z.value?(m(),s(`span`,xe,[R.value?(m(),s(`span`,Se,[...i[12]||=[o(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),r(` Sauvegarde…`,-1)]])):I.value===e(V)?(m(),s(`span`,we,[...i[14]||=[o(`i`,{class:`ti ti-check`},null,-1),r(` Sauvegardé`,-1)]])):(m(),s(`span`,Ce,[...i[13]||=[o(`i`,{class:`ti ti-circle-filled wiki__status-pending`},null,-1),r(` Modifié`,-1)]]))])):(m(),s(`span`,Te,[...i[15]||=[o(`i`,{class:`ti ti-eye`},null,-1),r(` Lecture seule `,-1)]])),n(e(C),{icon:z.value?`ti ti-check`:`ti ti-pencil`,label:z.value?`Terminer`:`Modifier`,size:`small`,severity:z.value?`success`:`secondary`,variant:z.value?`filled`:`outlined`,onClick:Ke},null,8,[`icon`,`label`,`severity`,`variant`]),n(e(C),{icon:`ti ti-refresh`,size:`small`,variant:`text`,rounded:``,title:`Recharger depuis le disque`,loading:L.value,onClick:Q},null,8,[`loading`])]),z.value?(m(),s(`div`,Ee,[n(e(C),{icon:`ti ti-link`,label:`Lier un fichier`,size:`small`,variant:`text`,onClick:Ye})])):v(``,!0),L.value?(m(),s(`div`,De,`Chargement du fichier…`)):(m(),ee(e(re),{key:2,ref_key:`editorRef`,ref:Fe,modelValue:I.value,"onUpdate:modelValue":i[2]||=e=>I.value=e,markdown:``,editable:z.value,class:u([`wiki__editor`,{"wiki__editor--readonly":!z.value}]),placeholder:`Écrivez le contenu de la page…`,onLinkClick:Qe},null,8,[`modelValue`,`editable`,`class`]))],64)):(m(),s(`div`,Oe,[...i[17]||=[o(`i`,{class:`ti ti-book wiki__placeholder-icon`},null,-1),o(`p`,null,`Sélectionnez un fichier ou créez-en un nouveau.`,-1)]]))]),n(e(S),{visible:W.value.open,"onUpdate:visible":i[4]||=e=>W.value.open=e,header:W.value.title,modal:``,style:{width:`420px`},"close-on-escape":!0,onHide:G},{footer:g(()=>[n(e(C),{label:`Annuler`,severity:`secondary`,variant:`outlined`,size:`small`,onClick:G}),n(e(C),{label:`OK`,size:`small`,disabled:!W.value.value.trim(),onClick:Le},null,8,[`disabled`])]),default:g(()=>[o(`div`,ke,[o(`label`,Ae,_(W.value.label),1),n(e(x),{id:`wiki-prompt-input`,modelValue:W.value.value,"onUpdate:modelValue":i[3]||=e=>W.value.value=e,class:`wiki__prompt-input`,placeholder:W.value.placeholder,autofocus:``,onKeydown:[y(b(Le,[`prevent`]),[`enter`]),y(G,[`escape`])]},null,8,[`modelValue`,`placeholder`,`onKeydown`])])]),_:1},8,[`visible`,`header`]),n(e(S),{visible:H.value,"onUpdate:visible":i[6]||=e=>H.value=e,header:`Insérer un lien vers un fichier`,modal:``,style:{width:`500px`}},{default:g(()=>[n(e(x),{modelValue:U.value,"onUpdate:modelValue":i[5]||=e=>U.value=e,placeholder:`Rechercher un fichier…`,class:`wiki__link-search`,autofocus:``},null,8,[`modelValue`]),o(`div`,je,[(m(!0),s(h,null,c(ze.value,e=>(m(),s(`button`,{key:e.path,class:`wiki__link-item`,onClick:t=>Xe(e)},[i[18]||=o(`i`,{class:`ti ti-file`},null,-1),o(`span`,Ne,_(e.path),1)],8,Me))),128)),ze.value.length===0?(m(),s(`div`,Pe,` Aucun fichier disponible. `)):v(``,!0)])]),_:1},8,[`visible`])]))}}),[[`__scopeId`,`data-v-41cacdea`]]);export{N as t};
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{i as n}from"./project-launch.store-9PE0nYa6.js";import{c as r,r as i,s as a}from"./trpc--XNiYHQf.js";import{n as o}from"./error-DpF7X5iu.js";import{a as s}from"./dist-DWtN-uEL.js";var c=n(`agent`,()=>{let n=e([]),c=e(!1),l=e(null),u=null,d=0,f=null,p=t(()=>n.value.length),m=t(()=>n.value.filter(e=>e.status.connected)),h=t(()=>e=>n.value.find(t=>t.config.id===e)??null);async function g(){c.value=!0,l.value=null;try{n.value=await i.agent.list.query()}catch(e){l.value=o(e)??`Failed to fetch agents`}finally{c.value=!1}}async function _(e,t,n){l.value=null;try{let r=await i.agent.register.mutate({name:e,url:t,passphrase:n});return await g(),r}catch(e){return l.value=o(e)??`Failed to register agent`,null}}async function v(e,t){l.value=null;try{let r=await i.agent.update.mutate({id:e,...t}),a=n.value.findIndex(t=>t.config.id===e);if(a>=0){let e=[...n.value];e[a]={...e[a],config:{...e[a].config,...r}},n.value=e}return r}catch(e){return l.value=o(e)??`Failed to update agent`,null}}async function y(e){l.value=null;try{return await i.agent.remove.mutate({id:e}),n.value=n.value.filter(t=>t.config.id!==e),!0}catch(e){return l.value=o(e)??`Failed to remove agent`,!1}}async function b(e,t){l.value=null;try{let r=await i.agent.update.mutate({id:e,passthroughEnv:t}),a=n.value.findIndex(t=>t.config.id===e);if(a>=0){let e=[...n.value];e[a]={...e[a],config:{...e[a].config,passthroughEnv:r.passthroughEnv}},n.value=e}return r}catch(e){return l.value=o(e)??`Failed to update passthrough env`,null}}function x(){if(d>=5){console.warn(`[agent.store] Max status subscription retries (5) reached`);return}let e=s*2**d+Math.random()*300;d++,r(`agent.store`,`nouvelle tentative ${d}/5 dans ${Math.round(e)} ms`),f=setTimeout(()=>{f=null,w()},e)}let S=!1;function C(){S||(S=!0,g().finally(()=>{S=!1}))}function w(){u||=(a(`agent.store`,`souscription agent.onStatus demandée`),i.agent.onStatus.subscribe(void 0,{onData(e){d=0;let t=n.value.findIndex(t=>t.config.id===e.agentId);if(t>=0){let r=[...n.value];r[t]={...r[t],status:e.status},n.value=r}else C()},onError(e){u=null,r(`agent.store`,`agent.onStatus en erreur :`,e.message),x()}}))}function T(){f&&=(clearTimeout(f),null),u&&=(u.unsubscribe(),null),d=0}return{agents:n,loading:c,error:l,agentCount:p,connectedAgents:m,getById:h,fetchAll:g,register:_,update:v,remove:y,updatePassthroughEnv:b,subscribeStatus:w,unsubscribeStatus:T}});export{c as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{i as n}from"./project-launch.store-uVIdI1FE.js";import{c as r,r as i,s as a}from"./trpc-_B70IpnV.js";import{n as o}from"./error-DpF7X5iu.js";import{a as s}from"./dist-DWtN-uEL.js";var c=n(`agent`,()=>{let n=e([]),c=e(!1),l=e(null),u=null,d=0,f=null,p=t(()=>n.value.length),m=t(()=>n.value.filter(e=>e.status.connected)),h=t(()=>e=>n.value.find(t=>t.config.id===e)??null);async function g(){c.value=!0,l.value=null;try{n.value=await i.agent.list.query()}catch(e){l.value=o(e)??`Failed to fetch agents`}finally{c.value=!1}}async function _(e,t,n){l.value=null;try{let r=await i.agent.register.mutate({name:e,url:t,passphrase:n});return await g(),r}catch(e){return l.value=o(e)??`Failed to register agent`,null}}async function v(e,t){l.value=null;try{let r=await i.agent.update.mutate({id:e,...t}),a=n.value.findIndex(t=>t.config.id===e);if(a>=0){let e=[...n.value];e[a]={...e[a],config:{...e[a].config,...r}},n.value=e}return r}catch(e){return l.value=o(e)??`Failed to update agent`,null}}async function y(e){l.value=null;try{return await i.agent.remove.mutate({id:e}),n.value=n.value.filter(t=>t.config.id!==e),!0}catch(e){return l.value=o(e)??`Failed to remove agent`,!1}}async function b(e,t){l.value=null;try{let r=await i.agent.update.mutate({id:e,passthroughEnv:t}),a=n.value.findIndex(t=>t.config.id===e);if(a>=0){let e=[...n.value];e[a]={...e[a],config:{...e[a].config,passthroughEnv:r.passthroughEnv}},n.value=e}return r}catch(e){return l.value=o(e)??`Failed to update passthrough env`,null}}function x(){if(d>=5){console.warn(`[agent.store] Max status subscription retries (5) reached`);return}let e=s*2**d+Math.random()*300;d++,r(`agent.store`,`nouvelle tentative ${d}/5 dans ${Math.round(e)} ms`),f=setTimeout(()=>{f=null,w()},e)}let S=!1;function C(){S||(S=!0,g().finally(()=>{S=!1}))}function w(){u||=(a(`agent.store`,`souscription agent.onStatus demandée`),i.agent.onStatus.subscribe(void 0,{onData(e){d=0;let t=n.value.findIndex(t=>t.config.id===e.agentId);if(t>=0){let r=[...n.value];r[t]={...r[t],status:e.status},n.value=r}else C()},onError(e){u=null,r(`agent.store`,`agent.onStatus en erreur :`,e.message),x()}}))}function T(){f&&=(clearTimeout(f),null),u&&=(u.unsubscribe(),null),d=0}return{agents:n,loading:c,error:l,agentCount:p,connectedAgents:m,getById:h,fetchAll:g,register:_,update:v,remove:y,updatePassthroughEnv:b,subscribeStatus:w,unsubscribeStatus:T}});export{c as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CNvxC2Zv.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/runtime-dom.esm-bundler-CyEVRK6B.js","assets/vue-i18n-o7yraQpR.js","assets/project-launch.store-9PE0nYa6.js","assets/trpc--XNiYHQf.js","assets/preload-helper-BZ1Pz5am.js","assets/i18n-CPWEaCn9.js","assets/useApi-s_02lHjl-DZYO2tHU.js","assets/vue-router--yRg_Dd_.js","assets/devtools-DCoWQoU_-D2vs4YXr.js","assets/src-B1nAsOcw.js","assets/floating-ui.dom-DF3oyfHd.js","assets/src-BR35jQnn.css","assets/scenario.store-D8PzqAes.js","assets/project.store-DS9yZmd1.js","assets/error-DpF7X5iu.js","assets/use-polling-CEkhIY_9.js","assets/useAiChatDrawer-D_ofn8Eo.js","assets/settings-scope-BLpz3gLZ.js","assets/dist-DWtN-uEL.js","assets/schemas-68I2iCLF.js","assets/service.store-BGU4aO6x.js","assets/notification.store-B150rmMZ.js","assets/scenario-DOeZsRCE.css","assets/app-mode-BVpTuh0i.js","assets/src-D_HTzAKM.js","assets/w3c-keyname-BOAvb0qz.js","assets/src-C1M5hNGI.css","assets/cloud-auth-D_am4FlK.js","assets/useProjectCatalog-B6E7VPMS.js","assets/cloud-session-BSRFBtW5.js","assets/open-project-org-BNDadG2_.js","assets/cloud-client-f1uf6_f0.js","assets/src-C1pDBhwJ.js","assets/uuid-B2pLMyOM.js","assets/src-ZDBDx6hs.css","assets/editor.api-Bef3xeth.js","assets/editor-8AbsNvUX.css","assets/AiChatModals-TIc0t8Cs.js","assets/toggleHighContrast-Dqz1Qao1.js","assets/toggleHighContrast--ixms01u.css","assets/register-BLGIM2pN.js","assets/agent.store-TNybFdDu.js","assets/AiChatModals-DS5R3Oz1.css","assets/useProjectCloudOrg-33pCxtnH.js","assets/SendToChatDialog-Df7wMccw.js","assets/src-DwxqtlGt.js","assets/src-dOj6pCsH.css","assets/process-C53v1rNU.js","assets/theme-BZCAxfJD.js","assets/index-CSsNTonn.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-BZ1Pz5am.js";var t=`runeya:jwt`;function n(n){sessionStorage.setItem(t,n),c(),e(async()=>{let{announceThemeToServer:e}=await import(`./index-CNvxC2Zv.js`).then(e=>e.t);return{announceThemeToServer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])).then(({announceThemeToServer:e})=>e())}function r(){return sessionStorage.getItem(t)}function i(){sessionStorage.removeItem(t),s&&clearTimeout(s),s=null}function a(e){try{let t=JSON.parse(atob(e.split(`.`)[1]??``));return typeof t.exp==`number`?t.exp:null}catch{return null}}var o=1e3,s=null;function c(){s&&clearTimeout(s),s=null;let e=r(),t=e?a(e):null;if(!e||t===null)return;let n=t*1e3-Date.now();n<=0||(s=setTimeout(()=>{l(e)},n/2))}async function l(e){s=null;let n;try{n=await fetch(`/api/auth/refresh`,{method:`POST`,headers:{Authorization:`Bearer ${e}`},signal:AbortSignal.timeout(5e3)})}catch{f(e);return}if(r()!==e||n.status===401)return;if(!n.ok){f(e);return}let i=await n.json().catch(()=>null);if(typeof i?.token==`string`&&r()===e){sessionStorage.setItem(t,i.token),c();for(let e of u)e(i.token)}}var u=new Set;function d(e){return u.add(e),()=>u.delete(e)}function f(e){if(r()!==e)return;let t=a(e);t===null||t*1e3-Date.now()<=o||(s=setTimeout(()=>{l(e)},o))}var p=!1;function m(e){p=e}function h(){return r()!==null||p}async function g(){let e=await fetch(`/api/status`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)throw Error(`Failed to fetch server status`);return e.json()}async function _(e){let t=r(),n=await fetch(`/api/migrate-vault`,{method:`POST`,headers:{"Content-Type":`application/json`,...t?{Authorization:`Bearer ${t}`}:{}},body:JSON.stringify({masterPassword:e}),signal:AbortSignal.timeout(12e4)}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(i?.error??`La migration a échoué`);return i}async function v(e){let t=await fetch(`/api/unlock`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({masterPassword:e}),signal:AbortSignal.timeout(3e4)});if(t.status===429)throw Error(`Trop de tentatives. Réessayez dans 15 minutes.`);if(t.status===401)throw Error(`Master password incorrect`);if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Erreur serveur`)}return(await t.json()).token}async function y(e,t){let n={masterPassword:e};t&&(n.encryptionKey=t);let r=await fetch(`/api/setup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n),signal:AbortSignal.timeout(3e4)});if(r.status===429)throw Error(`Trop de tentatives. Réessayez dans 15 minutes.`);if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`Erreur serveur`)}return(await r.json()).token}export{a,m as c,v as d,_ as f,h as i,n as l,g as n,d as o,r,c as s,i as t,y as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CJqaFgn7.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/runtime-dom.esm-bundler-CyEVRK6B.js","assets/vue-i18n-o7yraQpR.js","assets/project-launch.store-uVIdI1FE.js","assets/trpc-_B70IpnV.js","assets/preload-helper-BZ1Pz5am.js","assets/i18n-YdGGLQ4Z.js","assets/useApi-s_02lHjl-DZYO2tHU.js","assets/vue-router--yRg_Dd_.js","assets/devtools-DCoWQoU_-D2vs4YXr.js","assets/src-q8L6Eojs.js","assets/floating-ui.dom-DF3oyfHd.js","assets/src-D9bzjqzP.css","assets/scenario.store-BOxwE9Nf.js","assets/project.store-BGgsly35.js","assets/error-DpF7X5iu.js","assets/use-polling-CEkhIY_9.js","assets/useAiChatDrawer-D_ofn8Eo.js","assets/settings-scope-DPiKHU9X.js","assets/dist-DWtN-uEL.js","assets/schemas-68I2iCLF.js","assets/service.store-BUl1mZ8r.js","assets/notification.store-ChNT9swL.js","assets/scenario-DOeZsRCE.css","assets/app-mode-BVpTuh0i.js","assets/src-BQgMiizJ.js","assets/w3c-keyname-BOAvb0qz.js","assets/src-ByZ6iA0V.css","assets/cloud-auth-D_am4FlK.js","assets/useProjectCatalog-BLPIZIFK.js","assets/cloud-session-BGrDhQyl.js","assets/open-project-org-BNDadG2_.js","assets/cloud-client-C3E2yyUu.js","assets/src-D6Id_6yT.js","assets/uuid-B2pLMyOM.js","assets/src-EQeZO9eV.css","assets/editor.api-Bef3xeth.js","assets/editor-8AbsNvUX.css","assets/AiChatModals-D1yRQMh8.js","assets/toggleHighContrast-Dqz1Qao1.js","assets/toggleHighContrast--ixms01u.css","assets/register-BLGIM2pN.js","assets/agent.store-BrQmTiUs.js","assets/AiChatModals-DS5R3Oz1.css","assets/useProjectCloudOrg-eL8syIRO.js","assets/SendToChatDialog-BMtNa_QR.js","assets/src-CVBn8NuP.js","assets/src-zpuGtnBZ.css","assets/process-C53v1rNU.js","assets/theme-BZCAxfJD.js","assets/index-DPyBKb-x.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-BZ1Pz5am.js";var t=`runeya:jwt`;function n(n){sessionStorage.setItem(t,n),c(),e(async()=>{let{announceThemeToServer:e}=await import(`./index-CJqaFgn7.js`).then(e=>e.t);return{announceThemeToServer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])).then(({announceThemeToServer:e})=>e())}function r(){return sessionStorage.getItem(t)}function i(){sessionStorage.removeItem(t),s&&clearTimeout(s),s=null}function a(e){try{let t=JSON.parse(atob(e.split(`.`)[1]??``));return typeof t.exp==`number`?t.exp:null}catch{return null}}var o=1e3,s=null;function c(){s&&clearTimeout(s),s=null;let e=r(),t=e?a(e):null;if(!e||t===null)return;let n=t*1e3-Date.now();n<=0||(s=setTimeout(()=>{l(e)},n/2))}async function l(e){s=null;let n;try{n=await fetch(`/api/auth/refresh`,{method:`POST`,headers:{Authorization:`Bearer ${e}`},signal:AbortSignal.timeout(5e3)})}catch{f(e);return}if(r()!==e||n.status===401)return;if(!n.ok){f(e);return}let i=await n.json().catch(()=>null);if(typeof i?.token==`string`&&r()===e){sessionStorage.setItem(t,i.token),c();for(let e of u)e(i.token)}}var u=new Set;function d(e){return u.add(e),()=>u.delete(e)}function f(e){if(r()!==e)return;let t=a(e);t===null||t*1e3-Date.now()<=o||(s=setTimeout(()=>{l(e)},o))}var p=!1;function m(e){p=e}function h(){return r()!==null||p}async function g(){let e=await fetch(`/api/status`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)throw Error(`Failed to fetch server status`);return e.json()}async function _(e){let t=r(),n=await fetch(`/api/migrate-vault`,{method:`POST`,headers:{"Content-Type":`application/json`,...t?{Authorization:`Bearer ${t}`}:{}},body:JSON.stringify({masterPassword:e}),signal:AbortSignal.timeout(12e4)}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(i?.error??`La migration a échoué`);return i}async function v(e){let t=await fetch(`/api/unlock`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({masterPassword:e}),signal:AbortSignal.timeout(3e4)});if(t.status===429)throw Error(`Trop de tentatives. Réessayez dans 15 minutes.`);if(t.status===401)throw Error(`Master password incorrect`);if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Erreur serveur`)}return(await t.json()).token}async function y(e,t){let n={masterPassword:e};t&&(n.encryptionKey=t);let r=await fetch(`/api/setup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n),signal:AbortSignal.timeout(3e4)});if(r.status===429)throw Error(`Trop de tentatives. Réessayez dans 15 minutes.`);if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`Erreur serveur`)}return(await r.json()).token}export{a,m as c,v as d,_ as f,h as i,n as l,g as n,d as o,r,c as s,i as t,y as u};
@@ -0,0 +1 @@
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ht as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as r}from"./vue-i18n-o7yraQpR.js";import{i,n as a}from"./project-launch.store-uVIdI1FE.js";import{n as o}from"./project.store-BGgsly35.js";import{r as s}from"./cloud-session-BGrDhQyl.js";import{n as c,t as l}from"./cloud-client-C3E2yyUu.js";import{p as u,v as d}from"./src-D6Id_6yT.js";import{o as f,s as p}from"./src-CVBn8NuP.js";import{F as m}from"./index-CJqaFgn7.js";function h(){let e=r();return(t,n)=>t&&e.te(`authErrors.${t}`)?e.t(`authErrors.${t}`):t?e.t(`authErrors.default`):n}var g=i(`cloud-chat`,()=>{let{user:r}=s(),i=n(()=>!!r.value),g=d(c,h());t(()=>r.value?.id,e=>{e&&g.refresh()},{immediate:!0});let _=o();a();let v=n(()=>_.currentProjectOrgId),y=n(()=>{let e=g.organizations.value;if(!e.length)return``;let t=v.value;return t&&e.some(e=>e.id===t)?t:e[0].id}),b=u(c,y,{streamUrl:l,streamFactory:m,currentUserId:n(()=>r.value?.id)}),x=e(null),S=e(null);t(()=>S.value?b.threadUnread.value[S.value]:0,e=>{e&&S.value&&b.clearThreadUnread(S.value)});let C=p(b,x,S);t(()=>r.value?.id,e=>{e&&f(c)},{immediate:!0});function w(){b.unread.value={}}function T(e){b.unread.value[e]&&(b.unread.value={...b.unread.value,[e]:0})}function E(e){x.value=e}function D(e){S.value=e,e&&b.clearThreadUnread(e)}return{connected:i,orgId:y,unreadCount:C,clearUnread:w,noteChannelRead:T,setViewing:E,setViewingThread:D}});export{h as n,g as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cloud-session-BGrDhQyl.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/project-launch.store-uVIdI1FE.js","assets/trpc-_B70IpnV.js","assets/preload-helper-BZ1Pz5am.js","assets/auth-Bn1t6v9Z.js","assets/project.store-BGgsly35.js","assets/error-DpF7X5iu.js","assets/open-project-org-BNDadG2_.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./trpc-_B70IpnV.js";import{t as n}from"./preload-helper-BZ1Pz5am.js";import{r}from"./auth-Bn1t6v9Z.js";function i(e,t,{onProgress:n,withCredentials:r=!1,timeoutMs:i=3e5}={}){return new Promise(a=>{let o=new XMLHttpRequest;o.open(`POST`,e,!0),o.withCredentials=r,o.timeout=i,o.setRequestHeader(`Content-Type`,t.type||`application/octet-stream`),n&&(o.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(e.loaded/e.total)}),o.onload=()=>{let e=null;try{e=JSON.parse(o.responseText)}catch{}n&&o.status>=200&&o.status<300&&n(1),a({data:o.status>=200&&o.status<300?e:null,status:o.status})},o.onerror=()=>a({data:null,status:0}),o.ontimeout=()=>a({data:null,status:0}),o.send(t)})}var a=/^(image\/(png|jpeg|webp|gif)|application\/pdf|video\/(mp4|webm|ogg)|audio\/(mpeg|mp3|ogg|wav|x-wav|webm))$/;function o(e,t){let n=a.test(t)?t:`application/octet-stream`;return URL.createObjectURL(new Blob([e],{type:n}))}var s=e({cloudChatStreamUrl:()=>d,cloudClient:()=>l,cloudKanbanStreamUrl:()=>p,cloudNotificationStreamUrl:()=>m,cloudSupportStreamUrl:()=>f,deleteKanbanAttachment:()=>v,fetchKanbanAttachment:()=>_,fetchSupportFile:()=>x,uploadKanbanImage:()=>h,uploadSupportFile:()=>b});async function c(e,r={}){let{resolvedAccountId:i}=await n(async()=>{let{resolvedAccountId:e}=await import(`./cloud-session-BGrDhQyl.js`).then(e=>e.t);return{resolvedAccountId:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),a=r.accountId??await i();if(!a)return{data:null,error:{status:412,code:`CLOUD_NO_ACCOUNT_FOR_PROJECT`,message:`No cloud account on this machine answers for the open project.`}};try{return await t.cloudAuth.proxy.mutate({path:e,method:r.method??`GET`,...r.query?{query:r.query}:{},...r.body===void 0?{}:{body:r.body},accountId:a})}catch(e){return{data:null,error:e}}}var l={$fetch:c,organization:{getFullOrganization:e=>c(`/organization/get-full-organization`,{query:{organizationId:e.query.organizationId}}),list:async e=>{if(e)return c(`/organization/list`,{accountId:e});try{let{listCloudOrganizations:e}=await n(async()=>{let{listCloudOrganizations:e}=await import(`./cloud-session-BGrDhQyl.js`).then(e=>e.t);return{listCloudOrganizations:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));return{data:await e(),error:null}}catch(e){return{data:null,error:e}}},listTeams:e=>c(`/organization/list-teams`,{query:e.query}),listUserTeams:()=>c(`/organization/list-user-teams`),createTeam:e=>c(`/organization/create-team`,{method:`POST`,body:e}),removeTeam:e=>c(`/organization/remove-team`,{method:`POST`,body:e}),listTeamMembers:e=>c(`/organization/list-team-members`,{query:e.query}),addTeamMember:e=>c(`/organization/add-team-member`,{method:`POST`,body:e}),removeTeamMember:e=>c(`/organization/remove-team-member`,{method:`POST`,body:e}),checkSlug:e=>c(`/organization/check-slug`,{method:`POST`,body:e}),create:e=>c(`/organization/create`,{method:`POST`,body:e}),inviteMember:e=>c(`/organization/invite-member`,{method:`POST`,body:e})}};function u(e,t){let n=r(),i=new URLSearchParams({organizationId:t});return n&&i.set(`token`,n),`${e}?${i.toString()}`}function d(e){return u(`/api/cloud/chat/stream`,e)}function f(){let e=r();return`/api/cloud/support/stream${e?`?token=${encodeURIComponent(e)}`:``}`}function p(e){return u(`/api/cloud/kanban/stream`,e)}function m(e){return u(`/api/cloud/notification/stream`,e)}async function h(e,t,n){let a=r(),o=new URLSearchParams({organizationId:e,name:t.name});a&&o.set(`token`,a);let s=await i(`/api/cloud/kanban/image?${o.toString()}`,t,{onProgress:n});return s.data?.id?s.data:null}var g=/^(image\/(png|jpeg|webp|gif)|application\/pdf|video\/(mp4|webm|ogg)|audio\/(mpeg|mp3|ogg|wav|x-wav|webm))$/;async function _(e,t=``,n=``){try{let i=r(),a=new URLSearchParams;i&&a.set(`token`,i),n&&a.set(`organizationId`,n);let o=await fetch(`/api/cloud/kanban/file/${encodeURIComponent(e)}?${a.toString()}`,{signal:AbortSignal.timeout(3e5)});if(!o.ok)return null;let s=g.test(t)?t:`application/octet-stream`;return URL.createObjectURL(new Blob([await o.arrayBuffer()],{type:s}))}catch{return null}}async function v(e,t=``){try{let n=r(),i=new URLSearchParams;n&&i.set(`token`,n),t&&i.set(`organizationId`,t),await fetch(`/api/cloud/kanban/file/${encodeURIComponent(e)}?${i.toString()}`,{method:`DELETE`,signal:AbortSignal.timeout(15e3)})}catch{}}function y(e,t={}){let n=new URLSearchParams(t),i=r();return i&&n.set(`token`,i),e.ticketId&&n.set(`ticketId`,e.ticketId),e.accountId&&n.set(`accountId`,e.accountId),n.toString()}async function b(e,t,n){let r=await i(`/api/cloud/support/file?${y(t,{name:e.name})}`,e,{onProgress:n});return r.data?.id?r.data:null}async function x(e,t){try{let n=await fetch(`/api/cloud/support/file/${encodeURIComponent(e.id)}?${y(t)}`,{signal:AbortSignal.timeout(3e5)});return n.ok?o(await n.arrayBuffer(),e.contentType):null}catch{return null}}export{f as a,_ as c,b as d,m as i,x as l,l as n,s as o,p as r,v as s,d as t,h as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cloud-client-f1uf6_f0.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/trpc--XNiYHQf.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/preload-helper-BZ1Pz5am.js","assets/auth-P2oqhfLJ.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{C as t,c as n}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ht as r,g as i}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as a}from"./project-launch.store-9PE0nYa6.js";import{n as o,r as s}from"./trpc--XNiYHQf.js";import{t as c}from"./preload-helper-BZ1Pz5am.js";import{n as l}from"./project.store-DS9yZmd1.js";import{t as u}from"./open-project-org-BNDadG2_.js";var d=e({listCloudOrganizations:()=>A,resolvedAccountId:()=>C,useCloudSession:()=>N}),f=t([]),p=t({}),m=t(!1),h=t(!1),g=t(null),_=t(null),v=t(null),y=!1;function b(e){return e?{id:e.userId,name:e.name,email:e.email,image:e.image}:null}var x=i(()=>v.value===g.value?f.value.find(e=>e.id===_.value)??null:null),S=i(()=>!!g.value&&v.value!==g.value);async function C(){for(let e=0;E&&e<5;e++)await E;return x.value?.id??null}var w=0;async function T(){let e=++w;m.value=!0;try{let t=await s.cloudAuth.accounts.query();if(e!==w)return;f.value=t.accounts,p.value=t.orgAccounts;let n=f.value.filter(e=>!e.userId);if(n.length>0){await Promise.all(n.map(e=>s.cloudAuth.session.query({accountId:e.id}).catch(()=>null)));let t=await s.cloudAuth.accounts.query();if(e!==w)return;f.value=t.accounts,p.value=t.orgAccounts}}catch{if(e!==w)return;f.value=[],p.value={}}finally{e===w&&(m.value=!1,h.value=!0)}}o(()=>{(h.value||m.value)&&T().then(()=>{y&&O()})});var E=null;async function D(){let e=g.value;if(!e){_.value=null,v.value=null;return}try{let{accountId:t}=await s.cloudAuth.accountForOrg.query({orgId:e});if(g.value!==e)return;_.value=t,v.value=e}catch{g.value===e&&(_.value=null,v.value=e)}}function O(){E=D().finally(()=>{E=null})}function k(){if(y)return;let e=l(),t=a();y=!0,n(!0).run(()=>r(()=>u(t,e),e=>{g.value=e??null,O()},{immediate:!0}))}async function A(){let{cloudClient:e}=await c(async()=>{let{cloudClient:e}=await import(`./cloud-client-f1uf6_f0.js`).then(e=>e.a);return{cloudClient:e}},__vite__mapDeps([0,1,2,3,4,5,6]));!h.value&&!m.value&&await T();let t=0,n=await Promise.all(f.value.map(async n=>{try{let r=await e.organization.list(n.id);return r.error?(t++,[]):(r.data??[]).map(e=>({...e,accountId:n.id}))}catch{return t++,[]}}));if(t>0&&t===f.value.length)throw Error(`CLOUD_ORGS_UNREACHABLE`);let r=n.flat();return r.length>0&&s.cloudSync.rememberOrgAccounts.mutate({orgs:r.map(e=>({orgId:e.id,accountId:e.accountId}))}).then(()=>(O(),E)).catch(()=>{}),r}async function j(){let{url:e}=await s.cloudAuth.startLogin.mutate({returnTo:window.location.origin});window.location.href=e}async function M(e){let t=e??x.value?.id;t&&(await s.cloudAuth.signOut.mutate({accountId:t}),await T())}function N(){return!h.value&&!m.value&&T(),k(),{user:i(()=>b(x.value??void 0)),accounts:f,orgAccounts:p,currentAccount:x,loading:m,accountPending:S,isLinked:i(()=>f.value.length>0),activeOrgId:i(()=>g.value),refresh:T,signIn:j,signOut:M}}export{A as n,N as r,d as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cloud-client-C3E2yyUu.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/trpc-_B70IpnV.js","assets/reactivity.esm-bundler-BQ9SB2vv.js","assets/runtime-core.esm-bundler-DujKY9QV.js","assets/preload-helper-BZ1Pz5am.js","assets/auth-Bn1t6v9Z.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{C as t,c as n}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ht as r,g as i}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as a}from"./project-launch.store-uVIdI1FE.js";import{n as o,r as s}from"./trpc-_B70IpnV.js";import{t as c}from"./preload-helper-BZ1Pz5am.js";import{n as l}from"./project.store-BGgsly35.js";import{t as u}from"./open-project-org-BNDadG2_.js";var d=e({listCloudOrganizations:()=>A,resolvedAccountId:()=>C,useCloudSession:()=>N}),f=t([]),p=t({}),m=t(!1),h=t(!1),g=t(null),_=t(null),v=t(null),y=!1;function b(e){return e?{id:e.userId,name:e.name,email:e.email,image:e.image}:null}var x=i(()=>v.value===g.value?f.value.find(e=>e.id===_.value)??null:null),S=i(()=>!!g.value&&v.value!==g.value);async function C(){for(let e=0;E&&e<5;e++)await E;return x.value?.id??null}var w=0;async function T(){let e=++w;m.value=!0;try{let t=await s.cloudAuth.accounts.query();if(e!==w)return;f.value=t.accounts,p.value=t.orgAccounts;let n=f.value.filter(e=>!e.userId);if(n.length>0){await Promise.all(n.map(e=>s.cloudAuth.session.query({accountId:e.id}).catch(()=>null)));let t=await s.cloudAuth.accounts.query();if(e!==w)return;f.value=t.accounts,p.value=t.orgAccounts}}catch{if(e!==w)return;f.value=[],p.value={}}finally{e===w&&(m.value=!1,h.value=!0)}}o(()=>{(h.value||m.value)&&T().then(()=>{y&&O()})});var E=null;async function D(){let e=g.value;if(!e){_.value=null,v.value=null;return}try{let{accountId:t}=await s.cloudAuth.accountForOrg.query({orgId:e});if(g.value!==e)return;_.value=t,v.value=e}catch{g.value===e&&(_.value=null,v.value=e)}}function O(){E=D().finally(()=>{E=null})}function k(){if(y)return;let e=l(),t=a();y=!0,n(!0).run(()=>r(()=>u(t,e),e=>{g.value=e??null,O()},{immediate:!0}))}async function A(){let{cloudClient:e}=await c(async()=>{let{cloudClient:e}=await import(`./cloud-client-C3E2yyUu.js`).then(e=>e.o);return{cloudClient:e}},__vite__mapDeps([0,1,2,3,4,5,6]));!h.value&&!m.value&&await T();let t=0,n=await Promise.all(f.value.map(async n=>{try{let r=await e.organization.list(n.id);return r.error?(t++,[]):(r.data??[]).map(e=>({...e,accountId:n.id}))}catch{return t++,[]}}));if(t>0&&t===f.value.length)throw Error(`CLOUD_ORGS_UNREACHABLE`);let r=n.flat();return r.length>0&&s.cloudSync.rememberOrgAccounts.mutate({orgs:r.map(e=>({orgId:e.id,accountId:e.accountId}))}).then(()=>(O(),E)).catch(()=>{}),r}async function j(){let{url:e}=await s.cloudAuth.startLogin.mutate({returnTo:window.location.origin});window.location.href=e}async function M(e){let t=e??x.value?.id;t&&(await s.cloudAuth.signOut.mutate({accountId:t}),await T())}function N(){return!h.value&&!m.value&&T(),k(),{user:i(()=>b(x.value??void 0)),accounts:f,orgAccounts:p,currentAccount:x,loading:m,accountPending:S,isLinked:i(()=>f.value.length>0),activeOrgId:i(()=>g.value),refresh:T,signIn:j,signOut:M}}export{A as n,N as r,d as t};