@runeya/runeya 2.0.162 → 2.0.164

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 (75) hide show
  1. package/{chat-PK7AGEMQ.js → chat-CRQCRFX4.js} +3 -3
  2. package/{chunk-7EDWDQDE.js → chunk-3YT6QMXG.js} +9 -4
  3. package/chunk-3YT6QMXG.js.map +1 -0
  4. package/{chunk-MA5PMG6C.js → chunk-AJNBZIYB.js} +25 -6
  5. package/chunk-AJNBZIYB.js.map +1 -0
  6. package/{companion-TZBQ6QS7.js → companion-UEEK5AT6.js} +4 -2
  7. package/index.js +7 -7
  8. package/{install-gate-BLAAYFUO.js → install-gate-Z3YGU4AR.js} +2 -2
  9. package/package.json +1 -1
  10. package/{src-4SDXJP3Q.js → src-C4FJML4T.js} +4 -4
  11. package/web/assets/{AgentScalarChatInterface.vue-BX5S480p.js → AgentScalarChatInterface.vue-QWo7-Jxl.js} +1 -1
  12. package/web/assets/{AgentTerminalPage-De0EaxvA.js → AgentTerminalPage-08QxSf6-.js} +1 -1
  13. package/web/assets/{AiChatModals-CyKK7b_h.js → AiChatModals-B76q5ifT.js} +1 -1
  14. package/web/assets/{AppLayout-ikM5QqkC.js → AppLayout-LPduRihV.js} +1 -1
  15. package/web/assets/{AuditPage-3oCD4TUZ.js → AuditPage-Cv46_-e_.js} +1 -1
  16. package/web/assets/{CloudAccountPage-CsHeTvXQ.js → CloudAccountPage-Yrnl3Su0.js} +1 -1
  17. package/web/assets/{CloudMessagingPage-DA9435xV.js → CloudMessagingPage-DYhiiLOF.js} +1 -1
  18. package/web/assets/{DashboardPage-BFbVcVv0.js → DashboardPage-BcBgo5rb.js} +1 -1
  19. package/web/assets/{DirectoryPickerDialog-CH4wXEur.js → DirectoryPickerDialog-ijyqFhTg.js} +1 -1
  20. package/web/assets/{EnvironmentForm-Yu6nJyMJ.js → EnvironmentForm-B5fHukzl.js} +1 -1
  21. package/web/assets/{EnvironmentFormPage-FvUTEBYT.js → EnvironmentFormPage-Dgt6V5Un.js} +1 -1
  22. package/web/assets/{EnvironmentListPage-V4xV6o3x.js → EnvironmentListPage-B4nAy3KB.js} +1 -1
  23. package/web/assets/{KanbanListPage-BiNd5Df8.js → KanbanListPage-Kj9CbUCi.js} +1 -1
  24. package/web/assets/{KnowledgeListPage-1RDdvtYX.js → KnowledgeListPage-DBZG9C--.js} +1 -1
  25. package/web/assets/{KnowledgePagePage-CPZkPeri.js → KnowledgePagePage-DCN1EwgN.js} +1 -1
  26. package/web/assets/{LaunchProjectPage-DhOAe4db.js → LaunchProjectPage-WMysRPDD.js} +1 -1
  27. package/web/assets/{LaunchServicesPage-Djmzinj9.js → LaunchServicesPage-Xd7Jihvs.js} +1 -1
  28. package/web/assets/{LaunchShell-BaTKGEhy.js → LaunchShell-R6AKAyMq.js} +1 -1
  29. package/web/assets/{LogViewer-BCIuHtXT.js → LogViewer-D9n3aOdg.js} +1 -1
  30. package/web/assets/{OrgKeyPrompt-BwD5A8G-.js → OrgKeyPrompt-DFq7ZSBG.js} +1 -1
  31. package/web/assets/{ProcessControls-_8LXNCLl.js → ProcessControls-By6wvpc2.js} +1 -1
  32. package/web/assets/{ProcessDetailPage-C1N9NR1E.js → ProcessDetailPage-DdJu7opq.js} +1 -1
  33. package/web/assets/{ProjectCreateDialog-CuF9F0XO.js → ProjectCreateDialog-D9hkQuXl.js} +1 -1
  34. package/web/assets/{ProjectLocationGate-BdYQ9_jQ.js → ProjectLocationGate-j9fx_csk.js} +1 -1
  35. package/web/assets/{ProjectPublishDialog-C3_Y9Yq6.js → ProjectPublishDialog-Co7tmQsu.js} +1 -1
  36. package/web/assets/{RandomJobTestPage-Dulqqbhp.js → RandomJobTestPage-CNr-qrE_.js} +1 -1
  37. package/web/assets/{ScenarioEditorPage-xKRrdT2r.js → ScenarioEditorPage-Ol_jB9uJ.js} +1 -1
  38. package/web/assets/{SendToChatDialog-BFzDg5nx.js → SendToChatDialog-BmMFqe1y.js} +1 -1
  39. package/web/assets/{ServiceControlsBar-B_bVSJSA.js → ServiceControlsBar-0M4LI_xh.js} +1 -1
  40. package/web/assets/{ServiceDetailPage-D6M6yhkA.js → ServiceDetailPage-CPjkbNHh.js} +1 -1
  41. package/web/assets/{ServiceFormPage-Bhd-zKw7.js → ServiceFormPage-3gcfVUiv.js} +1 -1
  42. package/web/assets/{SettingsPage-BBvBToaz.js → SettingsPage-v8tyWWXt.js} +3 -3
  43. package/web/assets/{UnlockPage-fWq2Qkqr.js → UnlockPage-BSGn7MXk.js} +1 -1
  44. package/web/assets/{VaultMigrationPage-BzKviST1.js → VaultMigrationPage-BGqRmQ1g.js} +1 -1
  45. package/web/assets/{VersionBadge-DKEn3pmA.js → VersionBadge-BXGxUtXg.js} +1 -1
  46. package/web/assets/{WikiPage-MA4ySDOk.js → WikiPage-BMC56SQ0.js} +1 -1
  47. package/web/assets/{WikiView-Ce0n_6fM.js → WikiView-CkuON8KT.js} +1 -1
  48. package/web/assets/{agent.store-e4Ke2rYW.js → agent.store-Bt63uFbM.js} +1 -1
  49. package/web/assets/{auth-BbkU1I0J.js → auth-DSLAuscT.js} +2 -2
  50. package/web/assets/{cloud-chat.store-B5NxzZQT.js → cloud-chat.store-BO-4sGTf.js} +1 -1
  51. package/web/assets/{cloud-client-DLxxwewI.js → cloud-client-3h4cmNw3.js} +2 -2
  52. package/web/assets/{cloud-session-HfbPoign.js → cloud-session-BJtCFbhi.js} +2 -2
  53. package/web/assets/{i18n-CPWEaCn9.js → i18n-CEwdTH7G.js} +2 -2
  54. package/web/assets/{index-CSsNTonn.css → index-C-fz6wzL.css} +1 -1
  55. package/web/assets/{index-C4Y_dclF.js → index-PhIN2Rcg.js} +4 -4
  56. package/web/assets/{knowledge-host-DZnuTRE_.js → knowledge-host-DqCoFyPt.js} +3 -3
  57. package/web/assets/{notification.store-Co_PM77B.js → notification.store-CZ7UoZzz.js} +1 -1
  58. package/web/assets/{project-launch.store-DtLfJ67k.js → project-launch.store-CeywEJkN.js} +1 -1
  59. package/web/assets/{project.store-CKbzQ5Je.js → project.store-BSWLvx2x.js} +1 -1
  60. package/web/assets/{scenario.store-0bPINumD.js → scenario.store-B5bXLIWL.js} +2 -2
  61. package/web/assets/{service.store-c0eVyOBN.js → service.store-DVul_kXO.js} +1 -1
  62. package/web/assets/{settings-scope-Bq9I7jDm.js → settings-scope-icArEMd1.js} +1 -1
  63. package/web/assets/{settings.store-Cq_bkYmx.js → settings.store-hYsmFyg1.js} +1 -1
  64. package/web/assets/{trpc-DBVmmY7W.js → trpc-CNQXHoRR.js} +3 -3
  65. package/web/assets/{useEnvVarAutocomplete-BfgZTz-t.js → useEnvVarAutocomplete-DozIH2oc.js} +1 -1
  66. package/web/assets/{useProjectCatalog-Bh7IvnoT.js → useProjectCatalog-DfFl4l8b.js} +1 -1
  67. package/web/assets/{useProjectCloudOrg-DHeiqIFT.js → useProjectCloudOrg-BmYLlKxw.js} +1 -1
  68. package/web/assets/{useServiceUrlHost-C9uRvKCY.js → useServiceUrlHost-BPCZHKek.js} +1 -1
  69. package/web/index.html +18 -18
  70. package/chunk-7EDWDQDE.js.map +0 -1
  71. package/chunk-MA5PMG6C.js.map +0 -1
  72. /package/{chat-PK7AGEMQ.js.map → chat-CRQCRFX4.js.map} +0 -0
  73. /package/{companion-TZBQ6QS7.js.map → companion-UEEK5AT6.js.map} +0 -0
  74. /package/{install-gate-BLAAYFUO.js.map → install-gate-Z3YGU4AR.js.map} +0 -0
  75. /package/{src-4SDXJP3Q.js.map → src-C4FJML4T.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-DtLfJ67k.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-B1nAsOcw.js";import{t as ue}from"./uuid-B2pLMyOM.js";import{t as M}from"./src-D_HTzAKM.js";import{n as de,r as fe}from"./project.store-CKbzQ5Je.js";import{h as pe,l as N,t as me,u as P}from"./dist-DWtN-uEL.js";import{t as F}from"./service.store-c0eVyOBN.js";import{t as I}from"./agent.store-e4Ke2rYW.js";import{U as he}from"./index-C4Y_dclF.js";import{t as L}from"./useServiceUrlHost-C9uRvKCY.js";import"./uuid-D2uso58z.js";import{t as ge}from"./FlagChip-DBj0fpJC.js";var R={key:0,class:`env-badge`},z={class:`env-badge__name`},_e=O(m({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(h(),l(`span`,R,[c(`span`,{class:`env-badge__swatch`,style:g({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,z,y(r.value.name),1)])):x(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),B=150,ve=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=``},B)}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`]))}}),ye=/^\{\{([^{}]+)\}\}$/,V=/\{\{([^}]+)\}\}/g,H=`environment.`;function be(e,t){return e.startsWith(H)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function xe(e,t){let n=e.match(ye);return n?be(n[1],t):null}function Se(e,t){return e.replace(V,(e,n)=>be(n,t)??e)}var U={class:`ref-group`},Ce={class:`ref-option`},W={key:0,class:`ti ti-lock ref-option-secret`},we={key:1,class:`ref-option-preview`},Te=40,G=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(ye);return t?t[1].replace(/^environment\./,``):e}function te(e){let t=e.match(ye);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function S(e){let t=e.match(ye);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=be(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?ne(r):null}function ne(e){return e.length>Te?`${e.slice(0,Te)}…`: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`,U,y(e.label),1)]),option:v(({option:t})=>[c(`span`,Ce,[r(e(E),{severity:`secondary`,value:_(t)},null,8,[`value`]),te(t)?(h(),l(`i`,W)):S(t)?(h(),l(`span`,we,y(S(t)),1)):x(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function Ee(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=fe(),ae=ie(),{t:D}=re(),oe=t(!1),O=t(!1),ce=t(!1),le=t(!1),A=t(!1),j=t(!1),ue=t(null);function de(e,t){navigator.clipboard.writeText(t),ue.value=e,setTimeout(()=>{ue.value===e&&(ue.value=null)},1500)}let pe=f(()=>C.getById(g.environmentId)?.variables?.[g.variableId]),N=t(``),P=t(``),F=t(``),I=t(``),L=t(!1),R=t(!1),z=t(!1),_e=t(!1),B=t(!1),V=t(``),H=t([]),be=t(!1),U=t(!1),Ce=t(!1),W=f(()=>be.value||!!V.value),we=o(`descriptionEditor`);async function Te(){be.value=!0,await te(),we.value?.focus?.()}let qt=f(()=>rn(P.value)),q=f(()=>L.value&&!qt.value),Jt=f({get:()=>R.value||z.value,set:e=>{R.value=e}}),Yt=f(()=>z.value?D(`variableRowEditor.shareWithAiHintInjected`):q.value?D(`variableRowEditor.shareWithAiHint`):D(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>g.disabled||B.value);function Zt(){let e=pe.value;N.value=e?.key??``,P.value=e?.value?.value??``,F.value=e?.value?.pre??``,I.value=e?.value?.post??``,L.value=e?.value?.isSecret??!1,R.value=e?.value?.shareWithAi??!1,z.value=e?.value?.injectIntoAi??!1,_e.value=e?.value?.required??!1,B.value=e?.value?.overrideOnly??!1,be.value=!1,U.value=!1,Ce.value=!1,V.value=e?.value?.description??``,H.value=[...e?.tags??[]]}function Qt(){B.value&&(P.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>g.overrides[g.variableId]??null),$t=f(()=>!J.value||U.value),en=f(()=>!g.editable||!!J.value||B.value||Ce.value);async function tn(){Ce.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 ye.test(e)}function an(e){let t=e.match(ye);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:g.resolvedEnv,serviceBuiltins:g.serviceBuiltins}));function sn(e){return Se(e,on.value)}function cn(e){return xe(e,on.value)}function ln(e){let t=e.value;N.value=t,P.value=`{{environment.${t}}}`,L.value=!1;let n=g.autocompleteMeta?.[t];n&&(F.value=n.pre,I.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:D(`builtins.${e.descriptionKey}`)}))),Q=Ee(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,...H.value.length?{tags:H.value}:{},value:{value:P.value,pre:F.value,post:I.value,isSecret:q.value,shareWithAi:R.value,injectIntoAi:z.value,required:_e.value,overrideOnly:B.value,description:V.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(ge,{key:0,modelValue:L.value,"onUpdate:modelValue":[a[3]||=e=>L.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(ge,{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:z.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(ge,{modelValue:z.value,"onUpdate:modelValue":[a[5]||=e=>z.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(ge,{modelValue:_e.value,"onUpdate:modelValue":[a[6]||=e=>_e.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(ge,{modelValue:B.value,"onUpdate:modelValue":[a[7]||=e=>B.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||H.value.length?(h(),l(`div`,Me,[c(`label`,Ne,y(e(D)(`variableRowEditor.tags`)),1),p.editable?(h(),b(ve,{key:0,modelValue:H.value,"onUpdate:modelValue":a[8]||=e=>H.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(H.value,t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):x(``,!0),p.editable&&!L.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&&!W.value?(h(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Te},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addDescription`)),1)])):x(``,!0),W.value?(h(),l(`div`,Ie,[c(`label`,Le,y(e(D)(`variableRowEditor.description`)),1),r(e(M),{ref_key:`descriptionEditor`,ref:we,modelValue:V.value,"onUpdate:modelValue":a[9]||=e=>V.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(D)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):x(``,!0),p.editable&&B.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=>U.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=>U.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(G,{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(G,{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([ue.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(G,{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(G,{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(G,{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(G,{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([ue.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=ye,S=/^\{\{environment\.([^{}]+)\}\}$/,C=Object.fromEntries(me.map(e=>[e.name,``])),w=n,O=m,{t:k}=re(),M=fe(),de=f(()=>Object.keys(w.sources).length>0),pe=f(()=>Object.keys(w.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>w.scrollHeight===`auto`?P.value??`460px`:w.scrollHeight);function I(){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(I),window.addEventListener(`resize`,I),typeof ResizeObserver<`u`&&N.value&&(he=new ResizeObserver(()=>I()),he.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,I),he?.disconnect(),he=null});let L=t(``),ge=t(!1),R=t([]),z=t({});async function B(){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}}z.value=t}catch{}}ee(B);let ve=f(()=>M.getById(w.environmentId));function V(e){return ve.value?.variables?.[e]}let H=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))}),be=f(()=>{let e={...xe.value};for(let t of Object.values(ve.value?.variables??{}))e[t.key]=t.tags??[];return e}),xe=f(()=>{let e=ve.value?.variables??{},t={};for(let[n,r]of Object.entries(w.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Se(e){let t=V(e);if(!t)return[];let n=z.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...be.value,[t.key]:xe.value[t.key]??[]},t.tags??[])}function U(e){return[...V(e)?.tags??[],...Se(e)]}let Ce=f(()=>{let e=new Set;for(let t of Object.keys(ve.value?.variables??{}))for(let n of U(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(Ce,e=>{R.value=J(R.value,e)});let W=t([]),we=f(()=>{let e=Object.keys(ve.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=W.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Te=o(`tableRef`),G=t({}),Ee=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=V(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=V(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=z.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...we.value];if(ge.value&&(e=e.filter(e=>!!z.value[e.variableId])),R.value.length&&(e=e.filter(e=>W.value.includes(e.variableId)||Yt(U(e.variableId),R.value))),L.value.trim()){let t=L.value.toLowerCase();e=e.filter(e=>{let n=V(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||U(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=z.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(Ee.value.length>0)e.sort((e,t)=>{let n=Ee.value.indexOf(e.variableId),r=Ee.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:V(e)?.key??``,tags:U(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;G.value[t]?(G.value={},Ee.value=[],We(t)):(Ee.value=He.value.map(e=>e.variableId),G.value={[t]:!0})}function We(e){te(()=>{let t=Te.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){W.value=W.value.filter(t=>t!==e),G.value[e]&&(G.value={},Ee.value=[])}function Ke(e){W.value=W.value.filter(t=>t!==e)}function qe(){let e=ue();W.value=[...W.value,e],Ee.value=[...we.value.map(e=>e.variableId),e],te(()=>{G.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:L.value,"onUpdate:modelValue":a[0]||=e=>L.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),Ce.value.length?(h(),b(e(oe),{key:0,modelValue:R.value,"onUpdate:modelValue":a[1]||=e=>R.value=e,options:Ce.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:ge.value,"onUpdate:modelValue":a[2]||=e=>ge.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:Te,"expanded-rows":G.value,"onUpdate:expandedRows":a[6]||=e=>G.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:z.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":W.value.includes(t.variableId),"known-tags":H.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>O(`autocomplete-search`,e),onOverrideChanged:B,"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(V(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(V(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)]),U(t.variableId).length?(h(),l(`span`,on,[(h(!0),l(_,null,u(V(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(Se(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(_e,{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(_e,{"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`])},[V(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(V(t.variableId)?.value?.value??``)&&Xe(V(t.variableId)?.value?.value??``)!=null?(h(),l(`span`,dn,[r(e(E),{severity:`secondary`,value:Ye(V(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[V(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(h(),l(`span`,fn,`***`)):(h(),l(`code`,{key:1,class:`resolved-final`,title:Xe(V(t.variableId)?.value?.value??``)},y(Ze(Xe(V(t.variableId)?.value?.value??``))),9,$))])])):Je(V(t.variableId)?.value?.value??``)&&pe.value&&Xe(V(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(V(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(V(t.variableId)?.value?.value??``)?(h(),b(e(E),{key:3,severity:`secondary`,value:Ye(V(t.variableId)?.value?.value??``)},null,8,[`value`])):V(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)):V(t.variableId)?.value?.value||V(t.variableId)?.value?.pre||V(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(V(t.variableId)?.value?.value??``)&&z.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`])},[V(t.variableId)?.value?.isSecret||z.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)]),V(t.variableId)?.value?.isSecret||z.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=de(),r=C(),i=F(),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=N(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,P({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=I(),n=fe(),r=de(),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}=L(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)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{_e as a,ve 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-CeywEJkN.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-B1nAsOcw.js";import{t as ue}from"./uuid-B2pLMyOM.js";import{t as M}from"./src-D_HTzAKM.js";import{n as de,r as fe}from"./project.store-BSWLvx2x.js";import{h as pe,l as N,t as me,u as P}from"./dist-DWtN-uEL.js";import{t as F}from"./service.store-DVul_kXO.js";import{t as I}from"./agent.store-Bt63uFbM.js";import{U as he}from"./index-PhIN2Rcg.js";import{t as L}from"./useServiceUrlHost-BPCZHKek.js";import"./uuid-D2uso58z.js";import{t as ge}from"./FlagChip-DBj0fpJC.js";var R={key:0,class:`env-badge`},z={class:`env-badge__name`},_e=O(m({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(h(),l(`span`,R,[c(`span`,{class:`env-badge__swatch`,style:g({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,z,y(r.value.name),1)])):x(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),B=150,ve=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=``},B)}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`]))}}),ye=/^\{\{([^{}]+)\}\}$/,V=/\{\{([^}]+)\}\}/g,H=`environment.`;function be(e,t){return e.startsWith(H)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function xe(e,t){let n=e.match(ye);return n?be(n[1],t):null}function Se(e,t){return e.replace(V,(e,n)=>be(n,t)??e)}var U={class:`ref-group`},Ce={class:`ref-option`},W={key:0,class:`ti ti-lock ref-option-secret`},we={key:1,class:`ref-option-preview`},Te=40,G=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(ye);return t?t[1].replace(/^environment\./,``):e}function te(e){let t=e.match(ye);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function S(e){let t=e.match(ye);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=be(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?ne(r):null}function ne(e){return e.length>Te?`${e.slice(0,Te)}…`: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`,U,y(e.label),1)]),option:v(({option:t})=>[c(`span`,Ce,[r(e(E),{severity:`secondary`,value:_(t)},null,8,[`value`]),te(t)?(h(),l(`i`,W)):S(t)?(h(),l(`span`,we,y(S(t)),1)):x(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function Ee(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=fe(),ae=ie(),{t:D}=re(),oe=t(!1),O=t(!1),ce=t(!1),le=t(!1),A=t(!1),j=t(!1),ue=t(null);function de(e,t){navigator.clipboard.writeText(t),ue.value=e,setTimeout(()=>{ue.value===e&&(ue.value=null)},1500)}let pe=f(()=>C.getById(g.environmentId)?.variables?.[g.variableId]),N=t(``),P=t(``),F=t(``),I=t(``),L=t(!1),R=t(!1),z=t(!1),_e=t(!1),B=t(!1),V=t(``),H=t([]),be=t(!1),U=t(!1),Ce=t(!1),W=f(()=>be.value||!!V.value),we=o(`descriptionEditor`);async function Te(){be.value=!0,await te(),we.value?.focus?.()}let qt=f(()=>rn(P.value)),q=f(()=>L.value&&!qt.value),Jt=f({get:()=>R.value||z.value,set:e=>{R.value=e}}),Yt=f(()=>z.value?D(`variableRowEditor.shareWithAiHintInjected`):q.value?D(`variableRowEditor.shareWithAiHint`):D(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>g.disabled||B.value);function Zt(){let e=pe.value;N.value=e?.key??``,P.value=e?.value?.value??``,F.value=e?.value?.pre??``,I.value=e?.value?.post??``,L.value=e?.value?.isSecret??!1,R.value=e?.value?.shareWithAi??!1,z.value=e?.value?.injectIntoAi??!1,_e.value=e?.value?.required??!1,B.value=e?.value?.overrideOnly??!1,be.value=!1,U.value=!1,Ce.value=!1,V.value=e?.value?.description??``,H.value=[...e?.tags??[]]}function Qt(){B.value&&(P.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>g.overrides[g.variableId]??null),$t=f(()=>!J.value||U.value),en=f(()=>!g.editable||!!J.value||B.value||Ce.value);async function tn(){Ce.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 ye.test(e)}function an(e){let t=e.match(ye);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:g.resolvedEnv,serviceBuiltins:g.serviceBuiltins}));function sn(e){return Se(e,on.value)}function cn(e){return xe(e,on.value)}function ln(e){let t=e.value;N.value=t,P.value=`{{environment.${t}}}`,L.value=!1;let n=g.autocompleteMeta?.[t];n&&(F.value=n.pre,I.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:D(`builtins.${e.descriptionKey}`)}))),Q=Ee(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,...H.value.length?{tags:H.value}:{},value:{value:P.value,pre:F.value,post:I.value,isSecret:q.value,shareWithAi:R.value,injectIntoAi:z.value,required:_e.value,overrideOnly:B.value,description:V.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(ge,{key:0,modelValue:L.value,"onUpdate:modelValue":[a[3]||=e=>L.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(ge,{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:z.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(ge,{modelValue:z.value,"onUpdate:modelValue":[a[5]||=e=>z.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(ge,{modelValue:_e.value,"onUpdate:modelValue":[a[6]||=e=>_e.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(ge,{modelValue:B.value,"onUpdate:modelValue":[a[7]||=e=>B.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||H.value.length?(h(),l(`div`,Me,[c(`label`,Ne,y(e(D)(`variableRowEditor.tags`)),1),p.editable?(h(),b(ve,{key:0,modelValue:H.value,"onUpdate:modelValue":a[8]||=e=>H.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(H.value,t=>(h(),b(e(E),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):x(``,!0),p.editable&&!L.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&&!W.value?(h(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Te},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,y(e(D)(`variableRowEditor.addDescription`)),1)])):x(``,!0),W.value?(h(),l(`div`,Ie,[c(`label`,Le,y(e(D)(`variableRowEditor.description`)),1),r(e(M),{ref_key:`descriptionEditor`,ref:we,modelValue:V.value,"onUpdate:modelValue":a[9]||=e=>V.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(D)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):x(``,!0),p.editable&&B.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=>U.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=>U.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(G,{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(G,{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([ue.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(G,{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(G,{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(G,{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(G,{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([ue.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=ye,S=/^\{\{environment\.([^{}]+)\}\}$/,C=Object.fromEntries(me.map(e=>[e.name,``])),w=n,O=m,{t:k}=re(),M=fe(),de=f(()=>Object.keys(w.sources).length>0),pe=f(()=>Object.keys(w.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>w.scrollHeight===`auto`?P.value??`460px`:w.scrollHeight);function I(){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(I),window.addEventListener(`resize`,I),typeof ResizeObserver<`u`&&N.value&&(he=new ResizeObserver(()=>I()),he.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,I),he?.disconnect(),he=null});let L=t(``),ge=t(!1),R=t([]),z=t({});async function B(){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}}z.value=t}catch{}}ee(B);let ve=f(()=>M.getById(w.environmentId));function V(e){return ve.value?.variables?.[e]}let H=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))}),be=f(()=>{let e={...xe.value};for(let t of Object.values(ve.value?.variables??{}))e[t.key]=t.tags??[];return e}),xe=f(()=>{let e=ve.value?.variables??{},t={};for(let[n,r]of Object.entries(w.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Se(e){let t=V(e);if(!t)return[];let n=z.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...be.value,[t.key]:xe.value[t.key]??[]},t.tags??[])}function U(e){return[...V(e)?.tags??[],...Se(e)]}let Ce=f(()=>{let e=new Set;for(let t of Object.keys(ve.value?.variables??{}))for(let n of U(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(Ce,e=>{R.value=J(R.value,e)});let W=t([]),we=f(()=>{let e=Object.keys(ve.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=W.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Te=o(`tableRef`),G=t({}),Ee=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=V(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=V(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=z.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...we.value];if(ge.value&&(e=e.filter(e=>!!z.value[e.variableId])),R.value.length&&(e=e.filter(e=>W.value.includes(e.variableId)||Yt(U(e.variableId),R.value))),L.value.trim()){let t=L.value.toLowerCase();e=e.filter(e=>{let n=V(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||U(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=z.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(Ee.value.length>0)e.sort((e,t)=>{let n=Ee.value.indexOf(e.variableId),r=Ee.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:V(e)?.key??``,tags:U(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;G.value[t]?(G.value={},Ee.value=[],We(t)):(Ee.value=He.value.map(e=>e.variableId),G.value={[t]:!0})}function We(e){te(()=>{let t=Te.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){W.value=W.value.filter(t=>t!==e),G.value[e]&&(G.value={},Ee.value=[])}function Ke(e){W.value=W.value.filter(t=>t!==e)}function qe(){let e=ue();W.value=[...W.value,e],Ee.value=[...we.value.map(e=>e.variableId),e],te(()=>{G.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:L.value,"onUpdate:modelValue":a[0]||=e=>L.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),Ce.value.length?(h(),b(e(oe),{key:0,modelValue:R.value,"onUpdate:modelValue":a[1]||=e=>R.value=e,options:Ce.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:ge.value,"onUpdate:modelValue":a[2]||=e=>ge.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:Te,"expanded-rows":G.value,"onUpdate:expandedRows":a[6]||=e=>G.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:z.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":W.value.includes(t.variableId),"known-tags":H.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>O(`autocomplete-search`,e),onOverrideChanged:B,"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(V(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(V(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)]),U(t.variableId).length?(h(),l(`span`,on,[(h(!0),l(_,null,u(V(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(Se(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(_e,{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(_e,{"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`])},[V(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(V(t.variableId)?.value?.value??``)&&Xe(V(t.variableId)?.value?.value??``)!=null?(h(),l(`span`,dn,[r(e(E),{severity:`secondary`,value:Ye(V(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[V(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(h(),l(`span`,fn,`***`)):(h(),l(`code`,{key:1,class:`resolved-final`,title:Xe(V(t.variableId)?.value?.value??``)},y(Ze(Xe(V(t.variableId)?.value?.value??``))),9,$))])])):Je(V(t.variableId)?.value?.value??``)&&pe.value&&Xe(V(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(V(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(V(t.variableId)?.value?.value??``)?(h(),b(e(E),{key:3,severity:`secondary`,value:Ye(V(t.variableId)?.value?.value??``)},null,8,[`value`])):V(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)):V(t.variableId)?.value?.value||V(t.variableId)?.value?.pre||V(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(V(t.variableId)?.value?.value??``)&&z.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`])},[V(t.variableId)?.value?.isSecret||z.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)]),V(t.variableId)?.value?.isSecret||z.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=de(),r=C(),i=F(),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=N(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,P({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=I(),n=fe(),r=de(),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}=L(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)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{_e as a,ve 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-DBVmmY7W.js";import{n as i}from"./project.store-CKbzQ5Je.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-HfbPoign.js";import{n as c}from"./cloud-client-DLxxwewI.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-CNQXHoRR.js";import{n as i}from"./project.store-BSWLvx2x.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-BJtCFbhi.js";import{n as c}from"./cloud-client-3h4cmNw3.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-DtLfJ67k.js";import{n}from"./project.store-CKbzQ5Je.js";import{t as r}from"./open-project-org-BNDadG2_.js";import{r as i}from"./cloud-session-HfbPoign.js";function a(){let{user:a,currentAccount:o,loading:s,accountPending:c}=i(),l=n(),u=t(),d=e(()=>r(u,l)),f=e(()=>!!d.value&&o.value!==null),p=e(()=>f.value?d.value:``),m=e(()=>!!d.value&&!f.value&&(s.value||c.value)),h=e(()=>!!p.value||m.value);return{orgId:p,available:h,unavailability:e(()=>h.value?null:d.value?`not-member`:`local-project`),cloudUser:a}}export{a as t};
1
+ import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-CeywEJkN.js";import{n}from"./project.store-BSWLvx2x.js";import{t as r}from"./open-project-org-BNDadG2_.js";import{r as i}from"./cloud-session-BJtCFbhi.js";function a(){let{user:a,currentAccount:o,loading:s,accountPending:c}=i(),l=n(),u=t(),d=e(()=>r(u,l)),f=e(()=>!!d.value&&o.value!==null),p=e(()=>f.value?d.value:``),m=e(()=>!!d.value&&!f.value&&(s.value||c.value)),h=e(()=>!!p.value||m.value);return{orgId:p,available:h,unavailability:e(()=>h.value?null:d.value?`not-member`:`local-project`),cloudUser:a}}export{a 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-DBVmmY7W.js";import{_ as i}from"./dist-DWtN-uEL.js";import{t as a}from"./agent.store-e4Ke2rYW.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-CNQXHoRR.js";import{_ as i}from"./dist-DWtN-uEL.js";import{t as a}from"./agent.store-Bt63uFbM.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,50 +15,50 @@
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-C4Y_dclF.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-PhIN2Rcg.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-BbkU1I0J.js">
26
- <link rel="modulepreload" crossorigin href="/assets/trpc-DBVmmY7W.js">
27
- <link rel="modulepreload" crossorigin href="/assets/project-launch.store-DtLfJ67k.js">
28
- <link rel="modulepreload" crossorigin href="/assets/i18n-CPWEaCn9.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/auth-DSLAuscT.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/trpc-CNQXHoRR.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/project-launch.store-CeywEJkN.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/i18n-CEwdTH7G.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/useApi-s_02lHjl-DZYO2tHU.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/devtools-DCoWQoU_-D2vs4YXr.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/vue-router--yRg_Dd_.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-DF3oyfHd.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/src-B1nAsOcw.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/error-DpF7X5iu.js">
35
- <link rel="modulepreload" crossorigin href="/assets/project.store-CKbzQ5Je.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/project.store-BSWLvx2x.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/use-polling-CEkhIY_9.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/useAiChatDrawer-D_ofn8Eo.js">
38
- <link rel="modulepreload" crossorigin href="/assets/settings-scope-Bq9I7jDm.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/settings-scope-icArEMd1.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/schemas-68I2iCLF.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/dist-DWtN-uEL.js">
41
- <link rel="modulepreload" crossorigin href="/assets/service.store-c0eVyOBN.js">
42
- <link rel="modulepreload" crossorigin href="/assets/notification.store-Co_PM77B.js">
43
- <link rel="modulepreload" crossorigin href="/assets/scenario.store-0bPINumD.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/service.store-DVul_kXO.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/notification.store-CZ7UoZzz.js">
43
+ <link rel="modulepreload" crossorigin href="/assets/scenario.store-B5bXLIWL.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/app-mode-BVpTuh0i.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/w3c-keyname-BOAvb0qz.js">
46
46
  <link rel="modulepreload" crossorigin href="/assets/src-D_HTzAKM.js">
47
47
  <link rel="modulepreload" crossorigin href="/assets/cloud-auth-D_am4FlK.js">
48
48
  <link rel="modulepreload" crossorigin href="/assets/open-project-org-BNDadG2_.js">
49
- <link rel="modulepreload" crossorigin href="/assets/cloud-session-HfbPoign.js">
50
- <link rel="modulepreload" crossorigin href="/assets/cloud-client-DLxxwewI.js">
51
- <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-Bh7IvnoT.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/cloud-session-BJtCFbhi.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/cloud-client-3h4cmNw3.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-DfFl4l8b.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/uuid-B2pLMyOM.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/src-C1pDBhwJ.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/editor.api-Bef3xeth.js">
55
55
  <link rel="modulepreload" crossorigin href="/assets/toggleHighContrast-Dqz1Qao1.js">
56
56
  <link rel="modulepreload" crossorigin href="/assets/register-BLGIM2pN.js">
57
- <link rel="modulepreload" crossorigin href="/assets/agent.store-e4Ke2rYW.js">
58
- <link rel="modulepreload" crossorigin href="/assets/AiChatModals-CyKK7b_h.js">
59
- <link rel="modulepreload" crossorigin href="/assets/useProjectCloudOrg-DHeiqIFT.js">
57
+ <link rel="modulepreload" crossorigin href="/assets/agent.store-Bt63uFbM.js">
58
+ <link rel="modulepreload" crossorigin href="/assets/AiChatModals-B76q5ifT.js">
59
+ <link rel="modulepreload" crossorigin href="/assets/useProjectCloudOrg-BmYLlKxw.js">
60
60
  <link rel="modulepreload" crossorigin href="/assets/src-DwxqtlGt.js">
61
- <link rel="modulepreload" crossorigin href="/assets/SendToChatDialog-BFzDg5nx.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/SendToChatDialog-BmMFqe1y.js">
62
62
  <link rel="modulepreload" crossorigin href="/assets/process-C53v1rNU.js">
63
63
  <link rel="modulepreload" crossorigin href="/assets/theme-BZCAxfJD.js">
64
64
  <link rel="stylesheet" crossorigin href="/assets/src-BR35jQnn.css">
@@ -69,7 +69,7 @@
69
69
  <link rel="stylesheet" crossorigin href="/assets/toggleHighContrast--ixms01u.css">
70
70
  <link rel="stylesheet" crossorigin href="/assets/AiChatModals-DS5R3Oz1.css">
71
71
  <link rel="stylesheet" crossorigin href="/assets/src-dOj6pCsH.css">
72
- <link rel="stylesheet" crossorigin href="/assets/index-CSsNTonn.css">
72
+ <link rel="stylesheet" crossorigin href="/assets/index-C-fz6wzL.css">
73
73
  </head>
74
74
  <body>
75
75
  <div id="app"></div>