@runeya/runeya 2.0.153 → 2.0.154

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 (99) hide show
  1. package/{chat-Z7SFBEXS.js → chat-COP27XB3.js} +3 -3
  2. package/{chunk-EUTW2S4P.js → chunk-OLHL5NFP.js} +7 -4
  3. package/chunk-OLHL5NFP.js.map +1 -0
  4. package/{chunk-QJSIN26R.js → chunk-VKYSHTYT.js} +443 -78
  5. package/chunk-VKYSHTYT.js.map +1 -0
  6. package/{companion-ZDEGNZ2G.js → companion-3MW23ONE.js} +2 -2
  7. package/index.js +7 -7
  8. package/{install-gate-TSCXUCYE.js → install-gate-3UVXPA57.js} +2 -2
  9. package/package.json +1 -1
  10. package/{src-NWPED6TK.js → src-K4E6GUCZ.js} +37 -25
  11. package/src-K4E6GUCZ.js.map +1 -0
  12. package/web/assets/{AgentScalarChatInterface.vue-CEMnvqfq.js → AgentScalarChatInterface.vue-BtA-f77q.js} +3 -3
  13. package/web/assets/{AgentTerminalPage-qQ96vm5Y.js → AgentTerminalPage-2Ky-vEkw.js} +1 -1
  14. package/web/assets/AiChatModals-BV3vIIqN.js +4 -0
  15. package/web/assets/AiChatModals-DS5R3Oz1.css +1 -0
  16. package/web/assets/AppLayout-BgPr-urw.css +1 -0
  17. package/web/assets/AppLayout-DsczwAFI.js +1 -0
  18. package/web/assets/{AuditPage-B-pCRqXH.js → AuditPage-DoKHFRJ7.js} +1 -1
  19. package/web/assets/{CloudAccountPage-C7aV6M8U.js → CloudAccountPage-CDQNalgx.js} +1 -1
  20. package/web/assets/{CloudMessagingPage-BTc8xbjF.js → CloudMessagingPage-DduCz3KB.js} +1 -1
  21. package/web/assets/{DashboardPage-CF7GLFlx.js → DashboardPage-ClJR5DiP.js} +1 -1
  22. package/web/assets/{DirectoryPickerDialog-bKqIFy8e.js → DirectoryPickerDialog-CVVg3SzI.js} +1 -1
  23. package/web/assets/{EnvironmentForm-kOyM5xTa.js → EnvironmentForm-eMpLFv_-.js} +1 -1
  24. package/web/assets/{EnvironmentFormPage-DfNI6meL.js → EnvironmentFormPage-DXH2lgk_.js} +1 -1
  25. package/web/assets/{EnvironmentListPage-C1VLgeeP.js → EnvironmentListPage-D-g_8lQw.js} +1 -1
  26. package/web/assets/{KanbanBoardPage-Bl6UnQ6P.js → KanbanBoardPage-BeSkCN6I.js} +3 -3
  27. package/web/assets/KanbanBoardPage-BrFqn87r.css +1 -0
  28. package/web/assets/{KanbanListPage-Dly6XiRC.js → KanbanListPage-DnhCC5ET.js} +1 -1
  29. package/web/assets/{LaunchProjectPage-DCrKSY8v.js → LaunchProjectPage-DyNqhic1.js} +1 -1
  30. package/web/assets/{LaunchServicesPage-Bl1pjfYH.js → LaunchServicesPage-bI7pVeU7.js} +1 -1
  31. package/web/assets/{LaunchShell-BcbfPDdc.js → LaunchShell-CokT4E5l.js} +1 -1
  32. package/web/assets/{LogViewer-C_XcH7Oe.js → LogViewer-Cs3Y8vaZ.js} +1 -1
  33. package/web/assets/{OrgKeyPrompt-BK6gkvaO.js → OrgKeyPrompt-DtgelhnI.js} +1 -1
  34. package/web/assets/{ProcessControls-BbRdiZsD.js → ProcessControls-CxlDLGiO.js} +1 -1
  35. package/web/assets/{ProcessDetailPage-W7S7ogas.js → ProcessDetailPage-D93cKCHb.js} +1 -1
  36. package/web/assets/{ProjectCreateDialog-q_39qiPd.js → ProjectCreateDialog-Bko_A5wp.js} +1 -1
  37. package/web/assets/{ProjectLocationGate-BFvdSy-B.js → ProjectLocationGate-jsy8WetY.js} +1 -1
  38. package/web/assets/{ProjectPublishDialog-DAJAvDTT.js → ProjectPublishDialog-7kR1zZAo.js} +1 -1
  39. package/web/assets/{RandomJobTestPage-A-I7cImN.js → RandomJobTestPage-Dp9prwa7.js} +1 -1
  40. package/web/assets/{ScenarioEditorPage-DXw4bCxb.js → ScenarioEditorPage-fv9yLH75.js} +1 -1
  41. package/web/assets/{SendToChatDialog-CbhE2WYO.js → SendToChatDialog-BVSbXcbf.js} +1 -1
  42. package/web/assets/{ServiceControlsBar-CudCeQql.js → ServiceControlsBar-DFECGWL8.js} +1 -1
  43. package/web/assets/{ServiceDetailPage-DQvL-VOx.js → ServiceDetailPage-BQA74240.js} +1 -1
  44. package/web/assets/{ServiceFormPage-0qXPeqrh.js → ServiceFormPage-ChsRsoLt.js} +1 -1
  45. package/web/assets/SettingsPage-BXKsN9Py.js +2086 -0
  46. package/web/assets/{SettingsPage-NpFX7FAy.css → SettingsPage-Dsuzjo8r.css} +1 -1
  47. package/web/assets/{UnlockPage-CtvaQt45.js → UnlockPage-DhEN16uX.js} +1 -1
  48. package/web/assets/{VaultMigrationPage-DtoAlng4.js → VaultMigrationPage-BgRNUuTP.js} +1 -1
  49. package/web/assets/{VersionBadge-CiBz82BB.js → VersionBadge-CXJ-2h5V.js} +1 -1
  50. package/web/assets/{WikiPage-cuKigw_5.js → WikiPage-BT5a9d5Q.js} +1 -1
  51. package/web/assets/{WikiView-BW-B83LB.js → WikiView-BNReLsq5.js} +1 -1
  52. package/web/assets/{add-scalar-classes-BPTxQDQd.js → add-scalar-classes-C_lKfiMa.js} +2 -2
  53. package/web/assets/{agent.store-DumNiX1X.js → agent.store-B6OM7edC.js} +1 -1
  54. package/web/assets/{auth-Qa1l14iV.js → auth-5bsz5kSC.js} +2 -2
  55. package/web/assets/{cloud-chat.store-TYR1_27Z.js → cloud-chat.store-Di38xQRJ.js} +1 -1
  56. package/web/assets/{cloud-client-CdOqrdP_.js → cloud-client-CEVx-bg6.js} +2 -2
  57. package/web/assets/{cloud-session-Dd7b9wxV.js → cloud-session-w6eNQX1X.js} +2 -2
  58. package/web/assets/composables-CCbqJqnd.js +1 -0
  59. package/web/assets/i18n-DbgjJIf8.js +1 -0
  60. package/web/assets/index-DB3-fmza.css +1 -0
  61. package/web/assets/{index-BCU69ZHl.js → index-mvpLwxNT.js} +74 -74
  62. package/web/assets/modal-Bslt0NZi.js +5 -0
  63. package/web/assets/{notification.store-D2olEA0V.js → notification.store-CAG1kWYq.js} +1 -1
  64. package/web/assets/{project-launch.store-MX5LzgIm.js → project-launch.store-Im5SMon9.js} +1 -1
  65. package/web/assets/{project.store-BFwiDQ1X.js → project.store-CITAykC3.js} +1 -1
  66. package/web/assets/{scenario.store-C8kW-yTN.js → scenario.store-C9sSoRzb.js} +2 -2
  67. package/web/assets/{service.store-B0Ass90H.js → service.store-CZJuuJiv.js} +1 -1
  68. package/web/assets/{settings-scope-D0hzzuyq.js → settings-scope-vcJEMNnD.js} +1 -1
  69. package/web/assets/{settings.store-B9Kp0l1G.js → settings.store-CydW_2jh.js} +1 -1
  70. package/web/assets/{src-DnjsM9el.js → src-CIOvFTGI.js} +23 -23
  71. package/web/assets/{src-DITmhvGS.js → src-COZZWm-m.js} +1 -1
  72. package/web/assets/src-DrVR8mhy.css +1 -0
  73. package/web/assets/{trpc-BvrR5qP9.js → trpc-BQ0mLnfI.js} +3 -3
  74. package/web/assets/{useCloudOrg-2vv5fVV6.js → useCloudOrg-CQvEbrZv.js} +1 -1
  75. package/web/assets/{useEnvVarAutocomplete-VVX3MC62.js → useEnvVarAutocomplete-hy3rO3SN.js} +1 -1
  76. package/web/assets/{useProjectCatalog-DsVvtBzo.js → useProjectCatalog-CWHpf3Yj.js} +1 -1
  77. package/web/assets/{useProjectCloudOrg-wv-RfsmO.js → useProjectCloudOrg-B3rNPes5.js} +1 -1
  78. package/web/assets/{useServiceUrlHost-C4Evrede.js → useServiceUrlHost-BFfie_6h.js} +1 -1
  79. package/web/index.html +17 -17
  80. package/chunk-EUTW2S4P.js.map +0 -1
  81. package/chunk-QJSIN26R.js.map +0 -1
  82. package/mcp-server/external.d.ts +0 -44
  83. package/mcp-server/index.d.ts +0 -1
  84. package/mcp-server/launch.d.ts +0 -89
  85. package/src-NWPED6TK.js.map +0 -1
  86. package/web/assets/AiChatModals-BmWxg-Sr.css +0 -1
  87. package/web/assets/AiChatModals-BsfKdbEA.js +0 -4
  88. package/web/assets/AppLayout-Djk3-XbN.css +0 -1
  89. package/web/assets/AppLayout-f0_BsXSc.js +0 -1
  90. package/web/assets/KanbanBoardPage-Cmu4Je4N.css +0 -1
  91. package/web/assets/SettingsPage-Bjn4bKPP.js +0 -2086
  92. package/web/assets/composables-DguCUR3O.js +0 -1
  93. package/web/assets/i18n-DipCGVKv.js +0 -1
  94. package/web/assets/index-Ck_3m_I9.css +0 -1
  95. package/web/assets/modal-BgrgFhyC.js +0 -5
  96. package/web/assets/src-CfDz-9Q6.css +0 -1
  97. /package/{chat-Z7SFBEXS.js.map → chat-COP27XB3.js.map} +0 -0
  98. /package/{companion-ZDEGNZ2G.js.map → companion-3MW23ONE.js.map} +0 -0
  99. /package/{install-gate-TSCXUCYE.js.map → install-gate-3UVXPA57.js.map} +0 -0
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as m,mt as h,nn as g,o as _,qt as v,rn as y,tt as te,v as b,y as x}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as S,w as ne}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as re}from"./vue-i18n-o7yraQpR.js";import{n as C}from"./project-launch.store-MX5LzgIm.js";import{C as w,J as T,P as ie,U as E,W as ae,Y as D,a as oe,dt as se,ft as O,i as k,k as ce,n as le,r as A,t as j}from"./src-Ck_MutzB.js";import{n as M,r as ue}from"./project.store-BFwiDQ1X.js";import{h as de,l as fe,t as pe,u as N}from"./dist-C9Qdh18x.js";import{t as P}from"./service.store-B0Ass90H.js";import{t as F}from"./agent.store-DumNiX1X.js";import{H as me,U as he}from"./index-BCU69ZHl.js";import{t as I}from"./useServiceUrlHost-C4Evrede.js";import{t as ge}from"./uuid-XipkJWQw.js";import{t as _e}from"./FlagChip-DjC14z4J.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=O(m({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=ue(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(h(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:g({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,y(r.value.name),1)])):x(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=m({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(h(),b(e(k),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:S(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=O(m({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=re(),d=t(``),f=t(``),p=t([]);function m(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function g(){p.value=m()}a(()=>[s.envKeys,s.serviceBuiltins],g,{deep:!0});function _(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function te(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function S(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?ne(r):null}function ne(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function C(e){if(f.value=e.query,w)w=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),g()}let w=!1;function T(){w=!0,u(`focus`)}function ie(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(h(),b(e(k),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:C,onItemSelect:i[1]||=e=>ie(e.value),onFocus:T,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:v(({option:e})=>[c(`span`,H,y(e.label),1)]),option:v(({option:t})=>[c(`span`,we,[r(e(E),{severity:`secondary`,value:_(t)},null,8,[`value`]),te(t)?(h(),l(`i`,U)):S(t)?(h(),l(`span`,Te,y(S(t)),1)):x(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=O(m({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:m}){let g=p,S=m,C=ue(),ae=ie(),{t:D}=re(),oe=t(!1),O=t(!1),ce=t(!1),le=t(!1),A=t(!1),j=t(!1),M=t(null);function de(e,t){navigator.clipboard.writeText(t),M.value=e,setTimeout(()=>{M.value===e&&(M.value=null)},1500)}let fe=f(()=>C.getById(g.environmentId)?.variables?.[g.variableId]),N=t(``),P=t(``),F=t(``),I=t(``),ge=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await te(),Te.value?.focus?.()}let qt=f(()=>rn(P.value)),q=f(()=>ge.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?D(`variableRowEditor.shareWithAiHintInjected`):q.value?D(`variableRowEditor.shareWithAiHint`):D(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>g.disabled||z.value);function Zt(){let e=fe.value;N.value=e?.key??``,P.value=e?.value?.value??``,F.value=e?.value?.pre??``,I.value=e?.value?.post??``,ge.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(P.value=``),Q()}ee(Zt),a(fe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>g.overrides[g.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!g.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await te(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:g.resolvedEnv,serviceBuiltins:g.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;N.value=t,P.value=`{{environment.${t}}}`,ge.value=!1;let n=g.autocompleteMeta?.[t];n&&(F.value=n.pre,I.value=n.post),Q()}let un=t(null),dn=f(()=>pe.map(e=>({ref:`{{${e.name}}}`,desc:D(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(O.value)return;let e=N.value.trim();if(e){oe.value=!0;try{await C.upsertVariable(g.environmentId,g.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:P.value,pre:F.value,post:I.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),g.isPending&&S(`saved`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.saveError`),life:4e3})}finally{oe.value=!1}}});async function fn(){if(O.value=!0,g.isPending){S(`deleted`);return}oe.value=!0;try{J.value&&await C.removeOverride(g.variableId),await C.removeVariable(g.environmentId,g.variableId),S(`deleted`)}catch(e){O.value=!1,ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.deleteError`),life:4e3})}finally{oe.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await C.removeOverride(g.variableId),S(`override-changed`));return}await C.setOverride(g.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),S(`override-changed`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await C.removeOverride(g.variableId),S(`override-changed`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return h(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},y(e(D)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(h(),b(e(k),{key:0,"input-id":`varrow-key-ac`,modelValue:N.value,"onUpdate:modelValue":a[0]||=e=>N.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(D)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>S(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-key-input`,modelValue:N.value,"onUpdate:modelValue":a[2]||=e=>N.value=e,placeholder:e(D)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,ke,y(N.value),1))]),p.showDelete&&p.editable?(h(),l(`div`,Ae,[r(e(se),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||oe.value,onClick:fn},null,8,[`disabled`])])):x(``,!0)]),p.editable?(h(),l(`div`,je,[qt.value?x(``,!0):(h(),b(_e,{key:0,modelValue:ge.value,"onUpdate:modelValue":[a[3]||=e=>ge.value=e,e(Q)],label:e(D)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(D)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(D)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(D)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(D)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(D)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(D)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(D)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(D)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):x(``,!0),p.editable||V.value.length?(h(),l(`div`,Me,[c(`label`,Ne,y(e(D)(`variableRowEditor.tags`)),1),p.editable?(h(),b(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(D)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(h(),l(`div`,Pe,[(h(!0),l(_,null,u(V.value,t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):x(``,!0),p.editable&&!ge.value&&!rn(P.value)?(h(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.notSecretWarning`)),1)])):x(``,!0),p.editable&&!U.value?(h(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addDescription`)),1)])):x(``,!0),U.value?(h(),l(`div`,Ie,[c(`label`,Le,y(e(D)(`variableRowEditor.description`)),1),r(e(he),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(D)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(me)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):x(``,!0),p.editable&&z.value?(h(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.overrideOnlyNotice`)),1)])):x(``,!0),$t.value?x(``,!0):(h(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(h(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,y(e(D)(`variableRowEditor.value`)),1),J.value?(h(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.hideSharedValue`)),1)])):x(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,y(e(D)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-prefix`,modelValue:F.value,"onUpdate:modelValue":a[12]||=e=>F.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>S(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-prefix`,modelValue:F.value,"onUpdate:modelValue":a[16]||=e=>F.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,Ge,y(F.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(y(e(D)(`variableRowEditor.value`))+` `,1),p.editable?(h(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(D)(`variableRowEditor.helpTitle`),onClick:a[17]||=ne(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):x(``,!0)],8,qe),r(e(w),{ref_key:`valueHelp`,ref:un},{default:v(()=>[c(`div`,Ye,[c(`div`,Xe,y(e(D)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(y(e(D)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,y(Kt))]),c(`p`,Qe,y(e(D)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,y(e(D)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(h(!0),l(_,null,u(dn.value,e=>(h(),l(`li`,{key:e.ref},[c(`code`,null,y(e.ref),1),c(`span`,null,y(e.desc),1)]))),128))]),c(`p`,tt,y(e(D)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(h(),l(_,{key:0},[q.value?(h(),l(`div`,nt,[r(e(T),{id:`varrow-value-secret`,modelValue:P.value,"onUpdate:modelValue":a[18]||=e=>P.value=e,type:A.value?`text`:`password`,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(P.value)&&!ce.value?(h(),l(`span`,{key:1,class:`interpolation-badge`,title:P.value,onClick:a[20]||=e=>ce.value=!0},[r(e(E),{severity:`secondary`,value:an(P.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(h(),b(W,{key:2,"input-id":`varrow-value-plain`,modelValue:P.value,"onUpdate:modelValue":a[21]||=e=>P.value=e,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>S(`autocomplete-search`,e),onFocus:a[23]||=e=>ce.value=!0,onBlur:a[24]||=t=>{ce.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:3,id:`varrow-value-plain`,modelValue:P.value,"onUpdate:modelValue":a[26]||=e=>P.value=e,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>ce.value=!0,onBlur:a[28]||=t=>{ce.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(h(),l(`span`,at,[P.value?(h(),l(`span`,ot,[q.value?(h(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>A.value=!A.value},null,2)):x(``,!0),c(`i`,{class:d([M.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>de(`val`,F.value+P.value+I.value)},null,2)])):x(``,!0),rn(P.value)?(h(),b(e(E),{key:1,severity:`secondary`,value:an(P.value)},null,8,[`value`])):q.value?(h(),l(_,{key:2},[A.value?(h(),l(`span`,ct,y(P.value),1)):(h(),l(`span`,st,`***`))],64)):(h(),l(_,{key:3},[i(y(P.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,y(e(D)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-suffix`,modelValue:I.value,"onUpdate:modelValue":a[31]||=e=>I.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>S(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-suffix`,modelValue:I.value,"onUpdate:modelValue":a[35]||=e=>I.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,dt,y(I.value||`—`),1))])]),q.value?x(``,!0):(h(),l(`code`,ft,[F.value?(h(),l(`span`,pt,y(sn(F.value)),1)):x(``,!0),rn(P.value)?(h(),l(`span`,mt,[cn(P.value)==null?(h(),l(_,{key:1},[r(e(E),{severity:`secondary`,value:an(P.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(h(),l(_,{key:0},[c(`span`,ht,y(cn(P.value)),1),p.canEditSource?(h(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(D)(`variablesTable.editParentTitle`),onClick:a[36]||=ne(e=>S(`edit-source`),[`stop`])},null,8,gt)):x(``,!0)],64))])):(h(),l(`span`,_t,y(sn(P.value)||`…`),1)),I.value?(h(),l(`span`,vt,y(sn(I.value)),1)):x(``,!0)]))])):x(``,!0),p.showOverrides&&N.value?.trim()&&p.editable&&!en.value?(h(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addOverride`)),1)])):x(``,!0),p.showOverrides&&N.value?.trim()&&en.value?(h(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(y(e(D)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(D)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(h(),b(e(se),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(D)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):x(``,!0)]),c(`div`,Ct,[p.editable?(h(),l(_,{key:0},[c(`div`,wt,[c(`label`,Tt,y(e(D)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>S(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},y(e(D)(`variableRowEditor.value`)),9,Dt),q.value?(h(),l(`div`,Ot,[r(e(T),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:j.value?`text`:`password`,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>j.value=!j.value,tabindex:`-1`},[c(`i`,{class:d(j.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!le.value?(h(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>le.value=!0},[r(e(E),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(h(),b(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>S(`autocomplete-search`,e),onFocus:a[47]||=e=>le.value=!0,onBlur:a[48]||=e=>{le.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>le.value=!0,onBlur:a[52]||=e=>{le.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,y(e(D)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>S(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(h(),l(`div`,Nt,[J.value?(h(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(h(),l(`i`,{key:0,class:d([j.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>j.value=!j.value},null,2)):x(``,!0),c(`i`,{class:d([M.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>de(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(h(),l(_,{key:0},[j.value?(h(),l(`code`,Lt,y(J.value.pre)+y(J.value.value)+y(J.value.post),1)):(h(),l(`span`,It,`***`))],64)):(h(),l(`code`,Rt,y(J.value.pre)+y(J.value.value)+y(J.value.post),1))])):(h(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(h(),l(`code`,Bt,[Y.value?(h(),l(`span`,Vt,y(sn(Y.value)),1)):x(``,!0),rn(X.value)?(h(),l(`span`,Ht,[cn(X.value)==null?(h(),l(_,{key:1},[r(e(E),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(h(),l(`span`,Ut,y(cn(X.value)),1))])):(h(),l(`span`,Wt,y(sn(X.value)||`…`),1)),Z.value?(h(),l(`span`,Gt,y(sn(Z.value)),1)):x(``,!0)])):x(``,!0)])):x(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=O(m({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:m}){let g=be,S=/^\{\{environment\.([^{}]+)\}\}$/,C=Object.fromEntries(pe.map(e=>[e.name,``])),w=n,O=m,{t:k}=re(),M=ue(),de=f(()=>Object.keys(w.sources).length>0),fe=f(()=>Object.keys(w.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>w.scrollHeight===`auto`?P.value??`460px`:w.scrollHeight);function me(){if(w.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let he=null;ee(()=>{te(me),window.addEventListener(`resize`,me),typeof ResizeObserver<`u`&&N.value&&(he=new ResizeObserver(()=>me()),he.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,me),he?.disconnect(),he=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(w.showOverrides)try{let e=await M.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>M.getById(w.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of M.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(w.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ie(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=w.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=M.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:k(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=M.currentProjectId;if(!r)return;let i=await M.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await M.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,O(`variables-changed`)}catch(e){je.add({severity:`error`,summary:k(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){te(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=ge();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],te(()=>{W.value={[e]:!0},te(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return g.test(e)}function Ye(e){let t=e.match(g);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(S);if(t)return w.resolvedEnv[t[1]]??null;let n=e.match(g);if(n){let e={...C,...w.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(h(),l(_,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(T),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(h(),b(e(oe),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(k)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):x(``,!0),n.showOverrides?(h(),l(`div`,en,[r(e(ce),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,y(e(k)(`variablesTable.overriddenOnly`)),1)])):x(``,!0)]),r(e(le),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:v(()=>[c(`div`,Y,y(n.showAddButton?e(k)(`variablesTable.empty`):e(k)(`variablesTable.emptyReadonly`)),1)]),expansion:v(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(C),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>O(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:v(()=>[r(e(A),{expander:``,style:{width:`2.5rem`}}),r(e(A),{field:`variableId`,header:e(k)(`common.key`)},{body:v(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,y(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(h(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(k)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+y(e(k)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(h(),l(`span`,{key:1,class:`overridden-badge`,title:e(k)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+y(e(k)(`variablesTable.override`)),1)],8,an)):x(``,!0)]),H(t.variableId).length?(h(),l(`span`,on,[(h(!0),l(_,null,u(B(t.variableId)?.tags??[],t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(h(!0),l(_,null,u(Ce(t.variableId),t=>s((h(),b(e(E),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(j),e(k)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):x(``,!0),de.value&&n.sources[t.variableId]?(h(),b(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):x(``,!0),de.value&&n.sources[t.variableId]?.resolvedFrom?(h(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):x(``,!0)])]),_:1},8,[`header`]),r(e(A),{header:e(k)(`common.value`)},{body:v(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(h(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=ne(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(h(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(k)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):x(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(k)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):x(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(h(),l(`span`,dn,[r(e(E),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(h(),l(`span`,fn,`***`)):(h(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},y(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&fe.value&&Xe(B(t.variableId)?.value?.value??``)==null?(h(),l(_,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(E),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(h(),b(e(E),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(h(),l(_,{key:4},[K.value.has(t.variableId)?(h(),l(`code`,{key:1,title:Ae(t.variableId)},y(Ze(Ae(t.variableId))),9,mn)):(h(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(h(),l(`code`,{key:5,title:Ae(t.variableId)},y(Ze(Ae(t.variableId))),9,hn)):(h(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(h(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=ne(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(h(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(k)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):x(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(k)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(h(),l(_,{key:0},[K.value.has(`ovr:`+t.variableId)?(h(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},y(Ze(Ve(t.variableId))),9,xn)):(h(),l(`span`,bn,`***`))],64)):(h(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},y(Ze(Ve(t.variableId))),9,Sn))])):x(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(h(),b(e(se),{key:0,type:`button`,label:e(k)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):x(``,!0)],512),r(e(D),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(k)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:v(()=>[r(e(se),{label:e(k)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(se),{label:e(k)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:v(()=>[Me.value?(h(),l(`div`,Cn,[r(e(ae),{severity:`warn`,class:`parent-edit__warning`},{default:v(()=>[i(y(e(k)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,y(e(k)(`common.value`)),1),r(e(T),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+y(e(k)(`variablesTable.editParentImpact`)),1)]),Fe.value?(h(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,y(e(k)(`variablesTable.editParentLoading`)),1)])):(h(),l(_,{key:1},[Le.value.length?(h(),l(`ul`,kn,[(h(!0),l(_,null,u(Le.value,(t,n)=>(h(),l(`li`,{key:n},[r(e(E),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(k)(`variablesTable.editParentInherits`):e(k)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,y(t.environmentName),1),t.serviceName?(h(),l(`span`,jn,y(t.serviceName),1)):x(``,!0)]))),128))])):(h(),l(`div`,Mn,y(e(k)(`variablesTable.editParentNoUsage`)),1))],64))])])):x(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=M(),r=C(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=fe(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=de(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=ue(),r=M(),i=C(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of pe)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn as t};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as m,mt as h,nn as g,o as _,qt as v,rn as y,tt as te,v as b,y as x}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as S,w as ne}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as re}from"./vue-i18n-o7yraQpR.js";import{n as C}from"./project-launch.store-Im5SMon9.js";import{C as w,J as T,P as ie,U as E,W as ae,Y as D,a as oe,dt as se,ft as O,i as k,k as ce,n as le,r as A,t as j}from"./src-Ck_MutzB.js";import{n as M,r as ue}from"./project.store-CITAykC3.js";import{h as de,l as fe,t as pe,u as N}from"./dist-C9Qdh18x.js";import{t as P}from"./service.store-CZJuuJiv.js";import{t as F}from"./agent.store-B6OM7edC.js";import{H as me,U as he}from"./index-mvpLwxNT.js";import{t as I}from"./useServiceUrlHost-BFfie_6h.js";import{t as ge}from"./uuid-XipkJWQw.js";import{t as _e}from"./FlagChip-DjC14z4J.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=O(m({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=ue(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(h(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:g({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,y(r.value.name),1)])):x(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=m({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(h(),b(e(k),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:S(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=O(m({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=re(),d=t(``),f=t(``),p=t([]);function m(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function g(){p.value=m()}a(()=>[s.envKeys,s.serviceBuiltins],g,{deep:!0});function _(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function te(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function S(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?ne(r):null}function ne(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function C(e){if(f.value=e.query,w)w=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),g()}let w=!1;function T(){w=!0,u(`focus`)}function ie(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(h(),b(e(k),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:C,onItemSelect:i[1]||=e=>ie(e.value),onFocus:T,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:v(({option:e})=>[c(`span`,H,y(e.label),1)]),option:v(({option:t})=>[c(`span`,we,[r(e(E),{severity:`secondary`,value:_(t)},null,8,[`value`]),te(t)?(h(),l(`i`,U)):S(t)?(h(),l(`span`,Te,y(S(t)),1)):x(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=O(m({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:m}){let g=p,S=m,C=ue(),ae=ie(),{t:D}=re(),oe=t(!1),O=t(!1),ce=t(!1),le=t(!1),A=t(!1),j=t(!1),M=t(null);function de(e,t){navigator.clipboard.writeText(t),M.value=e,setTimeout(()=>{M.value===e&&(M.value=null)},1500)}let fe=f(()=>C.getById(g.environmentId)?.variables?.[g.variableId]),N=t(``),P=t(``),F=t(``),I=t(``),ge=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await te(),Te.value?.focus?.()}let qt=f(()=>rn(P.value)),q=f(()=>ge.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?D(`variableRowEditor.shareWithAiHintInjected`):q.value?D(`variableRowEditor.shareWithAiHint`):D(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>g.disabled||z.value);function Zt(){let e=fe.value;N.value=e?.key??``,P.value=e?.value?.value??``,F.value=e?.value?.pre??``,I.value=e?.value?.post??``,ge.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(P.value=``),Q()}ee(Zt),a(fe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>g.overrides[g.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!g.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await te(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:g.resolvedEnv,serviceBuiltins:g.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;N.value=t,P.value=`{{environment.${t}}}`,ge.value=!1;let n=g.autocompleteMeta?.[t];n&&(F.value=n.pre,I.value=n.post),Q()}let un=t(null),dn=f(()=>pe.map(e=>({ref:`{{${e.name}}}`,desc:D(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(O.value)return;let e=N.value.trim();if(e){oe.value=!0;try{await C.upsertVariable(g.environmentId,g.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:P.value,pre:F.value,post:I.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),g.isPending&&S(`saved`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.saveError`),life:4e3})}finally{oe.value=!1}}});async function fn(){if(O.value=!0,g.isPending){S(`deleted`);return}oe.value=!0;try{J.value&&await C.removeOverride(g.variableId),await C.removeVariable(g.environmentId,g.variableId),S(`deleted`)}catch(e){O.value=!1,ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.deleteError`),life:4e3})}finally{oe.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await C.removeOverride(g.variableId),S(`override-changed`));return}await C.setOverride(g.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),S(`override-changed`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await C.removeOverride(g.variableId),S(`override-changed`)}catch(e){ae.add({severity:`error`,summary:D(`common.error`),detail:e.message??D(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return h(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},y(e(D)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(h(),b(e(k),{key:0,"input-id":`varrow-key-ac`,modelValue:N.value,"onUpdate:modelValue":a[0]||=e=>N.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(D)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>S(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-key-input`,modelValue:N.value,"onUpdate:modelValue":a[2]||=e=>N.value=e,placeholder:e(D)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,ke,y(N.value),1))]),p.showDelete&&p.editable?(h(),l(`div`,Ae,[r(e(se),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||oe.value,onClick:fn},null,8,[`disabled`])])):x(``,!0)]),p.editable?(h(),l(`div`,je,[qt.value?x(``,!0):(h(),b(_e,{key:0,modelValue:ge.value,"onUpdate:modelValue":[a[3]||=e=>ge.value=e,e(Q)],label:e(D)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(D)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(D)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(D)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(D)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(D)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(D)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(D)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(D)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):x(``,!0),p.editable||V.value.length?(h(),l(`div`,Me,[c(`label`,Ne,y(e(D)(`variableRowEditor.tags`)),1),p.editable?(h(),b(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(D)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(h(),l(`div`,Pe,[(h(!0),l(_,null,u(V.value,t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):x(``,!0),p.editable&&!ge.value&&!rn(P.value)?(h(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.notSecretWarning`)),1)])):x(``,!0),p.editable&&!U.value?(h(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addDescription`)),1)])):x(``,!0),U.value?(h(),l(`div`,Ie,[c(`label`,Le,y(e(D)(`variableRowEditor.description`)),1),r(e(he),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(D)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(me)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):x(``,!0),p.editable&&z.value?(h(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.overrideOnlyNotice`)),1)])):x(``,!0),$t.value?x(``,!0):(h(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(h(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,y(e(D)(`variableRowEditor.value`)),1),J.value?(h(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.hideSharedValue`)),1)])):x(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,y(e(D)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-prefix`,modelValue:F.value,"onUpdate:modelValue":a[12]||=e=>F.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>S(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-prefix`,modelValue:F.value,"onUpdate:modelValue":a[16]||=e=>F.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,Ge,y(F.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(y(e(D)(`variableRowEditor.value`))+` `,1),p.editable?(h(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(D)(`variableRowEditor.helpTitle`),onClick:a[17]||=ne(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):x(``,!0)],8,qe),r(e(w),{ref_key:`valueHelp`,ref:un},{default:v(()=>[c(`div`,Ye,[c(`div`,Xe,y(e(D)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(y(e(D)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,y(Kt))]),c(`p`,Qe,y(e(D)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,y(e(D)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(h(!0),l(_,null,u(dn.value,e=>(h(),l(`li`,{key:e.ref},[c(`code`,null,y(e.ref),1),c(`span`,null,y(e.desc),1)]))),128))]),c(`p`,tt,y(e(D)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(h(),l(_,{key:0},[q.value?(h(),l(`div`,nt,[r(e(T),{id:`varrow-value-secret`,modelValue:P.value,"onUpdate:modelValue":a[18]||=e=>P.value=e,type:A.value?`text`:`password`,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(P.value)&&!ce.value?(h(),l(`span`,{key:1,class:`interpolation-badge`,title:P.value,onClick:a[20]||=e=>ce.value=!0},[r(e(E),{severity:`secondary`,value:an(P.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(h(),b(W,{key:2,"input-id":`varrow-value-plain`,modelValue:P.value,"onUpdate:modelValue":a[21]||=e=>P.value=e,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>S(`autocomplete-search`,e),onFocus:a[23]||=e=>ce.value=!0,onBlur:a[24]||=t=>{ce.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:3,id:`varrow-value-plain`,modelValue:P.value,"onUpdate:modelValue":a[26]||=e=>P.value=e,placeholder:e(D)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>ce.value=!0,onBlur:a[28]||=t=>{ce.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(h(),l(`span`,at,[P.value?(h(),l(`span`,ot,[q.value?(h(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>A.value=!A.value},null,2)):x(``,!0),c(`i`,{class:d([M.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>de(`val`,F.value+P.value+I.value)},null,2)])):x(``,!0),rn(P.value)?(h(),b(e(E),{key:1,severity:`secondary`,value:an(P.value)},null,8,[`value`])):q.value?(h(),l(_,{key:2},[A.value?(h(),l(`span`,ct,y(P.value),1)):(h(),l(`span`,st,`***`))],64)):(h(),l(_,{key:3},[i(y(P.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,y(e(D)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-suffix`,modelValue:I.value,"onUpdate:modelValue":a[31]||=e=>I.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>S(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(h(),b(e(T),{key:1,id:`varrow-suffix`,modelValue:I.value,"onUpdate:modelValue":a[35]||=e=>I.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(h(),l(`code`,dt,y(I.value||`—`),1))])]),q.value?x(``,!0):(h(),l(`code`,ft,[F.value?(h(),l(`span`,pt,y(sn(F.value)),1)):x(``,!0),rn(P.value)?(h(),l(`span`,mt,[cn(P.value)==null?(h(),l(_,{key:1},[r(e(E),{severity:`secondary`,value:an(P.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(h(),l(_,{key:0},[c(`span`,ht,y(cn(P.value)),1),p.canEditSource?(h(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(D)(`variablesTable.editParentTitle`),onClick:a[36]||=ne(e=>S(`edit-source`),[`stop`])},null,8,gt)):x(``,!0)],64))])):(h(),l(`span`,_t,y(sn(P.value)||`…`),1)),I.value?(h(),l(`span`,vt,y(sn(I.value)),1)):x(``,!0)]))])):x(``,!0),p.showOverrides&&N.value?.trim()&&p.editable&&!en.value?(h(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addOverride`)),1)])):x(``,!0),p.showOverrides&&N.value?.trim()&&en.value?(h(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(y(e(D)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(D)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(h(),b(e(se),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(D)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):x(``,!0)]),c(`div`,Ct,[p.editable?(h(),l(_,{key:0},[c(`div`,wt,[c(`label`,Tt,y(e(D)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>S(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(D)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},y(e(D)(`variableRowEditor.value`)),9,Dt),q.value?(h(),l(`div`,Ot,[r(e(T),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:j.value?`text`:`password`,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>j.value=!j.value,tabindex:`-1`},[c(`i`,{class:d(j.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!le.value?(h(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>le.value=!0},[r(e(E),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(h(),b(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>S(`autocomplete-search`,e),onFocus:a[47]||=e=>le.value=!0,onBlur:a[48]||=e=>{le.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(D)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>le.value=!0,onBlur:a[52]||=e=>{le.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,y(e(D)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(h(),b(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>S(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(h(),b(e(T),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(D)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(h(),l(`div`,Nt,[J.value?(h(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(h(),l(`i`,{key:0,class:d([j.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>j.value=!j.value},null,2)):x(``,!0),c(`i`,{class:d([M.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>de(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(h(),l(_,{key:0},[j.value?(h(),l(`code`,Lt,y(J.value.pre)+y(J.value.value)+y(J.value.post),1)):(h(),l(`span`,It,`***`))],64)):(h(),l(`code`,Rt,y(J.value.pre)+y(J.value.value)+y(J.value.post),1))])):(h(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(h(),l(`code`,Bt,[Y.value?(h(),l(`span`,Vt,y(sn(Y.value)),1)):x(``,!0),rn(X.value)?(h(),l(`span`,Ht,[cn(X.value)==null?(h(),l(_,{key:1},[r(e(E),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(h(),l(`span`,Ut,y(cn(X.value)),1))])):(h(),l(`span`,Wt,y(sn(X.value)||`…`),1)),Z.value?(h(),l(`span`,Gt,y(sn(Z.value)),1)):x(``,!0)])):x(``,!0)])):x(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=O(m({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:m}){let g=be,S=/^\{\{environment\.([^{}]+)\}\}$/,C=Object.fromEntries(pe.map(e=>[e.name,``])),w=n,O=m,{t:k}=re(),M=ue(),de=f(()=>Object.keys(w.sources).length>0),fe=f(()=>Object.keys(w.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>w.scrollHeight===`auto`?P.value??`460px`:w.scrollHeight);function me(){if(w.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let he=null;ee(()=>{te(me),window.addEventListener(`resize`,me),typeof ResizeObserver<`u`&&N.value&&(he=new ResizeObserver(()=>me()),he.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,me),he?.disconnect(),he=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(w.showOverrides)try{let e=await M.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>M.getById(w.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of M.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(w.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ie(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=w.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=M.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:k(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=M.currentProjectId;if(!r)return;let i=await M.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await M.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,O(`variables-changed`)}catch(e){je.add({severity:`error`,summary:k(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){te(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=ge();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],te(()=>{W.value={[e]:!0},te(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return g.test(e)}function Ye(e){let t=e.match(g);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(S);if(t)return w.resolvedEnv[t[1]]??null;let n=e.match(g);if(n){let e={...C,...w.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(h(),l(_,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(T),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(h(),b(e(oe),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(k)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):x(``,!0),n.showOverrides?(h(),l(`div`,en,[r(e(ce),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,y(e(k)(`variablesTable.overriddenOnly`)),1)])):x(``,!0)]),r(e(le),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:v(()=>[c(`div`,Y,y(n.showAddButton?e(k)(`variablesTable.empty`):e(k)(`variablesTable.emptyReadonly`)),1)]),expansion:v(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(C),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>O(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:v(()=>[r(e(A),{expander:``,style:{width:`2.5rem`}}),r(e(A),{field:`variableId`,header:e(k)(`common.key`)},{body:v(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,y(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(h(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(k)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+y(e(k)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(h(),l(`span`,{key:1,class:`overridden-badge`,title:e(k)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+y(e(k)(`variablesTable.override`)),1)],8,an)):x(``,!0)]),H(t.variableId).length?(h(),l(`span`,on,[(h(!0),l(_,null,u(B(t.variableId)?.tags??[],t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(h(!0),l(_,null,u(Ce(t.variableId),t=>s((h(),b(e(E),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(j),e(k)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):x(``,!0),de.value&&n.sources[t.variableId]?(h(),b(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):x(``,!0),de.value&&n.sources[t.variableId]?.resolvedFrom?(h(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):x(``,!0)])]),_:1},8,[`header`]),r(e(A),{header:e(k)(`common.value`)},{body:v(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(h(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=ne(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(h(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(k)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):x(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(k)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):x(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(h(),l(`span`,dn,[r(e(E),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(h(),l(`span`,fn,`***`)):(h(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},y(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&fe.value&&Xe(B(t.variableId)?.value?.value??``)==null?(h(),l(_,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(E),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(h(),b(e(E),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(h(),l(_,{key:4},[K.value.has(t.variableId)?(h(),l(`code`,{key:1,title:Ae(t.variableId)},y(Ze(Ae(t.variableId))),9,mn)):(h(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(h(),l(`code`,{key:5,title:Ae(t.variableId)},y(Ze(Ae(t.variableId))),9,hn)):(h(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(h(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=ne(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(h(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(k)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):x(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(k)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(h(),l(_,{key:0},[K.value.has(`ovr:`+t.variableId)?(h(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},y(Ze(Ve(t.variableId))),9,xn)):(h(),l(`span`,bn,`***`))],64)):(h(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},y(Ze(Ve(t.variableId))),9,Sn))])):x(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(h(),b(e(se),{key:0,type:`button`,label:e(k)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):x(``,!0)],512),r(e(D),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(k)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:v(()=>[r(e(se),{label:e(k)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(se),{label:e(k)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:v(()=>[Me.value?(h(),l(`div`,Cn,[r(e(ae),{severity:`warn`,class:`parent-edit__warning`},{default:v(()=>[i(y(e(k)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,y(e(k)(`common.value`)),1),r(e(T),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+y(e(k)(`variablesTable.editParentImpact`)),1)]),Fe.value?(h(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,y(e(k)(`variablesTable.editParentLoading`)),1)])):(h(),l(_,{key:1},[Le.value.length?(h(),l(`ul`,kn,[(h(!0),l(_,null,u(Le.value,(t,n)=>(h(),l(`li`,{key:n},[r(e(E),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(k)(`variablesTable.editParentInherits`):e(k)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,y(t.environmentName),1),t.serviceName?(h(),l(`span`,jn,y(t.serviceName),1)):x(``,!0)]))),128))])):(h(),l(`div`,Mn,y(e(k)(`variablesTable.editParentNoUsage`)),1))],64))])])):x(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=M(),r=C(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=fe(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=de(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=ue(),r=M(),i=C(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of pe)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn 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{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-BvrR5qP9.js";import{n as i}from"./project.store-BFwiDQ1X.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-Dd7b9wxV.js";import{n as c}from"./cloud-client-CdOqrdP_.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ 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{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-BQ0mLnfI.js";import{n as i}from"./project.store-CITAykC3.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-w6eNQX1X.js";import{n as c}from"./cloud-client-CEVx-bg6.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
@@ -1 +1 @@
1
- import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-MX5LzgIm.js";import{n}from"./project.store-BFwiDQ1X.js";import{r}from"./cloud-session-Dd7b9wxV.js";function i(){let{user:i,currentAccount:a,loading:o}=r(),s=n(),c=t(),l=e(()=>c.activeOrgId??s.currentProjectOrgId),u=e(()=>!!l.value&&a.value!==null),d=e(()=>u.value?l.value:``),f=e(()=>!!l.value&&!u.value&&o.value),p=e(()=>!!d.value||f.value);return{orgId:d,available:p,unavailability:e(()=>p.value?null:l.value?`not-member`:`local-project`),cloudUser:i}}export{i as t};
1
+ import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-Im5SMon9.js";import{n}from"./project.store-CITAykC3.js";import{r}from"./cloud-session-w6eNQX1X.js";function i(){let{user:i,currentAccount:a,loading:o}=r(),s=n(),c=t(),l=e(()=>c.activeOrgId??s.currentProjectOrgId),u=e(()=>!!l.value&&a.value!==null),d=e(()=>u.value?l.value:``),f=e(()=>!!l.value&&!u.value&&o.value),p=e(()=>!!d.value||f.value);return{orgId:d,available:p,unavailability:e(()=>p.value?null:l.value?`not-member`:`local-project`),cloudUser:i}}export{i as t};
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-BvrR5qP9.js";import{_ as i}from"./dist-C9Qdh18x.js";import{t as a}from"./agent.store-DumNiX1X.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-BQ0mLnfI.js";import{_ as i}from"./dist-C9Qdh18x.js";import{t as a}from"./agent.store-B6OM7edC.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
package/web/index.html CHANGED
@@ -15,49 +15,49 @@
15
15
  content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"
16
16
  />
17
17
  <title>Runeya</title>
18
- <script type="module" crossorigin src="/assets/index-BCU69ZHl.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-mvpLwxNT.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/reactivity.esm-bundler-BQ9SB2vv.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-DujKY9QV.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-CyEVRK6B.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/vue-i18n-o7yraQpR.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-BZ1Pz5am.js">
25
- <link rel="modulepreload" crossorigin href="/assets/auth-Qa1l14iV.js">
26
- <link rel="modulepreload" crossorigin href="/assets/trpc-BvrR5qP9.js">
27
- <link rel="modulepreload" crossorigin href="/assets/project-launch.store-MX5LzgIm.js">
28
- <link rel="modulepreload" crossorigin href="/assets/i18n-DipCGVKv.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/auth-5bsz5kSC.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/trpc-BQ0mLnfI.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/project-launch.store-Im5SMon9.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/i18n-DbgjJIf8.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/useApi-s_02lHjl-DZYO2tHU.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/vue-router-fin80h5W.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-DF3oyfHd.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/src-Ck_MutzB.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/error-DpF7X5iu.js">
34
- <link rel="modulepreload" crossorigin href="/assets/project.store-BFwiDQ1X.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/project.store-CITAykC3.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/use-polling-CEkhIY_9.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/useAiChatDrawer-D_ofn8Eo.js">
37
- <link rel="modulepreload" crossorigin href="/assets/settings-scope-D0hzzuyq.js">
37
+ <link rel="modulepreload" crossorigin href="/assets/settings-scope-vcJEMNnD.js">
38
38
  <link rel="modulepreload" crossorigin href="/assets/schemas-68I2iCLF.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/dist-C9Qdh18x.js">
40
- <link rel="modulepreload" crossorigin href="/assets/service.store-B0Ass90H.js">
41
- <link rel="modulepreload" crossorigin href="/assets/notification.store-D2olEA0V.js">
42
- <link rel="modulepreload" crossorigin href="/assets/scenario.store-C8kW-yTN.js">
40
+ <link rel="modulepreload" crossorigin href="/assets/service.store-CZJuuJiv.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/notification.store-CAG1kWYq.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/scenario.store-C9sSoRzb.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/app-mode-BVpTuh0i.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/cloud-auth-D_am4FlK.js">
45
- <link rel="modulepreload" crossorigin href="/assets/cloud-session-Dd7b9wxV.js">
46
- <link rel="modulepreload" crossorigin href="/assets/cloud-client-CdOqrdP_.js">
47
- <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-DsVvtBzo.js">
45
+ <link rel="modulepreload" crossorigin href="/assets/cloud-session-w6eNQX1X.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/cloud-client-CEVx-bg6.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-CWHpf3Yj.js">
48
48
  <link rel="modulepreload" crossorigin href="/assets/editor.api-Bef3xeth.js">
49
49
  <link rel="modulepreload" crossorigin href="/assets/toggleHighContrast-Dqz1Qao1.js">
50
50
  <link rel="modulepreload" crossorigin href="/assets/register-BLGIM2pN.js">
51
- <link rel="modulepreload" crossorigin href="/assets/agent.store-DumNiX1X.js">
52
- <link rel="modulepreload" crossorigin href="/assets/AiChatModals-BsfKdbEA.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/agent.store-B6OM7edC.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/AiChatModals-BV3vIIqN.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/process-BWkHpZOM.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/theme-BZCAxfJD.js">
55
55
  <link rel="stylesheet" crossorigin href="/assets/src-DOziuDw8.css">
56
56
  <link rel="stylesheet" crossorigin href="/assets/scenario-DOeZsRCE.css">
57
57
  <link rel="stylesheet" crossorigin href="/assets/editor-8AbsNvUX.css">
58
58
  <link rel="stylesheet" crossorigin href="/assets/toggleHighContrast--ixms01u.css">
59
- <link rel="stylesheet" crossorigin href="/assets/AiChatModals-BmWxg-Sr.css">
60
- <link rel="stylesheet" crossorigin href="/assets/index-Ck_3m_I9.css">
59
+ <link rel="stylesheet" crossorigin href="/assets/AiChatModals-DS5R3Oz1.css">
60
+ <link rel="stylesheet" crossorigin href="/assets/index-DB3-fmza.css">
61
61
  </head>
62
62
  <body>
63
63
  <div id="app"></div>