@intent-hq/web 2.389.2 → 2.390.0

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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{C0ar8e1U.js → -Zg6rfog.js} +1 -1
  3. package/web/app/immutable/chunks/{lPtzElq9.js → 2kr9sl0a.js} +1 -1
  4. package/web/app/immutable/chunks/{FVGAeFGR.js → 5Rw929MQ.js} +1 -1
  5. package/web/app/immutable/chunks/{BFiq0x-M.js → 6zHrL7ht.js} +1 -1
  6. package/web/app/immutable/chunks/{YH-zvTaG.js → 7MNwLg3l.js} +1 -1
  7. package/web/app/immutable/chunks/{BYZgkpv-.js → 8NmvrAbf.js} +1 -1
  8. package/web/app/immutable/chunks/{BmGKJL-X.js → B1cYD5sf.js} +1 -1
  9. package/web/app/immutable/chunks/{HCeNaLBX.js → B6c2kL4w.js} +2 -2
  10. package/web/app/immutable/chunks/{r9CLdeRr.js → B75YmuDW.js} +3 -3
  11. package/web/app/immutable/chunks/{DLN1m_oc.js → BABPbAn1.js} +1 -1
  12. package/web/app/immutable/chunks/{D0bUMHTb.js → BAwfT99s.js} +1 -1
  13. package/web/app/immutable/chunks/{C_ps7SI2.js → BBRFTdr4.js} +1 -1
  14. package/web/app/immutable/chunks/{Dq37igck.js → BD_S4uTD.js} +1 -1
  15. package/web/app/immutable/chunks/{DUc2opAY.js → BEhUDDmK.js} +1 -1
  16. package/web/app/immutable/chunks/{CzBMiZpT.js → BI8cL-JN.js} +1 -1
  17. package/web/app/immutable/chunks/{BwA1d-u1.js → BIjxJZ5i.js} +1 -1
  18. package/web/app/immutable/chunks/{BAMTcytp.js → BIkp_Hmt.js} +1 -1
  19. package/web/app/immutable/chunks/{DzHCFW-E.js → BKKERvpk.js} +1 -1
  20. package/web/app/immutable/chunks/{DP94l5zD.js → BLg51chm.js} +3 -3
  21. package/web/app/immutable/chunks/{B37_G9B8.js → BPXITtd5.js} +1 -1
  22. package/web/app/immutable/chunks/{BOy6NFH3.js → BR96U9Wd.js} +1 -1
  23. package/web/app/immutable/chunks/{4mQbCgSg.js → BTEHnOFb.js} +1 -1
  24. package/web/app/immutable/chunks/{kGnYVYAk.js → BX0V9vST.js} +2 -2
  25. package/web/app/immutable/chunks/{-xQ9aHnN.js → BYxTMRdy.js} +1 -1
  26. package/web/app/immutable/chunks/{DvKBDp7T.js → Bc1BuSIT.js} +1 -1
  27. package/web/app/immutable/chunks/{DBjXG7Re.js → BcEFHs1M.js} +1 -1
  28. package/web/app/immutable/chunks/{BoToR9vg.js → BgL-Z3DM.js} +1 -1
  29. package/web/app/immutable/chunks/{DC_3EQkj.js → BgnV10Sc.js} +2 -2
  30. package/web/app/immutable/chunks/{Cx-w_9tt.js → Bi8MRKMx.js} +1 -1
  31. package/web/app/immutable/chunks/{DP6e20em.js → Bizymm2G.js} +1 -1
  32. package/web/app/immutable/chunks/{qksfFGtg.js → BjuRA2LN.js} +1 -1
  33. package/web/app/immutable/chunks/{BGN20Sak.js → Bm6N2soI.js} +4 -4
  34. package/web/app/immutable/chunks/{Cg8YmoXY.js → BnknS-C6.js} +1 -1
  35. package/web/app/immutable/chunks/{BnaA6Qz9.js → BotNUGl4.js} +3 -3
  36. package/web/app/immutable/chunks/{DdG0fpQR.js → BpQNd38A.js} +1 -1
  37. package/web/app/immutable/chunks/{0JJFb4pz.js → Bq4K4JBr.js} +1 -1
  38. package/web/app/immutable/chunks/{BHd5Ycyv.js → Br0totzy.js} +1 -1
  39. package/web/app/immutable/chunks/{B9LAnui0.js → BrtJC6OX.js} +1 -1
  40. package/web/app/immutable/chunks/{BFpiydcV.js → Bs_2q1R8.js} +1 -1
  41. package/web/app/immutable/chunks/{CT137GBc.js → Bs_TRDLE.js} +1 -1
  42. package/web/app/immutable/chunks/{CLuP0_Is.js → BsouhNTN.js} +1 -1
  43. package/web/app/immutable/chunks/{BVZ7Hw44.js → Bttnblj5.js} +1 -1
  44. package/web/app/immutable/chunks/{DeTo2B7W.js → Bwe7RKw-.js} +1 -1
  45. package/web/app/immutable/chunks/{CPIfFszb.js → BxQzAB5H.js} +1 -1
  46. package/web/app/immutable/chunks/{DWlmiKMQ.js → ByGh65n0.js} +7 -7
  47. package/web/app/immutable/chunks/{CSMPUzig.js → C-llZXnj.js} +1 -1
  48. package/web/app/immutable/chunks/{Bj2kxXBv.js → C3WhRTo5.js} +1 -1
  49. package/web/app/immutable/chunks/{Du0sz9ah.js → C3s2I-px.js} +1 -1
  50. package/web/app/immutable/chunks/{CW6t9rU8.js → C4u2zmyj.js} +1 -1
  51. package/web/app/immutable/chunks/{2Rvfwx05.js → C6dmVB1C.js} +4 -4
  52. package/web/app/immutable/chunks/{CpSE18tk.js → C7KJ2WWY.js} +1 -1
  53. package/web/app/immutable/chunks/{4DKzLFxz.js → C8LWodzW.js} +2 -2
  54. package/web/app/immutable/chunks/{rRCDXSQW.js → C8ukaQ4v.js} +1 -1
  55. package/web/app/immutable/chunks/{CrF2NvoU.js → C97rJdwd.js} +2 -2
  56. package/web/app/immutable/chunks/{mnUHiFkL.js → CAUT4r9n.js} +1 -1
  57. package/web/app/immutable/chunks/{Comxi6VB.js → CCdFHP5T.js} +1 -1
  58. package/web/app/immutable/chunks/{_O-9-CfM.js → CRPm4Pj6.js} +1 -1
  59. package/web/app/immutable/chunks/{CKjPe4ll.js → CSEXx_lD.js} +1 -1
  60. package/web/app/immutable/chunks/{BLhpk6cm.js → CZtfaUbt.js} +1 -1
  61. package/web/app/immutable/chunks/{BxBhc8SK.js → C_O50F5M.js} +1 -1
  62. package/web/app/immutable/chunks/{B_EH4rnd.js → CaTfcRGE.js} +2 -2
  63. package/web/app/immutable/chunks/{1-L83W2E.js → Cb0GBy9I.js} +2 -2
  64. package/web/app/immutable/chunks/{rhdxBxmR.js → CebXSmXo.js} +1 -1
  65. package/web/app/immutable/chunks/{DJAJF2aV.js → CfXgD_Pw.js} +1 -1
  66. package/web/app/immutable/chunks/{C2PFxOOc.js → CgrukgLv.js} +1 -1
  67. package/web/app/immutable/chunks/{Bk5Drm1a.js → CjGXnvXd.js} +5 -5
  68. package/web/app/immutable/chunks/{DBtTsT3h.js → Cjn3mkT-.js} +1 -1
  69. package/web/app/immutable/chunks/{BFacF5Cc.js → CmfAV5b9.js} +1 -1
  70. package/web/app/immutable/chunks/{CPlbtgfY.js → CnpTi_2q.js} +2 -2
  71. package/web/app/immutable/chunks/{BPueFkqz.js → CovKrpBE.js} +1 -1
  72. package/web/app/immutable/chunks/{aXIBID0A.js → Cp0zjovM.js} +1 -1
  73. package/web/app/immutable/chunks/{BGyTNq2q.js → CqCb3N-V.js} +4 -4
  74. package/web/app/immutable/chunks/{Ccgqb2IM.js → Cqrn6Iuw.js} +1 -1
  75. package/web/app/immutable/chunks/{DiSTOpT2.js → CsJwP4fg.js} +1 -1
  76. package/web/app/immutable/chunks/{CIzdwtCK.js → CyzdJWF0.js} +1 -1
  77. package/web/app/immutable/chunks/{Cb1ltk9x.js → CzEoKeV2.js} +3 -3
  78. package/web/app/immutable/chunks/{hr3XkGev.js → D-9KNtuV.js} +1 -1
  79. package/web/app/immutable/chunks/{ZACNX8Dr.js → D-osFWh4.js} +1 -1
  80. package/web/app/immutable/chunks/{36_0UmtU.js → D06KyCnD.js} +1 -1
  81. package/web/app/immutable/chunks/{DhBCCByJ.js → D09F61W3.js} +1 -1
  82. package/web/app/immutable/chunks/{BE9LyC4x.js → D4xriAny.js} +1 -1
  83. package/web/app/immutable/chunks/{BpmuH_kK.js → D5Jqamkx.js} +1 -1
  84. package/web/app/immutable/chunks/{C87s6b1I.js → D69-2bhh.js} +1 -1
  85. package/web/app/immutable/chunks/{DlYWQy9o.js → D7TF3ktW.js} +1 -1
  86. package/web/app/immutable/chunks/{j4CbH61f.js → D9ejVVI8.js} +1 -1
  87. package/web/app/immutable/chunks/{BQGkLFny.js → D9vbo-CC.js} +3 -3
  88. package/web/app/immutable/chunks/{BfgamEFW.js → DAHeBTvv.js} +1 -1
  89. package/web/app/immutable/chunks/{COli2nkv.js → DFOcWzwz.js} +1 -1
  90. package/web/app/immutable/chunks/{BI-xeUgJ.js → DGdVv1yv.js} +1 -1
  91. package/web/app/immutable/chunks/{Byqd0P12.js → DJwakuJL.js} +1 -1
  92. package/web/app/immutable/chunks/{DpSuNWKG.js → DOy5PC7K.js} +1 -1
  93. package/web/app/immutable/chunks/{f5_5NkcH.js → DPqjG1Qz.js} +1 -1
  94. package/web/app/immutable/chunks/{C9HRYAK5.js → DQTlXZTK.js} +1 -1
  95. package/web/app/immutable/chunks/{DPWgxx_r.js → DR942Ajh.js} +1 -1
  96. package/web/app/immutable/chunks/{BBPT3jzS.js → DVx4z2O_.js} +1 -1
  97. package/web/app/immutable/chunks/{ialDfbR3.js → DWP4pi_Q.js} +1 -1
  98. package/web/app/immutable/chunks/{Cs1c4sXg.js → DXLbZrSI.js} +1 -1
  99. package/web/app/immutable/chunks/{Ce8WBTjF.js → DZ-x-eWR.js} +1 -1
  100. package/web/app/immutable/chunks/{C6nQg0nK.js → DZ6KouyB.js} +1 -1
  101. package/web/app/immutable/chunks/{1C8jE5xg.js → DZaRsTHz.js} +1 -1
  102. package/web/app/immutable/chunks/{QzztRxOC.js → DhZ3_JXX.js} +1 -1
  103. package/web/app/immutable/chunks/{Dg6-yJwG.js → Dn2kTCYW.js} +1 -1
  104. package/web/app/immutable/chunks/{DROfA7cv.js → Dnkb7G58.js} +1 -1
  105. package/web/app/immutable/chunks/{y6JuXIK4.js → DpkDQyZQ.js} +1 -1
  106. package/web/app/immutable/chunks/{HXrwONGg.js → Dv1h77Vp.js} +1 -1
  107. package/web/app/immutable/chunks/{a8-PvMdA.js → DvhzK-4t.js} +1 -1
  108. package/web/app/immutable/chunks/{CO1JOjiw.js → DyLaiVzG.js} +1 -1
  109. package/web/app/immutable/chunks/{pLgYa-qv.js → Dzy45J4U.js} +1 -1
  110. package/web/app/immutable/chunks/{DaR1HweB.js → E1ou7S5Q.js} +2 -2
  111. package/web/app/immutable/chunks/{O_noOQCK.js → Gz_O-dMq.js} +1 -1
  112. package/web/app/immutable/chunks/{DghicuZY.js → HlKQh-jr.js} +1 -1
  113. package/web/app/immutable/chunks/{Dwp4DMqr.js → J2joGn0l.js} +1 -1
  114. package/web/app/immutable/chunks/{DBb8bRDA.js → Klbdavqn.js} +1 -1
  115. package/web/app/immutable/chunks/{B6xkV8xv.js → PslMlnNq.js} +1 -1
  116. package/web/app/immutable/chunks/{DmaxCRlh.js → Qe8C2Z8H.js} +1 -1
  117. package/web/app/immutable/chunks/{BPDTSRg_.js → RhUR09AA.js} +1 -1
  118. package/web/app/immutable/chunks/{B3ZhJ2zS.js → Ve-0_aGT.js} +3 -3
  119. package/web/app/immutable/chunks/{ByH7GIW_.js → WbzVOnzB.js} +2 -2
  120. package/web/app/immutable/chunks/{ScJg5Frh.js → XwUFesej.js} +1 -1
  121. package/web/app/immutable/chunks/{C-AFiViU.js → Y3Xkuhtt.js} +1 -1
  122. package/web/app/immutable/chunks/{6SYeyudR.js → YmRtKLCw.js} +1 -1
  123. package/web/app/immutable/chunks/{F_CzStpc.js → ggXs_b9y.js} +1 -1
  124. package/web/app/immutable/chunks/{W8QLebuN.js → j1QbeoGS.js} +1 -1
  125. package/web/app/immutable/chunks/{DB7VQKGS.js → nBmxMCff.js} +1 -1
  126. package/web/app/immutable/chunks/{C46oSs94.js → prVatUwz.js} +1 -1
  127. package/web/app/immutable/chunks/{trGNLbxJ.js → sLmWN1ks.js} +1 -1
  128. package/web/app/immutable/chunks/{eeYFFN2l.js → vCzBOtB7.js} +1 -1
  129. package/web/app/immutable/entry/{app.DJnjuiiE.js → app.Ck7KNM4b.js} +2 -2
  130. package/web/app/immutable/entry/start.DjIjqTgP.js +1 -0
  131. package/web/app/immutable/nodes/{0.CUxBVUWQ.js → 0.BL1rQnVQ.js} +1 -1
  132. package/web/app/immutable/nodes/{1.CSjXQrGv.js → 1.BLzCq48F.js} +1 -1
  133. package/web/app/immutable/nodes/{10.BATprR9e.js → 10.CQRco_pp.js} +1 -1
  134. package/web/app/immutable/nodes/{11.5ipin3q_.js → 11.CqlkrbW8.js} +1 -1
  135. package/web/app/immutable/nodes/{15.Dwvj0-lX.js → 15.Bl9Ro66C.js} +1 -1
  136. package/web/app/immutable/nodes/{19.8bZ2WiIx.js → 19.CeE6vjuX.js} +2 -2
  137. package/web/app/immutable/nodes/{2.BhLocieZ.js → 2.DjFjqnV0.js} +1 -1
  138. package/web/app/immutable/nodes/{3.CZ0MN870.js → 3.BCbxJGeq.js} +1 -1
  139. package/web/app/immutable/nodes/{4.Jqmt7KB_.js → 4.CL0JqE8n.js} +1 -1
  140. package/web/app/immutable/nodes/{5.QoAJLoN0.js → 5.hD1YagZR.js} +1 -1
  141. package/web/app/immutable/nodes/{6.uLNlkxFf.js → 6.776DAlfQ.js} +1 -1
  142. package/web/app/immutable/nodes/{7.BohHriQX.js → 7.5BWaKbyF.js} +1 -1
  143. package/web/app/immutable/nodes/{8.BC5uGoFC.js → 8.C_V2pSbF.js} +1 -1
  144. package/web/app/immutable/nodes/{9.BnQAis5Y.js → 9.CBuIBgSj.js} +2 -2
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.DrjKV6rZ.js +0 -1
@@ -1,4 +1,4 @@
1
- var z1=Object.defineProperty;var js=t=>{throw TypeError(t)};var R1=(t,e,r)=>e in t?z1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>R1(t,typeof e!="symbol"?e+"":e,r),D1=(t,e,r)=>e.has(t)||js("Cannot "+r);var Vs=(t,e,r)=>e.has(t)?js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);var tn=(t,e,r)=>(D1(t,e,"access private method"),r);import{cR as Vt,b4 as N1,dJ as Xl,a7 as _n,a5 as Ia,a6 as P1,a4 as _1,aa as L1,am as O1,a1 as $1,ea as B1,X as q1,bn as Yl,cU as qr,dI as Zl,b3 as F1,b8 as H1,cC as U1,cS as W1,cn as G1,dD as si,e2 as j1,dX as V1,aK as X0,ax as K1,aF as _i,dH as Ql,ee as Jl,dV as X1,ed as Y1}from"./C2UL5Ler.js";import{D as Ks,b3 as Z1,bd as Q1,aB as J1}from"./BwA1d-u1.js";import{M as eh,G as hn,I as th}from"./Bqd7fdCF.js";import{zz as y0,JH as E,n_ as ve,nZ as xe,aU as rh,m as ec,I as De,br as gn,kf as Li,mf as w0,ar as Xt,me as Xs,mo as Ys,ml as Zs,jO as tc,gA as oi,I2 as nh,tK as ah,B1 as ih,p1 as sh,n3 as k0,CB as oh,iO as lh,my as ch,m9 as uh}from"./B9vHutcJ.js";import{bm as ie}from"./CLAmm_T1.js";import{l as rt}from"./Cu5e4npY.js";import{m as hh,f as Tr}from"./BbhtQrkZ.js";import{a as vn}from"./BdWqymET.js";import{o as pe,r as Kt,e as bn,s as V,_ as Je,l as yn,g as dh,n as Le,c as dr,b as Ve,u as ph,d as mh}from"./CIyUrgF0.js";import{j as rc}from"./uXuxG9cN.js";import{u as fh}from"./BGrimfDs.js";import{selectActiveWorkspaceIds as gh}from"./aZdb_rCN.js";import{i as je}from"./CL3a4Hm1.js";import{l as za,c as Oi}from"./ChTqQfQN.js";import"./KnkAG0HD.js";import{e as vh,h as Er}from"./DONrLvvt.js";import{h as wn}from"./TB9r2XJy.js";import{i as Qs}from"./BBWuirRW.js";import{f as $i,o as nc,p as ac,h as bh,m as ic,i as yh,k as wh}from"./DQw0Iiac.js";const Ze=[];for(let t=0;t<256;++t)Ze.push((t+256).toString(16).slice(1));function kh(t,e=0){return(Ze[t[e+0]]+Ze[t[e+1]]+Ze[t[e+2]]+Ze[t[e+3]]+"-"+Ze[t[e+4]]+Ze[t[e+5]]+"-"+Ze[t[e+6]]+Ze[t[e+7]]+"-"+Ze[t[e+8]]+Ze[t[e+9]]+"-"+Ze[t[e+10]]+Ze[t[e+11]]+Ze[t[e+12]]+Ze[t[e+13]]+Ze[t[e+14]]+Ze[t[e+15]]).toLowerCase()}const xh=new Uint8Array(16);function Sh(){return crypto.getRandomValues(xh)}function Bi(t,e,r){return crypto.randomUUID?crypto.randomUUID():Ah(t)}function Ah(t,e,r){t=t||{};const n=t.random??t.rng?.()??Sh();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kh(n)}function qi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=qi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?eh(r.replace(/\.git\/?$/,""),e):null}function f3(t,e){return t.type==="local"?t.plainFolder?"folder":"local":qi(t,e)?.provider==="gitlab"?"gitlab":"github"}function sc(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g3(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=sc(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v3(t){return t.type==="local"&&t.path?t.path:void 0}const Th=["/.clones/","/.repo-cache/"];function b3(t){const e=t.replaceAll("\\","/");return Th.some(r=>e.includes(r))}function y3(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function Eh(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w3(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??Eh(r)}}function k3(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,sc(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Ch="known-repos",Mh=6e4;function Ih({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=y0(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(y0(s),s);for(const s of e.repos)a.set(y0(s),s)}const i=[...a.values()].filter(s=>!r[y0(s)]);return n==="all"?i:i.slice(0,9)}function x3(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S3({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<Mh?"skip":"load"}function A3(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=qi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function zh({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ks)?Ks:null;return s===null||!i(s)?null:s}const T3=E.createSelector(t=>t.workspaceInitializer.hydrated),E3=E.createSelector(t=>t.workspaceInitializer.compactFormState),C3=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),M3=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I3=E.createSelector(t=>t.workspaceInitializer.branchByRepo),z3=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),R3=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D3=E.createSelector((t,e)=>xe(t.workspaceInitializer.recentRepoRefreshes,e)),N3=E.createSelector((t,e)=>xe(t.workspaceInitializer.directoryStatusChecks,e)),P3=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),_3=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),L3=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),O3=E.createSelector(t=>t.workspaceInitializer.agentByRepo),$3=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B3=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q3=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F3=E.createSelector((t,e)=>({restore:xe(t.workspaceInitializer.draftRestores,e),clear:xe(t.workspaceInitializer.draftClears,e)})),H3=E.createSelector((t,e,r)=>{const n=xe(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationOutcomes,e)),W3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationResumes,e)),G3=E.createSelector(t=>zh({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:Q1.select(t),orchestratorId:Z1.select(t)?.id??null})),Rh=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Vt.select(t);return e&&r&&N1.select(t)?JSON.stringify([r,e]):null}),j3=E.createSelector(t=>{const e=Rh.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Dh=E.createSelector(t=>{const e=xe(t.workspaceInitializer.recentRepoRefreshes,Ch),r=Vt.select(t);return Ih({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V3=E.createSelector(t=>Xl.select(t)?Dh.select(t):[]),K3=E.createSelector(t=>J1.select(t)||void 0),Js="workspace-debug-flags",x0={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class Nh{constructor(){le(this,"flags");le(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return x0;try{const e=localStorage.getItem(Js);if(e)return{...x0,...JSON.parse(e)}}catch(e){za.error("Failed to load debug flags:",e)}return x0}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem(Js,JSON.stringify(this.flags))}catch(e){za.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...x0},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),za.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const Ra=new Nh;function X3(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function Ph(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Y3(t){if(!t||t.trim().length===0)return ie.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ie.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ie.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ie.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ie.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ie.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ie.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ie.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ie.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ie.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ie.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ie.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ie.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ie.workspace_sidebarHeader_branchTooLong_error()}function Z3(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function li(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q3(t,e){return`${e}:${t.agentId??"manual"}`}function _h(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function Lh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function Oh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J3(t,e,r,n){const a=_h(t,e),i=n?` (origin/${n})`:"";return r?a===1?ie.workspace_sidebarChanges_addToPr_one({suffix:i}):ie.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ie.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ie.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e6(t,e,r){const n=Lh(t,e),a=r?` (origin/${r})`:"";return n===1?ie.workspace_sidebarChanges_undoPush_one({suffix:a}):ie.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t6(t,e){const r=Oh(t,e);return r===1?ie.workspace_sidebarChanges_undoCommit_one():ie.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r6(t,e){return e===0&&t.length>0}function n6(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a6(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i6(t,e,r){return r?.path===t&&r?.staged===e}function s6(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o6(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function $h(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l6(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=$h(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:li(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Fi(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:li(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c6(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??rh.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function Bh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function Da(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=_n(i),c=o.toLowerCase(),h=a.find(d=>!!o&&d.url.toLowerCase()===c||(i.resource||i.monitorAvailability?d.monitorIdentity===Ia(i):!d.resource&&!d.monitorAvailability&&(s?!d.crossRepo&&d.number===i.prNumber:d.crossRepo===i.repo&&d.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?Ia(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${P1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?Ia(i):void 0,url:o,htmlUrl:o,status:Bh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Fi(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Fi(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u6(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const k of n)k.repoOwner&&k.repoName&&s.add(`${k.repoOwner}/${k.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(k=>k.crossRepo)){o=[];for(const k of t)k.crossRepo?s.has(k.crossRepo.toLowerCase())?c.push(k):h.push(k):o.push(k)}const d=[],v=[],m=[];for(const k of e){const I=k.repo.toLowerCase();_n(k)&&o.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&(!i||I===i)?d.push(k):_n(k)&&c.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&s.has(I)?v.push(k):m.push(k)}const w=Da(o,d,r),A=r?.split("/")[0],C=new Set([...w,...c,...h].map(k=>`${(k.crossRepo??r??"").toLowerCase()}#${k.number}`)),M=[...c];for(const k of n){if(!k.repoOwner||!k.repoName)continue;const I=`${k.repoOwner}/${k.repoName}`;for(const R of k.pullRequests??[]){const Z=`${I.toLowerCase()}#${R.number}`;if(C.has(Z))continue;C.add(Z);const K=R.url||`https://github.com/${I}/pull/${R.number}`,ee=i!==void 0&&I.toLowerCase()===i;M.push({number:R.number,title:a(R),url:K,htmlUrl:K,status:li(R.status),createdAt:R.createdAt,updatedAt:R.updatedAt,crossRepo:ee?void 0:I,crossRepoDisplay:ee?void 0:Fi(I,A)})}}return{own:w,otherRoots:Da(M,v,r),otherTracked:Da(h,m,r)}}function eo(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h6(t){const e=t.status==="merged"?ie.workspace_prSection_merged_label():t.status==="closed"?ie.workspace_prSection_closed_label():t.status==="draft"?ie.workspace_prSection_statusDraft_label():eo(t)?ie.workspace_prSection_statusQueued_label():ie.workspace_prSection_statusOpen_label(),r=[_1(t)??e],n=eo(t)?hh(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ie.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ie.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ie.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ie.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ie.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ie.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ie.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(Ph(a.mergeBlockedReason))),r.join(`
1
+ var z1=Object.defineProperty;var js=t=>{throw TypeError(t)};var R1=(t,e,r)=>e in t?z1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>R1(t,typeof e!="symbol"?e+"":e,r),D1=(t,e,r)=>e.has(t)||js("Cannot "+r);var Vs=(t,e,r)=>e.has(t)?js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);var tn=(t,e,r)=>(D1(t,e,"access private method"),r);import{cR as Vt,b4 as N1,dJ as Xl,a7 as _n,a5 as Ia,a6 as P1,a4 as _1,aa as L1,am as O1,a1 as $1,ea as B1,X as q1,bn as Yl,cU as qr,dI as Zl,b3 as F1,b8 as H1,cC as U1,cS as W1,cn as G1,dD as si,e2 as j1,dX as V1,aK as X0,ax as K1,aF as _i,dH as Ql,ee as Jl,dV as X1,ed as Y1}from"./C2UL5Ler.js";import{D as Ks,b3 as Z1,bd as Q1,aB as J1}from"./BIjxJZ5i.js";import{M as eh,G as hn,I as th}from"./Bqd7fdCF.js";import{zz as y0,JH as E,n_ as ve,nZ as xe,aU as rh,m as ec,I as De,br as gn,kf as Li,mf as w0,ar as Xt,me as Xs,mo as Ys,ml as Zs,jO as tc,gA as oi,I2 as nh,tK as ah,B1 as ih,p1 as sh,n3 as k0,CB as oh,iO as lh,my as ch,m9 as uh}from"./B9vHutcJ.js";import{bm as ie}from"./CLAmm_T1.js";import{l as rt}from"./Cu5e4npY.js";import{m as hh,f as Tr}from"./BbhtQrkZ.js";import{a as vn}from"./BdWqymET.js";import{o as pe,r as Kt,e as bn,s as V,_ as Je,l as yn,g as dh,n as Le,c as dr,b as Ve,u as ph,d as mh}from"./CIyUrgF0.js";import{j as rc}from"./uXuxG9cN.js";import{u as fh}from"./BGrimfDs.js";import{selectActiveWorkspaceIds as gh}from"./aZdb_rCN.js";import{i as je}from"./CL3a4Hm1.js";import{l as za,c as Oi}from"./ChTqQfQN.js";import"./KnkAG0HD.js";import{e as vh,h as Er}from"./DONrLvvt.js";import{h as wn}from"./TB9r2XJy.js";import{i as Qs}from"./BBWuirRW.js";import{f as $i,o as nc,p as ac,h as bh,m as ic,i as yh,k as wh}from"./DQw0Iiac.js";const Ze=[];for(let t=0;t<256;++t)Ze.push((t+256).toString(16).slice(1));function kh(t,e=0){return(Ze[t[e+0]]+Ze[t[e+1]]+Ze[t[e+2]]+Ze[t[e+3]]+"-"+Ze[t[e+4]]+Ze[t[e+5]]+"-"+Ze[t[e+6]]+Ze[t[e+7]]+"-"+Ze[t[e+8]]+Ze[t[e+9]]+"-"+Ze[t[e+10]]+Ze[t[e+11]]+Ze[t[e+12]]+Ze[t[e+13]]+Ze[t[e+14]]+Ze[t[e+15]]).toLowerCase()}const xh=new Uint8Array(16);function Sh(){return crypto.getRandomValues(xh)}function Bi(t,e,r){return crypto.randomUUID?crypto.randomUUID():Ah(t)}function Ah(t,e,r){t=t||{};const n=t.random??t.rng?.()??Sh();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kh(n)}function qi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=qi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?eh(r.replace(/\.git\/?$/,""),e):null}function f3(t,e){return t.type==="local"?t.plainFolder?"folder":"local":qi(t,e)?.provider==="gitlab"?"gitlab":"github"}function sc(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g3(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=sc(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v3(t){return t.type==="local"&&t.path?t.path:void 0}const Th=["/.clones/","/.repo-cache/"];function b3(t){const e=t.replaceAll("\\","/");return Th.some(r=>e.includes(r))}function y3(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function Eh(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w3(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??Eh(r)}}function k3(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,sc(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Ch="known-repos",Mh=6e4;function Ih({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=y0(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(y0(s),s);for(const s of e.repos)a.set(y0(s),s)}const i=[...a.values()].filter(s=>!r[y0(s)]);return n==="all"?i:i.slice(0,9)}function x3(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S3({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<Mh?"skip":"load"}function A3(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=qi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function zh({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ks)?Ks:null;return s===null||!i(s)?null:s}const T3=E.createSelector(t=>t.workspaceInitializer.hydrated),E3=E.createSelector(t=>t.workspaceInitializer.compactFormState),C3=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),M3=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I3=E.createSelector(t=>t.workspaceInitializer.branchByRepo),z3=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),R3=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D3=E.createSelector((t,e)=>xe(t.workspaceInitializer.recentRepoRefreshes,e)),N3=E.createSelector((t,e)=>xe(t.workspaceInitializer.directoryStatusChecks,e)),P3=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),_3=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),L3=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),O3=E.createSelector(t=>t.workspaceInitializer.agentByRepo),$3=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B3=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q3=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F3=E.createSelector((t,e)=>({restore:xe(t.workspaceInitializer.draftRestores,e),clear:xe(t.workspaceInitializer.draftClears,e)})),H3=E.createSelector((t,e,r)=>{const n=xe(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationOutcomes,e)),W3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationResumes,e)),G3=E.createSelector(t=>zh({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:Q1.select(t),orchestratorId:Z1.select(t)?.id??null})),Rh=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Vt.select(t);return e&&r&&N1.select(t)?JSON.stringify([r,e]):null}),j3=E.createSelector(t=>{const e=Rh.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Dh=E.createSelector(t=>{const e=xe(t.workspaceInitializer.recentRepoRefreshes,Ch),r=Vt.select(t);return Ih({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V3=E.createSelector(t=>Xl.select(t)?Dh.select(t):[]),K3=E.createSelector(t=>J1.select(t)||void 0),Js="workspace-debug-flags",x0={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class Nh{constructor(){le(this,"flags");le(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return x0;try{const e=localStorage.getItem(Js);if(e)return{...x0,...JSON.parse(e)}}catch(e){za.error("Failed to load debug flags:",e)}return x0}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem(Js,JSON.stringify(this.flags))}catch(e){za.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...x0},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),za.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const Ra=new Nh;function X3(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function Ph(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Y3(t){if(!t||t.trim().length===0)return ie.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ie.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ie.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ie.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ie.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ie.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ie.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ie.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ie.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ie.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ie.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ie.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ie.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ie.workspace_sidebarHeader_branchTooLong_error()}function Z3(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function li(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q3(t,e){return`${e}:${t.agentId??"manual"}`}function _h(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function Lh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function Oh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J3(t,e,r,n){const a=_h(t,e),i=n?` (origin/${n})`:"";return r?a===1?ie.workspace_sidebarChanges_addToPr_one({suffix:i}):ie.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ie.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ie.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e6(t,e,r){const n=Lh(t,e),a=r?` (origin/${r})`:"";return n===1?ie.workspace_sidebarChanges_undoPush_one({suffix:a}):ie.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t6(t,e){const r=Oh(t,e);return r===1?ie.workspace_sidebarChanges_undoCommit_one():ie.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r6(t,e){return e===0&&t.length>0}function n6(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a6(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i6(t,e,r){return r?.path===t&&r?.staged===e}function s6(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o6(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function $h(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l6(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=$h(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:li(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Fi(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:li(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c6(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??rh.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function Bh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function Da(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=_n(i),c=o.toLowerCase(),h=a.find(d=>!!o&&d.url.toLowerCase()===c||(i.resource||i.monitorAvailability?d.monitorIdentity===Ia(i):!d.resource&&!d.monitorAvailability&&(s?!d.crossRepo&&d.number===i.prNumber:d.crossRepo===i.repo&&d.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?Ia(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${P1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?Ia(i):void 0,url:o,htmlUrl:o,status:Bh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Fi(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Fi(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u6(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const k of n)k.repoOwner&&k.repoName&&s.add(`${k.repoOwner}/${k.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(k=>k.crossRepo)){o=[];for(const k of t)k.crossRepo?s.has(k.crossRepo.toLowerCase())?c.push(k):h.push(k):o.push(k)}const d=[],v=[],m=[];for(const k of e){const I=k.repo.toLowerCase();_n(k)&&o.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&(!i||I===i)?d.push(k):_n(k)&&c.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&s.has(I)?v.push(k):m.push(k)}const w=Da(o,d,r),A=r?.split("/")[0],C=new Set([...w,...c,...h].map(k=>`${(k.crossRepo??r??"").toLowerCase()}#${k.number}`)),M=[...c];for(const k of n){if(!k.repoOwner||!k.repoName)continue;const I=`${k.repoOwner}/${k.repoName}`;for(const R of k.pullRequests??[]){const Z=`${I.toLowerCase()}#${R.number}`;if(C.has(Z))continue;C.add(Z);const K=R.url||`https://github.com/${I}/pull/${R.number}`,ee=i!==void 0&&I.toLowerCase()===i;M.push({number:R.number,title:a(R),url:K,htmlUrl:K,status:li(R.status),createdAt:R.createdAt,updatedAt:R.updatedAt,crossRepo:ee?void 0:I,crossRepoDisplay:ee?void 0:Fi(I,A)})}}return{own:w,otherRoots:Da(M,v,r),otherTracked:Da(h,m,r)}}function eo(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h6(t){const e=t.status==="merged"?ie.workspace_prSection_merged_label():t.status==="closed"?ie.workspace_prSection_closed_label():t.status==="draft"?ie.workspace_prSection_statusDraft_label():eo(t)?ie.workspace_prSection_statusQueued_label():ie.workspace_prSection_statusOpen_label(),r=[_1(t)??e],n=eo(t)?hh(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ie.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ie.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ie.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ie.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ie.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ie.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ie.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(Ph(a.mergeBlockedReason))),r.join(`
2
2
  `)}function d6(t,e){return e.has(t??"manual")}function p6(t,e){return{path:t.relativePath,additions:t.stats.additions,deletions:t.stats.deletions,staged:e,status:t.status,attribution:t.attribution?.agent?{agentId:t.attribution.agent.agentId,agentName:t.attribution.agent.agentName,sessionId:t.attribution.agent.sessionId,turnNumber:t.attribution.agent.turnNumber,timestamp:t.attribution.timestamp}:void 0}}const oc=500;function m6(t,e=oc){const r=Math.max(0,Math.floor(e));return t.length<=r?{visible:t,shown:t.length,hiddenCount:0}:{visible:t.slice(0,r),shown:r,hiddenCount:t.length-r}}function f6(t,e,r=oc){let n=Math.max(0,Math.floor(r)),a=0,i=0;return{groups:t.map(o=>{if(e(o))return{group:o,visibleFiles:[]};const c=Math.min(n,o.files.length);return n-=c,a+=c,i+=o.files.length-c,{group:o,visibleFiles:c===o.files.length?o.files:o.files.slice(0,c)}}),shown:a,hiddenCount:i}}function g6(t){if(t.hiddenCount<=0)return"";const e=rt(t.shown),r=rt(t.shown+t.hiddenCount);return t.hiddenCount===1?ie.workspace_fileChanges_hiddenFiles_one({shown:e,total:r}):ie.workspace_fileChanges_hiddenFiles_many({shown:e,total:r,count:rt(t.hiddenCount)})}function qh(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function ci(t){return t.startsWith("@")?t.slice(1):t}function Fh(t,e,r,n){const a=t.fullPath||t.path||t.filename;if(a)return ci(String(a));const i=[r,e,n.trim()].map(ci).filter(Boolean),s=i.find(o=>o.includes("/"))??i[0];return s?L1(s).path:void 0}function Hh(t){const e=t.line??t.startLine??t.range?.start;return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Uh(t){if(!t||t.getAttribute("data-mention")===null)return null;const e=t.getAttribute("data-type")||"",r=t.getAttribute("data-id")||"",n=t.getAttribute("data-label")||"",a=t.getAttribute("data-uri")||"",i=qh(t.getAttribute("data-meta")),s={type:e,id:r,label:n,uri:a,meta:i},o=a.startsWith("intent://")?a:typeof i.fullUrl=="string"&&i.fullUrl.startsWith("intent://")?i.fullUrl:void 0;if(o&&(s.intentUrl=o),e==="file"||e==="file-range"){const c=Fh(i,n,r,t.textContent||"");c&&(s.filePath=c);const h=Hh(i);h!==void 0&&(s.line=h)}else if(e==="folder"||e==="source-folder"){const c=i.fullPath||i.path||r||n,h=c?ci(String(c)).replace(/\/+$/,""):"";h&&(s.folderPath=h)}else if(e==="note"||e==="note-range"){const c=i.noteId||r;c&&(s.note=i.isExternalLink&&i.workspaceId?{id:c,workspaceId:String(i.workspaceId)}:{id:c})}return s}function v6(t){return{sidebarTabId:"files",type:"file",filePath:`${t}/`}}function Hi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fr=Hi();function lc(t){Fr=t}var Nr={exec:()=>null};function Cr(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),a=e[n];return a||(a=t(n),e[n]=a),a}}function oe(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Ue.caret,"$1"),r=r.replace(a,s),n},getRegex:()=>new RegExp(r,e)};return n}var cc=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ue={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Cr(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Wi})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Wh=/^(?:[ \t]*(?:\n|$))+/,Gh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,Kn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ui=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Wi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xn=oe(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Wi).getRegex(),uc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,hc=oe(uc).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,Xn).getRegex(),Kh=oe(uc).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,Xn).getRegex(),Gi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Xh=/^[^\n]+/,ji=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Yh=oe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ji).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Zh=oe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ui).getRegex(),Vi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qh=oe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Vi).replace("tag",Wi).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),dc=t=>oe(Gi).replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html",Xn).getRegex(),Jh=dc(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ed=dc(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),td=oe(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",ed).getRegex(),Ki={blockquote:td,code:Gh,def:Yh,fences:jh,heading:Vh,hr:Kn,html:Qh,lheading:hc,list:Zh,newline:Wh,paragraph:Jh,table:Nr,text:Xh},to=oe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",Xn).getRegex(),rd={...Ki,lheading:Kh,table:to,paragraph:oe(Gi).replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",to).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",Xn).getRegex()},nd={...Ki,html:oe(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",Vi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oe(Gi).replace("hr",Kn).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",hc).getRegex()},ad=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pc=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,sd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pt=/[\p{P}\p{S}]/u,kn=/[\s\p{P}\p{S}]/u,Yn=/[^\s\p{P}\p{S}]/u,od=oe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kn).getRegex(),ld=/[\p{Pi}\p{Ps}"']/u,mc=/(?!~)[\p{P}\p{S}]/u,cd=/(?!~)[\s\p{P}\p{S}]/u,ud=/(?:[^\s\p{P}\p{S}]|~)/u,hd=oe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cc?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fc=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dd=oe(fc,"u").replace(/punct/g,Pt).getRegex(),pd=oe(fc,"u").replace(/punct/g,mc).getRegex(),md=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,fd=oe(md,"u").replace(/openQuote/g,ld).replace(/punct/g,Pt).getRegex(),gc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",gd=oe(gc,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),vd=oe(gc,"gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,cd).replace(/punct/g,mc).getRegex(),bd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",yd=oe(bd,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),wd=oe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),kd="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",xd=oe(kd,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),Sd=oe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pt).getRegex(),Ad="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Td=oe(Ad,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),Ed=oe(/\\(punct)/,"gu").replace(/punct/g,Pt).getRegex(),Cd=oe(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,Pt).getRegex(),Md=oe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Id=oe(Vi).replace("(?:-->|$)","-->").getRegex(),zd=oe("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Id).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vc=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,q0=oe(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",vc).getRegex(),Rd=oe(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",q0).replace("href",/<(?:\\.|[^\n<>\\])*>|(?!<)[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Dd=oe(/^!?\[(label)\]\[(ref)\]/).replace("label",q0).replace("ref",ji).getRegex(),Nd=oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ji).getRegex(),ro=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Pd=oe(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",vc).getRegex(),_d=oe("reflink|nolink(?!\\()","g").replace("reflink",oe(/^!?\[(label)\]\[(ref)\]/).replace("label",Pd).replace("ref",ro).getRegex()).replace("nolink",oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ro).getRegex()).getRegex(),no=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ld=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Od=oe(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Ld).getRegex(),Xi={_backpedal:Nr,anyPunctuation:Ed,anyPunctuationOutsideCode:Cd,autolink:Md,blockSkip:hd,br:pc,code:id,del:Nr,delLDelim:Nr,delRDelim:Nr,emStrongLDelim:dd,emStrongRDelimAst:gd,emStrongRDelimUnd:wd,escape:ad,link:Rd,nolink:Nd,punctuation:od,reflink:Dd,reflinkSearch:_d,tag:zd,text:sd,url:Nr},$d={...Xi,emStrongLDelim:fd,emStrongRDelimAst:yd,emStrongRDelimUnd:xd,link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",q0).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q0).getRegex()},ui={...Xi,emStrongRDelimAst:vd,emStrongLDelim:pd,delLDelim:Sd,delRDelim:Td,url:oe(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Od).replace("protocol",no).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:oe(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",no).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",cc?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Bd={...ui,br:oe(pc).replace("{2,}","*").getRegex(),text:oe(ui.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},S0={normal:Ki,gfm:rd,pedantic:nd},Mn={normal:Xi,gfm:ui,breaks:Bd,pedantic:$d},qd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ao=t=>qd[t];function mt(t,e){if(e){if(Ue.escapeTest.test(t))return t.replace(Ue.escapeReplace,ao)}else if(Ue.escapeTestNoEncode.test(t))return t.replace(Ue.escapeReplaceNoEncode,ao);return t}function Fd(t){return Ue.numericCharacterReference.test(t)?t.replace(Ue.numericCharacterReferenceOrAmpersand,(e,r,n)=>{if(r===void 0&&n===void 0)return"&amp;";let a=r===void 0?Number.parseInt(n,16):Number.parseInt(r,10);return a===0||a>1114111||a>=55296&&a<=57343?"�":a===38?"&amp;":String.fromCodePoint(a)}):t}function io(t){try{t=encodeURI(t).replace(Ue.percentDecode,"%")}catch{return null}return t}function so(t,e){let r=t.replace(Ue.findPipe,(i,s,o)=>{let c=!1,h=s;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split(Ue.splitPipe),a=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(Ue.slashPipe,"|");return n}function qt(t,e,r){let n=t.length;if(n===0)return"";let a=0;for(;a<n&&t.charAt(n-a-1)===e;)a++;return t.slice(0,n-a)}function oo(t){let e=t.split(`
4
4
  `),r=e.length-1;for(;r>=0&&Ue.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
@@ -1 +1 @@
1
- import{aB as v,b as y}from"./BGyTNq2q.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
1
+ import{aB as v,b as y}from"./CqCb3N-V.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
@@ -1,4 +1,4 @@
1
- import{s as xe}from"./DghicuZY.js";import{p as be}from"./C0ar8e1U.js";import{b as C,a6 as Ce,W as ae,q as ee,aX as we,B as Te,ay as te,b8 as B,aW as Z,a_ as Le,V as $e,b0 as Ae,Y as Fe,U as _e,aZ as Ne,O as Me,ao as ke,r as Ve}from"./BGyTNq2q.js";import{p as ze}from"./nIshZjK_.js";import{f as O,o as Q}from"./BLhpk6cm.js";function De(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function Pe(){return this.eachAfter(De)}function Be(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function We(t,a){for(var l=this,n=[l],s,r,h=-1;l=n.pop();)if(t.call(a,l,++h,this),s=l.children)for(r=s.length-1;r>=0;--r)n.push(s[r]);return this}function Ee(t,a){for(var l=this,n=[l],s=[],r,h,d,f=-1;l=n.pop();)if(s.push(l),r=l.children)for(h=0,d=r.length;h<d;++h)n.push(r[h]);for(;l=s.pop();)t.call(a,l,++f,this);return this}function Re(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function He(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function Ie(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Oe(t){for(var a=this,l=qe(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;t!==l;)n.splice(s,0,t),t=t.parent;return n}function qe(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),s=null;for(t=l.pop(),a=n.pop();t===a;)s=t,t=l.pop(),a=n.pop();return s}function Ge(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Xe(){return Array.from(this)}function Ye(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function je(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ue(){var t=this,a,l=[t],n,s,r;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(s=0,r=n.length;s<r;++s)l.push(n[s]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ke)):a===void 0&&(a=Je);for(var l=new Y(t),n,s=[l],r,h,d,f;n=s.pop();)if((h=a(n.data))&&(f=(h=Array.from(h)).length))for(n.children=h,d=f-1;d>=0;--d)s.push(r=h[d]=new Y(h[d])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(et)}function Ze(){return ne(this).eachBefore(Qe)}function Je(t){return t.children}function Ke(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function et(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}Y.prototype=ne.prototype={constructor:Y,count:Pe,each:Be,eachAfter:Ee,eachBefore:We,find:Re,sum:He,sort:Ie,path:Oe,ancestors:Ge,descendants:Xe,leaves:Ye,links:je,copy:Ze,[Symbol.iterator]:Ue};function tt(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function at(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function oe(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(n-a)/t.value;++d<f;)h=r[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*o}Object.create(Y.prototype);function ce(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(s-l)/t.value;++d<f;)h=r[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*o}var he=(1+Math.sqrt(5))/2;function de(t,a,l,n,s,r){for(var h=[],d=a.children,f,o,u=0,S=0,i=d.length,v,x,g=a.value,p,b,_,$,z,R,N;u<i;){v=s-l,x=r-n;do p=d[S++].value;while(!p&&S<i);for(b=_=p,R=Math.max(x/v,v/x)/(g*t),N=p*p*R,z=Math.max(_/N,N/b);S<i;++S){if(p+=o=d[S].value,o<b&&(b=o),o>_&&(_=o),N=p*p*R,$=Math.max(_/N,N/b),$>z){p-=o;break}z=$}h.push(f={value:p,dice:v<x,children:d.slice(u,S)}),f.dice?oe(f,l,n,s,g?n+=x*p/g:r):ce(f,l,n,g?l+=v*p/g:s,r),g-=p,u=S}return h}var nt=(function t(a){function l(n,s,r,h,d){de(a,n,s,r,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);function lt(){var t=nt,a=!1,l=1,n=1,s=[0],r=q,h=q,d=q,f=q,o=q;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(S),s=[0],a&&i.eachBefore(at),i}function S(i){var v=s[i.depth],x=i.x0+v,g=i.y0+v,p=i.x1-v,b=i.y1-v;p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),i.x0=x,i.y0=g,i.x1=p,i.y1=b,i.children&&(v=s[i.depth+1]=r(i)/2,x+=o(i)-v,g+=h(i)-v,p-=d(i)-v,b-=f(i)-v,p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),t(i,x,g,p,b))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=tt(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(r=typeof i=="function"?i:G(+i),u):r},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),u):h},u.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),u):d},u.paddingBottom=function(i){return arguments.length?(f=typeof i=="function"?i:G(+i),u):f},u.paddingLeft=function(i){return arguments.length?(o=typeof i=="function"?i:G(+i),u):o},u}(function t(a){function l(n,s,r,h,d){if((f=n._squarify)&&f.ratio===a)for(var f,o,u,S,i=-1,v,x=f.length,g=n.value;++i<x;){for(o=f[i],u=o.children,S=o.value=0,v=u.length;S<v;++S)o.value+=u[S].value;o.dice?oe(o,s,r,h,g?r+=(d-r)*o.value/g:d):ce(o,s,r,g?s+=(h-s)*o.value/g:h,d),g-=o.value}else n._squarify=f=de(a,n,s,r,h,d),f.ratio=a}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);var E,ue=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Le,this.getAccTitle=$e,this.setDiagramTitle=Ae,this.getDiagramTitle=Fe,this.getAccDescription=_e,this.setAccDescription=Ne}getNodes(){return this.nodes}getConfig(){const a=Me,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},s=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(r=>{ke(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Ve(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(E,"TreeMapDB"),E);function pe(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const r=l[l.length-1].node;r.children?r.children.push(s):r.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}C(pe,"buildHierarchy");var st=C((t,a)=>{be(t,a);const l=[];for(const r of t.TreemapRows??[])r.$type==="ClassDefStatement"&&a.addClass(r.className??"",r.styleText??"");for(const r of t.TreemapRows??[]){const h=r.item;if(!h)continue;const d=r.indent?parseInt(r.indent):0,f=rt(h),o=h.classSelector?a.getStylesForClass(h.classSelector):[],u=o.length>0?o:void 0,S={level:d,name:f,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(S)}const n=pe(l),s=C((r,h)=>{for(const d of r)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),rt=C(t=>t.name?String(t.name):"","getItemName"),fe={parser:{yy:void 0},parse:C(async t=>{try{const l=await ze("treemap",t);te.debug("Treemap AST:",l);const n=fe.parser?.yy;if(!(n instanceof ue))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");st(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,W=10,X=25,ot=C((t,a,l,n)=>{const s=n.db,r=s.getConfig(),h=r.padding??it,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:o}=ae();if(!f)return;const u=d?30:0,S=we(a),i=r.nodeWidth?r.nodeWidth*W:960,v=r.nodeHeight?r.nodeHeight*W:500,x=i,g=v+u;S.attr("viewBox",`0 0 ${x} ${g}`),Te(S,g,x,r.useMaxWidth);let p;try{const e=r.valueFormat||",";if(e==="$0,0")p=C(c=>"$"+O(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),m=c?c[0]:"";p=C(w=>"$"+O(","+m)(w),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);p=C(m=>"$"+O(c||"")(m),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const b=Q().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),_=Q().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),$=Q().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);d&&S.append("text").attr("x",x/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=S.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ne(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),le=lt().size([i,v]).paddingTop(e=>e.children&&e.children.length>0?X+W:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?W:0).paddingRight(e=>e.children&&e.children.length>0?W:0).paddingBottom(e=>e.children&&e.children.length>0?W:0).round(!0)(R),me=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(me).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>b(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>_(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,c)=>`url(#clip-section-${a}-${c})`).attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=Z(this),m=e.data.name;c.text(m);const w=e.x1-e.x0,L=6;let T;r.showValues!==!1&&e.value?T=w-10-30-10-L:T=w-L-6;const y=Math.max(15,T),M=c.node();if(M.getComputedTextLength()>y){let V=m;for(;V.length>0;){if(V=m.substring(0,V.length-1),V.length===0){c.text("..."),M.getComputedTextLength()>y&&c.text("");break}if(c.text(V+"..."),M.getComputedTextLength()<=y)break}}}),r.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")});const se=le.leaves(),A=se.length>20,ge=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,re=A?8:10,K=A?1:2,U=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);U.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("stroke-width",3),U.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),U.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c=`text-anchor: middle; dominant-baseline: middle; font-size: ${ge}px;fill:`+$(e.data.name)+";",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=Z(this),m=e.x1-e.x0,w=e.y1-e.y0,L=c.node(),T=m-2*J,P=w-2*J;if(T<re||P<re){c.style("display","none");return}let y=parseInt(c.style("font-size"),10);const M=.6;for(;L.getComputedTextLength()>T&&y>D;)y--,c.style("font-size",`${y}px`);let F=Math.max(I,Math.min(j,Math.round(y*M))),k=y+K+F;for(;k>P&&y>D&&(y--,F=Math.max(I,Math.min(j,Math.round(y*M))),!(F<I&&y===D));)c.style("font-size",`${y}px`),k=y+K+F;c.style("font-size",`${y}px`),A?(y<D||P<D)&&c.style("display","none"):(L.getComputedTextLength()>T||y<D||P<y)&&c.style("display","none")}),r.showValues!==!1&&U.append("text").attr("class","treemapValue").attr("x",c=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",c=>{const m=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(c.data.name)+";",w=B({cssCompiledStyles:c.data.cssCompiledStyles});return m+w.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,m)=>`url(#clip-${a}-${m})`).text(c=>c.value?p(c.value):"").each(function(c){const m=Z(this),w=this.parentNode;if(!w){m.style("display","none");return}const L=Z(w).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){m.style("display","none");return}const T=parseFloat(L.style("font-size")),y=Math.max(I,Math.min(j,Math.round(T*.6)));m.style("font-size",`${y}px`);const F=(c.y1-c.y0)/2+T/2+K;m.attr("y",F);const k=c.x1-c.x0,ie=c.y1-c.y0-4,ve=k-2*J;m.node().getComputedTextLength()>ve||F+y>ie||y<I?m.style("display","none"):m.style("display",null)});const ye=r.diagramPadding??8;xe(S,ye,"flowchart",r?.useMaxWidth||!1)},"draw"),ct=C(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=C(({treemap:t}={})=>{const a=Ce(),l=ae(),n=ee(a,l.themeVariables),s=ee(dt,t),r=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
1
+ import{s as xe}from"./HlKQh-jr.js";import{p as be}from"./-Zg6rfog.js";import{b as C,a6 as Ce,W as ae,q as ee,aX as we,B as Te,ay as te,b8 as B,aW as Z,a_ as Le,V as $e,b0 as Ae,Y as Fe,U as _e,aZ as Ne,O as Me,ao as ke,r as Ve}from"./CqCb3N-V.js";import{p as ze}from"./nIshZjK_.js";import{f as O,o as Q}from"./CZtfaUbt.js";function De(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function Pe(){return this.eachAfter(De)}function Be(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function We(t,a){for(var l=this,n=[l],s,r,h=-1;l=n.pop();)if(t.call(a,l,++h,this),s=l.children)for(r=s.length-1;r>=0;--r)n.push(s[r]);return this}function Ee(t,a){for(var l=this,n=[l],s=[],r,h,d,f=-1;l=n.pop();)if(s.push(l),r=l.children)for(h=0,d=r.length;h<d;++h)n.push(r[h]);for(;l=s.pop();)t.call(a,l,++f,this);return this}function Re(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function He(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function Ie(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Oe(t){for(var a=this,l=qe(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;t!==l;)n.splice(s,0,t),t=t.parent;return n}function qe(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),s=null;for(t=l.pop(),a=n.pop();t===a;)s=t,t=l.pop(),a=n.pop();return s}function Ge(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Xe(){return Array.from(this)}function Ye(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function je(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ue(){var t=this,a,l=[t],n,s,r;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(s=0,r=n.length;s<r;++s)l.push(n[s]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ke)):a===void 0&&(a=Je);for(var l=new Y(t),n,s=[l],r,h,d,f;n=s.pop();)if((h=a(n.data))&&(f=(h=Array.from(h)).length))for(n.children=h,d=f-1;d>=0;--d)s.push(r=h[d]=new Y(h[d])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(et)}function Ze(){return ne(this).eachBefore(Qe)}function Je(t){return t.children}function Ke(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function et(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}Y.prototype=ne.prototype={constructor:Y,count:Pe,each:Be,eachAfter:Ee,eachBefore:We,find:Re,sum:He,sort:Ie,path:Oe,ancestors:Ge,descendants:Xe,leaves:Ye,links:je,copy:Ze,[Symbol.iterator]:Ue};function tt(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function at(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function oe(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(n-a)/t.value;++d<f;)h=r[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*o}Object.create(Y.prototype);function ce(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(s-l)/t.value;++d<f;)h=r[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*o}var he=(1+Math.sqrt(5))/2;function de(t,a,l,n,s,r){for(var h=[],d=a.children,f,o,u=0,S=0,i=d.length,v,x,g=a.value,p,b,_,$,z,R,N;u<i;){v=s-l,x=r-n;do p=d[S++].value;while(!p&&S<i);for(b=_=p,R=Math.max(x/v,v/x)/(g*t),N=p*p*R,z=Math.max(_/N,N/b);S<i;++S){if(p+=o=d[S].value,o<b&&(b=o),o>_&&(_=o),N=p*p*R,$=Math.max(_/N,N/b),$>z){p-=o;break}z=$}h.push(f={value:p,dice:v<x,children:d.slice(u,S)}),f.dice?oe(f,l,n,s,g?n+=x*p/g:r):ce(f,l,n,g?l+=v*p/g:s,r),g-=p,u=S}return h}var nt=(function t(a){function l(n,s,r,h,d){de(a,n,s,r,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);function lt(){var t=nt,a=!1,l=1,n=1,s=[0],r=q,h=q,d=q,f=q,o=q;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(S),s=[0],a&&i.eachBefore(at),i}function S(i){var v=s[i.depth],x=i.x0+v,g=i.y0+v,p=i.x1-v,b=i.y1-v;p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),i.x0=x,i.y0=g,i.x1=p,i.y1=b,i.children&&(v=s[i.depth+1]=r(i)/2,x+=o(i)-v,g+=h(i)-v,p-=d(i)-v,b-=f(i)-v,p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),t(i,x,g,p,b))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=tt(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(r=typeof i=="function"?i:G(+i),u):r},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),u):h},u.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),u):d},u.paddingBottom=function(i){return arguments.length?(f=typeof i=="function"?i:G(+i),u):f},u.paddingLeft=function(i){return arguments.length?(o=typeof i=="function"?i:G(+i),u):o},u}(function t(a){function l(n,s,r,h,d){if((f=n._squarify)&&f.ratio===a)for(var f,o,u,S,i=-1,v,x=f.length,g=n.value;++i<x;){for(o=f[i],u=o.children,S=o.value=0,v=u.length;S<v;++S)o.value+=u[S].value;o.dice?oe(o,s,r,h,g?r+=(d-r)*o.value/g:d):ce(o,s,r,g?s+=(h-s)*o.value/g:h,d),g-=o.value}else n._squarify=f=de(a,n,s,r,h,d),f.ratio=a}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);var E,ue=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Le,this.getAccTitle=$e,this.setDiagramTitle=Ae,this.getDiagramTitle=Fe,this.getAccDescription=_e,this.setAccDescription=Ne}getNodes(){return this.nodes}getConfig(){const a=Me,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},s=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(r=>{ke(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Ve(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(E,"TreeMapDB"),E);function pe(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const r=l[l.length-1].node;r.children?r.children.push(s):r.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}C(pe,"buildHierarchy");var st=C((t,a)=>{be(t,a);const l=[];for(const r of t.TreemapRows??[])r.$type==="ClassDefStatement"&&a.addClass(r.className??"",r.styleText??"");for(const r of t.TreemapRows??[]){const h=r.item;if(!h)continue;const d=r.indent?parseInt(r.indent):0,f=rt(h),o=h.classSelector?a.getStylesForClass(h.classSelector):[],u=o.length>0?o:void 0,S={level:d,name:f,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(S)}const n=pe(l),s=C((r,h)=>{for(const d of r)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),rt=C(t=>t.name?String(t.name):"","getItemName"),fe={parser:{yy:void 0},parse:C(async t=>{try{const l=await ze("treemap",t);te.debug("Treemap AST:",l);const n=fe.parser?.yy;if(!(n instanceof ue))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");st(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,W=10,X=25,ot=C((t,a,l,n)=>{const s=n.db,r=s.getConfig(),h=r.padding??it,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:o}=ae();if(!f)return;const u=d?30:0,S=we(a),i=r.nodeWidth?r.nodeWidth*W:960,v=r.nodeHeight?r.nodeHeight*W:500,x=i,g=v+u;S.attr("viewBox",`0 0 ${x} ${g}`),Te(S,g,x,r.useMaxWidth);let p;try{const e=r.valueFormat||",";if(e==="$0,0")p=C(c=>"$"+O(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),m=c?c[0]:"";p=C(w=>"$"+O(","+m)(w),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);p=C(m=>"$"+O(c||"")(m),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const b=Q().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),_=Q().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),$=Q().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);d&&S.append("text").attr("x",x/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=S.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ne(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),le=lt().size([i,v]).paddingTop(e=>e.children&&e.children.length>0?X+W:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?W:0).paddingRight(e=>e.children&&e.children.length>0?W:0).paddingBottom(e=>e.children&&e.children.length>0?W:0).round(!0)(R),me=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(me).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>b(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>_(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,c)=>`url(#clip-section-${a}-${c})`).attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=Z(this),m=e.data.name;c.text(m);const w=e.x1-e.x0,L=6;let T;r.showValues!==!1&&e.value?T=w-10-30-10-L:T=w-L-6;const y=Math.max(15,T),M=c.node();if(M.getComputedTextLength()>y){let V=m;for(;V.length>0;){if(V=m.substring(0,V.length-1),V.length===0){c.text("..."),M.getComputedTextLength()>y&&c.text("");break}if(c.text(V+"..."),M.getComputedTextLength()<=y)break}}}),r.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")});const se=le.leaves(),A=se.length>20,ge=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,re=A?8:10,K=A?1:2,U=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);U.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("stroke-width",3),U.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),U.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c=`text-anchor: middle; dominant-baseline: middle; font-size: ${ge}px;fill:`+$(e.data.name)+";",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=Z(this),m=e.x1-e.x0,w=e.y1-e.y0,L=c.node(),T=m-2*J,P=w-2*J;if(T<re||P<re){c.style("display","none");return}let y=parseInt(c.style("font-size"),10);const M=.6;for(;L.getComputedTextLength()>T&&y>D;)y--,c.style("font-size",`${y}px`);let F=Math.max(I,Math.min(j,Math.round(y*M))),k=y+K+F;for(;k>P&&y>D&&(y--,F=Math.max(I,Math.min(j,Math.round(y*M))),!(F<I&&y===D));)c.style("font-size",`${y}px`),k=y+K+F;c.style("font-size",`${y}px`),A?(y<D||P<D)&&c.style("display","none"):(L.getComputedTextLength()>T||y<D||P<y)&&c.style("display","none")}),r.showValues!==!1&&U.append("text").attr("class","treemapValue").attr("x",c=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",c=>{const m=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(c.data.name)+";",w=B({cssCompiledStyles:c.data.cssCompiledStyles});return m+w.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,m)=>`url(#clip-${a}-${m})`).text(c=>c.value?p(c.value):"").each(function(c){const m=Z(this),w=this.parentNode;if(!w){m.style("display","none");return}const L=Z(w).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){m.style("display","none");return}const T=parseFloat(L.style("font-size")),y=Math.max(I,Math.min(j,Math.round(T*.6)));m.style("font-size",`${y}px`);const F=(c.y1-c.y0)/2+T/2+K;m.attr("y",F);const k=c.x1-c.x0,ie=c.y1-c.y0-4,ve=k-2*J;m.node().getComputedTextLength()>ve||F+y>ie||y<I?m.style("display","none"):m.style("display",null)});const ye=r.diagramPadding??8;xe(S,ye,"flowchart",r?.useMaxWidth||!1)},"draw"),ct=C(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=C(({treemap:t}={})=>{const a=Ce(),l=ae(),n=ee(a,l.themeVariables),s=ee(dt,t),r=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
2
2
  .treemapNode.section {
3
3
  stroke: ${s.sectionStrokeColor};
4
4
  stroke-width: ${s.sectionStrokeWidth};
@@ -1 +1 @@
1
- import{D as C}from"./DBb8bRDA.js";import{t as re,bo as y,bw as se,b as ae,bm as I}from"./CLAmm_T1.js";import{bs as ne,cb as oe,c5 as ie,bH as k,aD as b,a5 as G,bA as W,b_ as R,W as E,bn as le,bV as q,c9 as F,aA as x,ay as H,bl as N,bS as L,bO as O,a7 as ce,aB as P}from"./3SdAC2_C.js";import{i as de}from"./BFgvMDua.js";import{k as me}from"./CIbfGsF-.js";import{s as D}from"./CcJmuwXr.js";import{a as ue}from"./BGyTNq2q.js";const K=C.shape.model,pe=C.shape.states.unwrap().element;function U(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fe(t){return/^(?:|model|model\.(?:nodes|edges|groups)|states)$/.test(t)}function ge(t){let e=0;const s=()=>{for(;/[\t\n\r ]/.test(t[e]??"\0");)e+=1},a=(l,d)=>{if(d>64)throw new Error("JSON nesting limit exceeded");s();const f=e,m=t[e];if(m===void 0)return{complete:!1};if(m==='"'){for(e+=1;e<t.length;){const r=t[e++];if(r==="\\")e+=1;else if(r==='"')return{value:JSON.parse(t.slice(f,e)),complete:!0}}return{complete:!1}}if(m==="{"||m==="["){const r=m==="{",c=r?Object.create(null):[],h=r?"}":"]";if(e+=1,s(),t[e]===h)return e+=1,{value:c,complete:!0};for(;e<t.length;){let i="";if(r){if(t[e]!=='"')throw new Error("Expected JSON property");const _=a(l,d+1);if(!_.complete)return{value:c,complete:!1};if(i=_.value,s(),e===t.length)return{value:c,complete:!1};if(t[e++]!==":")throw new Error("Expected JSON colon")}const g=r?l?`${l}.${i}`:i:`${l}[]`,v=a(g,d+1);if((v.complete||fe(g)&&v.value!==void 0)&&(Array.isArray(c)?c.push(v.value):c[i]=v.value),!v.complete)return{value:c,complete:!1};if(s(),e===t.length)return{value:c,complete:!1};if(t[e]===h)return e+=1,{value:c,complete:!0};if(t[e++]!==",")throw new Error("Expected JSON separator");s()}return{value:c,complete:!1}}for(;e<t.length&&!/[\t\n\r ,}\]]/.test(t[e]);)e+=1;return e===t.length?{complete:!1}:{value:JSON.parse(t.slice(f,e)),complete:!0}},n=a("",0);if(s(),n.complete&&e!==t.length)throw new Error("Unexpected JSON suffix");return n}function J(t){const e=new Set;return t.filter(({id:s})=>e.has(s)?!1:(e.add(s),!0))}function z(t,e,s,a){return[t.visibleNodes,t.highlightedNodes].every(n=>n?.every(l=>e.has(l))??!0)&&[t.visibleEdges,t.highlightedEdges].every(n=>n?.every(l=>s.has(l))??!0)&&(t.visibleGroups?.every(n=>a.has(n))??!0)&&(t.camera?.focus===void 0||e.has(t.camera.focus))}function ve(t){if(!U(t)||!U(t.model))return null;const e=t.model,s=(i,g)=>Array.isArray(i)?i.filter(v=>g.safeParse(v).success):[];let a=J(s(e.nodes,K.shape.nodes.element)),n=J(s(e.groups,K.shape.groups.unwrap().element)),l=!0;for(;l;){const i=new Set(a.map(({id:u})=>u)),g=n.filter(u=>u.nodeIds.every(A=>i.has(A))),v=new Set(g.map(({id:u})=>u)),_=a.filter(u=>u.group===void 0||v.has(u.group));l=_.length!==a.length||g.length!==n.length,a=_,n=g}if(!a.length)return null;const d=new Set(a.map(({id:i})=>i)),f=J(s(e.edges,K.shape.edges.element)).filter(i=>d.has(i.from)&&d.has(i.to)),m=new Set(f.map(({id:i})=>i)),r=new Set(n.map(({id:i})=>i)),c=J(s(t.states,pe)).filter(i=>z(i,d,m,r)),h={...t,model:{...e,nodes:a,edges:f,...e.groups===void 0?{}:{groups:n}},...t.states===void 0?{}:{states:c}};return c.some(i=>i.id===h.currentStateId)||delete h.currentStateId,C.safeParse(h).success?h:null}function V(t){if(!C.safeParse(t).success)return null;const e=t,{nodes:s,edges:a,groups:n=[]}=e.model,l=e.states??[],d=new Set(s.map(({id:r})=>r)),f=new Set(a.map(({id:r})=>r)),m=new Set(n.map(({id:r})=>r));return[s,a,n,l].some(r=>new Set(r.map(({id:c})=>c)).size!==r.length)||s.some(r=>r.group!==void 0&&!m.has(r.group))||a.some(r=>!d.has(r.from)||!d.has(r.to))||n.some(r=>r.nodeIds.some(c=>!d.has(c)))||l.some(r=>!z(r,d,f,m))||e.currentStateId!==void 0&&!l.some(r=>r.id===e.currentStateId)?null:e}function Oe(t,e=!1){const s=(a,n,l)=>({rawSource:t,status:a,diagram:n,...l?{error:l}:{}});try{if(e){const n=V(JSON.parse(t));return n?s("complete",n):s("invalid",null,"Invalid diagram payload")}const a=ge(t);if(a.complete){const n=V(a.value);if(n)return s("complete",n)}return s("partial",ve(a.value))}catch{return s(e?"invalid":"partial",null,e?"Invalid diagram JSON":void 0)}}var he=P('<div class="diagram-feedback svelte-p097sp" role="alert"><strong> </strong> <span> </span></div> <pre class="diagram-source svelte-p097sp"> </pre>',1),we=P('<div class="diagram-feedback svelte-p097sp" role="status"> </div>'),Se=P('<div class="streaming-diagram svelte-p097sp"><!></div>');function _e(t,e){if(new.target)return re({component:_e,...t});ne(e,!0);let s=y(e,"diagram",7),a=y(e,"isStreaming",7,!1),n=y(e,"source",7),l=y(e,"sourceError",7),d=y(e,"viewResetKey",7),f=y(e,"onBindingClick",7),m=q(null),r=q(0),c="",h,i=!1;oe(()=>{const o=s(),p=n(),w=d(),S=a(),B=!!l();ie(()=>{i&&(w!==h||!p.startsWith(c))&&(k(m,null),k(r,b(r)+1)),i=!0,c=p,h=w,B||!S&&!o?k(m,null):o&&k(m,o,!0)})});const g=F(()=>l()?null:s()??(a()?b(m):null)),v=F(()=>!!l()||!a()&&!s());var _={get diagram(){return s()},set diagram(o){s(o),x()},get isStreaming(){return a()},set isStreaming(o=!1){a(o),x()},get source(){return n()},set source(o){n(o),x()},get sourceError(){return l()},set sourceError(o){l(o),x()},get viewResetKey(){return d()},set viewResetKey(o){d(o),x()},get onBindingClick(){return f()},set onBindingClick(o){f(o),x()},$set:se,$on:(o,p)=>ae(e,o,p)},u=Se(),A=G(u);{var M=o=>{var p=he(),w=H(p),S=G(w),B=N(S,!0),X=L(S,2),Y=N(X,!0);W(w);var j=L(w,2),Z=N(j,!0);R(($,ee,te)=>{O(B,$),O(Y,ee),D(j,"aria-label",te),O(Z,n())},[()=>I.markdown_mermaid_renderFailed_error(),()=>I.diagram_renderer_error_description(),()=>I.markdown_mermaid_viewSource_label()]),E(o,p)},Q=o=>{var p=ce(),w=H(p);me(w,()=>b(r),S=>{ue(S,{get diagram(){return b(g)},editable:!1,get viewResetKey(){return d()},get onBindingClick(){return f()}})}),E(o,p)},T=o=>{var p=we(),w=N(p,!0);R(S=>O(w,S),[()=>I.ui_spinner_loading_ariaLabel()]),E(o,p)};de(A,o=>{b(v)?o(M):b(g)?o(Q,1):o(T,-1)})}return W(u),R(()=>{D(u,"aria-busy",a()),D(u,"data-diagram-streaming",a())}),E(t,u),le(_)}export{_e as S,Oe as p};
1
+ import{D as C}from"./Klbdavqn.js";import{t as re,bo as y,bw as se,b as ae,bm as I}from"./CLAmm_T1.js";import{bs as ne,cb as oe,c5 as ie,bH as k,aD as b,a5 as G,bA as W,b_ as R,W as E,bn as le,bV as q,c9 as F,aA as x,ay as H,bl as N,bS as L,bO as O,a7 as ce,aB as P}from"./3SdAC2_C.js";import{i as de}from"./BFgvMDua.js";import{k as me}from"./CIbfGsF-.js";import{s as D}from"./CcJmuwXr.js";import{a as ue}from"./CqCb3N-V.js";const K=C.shape.model,pe=C.shape.states.unwrap().element;function U(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fe(t){return/^(?:|model|model\.(?:nodes|edges|groups)|states)$/.test(t)}function ge(t){let e=0;const s=()=>{for(;/[\t\n\r ]/.test(t[e]??"\0");)e+=1},a=(l,d)=>{if(d>64)throw new Error("JSON nesting limit exceeded");s();const f=e,m=t[e];if(m===void 0)return{complete:!1};if(m==='"'){for(e+=1;e<t.length;){const r=t[e++];if(r==="\\")e+=1;else if(r==='"')return{value:JSON.parse(t.slice(f,e)),complete:!0}}return{complete:!1}}if(m==="{"||m==="["){const r=m==="{",c=r?Object.create(null):[],h=r?"}":"]";if(e+=1,s(),t[e]===h)return e+=1,{value:c,complete:!0};for(;e<t.length;){let i="";if(r){if(t[e]!=='"')throw new Error("Expected JSON property");const _=a(l,d+1);if(!_.complete)return{value:c,complete:!1};if(i=_.value,s(),e===t.length)return{value:c,complete:!1};if(t[e++]!==":")throw new Error("Expected JSON colon")}const g=r?l?`${l}.${i}`:i:`${l}[]`,v=a(g,d+1);if((v.complete||fe(g)&&v.value!==void 0)&&(Array.isArray(c)?c.push(v.value):c[i]=v.value),!v.complete)return{value:c,complete:!1};if(s(),e===t.length)return{value:c,complete:!1};if(t[e]===h)return e+=1,{value:c,complete:!0};if(t[e++]!==",")throw new Error("Expected JSON separator");s()}return{value:c,complete:!1}}for(;e<t.length&&!/[\t\n\r ,}\]]/.test(t[e]);)e+=1;return e===t.length?{complete:!1}:{value:JSON.parse(t.slice(f,e)),complete:!0}},n=a("",0);if(s(),n.complete&&e!==t.length)throw new Error("Unexpected JSON suffix");return n}function J(t){const e=new Set;return t.filter(({id:s})=>e.has(s)?!1:(e.add(s),!0))}function z(t,e,s,a){return[t.visibleNodes,t.highlightedNodes].every(n=>n?.every(l=>e.has(l))??!0)&&[t.visibleEdges,t.highlightedEdges].every(n=>n?.every(l=>s.has(l))??!0)&&(t.visibleGroups?.every(n=>a.has(n))??!0)&&(t.camera?.focus===void 0||e.has(t.camera.focus))}function ve(t){if(!U(t)||!U(t.model))return null;const e=t.model,s=(i,g)=>Array.isArray(i)?i.filter(v=>g.safeParse(v).success):[];let a=J(s(e.nodes,K.shape.nodes.element)),n=J(s(e.groups,K.shape.groups.unwrap().element)),l=!0;for(;l;){const i=new Set(a.map(({id:u})=>u)),g=n.filter(u=>u.nodeIds.every(A=>i.has(A))),v=new Set(g.map(({id:u})=>u)),_=a.filter(u=>u.group===void 0||v.has(u.group));l=_.length!==a.length||g.length!==n.length,a=_,n=g}if(!a.length)return null;const d=new Set(a.map(({id:i})=>i)),f=J(s(e.edges,K.shape.edges.element)).filter(i=>d.has(i.from)&&d.has(i.to)),m=new Set(f.map(({id:i})=>i)),r=new Set(n.map(({id:i})=>i)),c=J(s(t.states,pe)).filter(i=>z(i,d,m,r)),h={...t,model:{...e,nodes:a,edges:f,...e.groups===void 0?{}:{groups:n}},...t.states===void 0?{}:{states:c}};return c.some(i=>i.id===h.currentStateId)||delete h.currentStateId,C.safeParse(h).success?h:null}function V(t){if(!C.safeParse(t).success)return null;const e=t,{nodes:s,edges:a,groups:n=[]}=e.model,l=e.states??[],d=new Set(s.map(({id:r})=>r)),f=new Set(a.map(({id:r})=>r)),m=new Set(n.map(({id:r})=>r));return[s,a,n,l].some(r=>new Set(r.map(({id:c})=>c)).size!==r.length)||s.some(r=>r.group!==void 0&&!m.has(r.group))||a.some(r=>!d.has(r.from)||!d.has(r.to))||n.some(r=>r.nodeIds.some(c=>!d.has(c)))||l.some(r=>!z(r,d,f,m))||e.currentStateId!==void 0&&!l.some(r=>r.id===e.currentStateId)?null:e}function Oe(t,e=!1){const s=(a,n,l)=>({rawSource:t,status:a,diagram:n,...l?{error:l}:{}});try{if(e){const n=V(JSON.parse(t));return n?s("complete",n):s("invalid",null,"Invalid diagram payload")}const a=ge(t);if(a.complete){const n=V(a.value);if(n)return s("complete",n)}return s("partial",ve(a.value))}catch{return s(e?"invalid":"partial",null,e?"Invalid diagram JSON":void 0)}}var he=P('<div class="diagram-feedback svelte-p097sp" role="alert"><strong> </strong> <span> </span></div> <pre class="diagram-source svelte-p097sp"> </pre>',1),we=P('<div class="diagram-feedback svelte-p097sp" role="status"> </div>'),Se=P('<div class="streaming-diagram svelte-p097sp"><!></div>');function _e(t,e){if(new.target)return re({component:_e,...t});ne(e,!0);let s=y(e,"diagram",7),a=y(e,"isStreaming",7,!1),n=y(e,"source",7),l=y(e,"sourceError",7),d=y(e,"viewResetKey",7),f=y(e,"onBindingClick",7),m=q(null),r=q(0),c="",h,i=!1;oe(()=>{const o=s(),p=n(),w=d(),S=a(),B=!!l();ie(()=>{i&&(w!==h||!p.startsWith(c))&&(k(m,null),k(r,b(r)+1)),i=!0,c=p,h=w,B||!S&&!o?k(m,null):o&&k(m,o,!0)})});const g=F(()=>l()?null:s()??(a()?b(m):null)),v=F(()=>!!l()||!a()&&!s());var _={get diagram(){return s()},set diagram(o){s(o),x()},get isStreaming(){return a()},set isStreaming(o=!1){a(o),x()},get source(){return n()},set source(o){n(o),x()},get sourceError(){return l()},set sourceError(o){l(o),x()},get viewResetKey(){return d()},set viewResetKey(o){d(o),x()},get onBindingClick(){return f()},set onBindingClick(o){f(o),x()},$set:se,$on:(o,p)=>ae(e,o,p)},u=Se(),A=G(u);{var M=o=>{var p=he(),w=H(p),S=G(w),B=N(S,!0),X=L(S,2),Y=N(X,!0);W(w);var j=L(w,2),Z=N(j,!0);R(($,ee,te)=>{O(B,$),O(Y,ee),D(j,"aria-label",te),O(Z,n())},[()=>I.markdown_mermaid_renderFailed_error(),()=>I.diagram_renderer_error_description(),()=>I.markdown_mermaid_viewSource_label()]),E(o,p)},Q=o=>{var p=ce(),w=H(p);me(w,()=>b(r),S=>{ue(S,{get diagram(){return b(g)},editable:!1,get viewResetKey(){return d()},get onBindingClick(){return f()}})}),E(o,p)},T=o=>{var p=we(),w=N(p,!0);R(S=>O(w,S),[()=>I.ui_spinner_loading_ariaLabel()]),E(o,p)};de(A,o=>{b(v)?o(M):b(g)?o(Q,1):o(T,-1)})}return W(u),R(()=>{D(u,"aria-busy",a()),D(u,"data-diagram-streaming",a())}),E(t,u),le(_)}export{_e as S,Oe as p};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DaR1HweB.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BwA1d-u1.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DQw0Iiac.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/KnkAG0HD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/ByH7GIW_.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
- import{t as Bt,bo as h,bw as Ft,b as Ht,bm as g,bp as jf,bs as mt,bq as la,br as js,b6 as Xl,bj as Uf,b9 as qf,bi as Vf,ba as Kf,bf as Gf,a$ as Jf,b3 as Yf,bh as Xf,bk as Zf,a_ as Qf,b8 as $f,b7 as eg,b1 as tg,be as rg,bl as ng,bu as Zl,bd as ag,b5 as og,b4 as sg,b2 as ig,bc as lg,bb as cg,bg as dg,b0 as ug,_ as pg}from"./CLAmm_T1.js";import{bI as fg,bj as _o,aG as gg,bs as zt,ca as wt,c0 as zn,aD as e,a7 as ht,ay as De,bS as m,be as er,b$ as jt,b_ as S,bO as x,W as u,bH as T,c9 as d,a5 as E,bl as L,bA as w,bn as Wt,bV as ye,aA as b,aB as I,c5 as fn,aC as ja,bo as Ho,br as tn,bk as is,ai as oo,cd as Ro,aw as An,a as vg,aj as Nr,c7 as mg,c6 as Ql,bf as $o,bz as Ud}from"./3SdAC2_C.js";import{i as B}from"./BFgvMDua.js";import{k as ao}from"./CIbfGsF-.js";import{g as Lt,h as hg,e as Wn,I as ls,i as Lr,o as bg,p as yg,f as _g,s as xg}from"./B1CKzIA2.js";import{t as pn}from"./BwNrQXlF.js";import{c as Sr}from"./BwH4Bvte.js";import{n as Oi}from"./CfNIzRu8.js";import{b as wg,s as ne,g as Tn,e as kn,c as lr,f as ft}from"./CcJmuwXr.js";import{b as vr}from"./Dn334wJv.js";import{a as kg,V as Ig,E as Sg,k as Cg,i as Eg,_ as Pg,f as Ag}from"./BbhtQrkZ.js";import{p as qd,bJ as Vd,c$ as Kd,bq as Tg,dX as Rg,dJ as Mg,aJ as Lg,cJ as Ng,ac as Og,d5 as Dg,dI as es,aO as Us,ch as Bg,R as Fg,b as Hg,a9 as $l,db as zg,c5 as Wg,X as jg,dE as Ug,a3 as qg,dO as Vg,aq as Kg,cx as Gg,d2 as Jg,aF as Yg,n as Xg,H as Zg}from"./C2UL5Ler.js";import{c as Qg}from"./D-62MVd3.js";import{m as Hn,w as $g,C as Gd,c as ev,R as tv}from"./96V4v2iI.js";import{aa as Jd,f as Ct,ah as Ao,ae as Di}from"./nxtepGjE.js";import{w as rv,F as nv}from"./TB9r2XJy.js";import{T as av}from"./BIFBPuAO.js";import{F as Mt,bj as Bi,bO as ov,aq as sv,aS as iv,cQ as lv,bn as pl,bE as cv,aI as Yd,aN as fl,d3 as Ts,ad as Fi,cs as dv,ch as uv,cn as gl,cK as vl,bv as pv,e as fv,c3 as ec,cd as gv,cq as vv,c$ as Xd,bY as mv,ba as gi,bg as Jo,aH as hv,aB as Hi,aw as Zd,be as Qd,bF as bv,B as yv,by as _v,a2 as $d,b5 as xv,a8 as eu,cl as wv,an as tu,cS as ru,cO as tc,au as nu,aM as rc,cA as kv,cZ as Iv,cT as Sv,aL as Cv,b1 as Ev,bR as au,bp as Pv,ap as ml,c9 as nc,aA as Av,ab as Tv,a9 as Rv}from"./DPttSllj.js";import{c as ou}from"./ChTqQfQN.js";import{g as Mv}from"./BbYWP3Ow.js";import{JH as Ot,bZ as Lv,sA as ac,t9 as Nv,Kx as Ov,KD as Dv,m as su,Jk as iu,nY as lu,oc as cu,ob as du,nR as qs,qA as hl,yJ as Bv,vK as Is,v1 as zi,vM as Fv,nF as uu,JM as Hv,tR as zv,p0 as pu,rU as bl,mk as oc,aa as sc,rm as Wv,ri as jv,rn as Uv,re as qv,rk as Vv,vA as Kv,BB as fu,BF as gu,od as ic,Av as Gv,At as Jv,Ax as Yv,br as Wi,I2 as Xv,Jg as Zv,hr as lc,hq as Qv,o7 as $v,wM as em,wN as tm,wL as cc,CA as sa,cE as vu,cs as rm,xK as nm,dd as am,dk as om,BL as sm}from"./B9vHutcJ.js";import{z as mu,I as hu}from"./Bqd7fdCF.js";import{e as dc,i as bu}from"./CL3a4Hm1.js";import{e as uc,d as yu,b as im,a as lm,f as cm,I as dm}from"./DROfA7cv.js";import{b as _u}from"./D99jSct3.js";/* empty css */import{d as xu,G as wu,R as ku,g as Iu,f as um,M as Su,C as pm,q as yl,l as fm,h as gm,e as vm,a as Cu,o as mm,S as Eo,K as hm}from"./Dd-LQrG1.js";import{D as bm,e as ym}from"./BBFoj-dS.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import"./CgrVbtN0.js";import{b as _m}from"./D7QZQ0zf.js";import{r as xm}from"./CZr8f1ch.js";import{a4 as wm,cl as km,cn as Im,cm as Sm,b3 as Cm,b1 as Em,b2 as Pm,a2 as Am,al as bs,ak as Tm,cW as Rm,aA as pc,aJ as Mm,ai as Lm,C as Nm,i as Om,d8 as Ss,cX as Dm,aY as fc,d1 as Bm,af as Fm,a7 as Hm,r as zm,p as Wm,aG as jm,d4 as Um,cN as qm,cG as Vm,Q as Km,cx as Gm,bU as Jm}from"./DBb8bRDA.js";import{v as Ym,k as Xm,E as Zm,l as Qm,U as $m,q as eh,n as th,s as rh,I as nh,R as ah,m as oh,V as sh,o as Eu,S as Pu,i as ih,g as gc,f as lh,e as ch,j as dh,h as uh,c as vc,r as ph}from"./BQGkLFny.js";import{A as mc,a as fh}from"./-xQ9aHnN.js";import{aA as gh,aH as vh,g as mh,n as hh,aK as bh,K as yh,M as _h,O as xh,at as wh,aD as kh,av as Ih}from"./DQw0Iiac.js";import{f as Sh,e as Ch,m as ji,bE as Eh,A as Ph,bD as Ah,bA as Th,ah as hc,bC as Rh,bd as Ui,aq as Mh,k as Lh,b3 as Nh,q as bc,z as Oh,K as yc}from"./BwA1d-u1.js";import{i as Dh,I as Mo,c as _c}from"./DaWmj23r.js";import{A as Bh,s as Fh}from"./Cb1ltk9x.js";import{e as xc,l as wc,M as Au,m as qi,w as ho}from"./C46oSs94.js";import{b as Tu}from"./CVWwz1Ss.js";import{H as Hh}from"./B5N8LmEF.js";import{t as ts}from"./DAsc1V4f.js";import{a as zh}from"./hkJYqn41.js";import{P as Wh}from"./BnV9CBUH.js";import{C as Vi}from"./CDwhmkPo.js";import"./1-L83W2E.js";import{d as jh,c as Uh}from"./BksTLNI4.js";import{O as qh,M as Vh}from"./BtmHyUSg.js";import{b3 as Kh,bc as Gh,aM as Jh,bg as Yh,b1 as Xh,bb as Zh,b7 as Qh,ag as No,bi as kc,aZ as $h,b4 as eb,ba as _l,b5 as xl,a2 as vi,aB as tb,a4 as rb,be as nb,aY as ab,b6 as ob,b9 as sb,bl as ib,bj as lb,aJ as Ru,u as cb,s as db,b8 as ub,a7 as pb,az as fb,aO as gb,M as vb,aN as mb,ah as hb}from"./BGN20Sak.js";import{s as Ki}from"./ialDfbR3.js";import{e as Ic}from"./CYxt6gzD.js";import{M as bb}from"./B6dUCFoz.js";import{s as yb,a as _b}from"./BsieX9dN.js";import{u as wl,w as xb,v as Vs,I as wb,A as Sc,e as Oo,d as Oa,J as Cc,c as kb,f as Ib,g as Ec,i as Sb,b as Cb,o as Mu,j as Eb,q as Gi,r as Pb,O as Ab,x as Tb,k as Lu,S as Rb,N as Mb,p as Lb,n as Pc,z as Nb,s as Ob}from"./BFiq0x-M.js";import{o as Ac,T as mi,a as Db}from"./4DKzLFxz.js";import{D as rs}from"./rRCDXSQW.js";import{l as ar,e as Bb,f as Tc,m as Rc}from"./Cu5e4npY.js";import{A as ns}from"./9YT9B_ti.js";import"./ByyFoG6W.js";import{h as Nu}from"./BKD7o1lQ.js";import{C as ha}from"./BId1zNus.js";import{M as Fb}from"./BGyTNq2q.js";/* empty css */import{g as kl}from"./BrMDTgLg.js";import{h as Ji}from"./DaR1HweB.js";import{f as Mc,d as Hb}from"./DhBCCByJ.js";import{c as Cs}from"./CRSiOiSR.js";import{handleIntentLink as zb}from"./CPlbtgfY.js";import{a as Lc}from"./DgAgTFcK.js";import{t as Yi}from"./C-BsEdGZ.js";import{s as Wb,a as jb,M as Ou}from"./DP94l5zD.js";import{b as Ub,k as qb}from"./BPQFiQQc.js";import{m as Vb}from"./Dms_DO28.js";import{showAssistantContent as Kb}from"./B_EH4rnd.js";import{o as Rs,c as Gb,n as Jb}from"./pLgYa-qv.js";import{p as Yb}from"./Ccgqb2IM.js";import{H as Xb}from"./CfQcMKZg.js";import{d as Zb,c as Qb,r as $b,g as ey,w as Yo,e as ty,W as ry,b as ny}from"./BnaA6Qz9.js";import{A as Nc}from"./BhCMc9G0.js";import{m as ay}from"./A0p6PvBn.js";import{h as ys}from"./BWfc0sSK.js";import{g as oy,e as sy,f as iy,h as ly}from"./B5aYN90J.js";import{T as hi}from"./DMrzeQEi.js";import"./DZzwt3PA.js";import{S as Wa}from"./vj8NdGWd.js";import{R as cy,Q as dy,Z as uy,K as py}from"./KnkAG0HD.js";import{S as Qo,a as Xi,V as fy,b as vo,W as Zi,M as gy,C as vy,R as my,P as hy,y as by,l as yy,_ as _y,X as xy,Z as Oc,U as wy,Y as ky}from"./BzWT_wQw.js";import{D as Iy}from"./CjPEI4fg.js";import{a as Sy}from"./z5FcOXD5.js";import{a as Cy}from"./BdWqymET.js";import{p as Ey}from"./BPDTSRg_.js";const Py="intent:inline-visual-draft";function NP(r,t){const n=t.title.replace(/\s+/g," ").trim(),a=JSON.stringify({inputs:t.inputs,results:t.results},null,2),o=(a.match(/`+/g)??[]).reduce((c,l)=>Math.max(c,l.length),0),s="`".repeat(Math.max(3,o+1));return`${r}${r?`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/E1ou7S5Q.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BIjxJZ5i.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DQw0Iiac.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/KnkAG0HD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/WbzVOnzB.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
+ import{t as Bt,bo as h,bw as Ft,b as Ht,bm as g,bp as jf,bs as mt,bq as la,br as js,b6 as Xl,bj as Uf,b9 as qf,bi as Vf,ba as Kf,bf as Gf,a$ as Jf,b3 as Yf,bh as Xf,bk as Zf,a_ as Qf,b8 as $f,b7 as eg,b1 as tg,be as rg,bl as ng,bu as Zl,bd as ag,b5 as og,b4 as sg,b2 as ig,bc as lg,bb as cg,bg as dg,b0 as ug,_ as pg}from"./CLAmm_T1.js";import{bI as fg,bj as _o,aG as gg,bs as zt,ca as wt,c0 as zn,aD as e,a7 as ht,ay as De,bS as m,be as er,b$ as jt,b_ as S,bO as x,W as u,bH as T,c9 as d,a5 as E,bl as L,bA as w,bn as Wt,bV as ye,aA as b,aB as I,c5 as fn,aC as ja,bo as Ho,br as tn,bk as is,ai as oo,cd as Ro,aw as An,a as vg,aj as Nr,c7 as mg,c6 as Ql,bf as $o,bz as Ud}from"./3SdAC2_C.js";import{i as B}from"./BFgvMDua.js";import{k as ao}from"./CIbfGsF-.js";import{g as Lt,h as hg,e as Wn,I as ls,i as Lr,o as bg,p as yg,f as _g,s as xg}from"./B1CKzIA2.js";import{t as pn}from"./BwNrQXlF.js";import{c as Sr}from"./BwH4Bvte.js";import{n as Oi}from"./CfNIzRu8.js";import{b as wg,s as ne,g as Tn,e as kn,c as lr,f as ft}from"./CcJmuwXr.js";import{b as vr}from"./Dn334wJv.js";import{a as kg,V as Ig,E as Sg,k as Cg,i as Eg,_ as Pg,f as Ag}from"./BbhtQrkZ.js";import{p as qd,bJ as Vd,c$ as Kd,bq as Tg,dX as Rg,dJ as Mg,aJ as Lg,cJ as Ng,ac as Og,d5 as Dg,dI as es,aO as Us,ch as Bg,R as Fg,b as Hg,a9 as $l,db as zg,c5 as Wg,X as jg,dE as Ug,a3 as qg,dO as Vg,aq as Kg,cx as Gg,d2 as Jg,aF as Yg,n as Xg,H as Zg}from"./C2UL5Ler.js";import{c as Qg}from"./D-62MVd3.js";import{m as Hn,w as $g,C as Gd,c as ev,R as tv}from"./96V4v2iI.js";import{aa as Jd,f as Ct,ah as Ao,ae as Di}from"./nxtepGjE.js";import{w as rv,F as nv}from"./TB9r2XJy.js";import{T as av}from"./BIFBPuAO.js";import{F as Mt,bj as Bi,bO as ov,aq as sv,aS as iv,cQ as lv,bn as pl,bE as cv,aI as Yd,aN as fl,d3 as Ts,ad as Fi,cs as dv,ch as uv,cn as gl,cK as vl,bv as pv,e as fv,c3 as ec,cd as gv,cq as vv,c$ as Xd,bY as mv,ba as gi,bg as Jo,aH as hv,aB as Hi,aw as Zd,be as Qd,bF as bv,B as yv,by as _v,a2 as $d,b5 as xv,a8 as eu,cl as wv,an as tu,cS as ru,cO as tc,au as nu,aM as rc,cA as kv,cZ as Iv,cT as Sv,aL as Cv,b1 as Ev,bR as au,bp as Pv,ap as ml,c9 as nc,aA as Av,ab as Tv,a9 as Rv}from"./DPttSllj.js";import{c as ou}from"./ChTqQfQN.js";import{g as Mv}from"./BbYWP3Ow.js";import{JH as Ot,bZ as Lv,sA as ac,t9 as Nv,Kx as Ov,KD as Dv,m as su,Jk as iu,nY as lu,oc as cu,ob as du,nR as qs,qA as hl,yJ as Bv,vK as Is,v1 as zi,vM as Fv,nF as uu,JM as Hv,tR as zv,p0 as pu,rU as bl,mk as oc,aa as sc,rm as Wv,ri as jv,rn as Uv,re as qv,rk as Vv,vA as Kv,BB as fu,BF as gu,od as ic,Av as Gv,At as Jv,Ax as Yv,br as Wi,I2 as Xv,Jg as Zv,hr as lc,hq as Qv,o7 as $v,wM as em,wN as tm,wL as cc,CA as sa,cE as vu,cs as rm,xK as nm,dd as am,dk as om,BL as sm}from"./B9vHutcJ.js";import{z as mu,I as hu}from"./Bqd7fdCF.js";import{e as dc,i as bu}from"./CL3a4Hm1.js";import{e as uc,d as yu,b as im,a as lm,f as cm,I as dm}from"./Dnkb7G58.js";import{b as _u}from"./D99jSct3.js";/* empty css */import{d as xu,G as wu,R as ku,g as Iu,f as um,M as Su,C as pm,q as yl,l as fm,h as gm,e as vm,a as Cu,o as mm,S as Eo,K as hm}from"./Dd-LQrG1.js";import{D as bm,e as ym}from"./BBFoj-dS.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import"./CgrVbtN0.js";import{b as _m}from"./D7QZQ0zf.js";import{r as xm}from"./CZr8f1ch.js";import{a4 as wm,cl as km,cn as Im,cm as Sm,b3 as Cm,b1 as Em,b2 as Pm,a2 as Am,al as bs,ak as Tm,cW as Rm,aA as pc,aJ as Mm,ai as Lm,C as Nm,i as Om,d8 as Ss,cX as Dm,aY as fc,d1 as Bm,af as Fm,a7 as Hm,r as zm,p as Wm,aG as jm,d4 as Um,cN as qm,cG as Vm,Q as Km,cx as Gm,bU as Jm}from"./Klbdavqn.js";import{v as Ym,k as Xm,E as Zm,l as Qm,U as $m,q as eh,n as th,s as rh,I as nh,R as ah,m as oh,V as sh,o as Eu,S as Pu,i as ih,g as gc,f as lh,e as ch,j as dh,h as uh,c as vc,r as ph}from"./D9vbo-CC.js";import{A as mc,a as fh}from"./BYxTMRdy.js";import{aA as gh,aH as vh,g as mh,n as hh,aK as bh,K as yh,M as _h,O as xh,at as wh,aD as kh,av as Ih}from"./DQw0Iiac.js";import{f as Sh,e as Ch,m as ji,bE as Eh,A as Ph,bD as Ah,bA as Th,ah as hc,bC as Rh,bd as Ui,aq as Mh,k as Lh,b3 as Nh,q as bc,z as Oh,K as yc}from"./BIjxJZ5i.js";import{i as Dh,I as Mo,c as _c}from"./DaWmj23r.js";import{A as Bh,s as Fh}from"./CzEoKeV2.js";import{e as xc,l as wc,M as Au,m as qi,w as ho}from"./prVatUwz.js";import{b as Tu}from"./CVWwz1Ss.js";import{H as Hh}from"./B5N8LmEF.js";import{t as ts}from"./DAsc1V4f.js";import{a as zh}from"./hkJYqn41.js";import{P as Wh}from"./BnV9CBUH.js";import{C as Vi}from"./CDwhmkPo.js";import"./Cb0GBy9I.js";import{d as jh,c as Uh}from"./BksTLNI4.js";import{O as qh,M as Vh}from"./BtmHyUSg.js";import{b3 as Kh,bc as Gh,aM as Jh,bg as Yh,b1 as Xh,bb as Zh,b7 as Qh,ag as No,bi as kc,aZ as $h,b4 as eb,ba as _l,b5 as xl,a2 as vi,aB as tb,a4 as rb,be as nb,aY as ab,b6 as ob,b9 as sb,bl as ib,bj as lb,aJ as Ru,u as cb,s as db,b8 as ub,a7 as pb,az as fb,aO as gb,M as vb,aN as mb,ah as hb}from"./Bm6N2soI.js";import{s as Ki}from"./DWP4pi_Q.js";import{e as Ic}from"./CYxt6gzD.js";import{M as bb}from"./B6dUCFoz.js";import{s as yb,a as _b}from"./BsieX9dN.js";import{u as wl,w as xb,v as Vs,I as wb,A as Sc,e as Oo,d as Oa,J as Cc,c as kb,f as Ib,g as Ec,i as Sb,b as Cb,o as Mu,j as Eb,q as Gi,r as Pb,O as Ab,x as Tb,k as Lu,S as Rb,N as Mb,p as Lb,n as Pc,z as Nb,s as Ob}from"./6zHrL7ht.js";import{o as Ac,T as mi,a as Db}from"./C8LWodzW.js";import{D as rs}from"./C8ukaQ4v.js";import{l as ar,e as Bb,f as Tc,m as Rc}from"./Cu5e4npY.js";import{A as ns}from"./9YT9B_ti.js";import"./ByyFoG6W.js";import{h as Nu}from"./BKD7o1lQ.js";import{C as ha}from"./BId1zNus.js";import{M as Fb}from"./CqCb3N-V.js";/* empty css */import{g as kl}from"./BrMDTgLg.js";import{h as Ji}from"./E1ou7S5Q.js";import{f as Mc,d as Hb}from"./D09F61W3.js";import{c as Cs}from"./CRSiOiSR.js";import{handleIntentLink as zb}from"./CnpTi_2q.js";import{a as Lc}from"./DgAgTFcK.js";import{t as Yi}from"./C-BsEdGZ.js";import{s as Wb,a as jb,M as Ou}from"./BLg51chm.js";import{b as Ub,k as qb}from"./BPQFiQQc.js";import{m as Vb}from"./Dms_DO28.js";import{showAssistantContent as Kb}from"./CaTfcRGE.js";import{o as Rs,c as Gb,n as Jb}from"./Dzy45J4U.js";import{p as Yb}from"./Cqrn6Iuw.js";import{H as Xb}from"./CfQcMKZg.js";import{d as Zb,c as Qb,r as $b,g as ey,w as Yo,e as ty,W as ry,b as ny}from"./BotNUGl4.js";import{A as Nc}from"./BhCMc9G0.js";import{m as ay}from"./A0p6PvBn.js";import{h as ys}from"./BWfc0sSK.js";import{g as oy,e as sy,f as iy,h as ly}from"./B5aYN90J.js";import{T as hi}from"./DMrzeQEi.js";import"./DZzwt3PA.js";import{S as Wa}from"./vj8NdGWd.js";import{R as cy,Q as dy,Z as uy,K as py}from"./KnkAG0HD.js";import{S as Qo,a as Xi,V as fy,b as vo,W as Zi,M as gy,C as vy,R as my,P as hy,y as by,l as yy,_ as _y,X as xy,Z as Oc,U as wy,Y as ky}from"./BzWT_wQw.js";import{D as Iy}from"./CjPEI4fg.js";import{a as Sy}from"./z5FcOXD5.js";import{a as Cy}from"./BdWqymET.js";import{p as Ey}from"./RhUR09AA.js";const Py="intent:inline-visual-draft";function NP(r,t){const n=t.title.replace(/\s+/g," ").trim(),a=JSON.stringify({inputs:t.inputs,results:t.results},null,2),o=(a.match(/`+/g)??[]).reduce((c,l)=>Math.max(c,l.length),0),s="`".repeat(Math.max(3,o+1));return`${r}${r?`
3
3
 
4
4
  `:""}${n}
5
5
 
@@ -294,7 +294,7 @@ ${r.content}`:a.content=r.content,a):r.old_text!==void 0&&r.new_text!==void 0?(a
294
294
  `,Yk=["background","foreground","card","card-foreground","primary","primary-ink","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","border","input","ring","danger","danger-background","info","info-foreground","success","success-foreground","warning","warning-foreground","font-ui","font-code","text-body-size","text-body-line-height","text-body-weight","text-body-tracking","radius-small","radius-medium","radius-large","app-background","sidebar","sidebar-accent","agent-avatar-surface-active","agent-avatar-foreground","diagram-host-surface","diagram-canvas","diagram-label-surface","diagram-node-surface","diagram-node-hover-surface","diagram-node-outline","diagram-node-title","diagram-metadata","diagram-group-outline","diagram-connector","diagram-connector-hover","diagram-connector-muted","diagram-connector-inactive","diagram-connector-danger","diagram-connector-success","diagram-connector-warning","diagram-connector-active","diagram-accent","diagram-accent-foreground","diagram-node-radius","diagram-group-radius","diagram-connector-width","text-caption-size","text-caption-line-height","text-caption-weight","text-caption-tracking","text-body-strong-size","text-body-strong-line-height","text-body-strong-weight","text-body-strong-tracking","space-1","space-2","space-3","space-4","space-5","space-6","space-7","control-height-compact","control-height-small","control-height-medium","control-height-large","radius-full","spring-fast","spring-fast-exit","spring-fast-ease","spring-moderate","spring-moderate-exit","spring-moderate-ease","spring-slow","spring-slow-exit","spring-slow-ease","spring-exit-ease","motion-fast","motion-standard","motion-slow","ease-standard","ease-emphasized-out","motion-reduced"],Ti=96,Id=2e4,Xk=480,Kp=512,Zk=["default-src 'none'","script-src 'unsafe-inline'","style-src 'unsafe-inline'","img-src data:","connect-src 'none'","font-src data:","media-src 'none'","object-src 'none'","frame-src 'none'","child-src 'none'","worker-src 'none'","manifest-src 'none'","base-uri 'none'","form-action 'none'"].join("; ");function Qk(r,t,n,a,o,s){const c=new MessageChannel,l=MessagePort.prototype.postMessage.bind(c.port1);window.parent.postMessage({channel:r,type:"scroll-port"},"*",[c.port2]);const p=(k,F={})=>{window.parent.postMessage({channel:r,type:k,...F},"*")};let i=o?.state??null,f=null,v=!1;Object.defineProperty(window,"intentVisual",{configurable:!1,writable:!1,value:Object.freeze({get state(){return i},publish(k){try{if(!s(k))return!1;const F=JSON.parse(JSON.stringify(k));return i=F.state,f=F,v||(v=!0,requestAnimationFrame(()=>{v=!1,f&&p("snapshot",{snapshot:f}),f=null})),!0}catch{return!1}}})});let M=!1,_=-1,y=innerHeight,R=Number.NaN,N=0,D=0;const H=()=>{if(M=!1,!document.body)return;let k=Math.ceil(Math.max(document.body.scrollHeight,document.body.getBoundingClientRect().height));const F=innerHeight,V=k-F;if(F>y+1&&V>1&&Math.abs(V-R)<=1?N+=1:(F!==y||V<=1)&&(N=0),y=F,R=V,!D&&N>=3){D=Math.max(a,F);const z="Page height follows the frame (vh units or height: 100%); frame height held.";console.warn(z),p("layout",{message:z})}D&&(k=Math.min(k,D)),k!==_&&(_=k,p("resize",{height:k}))},C=()=>{M||(M=!0,requestAnimationFrame(H))},A=k=>{if(!k||typeof k.dark!="boolean"||!k.variables)return;const F=document.documentElement;F.classList.toggle("dark",k.dark),F.style.colorScheme=k.dark?"dark":"light";const V=k.variables["--inline-html-root-font-size"];"--inline-html-root-font-size"in t.variables&&typeof V=="string"&&V.length<512&&F.style.setProperty("--inline-html-root-font-size",V);for(const z of Object.keys(t.variables)){if(z==="--inline-html-root-font-size")continue;const G=k.variables[z];typeof G=="string"&&G.length<512&&F.style.setProperty(z,G)}C()};window.addEventListener("message",k=>{k.source!==window.parent||!k.data||k.data.channel!==r||k.data.type==="theme"&&A(k.data.theme)});const U=k=>{if(k.defaultPrevented||!k.isTrusted||k.ctrlKey||k.metaKey||k.shiftKey||!k.deltaY||Math.abs(k.deltaX)>Math.abs(k.deltaY))return;const F=G=>{const ie=getComputedStyle(G);if(G!==document.scrollingElement&&!/^(auto|scroll|overlay)$/.test(ie.overflowY)||/^(hidden|clip)$/.test(ie.overflowY))return!1;const Z=G.scrollHeight-G.clientHeight;return Z>1&&(k.deltaY<0?G.scrollTop>1:G.scrollTop<Z-1)};if(k.composedPath().some(G=>G instanceof Element&&F(G))||document.scrollingElement&&F(document.scrollingElement))return;const V=k.deltaMode===WheelEvent.DOM_DELTA_LINE?parseFloat(getComputedStyle(document.body).lineHeight)||16:k.deltaMode===WheelEvent.DOM_DELTA_PAGE?innerHeight:1,z=Math.max(-n,Math.min(n,k.deltaY*V));Number.isFinite(z)&&(k.preventDefault(),l({deltaY:z}))};window.addEventListener("wheel",()=>{window.removeEventListener("wheel",U),window.addEventListener("wheel",U,{passive:!1})},{capture:!0,passive:!1}),window.addEventListener("error",k=>{k.message&&p("error",{message:k.message.slice(0,300)})}),window.addEventListener("unhandledrejection",k=>{const F=k.reason;p("error",{message:String(F instanceof Error?F.message:F).slice(0,300)})}),window.addEventListener("click",k=>{const F=k.target instanceof Element?k.target.closest("a, area"):null;if(!F)return;(F.getAttribute("href")??F.getAttribute("xlink:href"))?.startsWith("#")||k.preventDefault()},!0),window.addEventListener("submit",k=>k.preventDefault(),!0),A(t),window.addEventListener("DOMContentLoaded",()=>{new ResizeObserver(C).observe(document.body),new MutationObserver(C).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),window.addEventListener("resize",C),document.addEventListener("load",C,!0),document.fonts.ready.then(C),p("ready"),C()},{once:!0})}function $k(r,t,n,a,o){const s=document.createElement("iframe");s.setAttribute("sandbox","allow-scripts"),s.setAttribute("referrerpolicy","no-referrer"),s.title=n,s.style.cssText="display:block;width:100%;height:100%;border:0;";let c;const l=p=>{const i=p.data?.deltaY;typeof i=="number"&&Number.isFinite(i)&&i!==0&&Math.abs(i)<=a&&window.parent.postMessage({channel:r,type:"wheel",deltaY:i},"*")};window.addEventListener("message",p=>{const i=p.data;if(!(!i||typeof i!="object"||i.channel!==r)){if(p.source===window.parent&&i.type==="theme"){s.contentWindow?.postMessage({channel:r,type:"theme",theme:i.theme},"*");return}if(!(p.source!==s.contentWindow||p.origin!=="null")){if(i.type==="scroll-port"&&!c&&p.ports.length===1){c=p.ports[0],c.onmessage=l;return}i.type==="resize"&&typeof i.height=="number"&&Number.isFinite(i.height)&&i.height>=0?window.parent.postMessage({channel:r,type:"resize",height:i.height},"*"):i.type==="ready"?window.parent.postMessage({channel:r,type:"ready"},"*"):(i.type==="error"||i.type==="layout")&&typeof i.message=="string"?window.parent.postMessage({channel:r,type:i.type,message:i.message.slice(0,300)},"*"):i.type==="snapshot"&&o(i.snapshot)&&window.parent.postMessage({channel:r,type:"snapshot",snapshot:i.snapshot},"*")}}}),window.addEventListener("DOMContentLoaded",()=>{s.srcdoc=t,document.body.append(s)},{once:!0})}function e2(r,t,n,a,o,s,c,l){const p=document.implementation.createHTMLDocument(""),i=p.createElement("template");i.innerHTML=n,p.body.append(i.content);const f=z=>{z.querySelectorAll("meta, base, link, iframe, frame, frameset, object, embed").forEach(G=>G.remove()),z.querySelectorAll("template").forEach(G=>f(G.content)),z.querySelectorAll("a, area").forEach(G=>{for(const ie of["href","xlink:href"])G.getAttribute(ie)?.startsWith("#")||G.removeAttribute(ie);G.removeAttribute("target"),G.removeAttribute("ping"),G.removeAttribute("download")})};f(p);const v=z=>JSON.stringify(z).replace(/</g,"\\u003c"),M=p.createElement("meta");M.httpEquiv="Content-Security-Policy",M.content=r.csp;const _=p.createElement("meta");_.setAttribute("charset","utf-8");const y=p.createElement("style"),R=/^data:[\w.+/-]+;base64,[A-Za-z0-9+/=]+$/.test(l)?`@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900;
295
295
  font-display: swap; src: url('${l}') format('woff2'); }`:"";y.textContent=`${R}${r.styles}`;const N=p.createElement("script"),D=v([a,o,r.maxScrollDelta,r.lockHeight,t(c)?c:null]);N.textContent=`(${r.bridge})(...${D}, (${r.validate}));`,p.head.prepend(M,_,y,N);const H=`<!doctype html>${p.documentElement.outerHTML}`,C=document.implementation.createHTMLDocument(""),A=C.createElement("meta");A.httpEquiv="Content-Security-Policy",A.content=r.csp.replace("frame-src 'none'","frame-src about:");const U=C.createElement("meta");U.setAttribute("charset","utf-8");const k=C.createElement("style");k.textContent="html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }";const F=C.createElement("script"),V=v([a,H,s,r.maxScrollDelta]);return F.textContent=`(${r.shell})(...${V}, (${r.validate}));`,C.head.prepend(A,U,k,F),`<!doctype html>${C.documentElement.outerHTML}`}const t2=()=>({csp:Zk,styles:Jk,maxScrollDelta:Kp,lockHeight:Xk,bridge:Qk.toString(),shell:$k.toString(),validate:bl.toString()});function r2(r,t,n,a,o=null,s=""){return e2(t2(),bl,r,t,n,a,o,s)}function Sd(r){const t=getComputedStyle(r);return{dark:document.documentElement.classList.contains("dark"),variables:{...Object.fromEntries(Yk.map(n=>[`--${n}`,t.getPropertyValue(`--${n}`).trim()])),"--inline-html-root-font-size":getComputedStyle(document.documentElement).fontSize}}}function n2(r,t,n,a,o=null){return r2(r,t,n,a,o,Gk)}var a2=I('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground"> </p>'),o2=I('<div class="type-body flex items-center justify-between gap-3 px-4 py-2" role="status"><span class="text-danger"> </span> <!></div> <!>',1),s2=I('<p class="sr-only" role="status"> </p>'),i2=I('<p class="type-body m-0 px-4 py-3 text-muted-foreground" role="status"> </p>'),l2=I('<div class="type-body px-4 py-2 text-danger" role="status"><p class="m-0"> </p> <p class="type-code m-0 break-words"> </p></div>'),c2=I('<iframe sandbox="allow-scripts" referrerpolicy="no-referrer"></iframe>'),d2=I('<div class="space-y-4 p-4" aria-hidden="true"><div class="space-y-2"><!> <!></div> <!> <div class="flex items-center gap-4"><!> <!> <!></div></div>'),u2=I('<span aria-hidden="true"><!></span> <span class="min-w-0 flex-1 whitespace-normal text-pretty"> </span>',1),p2=I('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground" role="status"> <!></p>'),f2=I('<th class="min-w-40 px-2 pb-3 align-top font-normal"><!> <div class="mt-1 flex gap-1"><!> <!></div></th>'),g2=I('<td class="max-w-56 px-2 py-2 align-top break-words tabular-nums"> </td>'),v2=I('<tr><th class="max-w-48 py-2 pr-4 align-top font-normal break-words text-muted-foreground"> </th><!></tr>'),m2=I('<div class="overflow-x-auto px-4 pb-4" data-inline-visual-comparison=""><table class="type-body w-full border-separate border-spacing-0 text-left"><thead><tr><th class="min-w-28 pr-4 pb-3 font-normal text-muted-foreground"> </th><th class="min-w-32 px-2 pb-3 align-top font-medium"> </th><!></tr></thead><tbody></tbody></table></div>'),h2=I("<!> <!>",1),b2=I('<div data-inline-html="" class="my-3 min-w-0 overflow-hidden rounded-lg bg-background text-foreground"><!> <!> <div class="relative min-w-0"><!> <!></div> <div class="flex min-w-0 items-center justify-between gap-2 px-4 pt-1 pb-3" data-inline-visual-actions=""><!> <!></div> <!></div>');function Gp(r,t){if(new.target)return Bt({component:Gp,...r});zt(t,!0);const n=720,a=1e4;let o=h(t,"source",7),s=h(t,"isStreaming",7,!1),c=h(t,"isComplete",7,!0),l=h(t,"record",7),p=h(t,"storageStatus",7,"ready"),i=h(t,"onRecordChange",7),f=h(t,"onUseConfiguration",7),v=h(t,"onExport",7),M=h(t,"onRetry",7),_=h(t,"storageError",7),y=h(t,"exportStatus",7),R=h(t,"exportPath",7),N=h(t,"exportError",7),D,H=ye(void 0),C=ye(!1),A=ye(!1),U=ye(0),k=ye(""),F=ye(""),V=ye(!1),z=ye(""),G=ye(tn(Ti)),ie=ye(n),Z=ye(""),ke=ye(oc()),oe=ye(void 0),Ae=ye(void 0),ge,Ie=ye(void 0),te=ye(!1);const Q=d(()=>l()??e(ke)),we=d(()=>e(Ae)!==void 0&&e(oe)!==void 0&&!Vb(e(Ae),e(oe).inputs)),ue=d(()=>p()!=="loading"&&(p()!=="error"||!!e(Q).current)),be=d(()=>!s()&&c()&&!!o().trim()&&e(ue)),Ge=d(()=>Math.min(Id,Math.max(Ti,e(G)))),$e=d(()=>s()||p()==="loading"?"loading":c()?o().trim()?e(z)?"error":e(V)?"ready":"loading":"empty":"incomplete"),$=d(()=>s()||p()==="loading"||e(be)&&!e(V)&&!e(z)),Y=d(()=>mm([{id:"source",label:e(A)?qf():Vf()},{id:"reload",label:Kf(),disabled:!e(be)},{id:"save",label:Gf(),when:!!(e(oe)&&e(be)),disabled:!e(V)||!!e(z)||e(Q).scenarios.length>=sc,group:"configuration"},{id:"compare",label:Jf(),when:!!(e(oe)&&e(be)&&e(Q).scenarios.length),group:"configuration"},{id:"export",label:Yf(),when:!!(e(oe)&&e(be)&&v()),disabled:!e(V)||y()==="saving",group:"configuration"}]));function xe(le){le==="source"?T(A,!e(A)):le==="reload"?T(U,e(U)+1):le==="save"?q():le==="compare"?T(te,!e(te)):le==="export"&&v()?.({...e(Q),current:e(oe)??null})}function j(le){const Me={...le,current:e(oe)??le.current};T(ke,Me),i()?.(Me)}function q(){const le=e(oe);!le||e(Q).scenarios.length>=sc||(j({...e(Q),scenarios:[...e(Q).scenarios,{id:crypto.randomUUID(),name:Xf({number:Rc(e(Q).scenarios.length+1)}),snapshot:structuredClone(le)}]}),T(te,!0))}function J(le,Me){const Ze=Me.trim().slice(0,120);Ze&&j({...e(Q),scenarios:e(Q).scenarios.map(gt=>gt.id===le?{...gt,name:Ze}:gt)})}function se(le){const Me=structuredClone(le);T(oe,Me),T(Ie,Me),j({...e(Q),current:Me}),T(U,e(U)+1)}function _e(le){return typeof le=="number"?Rc(le):typeof le=="string"?le:JSON.stringify(le)}function Ne(){!e(H)?.contentWindow||!e(F)||e(H).contentWindow.postMessage({channel:e(F),type:"theme",theme:Sd(D)},"*")}function ee(le){let Me=D.parentElement;for(;Me;){const Ze=getComputedStyle(Me),gt=Me.scrollHeight-Me.clientHeight;if(/^(auto|scroll|overlay)$/.test(Ze.overflowY)&&gt>1){if(le<0?Me.scrollTop>0:Me.scrollTop<gt){Me.dispatchEvent(new WheelEvent("wheel",{deltaY:le,bubbles:!0})),Me.scrollTop+=le;return}if(/^(contain|none)$/.test(Ze.overscrollBehaviorY))return}Me=Me.parentElement}window.scrollBy({top:le,behavior:"instant"})}wt(()=>{if(!e(C))return;const le=o(),Me=e(be);e(U),fn(()=>{ge!==le&&(T(ke,oc()),T(oe,void 0),T(Ae,void 0),T(te,!1),T(Ie,void 0),ge=le),T(V,!1),T(z,""),T(Z,""),T(G,Ti,!0),T(F,crypto.randomUUID(),!0),T(k,Me?n2(le,e(F),Sd(D),Xl(),e(Ie)??e(oe)??e(Q).current):"",!0),T(Ie,void 0)})}),wt(()=>{if(!e(k)||e(V)||e(z))return;const le=setTimeout(()=>{T(z,Uf(),!0)},a);return()=>clearTimeout(le)}),is(()=>{T(C,!0);const le=dt=>{if(dt.source!==e(H)?.contentWindow||dt.origin!=="null")return;const at=dt.data;if(!(!at||typeof at!="object"||at.channel!==e(F))){if(at.type==="bootstrap"){e(H)?.contentWindow?.postMessage({channel:e(F),type:"initialize",documentHtml:e(k)},"*");return}if(at.type==="resize"&&typeof at.height=="number"&&Number.isFinite(at.height)&&at.height>=0)T(G,Math.min(Id,Math.ceil(at.height)),!0);else if(at.type==="ready")T(V,!0),Ne();else if(at.type==="error"&&typeof at.message=="string")T(z,at.message.slice(0,300),!0);else if(at.type==="layout"&&typeof at.message=="string")T(Z,at.message.slice(0,300),!0);else if(at.type==="snapshot"&&e(be)&&bl(at.snapshot)){const Pt=at.snapshot;T(Ae,e(Ae)??structuredClone(Pt.inputs)),T(oe,Pt),j({...e(Q),current:Pt})}else at.type==="wheel"&&e(V)&&e(be)&&!e(A)&&!e($)&&typeof at.deltaY=="number"&&Number.isFinite(at.deltaY)&&at.deltaY!==0&&Math.abs(at.deltaY)<=Kp&&ee(at.deltaY)}},Me=()=>{T(ie,Math.min(n,Math.max(160,Math.floor(window.innerHeight*.8))),!0)},Ze=new MutationObserver(Ne);Ze.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]});const gt=window.matchMedia("(prefers-color-scheme: dark)");return gt.addEventListener("change",Ne),window.addEventListener("message",le),window.addEventListener("resize",Me),Me(),()=>{Ze.disconnect(),gt.removeEventListener("change",Ne),window.removeEventListener("message",le),window.removeEventListener("resize",Me)}});var pe={get source(){return o()},set source(le){o(le),b()},get isStreaming(){return s()},set isStreaming(le=!1){s(le),b()},get isComplete(){return c()},set isComplete(le=!0){c(le),b()},get record(){return l()},set record(le){l(le),b()},get storageStatus(){return p()},set storageStatus(le="ready"){p(le),b()},get onRecordChange(){return i()},set onRecordChange(le){i(le),b()},get onUseConfiguration(){return f()},set onUseConfiguration(le){f(le),b()},get onExport(){return v()},set onExport(le){v(le),b()},get onRetry(){return M()},set onRetry(le){M(le),b()},get storageError(){return _()},set storageError(le){_(le),b()},get exportStatus(){return y()},set exportStatus(le){y(le),b()},get exportPath(){return R()},set exportPath(le){R(le),b()},get exportError(){return N()},set exportError(le){N(le),b()},$set:Ft,$on:(le,Me)=>Ht(t,le,Me)},ce=b2(),et=E(ce);{var me=le=>{var Me=o2(),Ze=De(Me),gt=E(Ze),dt=L(gt,!0),at=m(gt,2);{var Pt=Nt=>{Ct(Nt,{variant:"ghost",size:"sm",get onclick(){return M()},children:(Gt,tr)=>{er();var Vt=jt();S(Oe=>x(Vt,Oe),[()=>ag()]),u(Gt,Vt)},$$slots:{default:!0}})};B(at,Nt=>{M()&&Nt(Pt)})}w(Ze);var St=m(Ze,2);{var _t=Nt=>{var Gt=a2(),tr=L(Gt,!0);S(()=>x(tr,_())),u(Nt,Gt)};B(St,Nt=>{_()&&Nt(_t)})}S(Nt=>x(dt,Nt),[()=>Zf()]),u(le,Me)};B(et,le=>{p()==="error"&&le(me)})}var Ee=m(et,2);{var X=le=>{var Me=s2(),Ze=L(Me,!0);S(gt=>x(Ze,gt),[()=>s()?Qf():$f()]),u(le,Me)},Ce=le=>{var Me=i2(),Ze=L(Me,!0);S(gt=>x(Ze,gt),[()=>c()?tg():eg()]),u(le,Me)},fe=le=>{var Me=l2(),Ze=E(Me),gt=L(Ze,!0),dt=m(Ze,2),at=L(dt,!0);w(Me),S(Pt=>{x(gt,Pt),x(at,e(z))},[()=>rg()]),u(le,Me)};B(Ee,le=>{e($)?le(X):e(be)?e(z)&&le(fe,2):le(Ce,1)})}var O=m(Ee,2),K=E(O);{var Pe=le=>{var Me=ht(),Ze=De(Me);ao(Ze,()=>e(F),gt=>{var dt=c2();let at,Pt;vr(dt,St=>T(H,St),()=>e(H)),S(St=>{ne(dt,"title",St),ne(dt,"src",`/inline-html-sandbox.html#${e(F)}`),at=ft(dt,1,"block w-full border-0 svelte-1kkow1d",null,at,{"preview-hidden":e(A)||!e(V)}),ne(dt,"aria-hidden",e(A)||!e(V)),Pt=Tn(dt,"",Pt,{height:`${e(Ge)}px`})},[()=>Xl()]),u(gt,dt)}),u(le,Me)};B(K,le=>{e(be)&&e(k)&&le(Pe)})}var qe=m(K,2);{var Le=le=>{ha(le,{get code(){return o()},language:"html",noBorder:!0,noMargin:!0,get maxHeight(){return e(ie)}})},je=le=>{var Me=d2(),Ze=E(Me),gt=E(Ze);Eo(gt,{class:"h-4 w-32 max-w-1/2"});var dt=m(gt,2);Eo(dt,{class:"h-3 w-2/3"}),w(Ze);var at=m(Ze,2);Eo(at,{class:"aspect-video max-h-60 w-full rounded-lg"});var Pt=m(at,2),St=E(Pt);Eo(St,{class:"h-3 w-16"});var _t=m(St,2);Eo(_t,{class:"h-2 min-w-0 flex-1"});var Nt=m(_t,2);Eo(Nt,{class:"h-3 w-10"}),w(Pt),w(Me),u(le,Me)};B(qe,le=>{e(A)?le(Le):e($)&&le(je,1)})}w(O);var Ke=m(O,2),lt=E(Ke);{var bt=le=>{{let Me=d(()=>!e(V)||!!e(z));Ct(le,{variant:"plain",size:"sm",wrapContent:!1,get class(){return`${Gi} ${Pb} h-auto min-w-0 shrink justify-start rounded-sm border border-transparent px-1.5 py-0.5 text-left hover:text-foreground`},style:"gap: var(--operational-leading-gap)","data-typography-role":"body",get disabled(){return e(Me)},onclick:()=>e(oe)&&f()(e(oe)),children:(Ze,gt)=>{var dt=u2(),at=De(dt),Pt=E(at);Mt(Pt,{get icon(){return $d},size:16,get class(){return Oa}}),w(at);var St=m(at,2),_t=L(St,!0);S(Nt=>{ft(at,1,`${Oo??""} mt-px self-start`,"svelte-1kkow1d"),x(_t,Nt)},[()=>ng()]),u(Ze,dt)},$$slots:{default:!0}})}};B(lt,le=>{e(oe)&&e(we)&&e(be)&&f()&&!e(A)&&le(bt)})}var yt=m(lt,2);{const le=(Ze,gt)=>{let dt=()=>(gt?.()).props;{let at=d(()=>Zl());Ct(Ze,js(dt,{variant:"ghost",size:"icon-sm",class:"ml-auto text-muted-foreground",get"aria-label"(){return e(at)},children:(Pt,St)=>{Mt(Pt,{get icon(){return xv},size:16})},$$slots:{default:!0}}))}};let Me=d(()=>Zl());Cu(yt,{get actions(){return e(Y)},get ariaLabel(){return e(Me)},align:"end",side:"top",onAction:xe,trigger:le,$$slots:{trigger:!0}})}w(Ke);var qt=m(Ke,2);{var It=le=>{var Me=h2(),Ze=De(Me);{var gt=Pt=>{var St=p2(),_t=E(St),Nt=m(_t);{var Gt=tr=>{var Vt=jt();S(()=>x(Vt,N())),u(tr,Vt)};B(Nt,tr=>{y()==="error"&&N()&&tr(Gt)})}w(St),S(tr=>x(_t,`${tr??""} `),[()=>y()==="saving"?og():y()==="saved"?sg({path:R()??""}):ig()]),u(Pt,St)};B(Ze,Pt=>{y()&&Pt(gt)})}var dt=m(Ze,2);{var at=Pt=>{var St=m2(),_t=E(St),Nt=E(_t),Gt=E(Nt),tr=E(Gt),Vt=L(tr,!0),Oe=m(tr),ve=L(Oe,!0),Qe=m(Oe);Lt(Qe,17,()=>e(Q).scenarios,nt=>nt.id,(nt,He)=>{var re=f2(),Se=E(re);{let Re=d(()=>dg());Mo(Se,{get value(){return e(He).name},get"aria-label"(){return e(Re)},maxlength:120,onblur:ze=>{ze.currentTarget.value.trim()||(ze.currentTarget.value=e(He).name),J(e(He).id,ze.currentTarget.value)},onkeydown:ze=>{ze.key==="Enter"&&ze.currentTarget.blur(),ze.key==="Escape"&&(ze.currentTarget.value=e(He).name,ze.currentTarget.blur())}})}var de=m(Se,2),Fe=E(de);Ct(Fe,{variant:"ghost",size:"sm",onclick:()=>se(e(He).snapshot),children:(Re,ze)=>{er();var Je=jt();S(tt=>x(Je,tt),[()=>lg()]),u(Re,Je)},$$slots:{default:!0}});var Te=m(Fe,2);Ct(Te,{variant:"ghost",size:"sm",onclick:()=>j({...e(Q),scenarios:e(Q).scenarios.filter(Re=>Re.id!==e(He).id)}),children:(Re,ze)=>{er();var Je=jt();S(tt=>x(Je,tt),[()=>cg()]),u(Re,Je)},$$slots:{default:!0}}),w(de),w(re),u(nt,re)}),w(Gt),w(Nt);var st=m(Nt);Lt(st,20,()=>["inputs","results"],Lr,(nt,He)=>{const re=d(()=>He),Se=d(()=>Array.from(new Set([...Object.keys(e(oe)[e(re)]),...e(Q).scenarios.flatMap(Te=>Object.keys(Te.snapshot[e(re)]))])));var de=ht(),Fe=De(de);Lt(Fe,16,()=>e(Se),Te=>Te,(Te,Re)=>{var ze=v2(),Je=E(ze),tt=L(Je,!0),Ve=m(Je);Lt(Ve,17,()=>[e(oe),...e(Q).scenarios.map(Ye=>Ye.snapshot)],Lr,(Ye,Ue)=>{var rt=g2(),it=L(rt,!0);S(Xe=>x(it,Xe),[()=>Object.hasOwn(e(Ue)[e(re)],Re)?_e(e(Ue)[e(re)][Re]):"—"]),u(Ye,rt)}),w(ze),S(()=>x(tt,Re)),u(Te,ze)}),u(nt,de)}),w(st),w(_t),w(St),S(nt=>{x(Vt,e(oe).title),x(ve,nt)},[()=>ug()]),u(Pt,St)};B(dt,Pt=>{e(te)&&e(Q).scenarios.length&&Pt(at)})}u(le,Me)};B(qt,le=>{e(oe)&&e(be)&&le(It)})}return w(ce),vr(ce,le=>D=le,()=>D),S(()=>{ne(ce,"data-inline-html-status",e($e)),ne(ce,"data-inline-html-layout",e(Z)?"viewport-locked":void 0),ne(ce,"aria-busy",e($))}),u(r,ce),Wt(pe)}var y2=I('<div class="w-full min-w-0"><!></div>');function _2(r,t){if(new.target)return Bt({component:_2,...r});zt(t,!0);const n=()=>mt(e(_),"$agent$",o),a=()=>mt(e(D),"$entry$",o),[o,s]=la();let c=h(t,"block",7),l=h(t,"role",7),p=h(t,"workspaceId",7),i=h(t,"agentId",7),f=h(t,"messageId",7),v=h(t,"contentBlockKey",7,""),M=ye(void 0);const _=d(()=>Us(i()??"")),y=d(()=>l()==="assistant"&&p()&&i()&&f()&&c().metadata?.fenceClosed&&!c().metadata?.isStreaming&&n()&&!pu(n())?{workspaceId:p(),agentId:i(),messageId:f(),blockKey:JSON.stringify([v(),c().metadata?.fenceStart??0]),source:c().content}:void 0),R=d(()=>!!(p()&&i()&&f()&&c().metadata?.fenceClosed&&!n())),N=d(()=>e(y)?Vv(e(y)):""),D=d(()=>Xh(e(N)));wt(()=>{e(y)&&Ot.dispatch(Wv(e(y)))});function H(z){!p()||!i()||n()?.retiredAt||e(M)?.dispatchEvent(new CustomEvent(Py,{bubbles:!0,detail:{workspaceId:p(),agentId:i(),snapshot:z}}))}var C={get block(){return c()},set block(z){c(z),b()},get role(){return l()},set role(z){l(z),b()},get workspaceId(){return p()},set workspaceId(z){p(z),b()},get agentId(){return i()},set agentId(z){i(z),b()},get messageId(){return f()},set messageId(z){f(z),b()},get contentBlockKey(){return v()},set contentBlockKey(z=""){v(z),b()},$set:Ft,$on:(z,G)=>Ht(t,z,G)},A=ht(),U=De(A);{var k=z=>{var G=y2(),ie=E(G);{let Z=d(()=>c().metadata?.isStreaming??!1),ke=d(()=>c().metadata?.fenceClosed??!1),oe=d(()=>a()?.record),Ae=d(()=>e(y)?a()?.status??"loading":e(R)?"loading":"ready"),ge=d(()=>a()?.error),Ie=d(()=>e(y)?$e=>Ot.dispatch(qv(e(N),$e)):void 0),te=d(()=>p()&&i()&&n()&&!n().retiredAt?H:void 0),Q=d(()=>e(y)?()=>Ot.dispatch(Uv(e(N))):void 0),we=d(()=>e(y)?$e=>Ot.dispatch(jv(e(N),crypto.randomUUID(),$e)):void 0),ue=d(()=>a()?.export?.status),be=d(()=>a()?.export?.path),Ge=d(()=>a()?.export?.error);Gp(ie,{get source(){return c().content},get isStreaming(){return e(Z)},get isComplete(){return e(ke)},get record(){return e(oe)},get storageStatus(){return e(Ae)},get storageError(){return e(ge)},get onRecordChange(){return e(Ie)},get onUseConfiguration(){return e(te)},get onRetry(){return e(Q)},get onExport(){return e(we)},get exportStatus(){return e(ue)},get exportPath(){return e(be)},get exportError(){return e(Ge)}})}w(G),vr(G,Z=>T(M,Z),()=>e(M)),u(z,G)},F=z=>{ha(z,{get code(){return c().content},language:"html"})};B(U,z=>{l()==="assistant"?z(k):z(F,-1)})}u(r,A);var V=Wt(C);return s(),V}var x2=I('<div class="digest-card flex items-start gap-2.5 py-5 px-6 my-4 shadow-xs text-base leading-normal border border-border"> </div>');function w2(r,t){if(new.target)return Bt({component:w2,...r});zt(t,!0);let n=h(t,"digest",7);var a={get digest(){return n()},set digest(c){n(c),b()},$set:Ft,$on:(c,l)=>Ht(t,c,l)},o=x2(),s=L(o,!0);return S(()=>x(s,n())),u(r,o),Wt(a)}var k2=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-blue-500/15 text-blue-600 dark:text-blue-400"> </span>'),I2=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-muted text-muted-foreground"> </span>'),S2=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary/80"> </span>'),C2=I('<div class="flex items-start gap-3 px-4 py-2.5"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 flex-wrap"><span class="text-sm font-semibold text-foreground"> </span> <!> <!></div> <div class="mt-0.5 text-xs font-mono text-muted-foreground truncate"> </div></div></div>'),E2=I('<div class="detected-scripts-card my-3 rounded-lg border border-border bg-muted/30 overflow-hidden"><div class="flex items-center gap-2 px-4 py-2.5 border-b border-border bg-muted/40"><!> <span class="text-sm font-semibold text-foreground"> </span></div> <div class="divide-y divide-border"></div> <div class="px-4 py-2 border-t border-border bg-muted/20"><span class="text-xs text-muted-foreground"> </span></div></div>');function P2(r,t){if(new.target)return Bt({component:P2,...r});zt(t,!0);let n=h(t,"scripts",7);var a={get scripts(){return n()},set scripts(_){n(_),b()},$set:Ft,$on:(_,y)=>Ht(t,_,y)},o=E2(),s=E(o),c=E(s);Mt(c,{get icon(){return Xd},size:"sm",class:"text-primary-ink/70"});var l=m(c,2),p=L(l,!0);w(s);var i=m(s,2);Lt(i,21,n,_=>_.name+_.command,(_,y)=>{var R=C2(),N=E(R),D=E(N),H=E(D),C=L(H,!0),A=m(H,2);{var U=ie=>{var Z=k2(),ke=L(Z,!0);S(oe=>x(ke,oe),[()=>g.chat_detectedScripts_service_badge()]),u(ie,Z)},k=ie=>{var Z=I2(),ke=L(Z,!0);S(oe=>x(ke,oe),[()=>g.chat_detectedScripts_command_badge()]),u(ie,Z)};B(A,ie=>{e(y).mode==="service"?ie(U):ie(k,-1)})}var F=m(A,2);{var V=ie=>{var Z=S2(),ke=L(Z,!0);S(()=>x(ke,e(y).category)),u(ie,Z)};B(F,ie=>{e(y).category&&e(y).category!=="other"&&ie(V)})}w(D);var z=m(D,2),G=L(z,!0);w(N),w(R),S(()=>{x(C,e(y).name),x(G,e(y).command)}),u(_,R)}),w(i);var f=m(i,2),v=E(f),M=L(v,!0);return w(f),w(o),S((_,y)=>{x(p,_),x(M,y)},[()=>g.chat_detectedScripts_title(),()=>n().length===1?g.chat_detectedScripts_count_one({count:ar(n().length)}):g.chat_detectedScripts_count_many({count:ar(n().length)})]),u(r,o),Wt(a)}function A2(r,t){if(new.target)return Bt({component:A2,...r});zt(t,!0);let n=h(t,"diff",7),a=h(t,"filePath",7),o=h(t,"language",7),s=h(t,"onApply",7),c=h(t,"onReject",7);function l(){s()?.(),Hn.success(g.chat_diffViewer_applied_toast())}function p(){c()?.(),Hn.info(g.chat_diffViewer_rejected_toast())}const i=d(()=>{const v=[];return s()&&v.push({label:g.chat_diffViewer_apply_label(),variant:"success",onClick:l}),c()&&v.push({label:g.chat_diffViewer_reject_label(),variant:"danger",onClick:p}),v});var f={get diff(){return n()},set diff(v){n(v),b()},get filePath(){return a()},set filePath(v){a(v),b()},get language(){return o()},set language(v){o(v),b()},get onApply(){return s()},set onApply(v){s(v),b()},get onReject(){return c()},set onReject(v){c(v),b()},$set:Ft,$on:(v,M)=>Ht(t,v,M)};{let v=d(()=>a()||g.chat_diffViewer_suggestedChanges_fallback());rs(r,{get patch(){return n()},get fileName(){return e(v)},get language(){return o()},get actions(){return e(i)},collapsible:!0,initialCollapsed:!1,maxHeight:"500px"})}return Wt(f)}var T2=ja('<circle fill="none" style="transition: stroke-dasharray 0.3s ease-out"></circle>'),Cd=ja("<circle></circle>"),R2=ja('<svg class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 fill-background" viewBox="0 0 8 6"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.69471 1.69471C7.87687 1.50611 7.97766 1.25351 7.97539 0.991311C7.97311 0.729114 7.86794 0.478302 7.68253 0.292894C7.49712 0.107485 7.24631 0.00231622 6.98411 3.78025e-05C6.72192 -0.00224062 6.46931 0.0985542 6.28071 0.280712L2.98771 3.57371L1.69471 2.28071C1.50611 2.09855 1.25351 1.99776 0.991311 2.00004C0.729114 2.00232 0.478302 2.10749 0.292894 2.29289C0.107485 2.4783 0.00231622 2.72911 3.78025e-05 2.99131C-0.00224062 3.25351 0.0985542 3.50611 0.280712 3.69471L2.28071 5.69471C2.46824 5.88218 2.72255 5.9875 2.98771 5.9875C3.25288 5.9875 3.50718 5.88218 3.69471 5.69471L7.69471 1.69471Z"></path></svg>'),M2=I('<div class="relative"><svg fill="none" xmlns="http://www.w3.org/2000/svg"><circle fill="none"></circle><!></svg> <!></div>');function As(r,t){if(new.target)return Bt({component:As,...r});zt(t,!0);let n=h(t,"phase",7),a=h(t,"progress",7,0),o=h(t,"size",7,16),s=h(t,"class",7,""),c=d(()=>o()/2),l=d(()=>e(c)),p=d(()=>e(c)),i=d(()=>o()*.12),f=d(()=>e(c)-e(i)/2),v=d(()=>e(c)*.35),M=d(()=>2*Math.PI*e(v)),_=d(()=>Math.max(0,Math.min(1,a()))*e(M));const y={planning:"#99999999",building:"#54B1F3",reviewing:"#6D7FF5",shipped:"var(--color-foreground)"};let R=d(()=>y[n()]||"currentColor");var N={get phase(){return n()},set phase(Z){n(Z),b()},get progress(){return a()},set progress(Z=0){a(Z),b()},get size(){return o()},set size(Z=16){o(Z),b()},get class(){return s()},set class(Z=""){s(Z),b()},$set:Ft,$on:(Z,ke)=>Ht(t,Z,ke)},D=M2(),H=E(D),C=E(H),A=m(C);{var U=Z=>{},k=Z=>{var ke=T2();S(()=>{ne(ke,"cx",e(l)),ne(ke,"cy",e(p)),ne(ke,"r",e(v)*.8),ne(ke,"stroke",e(R)),ne(ke,"stroke-width",e(v)*1.5),ne(ke,"stroke-dasharray",`${e(_)??""} ${e(M)??""}`),ne(ke,"stroke-dashoffset",e(M)*.25),ne(ke,"transform",`rotate(-90 ${e(l)??""} ${e(p)??""})`)}),u(Z,ke)},F=Z=>{var ke=Cd();S(()=>{ne(ke,"cx",e(l)),ne(ke,"cy",e(p)),ne(ke,"r",e(f)*.6),ne(ke,"fill",e(R))}),u(Z,ke)},V=Z=>{var ke=Cd();S(()=>{ne(ke,"cx",e(l)),ne(ke,"cy",e(p)),ne(ke,"r",e(f)),ne(ke,"fill",e(R))}),u(Z,ke)};B(A,Z=>{n()==="planning"?Z(U):n()==="building"?Z(k,1):n()==="reviewing"?Z(F,2):n()==="shipped"&&Z(V,3)})}w(H);var z=m(H,2);{var G=Z=>{},ie=Z=>{var ke=R2();S(()=>ne(ke,"width",o()*.5)),u(Z,ke)};B(z,Z=>{n()==="reviewing"?Z(G):n()==="shipped"&&Z(ie,1)})}return w(D),S(()=>{ne(H,"width",o()),ne(H,"height",o()),ne(H,"viewBox",`0 0 ${o()??""} ${o()??""}`),ft(H,0,lr(s())),ne(C,"cx",e(l)),ne(C,"cy",e(p)),ne(C,"r",e(f)),ne(C,"stroke",e(R)),ne(C,"stroke-width",e(i))}),u(r,D),Wt(N)}var Ed=I('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full"></span> </span>'),L2=I('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full bg-border"></span> </span>'),Pd=I('<span class="text-ui text-subtle truncate"> </span>'),Ad=I('<div class="flex items-center gap-1 mt-0.5"><!> <!></div>'),Td=I('<div class="flex items-start gap-2"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-xs leading-snug truncate"> </div> <!></div></div>'),N2=I('<div class="flex items-center gap-2"><div class="shrink-0"><!></div> <span class="text-ui text-subtle truncate line-through"> </span></div>'),O2=I('<span class="text-ui text-subtle pl-4"> </span>'),D2=I('<div class="flex flex-col gap-0.5 pt-1 border-t border-border"><!> <!></div>'),B2=I('<div class="text-ui text-subtle"> </div>'),F2=I("<!> <!> <!> <!>",1),H2=I('<div class="flex flex-col py-2 px-3 gap-2 max-h-80 overflow-y-auto"><div class="flex items-center justify-between gap-3"><span class="text-xs font-semibold text-foreground"> </span> <div class="flex items-center gap-3 text-ui text-subtle"><!> <!> <!></div></div> <!></div>'),z2=I('<div class="rounded-[0.5px]"></div>');function Jp(r,t){if(new.target)return Bt({component:Jp,...r});zt(t,!0);let n=h(t,"stats",7),a=h(t,"tasks",23,()=>[]),o=h(t,"maxBars",7,20),s=h(t,"barWidth",7,"1px"),c=h(t,"barHeight",7,"16px"),l=h(t,"gap",7,"1px"),p=h(t,"class",7);const i={completed:"#22c55e",inProgress:"#4F7BF7",notStarted:"var(--border)"};let f=d(()=>{const{completed:A,inProgress:U,notStarted:k,total:F}=n();if(F===0)return[];const V=[...Array(A).fill("completed"),...Array(U).fill("inProgress"),...Array(Math.max(0,k)).fill("notStarted")];return V.length<=o()?V:V.slice(V.length-o())}),v=d(()=>a().filter(A=>A.status==="complete")),M=d(()=>a().filter(A=>A.status==="in_progress"||A.status==="review_required")),_=d(()=>a().filter(A=>A.status!=="complete"&&A.status!=="in_progress"&&A.status!=="review_required"&&A.status!=="cancelled")),y=d(()=>a().filter(A=>A.status==="cancelled")),R=d(()=>a().length>0);var N={get stats(){return n()},set stats(A){n(A),b()},get tasks(){return a()},set tasks(A=[]){a(A),b()},get maxBars(){return o()},set maxBars(A=20){o(A),b()},get barWidth(){return s()},set barWidth(A="1px"){s(A),b()},get barHeight(){return c()},set barHeight(A="16px"){c(A),b()},get gap(){return l()},set gap(A="1px"){l(A),b()},get class(){return p()},set class(A){p(A),b()},$set:Ft,$on:(A,U)=>Ht(t,A,U)},D=ht(),H=De(D);{var C=A=>{Di(A,{side:"top",align:"start",sideOffset:6,contentClass:"max-w-xs p-0",delayDuration:200,disableHoverableContent:!1,content:k=>{var F=H2(),V=E(F),z=E(V),G=L(z,!0),ie=m(z,2),Z=E(ie);{var ke=we=>{var ue=Ed(),be=E(ue);Tn(be,"",{},{"background-color":"#22c55e"});var Ge=m(be);w(ue),S(()=>x(Ge,` ${n().completed??""}`)),u(we,ue)};B(Z,we=>{n().completed>0&&we(ke)})}var oe=m(Z,2);{var Ae=we=>{var ue=Ed(),be=E(ue);Tn(be,"",{},{"background-color":"#4F7BF7"});var Ge=m(be);w(ue),S(()=>x(Ge,` ${n().inProgress??""}`)),u(we,ue)};B(oe,we=>{n().inProgress>0&&we(Ae)})}var ge=m(oe,2);{var Ie=we=>{var ue=L2(),be=m(E(ue));w(ue),S(()=>x(be,` ${n().notStarted??""}`)),u(we,ue)};B(ge,we=>{n().notStarted>0&&we(Ie)})}w(ie),w(V);var te=m(V,2);{var Q=we=>{var ue=F2(),be=De(ue);Lt(be,17,()=>e(M),Lr,(j,q)=>{var J=Td(),se=E(J),_e=E(se);mi(_e,{get status(){return e(q).status},size:14}),w(se);var Ne=m(se,2),ee=E(Ne),pe=L(ee,!0),ce=m(ee,2);{var et=me=>{var Ee=Ad(),X=E(Ee);{let O=d(()=>e(q).agentState||"idle");Nc(X,{get agentId(){return e(q).agentId},get state(){return e(O)},size:12,get specialist(){return e(q).agentSpecialist}})}var Ce=m(X,2);{var fe=O=>{var K=Pd(),Pe=L(K,!0);S(()=>x(Pe,e(q).agentName)),u(O,K)};B(Ce,O=>{e(q).agentName&&O(fe)})}w(Ee),u(me,Ee)};B(ce,me=>{e(q).agentId&&me(et)})}w(Ne),w(J),S(()=>x(pe,e(q).title)),u(j,J)});var Ge=m(be,2);Lt(Ge,17,()=>e(_),Lr,(j,q)=>{var J=Td(),se=E(J),_e=E(se);mi(_e,{get status(){return e(q).status},size:14}),w(se);var Ne=m(se,2),ee=E(Ne),pe=L(ee,!0),ce=m(ee,2);{var et=me=>{var Ee=Ad(),X=E(Ee);{let O=d(()=>e(q).agentState||"idle");Nc(X,{get agentId(){return e(q).agentId},get state(){return e(O)},size:12,get specialist(){return e(q).agentSpecialist}})}var Ce=m(X,2);{var fe=O=>{var K=Pd(),Pe=L(K,!0);S(()=>x(Pe,e(q).agentName)),u(O,K)};B(Ce,O=>{e(q).agentName&&O(fe)})}w(Ee),u(me,Ee)};B(ce,me=>{e(q).agentId&&me(et)})}w(Ne),w(J),S(()=>x(pe,e(q).title)),u(j,J)});var $e=m(Ge,2);{var $=j=>{var q=D2(),J=E(q);Lt(J,17,()=>e(v).slice(0,3),Lr,(Ne,ee)=>{var pe=N2(),ce=E(pe),et=E(ce);mi(et,{status:"complete",size:12}),w(ce);var me=m(ce,2),Ee=L(me,!0);w(pe),S(()=>x(Ee,e(ee).title)),u(Ne,pe)});var se=m(J,2);{var _e=Ne=>{var ee=O2(),pe=L(ee,!0);S(ce=>x(pe,ce),[()=>g.workspace_taskProgressBar_moreCompleted_label({count:ar(e(v).length-3)})]),u(Ne,ee)};B(se,Ne=>{e(v).length>3&&Ne(_e)})}w(q),u(j,q)};B($e,j=>{e(v).length>0&&j($)})}var Y=m($e,2);{var xe=j=>{var q=B2(),J=L(q,!0);S(se=>x(J,se),[()=>g.workspace_taskProgressBar_cancelled_label({count:ar(e(y).length)})]),u(j,q)};B(Y,j=>{e(y).length>0&&j(xe)})}u(we,ue)};B(te,we=>{e(R)&&we(Q)})}w(F),S(we=>x(G,we),[()=>g.workspace_taskProgressBar_tasksRatio_label({completed:ar(n().completed),total:ar(n().total)})]),u(k,F)},children:(k,F)=>{{let V=d(()=>kn("flex h-auto min-w-0 shrink items-end justify-start cursor-default rounded-none border-0",p())),z=d(()=>`gap: ${l()}`),G=d(()=>g.workspace_taskProgressBar_tasksRatio_label({completed:ar(n().completed),total:ar(n().total)}));Ct(k,{variant:"plain",type:"button",wrapContent:!1,get class(){return e(V)},get style(){return e(z)},get"aria-label"(){return e(G)},"data-task-progress-trigger":!0,children:(ie,Z)=>{var ke=ht(),oe=De(ke);Lt(oe,17,()=>e(f),Lr,(Ae,ge)=>{var Ie=z2();let te;S(()=>te=Tn(Ie,"",te,{width:s(),height:c(),"background-color":i[e(ge)]})),u(Ae,Ie)}),u(ie,ke)},$$slots:{default:!0}})}},$$slots:{content:!0,default:!0}})};B(H,A=>{n().total>0&&A(C)})}return u(r,D),Wt(N)}function Ws(r,t){if(new.target)return Bt({component:Ws,...r});zt(t,!0);let n=h(t,"items",7),a=h(t,"ariaLabel",7),o=h(t,"open",15,!1),s=h(t,"orientation",7,"vertical"),c=h(t,"selection",7),l=h(t,"class",7,"");const p=d(()=>sh(n(),c(),a()));var i={get items(){return n()},set items(f){n(f),b()},get ariaLabel(){return a()},set ariaLabel(f){a(f),b()},get open(){return o()},set open(f=!1){o(f),b()},get orientation(){return s()},set orientation(f="vertical"){s(f),b()},get selection(){return c()},set selection(f){c(f),b()},get class(){return l()},set class(f=""){l(f),b()},$set:Ft,$on:(f,v)=>Ht(t,f,v)};return Cu(r,{get actions(){return e(p)},align:"end",get ariaLabel(){return a()},onAction:v=>oh(n(),v)?.onClick(),get open(){return o()},set open(v){o(v)},trigger:(v,M)=>{let _=()=>(M?.()).props;Ct(v,js(_,{variant:"plain",size:"icon-compact",iconOnly:!0,type:"button",get class(){return l()},get"aria-label"(){return a()},onclick:y=>{y.stopPropagation(),_().onclick?.(y)},oncontextmenu:y=>{y.preventDefault(),y.stopPropagation()},children:(y,R)=>{hm(y,{get orientation(){return s()},class:"size-3.5"})},$$slots:{default:!0}}))},$$slots:{trigger:!0}}),Wt(i)}var W2=I('<span class="contents"><!></span>'),j2=I("<!> <!>",1);function Yp(r,t){if(new.target)return Bt({component:Yp,...r});zt(t,!0);let n=h(t,"workspaceId",7),a=h(t,"slot",7);const o=d(()=>Mv(a()));let s=ye(null);wt(()=>{e(s)&&e(s).workspaceId!==n()&&T(s,null)});function c(y){const R=Eu(y);R&&T(s,{...R,workspaceId:n()},!0)}function l(y){y.preventDefault(),y.stopPropagation();const R=y.currentTarget.getBoundingClientRect();T(s,{x:R.left,y:R.bottom+2,returnFocus:y.currentTarget,workspaceId:n()},!0)}function p(){T(s,null)}var i={get workspaceId(){return n()},set workspaceId(y){n(y),b()},get slot(){return a()},set slot(y){a(y),b()},$set:Ft,$on:(y,R)=>Ht(t,y,R)},f=j2(),v=De(f);{let y=d(()=>g.workspace_microKeyBadge_ariaLabel({number:ar(a()+1)})),R=d(()=>g.workspace_microKeyBadge_tooltip({number:ar(a()+1)})),N=d(()=>e(s)!==null);Ct(v,{variant:"ghost",size:"icon",type:"button",class:"micro-key-slot-badge size-4 min-w-0 shrink-0 cursor-pointer rounded-[3px] p-0 a11y-ignore",get"aria-label"(){return e(y)},get title(){return e(R)},onclick:l,oncontextmenu:c,onkeydown:c,"aria-haspopup":"menu",get"aria-expanded"(){return e(N)},children:(D,H)=>{var C=W2(),A=E(C);ev(A,{get slot(){return a()},get class(){return`transition-colors ${e(o)??""}`}}),w(C),u(D,C)},$$slots:{default:!0}})}var M=m(v,2);{var _=y=>{{let R=d(()=>e(s)?.x??0),N=d(()=>e(s)?.y??0),D=d(()=>e(s)?.returnFocus),H=d(()=>g.workspace_card_assignMicroKey_label()),C=d(()=>Zb(n(),p));Pu(y,{get x(){return e(R)},get y(){return e(N)},get returnFocus(){return e(D)},selection:"single",get ariaLabel(){return e(H)},get items(){return e(C)},onClickOutside:p})}};B(M,y=>{e(s)&&y(_)})}return u(r,f),Wt(i)}var U2=I('<span class="flex size-4 shrink-0 items-center justify-center"><!></span>'),q2=I('<span data-workspace-card-pin-indicator="" aria-hidden="true"><!></span> <span class="sr-only"> </span>',1),V2=I('<span class="type-caption shrink-0 rounded-sm bg-muted-foreground/10 px-1.5 font-normal text-muted-foreground" data-workspace-card-trailing-label=""> </span>'),K2=I('<span data-workspace-card-pr-item=""><!></span>'),G2=I('<span class="flex shrink-0 items-center" data-workspace-card-pr-list=""><!></span>'),J2=I('<span data-workspace-card-time=""><!></span>'),Y2=I('<span aria-hidden="true"><!></span>'),X2=I("<div><!> <!> <!> <!></div>"),Z2=I('<div data-workspace-card-hover-surface=""><!></div>'),Q2=I('<div role="group" data-workspace-card-row=""><!> <div class="relative z-10 flex shrink-0 items-center gap-1.5"><!> <!> <span class="sr-only"> </span></div> <div class="relative z-10 flex min-w-0 flex-1 items-center gap-2"><span class="flex min-w-0 flex-1 items-center gap-1" data-workspace-card-title-group=""><span dir="ltr" data-workspace-card-title=""><span class="wc-title-text svelte-1ct56pd"> </span></span> <!></span> <!> <!> <!></div> <!></div> <!> <!>',1),$2=I('<div class="relative z-10 flex shrink-0 items-center"><!></div>'),eI=I('<div><!> <!> <span class="font-medium truncate"> </span> <span class="shrink-0 text-muted-foreground">·</span> <span class="truncate text-xs text-muted-foreground"> </span> <!></div>'),tI=I('<div class="text-sm font-semibold truncate"> </div>'),Rd=I('<span class="truncate"> </span>'),rI=I('<span class="text-muted-foreground">·</span>'),nI=I('<div class="flex items-center gap-1 truncate text-xs text-muted-foreground"><!> <!> <!></div>'),aI=I('<div><!> <!> <div class="flex items-center gap-2 text-xs"><!> <span class="truncate text-muted-foreground"> </span> <span> </span></div> <!></div>'),oI=I('<div class="flex items-center gap-2"><!> <span class="text-ui shrink-0 tabular-nums text-muted-foreground"> </span></div>'),sI=I('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span> <span class="tabular-nums"><span class="text-success"> </span> <span class="ml-1 text-danger"> </span></span></div>'),iI=I('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span></div>'),lI=I('<div class="flex items-center text-ui"><span> </span></div>'),cI=I('<div class="flex flex-col gap-1 px-3 pb-2.5"><!> <!> <!> <!></div>'),dI=I('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!></div>'),uI=I('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!> <!></div>'),pI=I('<div role="group"><!> <div class="flex items-start gap-2.5 px-3 pt-3 pb-2"><!> <div class="flex-1 min-w-0"><div class="text-sm font-medium"> </div> <div class="mt-0.5 line-clamp-2 text-xs leading-snug text-muted-foreground"> </div></div></div> <!> <!></div>');function cl(r,t){if(new.target)return Bt({component:cl,...r});zt(t,!0);const n=()=>mt($e,"$prMonitors$",c),a=()=>mt($,"$microConnected$",c),o=()=>mt(xe,"$hidesOwnerActions$",c),s=()=>mt(Y,"$workspaceKeySlot$",c),[c,l]=la();let p=h(t,"workspace",7),i=h(t,"phase",7),f=h(t,"stats",7),v=h(t,"variant",7,"compact"),M=h(t,"showTime",7,!0),_=h(t,"isRunning",7,!1),y=h(t,"isUnread",7,!1),R=h(t,"isWaiting",7),N=h(t,"isPinned",7,!1),D=h(t,"streamingAgentIds",23,()=>[]),H=h(t,"hasSpec",7,!1),C=h(t,"isAgentRunning",7,!1),A=h(t,"agentDigest",7),U=h(t,"trailingLabel",7),k=h(t,"title",7),F=h(t,"repoName",7),V=h(t,"branch",7),z=h(t,"onClick",7),G=h(t,"onAction",7),ie=h(t,"onTogglePin",7),Z=h(t,"onMarkAsRead",7),ke=h(t,"onOpenInNewWindow",7),oe=h(t,"onHover",7),Ae=h(t,"highlighted",7,!1),ge=h(t,"selected",7,!1),Ie=h(t,"highlightId",7),te=h(t,"suppressHover",7,!1),Q=h(t,"hoverPreview",7,!0),we=h(t,"isolateHoverReveal",7,!1),ue=h(t,"class",7),be=h(t,"actions",7);const Ge=Ro("");wt(()=>{Ge.set(p()?.id??"")});const $e=zg(Ge),$=ay(),Y=bh(Ge),xe=Wg(Ge),j=d(()=>$b(p()??{})),q=d(()=>ey(e(j)));let J=d(()=>p()?Yb.url.pathname===`/workspace/${p().id}`:!1),se=d(()=>p()?`workspace-hover-card-${p().id}`:void 0),_e=ye(!1),Ne=ye(null),ee=ye(null);wt(()=>{if(!e(ee))return;const ae=ys(e(ee),{id:Ie()});return()=>ae.destroy()});let pe=ye(null),ce=ye(null),et=ye(null),me=ye(0),Ee=ye(0),X=d(()=>e(me)+(e(Ee)>0?e(Ee)+4:0));function Ce(){const ae=e(pe),pt=e(et);T(me,ae?Math.max(0,ae.scrollWidth-ae.clientWidth):0,!0),T(Ee,ae&&pt&&pt.getClientRects().length>0?Math.max(0,ae.getBoundingClientRect().right-pt.getBoundingClientRect().left):0,!0)}wt(()=>{const ae=e(pe),pt=e(ce),At=e(et);if(!ae||!pt||(Ce(),typeof ResizeObserver>"u"))return;const hr=new ResizeObserver(Ce);return hr.observe(ae),hr.observe(pt),At&&hr.observe(At),()=>hr.disconnect()});let fe=null,O=null,K=!1,Pe=!1,qe=!1,Le=!1,je=!1,Ke=!1,lt=ye(!1),bt=!1,yt=null,qt=ye(null),It=null,le;function Me(){fe!==null&&(clearTimeout(fe),fe=null)}function Ze(){O!==null&&(clearTimeout(O),O=null),It?.(),It=null}function gt(){Ze(),T(lt,!0),T(_e,!0),!je&&(je=!0,Yo.notifyOpened())}function dt(){Ze(),clearTimeout(le),T(lt,!1),T(_e,!1),Pe=!1,Le=!1,je&&(je=!1,Yo.notifyClosed())}function at(){return K||Pe||qe||Le}function Pt(){if(!e(_e)){dt();return}Ze(),O=setTimeout(()=>{O=null,at()||dt()},ry),It=Yo.deferClose(dt)}function St(){Pe=!0,Ze()}function _t(){Pe=!1,!qe&&!Le&&Pt()}function Nt(){Le=!0,clearTimeout(le),Ze()}function Gt(ae){const pt=ae.relatedTarget instanceof Node?ae.relatedTarget:null;if(pt&&de()?.contains(pt)||(Le=!1,pt&&e(Ne)?.contains(pt)))return;if(pt){!K&&!Pe&&dt();return}const At=ae.target;clearTimeout(le),le=setTimeout(()=>{const hr=document.activeElement,Dr=de()?.contains(hr)||e(Ne)?.contains(hr);hr&&hr!==At&&Dr||!K&&!Pe&&dt()},0)}function tr(){yt!==null&&clearTimeout(yt),bt=!0,yt=setTimeout(()=>{bt=!1,yt=null},0)}function Vt(ae){const pt=ae.target,At=de();pt instanceof Node&&At?.contains(pt)||ae.type==="scroll"&&e(Ne)&&pt instanceof Node&&!pt.contains(e(Ne))||(ae.type==="pointerdown"&&tr(),Me(),dt())}wt(()=>{if(e(lt))return window.addEventListener("pointerdown",Vt,!0),window.addEventListener("scroll",Vt,!0),()=>{window.removeEventListener("pointerdown",Vt,!0),window.removeEventListener("scroll",Vt,!0)}});function Oe(ae){if(ae.key!=="Escape")return;const pt=ae.target;pt instanceof Node&&de()?.contains(pt)||(ae.preventDefault(),ae.stopPropagation(),Ke=qe,Me(),dt())}wt(()=>{if(e(_e))return window.addEventListener("keydown",Oe,!0),()=>window.removeEventListener("keydown",Oe,!0)});const ve=d(()=>p()?Ug.select(Ot.state,p().id):null),Qe=d(()=>e(ve)?e(ve):p()?.activePullRequest?p().activePullRequest:!p()?.prStatus||p().prNumber==null?null:{id:`legacy-pr-${p().prNumber}`,number:p().prNumber,url:p().prUrl??"",title:g.workspace_hoverCard_pullRequest_label(),status:p().prStatus,createdAt:p().updatedAt,updatedAt:p().updatedAt}),st=d(()=>jg(p())),nt=d(()=>{if(!p()||e(st))return[];const ae=p(),pt=ae.repositoryOwner&&ae.repositoryName?`${ae.repositoryOwner}/${ae.repositoryName}`:void 0;return ih({workspacePRs:ae.pullRequests,activePR:e(Qe),monitors:n(),workspaceRepo:pt,buildPrUrl:(At,hr)=>Wm(At,ae.repositoryOwner,ae.repositoryName,hr),getDisplayTitle:At=>At.title})}),He=d(()=>e(nt)[0]);function re(ae){const pt=ae.resource?.repository.provider==="gitlab"?`${ae.repo} !${ae.number}`:ae.repo?g.workspace_card_prBadge_repoLine_tooltip({repo:ae.repo,number:ae.number}):g.workspace_card_prBadge_label({number:` #${ae.number}`});return[qg(pt,ae),ae.title,ae.details].filter(Boolean).join(`
296
296
  `)}function Se(ae){ae.key==="Enter"&&z()?.(ae)}function de(){return e(se)?document.getElementById(e(se)):null}function Fe(){return Array.from(de()?.querySelectorAll("button:not(:disabled), a[href]")??[])}function Te(){const ae=e(Ne)?.querySelector("[data-workspace-card-trigger]"),pt=de();if(!ae||!pt)return null;const At=Array.from(document.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter(Dr=>Dr.tabIndex>=0&&!pt.contains(Dr)),hr=At.indexOf(ae);return hr>=0?At[hr+1]:null}function Re(ae){Ke=!!e(Ne)?.contains(ae),dt(),ae.focus({preventScroll:!0})}function ze(){const ae=e(Ne)?.querySelector("[data-workspace-card-trigger]");ae&&Re(ae)}async function Je(ae){if(ae.key==="Escape"&&e(_e)){ae.preventDefault(),ae.stopPropagation(),dt();return}ae.key!=="ArrowDown"||te()||!p()||(ae.preventDefault(),ae.stopPropagation(),T(lt,!0),T(_e,!0),await zn(),Fe()[0]?.focus({preventScroll:!0}))}function tt(ae){const pt=Fe(),At=ae.key==="Tab"&&ae.shiftKey&&ae.currentTarget===pt[0],Dr=ae.key==="Tab"&&!ae.shiftKey&&ae.currentTarget===pt.at(-1)?Te():null;ae.key!=="Escape"&&!At&&!Dr||(ae.preventDefault(),ae.stopPropagation(),Dr?Re(Dr):ze())}function Ve(){K=!0,Ze(),Yo.settleDeferredCloses(),Ce(),oe()?.(),p()&&!te()&&!qe&&(Me(),T(lt,!0),fe=setTimeout(()=>{fe=null,gt()},Yo.currentOpenDelay))}function Ye(){K=!1,Me(),!qe&&!Le&&Pt()}function Ue(){qe=!0,Me(),Ze(),!Ke&&(bt||p()&&!te()&&(T(lt,!0),T(_e,!0)))}function rt(ae){const pt=ae.relatedTarget instanceof Node?ae.relatedTarget:null;pt&&e(Ne)?.contains(pt)||(Ke=!1,qe=!1,!(pt&&de()?.contains(pt))&&!K&&!Pe&&dt())}wt(()=>{te()&&(Me(),Ze(),dt())});let it=ye(null),Xe=ye(!1),ut;wt(()=>{const ae=p()?.id;ut!==ae&&(ut=ae,T(Xe,!1)),e(it)&&e(it).workspaceId!==p()?.id&&vt()});function Kt(ae){if(!p())return;const pt=Eu(ae);if(pt){if(T(Xe,!1),Rt().length===0){T(it,null);return}T(it,{...pt,returnFocus:ae.target instanceof HTMLElement?ae.target.closest("button")??e(Ne)?.querySelector("button")??null:null,workspaceId:p().id},!0)}}function vt(){T(it,null),T(Xe,!1)}wt(()=>{e(Xe)&&T(it,null)}),_o(()=>{Me(),Ze(),yt!==null&&(clearTimeout(yt),yt=null),dt()});function Rt(){if(!p())return[];const ae=[];return ke()&&ae.push({id:"open-new-window",label:g.workspace_card_openNewWindow_label(),icon:eu,onClick:()=>{ke()?.(),vt()}}),ae.push(...ty(p().id,{connected:a(),onClose:vt})),o()||(e(st)||ae.push({id:"transfer",label:g.workspace_card_transfer_label(),icon:wv,onClick:()=>{Ot.dispatch(Kv({workspaceId:p().id,workspaceTitle:p().title})),vt()}}),ae.push({id:"archive",label:g.workspace_card_archive_label(),icon:tu,onClick:()=>{Ot.dispatch(fu(p().id)),vt()}}),ae.push({id:"delete",label:g.workspace_card_deleteSpace_label(),icon:ru,destructive:!0,onClick:()=>{Ot.dispatch(gu(p().id)),vt()}})),ae}let Yt=d(()=>C()&&A()?A():i()?.subtitle??""),Xt=d(()=>f()&&f().tasks.total>0?f().tasks.completed/f().tasks.total:0),_r=d(()=>!!f()&&(f().tasks.total>0||f().files.changed>0||f().commits.total>0||f().pr.hasOpen||f().pr.hasMerged)),Or=d(()=>e(st)?void 0:V()),gn=d(()=>!f()||e(st)?"":f().pr.hasMerged?g.workspace_card_prMerged_label({number:f().pr.number??""}):f().pr.hasOpen?g.workspace_card_prOpen_label({number:f().pr.number?`#${f().pr.number}`:""}):""),zr=d(()=>i()?.phase==="planning"?C()?{primary:{label:g.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:g.workspace_card_pause_label(),action:"pause"}}:H()||(f()?.tasks.total??0)>0?{primary:{label:g.workspace_card_approveStart_label(),action:"approve"},secondary:{label:g.workspace_card_viewSpec_label(),action:"view-spec"}}:{primary:{label:g.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:g.workspace_card_viewSpec_label(),action:"view-spec"}}:i()?.phase==="building"?{primary:{label:g.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:g.workspace_card_pause_label(),action:"pause"}}:i()?.phase==="reviewing"?{primary:{label:g.workspace_card_createPr_label(),action:"create-pr"},secondary:{label:g.workspace_card_showChanges_label(),action:"show-changes"}}:{primary:{label:g.workspace_card_archive_label(),action:"archive"},secondary:{label:g.workspace_card_showChanges_label(),action:"show-changes"}});const mr={planning:"bg-muted/20 text-muted-foreground",building:"bg-info/15 text-info",reviewing:"bg-primary/15 text-primary",shipped:"bg-foreground/10 text-foreground"};var jn={get workspace(){return p()},set workspace(ae){p(ae),b()},get phase(){return i()},set phase(ae){i(ae),b()},get stats(){return f()},set stats(ae){f(ae),b()},get variant(){return v()},set variant(ae="compact"){v(ae),b()},get showTime(){return M()},set showTime(ae=!0){M(ae),b()},get isRunning(){return _()},set isRunning(ae=!1){_(ae),b()},get isUnread(){return y()},set isUnread(ae=!1){y(ae),b()},get isWaiting(){return R()},set isWaiting(ae){R(ae),b()},get isPinned(){return N()},set isPinned(ae=!1){N(ae),b()},get streamingAgentIds(){return D()},set streamingAgentIds(ae=[]){D(ae),b()},get hasSpec(){return H()},set hasSpec(ae=!1){H(ae),b()},get isAgentRunning(){return C()},set isAgentRunning(ae=!1){C(ae),b()},get agentDigest(){return A()},set agentDigest(ae){A(ae),b()},get trailingLabel(){return U()},set trailingLabel(ae){U(ae),b()},get title(){return k()},set title(ae){k(ae),b()},get repoName(){return F()},set repoName(ae){F(ae),b()},get branch(){return V()},set branch(ae){V(ae),b()},get onClick(){return z()},set onClick(ae){z(ae),b()},get onAction(){return G()},set onAction(ae){G(ae),b()},get onTogglePin(){return ie()},set onTogglePin(ae){ie(ae),b()},get onMarkAsRead(){return Z()},set onMarkAsRead(ae){Z(ae),b()},get onOpenInNewWindow(){return ke()},set onOpenInNewWindow(ae){ke(ae),b()},get onHover(){return oe()},set onHover(ae){oe(ae),b()},get highlighted(){return Ae()},set highlighted(ae=!1){Ae(ae),b()},get selected(){return ge()},set selected(ae=!1){ge(ae),b()},get highlightId(){return Ie()},set highlightId(ae){Ie(ae),b()},get suppressHover(){return te()},set suppressHover(ae=!1){te(ae),b()},get hoverPreview(){return Q()},set hoverPreview(ae=!0){Q(ae),b()},get isolateHoverReveal(){return we()},set isolateHoverReveal(ae=!1){we(ae),b()},get class(){return ue()},set class(ae){ue(ae),b()},get actions(){return be()},set actions(ae){be(ae),b()},$set:Ft,$on:(ae,pt)=>Ht(t,ae,pt)},Sn=ht(),_a=De(Sn);{var Rn=ae=>{var pt=Q2(),At=De(pt);let hr;var Dr=E(At);{let xt=d(()=>p().title||g.workspace_links_untitled_label()),Tt=d(()=>`workspace-status-state-${p().id}${N()?` workspace-pinned-state-${p().id}`:""}${e(_e)?` ${e(se)}`:""}`),cr=d(()=>e(J)?"page":void 0);Ct(Dr,{variant:"plain",class:"absolute inset-0 z-0 h-auto w-auto rounded-md focus-visible:border-transparent focus-visible:bg-background/50 focus-visible:ring-0",get"aria-label"(){return e(xt)},get"aria-describedby"(){return e(Tt)},get"aria-current"(){return e(cr)},"data-workspace-card-trigger":!0,onkeydown:Je,onclick:yr=>{yr.stopPropagation(),z()?.(yr)}})}var Br=m(Dr,2),qn=E(Br);{var Mn=xt=>{var Tt=U2(),cr=E(Tt);{var yr=Er=>{Yp(Er,{get workspaceId(){return p().id},get slot(){return s()}})};B(cr,Er=>{s()!==null&&Er(yr)})}w(Tt),u(xt,Tt)};B(qn,xt=>{a()&&xt(Mn)})}var Vn=m(qn,2);Di(Vn,{get content(){return e(q).tooltip},side:"bottom",sideOffset:4,children:(xt,Tt)=>{Qb(xt,{get status(){return e(j)},size:14,decorative:!0,class:"justify-start"})},$$slots:{default:!0}});var ca=m(Vn,2),da=L(ca,!0);w(Br);var Tr=m(Br,2),rn=E(Tr),$t=E(rn),Cr=E($t),Zn=L(Cr,!0);vr(Cr,xt=>T(ce,xt),()=>e(ce)),w($t),vr($t,xt=>T(pe,xt),()=>e(pe));var wr=m($t,2);{var dr=xt=>{var Tt=q2(),cr=De(Tt),yr=E(cr);Mt(yr,{get icon(){return tc},size:"xs"}),w(cr);var Er=m(cr,2),Pr=L(Er,!0);S(ua=>{ft(cr,1,`wc-pin-indicator inline-flex shrink-0 items-center text-muted-foreground transition-opacity
297
- ${ie()?Ae()?"opacity-0":te()?"":we()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),ne(Er,"id",`workspace-pinned-state-${p().id??""}`),x(Pr,ua)},[()=>g.layout_activeCard_pinned_header()]),u(xt,Tt)};B(wr,xt=>{N()&&xt(dr)})}w(rn);var br=m(rn,2);{var Ea=xt=>{var Tt=V2(),cr=L(Tt,!0);S(()=>x(cr,U())),u(xt,Tt)};B(br,xt=>{U()&&xt(Ea)})}var Wr=m(br,2);{var Yr=xt=>{const Tt=d(()=>e(He));var cr=G2(),yr=E(cr);{let Er=d(()=>re(e(Tt)));Di(yr,{get content(){return e(Er)},side:"bottom",sideOffset:4,children:(Pr,ua)=>{var pa=ht(),Aa=De(pa);{var Fr=Cn=>{{let Hr=d(()=>re(e(Tt)));Ct(Cn,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(Tt).foregroundClass??""}`},get"aria-label"(){return e(Hr)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(Tt).identity},get"data-pr-status"(){return e(Tt).status},onclick:hn=>{hn.stopPropagation();const qa=p().id;pg(async()=>{const{handleLink:Ra}=await import("./DaR1HweB.js").then(En=>En.l);return{handleLink:Ra}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url).then(({handleLink:Ra})=>Ra(e(Tt).url,{workspaceId:qa,event:hn}))},children:(hn,qa)=>{Mt(hn,{get icon(){return e(Tt).statusIcon},size:14})},$$slots:{default:!0}})}},Ta=Cn=>{var Hr=K2(),hn=E(Hr);Mt(hn,{get icon(){return e(Tt).statusIcon},size:14}),w(Hr),S(qa=>{ft(Hr,1,`inline-flex size-5 shrink-0 items-center justify-center rounded-sm ${e(Tt).foregroundClass??""}`,"svelte-1ct56pd"),ne(Hr,"aria-label",qa),ne(Hr,"data-pr-identity",e(Tt).identity),ne(Hr,"data-pr-status",e(Tt).status)},[()=>re(e(Tt))]),u(Cn,Hr)};B(Aa,Cn=>{e(Tt).url?Cn(Fr):Cn(Ta,-1)})}u(Pr,pa)},$$slots:{default:!0}})}w(cr),S(Er=>ne(cr,"aria-label",Er),[()=>e(Tt).resource?.repository.provider==="gitlab"?g.workspace_hoverCard_mergeRequest_label():g.workspace_hoverCard_pullRequest_label()]),u(xt,cr)};B(Wr,xt=>{e(He)&&xt(Yr)})}var Xr=m(Wr,2);{var Pa=xt=>{var Tt=J2(),cr=E(Tt);{var yr=Pr=>{{let ua=d(()=>ic(p()));tv(Pr,{get date(){return e(ua)},class:"type-caption whitespace-nowrap tabular-nums text-muted-foreground",compact:!0})}},Er=d(()=>ic(p())>0);B(cr,Pr=>{e(Er)&&Pr(yr)})}w(Tt),S(()=>ft(Tt,1,`wc-secondary shrink-0 ${be()||ie()||y()&&Z()?Ae()?"opacity-0":te()?"":we()?"group-hover/wc:opacity-0 group-hover/message:opacity-0":"group-hover:opacity-0 group-hover/message:opacity-0":""}`,"svelte-1ct56pd")),u(xt,Tt)};B(Xr,xt=>{M()&&xt(Pa)})}w(Tr);var Ua=m(Tr,2);{var io=xt=>{var Tt=X2(),cr=E(Tt);{var yr=Fr=>{{let Ta=d(()=>N()?"text-primary-ink":"text-muted-foreground"),Cn=d(()=>N()?g.workspace_card_unpin_ariaLabel():g.workspace_card_pin_ariaLabel()),Hr=d(()=>N()?g.workspace_card_unpin_tooltip():g.workspace_card_pin_tooltip());Ct(Fr,{variant:"plain",size:"icon-xs",iconOnly:!0,get class(){return`transition-all hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0
297
+ ${ie()?Ae()?"opacity-0":te()?"":we()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),ne(Er,"id",`workspace-pinned-state-${p().id??""}`),x(Pr,ua)},[()=>g.layout_activeCard_pinned_header()]),u(xt,Tt)};B(wr,xt=>{N()&&xt(dr)})}w(rn);var br=m(rn,2);{var Ea=xt=>{var Tt=V2(),cr=L(Tt,!0);S(()=>x(cr,U())),u(xt,Tt)};B(br,xt=>{U()&&xt(Ea)})}var Wr=m(br,2);{var Yr=xt=>{const Tt=d(()=>e(He));var cr=G2(),yr=E(cr);{let Er=d(()=>re(e(Tt)));Di(yr,{get content(){return e(Er)},side:"bottom",sideOffset:4,children:(Pr,ua)=>{var pa=ht(),Aa=De(pa);{var Fr=Cn=>{{let Hr=d(()=>re(e(Tt)));Ct(Cn,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(Tt).foregroundClass??""}`},get"aria-label"(){return e(Hr)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(Tt).identity},get"data-pr-status"(){return e(Tt).status},onclick:hn=>{hn.stopPropagation();const qa=p().id;pg(async()=>{const{handleLink:Ra}=await import("./E1ou7S5Q.js").then(En=>En.l);return{handleLink:Ra}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url).then(({handleLink:Ra})=>Ra(e(Tt).url,{workspaceId:qa,event:hn}))},children:(hn,qa)=>{Mt(hn,{get icon(){return e(Tt).statusIcon},size:14})},$$slots:{default:!0}})}},Ta=Cn=>{var Hr=K2(),hn=E(Hr);Mt(hn,{get icon(){return e(Tt).statusIcon},size:14}),w(Hr),S(qa=>{ft(Hr,1,`inline-flex size-5 shrink-0 items-center justify-center rounded-sm ${e(Tt).foregroundClass??""}`,"svelte-1ct56pd"),ne(Hr,"aria-label",qa),ne(Hr,"data-pr-identity",e(Tt).identity),ne(Hr,"data-pr-status",e(Tt).status)},[()=>re(e(Tt))]),u(Cn,Hr)};B(Aa,Cn=>{e(Tt).url?Cn(Fr):Cn(Ta,-1)})}u(Pr,pa)},$$slots:{default:!0}})}w(cr),S(Er=>ne(cr,"aria-label",Er),[()=>e(Tt).resource?.repository.provider==="gitlab"?g.workspace_hoverCard_mergeRequest_label():g.workspace_hoverCard_pullRequest_label()]),u(xt,cr)};B(Wr,xt=>{e(He)&&xt(Yr)})}var Xr=m(Wr,2);{var Pa=xt=>{var Tt=J2(),cr=E(Tt);{var yr=Pr=>{{let ua=d(()=>ic(p()));tv(Pr,{get date(){return e(ua)},class:"type-caption whitespace-nowrap tabular-nums text-muted-foreground",compact:!0})}},Er=d(()=>ic(p())>0);B(cr,Pr=>{e(Er)&&Pr(yr)})}w(Tt),S(()=>ft(Tt,1,`wc-secondary shrink-0 ${be()||ie()||y()&&Z()?Ae()?"opacity-0":te()?"":we()?"group-hover/wc:opacity-0 group-hover/message:opacity-0":"group-hover:opacity-0 group-hover/message:opacity-0":""}`,"svelte-1ct56pd")),u(xt,Tt)};B(Xr,xt=>{M()&&xt(Pa)})}w(Tr);var Ua=m(Tr,2);{var io=xt=>{var Tt=X2(),cr=E(Tt);{var yr=Fr=>{{let Ta=d(()=>N()?"text-primary-ink":"text-muted-foreground"),Cn=d(()=>N()?g.workspace_card_unpin_ariaLabel():g.workspace_card_pin_ariaLabel()),Hr=d(()=>N()?g.workspace_card_unpin_tooltip():g.workspace_card_pin_tooltip());Ct(Fr,{variant:"plain",size:"icon-xs",iconOnly:!0,get class(){return`transition-all hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0
298
298
  ${e(Ta)??""}`},onclick:hn=>{hn.stopPropagation(),ie()?.(hn)},get"aria-label"(){return e(Cn)},get title(){return e(Hr)},children:(hn,qa)=>{var Ra=Y2(),En=E(Ra);Mt(En,{get icon(){return tc},size:"xs"}),w(Ra),u(hn,Ra)},$$slots:{default:!0}})}};B(cr,Fr=>{ie()&&Fr(yr)})}var Er=m(cr,2);{var Pr=Fr=>{{let Ta=d(()=>g.workspace_card_markAsRead_label()),Cn=d(()=>g.workspace_card_markAsRead_label());Ct(Fr,{variant:"plain",size:"icon-xs",iconOnly:!0,class:"text-muted-foreground hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0",onclick:Hr=>{Hr.stopPropagation(),Z()?.(Hr)},get"aria-label"(){return e(Ta)},get title(){return e(Cn)},children:(Hr,hn)=>{Mt(Hr,{get icon(){return nu},size:"xs"})},$$slots:{default:!0}})}};B(Er,Fr=>{y()&&Z()&&Fr(Pr)})}var ua=m(Er,2);pn(ua,()=>be()??$o);var pa=m(ua,2);{var Aa=Fr=>{{let Ta=d(Rt),Cn=d(()=>g.workspace_progressCard_actions_ariaLabel());Ws(Fr,{get items(){return e(Ta)},get ariaLabel(){return e(Cn)},class:"flex size-5 cursor-pointer items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:outline-none",get open(){return e(Xe)},set open(Hr){T(Xe,Hr,!0)}})}};B(pa,Fr=>{ke()&&Fr(Aa)})}w(Tt),vr(Tt,Fr=>T(et,Fr),()=>e(et)),S(()=>ft(Tt,1,`wc-actions absolute right-1 top-1/2 z-20 flex -translate-y-1/2 items-center gap-0.5 rounded-md bg-accent/95 px-0.5 focus-within:opacity-100
299
299
  ${we()?"group-focus-within/wc:opacity-100":"group-focus-within:opacity-100"}
300
300
  ${Ae()?"opacity-100":te()?"opacity-0":we()?"opacity-0 group-hover/wc:opacity-100":"opacity-0 group-hover:opacity-100"}`,"svelte-1ct56pd")),u(xt,Tt)};B(Ua,xt=>{(be()||ke()||ie()||y()&&Z())&&xt(io)})}w(At),vr(At,xt=>T(Ne,xt),()=>e(Ne)),Wn(At,(xt,Tt)=>ys?.(xt,Tt),()=>({id:Ie()}));var Zr=m(At,2);{var nn=xt=>{Xb(xt,{get id(){return e(se)},get anchor(){return`--workspace-list-${p().id??""}`},position:"right",get anchorElement(){return e(Ne)},class:"w-auto overflow-visible! rounded-lg border-0! bg-background! shadow-none!",onmouseenter:St,onmouseleave:_t,onfocusin:Nt,onfocusout:Gt,children:(Tt,cr)=>{var yr=Z2(),Er=E(yr);ny(Er,{get workspace(){return p()},get activeAgentIds(){return D()},onkeydown:tt}),w(yr),vr(yr,Pr=>T(qt,Pr),()=>e(qt)),An("pointerenter",yr,St),An("pointerleave",yr,_t),Nr("focusin",yr,Nt),Nr("focusout",yr,Gt),u(Tt,yr)},$$slots:{default:!0}})};B(Zr,xt=>{e(_e)&&!te()&&Q()&&xt(nn)})}var gr=m(Zr,2);{var Qn=xt=>{const Tt=d(Rt);var cr=ht(),yr=De(cr);{var Er=Pr=>{{let ua=d(()=>e(it)?.x??0),pa=d(()=>e(it)?.y??0),Aa=d(()=>e(it)?.returnFocus),Fr=d(()=>g.workspace_progressCard_actions_ariaLabel());Pu(Pr,{get x(){return e(ua)},get y(){return e(pa)},get returnFocus(){return e(Aa)},get ariaLabel(){return e(Fr)},get items(){return e(Tt)},onClickOutside:vt})}};B(yr,Pr=>{e(Tt).length>0&&Pr(Er)})}u(xt,cr)};B(gr,xt=>{e(it)&&xt(Qn)})}S((xt,Tt,cr)=>{ft(At,1,xt,"svelte-1ct56pd"),ne(At,"data-pinned",N()),ne(At,"data-highlight-id",Ie()),hr=Tn(At,"",hr,{"anchor-name":`--workspace-list-${p().id??""}`}),ne(ca,"id",`workspace-status-state-${p().id??""}`),x(da,e(q).accessibleName),ft($t,1,`wc-title type-body min-w-0 truncate font-normal!