@intent-hq/web 2.341.1 → 2.341.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BWJDe8j7.js → 2T1-hN6X.js} +1 -1
  3. package/web/app/immutable/chunks/{BIPzkS2w.js → 54JK2dhu.js} +1 -1
  4. package/web/app/immutable/chunks/{lttzdtAd.js → 76adCxuK.js} +1 -1
  5. package/web/app/immutable/chunks/{Bjar6XLk.js → B-hHJECm.js} +1 -1
  6. package/web/app/immutable/chunks/{6zbXr_io.js → B-tsz9_7.js} +1 -1
  7. package/web/app/immutable/chunks/{r6BQ8kUW.js → B25ZGiq_.js} +1 -1
  8. package/web/app/immutable/chunks/{MfgLK08j.js → B2xn6k89.js} +1 -1
  9. package/web/app/immutable/chunks/{BkYxjZBQ.js → B47VX2Iz.js} +1 -1
  10. package/web/app/immutable/chunks/{DBQ6sG-N.js → B9iMH0o9.js} +1 -1
  11. package/web/app/immutable/chunks/{DD7CIwZr.js → BBY8ZkRW.js} +1 -1
  12. package/web/app/immutable/chunks/{DiYuqE5C.js → BCcHqi29.js} +3 -3
  13. package/web/app/immutable/chunks/{EfHzTgiE.js → BCjE6qea.js} +1 -1
  14. package/web/app/immutable/chunks/{bnlzpH0C.js → BCrxos2w.js} +1 -1
  15. package/web/app/immutable/chunks/{CSvoOaiI.js → BHBZ-FuT.js} +1 -1
  16. package/web/app/immutable/chunks/{T5dXiqec.js → BMlXfa1V.js} +1 -1
  17. package/web/app/immutable/chunks/{Fvq5uW61.js → BQxXUVuI.js} +1 -1
  18. package/web/app/immutable/chunks/{OuBvt1Dn.js → BRxxsIiu.js} +1 -1
  19. package/web/app/immutable/chunks/{7_ObPjVE.js → BSkLIrxe.js} +1 -1
  20. package/web/app/immutable/chunks/{CqlFtspL.js → BXYZt_z7.js} +1 -1
  21. package/web/app/immutable/chunks/{Deqxq6ha.js → B_l8hqmB.js} +1 -1
  22. package/web/app/immutable/chunks/{C2E3PLRc.js → B_qM2KXq.js} +1 -1
  23. package/web/app/immutable/chunks/{xCO9YQv5.js → Ba30yw2z.js} +1 -1
  24. package/web/app/immutable/chunks/{CGy2WPjn.js → BbjrS_gZ.js} +2 -2
  25. package/web/app/immutable/chunks/{CR6ZEzLI.js → BcFi6_4b.js} +1 -1
  26. package/web/app/immutable/chunks/{5yPZRZCV.js → Be14EhuN.js} +2 -2
  27. package/web/app/immutable/chunks/{BGhDRH6N.js → BeGaLSif.js} +1 -1
  28. package/web/app/immutable/chunks/{D9MlL8EE.js → Bm8ue3vD.js} +1 -1
  29. package/web/app/immutable/chunks/{CJER3CRY.js → BmrtciWO.js} +4 -4
  30. package/web/app/immutable/chunks/{CgEYFTw0.js → BnMslkdQ.js} +1 -1
  31. package/web/app/immutable/chunks/{LMfwm5GA.js → BsKnk4mK.js} +1 -1
  32. package/web/app/immutable/chunks/{BREnKX07.js → BurWh7sU.js} +1 -1
  33. package/web/app/immutable/chunks/{B5NUCtAB.js → BwH7MvyM.js} +1 -1
  34. package/web/app/immutable/chunks/{D7N7IHMl.js → Byu0LAJ9.js} +1 -1
  35. package/web/app/immutable/chunks/{CNaYNOfE.js → C0RyaDkI.js} +4 -4
  36. package/web/app/immutable/chunks/{lI90GCpH.js → C2g2bI5I.js} +1 -1
  37. package/web/app/immutable/chunks/{DAbJJ8Qj.js → C4b5bStH.js} +1 -1
  38. package/web/app/immutable/chunks/{dV6zU05r.js → C51fkH3h.js} +1 -1
  39. package/web/app/immutable/chunks/{uowR4Emm.js → C5Adi8IR.js} +2 -2
  40. package/web/app/immutable/chunks/{B8IG1OPH.js → CAz7XTKT.js} +1 -1
  41. package/web/app/immutable/chunks/{CdRr34Ch.js → CCaL_IJk.js} +1 -1
  42. package/web/app/immutable/chunks/{Dci3uR78.js → CDiEfEmo.js} +4 -4
  43. package/web/app/immutable/chunks/{B5MLgCrX.js → CEHZunWB.js} +1 -1
  44. package/web/app/immutable/chunks/{CccM2Igh.js → CFWmH1IG.js} +2 -2
  45. package/web/app/immutable/chunks/{DvcprnFO.js → CFbBmrwX.js} +1 -1
  46. package/web/app/immutable/chunks/{CW_delv_.js → CFxIvfBO.js} +1 -1
  47. package/web/app/immutable/chunks/{BXCSmyo3.js → CIMn79Wy.js} +1 -1
  48. package/web/app/immutable/chunks/{DeLswjKZ.js → CIftGvP3.js} +1 -1
  49. package/web/app/immutable/chunks/{DMoEVjOP.js → CJeE1pqF.js} +1 -1
  50. package/web/app/immutable/chunks/{K_GlKbLA.js → CNLEkESE.js} +1 -1
  51. package/web/app/immutable/chunks/{8NIig13l.js → CNt46_Sl.js} +4 -4
  52. package/web/app/immutable/chunks/{C8jV_1kH.js → CQV_RN2j.js} +1 -1
  53. package/web/app/immutable/chunks/{DHuOtKKG.js → CQZewidW.js} +1 -1
  54. package/web/app/immutable/chunks/{YEOg1jH9.js → CQqORW76.js} +1 -1
  55. package/web/app/immutable/chunks/{C0I9IFl7.js → CXC1Kqgk.js} +1 -1
  56. package/web/app/immutable/chunks/{BE3wyntg.js → CaGPXrgT.js} +1 -1
  57. package/web/app/immutable/chunks/{F0n5o6xT.js → CaMTqbZT.js} +1 -1
  58. package/web/app/immutable/chunks/{DXfvYvEU.js → CdP89xtd.js} +3 -3
  59. package/web/app/immutable/chunks/{iLL2N6eh.js → CjKSn5xs.js} +1 -1
  60. package/web/app/immutable/chunks/{BLu2Qjcz.js → CksGbYpD.js} +1 -1
  61. package/web/app/immutable/chunks/{DBOfY2BB.js → CmNcEfpC.js} +1 -1
  62. package/web/app/immutable/chunks/{usONbtdT.js → CpdAcB0D.js} +1 -1
  63. package/web/app/immutable/chunks/{CN5NPyij.js → CqIbZaud.js} +12 -12
  64. package/web/app/immutable/chunks/{v_6l3PxL.js → CsB5fvC6.js} +1 -1
  65. package/web/app/immutable/chunks/{CU_igNrp.js → CsC_AG5b.js} +1 -1
  66. package/web/app/immutable/chunks/{DMUjpYuS.js → CvF0K_Ij.js} +2 -2
  67. package/web/app/immutable/chunks/{BVpTbT83.js → D-uXrjxi.js} +1 -1
  68. package/web/app/immutable/chunks/{BLm6M8a7.js → D19pVBSM.js} +1 -1
  69. package/web/app/immutable/chunks/{jbubRayo.js → D5smEMy9.js} +1 -1
  70. package/web/app/immutable/chunks/{CSHEsMmc.js → D6G81XFr.js} +1 -1
  71. package/web/app/immutable/chunks/{CD2HYrCH.js → D6Mh_gko.js} +2 -2
  72. package/web/app/immutable/chunks/{DfkAksH6.js → D6zRpkz7.js} +1 -1
  73. package/web/app/immutable/chunks/{RqvE5pv9.js → D89PDrKh.js} +1 -1
  74. package/web/app/immutable/chunks/{Byde94fq.js → D8rhNp1j.js} +1 -1
  75. package/web/app/immutable/chunks/{CJE64TCE.js → DE54-T81.js} +1 -1
  76. package/web/app/immutable/chunks/{BG9XZ9or.js → DEDP3IGZ.js} +1 -1
  77. package/web/app/immutable/chunks/{CLgmUgBt.js → DF4C0Dva.js} +1 -1
  78. package/web/app/immutable/chunks/{CUME4y3G.js → DH8Uc9s3.js} +1 -1
  79. package/web/app/immutable/chunks/{B9e3ZGxo.js → DJifjb7s.js} +1 -1
  80. package/web/app/immutable/chunks/{CNMeJ__-.js → DLBfhzR4.js} +1 -1
  81. package/web/app/immutable/chunks/{C3vxynMw.js → DLuy_DUP.js} +3 -3
  82. package/web/app/immutable/chunks/{qRPKZipv.js → DMXRduRh.js} +2 -2
  83. package/web/app/immutable/chunks/{CLjbCWr-.js → DMjUT-kd.js} +1 -1
  84. package/web/app/immutable/chunks/{CErUs68q.js → DO9IuOvj.js} +1 -1
  85. package/web/app/immutable/chunks/{DsudoUwx.js → DQtBgy-t.js} +1 -1
  86. package/web/app/immutable/chunks/{DJz5fNHR.js → DSHD3GC1.js} +1 -1
  87. package/web/app/immutable/chunks/{BPpJ5XOM.js → DUPPDYfv.js} +1 -1
  88. package/web/app/immutable/chunks/{DFq5nrYO.js → DXDxXMKV.js} +1 -1
  89. package/web/app/immutable/chunks/{BaF_QH3L.js → DZqwrxF-.js} +1 -1
  90. package/web/app/immutable/chunks/{lo23QH6G.js → D_DOc2Os.js} +3 -3
  91. package/web/app/immutable/chunks/{yB960NCO.js → DcZV24g_.js} +1 -1
  92. package/web/app/immutable/chunks/{DtePJIwh.js → De8Fjgdl.js} +1 -1
  93. package/web/app/immutable/chunks/{BymNHpPR.js → DiKsWs5V.js} +1 -1
  94. package/web/app/immutable/chunks/{LY8itt27.js → DkAKkRDD.js} +1 -1
  95. package/web/app/immutable/chunks/{DC8-G6L8.js → DmM51QPi.js} +1 -1
  96. package/web/app/immutable/chunks/{ClbTB6Xj.js → Dodo2pdu.js} +1 -1
  97. package/web/app/immutable/chunks/{DzptM7_X.js → Doe50cOo.js} +1 -1
  98. package/web/app/immutable/chunks/{Cz81LY0L.js → DwoQ7vO-.js} +1 -1
  99. package/web/app/immutable/chunks/{DDBIVnjY.js → DyFh_EM3.js} +2 -2
  100. package/web/app/immutable/chunks/{BLnYhmvu.js → EyMXQJpg.js} +1 -1
  101. package/web/app/immutable/chunks/{CQnMf1_x.js → GCzoJnmz.js} +1 -1
  102. package/web/app/immutable/chunks/{PxK7Tpi1.js → ICUZD0Gc.js} +1 -1
  103. package/web/app/immutable/chunks/{CWIKgED9.js → J5SvV2uT.js} +1 -1
  104. package/web/app/immutable/chunks/{D25Siso6.js → LGHhTW5P.js} +1 -1
  105. package/web/app/immutable/chunks/{D_80WZ_T.js → NLEcMOSe.js} +1 -1
  106. package/web/app/immutable/chunks/{BvqQKgIh.js → NVLznFEf.js} +1 -1
  107. package/web/app/immutable/chunks/{Cm09y9xR.js → O8dU7rmr.js} +1 -1
  108. package/web/app/immutable/chunks/{BkOZFMFh.js → OIWVe_6Z.js} +1 -1
  109. package/web/app/immutable/chunks/{BVWMj_DH.js → OyVkiUcF.js} +1 -1
  110. package/web/app/immutable/chunks/{CzTA_X57.js → RrLZdzQw.js} +1 -1
  111. package/web/app/immutable/chunks/{DS9x31Ck.js → Wz8IKtd9.js} +1 -1
  112. package/web/app/immutable/chunks/{CqO_vGSb.js → XLkjpXJr.js} +1 -1
  113. package/web/app/immutable/chunks/{C33ol_Co.js → XyeZJ2nm.js} +1 -1
  114. package/web/app/immutable/chunks/{CPYAlnby.js → Y2e8rmSY.js} +1 -1
  115. package/web/app/immutable/chunks/{CblXzMHl.js → b_q_dt23.js} +1 -1
  116. package/web/app/immutable/chunks/{eLTYtu4L.js → f9JL4iHQ.js} +3 -3
  117. package/web/app/immutable/chunks/{DXZHhaz3.js → gsh3yl_n.js} +1 -1
  118. package/web/app/immutable/chunks/{OUEUfGbN.js → huniSIS2.js} +2 -2
  119. package/web/app/immutable/chunks/{96Ve7GDU.js → kqlckYxf.js} +1 -1
  120. package/web/app/immutable/chunks/{sl7qUXdR.js → lpr2a93v.js} +1 -1
  121. package/web/app/immutable/chunks/{kFQYnC_s.js → ojLoa0iy.js} +1 -1
  122. package/web/app/immutable/chunks/{YRHmTfBP.js → r0TRQO14.js} +1 -1
  123. package/web/app/immutable/chunks/{1BA0jf6v.js → rq5Cam6x.js} +1 -1
  124. package/web/app/immutable/chunks/{BhdaCqy0.js → vL5AniQ9.js} +1 -1
  125. package/web/app/immutable/entry/{app.Bw3-3P2q.js → app.B9Q-1x3Z.js} +2 -2
  126. package/web/app/immutable/entry/start.DVV9vWYa.js +1 -0
  127. package/web/app/immutable/nodes/{0.CmLft-QF.js → 0.Bs4PkCil.js} +1 -1
  128. package/web/app/immutable/nodes/{1.CqB7---n.js → 1.Yv7aaFvS.js} +1 -1
  129. package/web/app/immutable/nodes/{10.BtG5pQwg.js → 10.Ci3UaLkO.js} +1 -1
  130. package/web/app/immutable/nodes/{14.BSVXjSpi.js → 14.0pTaJEhl.js} +1 -1
  131. package/web/app/immutable/nodes/{17.Bh5ugvjO.js → 17.C4yIKoV3.js} +2 -2
  132. package/web/app/immutable/nodes/{2.CZ34mXRg.js → 2.CKWF11kM.js} +4 -4
  133. package/web/app/immutable/nodes/{3.BSXruCL4.js → 3.DU2FnI7u.js} +1 -1
  134. package/web/app/immutable/nodes/{4.H1psgKQ4.js → 4.BQRlURPi.js} +1 -1
  135. package/web/app/immutable/nodes/{5.CSAkx37t.js → 5.C0kRsqFa.js} +1 -1
  136. package/web/app/immutable/nodes/{6.C2NzRpeE.js → 6.meo8GLA8.js} +1 -1
  137. package/web/app/immutable/nodes/{7.DX2-aZdI.js → 7.BELSSAGn.js} +1 -1
  138. package/web/app/immutable/nodes/{8.BUULI5of.js → 8.BiXCtzxx.js} +4 -4
  139. package/web/app/immutable/nodes/{9.QGJ-fCb7.js → 9.CUlXD5Il.js} +4 -4
  140. package/web/app/version.json +1 -1
  141. package/web/index.html +9 -9
  142. package/web/app/immutable/entry/start.icYYR8ly.js +0 -1
@@ -1 +1 @@
1
- var ye=Object.defineProperty;var Re=(e,t,r)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Re(e,typeof t!="symbol"?t+"":t,r);import{k as Ce,N as we,T as Pe,d as Ie,l as Oe,w as Te}from"./B6kyqBFl.js";import"./DYhIMPy1.js";import{bp as a,_ as Fe}from"./O1QHAURn.js";import"./CAyg2ijY.js";import"./BBDxUL80.js";import"./CR_t_AVn.js";import{c as K}from"./ChTqQfQN.js";import"./B1mZq3ve.js";import{Ix as i,tX as Le,ny as y,nx as _,m1 as De,vk as xe,vi as te,h8 as Ne,h9 as Be,c as We,Ia as Ve,a4 as Ue,yd as O,ye as G,yb as Ge,yc as qe,bY as He,bX as je,ca as Ke,c9 as ze,nA as R}from"./DNqM68dO.js";import{cG as $e,cv as Xe,bv as Qe,cj as oe,cL as Ye,cK as Ze,cP as Je,c7 as et,cn as tt,c9 as rt,cE as ce,ax as st,bR as nt,cM as it}from"./VZEkDWIM.js";import{a as at,i as ot}from"./RoOfSbrC.js";import{aJ as ct,V as le,bK as lt,m as dt,O as ut,bX as z,g as pt,W as ft,bY as gt,c as ht,aK as mt,bF as $,an as bt,aZ as St,_ as _t,aF as vt,bM as At,Z as kt,X as Et,Y as Mt,bI as yt,x as Rt}from"./DrbtWgvN.js";import{y as Ct}from"./xEfOpOba.js";import{y as I}from"./CovkQMd0.js";import{i as B}from"./Csj7SEat.js";import{n as wt}from"./CGy2WPjn.js";const Pt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:we,TOAST_COUNTDOWN_CLASS:Pe,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Ie,notify:Ce,notifyMetadata:Oe,withToastCountdown:Te},Symbol.toStringTag,{value:"Module"})),ks=i.createSelector(e=>$e.select(e)?.capabilities.gitlabCheckout===!0),Es=i.createSelector(e=>e.gitlabAuth.host),Ms=i.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),ys=i.createSelector(e=>Le(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Rs=i.createSelector(e=>e.gitlabAuth.isCancelling),Cs=i.createSelector(e=>e.gitlabAuth.cancelOutcome),ws=i.createSelector(e=>e.gitlabAuth.isConfigured),Ps=i.createSelector(e=>e.gitlabAuth.isAuthenticating),Is=i.createSelector(e=>e.gitlabAuth.deviceFlow),Os=i.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Ts=i.createSelector(e=>e.gitlabAuth.user),Fs=i.createSelector(e=>e.gitlabAuth.error);i.createSelector(e=>e.gitlabAuth.method);const Ls=i.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],de=new Set(["pr-reviewer"]),Ds="developer";function xs(e){return E.find(t=>t.id===e)}const It=i.createSelector(e=>e.githubAuth.mutationRequestId),Ot=i.createSelector(e=>e.githubAuth.callbacksCancelled),Tt=i.createSelector(e=>e.githubAuth.isDisconnecting),ue=i.createSelector(e=>e.githubAuth.isAuthenticated),Ft=i.createSelector(e=>e.githubAuth.statusSettled===!0),Lt=i.createSelector(e=>e.githubAuth.requiresDaemonAuth),Dt=i.createSelector(e=>e.githubAuth.user),xt=i.createSelector(e=>e.githubAuth.isAuthenticating),Nt=i.createSelector(e=>e.githubAuth.deviceFlow),Bt=i.createSelector(e=>e.githubAuth.error),Ns=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Ot,selectGitHubAuthDeviceFlow:Nt,selectGitHubAuthError:Bt,selectGitHubAuthIsAuthenticated:ue,selectGitHubAuthIsAuthenticating:xt,selectGitHubAuthIsDisconnecting:Tt,selectGitHubAuthMutationRequestId:It,selectGitHubAuthRequiresDaemonAuth:Lt,selectGitHubAuthStatusSettled:Ft,selectGitHubAuthUser:Dt},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function Wt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((n,o)=>f(n.provider)===f(s[o].provider)&&n.model===s[o].model&&n.hint===s[o].hint&&f(n.reasoningEffort)===f(s[o].reasoningEffort))}function re(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&Wt(e.modelOptions,r.modelOptions):!1}const Bs=i.createSelector(e=>e.specialists.bundledSpecialists),Vt=i.createSelector(e=>e.specialists.fileSpecialists),Ws=i.createSelector(e=>y(Vt.select(e))),Vs=i.createSelector(e=>e.specialists.userOverrides);i.createSelector(e=>e.specialists.overridesLoaded);const Us=i.createSelector(e=>e.specialists.customSpecialistsLoaded),Gs=i.createSelector(e=>e.specialists.fileSpecialistsLoaded),qs=i.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Hs=i.createSelector(e=>e.specialists.specialistsFolderPath),js=i.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});i.createSelector(e=>e.specialists.providerModelOverrides);const W=i.createSelector((e,t)=>!(de.has(t)&&!ue.select(e)));function Ut(e,t){return t?e:e.filter(r=>!de.has(r.id))}function Gt(e,t){return Ut(e,t).filter(r=>!r.hidden)}function Ks(e,t){return Gt(e,t).filter(r=>r.role!=="internal")}const v=i.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,n=new Set,o=[];for(const l of r)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const b=c.has(l.id),N=c.has(p.id);return b&&N?(c.get(l.id)??0)-(c.get(p.id)??0):b&&!N?-1:!b&&N?1:l.name.localeCompare(p.name)}),o}),zs=i.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,n)=>+!r.has(s.id)-+!r.has(n.id)||s.id.localeCompare(n.id)),t[0]}),qt=i.createSelector((e,t)=>{const r=_(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(n=>n.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&y(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const n=E.find(o=>o.id===t);if(n)return{id:n.id,name:n.name,description:n.description,source:"builtin"}}return null}),$s=i.createSelector((e,t)=>qt.select(e,t)?.name??null),Xs=i.createSelector((e,t,r)=>{const n=v.select(e,r).find(o=>o.id===t);return n?n.defaultModel?n.defaultModel:n.resolvedModel??"":""}),Qs=i.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Ys=i.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Zs=i.createSelector((e,t,r)=>{const n=v.select(e,r).find(o=>o.id===t);return n?n.defaultBehaviorPrompt:""});function T(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const Js=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&T(t,e.specialists.bundledSpecialists)}return T(t,e.specialists.bundledSpecialists)}),en=i.createSelector((e,t,r)=>r?!!X.select(e,t,r):!!_(e.specialists.fileSpecialists,t)),tn=i.createSelector((e,t,r)=>{if(r){const o=X.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:T(t,e.specialists.bundledSpecialists)&&!re(o)}if(!T(t,e.specialists.bundledSpecialists))return!1;const n=_(e.specialists.fileSpecialists,t);return!n||n.source!=="user"?!1:!re(n)}),X=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return _(e.specialists.fileSpecialists,t)}),rn=i.createSelector((e,t,r)=>{const s=X.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(n=>n.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(n=>n.id===t)?"Built-in":null}),sn=i.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=_(e.specialists.fileSpecialists,t);if(s)return s.filePath;const n=e.specialists.bundledSpecialists.find(o=>o.id===t);if(n&&"filePath"in n)return n.filePath}),nn=i.createSelector((e,t,r)=>{if(r){const n=v.select(e,r).find(l=>l.id===t),o=n?.codingAgent||n?.resolvedProvider;if(o)return Xe.select(e,o,r);const c=Qe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=_(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ht.select(e,t)}),Ht=i.createSelector((e,t)=>{const s=v.select(e).find(n=>n.id===t);return s?.codingAgent?s.codingAgent:ct.select(e)?le.select(e):""}),an=i.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),on=i.createSelector((e,t)=>e.specialists.creationByContext?.[t]??De),cn=i.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),V=K("Clipboard");async function ln(e){let t;if(at())try{const r=await ot("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,V.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw V.error("Browser clipboard write failed",r,{electronError:t}),r}throw V.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const jt=["connected","disconnected","unreachable","revoked","update-required"],M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,pe=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Kt(e){if(!M(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>M(s)&&u(s.id)?[{id:s.id,...s.visible===!1?{visible:!1}:{},status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(n=>u(n)):[]}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function dn(e){if(!M(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!jt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=M(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Kt(e.capabilities),s=C(e.tcAddress),n=C(e.observedAt),o=C(e.lastConnectedAt),c=xe(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:pe(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...n?{observedAt:n}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function un(e){if(!M(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:pe(e.runningAgents)}}function pn(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function zt(e){if(!M(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function fn(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=zt(r);if(!s)return null;t.push(s)}return t}function $t(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function P(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const Xt={macos:"macOS",linux:"Linux",windows:"Windows"},Qt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function A(e,t){const r=[e&&(Xt[e]??e),t&&(Qt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function Yt(e){return e?.placement?.target==="remote"||I(e?.placement?.target)}const Zt=new Set(["running","paused","resuming","pausing","stopping"]);function Jt(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&Zt.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function fe(e,t){if(!e||!Yt(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(I(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Ne(s?.cloud?.provider??Be(e.placement?.cloudMachineId)),platform:A(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:Jt(e,s)}};const n=A(e.placement?.os,e.placement?.arch)??A(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:n,state:o}}function gn(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:A(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function ge(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function hn(e){const t=ge(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function mn(e){if(e.cloud){const r=ge(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function he(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function me(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function er(e,t){const r=e.detail??"",s=me(r),n=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(n&&s?.data.reason==="prepared-checkout")return{updateRequired:n,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=te(s?.data),c=o??(e.code?te({code:e.code}):null);return c?{updateRequired:n,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:n,message:s?.message||r}}function bn(e){if(!I(e?.placement?.target)||!e.placementError||e.status!==We.Error)return null;const t=er(e.placementError,"");return t.cloud?t:null}const tr=["attachments-too-large-for-machine:","node-prompt-too-large:"],rr="remote-agent-unsupported:";function se(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function Sn(e){const t=me(e)?.message??e;for(const s of tr){const n=t.indexOf(s);if(n<0)continue;const o=t.slice(n+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:se(Number(c[1])),limit:se(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(rr);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function _n(e){return I(e?.placement?.target)&&he(e,fe(e))==="starting"}function vn(e,t){if(!I(e?.placement?.target))return!1;const r=fe(e,t);return r?.cloud?.state==="resuming"&&he(e,r)===null}const h="",q="cloud:";function Q(e){return`${q}${e}`}function D(e){return e?.startsWith(q)&&e.slice(q.length)||null}const An=Q("e2b");function sr(e,t){return e?.find(r=>Q(r.cloudMachineId)===t&&r.unavailableReason===null)}const nr=new Set(["connected","disconnected"]);function ir(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function Y(e){return nr.has(e.state)}function ar({backendLabel:e,backendPlatform:t,machines:r,cloud:s,orchestrator:n=!1}){const o=[n?{id:h,label:a.remoteMachines_startOn_firstAvailable_label(),platform:null,disabled:!1,hint:a.remoteMachines_startOn_firstAvailable_hint()}:{id:h,label:e,platform:A(t?.os,t?.arch),disabled:!1},...r.map(c=>{const l=A(c.platform?.os,c.platform?.arch);return Y(c)?{id:c.id,label:c.name,platform:l,disabled:!1}:{id:c.id,label:c.name,platform:l,disabled:!0,reason:ir(c.state)}})];for(const c of s??[])o.push({id:Q(c.cloudMachineId),label:c.label,platform:null,kind:"cloud",disabled:c.unavailableReason!==null,...c.unavailableReason?{reason:c.unavailableReason}:c.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return o}function kn(e){return e.find(t=>t.id===h)?.label??""}function En(e,t,r){if(e!==h)return D(e)?void 0:e;if(r)return t.find(s=>s.id!==h&&s.kind!=="cloud"&&!s.disabled)?.id}function or({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(Y)||(s??[]).some(n=>n.unavailableReason===null))}function cr(e,t,r){if(!e)return h;if(D(e))return sr(r,e)?e:h;const s=t.find(n=>n.id===e);return s&&Y(s)?s.id:h}function Mn(e,{cloudEntries:t=!1,providerOf:r}={}){const s=D(e);return s?t&&r?.(s)==="northflank"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function yn({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),n=e.find(c=>c.key===t),o=n?s(n):[];if(r){const c=Ve(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(n&&o.length>0)return{providerId:n.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function lr(e,t,r,s){const n=e.map(P),o=n.indexOf(t),c=n.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[b]=p.splice(o,1);return p.splice(l,0,b),p.map($t)}function Rn(e,t,r){const s=e.findIndex(o=>P(o)===t),n=e[s+r];return s<0||!n?null:lr(e,t,P(n),r===-1?"before":"after")}function dr(e,t){if(e===h)return"local";const r=t==="cloud"?D(e):null;return P(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function ne(e,t){const r=new Map(t.map((n,o)=>[P(n),o])),s=n=>r.get(dr(n.id,n.kind))??t.length;return e.map((n,o)=>({option:n,index:o})).sort((n,o)=>s(n.option)-s(o.option)||n.index-o.index).map(({option:n})=>n)}const Z=i.createSelector(e=>Ct.select(e)&&e.remoteMachines?.supported===!0),Cn=i.createSelector(e=>Z.select(e)&&lt.select(e)&&!oe.select(e)),be=i.createSelector(e=>Z.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),ie=i.createSelector(e=>be.select(e)?e.remoteMachines.order??[]:[]),wn=i.createSelector(e=>e.remoteMachines.orderSaving!==null),J=i.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Pn=i.createSelector(e=>e.remoteMachines.localFingerprint),In=i.createSelector(e=>e.remoteMachines.pending),On=i.createSelector(e=>e.remoteMachines.failures),Tn=i.createSelector(e=>e.remoteMachines.executorBackends??[]),ur=i.createSelector((e,t)=>{if(t===Ue)return a.layout_daemonStatus_localConnection_label();const r=_(e.connections.connections,t);return r?dt(r):t}),pr=i.createSelector(e=>ur.select(e,e.connections.windowBackendId)),Fn=i.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Ln=i.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return ut({catalogProfiles:Je.select(e,t),defaultRemoteIncompatibility:Ze.select(e,t),defaultRemoteLaunch:Ye.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Dn=i.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),Se=i.createSelector(e=>or({remoteMachinesVisible:Z.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:J.select(e),cloud:z(e)}));function fr(e){const t=_(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const gr=i.createSelector(e=>{const t=oe.select(e),r=ar({backendLabel:pr.select(e),backendPlatform:fr(e),machines:J.select(e),cloud:z(e),orchestrator:t});if(!be.select(e))return r;if(!t)return ne(r,ie.select(e));const[s,...n]=r;return[s,...ne(n,ie.select(e))]}),xn=i.createSelector(e=>Se.select(e)?gr.select(e):[]),Nn=i.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),Bn=i.createSelector((e,t,r)=>Se.select(e)?cr(t,J.select(e),_e(e,r)):h);function _e(e,t){const r=z(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(n=>{if(n.unavailableReason)return n;const o=pt(e,t,s[n.cloudMachineId]??null);return o?{...n,unavailableReason:o}:n})}const Wn=i.createSelector((e,t)=>_e(e,t)),hr=K("WorkspaceValidation");async function Vn(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mr(s)?Sr(s):_r(s,t,r)}function mr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function br(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const n of r){const o=t.match(n);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const n=s[2].replace(/\.git$/,"");return n?{owner:s[1],repo:n}:null}return null}async function Sr(e){return br(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function _r(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await B("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await B("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await B("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(hr.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Un(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Gn(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function qn(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Hn(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function jn(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const vr=["idle","exited"];function Ar(e){return e===void 0||!vr.includes(e)}function Kn(e){return e.status==="restarting"?"restarting":Ar(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function kr(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const zn=i.createSelector(e=>e.voiceSettings.isLoading),$n=i.createSelector(e=>e.voiceSettings.available),Xn=i.createSelector(e=>e.voiceSettings.provider),Qn=i.createSelector(e=>e.voiceSettings.engine),Yn=i.createSelector(e=>e.voiceSettings.osEngineAvailable),Zn=i.createSelector(e=>e.voiceSettings.keyConfigured),Jn=i.createSelector(e=>e.voiceSettings.vocabulary),ei=i.createSelector(e=>e.voiceSettings.openaiModel),ti=i.createSelector(e=>e.voiceSettings.language),ri=i.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),si=i.createSelector(e=>e.voiceSettings.inputDeviceId),ni=i.createSelector(e=>e.voiceSettings.inputDevices),ii=i.createSelector(e=>e.voiceSettings.busyProvider),ai=i.createSelector(e=>e.voiceSettings.error),oi=i.createSelector(e=>et.select(e)?"unavailable":kr(e.voiceSettings)),H="intent.voice.inputDevice";let j;function Er(){if(j!==void 0)return j;try{const e=localStorage.getItem(H);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ci(e){j=e;try{e===null?localStorage.removeItem(H):localStorage.setItem(H,e)}catch{}}let F=null;function li(e){F=e}function di(){const e=F;return F=null,e}function Mr(){F=null}const yr=300,Rr=300;class Cr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??yr,this.doublePressWindowMs=t.doublePressWindowMs??Rr,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let L=null;function ui(e){L=e}function pi(){const e=L;return L=null,e}function wr(){L=null}const Pr=12e4,Ir=["audio/webm;codecs=opus","audio/webm"];function fi(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Or(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Tr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ir.find(e=>MediaRecorder.isTypeSupported(e))}class Fr{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Pr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Or(this.deviceId))}catch(n){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(n),o?"discarded":"error"}if(this.discardRequested){for(const n of t.getTracks())n.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Tr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=n=>{n.data&&n.data.size>0&&this.chunks.push(n.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=n=>this.handleRecorderError(n),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,n=this.cancelRequested;this.teardown(),!n&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Lr=300;function Dr(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const xr={stopReason:"manual",autoSend:!1};let g=null,S=null,k=0,w=null;const x=new Cr({onRecordStart:()=>{w&&Nr(w)},onRecordStop:e=>{ve(w,e)}});function gi(){return g!==null}function hi(){return g}function mi(e){w=e,k+=1,k===1&&x.keyDown()}function bi(e){w=e,k!==0&&(k-=1,k===0&&x.keyUp())}function Nr(e){if(g!==null)return;wr(),Mr();const t=new Fr({deviceId:Er(),onFinished:r=>{g===t&&(g=null);const s=S??{stopReason:"auto-stop",autoSend:!1},n=S!==null;if(S=null,e.dispatch(O()),n||x.reset(),r.durationMs<Lr){s.autoSend&&e.dispatch(G());return}e.dispatch(Ge({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{g===t&&(g=null),S=null,e.dispatch(O()),e.showHint(Dr(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});g=t,e.dispatch(qe()),t.start().then(r=>{if(r!=="recording"&&(g===t&&(g=null),r==="discarded")){const s=S?.autoSend===!0;S=null,e.dispatch(O()),s&&e.dispatch(G())}})}function ve(e,t){const r=g;if(r===null){t.autoSend&&e?.dispatch(G());return}S=t,r.stop()}function Si(){ve(null,xr)}function _i(e){x.reset(),k=0,S=null;const t=g;t!==null&&(g=null,t.cancel(),e.dispatch(O()))}const Br=K("HardwareConsoleVoiceSetupToast"),Wr="hardware-console-voice-setup";let U=null;function Vr(){return U||(U=Fe(()=>Promise.resolve().then(()=>Pt),void 0,import.meta.url).then(e=>e.notify)),U}function Ur(){wt("/settings?tab=connections#voice").catch(e=>{Br.error("Failed to open voice settings from setup toast",e)})}function Gr(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>Ur()}}function vi(){Vr().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Wr,action:Gr()})})}const Ai=i.createSelector(e=>e.externalEditors.selectedAction),qr=i.createSelector(e=>e.externalEditors.editors),Hr=i.createSelector(e=>{const t=y(qr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),n=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...n,...t.filter(({id:c})=>!o.has(c))]}),ki=i.createSelector(e=>e.externalEditors.editorOrder??[]),Ei=i.createSelector(e=>e.externalEditors.loading),Mi=i.createSelector(e=>e.externalEditors.lastFetched),jr=i.createSelector(e=>e.externalEditors.hiddenEditorIds),yi=i.createSelector((e,t)=>{if(!(t?tt.select(e,t):rt.select(e)))return[];const s=jr.select(e);return Hr.select(e).filter(n=>n.installed&&!s.includes(n.id))});function Ri(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Kr=0;function zr(e,t){const r=++Kr;return i.dispatch(je(e,t,r)),r}function Ci(e,t,r){i.dispatch(He(e,t,r))}async function Ae(e,t,r,s){const n=crypto.randomUUID(),o=s?.source??"control";try{return(await i.dispatch(Ke({requestId:n,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:ce.select(i.state)},{...s,intent:s?.intent??zr(e,t)}))).status==="success"}finally{i.dispatch(ze(n,o))}}async function wi(e,t,r,s,n){return Ae(e,t,{kind:"effort",effort:r,previous:s},n)}async function Pi(e,t,r,s,n){return Ae(e,t,{kind:"reconcile",current:r??null,levels:s},n)}const $r=i.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Ii=i.createSelector((e,t)=>$r.select(e,t).some(r=>r.status==="pending")),Oi=i.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],n=st.select(e,t),o=ft.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=gt(c),p=l?ht(s?.model,null,o):s?.model;return{session:s,providerId:n,levels:o,legacy:l,identity:JSON.stringify([p,n]),connection:ce.select(e),canWrite:!!s&&s.workspaceId===r&&!nt.select(e,r)}});function Xr(e,t,r=!1){return e!=="auggie"||t===!0||r}const Ti=i.createSelector(e=>mt.select(e)?null:$.select(e)),Qr=i.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),m=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Fi=i.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),Li=i.createSelector((e,t)=>!!m.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Qr.select(e)),ke=i.createSelector((e,t)=>t?m.select(e,t)?.catalog.providers??[]:it.select(e)),Ee=i.createSelector((e,t)=>{if(!t)return le.select(e);const r=m.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),ee=i.createSelector((e,t)=>{if(!t)return bt.select(e);const r=m.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),Me=i.createSelector((e,t)=>{if(!t)return St.select(e);const r=ee.select(e,t),s=Ee.select(e,t),n=m.select(e,t)?.readiness??{};return ke.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&n[o.id]?.available).map(o=>o.id)}),Di=i.createSelector((e,t)=>{const r=ee.select(e,t),s=t?m.select(e,t)?.readiness??{}:$.select(e);return ke.select(e,t).filter(n=>Xr(n.id,s[n.id]?.available,r[n.id]===!0)).map(n=>n.id)}),xi=i.createSelector((e,t)=>t?Me.select(e,t):_t.select(e)),Ni=i.createSelector((e,t)=>v.select(e,t)),Bi=i.createSelector((e,t)=>t?!!m.select(e,t):vt.select(e)),Wi=i.createSelector((e,t)=>{if(!t)return At.select(e);const r=m.select(e,t)?.settings??[],s=Ee.select(e,t),n=r.find(l=>l.path==="model.providerDefaults")?.value,o=n&&typeof n=="object"?n[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Vi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):kt.select(e)),Ui=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Et.select(e)),Gi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):Mt.select(e)),qi=i.createSelector((e,t,r)=>{if(!r)return yt.select(e,t);const s=ee.select(e,r),n=m.select(e,r);return Me.select(e,r).filter(o=>o!==t&&(s[o]||n?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Rt(o,n?.readiness[o]?.authenticated))}),Hi=i.createSelector((e,t)=>t?m.select(e,t)?.readiness??{}:$.select(e)),Yr={},ji=i.createSelector(e=>e.providerSettings?.profiles?.status??Yr),Ki=i.createSelector(e=>e.directoryPicker.listing),zi=i.createSelector(e=>e.directoryPicker.loading),$i=i.createSelector(e=>e.directoryPicker.error),Xi=i.createSelector(e=>e.directoryPicker.pathError),Qi=i.createSelector(e=>e.directoryPicker.createError),ae={},Zr=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Yi=i.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(n=>n.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Zi=i.createSelector(e=>e.mcpSettings.loading),Ji=i.createSelector(e=>e.mcpSettings.error),ea=i.createSelector(e=>e.mcpSettings.mutationError??null),ta=i.createSelector(e=>e.mcpSettings.enabled),Jr=i.createSelector(e=>e.mcpSettings.disabledServers),es=i.createSelector(e=>e.mcpSettings.statusMap),ts=i.createSelector(e=>e.mcpSettings.toolsMap),rs=i.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(n=>[n.id,R(n)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(n=>{const o=s.get(n.serverId);return o&&n.lastError?[[o,n.lastError]]:[]}))}),ss=i.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??ae:ae),ra=i.createSelector((e,t)=>Object.keys(ss.select(e,t))),sa=i.createSelector(e=>{const t=Zr.select(e),r=es.select(e),s=ts.select(e),n=Jr.select(e),o=rs.select(e);return t.map(c=>{const l=R(c)in n,p=s[R(c)]||[];let b=r[R(c)]||"disconnected";return l&&(b="disabled"),{...c,disabled:l,status:b,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});i.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const na=i.createSelector(e=>e.mcpSettings.lastImportedCount),ia=i.createSelector(e=>e.mcpSettings.advancedSaveStatus),aa=i.createSelector(e=>e.mcpSettings.advancedSaveError),oa=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],ns=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],ca=Object.fromEntries(ns.map(e=>[e.path,e.defaultValue]));export{Ci as $,mi as A,bi as B,Pt as C,Ds as D,Mn as E,ns as F,de as G,Ar as H,Xr as I,gi as J,Ri as K,re as L,fi as M,Er as N,gn as O,yn as P,P as Q,A as R,E as S,zr as T,lr as U,un as V,br as W,fn as X,dn as Y,er as Z,Pi as _,ca as a,ws as a$,Sn as a0,kr as a1,cr as a2,Gn as a3,ci as a4,Ii as a5,$r as a6,Oi as a7,Bs as a8,qs as a9,nn as aA,Xs as aB,Bn as aC,oi as aD,Tn as aE,Qs as aF,Ys as aG,Ws as aH,Gs as aI,X as aJ,Ot as aK,Nt as aL,Bt as aM,ue as aN,xt as aO,Tt as aP,It as aQ,Lt as aR,Dt as aS,Cs as aT,Is as aU,Os as aV,Fs as aW,Es as aX,ys as aY,Ps as aZ,Rs as a_,ur as aa,xi as ab,Ee as ac,ee as ad,Di as ae,Me as af,ke as ag,Ui as ah,Gi as ai,Vi as aj,qi as ak,Hi as al,Bi as am,Wi as an,Ni as ao,pr as ap,Us as aq,Dn as ar,js as as,Qi as at,$i as au,Ki as av,zi as aw,Xi as ax,ki as ay,Zs as az,oa as b,Xn as b$,Ms as b0,Ts as b1,ks as b2,Ls as b3,tn as b4,jr as b5,Nn as b6,Hr as b7,yi as b8,Ei as b9,J as bA,Z as bB,Ln as bC,Cn as bD,Ti as bE,qt as bF,on as bG,cn as bH,sn as bI,an as bJ,$s as bK,rn as bL,v as bM,Hs as bN,Wn as bO,xn as bP,gr as bQ,Se as bR,Vs as bS,ii as bT,Qn as bU,si as bV,ni as bW,Zn as bX,ti as bY,ei as bZ,Yn as b_,Js as ba,en as bb,Mi as bc,Pn as bd,ie as be,wn as bf,be as bg,aa as bh,ia as bi,Jr as bj,ta as bk,Ji as bl,rs as bm,na as bn,Zi as bo,ea as bp,Zr as bq,sa as br,es as bs,ts as bt,Ai as bu,zs as bv,ji as bw,Fn as bx,On as by,In as bz,h as c,$n as c0,ai as c1,zn as c2,Jn as c3,ri as c4,m as c5,Qr as c6,Li as c7,Fi as c8,ra as c9,Yi as ca,li as cb,ui as cc,vi as cd,kn as ce,Q as cf,D as cg,En as ch,Nr as ci,Rn as cj,Si as ck,qn as cl,Un as cm,Hn as cn,Vn as co,Gr as cp,ln as cq,An as d,bn as e,_n as f,vn as g,hn as h,fe as i,mn as j,he as k,wi as l,_i as m,Mr as n,wr as o,di as p,pi as q,Ks as r,Gt as s,Ut as t,pn as u,hi as v,jn as w,Kn as x,xs as y,Ns as z};
1
+ var ye=Object.defineProperty;var Re=(e,t,r)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Re(e,typeof t!="symbol"?t+"":t,r);import{k as Ce,N as we,T as Pe,d as Ie,l as Oe,w as Te}from"./B6kyqBFl.js";import"./DYhIMPy1.js";import{bp as a,_ as Fe}from"./O1QHAURn.js";import"./CAyg2ijY.js";import"./BBDxUL80.js";import"./CR_t_AVn.js";import{c as K}from"./ChTqQfQN.js";import"./B1mZq3ve.js";import{Ix as i,tX as Le,ny as y,nx as _,m1 as De,vk as xe,vi as te,h8 as Ne,h9 as Be,c as We,Ia as Ve,a4 as Ue,yd as O,ye as G,yb as Ge,yc as qe,bY as He,bX as je,ca as Ke,c9 as ze,nA as R}from"./DNqM68dO.js";import{cG as $e,cv as Xe,bv as Qe,cj as oe,cL as Ye,cK as Ze,cP as Je,c7 as et,cn as tt,c9 as rt,cE as ce,ax as st,bR as nt,cM as it}from"./VZEkDWIM.js";import{a as at,i as ot}from"./RoOfSbrC.js";import{aJ as ct,V as le,bK as lt,m as dt,O as ut,bX as z,g as pt,W as ft,bY as gt,c as ht,aK as mt,bF as $,an as bt,aZ as St,_ as _t,aF as vt,bM as At,Z as kt,X as Et,Y as Mt,bI as yt,x as Rt}from"./DrbtWgvN.js";import{y as Ct}from"./xEfOpOba.js";import{y as I}from"./CovkQMd0.js";import{i as B}from"./Csj7SEat.js";import{n as wt}from"./BbjrS_gZ.js";const Pt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:we,TOAST_COUNTDOWN_CLASS:Pe,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Ie,notify:Ce,notifyMetadata:Oe,withToastCountdown:Te},Symbol.toStringTag,{value:"Module"})),ks=i.createSelector(e=>$e.select(e)?.capabilities.gitlabCheckout===!0),Es=i.createSelector(e=>e.gitlabAuth.host),Ms=i.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),ys=i.createSelector(e=>Le(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Rs=i.createSelector(e=>e.gitlabAuth.isCancelling),Cs=i.createSelector(e=>e.gitlabAuth.cancelOutcome),ws=i.createSelector(e=>e.gitlabAuth.isConfigured),Ps=i.createSelector(e=>e.gitlabAuth.isAuthenticating),Is=i.createSelector(e=>e.gitlabAuth.deviceFlow),Os=i.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Ts=i.createSelector(e=>e.gitlabAuth.user),Fs=i.createSelector(e=>e.gitlabAuth.error);i.createSelector(e=>e.gitlabAuth.method);const Ls=i.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],de=new Set(["pr-reviewer"]),Ds="developer";function xs(e){return E.find(t=>t.id===e)}const It=i.createSelector(e=>e.githubAuth.mutationRequestId),Ot=i.createSelector(e=>e.githubAuth.callbacksCancelled),Tt=i.createSelector(e=>e.githubAuth.isDisconnecting),ue=i.createSelector(e=>e.githubAuth.isAuthenticated),Ft=i.createSelector(e=>e.githubAuth.statusSettled===!0),Lt=i.createSelector(e=>e.githubAuth.requiresDaemonAuth),Dt=i.createSelector(e=>e.githubAuth.user),xt=i.createSelector(e=>e.githubAuth.isAuthenticating),Nt=i.createSelector(e=>e.githubAuth.deviceFlow),Bt=i.createSelector(e=>e.githubAuth.error),Ns=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Ot,selectGitHubAuthDeviceFlow:Nt,selectGitHubAuthError:Bt,selectGitHubAuthIsAuthenticated:ue,selectGitHubAuthIsAuthenticating:xt,selectGitHubAuthIsDisconnecting:Tt,selectGitHubAuthMutationRequestId:It,selectGitHubAuthRequiresDaemonAuth:Lt,selectGitHubAuthStatusSettled:Ft,selectGitHubAuthUser:Dt},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function Wt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((n,o)=>f(n.provider)===f(s[o].provider)&&n.model===s[o].model&&n.hint===s[o].hint&&f(n.reasoningEffort)===f(s[o].reasoningEffort))}function re(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&Wt(e.modelOptions,r.modelOptions):!1}const Bs=i.createSelector(e=>e.specialists.bundledSpecialists),Vt=i.createSelector(e=>e.specialists.fileSpecialists),Ws=i.createSelector(e=>y(Vt.select(e))),Vs=i.createSelector(e=>e.specialists.userOverrides);i.createSelector(e=>e.specialists.overridesLoaded);const Us=i.createSelector(e=>e.specialists.customSpecialistsLoaded),Gs=i.createSelector(e=>e.specialists.fileSpecialistsLoaded),qs=i.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Hs=i.createSelector(e=>e.specialists.specialistsFolderPath),js=i.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});i.createSelector(e=>e.specialists.providerModelOverrides);const W=i.createSelector((e,t)=>!(de.has(t)&&!ue.select(e)));function Ut(e,t){return t?e:e.filter(r=>!de.has(r.id))}function Gt(e,t){return Ut(e,t).filter(r=>!r.hidden)}function Ks(e,t){return Gt(e,t).filter(r=>r.role!=="internal")}const v=i.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,n=new Set,o=[];for(const l of r)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const b=c.has(l.id),N=c.has(p.id);return b&&N?(c.get(l.id)??0)-(c.get(p.id)??0):b&&!N?-1:!b&&N?1:l.name.localeCompare(p.name)}),o}),zs=i.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,n)=>+!r.has(s.id)-+!r.has(n.id)||s.id.localeCompare(n.id)),t[0]}),qt=i.createSelector((e,t)=>{const r=_(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(n=>n.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&y(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const n=E.find(o=>o.id===t);if(n)return{id:n.id,name:n.name,description:n.description,source:"builtin"}}return null}),$s=i.createSelector((e,t)=>qt.select(e,t)?.name??null),Xs=i.createSelector((e,t,r)=>{const n=v.select(e,r).find(o=>o.id===t);return n?n.defaultModel?n.defaultModel:n.resolvedModel??"":""}),Qs=i.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Ys=i.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Zs=i.createSelector((e,t,r)=>{const n=v.select(e,r).find(o=>o.id===t);return n?n.defaultBehaviorPrompt:""});function T(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const Js=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&T(t,e.specialists.bundledSpecialists)}return T(t,e.specialists.bundledSpecialists)}),en=i.createSelector((e,t,r)=>r?!!X.select(e,t,r):!!_(e.specialists.fileSpecialists,t)),tn=i.createSelector((e,t,r)=>{if(r){const o=X.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:T(t,e.specialists.bundledSpecialists)&&!re(o)}if(!T(t,e.specialists.bundledSpecialists))return!1;const n=_(e.specialists.fileSpecialists,t);return!n||n.source!=="user"?!1:!re(n)}),X=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return _(e.specialists.fileSpecialists,t)}),rn=i.createSelector((e,t,r)=>{const s=X.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(n=>n.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(n=>n.id===t)?"Built-in":null}),sn=i.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=_(e.specialists.fileSpecialists,t);if(s)return s.filePath;const n=e.specialists.bundledSpecialists.find(o=>o.id===t);if(n&&"filePath"in n)return n.filePath}),nn=i.createSelector((e,t,r)=>{if(r){const n=v.select(e,r).find(l=>l.id===t),o=n?.codingAgent||n?.resolvedProvider;if(o)return Xe.select(e,o,r);const c=Qe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=_(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ht.select(e,t)}),Ht=i.createSelector((e,t)=>{const s=v.select(e).find(n=>n.id===t);return s?.codingAgent?s.codingAgent:ct.select(e)?le.select(e):""}),an=i.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),on=i.createSelector((e,t)=>e.specialists.creationByContext?.[t]??De),cn=i.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),V=K("Clipboard");async function ln(e){let t;if(at())try{const r=await ot("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,V.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw V.error("Browser clipboard write failed",r,{electronError:t}),r}throw V.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const jt=["connected","disconnected","unreachable","revoked","update-required"],M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,pe=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Kt(e){if(!M(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>M(s)&&u(s.id)?[{id:s.id,...s.visible===!1?{visible:!1}:{},status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(n=>u(n)):[]}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function dn(e){if(!M(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!jt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=M(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Kt(e.capabilities),s=C(e.tcAddress),n=C(e.observedAt),o=C(e.lastConnectedAt),c=xe(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:pe(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...n?{observedAt:n}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function un(e){if(!M(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:pe(e.runningAgents)}}function pn(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function zt(e){if(!M(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function fn(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=zt(r);if(!s)return null;t.push(s)}return t}function $t(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function P(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const Xt={macos:"macOS",linux:"Linux",windows:"Windows"},Qt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function A(e,t){const r=[e&&(Xt[e]??e),t&&(Qt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function Yt(e){return e?.placement?.target==="remote"||I(e?.placement?.target)}const Zt=new Set(["running","paused","resuming","pausing","stopping"]);function Jt(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&Zt.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function fe(e,t){if(!e||!Yt(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(I(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Ne(s?.cloud?.provider??Be(e.placement?.cloudMachineId)),platform:A(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:Jt(e,s)}};const n=A(e.placement?.os,e.placement?.arch)??A(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:n,state:o}}function gn(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:A(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function ge(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function hn(e){const t=ge(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function mn(e){if(e.cloud){const r=ge(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function he(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function me(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function er(e,t){const r=e.detail??"",s=me(r),n=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(n&&s?.data.reason==="prepared-checkout")return{updateRequired:n,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=te(s?.data),c=o??(e.code?te({code:e.code}):null);return c?{updateRequired:n,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:n,message:s?.message||r}}function bn(e){if(!I(e?.placement?.target)||!e.placementError||e.status!==We.Error)return null;const t=er(e.placementError,"");return t.cloud?t:null}const tr=["attachments-too-large-for-machine:","node-prompt-too-large:"],rr="remote-agent-unsupported:";function se(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function Sn(e){const t=me(e)?.message??e;for(const s of tr){const n=t.indexOf(s);if(n<0)continue;const o=t.slice(n+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:se(Number(c[1])),limit:se(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(rr);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function _n(e){return I(e?.placement?.target)&&he(e,fe(e))==="starting"}function vn(e,t){if(!I(e?.placement?.target))return!1;const r=fe(e,t);return r?.cloud?.state==="resuming"&&he(e,r)===null}const h="",q="cloud:";function Q(e){return`${q}${e}`}function D(e){return e?.startsWith(q)&&e.slice(q.length)||null}const An=Q("e2b");function sr(e,t){return e?.find(r=>Q(r.cloudMachineId)===t&&r.unavailableReason===null)}const nr=new Set(["connected","disconnected"]);function ir(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function Y(e){return nr.has(e.state)}function ar({backendLabel:e,backendPlatform:t,machines:r,cloud:s,orchestrator:n=!1}){const o=[n?{id:h,label:a.remoteMachines_startOn_firstAvailable_label(),platform:null,disabled:!1,hint:a.remoteMachines_startOn_firstAvailable_hint()}:{id:h,label:e,platform:A(t?.os,t?.arch),disabled:!1},...r.map(c=>{const l=A(c.platform?.os,c.platform?.arch);return Y(c)?{id:c.id,label:c.name,platform:l,disabled:!1}:{id:c.id,label:c.name,platform:l,disabled:!0,reason:ir(c.state)}})];for(const c of s??[])o.push({id:Q(c.cloudMachineId),label:c.label,platform:null,kind:"cloud",disabled:c.unavailableReason!==null,...c.unavailableReason?{reason:c.unavailableReason}:c.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return o}function kn(e){return e.find(t=>t.id===h)?.label??""}function En(e,t,r){if(e!==h)return D(e)?void 0:e;if(r)return t.find(s=>s.id!==h&&s.kind!=="cloud"&&!s.disabled)?.id}function or({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(Y)||(s??[]).some(n=>n.unavailableReason===null))}function cr(e,t,r){if(!e)return h;if(D(e))return sr(r,e)?e:h;const s=t.find(n=>n.id===e);return s&&Y(s)?s.id:h}function Mn(e,{cloudEntries:t=!1,providerOf:r}={}){const s=D(e);return s?t&&r?.(s)==="northflank"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function yn({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),n=e.find(c=>c.key===t),o=n?s(n):[];if(r){const c=Ve(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(n&&o.length>0)return{providerId:n.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function lr(e,t,r,s){const n=e.map(P),o=n.indexOf(t),c=n.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[b]=p.splice(o,1);return p.splice(l,0,b),p.map($t)}function Rn(e,t,r){const s=e.findIndex(o=>P(o)===t),n=e[s+r];return s<0||!n?null:lr(e,t,P(n),r===-1?"before":"after")}function dr(e,t){if(e===h)return"local";const r=t==="cloud"?D(e):null;return P(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function ne(e,t){const r=new Map(t.map((n,o)=>[P(n),o])),s=n=>r.get(dr(n.id,n.kind))??t.length;return e.map((n,o)=>({option:n,index:o})).sort((n,o)=>s(n.option)-s(o.option)||n.index-o.index).map(({option:n})=>n)}const Z=i.createSelector(e=>Ct.select(e)&&e.remoteMachines?.supported===!0),Cn=i.createSelector(e=>Z.select(e)&&lt.select(e)&&!oe.select(e)),be=i.createSelector(e=>Z.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),ie=i.createSelector(e=>be.select(e)?e.remoteMachines.order??[]:[]),wn=i.createSelector(e=>e.remoteMachines.orderSaving!==null),J=i.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Pn=i.createSelector(e=>e.remoteMachines.localFingerprint),In=i.createSelector(e=>e.remoteMachines.pending),On=i.createSelector(e=>e.remoteMachines.failures),Tn=i.createSelector(e=>e.remoteMachines.executorBackends??[]),ur=i.createSelector((e,t)=>{if(t===Ue)return a.layout_daemonStatus_localConnection_label();const r=_(e.connections.connections,t);return r?dt(r):t}),pr=i.createSelector(e=>ur.select(e,e.connections.windowBackendId)),Fn=i.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Ln=i.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return ut({catalogProfiles:Je.select(e,t),defaultRemoteIncompatibility:Ze.select(e,t),defaultRemoteLaunch:Ye.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Dn=i.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),Se=i.createSelector(e=>or({remoteMachinesVisible:Z.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:J.select(e),cloud:z(e)}));function fr(e){const t=_(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const gr=i.createSelector(e=>{const t=oe.select(e),r=ar({backendLabel:pr.select(e),backendPlatform:fr(e),machines:J.select(e),cloud:z(e),orchestrator:t});if(!be.select(e))return r;if(!t)return ne(r,ie.select(e));const[s,...n]=r;return[s,...ne(n,ie.select(e))]}),xn=i.createSelector(e=>Se.select(e)?gr.select(e):[]),Nn=i.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),Bn=i.createSelector((e,t,r)=>Se.select(e)?cr(t,J.select(e),_e(e,r)):h);function _e(e,t){const r=z(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(n=>{if(n.unavailableReason)return n;const o=pt(e,t,s[n.cloudMachineId]??null);return o?{...n,unavailableReason:o}:n})}const Wn=i.createSelector((e,t)=>_e(e,t)),hr=K("WorkspaceValidation");async function Vn(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mr(s)?Sr(s):_r(s,t,r)}function mr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function br(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const n of r){const o=t.match(n);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const n=s[2].replace(/\.git$/,"");return n?{owner:s[1],repo:n}:null}return null}async function Sr(e){return br(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function _r(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await B("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await B("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await B("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(hr.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Un(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Gn(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function qn(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Hn(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function jn(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const vr=["idle","exited"];function Ar(e){return e===void 0||!vr.includes(e)}function Kn(e){return e.status==="restarting"?"restarting":Ar(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function kr(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const zn=i.createSelector(e=>e.voiceSettings.isLoading),$n=i.createSelector(e=>e.voiceSettings.available),Xn=i.createSelector(e=>e.voiceSettings.provider),Qn=i.createSelector(e=>e.voiceSettings.engine),Yn=i.createSelector(e=>e.voiceSettings.osEngineAvailable),Zn=i.createSelector(e=>e.voiceSettings.keyConfigured),Jn=i.createSelector(e=>e.voiceSettings.vocabulary),ei=i.createSelector(e=>e.voiceSettings.openaiModel),ti=i.createSelector(e=>e.voiceSettings.language),ri=i.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),si=i.createSelector(e=>e.voiceSettings.inputDeviceId),ni=i.createSelector(e=>e.voiceSettings.inputDevices),ii=i.createSelector(e=>e.voiceSettings.busyProvider),ai=i.createSelector(e=>e.voiceSettings.error),oi=i.createSelector(e=>et.select(e)?"unavailable":kr(e.voiceSettings)),H="intent.voice.inputDevice";let j;function Er(){if(j!==void 0)return j;try{const e=localStorage.getItem(H);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ci(e){j=e;try{e===null?localStorage.removeItem(H):localStorage.setItem(H,e)}catch{}}let F=null;function li(e){F=e}function di(){const e=F;return F=null,e}function Mr(){F=null}const yr=300,Rr=300;class Cr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??yr,this.doublePressWindowMs=t.doublePressWindowMs??Rr,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let L=null;function ui(e){L=e}function pi(){const e=L;return L=null,e}function wr(){L=null}const Pr=12e4,Ir=["audio/webm;codecs=opus","audio/webm"];function fi(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Or(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Tr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ir.find(e=>MediaRecorder.isTypeSupported(e))}class Fr{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Pr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Or(this.deviceId))}catch(n){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(n),o?"discarded":"error"}if(this.discardRequested){for(const n of t.getTracks())n.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Tr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=n=>{n.data&&n.data.size>0&&this.chunks.push(n.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=n=>this.handleRecorderError(n),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,n=this.cancelRequested;this.teardown(),!n&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Lr=300;function Dr(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const xr={stopReason:"manual",autoSend:!1};let g=null,S=null,k=0,w=null;const x=new Cr({onRecordStart:()=>{w&&Nr(w)},onRecordStop:e=>{ve(w,e)}});function gi(){return g!==null}function hi(){return g}function mi(e){w=e,k+=1,k===1&&x.keyDown()}function bi(e){w=e,k!==0&&(k-=1,k===0&&x.keyUp())}function Nr(e){if(g!==null)return;wr(),Mr();const t=new Fr({deviceId:Er(),onFinished:r=>{g===t&&(g=null);const s=S??{stopReason:"auto-stop",autoSend:!1},n=S!==null;if(S=null,e.dispatch(O()),n||x.reset(),r.durationMs<Lr){s.autoSend&&e.dispatch(G());return}e.dispatch(Ge({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{g===t&&(g=null),S=null,e.dispatch(O()),e.showHint(Dr(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});g=t,e.dispatch(qe()),t.start().then(r=>{if(r!=="recording"&&(g===t&&(g=null),r==="discarded")){const s=S?.autoSend===!0;S=null,e.dispatch(O()),s&&e.dispatch(G())}})}function ve(e,t){const r=g;if(r===null){t.autoSend&&e?.dispatch(G());return}S=t,r.stop()}function Si(){ve(null,xr)}function _i(e){x.reset(),k=0,S=null;const t=g;t!==null&&(g=null,t.cancel(),e.dispatch(O()))}const Br=K("HardwareConsoleVoiceSetupToast"),Wr="hardware-console-voice-setup";let U=null;function Vr(){return U||(U=Fe(()=>Promise.resolve().then(()=>Pt),void 0,import.meta.url).then(e=>e.notify)),U}function Ur(){wt("/settings?tab=connections#voice").catch(e=>{Br.error("Failed to open voice settings from setup toast",e)})}function Gr(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>Ur()}}function vi(){Vr().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Wr,action:Gr()})})}const Ai=i.createSelector(e=>e.externalEditors.selectedAction),qr=i.createSelector(e=>e.externalEditors.editors),Hr=i.createSelector(e=>{const t=y(qr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),n=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...n,...t.filter(({id:c})=>!o.has(c))]}),ki=i.createSelector(e=>e.externalEditors.editorOrder??[]),Ei=i.createSelector(e=>e.externalEditors.loading),Mi=i.createSelector(e=>e.externalEditors.lastFetched),jr=i.createSelector(e=>e.externalEditors.hiddenEditorIds),yi=i.createSelector((e,t)=>{if(!(t?tt.select(e,t):rt.select(e)))return[];const s=jr.select(e);return Hr.select(e).filter(n=>n.installed&&!s.includes(n.id))});function Ri(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Kr=0;function zr(e,t){const r=++Kr;return i.dispatch(je(e,t,r)),r}function Ci(e,t,r){i.dispatch(He(e,t,r))}async function Ae(e,t,r,s){const n=crypto.randomUUID(),o=s?.source??"control";try{return(await i.dispatch(Ke({requestId:n,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:ce.select(i.state)},{...s,intent:s?.intent??zr(e,t)}))).status==="success"}finally{i.dispatch(ze(n,o))}}async function wi(e,t,r,s,n){return Ae(e,t,{kind:"effort",effort:r,previous:s},n)}async function Pi(e,t,r,s,n){return Ae(e,t,{kind:"reconcile",current:r??null,levels:s},n)}const $r=i.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Ii=i.createSelector((e,t)=>$r.select(e,t).some(r=>r.status==="pending")),Oi=i.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],n=st.select(e,t),o=ft.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=gt(c),p=l?ht(s?.model,null,o):s?.model;return{session:s,providerId:n,levels:o,legacy:l,identity:JSON.stringify([p,n]),connection:ce.select(e),canWrite:!!s&&s.workspaceId===r&&!nt.select(e,r)}});function Xr(e,t,r=!1){return e!=="auggie"||t===!0||r}const Ti=i.createSelector(e=>mt.select(e)?null:$.select(e)),Qr=i.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),m=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Fi=i.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),Li=i.createSelector((e,t)=>!!m.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Qr.select(e)),ke=i.createSelector((e,t)=>t?m.select(e,t)?.catalog.providers??[]:it.select(e)),Ee=i.createSelector((e,t)=>{if(!t)return le.select(e);const r=m.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),ee=i.createSelector((e,t)=>{if(!t)return bt.select(e);const r=m.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),Me=i.createSelector((e,t)=>{if(!t)return St.select(e);const r=ee.select(e,t),s=Ee.select(e,t),n=m.select(e,t)?.readiness??{};return ke.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&n[o.id]?.available).map(o=>o.id)}),Di=i.createSelector((e,t)=>{const r=ee.select(e,t),s=t?m.select(e,t)?.readiness??{}:$.select(e);return ke.select(e,t).filter(n=>Xr(n.id,s[n.id]?.available,r[n.id]===!0)).map(n=>n.id)}),xi=i.createSelector((e,t)=>t?Me.select(e,t):_t.select(e)),Ni=i.createSelector((e,t)=>v.select(e,t)),Bi=i.createSelector((e,t)=>t?!!m.select(e,t):vt.select(e)),Wi=i.createSelector((e,t)=>{if(!t)return At.select(e);const r=m.select(e,t)?.settings??[],s=Ee.select(e,t),n=r.find(l=>l.path==="model.providerDefaults")?.value,o=n&&typeof n=="object"?n[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Vi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):kt.select(e)),Ui=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Et.select(e)),Gi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):Mt.select(e)),qi=i.createSelector((e,t,r)=>{if(!r)return yt.select(e,t);const s=ee.select(e,r),n=m.select(e,r);return Me.select(e,r).filter(o=>o!==t&&(s[o]||n?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Rt(o,n?.readiness[o]?.authenticated))}),Hi=i.createSelector((e,t)=>t?m.select(e,t)?.readiness??{}:$.select(e)),Yr={},ji=i.createSelector(e=>e.providerSettings?.profiles?.status??Yr),Ki=i.createSelector(e=>e.directoryPicker.listing),zi=i.createSelector(e=>e.directoryPicker.loading),$i=i.createSelector(e=>e.directoryPicker.error),Xi=i.createSelector(e=>e.directoryPicker.pathError),Qi=i.createSelector(e=>e.directoryPicker.createError),ae={},Zr=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Yi=i.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(n=>n.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Zi=i.createSelector(e=>e.mcpSettings.loading),Ji=i.createSelector(e=>e.mcpSettings.error),ea=i.createSelector(e=>e.mcpSettings.mutationError??null),ta=i.createSelector(e=>e.mcpSettings.enabled),Jr=i.createSelector(e=>e.mcpSettings.disabledServers),es=i.createSelector(e=>e.mcpSettings.statusMap),ts=i.createSelector(e=>e.mcpSettings.toolsMap),rs=i.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(n=>[n.id,R(n)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(n=>{const o=s.get(n.serverId);return o&&n.lastError?[[o,n.lastError]]:[]}))}),ss=i.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??ae:ae),ra=i.createSelector((e,t)=>Object.keys(ss.select(e,t))),sa=i.createSelector(e=>{const t=Zr.select(e),r=es.select(e),s=ts.select(e),n=Jr.select(e),o=rs.select(e);return t.map(c=>{const l=R(c)in n,p=s[R(c)]||[];let b=r[R(c)]||"disconnected";return l&&(b="disabled"),{...c,disabled:l,status:b,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});i.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const na=i.createSelector(e=>e.mcpSettings.lastImportedCount),ia=i.createSelector(e=>e.mcpSettings.advancedSaveStatus),aa=i.createSelector(e=>e.mcpSettings.advancedSaveError),oa=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],ns=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],ca=Object.fromEntries(ns.map(e=>[e.path,e.defaultValue]));export{Ci as $,mi as A,bi as B,Pt as C,Ds as D,Mn as E,ns as F,de as G,Ar as H,Xr as I,gi as J,Ri as K,re as L,fi as M,Er as N,gn as O,yn as P,P as Q,A as R,E as S,zr as T,lr as U,un as V,br as W,fn as X,dn as Y,er as Z,Pi as _,ca as a,ws as a$,Sn as a0,kr as a1,cr as a2,Gn as a3,ci as a4,Ii as a5,$r as a6,Oi as a7,Bs as a8,qs as a9,nn as aA,Xs as aB,Bn as aC,oi as aD,Tn as aE,Qs as aF,Ys as aG,Ws as aH,Gs as aI,X as aJ,Ot as aK,Nt as aL,Bt as aM,ue as aN,xt as aO,Tt as aP,It as aQ,Lt as aR,Dt as aS,Cs as aT,Is as aU,Os as aV,Fs as aW,Es as aX,ys as aY,Ps as aZ,Rs as a_,ur as aa,xi as ab,Ee as ac,ee as ad,Di as ae,Me as af,ke as ag,Ui as ah,Gi as ai,Vi as aj,qi as ak,Hi as al,Bi as am,Wi as an,Ni as ao,pr as ap,Us as aq,Dn as ar,js as as,Qi as at,$i as au,Ki as av,zi as aw,Xi as ax,ki as ay,Zs as az,oa as b,Xn as b$,Ms as b0,Ts as b1,ks as b2,Ls as b3,tn as b4,jr as b5,Nn as b6,Hr as b7,yi as b8,Ei as b9,J as bA,Z as bB,Ln as bC,Cn as bD,Ti as bE,qt as bF,on as bG,cn as bH,sn as bI,an as bJ,$s as bK,rn as bL,v as bM,Hs as bN,Wn as bO,xn as bP,gr as bQ,Se as bR,Vs as bS,ii as bT,Qn as bU,si as bV,ni as bW,Zn as bX,ti as bY,ei as bZ,Yn as b_,Js as ba,en as bb,Mi as bc,Pn as bd,ie as be,wn as bf,be as bg,aa as bh,ia as bi,Jr as bj,ta as bk,Ji as bl,rs as bm,na as bn,Zi as bo,ea as bp,Zr as bq,sa as br,es as bs,ts as bt,Ai as bu,zs as bv,ji as bw,Fn as bx,On as by,In as bz,h as c,$n as c0,ai as c1,zn as c2,Jn as c3,ri as c4,m as c5,Qr as c6,Li as c7,Fi as c8,ra as c9,Yi as ca,li as cb,ui as cc,vi as cd,kn as ce,Q as cf,D as cg,En as ch,Nr as ci,Rn as cj,Si as ck,qn as cl,Un as cm,Hn as cn,Vn as co,Gr as cp,ln as cq,An as d,bn as e,_n as f,vn as g,hn as h,fe as i,mn as j,he as k,wi as l,_i as m,Mr as n,wr as o,di as p,pi as q,Ks as r,Gt as s,Ut as t,pn as u,hi as v,jn as w,Kn as x,xs as y,Ns as z};
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./BVpTbT83.js";import{d as mt,g as lt,f as xt,e as kt}from"./Deqxq6ha.js";import{U as _t,aZ as vt,V as bt,a_ as wt,Y as Tt,b0 as St,b as s,X as R,aW as H,B as $t,r as Mt,d as it}from"./8NIig13l.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./D-uXrjxi.js";import{d as mt,g as lt,f as xt,e as kt}from"./B_l8hqmB.js";import{U as _t,aZ as vt,V as bt,a_ as wt,Y as Tt,b0 as St,b as s,X as R,aW as H,B as $t,r as Mt,d as it}from"./CNt46_Sl.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+W.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:W})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{C as M}from"./BvFAWM27.js";import{a as v}from"./BdWqymET.js";import{d as C}from"./BV3MrUXO.js";import{Ix as o,Ds as E,CU as _,g as A,uL as O,ul as D,fW as H,Ca as L,Cs as P,Es as R,Ce as x}from"./DNqM68dO.js";import{aZ as p}from"./VZEkDWIM.js";import{d as W}from"./B0Z-1lwJ.js";import{n as B}from"./CGy2WPjn.js";import{o as F,e as q}from"./BPpJ5XOM.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function I(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function K(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&I(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function U(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await C.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":q(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await B(d):await F(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(D(s,{agentId:n}));const f=await K(n,a,t);f&&T(n,a);const i=f||await U(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||W("chat:open-message",b)},w)}export{ee as openMessage,U as seekConversationToMessage};
1
+ import{C as M}from"./BvFAWM27.js";import{a as v}from"./BdWqymET.js";import{d as C}from"./BV3MrUXO.js";import{Ix as o,Ds as E,CU as _,g as A,uL as O,ul as D,fW as H,Ca as L,Cs as P,Es as R,Ce as x}from"./DNqM68dO.js";import{aZ as p}from"./VZEkDWIM.js";import{d as W}from"./B0Z-1lwJ.js";import{n as B}from"./BbjrS_gZ.js";import{o as F,e as q}from"./DUPPDYfv.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function I(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function K(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&I(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function U(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await C.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":q(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await B(d):await F(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(D(s,{agentId:n}));const f=await K(n,a,t);f&&T(n,a);const i=f||await U(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||W("chat:open-message",b)},w)}export{ee as openMessage,U as seekConversationToMessage};
@@ -1 +1 @@
1
- import"./DYhIMPy1.js";import{p as r}from"./5yPZRZCV.js";const t={get error(){return r.error},get params(){return r.params},get state(){return r.state},get status(){return r.status},get url(){return r.url}},s=t;export{s as p};
1
+ import"./DYhIMPy1.js";import{p as r}from"./Be14EhuN.js";const t={get error(){return r.error},get params(){return r.params},get state(){return r.state},get status(){return r.status},get url(){return r.url}},s=t;export{s as p};
@@ -1,4 +1,4 @@
1
- import{bp as y,t as wt,br as J,a_ as D,bz as xt,bt as Tt,b as kt,bv as N}from"./O1QHAURn.js";import{bs as It,ca as Q,aD as t,a7 as St,ay as X,W as w,bn as At,bS as F,c9 as f,aA as M,aB as T,a5 as I,bA as S,bl as A,b_ as L,bO as P}from"./DYhIMPy1.js";import{G as Pt}from"./CovkQMd0.js";import{c as Wt}from"./C2mPABxH.js";import{C as V}from"./DypB-Dwi.js";import{L as $t}from"./CSiaiLHL.js";import"./C33ol_Co.js";import"./CAyg2ijY.js";import"./BBDxUL80.js";import{bc as Dt}from"./B0f-om7y.js";import"./CR_t_AVn.js";import"./DMUjpYuS.js";import{Ix as B,J2 as Nt,Jj as Ft,J7 as Lt,uS as Bt}from"./DNqM68dO.js";import{T as Et}from"./MfgLK08j.js";import{g as Ut}from"./DfN8_dcw.js";import{dr as Ot}from"./VZEkDWIM.js";import{bR as jt,bL as Ht,b6 as Jt}from"./K_GlKbLA.js";import"./BgCTNfXj.js";import{M as Mt}from"./C64Iv2ib.js";import{V as Rt}from"./CyQ_uOB0.js";import{O as Vt}from"./BhdaCqy0.js";import{c as Gt}from"./ChTqQfQN.js";import{i as qt}from"./H2jLkRRS.js";const x=new $t({category:"change-converters"});function R(e,n){return e.path||e.file||e.filePath||e.relativePath||n?.filePath}function Y(e,n){return{additions:e.additions??n?.additions??0,deletions:e.deletions??n?.deletions??0,binary:e.binary??!1}}function zt(e,n){if(n.actor?.type==="agent"&&n.actor.id){const r=n.actor;return{agentId:r.id,agentName:r.name||y.fileTracking_changeTimeline_agent_fallback(),sessionId:r.sessionId||e.sessionId||"",turnNumber:r.turnNumber??e.turnNumber??0,messageId:r.messageId,timestamp:new Date(n.timestamp).getTime()}}if(e.agentId)return{agentId:e.agentId,agentName:e.agentName||y.fileTracking_changeTimeline_agent_fallback(),sessionId:e.sessionId||"",turnNumber:e.turnNumber||0,timestamp:new Date(n.timestamp).getTime()}}function Z(e,n){return{timestamp:new Date(e.timestamp).getTime(),manual:e.actor?.type==="user",agent:zt(n,e)}}function tt(e,n){return{oldContent:n?.oldContent??e.oldContent,newContent:n?.newContent??e.newContent,diff:e.diff??n?.diff}}function et(e,n,r){return r!==void 0?`${e}-${n}-${r}`:`${e}-${n}`}function Kt(e){try{const n=e.data||{},r=e.codeChange;x.debug("Converting event to TrackedChange",{eventType:e.type,eventId:e.id,hasData:!!n,hasCodeChange:!!r});const c=R(n,r);if(e.type.startsWith("file:")&&c){const d=Y(n,r);return x.debug("Creating TrackedChange for file event",{filePath:c,stats:d,hasDiff:!!(n.diff||r?.diff)}),[{id:et("event",e.id),file:c,relativePath:c,stage:V.Unstaged,stats:d,attribution:Z(e,n),content:tt(n,r)}]}return(e.type==="agent:completed"||e.type.startsWith("agent:"))&&n.fileChanges&&Array.isArray(n.fileChanges)?(x.debug("Creating TrackedChanges for agent event",{eventType:e.type,fileChangesCount:n.fileChanges.length,agentId:n.agentId}),n.fileChanges.filter(d=>R(d)?!0:(x.warn("Skipping file change without path",{change:d}),!1)).map((d,s)=>{const v=R(d);if(!v)throw new Error("file change without path");return{id:et("event",e.id,s),file:v,relativePath:v,stage:V.Unstaged,stats:Y(d),attribution:Z(e,n),content:tt(d)}})):(x.debug("No TrackedChanges created for event",{eventType:e.type,eventId:e.id,hasFilePath:!!c,hasFileChanges:!!(n.fileChanges&&Array.isArray(n.fileChanges))}),[])}catch(n){return x.error("Error converting event to TrackedChange",n instanceof Error?n:new Error(String(n)),{eventType:e.type,eventId:e.id}),[]}}function Qt(e){if(!e)return{oldContent:"",newContent:""};const n=[],r=[],c=e.split(`
1
+ import{bp as y,t as wt,br as J,a_ as D,bz as xt,bt as Tt,b as kt,bv as N}from"./O1QHAURn.js";import{bs as It,ca as Q,aD as t,a7 as St,ay as X,W as w,bn as At,bS as F,c9 as f,aA as M,aB as T,a5 as I,bA as S,bl as A,b_ as L,bO as P}from"./DYhIMPy1.js";import{G as Pt}from"./CovkQMd0.js";import{c as Wt}from"./C2mPABxH.js";import{C as V}from"./DypB-Dwi.js";import{L as $t}from"./CSiaiLHL.js";import"./XyeZJ2nm.js";import"./CAyg2ijY.js";import"./BBDxUL80.js";import{bc as Dt}from"./B0f-om7y.js";import"./CR_t_AVn.js";import"./CvF0K_Ij.js";import{Ix as B,J2 as Nt,Jj as Ft,J7 as Lt,uS as Bt}from"./DNqM68dO.js";import{T as Et}from"./B2xn6k89.js";import{g as Ut}from"./DfN8_dcw.js";import{dr as Ot}from"./VZEkDWIM.js";import{bR as jt,bL as Ht,b6 as Jt}from"./CNLEkESE.js";import"./BgCTNfXj.js";import{M as Mt}from"./C64Iv2ib.js";import{V as Rt}from"./CyQ_uOB0.js";import{O as Vt}from"./vL5AniQ9.js";import{c as Gt}from"./ChTqQfQN.js";import{i as qt}from"./H2jLkRRS.js";const x=new $t({category:"change-converters"});function R(e,n){return e.path||e.file||e.filePath||e.relativePath||n?.filePath}function Y(e,n){return{additions:e.additions??n?.additions??0,deletions:e.deletions??n?.deletions??0,binary:e.binary??!1}}function zt(e,n){if(n.actor?.type==="agent"&&n.actor.id){const r=n.actor;return{agentId:r.id,agentName:r.name||y.fileTracking_changeTimeline_agent_fallback(),sessionId:r.sessionId||e.sessionId||"",turnNumber:r.turnNumber??e.turnNumber??0,messageId:r.messageId,timestamp:new Date(n.timestamp).getTime()}}if(e.agentId)return{agentId:e.agentId,agentName:e.agentName||y.fileTracking_changeTimeline_agent_fallback(),sessionId:e.sessionId||"",turnNumber:e.turnNumber||0,timestamp:new Date(n.timestamp).getTime()}}function Z(e,n){return{timestamp:new Date(e.timestamp).getTime(),manual:e.actor?.type==="user",agent:zt(n,e)}}function tt(e,n){return{oldContent:n?.oldContent??e.oldContent,newContent:n?.newContent??e.newContent,diff:e.diff??n?.diff}}function et(e,n,r){return r!==void 0?`${e}-${n}-${r}`:`${e}-${n}`}function Kt(e){try{const n=e.data||{},r=e.codeChange;x.debug("Converting event to TrackedChange",{eventType:e.type,eventId:e.id,hasData:!!n,hasCodeChange:!!r});const c=R(n,r);if(e.type.startsWith("file:")&&c){const d=Y(n,r);return x.debug("Creating TrackedChange for file event",{filePath:c,stats:d,hasDiff:!!(n.diff||r?.diff)}),[{id:et("event",e.id),file:c,relativePath:c,stage:V.Unstaged,stats:d,attribution:Z(e,n),content:tt(n,r)}]}return(e.type==="agent:completed"||e.type.startsWith("agent:"))&&n.fileChanges&&Array.isArray(n.fileChanges)?(x.debug("Creating TrackedChanges for agent event",{eventType:e.type,fileChangesCount:n.fileChanges.length,agentId:n.agentId}),n.fileChanges.filter(d=>R(d)?!0:(x.warn("Skipping file change without path",{change:d}),!1)).map((d,s)=>{const v=R(d);if(!v)throw new Error("file change without path");return{id:et("event",e.id,s),file:v,relativePath:v,stage:V.Unstaged,stats:Y(d),attribution:Z(e,n),content:tt(d)}})):(x.debug("No TrackedChanges created for event",{eventType:e.type,eventId:e.id,hasFilePath:!!c,hasFileChanges:!!(n.fileChanges&&Array.isArray(n.fileChanges))}),[])}catch(n){return x.error("Error converting event to TrackedChange",n instanceof Error?n:new Error(String(n)),{eventType:e.type,eventId:e.id}),[]}}function Qt(e){if(!e)return{oldContent:"",newContent:""};const n=[],r=[],c=e.split(`
2
2
  `);c.length>0&&c[c.length-1]===""&&c.pop();let d=!1;for(const s of c)if(!(s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("\"))){if(s.startsWith("@@")){d=!0;continue}d&&(s.startsWith("+")?r.push(s.slice(1)):s.startsWith("-")?n.push(s.slice(1)):s.startsWith(" ")?(n.push(s.slice(1)),r.push(s.slice(1))):s===""&&(n.push(""),r.push("")))}return{oldContent:n.join(`
3
3
  `),newContent:r.join(`
4
4
  `)}}var Xt=T("<!> <!>",1),Yt=T('<div class="flex items-center gap-1.5 px-3 py-1.5 text-xs text-subtle bg-muted/50 border-b border-border"><span> </span></div>'),Zt=T('<div class="flex flex-col h-full"><!> <div class="flex-1 min-h-0"><!></div></div>'),te=T('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <p class="text-xs opacity-70"> </p></div>'),ee=T('<p class="text-xs opacity-70"> </p>'),ne=T('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <!></div>');function ae(e,n){if(new.target)return wt({component:ae,...e});It(n,!0);const r=()=>N(lt,"$workspace",v),c=()=>N(st,"$foldUnchanged",v),d=()=>N(rt,"$lineWrapping",v),s=()=>N(ot,"$diffSideBySide",v),[v,nt]=Tt(),at=a=>{Rt(a,{embedded:!0,get foldEnabled(){return c()},onToggleFold:()=>B.dispatch(Lt()),get wrapEnabled(){return d()},onToggleWrap:()=>B.dispatch(Ft()),get splitEnabled(){return s()},onToggleSplit:()=>B.dispatch(Nt())})},it=a=>{var i=Xt(),g=X(i);{let m=f(()=>y.layout_diffHeader_goToFile_tooltip());Wt(g,()=>Mt,(l,h)=>{h(l,{get icon(){return Dt},get label(){return t(m)},onclick:$=>ut()})})}var C=F(g,2);{var b=m=>{Vt(m,{get filePath(){return t(q)},get workspaceId(){return _()},isDirectory:!1,embedded:!0,get workspaceFolderPath(){return t(O)}})};D(C,m=>{t(q)&&m(b)})}w(a,i)},rt=jt(),st=Ht(),ot=Jt(),dt=Gt("ActivityChangesTabType");let E=J(n,"tab",7),_=J(n,"workspaceId",7),U=J(n,"isActive",7);const G=Ut(),lt=Ot(_()),O=f(()=>r()?.worktreePath||r()?.repositoryPath||void 0),o=f(()=>E().data?.event),ct=f(()=>t(o)?Kt(t(o)):[]),u=f(()=>t(ct)[0]),p=f(()=>t(u)?.relativePath||t(u)?.file||null),q=f(()=>t(p)&&t(O)?qt(t(p))?t(p):`${t(O)}/${t(p)}`:null),j=f(()=>()=>{if(!t(o))return null;const a=t(o).data,i=t(o).codeChange;return a?.diff||i?.diff||t(u)?.content?.diff||null}),z=f(()=>()=>t(u)?.content?!!(t(u).content.oldContent&&t(u).content.newContent):!1);function ft(a){if(!a)return;const i=a.match(/@@ -(\d+)/);return i?parseInt(i[1],10):void 0}const k=f(()=>{if(t(z)()&&t(u)?.content)return{oldContent:t(u).content.oldContent??"",newContent:t(u).content.newContent??""};const a=t(j)();return a?Qt(a):null}),W=f(()=>ft(t(j)())),pt=f(()=>t(W)!==void 0&&t(W)>1),gt=f(()=>{const a=t(p)||"",i=t(o)?.data||{};return{id:`activity-${t(o)?.id||"unknown"}-${a}`,file:a,relativePath:a,stage:V.Committed,status:t(u)?.status||"modified",stats:{additions:i?.additions||t(u)?.stats?.additions||0,deletions:i?.deletions||t(u)?.stats?.deletions||0},attribution:{timestamp:t(o)?.timestamp?new Date(t(o).timestamp).getTime():Date.now()},content:t(k)?{oldContent:t(k).oldContent,newContent:t(k).newContent}:void 0}});function ut(a){if(!t(p))return;const g={type:"file",title:t(p).split("/").pop()||t(p),closable:!0,filePath:t(p),workspaceId:_()};B.dispatch(Bt(_(),g))}Q(()=>{!G||!U()||G.registerActions({display:at,actions:it})}),Q(()=>{if(t(o)){const a=t(o).data;dt.debug("Activity event diff info",{eventType:t(o).type,eventId:t(o).id,filePath:t(p),hasDiffString:!!t(j)(),hasOldNewContent:t(z)(),hasDiffContents:!!t(k),dataAdditions:a?.additions,dataDeletions:a?.deletions})}});var ht={get tab(){return E()},set tab(a){E(a),M()},get workspaceId(){return _()},set workspaceId(a){_(a),M()},get isActive(){return U()},set isActive(a){U(a),M()},$set:xt,$on:(a,i)=>kt(n,a,i)},K=St(),mt=X(K);{var vt=a=>{var i=Zt(),g=I(i);{var C=l=>{var h=Yt(),$=I(h),H=A($,!0);S(h),L(_t=>P(H,_t),[()=>y.layout_activityChanges_partialDiff_label({line:t(W)??0})]),w(l,h)};D(g,l=>{t(pt)&&l(C)})}var b=F(g,2),m=I(b);Pt(m,()=>`${t(o)?.id}-${t(p)}`,l=>{{let h=f(()=>s()?"split":"unified");Et(l,{get change(){return t(gt)},get workspaceId(){return _()},get viewMode(){return t(h)},get foldUnchanged(){return c()},get lineWrapping(){return d()},get lineOffset(){return t(W)}})}}),S(b),S(i),w(a,i)},Ct=a=>{var i=te(),g=I(i),C=A(g,!0),b=F(g,2),m=A(b,!0);S(i),L((l,h)=>{P(C,l),P(m,h)},[()=>y.layout_activityChanges_noDiffStored_label(),()=>y.layout_activityChanges_diffNotCaptured_description()]),w(a,i)},bt=a=>{var i=ne(),g=I(i),C=A(g,!0),b=F(g,2);{var m=l=>{var h=ee(),$=A(h,!0);L(H=>P($,H),[()=>y.layout_activityChanges_eventType_label({type:t(o).type})]),w(l,h)};D(b,l=>{t(o)&&l(m)})}S(i),L(l=>P(C,l),[()=>y.layout_activityChanges_noChanges_label()]),w(a,i)};D(mt,a=>{t(p)&&t(k)?a(vt):t(p)?a(Ct,1):a(bt,-1)})}w(e,K);var yt=At(ht);return nt(),yt}export{ae as default};
@@ -1,4 +1,4 @@
1
- import{aZ as Ae,U as ke,Y as ae,b0 as Fe,V as Pe,a_ as ve,b as o,X as Vt,ay as bt,aW as Lt,B as Ce,r as Le,O as V,aV as Ee,a6 as De}from"./8NIig13l.js";import{l as ie}from"./LMfwm5GA.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],zt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],X=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Xt=[1,71],Ht=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
1
+ import{aZ as Ae,U as ke,Y as ae,b0 as Fe,V as Pe,a_ as ve,b as o,X as Vt,ay as bt,aW as Lt,B as Ce,r as Le,O as V,aV as Ee,a6 as De}from"./CNt46_Sl.js";import{l as ie}from"./BsKnk4mK.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],zt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],X=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Xt=[1,71],Ht=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,2 +1,2 @@
1
- import{t as se,br as a,a_ as ie,bz as ae,b as le}from"./O1QHAURn.js";import{bs as oe,bV as ge,br as ue,ca as ce,bH as q,a5 as p,bA as m,bS as V,aD as C,b_ as P,W as w,bn as he,c9 as W,aA as l,bl as de,bO as me,aB as I}from"./DYhIMPy1.js";import{n as Y,v,p as fe,w as ve}from"./CAyg2ijY.js";import{z as be}from"./DMUjpYuS.js";import{H as R}from"./CcNhqKh5.js";import{C as _e}from"./B6kyqBFl.js";function A(r){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return r.replace(/[&<>"']/g,n=>t[n])}const pe=300,Ce=2e6,xe=1e5,u=new Map;let X=0;function Q(r,t){return`${t}\0${r}`}function Z(r,t){const n=Q(r,t),s=u.get(n);return s===void 0?null:(u.delete(n),u.set(n,s),s)}function F(r){const t=u.get(r);t!==void 0&&(X-=r.length+t.length,u.delete(r))}function He(r,t){F(r);const n=r.length+t.length;if(!(n>xe)){for(;u.size>=pe||u.size>0&&X+n>Ce;){const s=u.keys().next().value;if(s===void 0)break;F(s)}u.set(r,t),X+=n}}function ye(){return new Promise(r=>{typeof requestIdleCallback=="function"?requestIdleCallback(()=>r(),{timeout:200}):setTimeout(r,0)})}function Ne(r,t){try{return t&&R.getLanguage(t)?R.highlight(r,{language:t}).value:R.highlightAuto(r).value}catch{return A(r)}}const k=new Map;function Le(r,t,n){const s=Q(r,t),f=u.get(s);if(f!==void 0)return Promise.resolve(f);const c=k.get(s);if(c)return c.staleChecks.push(n??(()=>!1)),c.promise;const g={staleChecks:[n??(()=>!1)],promise:Promise.resolve("")};return g.promise=ye().then(()=>{if(k.get(s)===g&&k.delete(s),g.staleChecks.every(x=>x()))return A(r);const b=Ne(r,t);return He(s,b),b}),k.set(s,g),g.promise}var we=I("<div> </div>"),ke=I('<div class="line-numbers-gutter select-none text-right flex-shrink-0 py-3 pl-3 pr-2 svelte-1irg7m4"></div>'),Ae=I("<div></div>"),Ie=I('<div><div class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10"><!></div> <div class="flex"><!> <div><pre><code></code></pre></div></div></div>');function Se(r,t){if(new.target)return se({component:Se,...r});oe(t,!0);const n=a(t,"code",7,""),s=a(t,"language",7,"plaintext"),f=a(t,"showLineNumbers",7,!1),c=a(t,"startLineNumber",7,1),g=a(t,"highlightLines",23,()=>[]),b=a(t,"fileName",7,""),x=a(t,"filename",7,""),H=a(t,"maxHeight",7,void 0),S=a(t,"noBorder",7,!1),y=a(t,"noMargin",7,!1),M=a(t,"doScroll",7,!0),B=a(t,"className",7,"");let N=ge(ue(Z(n(),s())??A(n())));ce(()=>{const e=n(),i=s(),h=Z(e,i);if(h!==null){q(N,h,!0);return}q(N,A(e),!0);let o=!1;return Le(e,i,()=>o).then(d=>{o||q(N,d,!0)}),()=>{o=!0}});const j=W(()=>C(N).split(`
1
+ import{t as se,br as a,a_ as ie,bz as ae,b as le}from"./O1QHAURn.js";import{bs as oe,bV as ge,br as ue,ca as ce,bH as q,a5 as p,bA as m,bS as V,aD as C,b_ as P,W as w,bn as he,c9 as W,aA as l,bl as de,bO as me,aB as I}from"./DYhIMPy1.js";import{n as Y,v,p as fe,w as ve}from"./CAyg2ijY.js";import{z as be}from"./CvF0K_Ij.js";import{H as R}from"./CcNhqKh5.js";import{C as _e}from"./B6kyqBFl.js";function A(r){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return r.replace(/[&<>"']/g,n=>t[n])}const pe=300,Ce=2e6,xe=1e5,u=new Map;let X=0;function Q(r,t){return`${t}\0${r}`}function Z(r,t){const n=Q(r,t),s=u.get(n);return s===void 0?null:(u.delete(n),u.set(n,s),s)}function F(r){const t=u.get(r);t!==void 0&&(X-=r.length+t.length,u.delete(r))}function He(r,t){F(r);const n=r.length+t.length;if(!(n>xe)){for(;u.size>=pe||u.size>0&&X+n>Ce;){const s=u.keys().next().value;if(s===void 0)break;F(s)}u.set(r,t),X+=n}}function ye(){return new Promise(r=>{typeof requestIdleCallback=="function"?requestIdleCallback(()=>r(),{timeout:200}):setTimeout(r,0)})}function Ne(r,t){try{return t&&R.getLanguage(t)?R.highlight(r,{language:t}).value:R.highlightAuto(r).value}catch{return A(r)}}const k=new Map;function Le(r,t,n){const s=Q(r,t),f=u.get(s);if(f!==void 0)return Promise.resolve(f);const c=k.get(s);if(c)return c.staleChecks.push(n??(()=>!1)),c.promise;const g={staleChecks:[n??(()=>!1)],promise:Promise.resolve("")};return g.promise=ye().then(()=>{if(k.get(s)===g&&k.delete(s),g.staleChecks.every(x=>x()))return A(r);const b=Ne(r,t);return He(s,b),b}),k.set(s,g),g.promise}var we=I("<div> </div>"),ke=I('<div class="line-numbers-gutter select-none text-right flex-shrink-0 py-3 pl-3 pr-2 svelte-1irg7m4"></div>'),Ae=I("<div></div>"),Ie=I('<div><div class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10"><!></div> <div class="flex"><!> <div><pre><code></code></pre></div></div></div>');function Se(r,t){if(new.target)return se({component:Se,...r});oe(t,!0);const n=a(t,"code",7,""),s=a(t,"language",7,"plaintext"),f=a(t,"showLineNumbers",7,!1),c=a(t,"startLineNumber",7,1),g=a(t,"highlightLines",23,()=>[]),b=a(t,"fileName",7,""),x=a(t,"filename",7,""),H=a(t,"maxHeight",7,void 0),S=a(t,"noBorder",7,!1),y=a(t,"noMargin",7,!1),M=a(t,"doScroll",7,!0),B=a(t,"className",7,"");let N=ge(ue(Z(n(),s())??A(n())));ce(()=>{const e=n(),i=s(),h=Z(e,i);if(h!==null){q(N,h,!0);return}q(N,A(e),!0);let o=!1;return Le(e,i,()=>o).then(d=>{o||q(N,d,!0)}),()=>{o=!0}});const j=W(()=>C(N).split(`
2
2
  `)),U=W(()=>Array.from({length:C(j).length},(e,i)=>c()+i));var $={get code(){return n()},set code(e=""){n(e),l()},get language(){return s()},set language(e="plaintext"){s(e),l()},get showLineNumbers(){return f()},set showLineNumbers(e=!1){f(e),l()},get startLineNumber(){return c()},set startLineNumber(e=1){c(e),l()},get highlightLines(){return g()},set highlightLines(e=[]){g(e),l()},get fileName(){return b()},set fileName(e=""){b(e),l()},get filename(){return x()},set filename(e=""){x(e),l()},get maxHeight(){return H()},set maxHeight(e=void 0){H(e),l()},get noBorder(){return S()},set noBorder(e=!1){S(e),l()},get noMargin(){return y()},set noMargin(e=!1){y(e),l()},get doScroll(){return M()},set doScroll(e=!0){M(e),l()},get className(){return B()},set className(e=""){B(e),l()},$set:ae,$on:(e,i)=>le(t,e,i)},_=Ie();let D;var z=p(_),ee=p(z);_e(ee,{get text(){return n()},size:"xs",class:"bg-background/80 hover:bg-hover text-muted-foreground hover:text-foreground backdrop-blur-sm"}),m(z);var J=V(z,2),K=p(J);{var te=e=>{var i=ke();Y(i,20,()=>C(U),h=>h,(h,o)=>{var d=we();let L;var re=de(d,!0);P(ne=>{L=v(d,1,"line-number svelte-1irg7m4",null,L,{highlighted:ne}),me(re,o)},[()=>g().includes(o)]),w(h,d)}),m(i),w(e,i)};ie(K,e=>{f()&&e(te)})}var G=V(K,2),E=p(G);let O;var T=p(E);return Y(T,21,()=>C(j),fe,(e,i,h)=>{var o=Ae();let d;be(o,()=>C(i)||" ",!0),m(o),P(L=>d=v(o,1,"code-line svelte-1irg7m4",null,d,{highlighted:L}),[()=>g().includes(c()+h)]),w(e,o)}),m(T),m(E),m(G),m(J),m(_),P(()=>{D=v(_,1,`code-block-container group rounded-md overflow-hidden relative ${B()??""}`,"svelte-1irg7m4",D,{"mt-3":!y(),"mb-5":!y(),"no-border":S()}),ve(_,H()?`max-height: ${H()}px; overflow-y: auto;`:""),v(G,1,`flex-1 ${M()?"overflow-x-auto":""}`),O=v(E,1,"code-pre py-3 pr-3 bg-background! svelte-1irg7m4",null,O,{"pl-3":!f()}),v(T,1,`hljs language-${s()??""}`,"svelte-1irg7m4")}),w(r,_),he($)}export{Se as C};
@@ -1,4 +1,4 @@
1
- var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,br as M,a_ as we,bz as nr,b as rr,bv as dn,bt as So,bp as $e}from"./O1QHAURn.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as je,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./DYhIMPy1.js";import{n as ko,p as Eo,v as un,w as pi,u as cn}from"./CAyg2ijY.js";import{b as Ro}from"./p7znhYIU.js";import{b as pn}from"./BaIAhI85.js";import{h as Ao,c as Ye,w as lr,N as O,O as Jt,b2 as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,ab as cr,U as Ho,f as To,e as pr,T as Do,g as Mo,S as Io,a4 as Ze,a3 as Ve,C as Fo,G as gr,F as No,I as Po,A as At,ah as zo,$ as Ht,ad as Tt,v as St,a1 as Ti,s as J,r as Ue,an as wt,D as Uo,d as _o,aa as mr,b as gn,u as mn,aI as Oo,ap as ct,ac as Bo,K as Le,M as Ut,L as Vo,a0 as Dt,E as Wo,al as vr,a6 as Go,a2 as vn,t as br,af as ft,a5 as kt,ae as ot,ag as Sr,B as gi,a9 as mi,k as $o,aH as bn}from"./lo23QH6G.js";import{F as vi,c4 as jo,be as qo,at as Ko,as as Xo}from"./B0f-om7y.js";import{f as Di}from"./CR_t_AVn.js";import{g as Yo}from"./xEfOpOba.js";import{c as Qo}from"./B1mZq3ve.js";import{P as Jo}from"./Dci3uR78.js";import{t as Sn}from"./BkT9o_nd.js";class Zo extends Ao{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
1
+ var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,br as M,a_ as we,bz as nr,b as rr,bv as dn,bt as So,bp as $e}from"./O1QHAURn.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as je,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./DYhIMPy1.js";import{n as ko,p as Eo,v as un,w as pi,u as cn}from"./CAyg2ijY.js";import{b as Ro}from"./p7znhYIU.js";import{b as pn}from"./BaIAhI85.js";import{h as Ao,c as Ye,w as lr,N as O,O as Jt,b2 as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,ab as cr,U as Ho,f as To,e as pr,T as Do,g as Mo,S as Io,a4 as Ze,a3 as Ve,C as Fo,G as gr,F as No,I as Po,A as At,ah as zo,$ as Ht,ad as Tt,v as St,a1 as Ti,s as J,r as Ue,an as wt,D as Uo,d as _o,aa as mr,b as gn,u as mn,aI as Oo,ap as ct,ac as Bo,K as Le,M as Ut,L as Vo,a0 as Dt,E as Wo,al as vr,a6 as Go,a2 as vn,t as br,af as ft,a5 as kt,ae as ot,ag as Sr,B as gi,a9 as mi,k as $o,aH as bn}from"./D_DOc2Os.js";import{F as vi,c4 as jo,be as qo,at as Ko,as as Xo}from"./B0f-om7y.js";import{f as Di}from"./CR_t_AVn.js";import{g as Yo}from"./xEfOpOba.js";import{c as Qo}from"./B1mZq3ve.js";import{P as Jo}from"./CDiEfEmo.js";import{t as Sn}from"./BkT9o_nd.js";class Zo extends Ao{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
2
2
  `))&&(t=t.trim()),(!n.newlineIsToken||!i.includes(`
3
3
  `))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
4
4
  `)&&(t=t.slice(0,-1)),i.endsWith(`
@@ -1 +1 @@
1
- import{t as F,br as q,bp as H,a_ as C,bz as G,bt as dt,b as J,bv as nt}from"./O1QHAURn.js";import{bs as K,cd as lt,ca as j,c5 as ct,a5 as T,be as D,b$ as M,b_ as x,bO as _,W as l,bH as U,aD as e,bS as L,bA as B,bn as N,bV as it,aA as R,c9 as u,aB as v,bl as S,ay as pt}from"./DYhIMPy1.js";import{C as ut}from"./CqO_vGSb.js";import{f as V}from"./CR_t_AVn.js";import{k as vt}from"./D7PWKdEa.js";import{Ix as P,dp as bt,dm as kt,dq as _t}from"./DNqM68dO.js";var gt=v('<p class="p-2 text-xs text-subtle" data-testid="hook-script-content-too-large"> </p>'),ft=v('<div class="min-h-0 min-w-0 flex-1 overflow-auto" data-testid="hook-script-content-script"><!></div>'),mt=v('<span class="text-xs font-medium text-danger"> </span> <pre class="whitespace-pre-wrap break-all rounded bg-danger-background/10 p-2 font-mono text-xs text-danger"> </pre>',1),xt=v('<pre class="whitespace-pre-wrap break-all rounded bg-muted/40 p-2 font-mono text-xs text-subtle"> </pre>'),ht=v('<p class="text-xs text-subtle"> </p>'),wt=v('<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto" data-testid="hook-script-content-logs"><!> <!></div>'),It=v('<div class="flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden" data-testid="hook-script-content"><div class="flex shrink-0 border-b border-border" role="tablist"><!> <!></div> <!></div>');function Q(h,c){if(new.target)return F({component:Q,...h});K(c,!0);const g=()=>nt($,"$hooks$",w),[w,E]=dt();let s=q(c,"workspaceId",7),I=q(c,"hookId",7);const d=lt(s());j(()=>d.set(s()));const $=vt(d),b=u(()=>g().find(t=>t.hookId===I()));j(()=>{if(!s())return;const t=s();return ct(()=>{P.dispatch(bt(t)),P.dispatch(kt(t))}),()=>P.dispatch(_t(t))});let k=it("script");var X={get workspaceId(){return s()},set workspaceId(t){s(t),R()},get hookId(){return I()},set hookId(t){I(t),R()},$set:G,$on:(t,r)=>J(c,t,r)},z=It(),A=T(z),W=T(A);{let t=u(()=>e(k)==="script"),r=u(()=>e(k)==="script"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(W,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"script"),children:(p,y)=>{D();var i=M();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_scriptTab_label()]),l(p,i)},$$slots:{default:!0}})}var Y=L(W,2);{let t=u(()=>e(k)==="logs"),r=u(()=>e(k)==="logs"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(Y,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"logs"),children:(p,y)=>{D();var i=M();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_logsTab_label()]),l(p,i)},$$slots:{default:!0}})}B(A);var Z=L(A,2);{var tt=t=>{var r=ft(),p=T(r);{var y=a=>{var f=gt(),o=S(f,!0);x(n=>_(o,n),[()=>H.chat_backgroundHooks_modal_codeTooLarge_description({size:(e(b).codeBytes??0).toLocaleString()})]),l(a,f)},i=a=>{{let f=u(()=>e(b)?.code??"");ut(a,{get code(){return e(f)},language:"javascript",noMargin:!0})}};C(p,a=>{e(b)?.codeOmitted?a(y):a(i,-1)})}B(r),l(t,r)},et=t=>{var r=wt(),p=T(r);{var y=o=>{var n=mt(),m=pt(n),O=S(m,!0),at=L(m,2),ot=S(at,!0);x(st=>{_(O,st),_(ot,e(b).lastError)},[()=>H.chat_backgroundHooks_modal_lastError_label()]),l(o,n)};C(p,o=>{e(b)?.lastError&&o(y)})}var i=L(p,2);{var a=o=>{var n=xt(),m=S(n,!0);x(()=>_(m,e(b).lastLogs)),l(o,n)},f=o=>{var n=ht(),m=S(n,!0);x(O=>_(m,O),[()=>H.chat_backgroundHooks_modal_noLogs_description()]),l(o,n)};C(i,o=>{e(b)?.lastLogs?o(a):o(f,-1)})}B(r),l(t,r)};C(Z,t=>{e(k)==="script"?t(tt):t(et,-1)})}B(z),l(h,z);var rt=N(X);return E(),rt}var $t=v('<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden p-4" data-testid="hook-script-panel"><!></div>');function yt(h,c){if(new.target)return F({component:yt,...h});K(c,!0);let g=q(c,"tab",7),w=q(c,"workspaceId",7);var E={get tab(){return g()},set tab(d){g(d),R()},get workspaceId(){return w()},set workspaceId(d){w(d),R()},$set:G,$on:(d,$)=>J(c,d,$)},s=$t(),I=T(s);{let d=u(()=>g().workspaceId??w()),$=u(()=>g().hookId??"");Q(I,{get workspaceId(){return e(d)},get hookId(){return e($)}})}return B(s),l(h,s),N(E)}export{yt as default};
1
+ import{t as F,br as q,bp as H,a_ as C,bz as G,bt as dt,b as J,bv as nt}from"./O1QHAURn.js";import{bs as K,cd as lt,ca as j,c5 as ct,a5 as T,be as D,b$ as M,b_ as x,bO as _,W as l,bH as U,aD as e,bS as L,bA as B,bn as N,bV as it,aA as R,c9 as u,aB as v,bl as S,ay as pt}from"./DYhIMPy1.js";import{C as ut}from"./XLkjpXJr.js";import{f as V}from"./CR_t_AVn.js";import{k as vt}from"./D7PWKdEa.js";import{Ix as P,dp as bt,dm as kt,dq as _t}from"./DNqM68dO.js";var gt=v('<p class="p-2 text-xs text-subtle" data-testid="hook-script-content-too-large"> </p>'),ft=v('<div class="min-h-0 min-w-0 flex-1 overflow-auto" data-testid="hook-script-content-script"><!></div>'),mt=v('<span class="text-xs font-medium text-danger"> </span> <pre class="whitespace-pre-wrap break-all rounded bg-danger-background/10 p-2 font-mono text-xs text-danger"> </pre>',1),xt=v('<pre class="whitespace-pre-wrap break-all rounded bg-muted/40 p-2 font-mono text-xs text-subtle"> </pre>'),ht=v('<p class="text-xs text-subtle"> </p>'),wt=v('<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto" data-testid="hook-script-content-logs"><!> <!></div>'),It=v('<div class="flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden" data-testid="hook-script-content"><div class="flex shrink-0 border-b border-border" role="tablist"><!> <!></div> <!></div>');function Q(h,c){if(new.target)return F({component:Q,...h});K(c,!0);const g=()=>nt($,"$hooks$",w),[w,E]=dt();let s=q(c,"workspaceId",7),I=q(c,"hookId",7);const d=lt(s());j(()=>d.set(s()));const $=vt(d),b=u(()=>g().find(t=>t.hookId===I()));j(()=>{if(!s())return;const t=s();return ct(()=>{P.dispatch(bt(t)),P.dispatch(kt(t))}),()=>P.dispatch(_t(t))});let k=it("script");var X={get workspaceId(){return s()},set workspaceId(t){s(t),R()},get hookId(){return I()},set hookId(t){I(t),R()},$set:G,$on:(t,r)=>J(c,t,r)},z=It(),A=T(z),W=T(A);{let t=u(()=>e(k)==="script"),r=u(()=>e(k)==="script"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(W,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"script"),children:(p,y)=>{D();var i=M();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_scriptTab_label()]),l(p,i)},$$slots:{default:!0}})}var Y=L(W,2);{let t=u(()=>e(k)==="logs"),r=u(()=>e(k)==="logs"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(Y,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"logs"),children:(p,y)=>{D();var i=M();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_logsTab_label()]),l(p,i)},$$slots:{default:!0}})}B(A);var Z=L(A,2);{var tt=t=>{var r=ft(),p=T(r);{var y=a=>{var f=gt(),o=S(f,!0);x(n=>_(o,n),[()=>H.chat_backgroundHooks_modal_codeTooLarge_description({size:(e(b).codeBytes??0).toLocaleString()})]),l(a,f)},i=a=>{{let f=u(()=>e(b)?.code??"");ut(a,{get code(){return e(f)},language:"javascript",noMargin:!0})}};C(p,a=>{e(b)?.codeOmitted?a(y):a(i,-1)})}B(r),l(t,r)},et=t=>{var r=wt(),p=T(r);{var y=o=>{var n=mt(),m=pt(n),O=S(m,!0),at=L(m,2),ot=S(at,!0);x(st=>{_(O,st),_(ot,e(b).lastError)},[()=>H.chat_backgroundHooks_modal_lastError_label()]),l(o,n)};C(p,o=>{e(b)?.lastError&&o(y)})}var i=L(p,2);{var a=o=>{var n=xt(),m=S(n,!0);x(()=>_(m,e(b).lastLogs)),l(o,n)},f=o=>{var n=ht(),m=S(n,!0);x(O=>_(m,O),[()=>H.chat_backgroundHooks_modal_noLogs_description()]),l(o,n)};C(i,o=>{e(b)?.lastLogs?o(a):o(f,-1)})}B(r),l(t,r)};C(Z,t=>{e(k)==="script"?t(tt):t(et,-1)})}B(z),l(h,z);var rt=N(X);return E(),rt}var $t=v('<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden p-4" data-testid="hook-script-panel"><!></div>');function yt(h,c){if(new.target)return F({component:yt,...h});K(c,!0);let g=q(c,"tab",7),w=q(c,"workspaceId",7);var E={get tab(){return g()},set tab(d){g(d),R()},get workspaceId(){return w()},set workspaceId(d){w(d),R()},$set:G,$on:(d,$)=>J(c,d,$)},s=$t(),I=T(s);{let d=u(()=>g().workspaceId??w()),$=u(()=>g().hookId??"");Q(I,{get workspaceId(){return e(d)},get hookId(){return e($)}})}return B(s),l(h,s),N(E)}export{yt as default};
@@ -1,4 +1,4 @@
1
- import{g as Ut}from"./sl7qUXdR.js";import{s as Kt}from"./BE3wyntg.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./8NIig13l.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
1
+ import{g as Ut}from"./lpr2a93v.js";import{s as Kt}from"./CaGPXrgT.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./CNt46_Sl.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`