@intent-hq/web 2.313.1 → 2.314.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 (145) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{B6Eksue8.js → -zJqCea3.js} +2 -2
  3. package/web/app/immutable/chunks/{DxZSyekB.js → 2GJ88dCs.js} +1 -1
  4. package/web/app/immutable/chunks/{qcgLBz2O.js → 4LT7y9ZQ.js} +1 -1
  5. package/web/app/immutable/chunks/{B1YnvfKo.js → 5QVtrNXq.js} +1 -1
  6. package/web/app/immutable/chunks/{C6gBBEr6.js → B1ufjei4.js} +1 -1
  7. package/web/app/immutable/chunks/{LSDVwgG8.js → B5wPXsMb.js} +2 -2
  8. package/web/app/immutable/chunks/{A3beYjJS.js → BAUBrw_Q.js} +4 -4
  9. package/web/app/immutable/chunks/{B_-1t0b5.js → BBraNKjo.js} +1 -1
  10. package/web/app/immutable/chunks/{OpYhygEs.js → BC3_Tz0I.js} +1 -1
  11. package/web/app/immutable/chunks/{D47PZJI_.js → BCqCPE2A.js} +1 -1
  12. package/web/app/immutable/chunks/{qIh42_HI.js → BDXyt8uc.js} +1 -1
  13. package/web/app/immutable/chunks/{CTfHCA2Y.js → BG3-LaXe.js} +1 -1
  14. package/web/app/immutable/chunks/{BESrHe_0.js → BGE3L6Og.js} +1 -1
  15. package/web/app/immutable/chunks/{Bu6sHonm.js → BLjpjU3o.js} +1 -1
  16. package/web/app/immutable/chunks/{CQbq623l.js → BO56ySMn.js} +1 -1
  17. package/web/app/immutable/chunks/{TP4sXUzS.js → BODoCeD7.js} +1 -1
  18. package/web/app/immutable/chunks/{D84mJH5u.js → BOxqCAFj.js} +1 -1
  19. package/web/app/immutable/chunks/{B6QJA3k0.js → BRiqjlZx.js} +1 -1
  20. package/web/app/immutable/chunks/{CMvHzajx.js → BSBjw5bf.js} +1 -1
  21. package/web/app/immutable/chunks/{CE8vXfAM.js → BShCMn2o.js} +1 -1
  22. package/web/app/immutable/chunks/{DYrH45vr.js → BTBt_CW3.js} +1 -1
  23. package/web/app/immutable/chunks/{COpjcilg.js → BTMFCm8Q.js} +1 -1
  24. package/web/app/immutable/chunks/{DPG0D59v.js → BU7c_DWX.js} +1 -1
  25. package/web/app/immutable/chunks/{ClfTOQ5L.js → BWNCru8v.js} +1 -1
  26. package/web/app/immutable/chunks/{BOQCK4ni.js → BZeqlYtS.js} +1 -1
  27. package/web/app/immutable/chunks/{CbpiaYyP.js → BZofcYpm.js} +1 -1
  28. package/web/app/immutable/chunks/{DUdpP1ED.js → Bb91_r8I.js} +1 -1
  29. package/web/app/immutable/chunks/{B88eFHaH.js → BbO_ZO-4.js} +1 -1
  30. package/web/app/immutable/chunks/{DChetNRi.js → BdoRV0R6.js} +2 -2
  31. package/web/app/immutable/chunks/{x8WBzABF.js → BfREzbFg.js} +6 -6
  32. package/web/app/immutable/chunks/{DESxr5Rj.js → Bgbwe74j.js} +1 -1
  33. package/web/app/immutable/chunks/{gsqPz4Y0.js → Bjrzfw53.js} +1 -1
  34. package/web/app/immutable/chunks/{HWP1BG2L.js → Bn90_HQH.js} +1 -1
  35. package/web/app/immutable/chunks/{DBUJXdXR.js → BnIjM7uu.js} +1 -1
  36. package/web/app/immutable/chunks/{usUeYWMe.js → BqIzbF9f.js} +1 -1
  37. package/web/app/immutable/chunks/{By8e6LYt.js → BrUwMaxD.js} +1 -1
  38. package/web/app/immutable/chunks/{CcGPnEzl.js → Brnng54P.js} +1 -1
  39. package/web/app/immutable/chunks/{CelhKzDn.js → BsJjUvSw.js} +1 -1
  40. package/web/app/immutable/chunks/{6rzwTXJx.js → BsM4tb6_.js} +1 -1
  41. package/web/app/immutable/chunks/{C80u9j_3.js → BuUw9ACB.js} +1 -1
  42. package/web/app/immutable/chunks/{DNYGh_FV.js → BxO_L-Qt.js} +1 -1
  43. package/web/app/immutable/chunks/{Cb6WrSKY.js → C1NXGg3X.js} +1 -1
  44. package/web/app/immutable/chunks/{C8PuI333.js → C1PSzyRQ.js} +1 -1
  45. package/web/app/immutable/chunks/{CWaCCzEn.js → C5UPv_5I.js} +1 -1
  46. package/web/app/immutable/chunks/{AHQMxoVk.js → C5ptdEHs.js} +1 -1
  47. package/web/app/immutable/chunks/{D2uybU7F.js → CAzCJvDl.js} +2 -2
  48. package/web/app/immutable/chunks/{CUPAS0zd.js → CDieeo7o.js} +1 -1
  49. package/web/app/immutable/chunks/{CXNySl0c.js → CEN0b_5u.js} +1 -1
  50. package/web/app/immutable/chunks/{NYwlcfYt.js → CH3RzGlL.js} +1 -1
  51. package/web/app/immutable/chunks/{DlKVdWHt.js → CIWRyl5b.js} +1 -1
  52. package/web/app/immutable/chunks/{4wFlAApS.js → CJC8_V9T.js} +1 -1
  53. package/web/app/immutable/chunks/{CCCBFmfe.js → CKDFf_TK.js} +3 -3
  54. package/web/app/immutable/chunks/{DgfdSIWo.js → CLaL96d7.js} +1 -1
  55. package/web/app/immutable/chunks/{y_yPvfwh.js → COzjVAvK.js} +1 -1
  56. package/web/app/immutable/chunks/{DAtBKOQq.js → CRjxer4T.js} +1 -1
  57. package/web/app/immutable/chunks/{jq7ACadW.js → CXGOaAk0.js} +1 -1
  58. package/web/app/immutable/chunks/{D5XH3yqM.js → CXWyJ7nE.js} +1 -1
  59. package/web/app/immutable/chunks/{BssmMBl2.js → CY0CjfPQ.js} +1 -1
  60. package/web/app/immutable/chunks/{D62gE1G0.js → CZewdZk7.js} +1 -1
  61. package/web/app/immutable/chunks/{nHQ6ExVj.js → CaQt2Z0q.js} +1 -1
  62. package/web/app/immutable/chunks/{dX_oN6Xt.js → CaS1NMra.js} +1 -1
  63. package/web/app/immutable/chunks/{sg8Cer3T.js → Cbk0B9g9.js} +3 -3
  64. package/web/app/immutable/chunks/{B3W2oJ3u.js → CdK-r9JV.js} +1 -1
  65. package/web/app/immutable/chunks/{CKH-l4ig.js → CeJWDN_3.js} +1 -1
  66. package/web/app/immutable/chunks/{Ctl9Ux7T.js → CePfYcwK.js} +1 -1
  67. package/web/app/immutable/chunks/{CP06IBS7.js → CgawRw03.js} +1 -1
  68. package/web/app/immutable/chunks/{CzrG_lpv.js → CgigepCD.js} +1 -1
  69. package/web/app/immutable/chunks/{Dz6YK0K2.js → Chgn8T0O.js} +1 -1
  70. package/web/app/immutable/chunks/{C6aPQebU.js → Ck-wy_3I.js} +1 -1
  71. package/web/app/immutable/chunks/{BAssmU5H.js → Cl7U8WuQ.js} +1 -1
  72. package/web/app/immutable/chunks/{MgJqQwQp.js → CnVKycix.js} +1 -1
  73. package/web/app/immutable/chunks/{CTX5Fuc9.js → CoJQ85XH.js} +2 -2
  74. package/web/app/immutable/chunks/{CBTot2K1.js → Cp0BnnBC.js} +1 -1
  75. package/web/app/immutable/chunks/{CQMd4GmI.js → CpQtqZEx.js} +1 -1
  76. package/web/app/immutable/chunks/{q4Mp6azq.js → CsMEcxXY.js} +4 -4
  77. package/web/app/immutable/chunks/{xfGEIVf6.js → CscNag4E.js} +1 -1
  78. package/web/app/immutable/chunks/{MED7rLah.js → CsxI1Ysj.js} +1 -1
  79. package/web/app/immutable/chunks/{DOnT_3WY.js → Ct9UL0kf.js} +1 -1
  80. package/web/app/immutable/chunks/{_bllxFVr.js → Cx4zcQSr.js} +1 -1
  81. package/web/app/immutable/chunks/{CG-371Y6.js → CyGfsC-B.js} +1 -1
  82. package/web/app/immutable/chunks/{BjqGlL_Y.js → CypLXDBF.js} +1 -1
  83. package/web/app/immutable/chunks/{jnmyog2T.js → D-ThocJU.js} +1 -1
  84. package/web/app/immutable/chunks/{BRIkzo-E.js → D1SQpDTj.js} +1 -1
  85. package/web/app/immutable/chunks/{D-8WC0DU.js → D9AR-YJM.js} +1 -1
  86. package/web/app/immutable/chunks/{DulsjrO4.js → DBepvuPk.js} +1 -1
  87. package/web/app/immutable/chunks/{AF5xKPfV.js → DBmtVDK9.js} +1 -1
  88. package/web/app/immutable/chunks/{CYmZhCDN.js → DGXlp1eV.js} +1 -1
  89. package/web/app/immutable/chunks/{CsTPrgDm.js → DGv7oJ6S.js} +3 -3
  90. package/web/app/immutable/chunks/{qr2Z9jBR.js → DIDs8yUA.js} +1 -1
  91. package/web/app/immutable/chunks/{DkI_jPOw.js → DJYgOHlz.js} +4 -4
  92. package/web/app/immutable/chunks/{DwgP_YcK.js → DJgdRHhr.js} +1 -1
  93. package/web/app/immutable/chunks/{Bc3_ahSr.js → DVreMO2u.js} +1 -1
  94. package/web/app/immutable/chunks/{DSOeLuN2.js → DW8z0oWh.js} +1 -1
  95. package/web/app/immutable/chunks/{CJtH5G9P.js → DX60JN13.js} +1 -1
  96. package/web/app/immutable/chunks/{CICEz2Qq.js → DXee6ESD.js} +1 -1
  97. package/web/app/immutable/chunks/{DWccAyE3.js → Dbxut3Pv.js} +1 -1
  98. package/web/app/immutable/chunks/{C_KYY7ZK.js → Dcgfe62U.js} +3 -3
  99. package/web/app/immutable/chunks/{a6K5_NPk.js → DdhV_WoI.js} +1 -1
  100. package/web/app/immutable/chunks/{CW1tBVLY.js → DfDkjmIC.js} +1 -1
  101. package/web/app/immutable/chunks/{C2Cq4c9l.js → Dg2dfh9w.js} +1 -1
  102. package/web/app/immutable/chunks/{Cbh1BCiS.js → DjvskqVM.js} +2 -2
  103. package/web/app/immutable/chunks/{D4qqUzAr.js → DlV2w5MI.js} +1 -1
  104. package/web/app/immutable/chunks/{Dvil1FCS.js → DlshxaaM.js} +1 -1
  105. package/web/app/immutable/chunks/{CN_VK1iL.js → DoJU2jv4.js} +1 -1
  106. package/web/app/immutable/chunks/{DUrqH6OL.js → Dpmk0epM.js} +1 -1
  107. package/web/app/immutable/chunks/{Bfc094Ub.js → DuLfhBfr.js} +1 -1
  108. package/web/app/immutable/chunks/{CA7UZgrf.js → Dv0vpZWp.js} +1 -1
  109. package/web/app/immutable/chunks/{BW6fyv0T.js → FDl_UWlf.js} +6 -6
  110. package/web/app/immutable/chunks/{B2st7VbN.js → H6q761aF.js} +1 -1
  111. package/web/app/immutable/chunks/{C-fnz5X4.js → MW8VbTBI.js} +1 -1
  112. package/web/app/immutable/chunks/{C-li4cfO.js → PBzuv4il.js} +1 -1
  113. package/web/app/immutable/chunks/{CAn8DYJP.js → XemXX3cr.js} +1 -1
  114. package/web/app/immutable/chunks/{C6krgOsR.js → ZT9NLLAX.js} +4 -4
  115. package/web/app/immutable/chunks/{tSV1knJu.js → _o2yTUEx.js} +1 -1
  116. package/web/app/immutable/chunks/{C6XSZJri.js → bFhyrNU-.js} +1 -1
  117. package/web/app/immutable/chunks/{DwPGocEY.js → byOSkJGc.js} +2 -2
  118. package/web/app/immutable/chunks/{BIZcuYRW.js → iHy08gWA.js} +2 -2
  119. package/web/app/immutable/chunks/{ZUZF8K3P.js → nkx_RFPY.js} +1 -1
  120. package/web/app/immutable/chunks/{C2m8Iivv.js → o1gIlJS2.js} +1 -1
  121. package/web/app/immutable/chunks/{CKWaKOqs.js → phbrAlDo.js} +1 -1
  122. package/web/app/immutable/chunks/{DQNmQX9F.js → rpMv4jb4.js} +1 -1
  123. package/web/app/immutable/chunks/{DL9BUVq-.js → ueAr5wDv.js} +1 -1
  124. package/web/app/immutable/chunks/{CxO_9nE4.js → xCmY532M.js} +1 -1
  125. package/web/app/immutable/chunks/{1wCbR4ud.js → xgUEDwKF.js} +1 -1
  126. package/web/app/immutable/chunks/{kdf0l6Z-.js → yXrfMNAa.js} +1 -1
  127. package/web/app/immutable/entry/{app.BlqNT7Cr.js → app.Dn2n9Nn5.js} +2 -2
  128. package/web/app/immutable/entry/start.D4Mla4ft.js +1 -0
  129. package/web/app/immutable/nodes/{0.ShO9PneW.js → 0.Da6D1aZS.js} +1 -1
  130. package/web/app/immutable/nodes/{1.CWY9gUhn.js → 1.DOTAJt-z.js} +1 -1
  131. package/web/app/immutable/nodes/{10.BPcvGGhE.js → 10.BLjAYHOl.js} +1 -1
  132. package/web/app/immutable/nodes/{14.C46jjudj.js → 14.CeAJIzhv.js} +1 -1
  133. package/web/app/immutable/nodes/{16.DxDrMp3A.js → 16.D77rdUiW.js} +2 -2
  134. package/web/app/immutable/nodes/{2.BY4xMtJS.js → 2.Bvxbft35.js} +3 -3
  135. package/web/app/immutable/nodes/{3.RPzUk4Sw.js → 3.8JMXBGvs.js} +1 -1
  136. package/web/app/immutable/nodes/{4.ZFgOw7Ux.js → 4.DDHd95s4.js} +1 -1
  137. package/web/app/immutable/nodes/5.CDflbQEw.js +5 -0
  138. package/web/app/immutable/nodes/{6.BqCf3vb3.js → 6.B_joFJya.js} +1 -1
  139. package/web/app/immutable/nodes/{7.CJYSYpjI.js → 7.B3VmEWTA.js} +1 -1
  140. package/web/app/immutable/nodes/{8.B_FmoLB7.js → 8.Cs2fn0sG.js} +2 -2
  141. package/web/app/immutable/nodes/{9.p1SC8ote.js → 9.DIFtvFG_.js} +1 -1
  142. package/web/app/version.json +1 -1
  143. package/web/index.html +9 -9
  144. package/web/app/immutable/entry/start.DaNUqzZq.js +0 -1
  145. package/web/app/immutable/nodes/5.BKaPpN7j.js +0 -5
@@ -1,4 +1,4 @@
1
- import{s as xe}from"./usUeYWMe.js";import{p as be}from"./CE8vXfAM.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"./q4Mp6azq.js";import{p as ze}from"./BxiJOwnz.js";import{f as O,o as Q}from"./CKWaKOqs.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"./BqIzbF9f.js";import{p as be}from"./BShCMn2o.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"./CsMEcxXY.js";import{p as ze}from"./BxiJOwnz.js";import{f as O,o as Q}from"./phbrAlDo.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"./DYhIMPy1.js";import{j as Be}from"./BPk16bSc.js";import{C as be,D as pe,c as Me,E as Ee}from"./Bl_iEh1f.js";import{s as Re}from"./CzrG_lpv.js";function Pe(t,r={}){const l=(r.axis??"y")==="y"?"height":"width",o=parseFloat(getComputedStyle(t)[l]);if(!Number.isFinite(o))return{duration:0};const p=r.duration??160,v=p<=80?"fast":p<=160?"moderate":"slow";return be(t,{axis:r.axis,tier:v},{direction:"in"})}function Ce(){return Re.get("enableComponentTransitions")}const ve={request(){},settle(){}},k=new WeakMap,Ne=2,ke=2e3;function Ve(t,r){let l=r.enabled??!0,o=r.follow,p=r.onFollowChange,v=r.onScrollStateChange,g=r.threshold??100,d=!1,m=0,s=0,c=!1,w=null,F,y=null,E=null,L=null,T=null,A=null,O=null,R=null,C=null,M=0,N=null,h=!1,P=null;const S=new Set,q=new Map,V=new WeakSet,B=new Map,u=document.createElement("div");u.dataset.followBottomAnchor="",u.setAttribute("aria-hidden","true"),u.style.cssText=`height:1px;${r.layoutNeutralBottomAnchor?"margin-top:-1px;":""}overflow-anchor:auto;pointer-events:none;flex:0 0 auto;`;function I(e){e===u||B.has(e)||(B.set(e,e.style.overflowAnchor),e.style.overflowAnchor="none")}function Y(e){const n=B.get(e);n!==void 0&&(e.style.overflowAnchor=n,B.delete(e))}function a(e){if(e)for(const i of t.children)i instanceof HTMLElement&&I(i);else for(const i of B.keys())Y(i);const n=e?"auto":"none";u.style.overflowAnchor!==n&&(u.style.overflowAnchor=n),e?(u.parentElement!==t||u.nextSibling)&&t.append(u):u.remove()}function $(){a(o)}function ye(){u.remove();for(const e of B.keys())Y(e)}function K(e){V.add(e),T?.observe(e)}function ne(){A!==null&&cancelAnimationFrame(A),C!==null&&cancelAnimationFrame(C),A=null,C=null,M=0,N=null}function J(){return Math.max(0,t.scrollHeight-t.clientHeight)}function X(){return P??=getComputedStyle(t).overflowAnchor!=="none",P}function H(){return{maximum:J(),scrollTop:t.scrollTop}}function _(e=H()){return e.scrollTop!==e.maximum&&(t.scrollTop=e.maximum),{maximum:e.maximum,scrollTop:e.maximum}}function G(e=H()){return e.maximum-e.scrollTop<=g}function x(e=H()){const n=Math.max(0,e.maximum-e.scrollTop),i=n<=g;E?.distanceFromBottom===n&&E.isAtBottom===i&&E.isFollowing===o||(E={distanceFromBottom:n,isAtBottom:i,isFollowing:o},v?.({distanceFromBottom:n,isAtBottom:i,isFollowing:o}))}function Q(e){F=e,w===null&&(w=requestAnimationFrame(()=>{w=null;const n=F;F=void 0,!(h||!l)&&(n&&(y?.event!==n||n.defaultPrevented||performance.now()>=y.expiresAt)||(G()?z.followAndScroll():x()))}))}function D(e,n=!0){if(y=null,!l){o=e;return}const i=o!==e;i&&(o=e,a(e)),i&&n&&p?.(e),e||ne(),x()}function Z(e,n=!0){if(!S.delete(e))return;const i=(q.get(e.element)??1)-1;i>0?q.set(e.element,i):(q.delete(e.element),V.has(e.element)||T?.unobserve?.(e.element)),M=0,n&&U()}function ee(e=!0){if(S.size===0)return;const n=performance.now();for(const i of S)(!t.contains(i.element)||n>=i.expiresAt)&&Z(i,e)}function te(){if(A=null,h||!l||!o)return;if(ee(!1),S.size>0){A=requestAnimationFrame(te);return}const e=_(),{maximum:n}=e;x(e),n===N?M+=1:(M=0,N=n),M<Ne&&(A=requestAnimationFrame(te))}function U(){h||!l||!o||A!==null||(A=requestAnimationFrame(te))}function W(e=!0){if(h||!l||!o)return;const n=_(),{maximum:i}=n;x(n),M=0,N=i,e&&U()}function oe(){R===null&&(R=requestAnimationFrame(()=>{R=null,!(h||!l)&&x()}))}function Ae(){if(C=null,h||!l)return;let e=H();const n=e.scrollTop!==e.maximum;e=_(e),(n||e.maximum!==N||S.size>0)&&(M=0,N=e.maximum,U()),x(e)}function xe(){if(!(h||!l)){if(o){if(A!==null||C!==null)return;C=requestAnimationFrame(Ae);return}oe()}}function Fe(){if(!(h||!l)){if(o){W(C===null);return}oe()}}const z={followAndScroll(){D(!0),W()},isFollowing:()=>o,isNativeScrollAnchoringActive:()=>!o&&getComputedStyle(t).overflowAnchor!=="none",hasActiveMutation:()=>o?(ee(),S.size>0):!1,beforeMutation(e,n){if(h||!l||!o)return ve;const i={element:e,expiresAt:performance.now()+(n.maxHoldMs??ke)};S.add(i);const f=q.get(e)??0;return q.set(e,f+1),f===0&&!V.has(e)&&T?.observe(e),M=0,U(),{request(){!S.has(i)||h||(X()?U():W())},settle(){if(!(h||!S.has(i))){if(X()){Z(i);return}Z(i,!1),W()}}}}};function re(e){e.deltaY<0?D(!1):e.deltaY>0&&(y={event:e,expiresAt:performance.now()+1e3},Q(e))}function le(e){const n=y;y=null,e.target===t&&n&&!n.event.defaultPrevented&&performance.now()<n.expiresAt&&G()&&z.followAndScroll()}let ie=0;function se(e){y=null,ie=e.touches[0]?.clientY??0}function ae(e){const n=e.touches[0]?.clientY??0;ie-n<0&&D(!1)}function ue(){Q()}function ce(e){y=null,["ArrowUp","PageUp","Home"].includes(e.key)?D(!1):["ArrowDown","PageDown","End"].includes(e.key)&&Q()}function Se(e){if(e.button!==0||e.target!==t)return!1;const n=Math.max(0,t.offsetWidth-t.clientWidth);if(n===0)return!1;const i=t.getBoundingClientRect(),f=t.offsetWidth>0?n*(i.width/t.offsetWidth):n;return getComputedStyle(t).direction==="rtl"?e.clientX<=i.left+f:e.clientX>=i.right-f}function fe(){if(!d){if(o&&A!==null)return;let f=H();o&&(f=_(f)),x(f);return}const e=J(),n=Math.max(0,e-t.scrollTop);if(e!==m){m=e,s=n,c=!1,x();return}const i=n-s;s=n,i>0?(c=!1,D(!1)):i<0?(c=!0,G()?z.followAndScroll():x()):x()}function me(e){y=null,d=Se(e),m=J(),s=Math.max(0,m-t.scrollTop),c=!1}function j(){d&&(d=!1,c&&G()?z.followAndScroll():x())}function Le(){if(!L){L=new MutationObserver(e=>{let n=!1;for(const i of e)if(i.type==="childList"){for(const f of i.removedNodes)n=!0,f instanceof HTMLElement&&Y(f);for(const f of i.addedNodes)f instanceof HTMLElement&&f!==u&&T&&(K(f),o&&f.parentElement===t&&I(f))}n&&ee(),a(o),xe()}),L.observe(t,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),T=new ResizeObserver(Fe),K(t);for(const e of t.children)e instanceof HTMLElement&&e!==u&&K(e)}}function Te(){L?.disconnect(),L=null,T?.disconnect(),T=null}function de(e=!1){if(!l||h)return;if(k.set(t,z),t.addEventListener("scroll",fe,{passive:!0}),t.addEventListener("scrollend",le,{passive:!0,capture:!0}),t.addEventListener("wheel",re,{passive:!0}),t.addEventListener("touchstart",se,{passive:!0}),t.addEventListener("touchmove",ae,{passive:!0}),t.addEventListener("touchend",ue,{passive:!0}),t.addEventListener("keydown",ce),t.addEventListener("pointerdown",me,{passive:!0}),window.addEventListener("pointerup",j,{passive:!0}),window.addEventListener("pointercancel",j,{passive:!0}),$(),Le(),e){O=requestAnimationFrame(()=>{O=null,!(h||!l)&&(X(),o?W():x())});return}X();let n=H();o&&(n=_(n),N=n.maximum),x(n)}function he(){y=null,F=void 0,S.clear(),q.clear(),d=!1,ne(),w!==null&&cancelAnimationFrame(w),w=null,O!==null&&cancelAnimationFrame(O),O=null,R!==null&&cancelAnimationFrame(R),R=null,E=null,P=null,k.get(t)===z&&k.delete(t),Te(),ye(),t.removeEventListener("scroll",fe),t.removeEventListener("scrollend",le,!0),t.removeEventListener("wheel",re),t.removeEventListener("touchstart",se),t.removeEventListener("touchmove",ae),t.removeEventListener("touchend",ue),t.removeEventListener("keydown",ce),t.removeEventListener("pointerdown",me),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}return de(!0),{update(e){p=e.onFollowChange,v=e.onScrollStateChange,g=e.threshold??100;const n=e.enabled??!0;if(l!==n&&(n||he(),l=n,l)){o=e.follow,de(!0);return}l?e.follow&&!o?(D(!0,!1),W()):!e.follow&&o?D(!1,!1):O===null&&oe():o=e.follow},destroy(){h=!0,he()}}}function Ye(t){return k.get(t)?.isFollowing()??!1}function _e(t){return k.get(t)?.isNativeScrollAnchoringActive()??!1}function Ue(t){return k.get(t)?.hasActiveMutation()??!1}function ge(t,r={}){let l=t;for(;l;){const o=k.get(l);if(o)return o.beforeMutation(t,r);l=l.parentElement}return ve}function Oe(t){const{scrollTop:r,scrollHeight:l,clientHeight:o}=t;return l-r-o}function qe(t,r=100){return Oe(t)<=r}function De(t,r=!1){t.scrollTo({top:t.scrollHeight,behavior:r?"smooth":"auto"})}function Ie(t){const r=k.get(t);if(r){r.followAndScroll();return}De(t)}function Xe(t,r,l=150,o){const p=t();if(!p)return;const v=p.scrollTop,g=performance.now();function d(s){return 1-Math.pow(1-s,3)}function m(s){const c=t();if(!c)return;const w=s-g,F=Math.min(w/l,1),y=typeof r=="function"?r(c):r;c.scrollTop=v+(y-v)*d(F),F<1?requestAnimationFrame(m):o?.(c)}requestAnimationFrame(m)}function Ge(t,r="[data-message-id], [data-lazy-turn-key]"){const l=t.scrollTop,o=t.getBoundingClientRect(),p=qe(t,100);if(p&&k.get(t)?.isFollowing()!==!1)return{element:null,offsetFromViewport:0,scrollTop:l,isNearBottom:p};const v=t.querySelectorAll(r);let g=null,d=0,m;for(const s of v){const c=s.getBoundingClientRect();if(c.top>=o.bottom)break;if(c.top>=o.top){g||(g=s,d=c.top-o.top);const w=s.getAttribute("data-message-id");if(w){m={id:w,offsetFromViewport:c.top-o.top};break}}}return{element:g,offsetFromViewport:d,scrollTop:l,isNearBottom:p,...m?{message:m}:{}}}function we(t,r){if(r.message){const l=t.querySelector(`[data-message-id="${CSS.escape(r.message.id)}"]`);if(l)return{element:l,offsetFromViewport:r.message.offsetFromViewport}}return r.element?.isConnected?{element:r.element,offsetFromViewport:r.offsetFromViewport}:null}function je(t,r){return we(t,r)!==null}function Ke(t,r){const l=we(t,r);if(l){const{element:o,offsetFromViewport:p}=l,v=t.getBoundingClientRect(),m=o.getBoundingClientRect().top-v.top-p;Math.abs(m)>5&&(t.scrollTop+=m)}}function b(t,r){const l=Number.parseFloat(String(t[r]));return Number.isFinite(l)?l:0}function Je(t,r={},l={}){const o=t,v={maxHoldMs:pe[r.tier??"moderate"].settleMs*2+500};let g=ge(o,v);const d=()=>{g?.settle(),g=null},m=()=>{g??=ge(o,v)};if(!Ce()||Be())return d(),{duration:0};const s=getComputedStyle(o),c=r.axis??"y",w=o.getBoundingClientRect(),F=c==="y"?b(s,"height")||w.height:b(s,"width")||w.width;if(!Number.isFinite(F)||F<=0)return d(),{duration:0};const y=b(s,"opacity")||1,E=r.tier??"moderate",L=pe[E],T=l.direction==="out",A=typeof s.getPropertyValue=="function"?T?Me(o,{tier:E}):Ee(o,{tier:E}):{duration:T?L.exit.duration:L.settleMs,easing:L.exit.easing},O=A.duration??(T?L.exit.duration:L.settleMs),R=r.y??-4,C=b(s,"paddingTop"),M=b(s,"paddingBottom"),N=b(s,"marginTop"),h=b(s,"marginBottom"),P=b(s,"paddingLeft"),S=b(s,"paddingRight"),q=b(s,"marginLeft"),V=b(s,"marginRight");let B=null,u=l.direction==="out"?"outro":l.direction==="in"?"intro":"idle";const I=(a,$)=>{o.style.overflow="hidden",c==="y"?(o.style.height=`${a*F}px`,o.style.paddingTop=`${a*C}px`,o.style.paddingBottom=`${a*M}px`,o.style.marginTop=`${a*N}px`,o.style.marginBottom=`${a*h}px`):(o.style.width=`${a*F}px`,o.style.paddingLeft=`${a*P}px`,o.style.paddingRight=`${a*S}px`,o.style.marginLeft=`${a*q}px`,o.style.marginRight=`${a*V}px`),o.style.opacity=`${a*y}`,o.style.transform=c==="y"?`translateY(${R*$}px)`:`translateX(${R*$}px)`},Y=()=>{o.style.overflow="",o.style.height="",o.style.width="",o.style.paddingTop="",o.style.paddingBottom="",o.style.marginTop="",o.style.marginBottom="",o.style.paddingLeft="",o.style.paddingRight="",o.style.marginLeft="",o.style.marginRight="",o.style.opacity="",o.style.transform=""};return{duration:O,easing:A.easing,tick:(a,$)=>{if(l.direction==="both"&&(B===null?a<1&&(u="outro"):a<B?(m(),u="outro"):a>B&&(m(),u="intro")),B=a,a===1&&u!=="outro"){Y(),d(),u="idle";return}I(a,$),g?.request(),a===0&&u==="outro"&&(d(),u="idle")}}}export{Xe as a,Ce as b,ge as c,je as d,Ge as e,Ve as f,Ie as g,Ue as h,Ye as i,_e as j,Pe as k,De as l,Ke as r,Je as s};
1
+ import"./DYhIMPy1.js";import{j as Be}from"./BPk16bSc.js";import{C as be,D as pe,c as Me,E as Ee}from"./Bl_iEh1f.js";import{s as Re}from"./CgigepCD.js";function Pe(t,r={}){const l=(r.axis??"y")==="y"?"height":"width",o=parseFloat(getComputedStyle(t)[l]);if(!Number.isFinite(o))return{duration:0};const p=r.duration??160,v=p<=80?"fast":p<=160?"moderate":"slow";return be(t,{axis:r.axis,tier:v},{direction:"in"})}function Ce(){return Re.get("enableComponentTransitions")}const ve={request(){},settle(){}},k=new WeakMap,Ne=2,ke=2e3;function Ve(t,r){let l=r.enabled??!0,o=r.follow,p=r.onFollowChange,v=r.onScrollStateChange,g=r.threshold??100,d=!1,m=0,s=0,c=!1,w=null,F,y=null,E=null,L=null,T=null,A=null,O=null,R=null,C=null,M=0,N=null,h=!1,P=null;const S=new Set,q=new Map,V=new WeakSet,B=new Map,u=document.createElement("div");u.dataset.followBottomAnchor="",u.setAttribute("aria-hidden","true"),u.style.cssText=`height:1px;${r.layoutNeutralBottomAnchor?"margin-top:-1px;":""}overflow-anchor:auto;pointer-events:none;flex:0 0 auto;`;function I(e){e===u||B.has(e)||(B.set(e,e.style.overflowAnchor),e.style.overflowAnchor="none")}function Y(e){const n=B.get(e);n!==void 0&&(e.style.overflowAnchor=n,B.delete(e))}function a(e){if(e)for(const i of t.children)i instanceof HTMLElement&&I(i);else for(const i of B.keys())Y(i);const n=e?"auto":"none";u.style.overflowAnchor!==n&&(u.style.overflowAnchor=n),e?(u.parentElement!==t||u.nextSibling)&&t.append(u):u.remove()}function $(){a(o)}function ye(){u.remove();for(const e of B.keys())Y(e)}function K(e){V.add(e),T?.observe(e)}function ne(){A!==null&&cancelAnimationFrame(A),C!==null&&cancelAnimationFrame(C),A=null,C=null,M=0,N=null}function J(){return Math.max(0,t.scrollHeight-t.clientHeight)}function X(){return P??=getComputedStyle(t).overflowAnchor!=="none",P}function H(){return{maximum:J(),scrollTop:t.scrollTop}}function _(e=H()){return e.scrollTop!==e.maximum&&(t.scrollTop=e.maximum),{maximum:e.maximum,scrollTop:e.maximum}}function G(e=H()){return e.maximum-e.scrollTop<=g}function x(e=H()){const n=Math.max(0,e.maximum-e.scrollTop),i=n<=g;E?.distanceFromBottom===n&&E.isAtBottom===i&&E.isFollowing===o||(E={distanceFromBottom:n,isAtBottom:i,isFollowing:o},v?.({distanceFromBottom:n,isAtBottom:i,isFollowing:o}))}function Q(e){F=e,w===null&&(w=requestAnimationFrame(()=>{w=null;const n=F;F=void 0,!(h||!l)&&(n&&(y?.event!==n||n.defaultPrevented||performance.now()>=y.expiresAt)||(G()?z.followAndScroll():x()))}))}function D(e,n=!0){if(y=null,!l){o=e;return}const i=o!==e;i&&(o=e,a(e)),i&&n&&p?.(e),e||ne(),x()}function Z(e,n=!0){if(!S.delete(e))return;const i=(q.get(e.element)??1)-1;i>0?q.set(e.element,i):(q.delete(e.element),V.has(e.element)||T?.unobserve?.(e.element)),M=0,n&&U()}function ee(e=!0){if(S.size===0)return;const n=performance.now();for(const i of S)(!t.contains(i.element)||n>=i.expiresAt)&&Z(i,e)}function te(){if(A=null,h||!l||!o)return;if(ee(!1),S.size>0){A=requestAnimationFrame(te);return}const e=_(),{maximum:n}=e;x(e),n===N?M+=1:(M=0,N=n),M<Ne&&(A=requestAnimationFrame(te))}function U(){h||!l||!o||A!==null||(A=requestAnimationFrame(te))}function W(e=!0){if(h||!l||!o)return;const n=_(),{maximum:i}=n;x(n),M=0,N=i,e&&U()}function oe(){R===null&&(R=requestAnimationFrame(()=>{R=null,!(h||!l)&&x()}))}function Ae(){if(C=null,h||!l)return;let e=H();const n=e.scrollTop!==e.maximum;e=_(e),(n||e.maximum!==N||S.size>0)&&(M=0,N=e.maximum,U()),x(e)}function xe(){if(!(h||!l)){if(o){if(A!==null||C!==null)return;C=requestAnimationFrame(Ae);return}oe()}}function Fe(){if(!(h||!l)){if(o){W(C===null);return}oe()}}const z={followAndScroll(){D(!0),W()},isFollowing:()=>o,isNativeScrollAnchoringActive:()=>!o&&getComputedStyle(t).overflowAnchor!=="none",hasActiveMutation:()=>o?(ee(),S.size>0):!1,beforeMutation(e,n){if(h||!l||!o)return ve;const i={element:e,expiresAt:performance.now()+(n.maxHoldMs??ke)};S.add(i);const f=q.get(e)??0;return q.set(e,f+1),f===0&&!V.has(e)&&T?.observe(e),M=0,U(),{request(){!S.has(i)||h||(X()?U():W())},settle(){if(!(h||!S.has(i))){if(X()){Z(i);return}Z(i,!1),W()}}}}};function re(e){e.deltaY<0?D(!1):e.deltaY>0&&(y={event:e,expiresAt:performance.now()+1e3},Q(e))}function le(e){const n=y;y=null,e.target===t&&n&&!n.event.defaultPrevented&&performance.now()<n.expiresAt&&G()&&z.followAndScroll()}let ie=0;function se(e){y=null,ie=e.touches[0]?.clientY??0}function ae(e){const n=e.touches[0]?.clientY??0;ie-n<0&&D(!1)}function ue(){Q()}function ce(e){y=null,["ArrowUp","PageUp","Home"].includes(e.key)?D(!1):["ArrowDown","PageDown","End"].includes(e.key)&&Q()}function Se(e){if(e.button!==0||e.target!==t)return!1;const n=Math.max(0,t.offsetWidth-t.clientWidth);if(n===0)return!1;const i=t.getBoundingClientRect(),f=t.offsetWidth>0?n*(i.width/t.offsetWidth):n;return getComputedStyle(t).direction==="rtl"?e.clientX<=i.left+f:e.clientX>=i.right-f}function fe(){if(!d){if(o&&A!==null)return;let f=H();o&&(f=_(f)),x(f);return}const e=J(),n=Math.max(0,e-t.scrollTop);if(e!==m){m=e,s=n,c=!1,x();return}const i=n-s;s=n,i>0?(c=!1,D(!1)):i<0?(c=!0,G()?z.followAndScroll():x()):x()}function me(e){y=null,d=Se(e),m=J(),s=Math.max(0,m-t.scrollTop),c=!1}function j(){d&&(d=!1,c&&G()?z.followAndScroll():x())}function Le(){if(!L){L=new MutationObserver(e=>{let n=!1;for(const i of e)if(i.type==="childList"){for(const f of i.removedNodes)n=!0,f instanceof HTMLElement&&Y(f);for(const f of i.addedNodes)f instanceof HTMLElement&&f!==u&&T&&(K(f),o&&f.parentElement===t&&I(f))}n&&ee(),a(o),xe()}),L.observe(t,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),T=new ResizeObserver(Fe),K(t);for(const e of t.children)e instanceof HTMLElement&&e!==u&&K(e)}}function Te(){L?.disconnect(),L=null,T?.disconnect(),T=null}function de(e=!1){if(!l||h)return;if(k.set(t,z),t.addEventListener("scroll",fe,{passive:!0}),t.addEventListener("scrollend",le,{passive:!0,capture:!0}),t.addEventListener("wheel",re,{passive:!0}),t.addEventListener("touchstart",se,{passive:!0}),t.addEventListener("touchmove",ae,{passive:!0}),t.addEventListener("touchend",ue,{passive:!0}),t.addEventListener("keydown",ce),t.addEventListener("pointerdown",me,{passive:!0}),window.addEventListener("pointerup",j,{passive:!0}),window.addEventListener("pointercancel",j,{passive:!0}),$(),Le(),e){O=requestAnimationFrame(()=>{O=null,!(h||!l)&&(X(),o?W():x())});return}X();let n=H();o&&(n=_(n),N=n.maximum),x(n)}function he(){y=null,F=void 0,S.clear(),q.clear(),d=!1,ne(),w!==null&&cancelAnimationFrame(w),w=null,O!==null&&cancelAnimationFrame(O),O=null,R!==null&&cancelAnimationFrame(R),R=null,E=null,P=null,k.get(t)===z&&k.delete(t),Te(),ye(),t.removeEventListener("scroll",fe),t.removeEventListener("scrollend",le,!0),t.removeEventListener("wheel",re),t.removeEventListener("touchstart",se),t.removeEventListener("touchmove",ae),t.removeEventListener("touchend",ue),t.removeEventListener("keydown",ce),t.removeEventListener("pointerdown",me),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}return de(!0),{update(e){p=e.onFollowChange,v=e.onScrollStateChange,g=e.threshold??100;const n=e.enabled??!0;if(l!==n&&(n||he(),l=n,l)){o=e.follow,de(!0);return}l?e.follow&&!o?(D(!0,!1),W()):!e.follow&&o?D(!1,!1):O===null&&oe():o=e.follow},destroy(){h=!0,he()}}}function Ye(t){return k.get(t)?.isFollowing()??!1}function _e(t){return k.get(t)?.isNativeScrollAnchoringActive()??!1}function Ue(t){return k.get(t)?.hasActiveMutation()??!1}function ge(t,r={}){let l=t;for(;l;){const o=k.get(l);if(o)return o.beforeMutation(t,r);l=l.parentElement}return ve}function Oe(t){const{scrollTop:r,scrollHeight:l,clientHeight:o}=t;return l-r-o}function qe(t,r=100){return Oe(t)<=r}function De(t,r=!1){t.scrollTo({top:t.scrollHeight,behavior:r?"smooth":"auto"})}function Ie(t){const r=k.get(t);if(r){r.followAndScroll();return}De(t)}function Xe(t,r,l=150,o){const p=t();if(!p)return;const v=p.scrollTop,g=performance.now();function d(s){return 1-Math.pow(1-s,3)}function m(s){const c=t();if(!c)return;const w=s-g,F=Math.min(w/l,1),y=typeof r=="function"?r(c):r;c.scrollTop=v+(y-v)*d(F),F<1?requestAnimationFrame(m):o?.(c)}requestAnimationFrame(m)}function Ge(t,r="[data-message-id], [data-lazy-turn-key]"){const l=t.scrollTop,o=t.getBoundingClientRect(),p=qe(t,100);if(p&&k.get(t)?.isFollowing()!==!1)return{element:null,offsetFromViewport:0,scrollTop:l,isNearBottom:p};const v=t.querySelectorAll(r);let g=null,d=0,m;for(const s of v){const c=s.getBoundingClientRect();if(c.top>=o.bottom)break;if(c.top>=o.top){g||(g=s,d=c.top-o.top);const w=s.getAttribute("data-message-id");if(w){m={id:w,offsetFromViewport:c.top-o.top};break}}}return{element:g,offsetFromViewport:d,scrollTop:l,isNearBottom:p,...m?{message:m}:{}}}function we(t,r){if(r.message){const l=t.querySelector(`[data-message-id="${CSS.escape(r.message.id)}"]`);if(l)return{element:l,offsetFromViewport:r.message.offsetFromViewport}}return r.element?.isConnected?{element:r.element,offsetFromViewport:r.offsetFromViewport}:null}function je(t,r){return we(t,r)!==null}function Ke(t,r){const l=we(t,r);if(l){const{element:o,offsetFromViewport:p}=l,v=t.getBoundingClientRect(),m=o.getBoundingClientRect().top-v.top-p;Math.abs(m)>5&&(t.scrollTop+=m)}}function b(t,r){const l=Number.parseFloat(String(t[r]));return Number.isFinite(l)?l:0}function Je(t,r={},l={}){const o=t,v={maxHoldMs:pe[r.tier??"moderate"].settleMs*2+500};let g=ge(o,v);const d=()=>{g?.settle(),g=null},m=()=>{g??=ge(o,v)};if(!Ce()||Be())return d(),{duration:0};const s=getComputedStyle(o),c=r.axis??"y",w=o.getBoundingClientRect(),F=c==="y"?b(s,"height")||w.height:b(s,"width")||w.width;if(!Number.isFinite(F)||F<=0)return d(),{duration:0};const y=b(s,"opacity")||1,E=r.tier??"moderate",L=pe[E],T=l.direction==="out",A=typeof s.getPropertyValue=="function"?T?Me(o,{tier:E}):Ee(o,{tier:E}):{duration:T?L.exit.duration:L.settleMs,easing:L.exit.easing},O=A.duration??(T?L.exit.duration:L.settleMs),R=r.y??-4,C=b(s,"paddingTop"),M=b(s,"paddingBottom"),N=b(s,"marginTop"),h=b(s,"marginBottom"),P=b(s,"paddingLeft"),S=b(s,"paddingRight"),q=b(s,"marginLeft"),V=b(s,"marginRight");let B=null,u=l.direction==="out"?"outro":l.direction==="in"?"intro":"idle";const I=(a,$)=>{o.style.overflow="hidden",c==="y"?(o.style.height=`${a*F}px`,o.style.paddingTop=`${a*C}px`,o.style.paddingBottom=`${a*M}px`,o.style.marginTop=`${a*N}px`,o.style.marginBottom=`${a*h}px`):(o.style.width=`${a*F}px`,o.style.paddingLeft=`${a*P}px`,o.style.paddingRight=`${a*S}px`,o.style.marginLeft=`${a*q}px`,o.style.marginRight=`${a*V}px`),o.style.opacity=`${a*y}`,o.style.transform=c==="y"?`translateY(${R*$}px)`:`translateX(${R*$}px)`},Y=()=>{o.style.overflow="",o.style.height="",o.style.width="",o.style.paddingTop="",o.style.paddingBottom="",o.style.marginTop="",o.style.marginBottom="",o.style.paddingLeft="",o.style.paddingRight="",o.style.marginLeft="",o.style.marginRight="",o.style.opacity="",o.style.transform=""};return{duration:O,easing:A.easing,tick:(a,$)=>{if(l.direction==="both"&&(B===null?a<1&&(u="outro"):a<B?(m(),u="outro"):a>B&&(m(),u="intro")),B=a,a===1&&u!=="outro"){Y(),d(),u="idle";return}I(a,$),g?.request(),a===0&&u==="outro"&&(d(),u="idle")}}}export{Xe as a,Ce as b,ge as c,je as d,Ge as e,Ve as f,Ie as g,Ue as h,Ye as i,_e as j,Pe as k,De as l,Ke as r,Je as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DYrH45vr.js","/app/immutable/chunks/q4Mp6azq.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/CzrG_lpv.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/C80u9j_3.js","/app/immutable/chunks/BHqHNrOT.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/D2uybU7F.js","/app/immutable/chunks/-URcs0EB.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/B6Eksue8.js","/app/immutable/chunks/Cop9b2dY.js","/app/immutable/chunks/XzWc0fs1.js","/app/immutable/chunks/BRNfUSNR.js","/app/immutable/chunks/DO2cS8JO.js","/app/immutable/chunks/7IyNIHph.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DH9gMPGd.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/assets/observe-overflow.CJJmE3_P.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/C5Nz-crT.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/BgyuoEGq.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BMkc6ng0.js","/app/immutable/chunks/BOQCK4ni.js","/app/immutable/chunks/BW6fyv0T.js","/app/immutable/chunks/CJtH5G9P.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CxO_9nE4.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css","/app/immutable/chunks/A3beYjJS.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/BGGxKX5q.js","/app/immutable/chunks/lkH5RFQO.js","/app/immutable/assets/AttachmentPreview.BCSCCZGm.css","/app/immutable/chunks/DkI_jPOw.js","/app/immutable/chunks/CCCBFmfe.js","/app/immutable/chunks/Dvil1FCS.js","/app/immutable/assets/accessibility.CP-rioAF.css","/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css"])))=>i.map(i=>d[i]);
2
- import{_ as Z}from"./BAqR9jtB.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./q4Mp6azq.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./DYrH45vr.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BTBt_CW3.js","/app/immutable/chunks/CsMEcxXY.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/CgigepCD.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/BuUw9ACB.js","/app/immutable/chunks/BHqHNrOT.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/CAzCJvDl.js","/app/immutable/chunks/-URcs0EB.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/-zJqCea3.js","/app/immutable/chunks/Cop9b2dY.js","/app/immutable/chunks/XzWc0fs1.js","/app/immutable/chunks/BRNfUSNR.js","/app/immutable/chunks/DO2cS8JO.js","/app/immutable/chunks/7IyNIHph.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DH9gMPGd.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/assets/observe-overflow.CJJmE3_P.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/C5Nz-crT.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/BgyuoEGq.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BMkc6ng0.js","/app/immutable/chunks/BZeqlYtS.js","/app/immutable/chunks/FDl_UWlf.js","/app/immutable/chunks/DX60JN13.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/xCmY532M.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css","/app/immutable/chunks/BAUBrw_Q.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/BGGxKX5q.js","/app/immutable/chunks/lkH5RFQO.js","/app/immutable/assets/AttachmentPreview.BCSCCZGm.css","/app/immutable/chunks/DJYgOHlz.js","/app/immutable/chunks/CKDFf_TK.js","/app/immutable/chunks/DlshxaaM.js","/app/immutable/assets/accessibility.CP-rioAF.css","/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css"])))=>i.map(i=>d[i]);
2
+ import{_ as Z}from"./BAqR9jtB.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./CsMEcxXY.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./BTBt_CW3.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DhAv1XMF.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BRIkzo-E.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/D2uybU7F.js","/app/immutable/chunks/CxO_9nE4.js"])))=>i.map(i=>d[i]);
2
- import{bo as b,_ as x}from"./BAqR9jtB.js";import{g as f,Hp as a,df as P,FW as S,xE as N,E6 as R,uj as W,pZ as q,tT as H,Js as U}from"./BSwWMzab.js";import{y as I}from"./C8_w7W1W.js";import{bb as j}from"./C9gP-gRX.js";import{parseIntentLink as V}from"./Cbh1BCiS.js";import{n as y}from"./Bc-8qHYh.js";import"./DYhIMPy1.js";import"./BPk16bSc.js";import"./DiCMHWTR.js";import"./ChTqQfQN.js";import"./7ZJvg7ev.js";import{I as B,q as C,H as L}from"./C0VJEx2v.js";import{dl as D}from"./DY6JypjK.js";import{p as E,o as $,h as z}from"./DkrnUdRW.js";const p="assistant-content",J=a.createSelector(t=>{const r=E.select(t),s=$.select(t),e=z.select(t).find(i=>i.agentId===s)??r.find(i=>i.isActive)??r.find(i=>i.messageCount>0)??r[0];return P(e?.agentId??null)}),O=new Map;function K(t,r=!1){const s=O.get(t)??{explicit:0,background:0},e={explicit:s.explicit+(r?0:1),background:s.background+(r?1:0)};return O.set(t,e),r?e:{explicit:e.explicit}}function m(t,r){const s=O.get(t);return s!==void 0&&r.explicit===s.explicit&&(r.background===void 0||r.background===s.background)}async function Z(t){a.dispatch(W(t)),L.select(a.state,t).restoreStatus==="pending"&&await new Promise(r=>{const s=L.withStore(a)(t).subscribe(e=>{e.restoreStatus!=="pending"&&(r(),queueMicrotask(()=>s()))})})}function _(t,r,s){const e=L.select(a.state,s);if(!e.panels[p]||Object.keys(e.panels).some(i=>i!==p)){const i=e.panels[p],d=Object.values(e.panels).flatMap(n=>n.tabs.filter(o=>o.type!=="agent"||o.workspaceId!==f)),c=d.some(n=>n.id===i?.activeTabId)?i?.activeTabId??null:d.at(-1)?.id??null;a.dispatch(q(s,{root:{type:"panel",panelId:p},panels:{[p]:{id:p,tabs:d,activeTabId:c}},focusedPanelId:e.focusedPanelId===p?p:null,hiddenTabs:C.select(a.state,s)}))}a.dispatch(H(s,t,p,void 0,!0,void 0,!1,r.background||r.preserveFocus,void 0,r.background))}async function de(t,r={}){try{return await G(t,r)}catch(s){return y.error(b.ui_linkHandler_notFound_title(),{description:s instanceof Error?s.message:String(s)}),!0}}async function G(t,r){const s=/^intent:\/\/local\/([^/?#]+)\/agent\/([^/?#]+)$/.exec(t),e=t.startsWith("intent://")?V(t):null,i=e?.valid&&e.type==="workspace"?[t,e.resourceId]:/^\/workspace\/([^/?#]+)\/?$/.exec(t),d=/^https?:\/\//.test(t)&&!j(t);if(!i&&!s&&!d&&!(e?.valid&&["file","message","note","task"].includes(e.type))||i&&[f,"new"].includes(i[1]))return!1;const c=E.select(a.state),n=r.agentId?P(r.agentId):r.background?c.length===1?P(c[0].agentId):null:r.layoutId??J.select(a.state);if(!n)return!0;const o=K(n,r.background);if(await Z(n),!m(n,o))return!0;if(i){const u=i[1],g=await I.workspaces.get(u);return m(n,o)?g?(a.dispatch(S(g)),_({type:"workspace",title:g.title,workspaceId:u,closable:!0},r,n),!0):(y.error(b.workspace_loader_notFound_title()),!0):!0}if(s)return T(s[1],s[2],r,n,o);if(d){const{resolveBrowserLinkForOpen:u}=await x(async()=>{const{resolveBrowserLinkForOpen:v}=await import("./DhAv1XMF.js").then(k=>k.b);return{resolveBrowserLinkForOpen:v}},__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]),import.meta.url),g=await u(t);return m(n,o)&&_({type:"browser",title:new URL(t).hostname,browserUrl:g.url,browserRequestedUrl:g.requestedUrl,workspaceId:f,closable:!0},r,n),!0}if(!e?.valid)return!1;const h=e.workspaceId??f;if(e.type==="file"){const u=await I.workspaces.get(h);return m(n,o)?u?(a.dispatch(S(u)),_({type:"file",title:e.resourceId.split("/").at(-1)??e.resourceId,filePath:e.resourceId,workspaceId:h,closable:!0,data:{line:e.line,filePathIsLiteral:!0}},r,n),!0):(y.error(b.workspace_loader_notFound_title()),!0):!0}if(e.type==="message"&&e.agentId)return T(h,e.agentId,r,n,o,e.resourceId);if(e.type!=="note"&&e.type!=="task")return!1;const l=e.workspaceId??f,[w,A]=await Promise.all([a.dispatch(N(l,e.resourceId)),Promise.resolve(D.select(a.state,l)??I.workspaces.get(l)).catch(()=>null)]);if(!m(n,o))return!0;if(!w||String(w.workspaceId)!==l)return y.error(b.ui_linkHandler_notFound_title(),{description:b.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:l})}),!0;A&&String(A.id)===l&&a.dispatch(S(A));const F=Object.entries(B.select(a.state)).some(([u,g])=>{const v=k=>k.type==="note"&&k.noteId===String(w.id)&&(k.workspaceId??u)===l;return Object.values(g.panels).some(k=>k.tabs.some(v))||C.select(a.state,u).some(v)}),M=a.state.transientUi.byWorkspaceId[l]?.noteViewModeByNoteId[String(w.id)];return!F&&(!r.background||M===void 0)&&a.dispatch(R(l,String(w.id),"editor")),_({type:"note",title:w.title,noteId:String(w.id),workspaceId:l,closable:!0},r,n),!0}async function T(t,r,s,e,i,d){const c=await I.agents.get(r,t===f?void 0:t);t===f&&c&&(t=String(c.workspaceId));const n=t===f?null:await I.workspaces.get(t);if(!m(e,i))return!0;if(!n&&t!==f||!c||String(c.workspaceId)!==t)return y.error(b.ui_linkHandler_notFound_title()),!0;if(n&&a.dispatch(S(n)),a.dispatch(U(c)),_({type:"agent",title:c.name??r,agentId:r,workspaceId:t,closable:!0},s,e),d&&!s.background){const{openMessage:o}=await x(async()=>{const{openMessage:h}=await import("./BRIkzo-E.js");return{openMessage:h}},__vite__mapDeps([25,26,27,28,2,3,17,18,19,20,13,5,8,11,7,4,6,9,10,12,14,29,30,31,32,22,33,15,34,35,36]),import.meta.url);o({workspaceId:t,agentId:r,messageId:d,contentAlreadyOpen:!0})}return!0}export{p as ASSISTANT_CONTENT_PANEL_ID,J as selectAssistantPanelLayoutId,de as showAssistantContent};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DhAv1XMF.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/D1SQpDTj.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CAzCJvDl.js","/app/immutable/chunks/xCmY532M.js"])))=>i.map(i=>d[i]);
2
+ import{bo as b,_ as x}from"./BAqR9jtB.js";import{g as f,Hp as a,df as P,FW as S,xE as N,E6 as R,uj as W,pZ as q,tT as H,Js as U}from"./BSwWMzab.js";import{y as I}from"./C8_w7W1W.js";import{bb as j}from"./C9gP-gRX.js";import{parseIntentLink as V}from"./DjvskqVM.js";import{n as y}from"./Bc-8qHYh.js";import"./DYhIMPy1.js";import"./BPk16bSc.js";import"./DiCMHWTR.js";import"./ChTqQfQN.js";import"./7ZJvg7ev.js";import{I as B,q as C,H as L}from"./C0VJEx2v.js";import{dl as D}from"./DY6JypjK.js";import{p as E,o as $,h as z}from"./DkrnUdRW.js";const p="assistant-content",J=a.createSelector(t=>{const r=E.select(t),s=$.select(t),e=z.select(t).find(i=>i.agentId===s)??r.find(i=>i.isActive)??r.find(i=>i.messageCount>0)??r[0];return P(e?.agentId??null)}),O=new Map;function K(t,r=!1){const s=O.get(t)??{explicit:0,background:0},e={explicit:s.explicit+(r?0:1),background:s.background+(r?1:0)};return O.set(t,e),r?e:{explicit:e.explicit}}function m(t,r){const s=O.get(t);return s!==void 0&&r.explicit===s.explicit&&(r.background===void 0||r.background===s.background)}async function Z(t){a.dispatch(W(t)),L.select(a.state,t).restoreStatus==="pending"&&await new Promise(r=>{const s=L.withStore(a)(t).subscribe(e=>{e.restoreStatus!=="pending"&&(r(),queueMicrotask(()=>s()))})})}function _(t,r,s){const e=L.select(a.state,s);if(!e.panels[p]||Object.keys(e.panels).some(i=>i!==p)){const i=e.panels[p],d=Object.values(e.panels).flatMap(n=>n.tabs.filter(o=>o.type!=="agent"||o.workspaceId!==f)),c=d.some(n=>n.id===i?.activeTabId)?i?.activeTabId??null:d.at(-1)?.id??null;a.dispatch(q(s,{root:{type:"panel",panelId:p},panels:{[p]:{id:p,tabs:d,activeTabId:c}},focusedPanelId:e.focusedPanelId===p?p:null,hiddenTabs:C.select(a.state,s)}))}a.dispatch(H(s,t,p,void 0,!0,void 0,!1,r.background||r.preserveFocus,void 0,r.background))}async function de(t,r={}){try{return await G(t,r)}catch(s){return y.error(b.ui_linkHandler_notFound_title(),{description:s instanceof Error?s.message:String(s)}),!0}}async function G(t,r){const s=/^intent:\/\/local\/([^/?#]+)\/agent\/([^/?#]+)$/.exec(t),e=t.startsWith("intent://")?V(t):null,i=e?.valid&&e.type==="workspace"?[t,e.resourceId]:/^\/workspace\/([^/?#]+)\/?$/.exec(t),d=/^https?:\/\//.test(t)&&!j(t);if(!i&&!s&&!d&&!(e?.valid&&["file","message","note","task"].includes(e.type))||i&&[f,"new"].includes(i[1]))return!1;const c=E.select(a.state),n=r.agentId?P(r.agentId):r.background?c.length===1?P(c[0].agentId):null:r.layoutId??J.select(a.state);if(!n)return!0;const o=K(n,r.background);if(await Z(n),!m(n,o))return!0;if(i){const u=i[1],g=await I.workspaces.get(u);return m(n,o)?g?(a.dispatch(S(g)),_({type:"workspace",title:g.title,workspaceId:u,closable:!0},r,n),!0):(y.error(b.workspace_loader_notFound_title()),!0):!0}if(s)return T(s[1],s[2],r,n,o);if(d){const{resolveBrowserLinkForOpen:u}=await x(async()=>{const{resolveBrowserLinkForOpen:v}=await import("./DhAv1XMF.js").then(k=>k.b);return{resolveBrowserLinkForOpen:v}},__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]),import.meta.url),g=await u(t);return m(n,o)&&_({type:"browser",title:new URL(t).hostname,browserUrl:g.url,browserRequestedUrl:g.requestedUrl,workspaceId:f,closable:!0},r,n),!0}if(!e?.valid)return!1;const h=e.workspaceId??f;if(e.type==="file"){const u=await I.workspaces.get(h);return m(n,o)?u?(a.dispatch(S(u)),_({type:"file",title:e.resourceId.split("/").at(-1)??e.resourceId,filePath:e.resourceId,workspaceId:h,closable:!0,data:{line:e.line,filePathIsLiteral:!0}},r,n),!0):(y.error(b.workspace_loader_notFound_title()),!0):!0}if(e.type==="message"&&e.agentId)return T(h,e.agentId,r,n,o,e.resourceId);if(e.type!=="note"&&e.type!=="task")return!1;const l=e.workspaceId??f,[w,A]=await Promise.all([a.dispatch(N(l,e.resourceId)),Promise.resolve(D.select(a.state,l)??I.workspaces.get(l)).catch(()=>null)]);if(!m(n,o))return!0;if(!w||String(w.workspaceId)!==l)return y.error(b.ui_linkHandler_notFound_title(),{description:b.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:l})}),!0;A&&String(A.id)===l&&a.dispatch(S(A));const F=Object.entries(B.select(a.state)).some(([u,g])=>{const v=k=>k.type==="note"&&k.noteId===String(w.id)&&(k.workspaceId??u)===l;return Object.values(g.panels).some(k=>k.tabs.some(v))||C.select(a.state,u).some(v)}),M=a.state.transientUi.byWorkspaceId[l]?.noteViewModeByNoteId[String(w.id)];return!F&&(!r.background||M===void 0)&&a.dispatch(R(l,String(w.id),"editor")),_({type:"note",title:w.title,noteId:String(w.id),workspaceId:l,closable:!0},r,n),!0}async function T(t,r,s,e,i,d){const c=await I.agents.get(r,t===f?void 0:t);t===f&&c&&(t=String(c.workspaceId));const n=t===f?null:await I.workspaces.get(t);if(!m(e,i))return!0;if(!n&&t!==f||!c||String(c.workspaceId)!==t)return y.error(b.ui_linkHandler_notFound_title()),!0;if(n&&a.dispatch(S(n)),a.dispatch(U(c)),_({type:"agent",title:c.name??r,agentId:r,workspaceId:t,closable:!0},s,e),d&&!s.background){const{openMessage:o}=await x(async()=>{const{openMessage:h}=await import("./D1SQpDTj.js");return{openMessage:h}},__vite__mapDeps([25,26,27,28,2,3,17,18,19,20,13,5,8,11,7,4,6,9,10,12,14,29,30,31,32,22,33,15,34,35,36]),import.meta.url);o({workspaceId:t,agentId:r,messageId:d,contentAlreadyOpen:!0})}return!0}export{p as ASSISTANT_CONTENT_PANEL_ID,J as selectAssistantPanelLayoutId,de as showAssistantContent};
@@ -1,4 +1,4 @@
1
- var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bq as C,a_ as M,bo as P,by as un,bs as On,b as hn,bu as je}from"./BAqR9jtB.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as L,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as S,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Hn,a as Us,be as Tt,b$ as ft,bf as or}from"./DYhIMPy1.js";import{k as En,s as Ve,h as Pt,i as Ln,I as ir,a as ar,l as lr}from"./BPk16bSc.js";import{H as cn,E as Ws,c as Bs,t as Rt}from"./Bl_iEh1f.js";import{b as on}from"./BaIAhI85.js";import{Hp as Me,eA as Vs,er as Ks,es as js,o7 as qs,mX as Vt,m$ as cr,m_ as In,eu as Gs,u5 as Qs,u6 as Xs,u8 as Ys,FC as Zs,Hu as Js,qH as eo,ez as to}from"./BSwWMzab.js";import{c as no}from"./CZI4_vlI.js";import{F as Ne,a0 as ro,a7 as An,av as dr,aw as ur,bP as so,aN as oo,c9 as hr,bW as gr,cl as fr}from"./DKXEy5Lq.js";import{dl as io,bc as ao,L as lo,aB as mr,h as co}from"./DY6JypjK.js";import{L as pr}from"./BUjtm23k.js";import{C as an}from"./DypB-Dwi.js";import{b5 as kr,bK as uo,bN as ho}from"./CzrG_lpv.js";import{q as $e,d as go,g as fo}from"./C-fnz5X4.js";import"./DiCMHWTR.js";import{f as ke}from"./C9gP-gRX.js";import{e as mo}from"./B6Eksue8.js";import{T as Pr}from"./CXNySl0c.js";import{g as Nn}from"./Cop9b2dY.js";import{C as po}from"./BGGxKX5q.js";import{C as vo}from"./Bc-8qHYh.js";import{s as vr}from"./C6XSZJri.js";import{w as Dt}from"./DO2cS8JO.js";import{P as _o,l as _r}from"./A3beYjJS.js";import{g as wo}from"./B6mHy78M.js";import{a2 as bo,S as yo}from"./D84mJH5u.js";import{ar as So}from"./sg8Cer3T.js";import{s as wr}from"./kdf0l6Z-.js";import{a6 as Co,a5 as xo,a7 as ko}from"./x8WBzABF.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,y=a?l+c*2:b;if(r=Math.max(r,y),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+y,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Ho=[0,1e-6,.99999,1],Lo={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Lo,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Ho,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,y=a+c+p;return!(r<b-l||r>y)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:y}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(y==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let y,A;b<=0?(y=b,A="bottom"):(y=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(y>=0&&(a.fileOffset<0||y<a.fileOffset)||y<0&&a.fileOffset<0&&y>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:y,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=C(r,"change",7),y=C(r,"foldUnchanged",7,!0),A=C(r,"allowHeadReads",7,!0),F=C(r,"canReadHeadFiles",7),G=C(r,"lineWrapping",7,!1),h=C(r,"scrollToLine",7),oe=C(r,"isAggregate",7,!1),Te=C(r,"showScrollHint",7,!1),ue=C(r,"onStageHunk",7),Q=C(r,"onUnstageHunk",7),at=C(r,"onOpenCommit",7),pt=C(r,"virtualizer",7),vt=C(r,"gitRootId",7,void 0),_t=C(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),ye=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(ye,!0)}function De(){m(ye,!1),m(Fe,!1),m(Ue,0)}function He(v){!e(ye)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(ye))&&(m(Fe,!1),m(Ue,0))});let Ht=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:yt,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let St;return Ke==="committed"?St=an.Committed:rt?St=an.Staged:St=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:St,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:yt},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Lt={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return y()},set foldUnchanged(v=!0){y(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},Le=To();let wt;var It=N(Le);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Ht)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return y()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var yt=S(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=S(At);L(Ke),L(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(yt,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(yt=>K(Qe,yt),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}L(Le),on(Le,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(Le,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(Le,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",Le,ie),sn("mouseleave",Le,De),sn("wheel",Le,He),ln("focusin",Le,jt),ln("focusout",Le,qt),w(f,Le);var mn=fn(Lt);return c(),mn}xr(["focusin","focusout"]);function yr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
1
+ var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bq as C,a_ as M,bo as P,by as un,bs as On,b as hn,bu as je}from"./BAqR9jtB.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as L,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as S,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Hn,a as Us,be as Tt,b$ as ft,bf as or}from"./DYhIMPy1.js";import{k as En,s as Ve,h as Pt,i as Ln,I as ir,a as ar,l as lr}from"./BPk16bSc.js";import{H as cn,E as Ws,c as Bs,t as Rt}from"./Bl_iEh1f.js";import{b as on}from"./BaIAhI85.js";import{Hp as Me,eA as Vs,er as Ks,es as js,o7 as qs,mX as Vt,m$ as cr,m_ as In,eu as Gs,u5 as Qs,u6 as Xs,u8 as Ys,FC as Zs,Hu as Js,qH as eo,ez as to}from"./BSwWMzab.js";import{c as no}from"./CZI4_vlI.js";import{F as Ne,a0 as ro,a7 as An,av as dr,aw as ur,bP as so,aN as oo,c9 as hr,bW as gr,cl as fr}from"./DKXEy5Lq.js";import{dl as io,bc as ao,L as lo,aB as mr,h as co}from"./DY6JypjK.js";import{L as pr}from"./BUjtm23k.js";import{C as an}from"./DypB-Dwi.js";import{b5 as kr,bK as uo,bN as ho}from"./CgigepCD.js";import{q as $e,d as go,g as fo}from"./MW8VbTBI.js";import"./DiCMHWTR.js";import{f as ke}from"./C9gP-gRX.js";import{e as mo}from"./-zJqCea3.js";import{T as Pr}from"./CEN0b_5u.js";import{g as Nn}from"./Cop9b2dY.js";import{C as po}from"./BGGxKX5q.js";import{C as vo}from"./Bc-8qHYh.js";import{s as vr}from"./bFhyrNU-.js";import{w as Dt}from"./DO2cS8JO.js";import{P as _o,l as _r}from"./BAUBrw_Q.js";import{g as wo}from"./B6mHy78M.js";import{a2 as bo,S as yo}from"./BOxqCAFj.js";import{ar as So}from"./Cbk0B9g9.js";import{s as wr}from"./yXrfMNAa.js";import{a6 as Co,a5 as xo,a7 as ko}from"./BfREzbFg.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,y=a?l+c*2:b;if(r=Math.max(r,y),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+y,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Ho=[0,1e-6,.99999,1],Lo={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Lo,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Ho,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,y=a+c+p;return!(r<b-l||r>y)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:y}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(y==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let y,A;b<=0?(y=b,A="bottom"):(y=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(y>=0&&(a.fileOffset<0||y<a.fileOffset)||y<0&&a.fileOffset<0&&y>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:y,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=C(r,"change",7),y=C(r,"foldUnchanged",7,!0),A=C(r,"allowHeadReads",7,!0),F=C(r,"canReadHeadFiles",7),G=C(r,"lineWrapping",7,!1),h=C(r,"scrollToLine",7),oe=C(r,"isAggregate",7,!1),Te=C(r,"showScrollHint",7,!1),ue=C(r,"onStageHunk",7),Q=C(r,"onUnstageHunk",7),at=C(r,"onOpenCommit",7),pt=C(r,"virtualizer",7),vt=C(r,"gitRootId",7,void 0),_t=C(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),ye=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(ye,!0)}function De(){m(ye,!1),m(Fe,!1),m(Ue,0)}function He(v){!e(ye)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(ye))&&(m(Fe,!1),m(Ue,0))});let Ht=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:yt,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let St;return Ke==="committed"?St=an.Committed:rt?St=an.Staged:St=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:St,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:yt},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Lt={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return y()},set foldUnchanged(v=!0){y(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},Le=To();let wt;var It=N(Le);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Ht)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return y()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var yt=S(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=S(At);L(Ke),L(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(yt,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(yt=>K(Qe,yt),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}L(Le),on(Le,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(Le,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(Le,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",Le,ie),sn("mouseleave",Le,De),sn("wheel",Le,He),ln("focusin",Le,jt),ln("focusout",Le,qt),w(f,Le);var mn=fn(Lt);return c(),mn}xr(["focusin","focusout"]);function yr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
2
2
  `):[],a=r?r.split(`
3
3
  `):[];if(l.length===0&&a.length===0)return[];const c=[];for(const p of l)c.push({type:"Deletion",content:p});for(const p of a)c.push({type:"Addition",content:p});return[{oldStart:1,oldLines:l.length,newStart:1,newLines:a.length,lines:c}]}function Mo(f){if(!f||f.length===0)return[];const r=[];for(const a of f){let c=a.change.chunks||[];c.length===0&&(a.change.oldContent!=null||a.change.newContent!=null)&&(c=zo(a.change.oldContent??"",a.change.newContent??"")),c.forEach((p,b)=>{r.push({hunk:p,stage:a.category,part:a,hunkIndex:b})})}if(r.length===0)return[];r.sort((a,c)=>a.hunk.newStart-c.hunk.newStart);const l=[];for(const{hunk:a,stage:c,hunkIndex:p}of r){const y=Do(a).map(A=>({type:A.type,content:A.content,oldLineNumber:A.oldLineNumber,newLineNumber:A.newLineNumber,stage:c,hunkIndex:p}));l.push({headStart:a.oldStart,headLines:a.oldLines,wtStart:a.newStart,wtLines:a.newLines,lines:y,stages:new Set([c])})}return $o(l)}function $o(f){if(f.length<=1)return f;const r=[];let l=f[0];for(let a=1;a<f.length;a++){const c=f[a],p=l.wtStart+l.wtLines;c.wtStart<=p+3?l=Fo(l,c):(r.push(l),l=c)}return r.push(l),r}function Fo(f,r){const l=new Map,a=new Map,c=new Set;for(const h of f.lines)c.add(yr(h)),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h);const p=[...f.lines];for(const h of r.lines){const oe=yr(h);if(!c.has(oe)){if(h.type==="Context"){const Te=h.newLineNumber!==void 0?l.get(h.newLineNumber):void 0,ue=h.oldLineNumber!==void 0?a.get(h.oldLineNumber):void 0;if(Te?.type==="Context"||ue?.type==="Context"){c.add(oe);continue}}p.push(h),c.add(oe),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h)}}p.sort((h,oe)=>{const Te=h.newLineNumber??h.oldLineNumber??0,ue=oe.newLineNumber??oe.oldLineNumber??0;return Te-ue});const b=new Set([...f.stages,...r.stages]),y=Math.min(f.headStart,r.headStart),A=Math.min(f.wtStart,r.wtStart),F=Math.max(f.headStart+f.headLines,r.headStart+r.headLines),G=Math.max(f.wtStart+f.wtLines,r.wtStart+r.wtLines);return{headStart:y,headLines:F-y,wtStart:A,wtLines:G-A,lines:p,stages:b}}function Uo(f){const r=[],l=[];let a=f[0]?.headStart??1,c=f[0]?.wtStart??1;const p=(b,y,A)=>{let F=y;for(;F<A;)b.push(""),F++;return F};for(const b of f){a=p(r,a,b.headStart),c=p(l,c,b.wtStart);for(const y of b.lines)y.type==="Context"?(y.oldLineNumber!==void 0&&(a=p(r,a,y.oldLineNumber)),y.newLineNumber!==void 0&&(c=p(l,c,y.newLineNumber)),r.push(y.content),l.push(y.content),a++,c++):y.type==="Deletion"?(y.oldLineNumber!==void 0&&(a=p(r,a,y.oldLineNumber)),r.push(y.content),a++):y.type==="Addition"&&(y.newLineNumber!==void 0&&(c=p(l,c,y.newLineNumber)),l.push(y.content),c++)}return{oldContent:r.join(`
4
4
  `),newContent:l.join(`
@@ -1 +1 @@
1
- import{t as Ye,bq as h,a_ as M,by as Ze,b as $e,bs as nt,bo as k,bu as Xe}from"./BAqR9jtB.js";import{bo as st,bs as et,a7 as V,ay as y,aD as e,bS as L,W as c,a5 as Pe,bA as De,bH as X,bl as _e,b_ as oe,bO as de,bn as tt,bf as je,bV as Ee,aA as v,c9 as w,aB as U,be as it,b$ as lt,bj as dt,cd as ct,ca as He,bk as ut}from"./DYhIMPy1.js";import{i as G}from"./BHqHNrOT.js";import{Hp as Ve,mp as pt,tH as ft}from"./BSwWMzab.js";import{b4 as ht}from"./C80u9j_3.js";import{ck as vt}from"./DY6JypjK.js";import{c as gt}from"./ChTqQfQN.js";import{i as Le,t as Ue}from"./H2jLkRRS.js";import{v as _t}from"./UuiGcpAE.js";import{d as mt}from"./B0Z-1lwJ.js";import{F as Re,av as bt,aw as kt,cQ as Je,aX as qe,be as wt,an as yt,am as At,cN as Ge}from"./DKXEy5Lq.js";import{n as K,w as Ft}from"./Bc-8qHYh.js";import{h as Wt,s as Ne,k as xe,a as Te,d as Ct}from"./BPk16bSc.js";import{s as xt}from"./DiCMHWTR.js";import{f as It,ai as Pt,aX as Dt}from"./C9gP-gRX.js";import"./7ZJvg7ev.js";import{c as Q}from"./B2RRuLl5.js";import{a as Mt,r as Et}from"./D4qqUzAr.js";import{M as Ot,m as Be,t as ze}from"./7IyNIHph.js";import{o as Ke,r as St,q as Rt,R as Nt,p as Tt,n as Bt,j as zt,l as Xt}from"./DO2cS8JO.js";var jt=U('<img alt="" class="size-4"/>'),Ht=U('<span class="min-w-0 flex-1 text-left"><span class="block truncate"> </span> <span class="block text-muted-foreground" aria-hidden="true" data-menu-action-reason=""> </span></span>'),Vt=U("<span> </span>"),Lt=U('<span data-menu-action-detail=""> </span>'),Ut=U('<span aria-hidden="true"><!></span>'),Qe=U("<!> <!> <!>",1),Jt=U('<div class="my-1 h-px bg-border" role="separator"></div>'),Me=U("<!> <!>",1),qt=U('<!> <p data-menu-action-note=""> </p>',1),Gt=U('<span class="flex size-4 shrink-0 items-center justify-center" aria-hidden="true"><!></span> <!> <!>',1),Kt=U('<p data-menu-action-note=""> </p>'),Qt=U('<div class="pl-4"><!> <!></div>'),Yt=U('<span class="sr-only"> </span>');function me(be,d){const ke=st();if(new.target)return Ye({component:me,...be});et(d,!0);const Ie=(p,r=je)=>{var O=V(),S=y(O);{var j=W=>{const x=w(()=>Mt(r().editor));var H=V(),m=y(H);{var f=s=>{var i=jt();oe(()=>Ne(i,"src",`data:image/png;base64,${r().editor.iconBase64??""}`)),c(s,i)},o=s=>{var i=V(),b=y(i);Q(b,()=>e(x),(T,ae)=>{ae(T,{size:16})}),c(s,i)},N=s=>{{let i=w(()=>Et(r().editor.category));Re(s,{get icon(){return e(i)},size:16})}};M(m,s=>{r().editor.iconBase64?s(f):e(x)?s(o,1):s(N,-1)})}c(W,H)},R=W=>{var x=V(),H=y(x);xt(H,()=>r().iconSnippet),c(W,x)},q=W=>{{let x=w(()=>r().variant==="destructive"?"text-current":"text-muted-foreground");Re(W,{get icon(){return r().icon},get weight(){return J()},size:16,get class(){return e(x)}})}};M(S,W=>{r().editor?W(j):r().iconSnippet?W(R,1):r().icon&&W(q,2)})}c(p,O)},ne=(p,r=je)=>{var O=Qe(),S=y(O);{var j=m=>{var f=Ht(),o=Pe(f),N=_e(o,!0);Te(o,(b,T)=>ze?.(b,T),()=>r().label);var s=L(o,2),i=_e(s,!0);De(f),oe(()=>{de(N,r().label),de(i,r().disabledReason)}),c(m,f)},R=m=>{var f=Vt(),o=_e(f,!0);Te(f,(N,s)=>ze?.(N,s),()=>r().label),oe(()=>{xe(f,1,`min-w-0 truncate text-left ${r().detail?"flex-[1_0_auto]":"flex-1"}`),de(o,r().label)}),c(m,f)};M(S,m=>{r().disabledReason?m(j):m(R,-1)})}var q=L(S,2);{var W=m=>{var f=Lt(),o=_e(f,!0);Te(f,(N,s)=>ze?.(N,s),()=>r().detail),oe(()=>{xe(f,1,`ml-4 min-w-0 truncate ${(r().detailTone==="danger"?"text-danger":Be)??""}`),de(o,r().detail)}),c(m,f)};M(q,m=>{r().detail&&m(W)})}var x=L(q,2);{var H=m=>{var f=Ut(),o=Pe(f);Pt(o,{children:(N,s)=>{it();var i=lt();oe(b=>de(i,b),[()=>Dt(r().shortcut)]),c(N,i)},$$slots:{default:!0}}),De(f),oe(()=>xe(f,1,Ct(E()?"ml-4 flex h-lh shrink-0 items-center":"ml-4"))),c(m,f)};M(x,m=>{r().shortcut&&m(H)})}c(p,O)};let we=h(d,"actions",7),E=h(d,"menu",7),J=h(d,"iconWeight",7),u=h(d,"onClose",7),A=h(d,"selection",7),F=Ee(null);function Y(p){p.disabled||p.disabledReason!==void 0||(p.onClick(),u()?.())}var ce={get actions(){return we()},set actions(p){we(p),v()},get menu(){return E()},set menu(p){E(p),v()},get iconWeight(){return J()},set iconWeight(p){J(p),v()},get onClose(){return u()},set onClose(p){u(p),v()},get selection(){return A()},set selection(p){A(p),v()},$set:Ze,$on:(p,r)=>$e(d,p,r)},se=V(),ie=y(se);return Wt(ie,17,we,p=>p.id,(p,r)=>{const O=i=>{Ie(i,()=>e(r))},S=w(()=>!!(e(r).editor||e(r).iconSnippet||e(r).icon)),j=w(()=>e(r).disabled||e(r).disabledReason!==void 0),R=w(()=>e(r).disabledReason?`${ke}-${e(r).id}-reason`:void 0);var q=Qe(),W=y(q);{var x=i=>{var b=V(),T=y(b);{var ae=a=>{var n=V(),g=y(n);Q(g,()=>Ke,(C,P)=>{P(C,{})}),c(a,n)},ue=a=>{var n=Jt();c(a,n)};M(T,a=>{E()?a(ae):a(ue,-1)})}c(i,b)};M(W,i=>{e(r).dividerBefore&&i(x)})}var H=L(W,2);{var m=i=>{var b=V(),T=y(b);{var ae=g=>{var C=V(),P=y(C);Q(P,()=>Tt,(I,D)=>{D(I,{children:(B,Z)=>{var $=Me(),pe=y($);{let te=w(()=>e(S)?O:void 0);Q(pe,()=>St,(fe,he)=>{he(fe,{get leading(){return e(te)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"data-action-id"(){return e(r).id},children:(ve,ye)=>{ne(ve,()=>e(r))},$$slots:{default:!0}})})}var ee=L(pe,2);{let te=w(()=>e(r).note?`${ke}-${e(r).id}-note`:void 0);Q(ee,()=>Rt,(fe,he)=>{he(fe,{class:"w-60",get"aria-describedby"(){return e(te)},children:(ve,ye)=>{var t=Me(),l=y(t);{var _=re=>{var Ae=Me(),Fe=y(Ae);{let Ce=w(()=>e(r).submenu.find(ge=>ge.checked)?.id??"");Q(Fe,()=>Nt,(ge,Se)=>{Se(ge,{get value(){return e(Ce)},get"aria-label"(){return e(r).label},children:(rt,$t)=>{{let at=w(()=>e(r).submenu.filter(ot=>ot.checked!==void 0));me(rt,{get actions(){return e(at)},selection:"single",get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}},$$slots:{default:!0}})})}var We=L(Fe,2);{let Ce=w(()=>e(r).submenu.filter(ge=>ge.checked===void 0));me(We,{get actions(){return e(Ce)},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}c(re,Ae)},z=re=>{me(re,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})};M(l,re=>{e(r).selection==="single"?re(_):re(z,-1)})}var le=L(l,2);{var Oe=re=>{var Ae=qt(),Fe=y(Ae);Q(Fe,()=>Ke,(ge,Se)=>{Se(ge,{})});var We=L(Fe,2),Ce=_e(We,!0);oe(()=>{Ne(We,"id",`${ke}-${e(r).id}-note`),xe(We,1,`type-caption px-2 py-1 ${Be}`),de(Ce,e(r).note)}),c(re,Ae)};M(le,re=>{e(r).note&&re(Oe)})}c(ve,t)},$$slots:{default:!0}})})}c(B,$)},$$slots:{default:!0}})}),c(g,C)},ue=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0);Q(P,()=>Bt,(D,B)=>{B(D,{get leading(){return e(I)},get value(){return e(r).id},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:(Z,$)=>{ne(Z,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},a=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0);Q(P,()=>zt,(D,B)=>{B(D,{get leading(){return e(I)},get checked(){return e(r).checked},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:(Z,$)=>{ne(Z,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},n=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0),D=w(()=>e(r).variant==="destructive");Q(P,()=>Xt,(B,Z)=>{Z(B,{get leading(){return e(I)},get destructive(){return e(D)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:($,pe)=>{ne($,()=>e(r))},$$slots:{default:!0}})})}c(g,C)};M(T,g=>{e(r).submenu?g(ae):A()==="single"&&e(r).checked!==void 0?g(ue,1):e(r).checked!==void 0?g(a,2):g(n,-1)})}c(i,b)},f=i=>{me(i,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})},o=i=>{var b=Me(),T=y(b);{let a=w(()=>e(r).variant==="destructive"?"text-danger hover:text-danger":""),n=w(()=>e(r).submenu?e(F)===e(r).id:void 0);It(T,{variant:"ghost",size:"sm",get class(){return`w-full justify-start gap-2 ${e(a)??""}`},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"aria-expanded"(){return e(n)},onclick:()=>e(r).submenu?X(F,e(F)===e(r).id?null:e(r).id,!0):Y(e(r)),children:(g,C)=>{var P=Gt(),I=y(P),D=Pe(I);Ie(D,()=>e(r)),De(I);var B=L(I,2);ne(B,()=>e(r));var Z=L(B,2);{var $=ee=>{{let te=w(()=>e(F)===e(r).id?bt:kt);Re(ee,{get icon(){return e(te)},size:12})}},pe=ee=>{var te=V(),fe=y(te);{let he=w(()=>e(r).checked?"checked":"empty");Q(fe,()=>Ot,(ve,ye)=>{ye(ve,{get state(){return e(he)}})})}c(ee,te)};M(Z,ee=>{e(r).submenu?ee($):e(r).checked!==void 0&&ee(pe,1)})}c(g,P)},$$slots:{default:!0}})}var ae=L(T,2);{var ue=a=>{var n=Qt(),g=Pe(n);me(g,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}});var C=L(g,2);{var P=I=>{var D=Kt(),B=_e(D,!0);oe(()=>{xe(D,1,`type-caption px-2 py-1 ${Be}`),de(B,e(r).note)}),c(I,D)};M(C,I=>{e(r).note&&I(P)})}De(n),c(a,n)};M(ae,a=>{e(r).submenu&&e(F)===e(r).id&&a(ue)})}c(i,b)};M(H,i=>{E()?i(m):e(r).id==="open-in"&&e(r).submenu?i(f,1):i(o,-1)})}var N=L(H,2);{var s=i=>{var b=Yt(),T=_e(b,!0);oe(()=>{Ne(b,"id",e(R)),de(T,e(r).disabledReason)}),c(i,b)};M(N,i=>{e(r).disabledReason&&i(s)})}c(p,q)}),c(be,se),tt(ce)}function Zt(be,d){if(new.target)return Ye({component:Zt,...be});et(d,!0);const ke=()=>Xe(T,"$installedEditors$",ne),Ie=()=>Xe(ue,"$isWorkspaceHostLocal$",ne),[ne,we]=nt();let E=h(d,"layout",7,"list"),J=h(d,"iconWeight",7),u=h(d,"filePath",7,""),A=h(d,"workspaceId",7,""),F=h(d,"isDirectory",7,!0),Y=h(d,"onDelete",7,void 0),ce=h(d,"onArchive",7,void 0),se=h(d,"onUnarchive",7,void 0),ie=h(d,"isArchived",7,!1),p=h(d,"onClose",7,void 0),r=h(d,"showDeleteOption",7,!0),O=h(d,"showArchiveOption",7,!1),S=h(d,"showPathCopy",7,!0),j=h(d,"showFileNameCopy",7,!1),R=h(d,"showFileActions",7,!0),q=h(d,"workspaceFolderPath",7,""),W=h(d,"isDiff",7,!1),x=h(d,"isWorkspaceRoot",7,!1),H=h(d,"additionalActions",23,()=>[]),m=h(d,"showDeleteFileOption",7,!1),f=h(d,"onFileDeleted",7,void 0);const o=gt("WorkspaceActionsMenu");let N=!1;dt(()=>{N=!0});function s(){N||p()?.()}const i=_t("externalEditors"),b=ct(A());He(()=>{b.set(A())});const T=ht(b),ae=w(ke),ue=vt(b);let a=Ee(""),n=Ee(""),g=Ee(!1);ut(()=>{Ve.dispatch(pt())}),He(()=>{u()&&A()?G("workspace:get",{id:A()}).then(t=>{if(t&&t.success&&t.data){const l=t.data,_=l.worktreePath||l.repositoryPath||l.path,z=q()==="__WORKSPACE_ROOT__"?_:q()||_;if(z){const le=z.replace(/\\/g,"/");x()?X(a,le,!0):Le(u())?X(a,u().replace(/\\/g,"/"),!0):X(a,`${le}/${u()}`.replace(/\/+/g,"/"),!0),X(n,le,!0),o.info("[WorkspaceActionsMenu] Resolved file path:",{filePath:u(),workspacePath:z,resolvedPath:e(a)})}else X(a,u()),X(n,""),l.status!=="archived"&&l.status!=="deleted"&&o.warn("[WorkspaceActionsMenu] No workspace path found:",l)}else X(a,u()),X(n,""),t?.error&&!t.error.includes("not found")&&o.warn("[WorkspaceActionsMenu] Workspace not available:",t)}).catch(t=>{X(a,u()),X(n,""),t?.message?.includes("not found")||o.error("[WorkspaceActionsMenu] Failed to resolve path:",t)}):(X(a,u()),o.info("[WorkspaceActionsMenu] Using filePath directly:",{filePath:u(),workspaceId:A()}))});async function C(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for VSCode");return}try{if(W()&&!F()){o.info("[WorkspaceActionsMenu] Opening diff in VSCode:",{resolvedPath:e(a)}),await G("vscode:open-git-diff",{filePath:e(a),workspacePath:e(n)||void 0}),s();return}let t=e(a);if(e(n))!F()&&!x()?t={folder:e(n),file:e(a)}:t=e(n);else if(!F()){const l=e(a).includes("\\")?"\\":"/",_=e(a).split(l);_.length>1&&(t={folder:_.slice(0,-1).join(l),file:e(a)})}await G("vscode:open",t),s()}catch(t){o.error("Failed to open in VSCode:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"VS Code"}))}}async function P(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for JetBrains");return}try{let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t=e(n)),await G("jetbrains:open",t),s()}catch(t){o.error("Failed to open in JetBrains:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"JetBrains"}))}}async function I(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for Xcode");return}try{if(A()&&e(n)){Ve.dispatch(ft(A(),e(n),F()?void 0:e(a))),s();return}let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t={folder:e(n)}),await G("xcode:open",t),s()}catch(t){o.error("Failed to open in Xcode:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"Xcode"}))}}async function D(t){if(o.info("[WorkspaceActionsMenu] openInEditor called",{editorId:t.id,appName:t.appName,handlerType:t.handlerType,resolvedPath:e(a),isDirectory:F()}),!e(a)){o.warn("[WorkspaceActionsMenu] openInEditor: No resolved path, aborting");return}const l=F()?e(a):e(a).substring(0,e(a).lastIndexOf("/"));o.info(`[WorkspaceActionsMenu] openInEditor: targetPath=${l}, handlerType=${t.handlerType}`);try{switch(t.handlerType){case"finder":o.info("[WorkspaceActionsMenu] openInEditor: Invoking shell:showItemInFolder"),await G("shell:showItemInFolder",{path:l});break;case"vscode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInVSCode"),await C();return;case"jetbrains":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInJetBrains"),await P();return;case"xcode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInXcode"),await I();return;case"generic":default:{o.info(`[WorkspaceActionsMenu] openInEditor: Invoking external-editors:open for ${t.id}`);const _=await G("external-editors:open",{editorId:t.id,path:l});o.info("[WorkspaceActionsMenu] openInEditor: external-editors:open result",_);break}}s()}catch(_){o.error(`[WorkspaceActionsMenu] Failed to open in ${t.appName}:`,_),K.error(_ instanceof Error?_.message:k.ui_workspaceActions_openFailed_error({name:t.appName}))}}async function B(){if(!e(a)){o.warn("No resolved path for openWithOther");return}try{let t=e(a);F()&&e(n)&&(t=e(n));const l=await G("external-editors:open-with-other",{path:t});if(!l?.success){l?.error!=="No application selected"&&(o.error("Failed to open with other app:",l?.error),K.error(l?.error||k.ui_workspaceActions_openOtherFailed_error()));return}s()}catch(t){o.error("Failed to open with other app:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openOtherFailed_error())}}async function Z(){if(e(a))try{await navigator.clipboard.writeText(Ue(e(a))),s()}catch(t){o.error("Failed to copy path:",t)}}async function $(){if(u())try{let t=u().replace(/\\/g,"/");if(Le(u())&&e(n)){const l=e(n).endsWith("/")?e(n):e(n)+"/";t.startsWith(l)&&(t=t.slice(l.length))}await navigator.clipboard.writeText(Ue(t)),s()}catch(t){o.error("Failed to copy workspace path:",t)}}async function pe(){if(u())try{const t=u().split(/[/\\]/).pop()||"";await navigator.clipboard.writeText(t),s()}catch(t){o.error("Failed to copy file name:",t)}}function ee(){Y()&&(Y()(),s())}async function te(){if(!(!A()||!e(a)||e(g))){X(g,!0);try{const t=u().split(/[/\\]/).pop()||"file",l=e(a);let _="";try{_=(await G("file:read",{path:l,workspaceId:A()}))?.data?.content??""}catch{}const z=await G("file:delete",{path:l,workspaceId:A()});if(z?.success){f()?.(),s();const le=K.warning(k.ui_workspaceActions_deletedFile_label({name:t}),Ft({duration:15e3,action:{label:k.ui_workspaceActions_undo_label(),onClick:async()=>{try{await G("file:write",{path:l,content:_,workspaceId:A()}),mt("file:changed",{workspaceId:A(),type:"create",filePath:l}),K.dismiss(le)}catch(Oe){o.error("[WorkspaceActionsMenu] Failed to restore file",Oe),K.error(k.ui_workspaceActions_restoreFileFailed_error())}}}}))}else K.error(k.ui_workspaceActions_deleteFileFailedDetail_error({error:z?.error||k.ui_workspaceActions_unknown_error()}))}catch(t){o.error("[WorkspaceActionsMenu] Error deleting file",t),K.error(k.ui_workspaceActions_deleteFileFailed_error())}finally{X(g,!1)}}}function fe(){ie()&&se()?(se()(),s()):!ie()&&ce()&&(ce()(),s())}const he=w(()=>{const t=[];R()&&(i&&Ie()&&t.push({id:"open-in",label:k.ui_openCombo_openInApp_tooltip(),icon:Je,onClick:()=>{},submenu:[...e(ae).map(_=>({id:`editor:${_.id}`,label:k.ui_workspaceActions_openIn_label({name:_.name}),editor:_,onClick:()=>{D(_)}})),{id:"choose-app",label:k.ui_workspaceActions_chooseApp_label(),icon:Je,onClick:()=>{B()}}]}),S()&&t.push({id:"copy-absolute-path",label:k.ui_workspaceActions_copyAbsolutePath_label(),icon:qe,disabled:!e(a),dividerBefore:t.length>0,onClick:()=>{Z()}}),S()&&!x()&&t.push({id:"copy-relative-path",label:k.ui_workspaceActions_copyRelativePath_label(),icon:qe,disabled:!u(),onClick:()=>{$()}}),j()&&!F()&&t.push({id:"copy-file-name",label:k.ui_workspaceActions_copyFileName_label(),icon:wt,disabled:!u(),onClick:()=>{pe()}}));const l=_=>_.map(z=>({...z,submenu:z.submenu?l(z.submenu):void 0,onClick:()=>{z.onClick(),s()}}));return t.push(...l(H())),O()&&(ce()||se())&&t.push({id:"archive-workspace",label:ie()?k.ui_workspaceActions_unarchiveSpace_label():k.ui_workspaceActions_archiveSpace_label(),icon:ie()?yt:At,dividerBefore:t.length>0,onClick:fe}),r()&&Y()&&t.push({id:"delete-workspace",label:k.ui_workspaceActions_deleteSpace_label(),icon:Ge,variant:"destructive",dividerBefore:t.length>0&&t.at(-1)?.id!=="archive-workspace",onClick:ee}),m()&&!F()&&t.push({id:"delete-file",label:k.ui_workspaceActions_deleteFile_label(),icon:Ge,variant:"destructive",disabled:e(g)||!e(a)||!A(),dividerBefore:t.length>0,onClick:()=>{te()}}),t});var ve={get layout(){return E()},set layout(t="list"){E(t),v()},get iconWeight(){return J()},set iconWeight(t){J(t),v()},get filePath(){return u()},set filePath(t=""){u(t),v()},get workspaceId(){return A()},set workspaceId(t=""){A(t),v()},get isDirectory(){return F()},set isDirectory(t=!0){F(t),v()},get onDelete(){return Y()},set onDelete(t=void 0){Y(t),v()},get onArchive(){return ce()},set onArchive(t=void 0){ce(t),v()},get onUnarchive(){return se()},set onUnarchive(t=void 0){se(t),v()},get isArchived(){return ie()},set isArchived(t=!1){ie(t),v()},get onClose(){return p()},set onClose(t=void 0){p(t),v()},get showDeleteOption(){return r()},set showDeleteOption(t=!0){r(t),v()},get showArchiveOption(){return O()},set showArchiveOption(t=!1){O(t),v()},get showPathCopy(){return S()},set showPathCopy(t=!0){S(t),v()},get showFileNameCopy(){return j()},set showFileNameCopy(t=!1){j(t),v()},get showFileActions(){return R()},set showFileActions(t=!0){R(t),v()},get workspaceFolderPath(){return q()},set workspaceFolderPath(t=""){q(t),v()},get isDiff(){return W()},set isDiff(t=!1){W(t),v()},get isWorkspaceRoot(){return x()},set isWorkspaceRoot(t=!1){x(t),v()},get additionalActions(){return H()},set additionalActions(t=[]){H(t),v()},get showDeleteFileOption(){return m()},set showDeleteFileOption(t=!1){m(t),v()},get onFileDeleted(){return f()},set onFileDeleted(t=void 0){f(t),v()},$set:Ze,$on:(t,l)=>$e(d,t,l)};{let t=w(()=>E()!=="list");me(be,{get actions(){return e(he)},get menu(){return e(t)},get iconWeight(){return J()}})}var ye=tt(ve);return we(),ye}export{Zt as default};
1
+ import{t as Ye,bq as h,a_ as M,by as Ze,b as $e,bs as nt,bo as k,bu as Xe}from"./BAqR9jtB.js";import{bo as st,bs as et,a7 as V,ay as y,aD as e,bS as L,W as c,a5 as Pe,bA as De,bH as X,bl as _e,b_ as oe,bO as de,bn as tt,bf as je,bV as Ee,aA as v,c9 as w,aB as U,be as it,b$ as lt,bj as dt,cd as ct,ca as He,bk as ut}from"./DYhIMPy1.js";import{i as G}from"./BHqHNrOT.js";import{Hp as Ve,mp as pt,tH as ft}from"./BSwWMzab.js";import{b4 as ht}from"./BuUw9ACB.js";import{ck as vt}from"./DY6JypjK.js";import{c as gt}from"./ChTqQfQN.js";import{i as Le,t as Ue}from"./H2jLkRRS.js";import{v as _t}from"./UuiGcpAE.js";import{d as mt}from"./B0Z-1lwJ.js";import{F as Re,av as bt,aw as kt,cQ as Je,aX as qe,be as wt,an as yt,am as At,cN as Ge}from"./DKXEy5Lq.js";import{n as K,w as Ft}from"./Bc-8qHYh.js";import{h as Wt,s as Ne,k as xe,a as Te,d as Ct}from"./BPk16bSc.js";import{s as xt}from"./DiCMHWTR.js";import{f as It,ai as Pt,aX as Dt}from"./C9gP-gRX.js";import"./7ZJvg7ev.js";import{c as Q}from"./B2RRuLl5.js";import{a as Mt,r as Et}from"./DlV2w5MI.js";import{M as Ot,m as Be,t as ze}from"./7IyNIHph.js";import{o as Ke,r as St,q as Rt,R as Nt,p as Tt,n as Bt,j as zt,l as Xt}from"./DO2cS8JO.js";var jt=U('<img alt="" class="size-4"/>'),Ht=U('<span class="min-w-0 flex-1 text-left"><span class="block truncate"> </span> <span class="block text-muted-foreground" aria-hidden="true" data-menu-action-reason=""> </span></span>'),Vt=U("<span> </span>"),Lt=U('<span data-menu-action-detail=""> </span>'),Ut=U('<span aria-hidden="true"><!></span>'),Qe=U("<!> <!> <!>",1),Jt=U('<div class="my-1 h-px bg-border" role="separator"></div>'),Me=U("<!> <!>",1),qt=U('<!> <p data-menu-action-note=""> </p>',1),Gt=U('<span class="flex size-4 shrink-0 items-center justify-center" aria-hidden="true"><!></span> <!> <!>',1),Kt=U('<p data-menu-action-note=""> </p>'),Qt=U('<div class="pl-4"><!> <!></div>'),Yt=U('<span class="sr-only"> </span>');function me(be,d){const ke=st();if(new.target)return Ye({component:me,...be});et(d,!0);const Ie=(p,r=je)=>{var O=V(),S=y(O);{var j=W=>{const x=w(()=>Mt(r().editor));var H=V(),m=y(H);{var f=s=>{var i=jt();oe(()=>Ne(i,"src",`data:image/png;base64,${r().editor.iconBase64??""}`)),c(s,i)},o=s=>{var i=V(),b=y(i);Q(b,()=>e(x),(T,ae)=>{ae(T,{size:16})}),c(s,i)},N=s=>{{let i=w(()=>Et(r().editor.category));Re(s,{get icon(){return e(i)},size:16})}};M(m,s=>{r().editor.iconBase64?s(f):e(x)?s(o,1):s(N,-1)})}c(W,H)},R=W=>{var x=V(),H=y(x);xt(H,()=>r().iconSnippet),c(W,x)},q=W=>{{let x=w(()=>r().variant==="destructive"?"text-current":"text-muted-foreground");Re(W,{get icon(){return r().icon},get weight(){return J()},size:16,get class(){return e(x)}})}};M(S,W=>{r().editor?W(j):r().iconSnippet?W(R,1):r().icon&&W(q,2)})}c(p,O)},ne=(p,r=je)=>{var O=Qe(),S=y(O);{var j=m=>{var f=Ht(),o=Pe(f),N=_e(o,!0);Te(o,(b,T)=>ze?.(b,T),()=>r().label);var s=L(o,2),i=_e(s,!0);De(f),oe(()=>{de(N,r().label),de(i,r().disabledReason)}),c(m,f)},R=m=>{var f=Vt(),o=_e(f,!0);Te(f,(N,s)=>ze?.(N,s),()=>r().label),oe(()=>{xe(f,1,`min-w-0 truncate text-left ${r().detail?"flex-[1_0_auto]":"flex-1"}`),de(o,r().label)}),c(m,f)};M(S,m=>{r().disabledReason?m(j):m(R,-1)})}var q=L(S,2);{var W=m=>{var f=Lt(),o=_e(f,!0);Te(f,(N,s)=>ze?.(N,s),()=>r().detail),oe(()=>{xe(f,1,`ml-4 min-w-0 truncate ${(r().detailTone==="danger"?"text-danger":Be)??""}`),de(o,r().detail)}),c(m,f)};M(q,m=>{r().detail&&m(W)})}var x=L(q,2);{var H=m=>{var f=Ut(),o=Pe(f);Pt(o,{children:(N,s)=>{it();var i=lt();oe(b=>de(i,b),[()=>Dt(r().shortcut)]),c(N,i)},$$slots:{default:!0}}),De(f),oe(()=>xe(f,1,Ct(E()?"ml-4 flex h-lh shrink-0 items-center":"ml-4"))),c(m,f)};M(x,m=>{r().shortcut&&m(H)})}c(p,O)};let we=h(d,"actions",7),E=h(d,"menu",7),J=h(d,"iconWeight",7),u=h(d,"onClose",7),A=h(d,"selection",7),F=Ee(null);function Y(p){p.disabled||p.disabledReason!==void 0||(p.onClick(),u()?.())}var ce={get actions(){return we()},set actions(p){we(p),v()},get menu(){return E()},set menu(p){E(p),v()},get iconWeight(){return J()},set iconWeight(p){J(p),v()},get onClose(){return u()},set onClose(p){u(p),v()},get selection(){return A()},set selection(p){A(p),v()},$set:Ze,$on:(p,r)=>$e(d,p,r)},se=V(),ie=y(se);return Wt(ie,17,we,p=>p.id,(p,r)=>{const O=i=>{Ie(i,()=>e(r))},S=w(()=>!!(e(r).editor||e(r).iconSnippet||e(r).icon)),j=w(()=>e(r).disabled||e(r).disabledReason!==void 0),R=w(()=>e(r).disabledReason?`${ke}-${e(r).id}-reason`:void 0);var q=Qe(),W=y(q);{var x=i=>{var b=V(),T=y(b);{var ae=a=>{var n=V(),g=y(n);Q(g,()=>Ke,(C,P)=>{P(C,{})}),c(a,n)},ue=a=>{var n=Jt();c(a,n)};M(T,a=>{E()?a(ae):a(ue,-1)})}c(i,b)};M(W,i=>{e(r).dividerBefore&&i(x)})}var H=L(W,2);{var m=i=>{var b=V(),T=y(b);{var ae=g=>{var C=V(),P=y(C);Q(P,()=>Tt,(I,D)=>{D(I,{children:(B,Z)=>{var $=Me(),pe=y($);{let te=w(()=>e(S)?O:void 0);Q(pe,()=>St,(fe,he)=>{he(fe,{get leading(){return e(te)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"data-action-id"(){return e(r).id},children:(ve,ye)=>{ne(ve,()=>e(r))},$$slots:{default:!0}})})}var ee=L(pe,2);{let te=w(()=>e(r).note?`${ke}-${e(r).id}-note`:void 0);Q(ee,()=>Rt,(fe,he)=>{he(fe,{class:"w-60",get"aria-describedby"(){return e(te)},children:(ve,ye)=>{var t=Me(),l=y(t);{var _=re=>{var Ae=Me(),Fe=y(Ae);{let Ce=w(()=>e(r).submenu.find(ge=>ge.checked)?.id??"");Q(Fe,()=>Nt,(ge,Se)=>{Se(ge,{get value(){return e(Ce)},get"aria-label"(){return e(r).label},children:(rt,$t)=>{{let at=w(()=>e(r).submenu.filter(ot=>ot.checked!==void 0));me(rt,{get actions(){return e(at)},selection:"single",get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}},$$slots:{default:!0}})})}var We=L(Fe,2);{let Ce=w(()=>e(r).submenu.filter(ge=>ge.checked===void 0));me(We,{get actions(){return e(Ce)},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}c(re,Ae)},z=re=>{me(re,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})};M(l,re=>{e(r).selection==="single"?re(_):re(z,-1)})}var le=L(l,2);{var Oe=re=>{var Ae=qt(),Fe=y(Ae);Q(Fe,()=>Ke,(ge,Se)=>{Se(ge,{})});var We=L(Fe,2),Ce=_e(We,!0);oe(()=>{Ne(We,"id",`${ke}-${e(r).id}-note`),xe(We,1,`type-caption px-2 py-1 ${Be}`),de(Ce,e(r).note)}),c(re,Ae)};M(le,re=>{e(r).note&&re(Oe)})}c(ve,t)},$$slots:{default:!0}})})}c(B,$)},$$slots:{default:!0}})}),c(g,C)},ue=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0);Q(P,()=>Bt,(D,B)=>{B(D,{get leading(){return e(I)},get value(){return e(r).id},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:(Z,$)=>{ne(Z,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},a=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0);Q(P,()=>zt,(D,B)=>{B(D,{get leading(){return e(I)},get checked(){return e(r).checked},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:(Z,$)=>{ne(Z,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},n=g=>{var C=V(),P=y(C);{let I=w(()=>e(S)?O:void 0),D=w(()=>e(r).variant==="destructive");Q(P,()=>Xt,(B,Z)=>{Z(B,{get leading(){return e(I)},get destructive(){return e(D)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},onSelect:()=>Y(e(r)),get"data-action-id"(){return e(r).id},children:($,pe)=>{ne($,()=>e(r))},$$slots:{default:!0}})})}c(g,C)};M(T,g=>{e(r).submenu?g(ae):A()==="single"&&e(r).checked!==void 0?g(ue,1):e(r).checked!==void 0?g(a,2):g(n,-1)})}c(i,b)},f=i=>{me(i,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})},o=i=>{var b=Me(),T=y(b);{let a=w(()=>e(r).variant==="destructive"?"text-danger hover:text-danger":""),n=w(()=>e(r).submenu?e(F)===e(r).id:void 0);It(T,{variant:"ghost",size:"sm",get class(){return`w-full justify-start gap-2 ${e(a)??""}`},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"aria-expanded"(){return e(n)},onclick:()=>e(r).submenu?X(F,e(F)===e(r).id?null:e(r).id,!0):Y(e(r)),children:(g,C)=>{var P=Gt(),I=y(P),D=Pe(I);Ie(D,()=>e(r)),De(I);var B=L(I,2);ne(B,()=>e(r));var Z=L(B,2);{var $=ee=>{{let te=w(()=>e(F)===e(r).id?bt:kt);Re(ee,{get icon(){return e(te)},size:12})}},pe=ee=>{var te=V(),fe=y(te);{let he=w(()=>e(r).checked?"checked":"empty");Q(fe,()=>Ot,(ve,ye)=>{ye(ve,{get state(){return e(he)}})})}c(ee,te)};M(Z,ee=>{e(r).submenu?ee($):e(r).checked!==void 0&&ee(pe,1)})}c(g,P)},$$slots:{default:!0}})}var ae=L(T,2);{var ue=a=>{var n=Qt(),g=Pe(n);me(g,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}});var C=L(g,2);{var P=I=>{var D=Kt(),B=_e(D,!0);oe(()=>{xe(D,1,`type-caption px-2 py-1 ${Be}`),de(B,e(r).note)}),c(I,D)};M(C,I=>{e(r).note&&I(P)})}De(n),c(a,n)};M(ae,a=>{e(r).submenu&&e(F)===e(r).id&&a(ue)})}c(i,b)};M(H,i=>{E()?i(m):e(r).id==="open-in"&&e(r).submenu?i(f,1):i(o,-1)})}var N=L(H,2);{var s=i=>{var b=Yt(),T=_e(b,!0);oe(()=>{Ne(b,"id",e(R)),de(T,e(r).disabledReason)}),c(i,b)};M(N,i=>{e(r).disabledReason&&i(s)})}c(p,q)}),c(be,se),tt(ce)}function Zt(be,d){if(new.target)return Ye({component:Zt,...be});et(d,!0);const ke=()=>Xe(T,"$installedEditors$",ne),Ie=()=>Xe(ue,"$isWorkspaceHostLocal$",ne),[ne,we]=nt();let E=h(d,"layout",7,"list"),J=h(d,"iconWeight",7),u=h(d,"filePath",7,""),A=h(d,"workspaceId",7,""),F=h(d,"isDirectory",7,!0),Y=h(d,"onDelete",7,void 0),ce=h(d,"onArchive",7,void 0),se=h(d,"onUnarchive",7,void 0),ie=h(d,"isArchived",7,!1),p=h(d,"onClose",7,void 0),r=h(d,"showDeleteOption",7,!0),O=h(d,"showArchiveOption",7,!1),S=h(d,"showPathCopy",7,!0),j=h(d,"showFileNameCopy",7,!1),R=h(d,"showFileActions",7,!0),q=h(d,"workspaceFolderPath",7,""),W=h(d,"isDiff",7,!1),x=h(d,"isWorkspaceRoot",7,!1),H=h(d,"additionalActions",23,()=>[]),m=h(d,"showDeleteFileOption",7,!1),f=h(d,"onFileDeleted",7,void 0);const o=gt("WorkspaceActionsMenu");let N=!1;dt(()=>{N=!0});function s(){N||p()?.()}const i=_t("externalEditors"),b=ct(A());He(()=>{b.set(A())});const T=ht(b),ae=w(ke),ue=vt(b);let a=Ee(""),n=Ee(""),g=Ee(!1);ut(()=>{Ve.dispatch(pt())}),He(()=>{u()&&A()?G("workspace:get",{id:A()}).then(t=>{if(t&&t.success&&t.data){const l=t.data,_=l.worktreePath||l.repositoryPath||l.path,z=q()==="__WORKSPACE_ROOT__"?_:q()||_;if(z){const le=z.replace(/\\/g,"/");x()?X(a,le,!0):Le(u())?X(a,u().replace(/\\/g,"/"),!0):X(a,`${le}/${u()}`.replace(/\/+/g,"/"),!0),X(n,le,!0),o.info("[WorkspaceActionsMenu] Resolved file path:",{filePath:u(),workspacePath:z,resolvedPath:e(a)})}else X(a,u()),X(n,""),l.status!=="archived"&&l.status!=="deleted"&&o.warn("[WorkspaceActionsMenu] No workspace path found:",l)}else X(a,u()),X(n,""),t?.error&&!t.error.includes("not found")&&o.warn("[WorkspaceActionsMenu] Workspace not available:",t)}).catch(t=>{X(a,u()),X(n,""),t?.message?.includes("not found")||o.error("[WorkspaceActionsMenu] Failed to resolve path:",t)}):(X(a,u()),o.info("[WorkspaceActionsMenu] Using filePath directly:",{filePath:u(),workspaceId:A()}))});async function C(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for VSCode");return}try{if(W()&&!F()){o.info("[WorkspaceActionsMenu] Opening diff in VSCode:",{resolvedPath:e(a)}),await G("vscode:open-git-diff",{filePath:e(a),workspacePath:e(n)||void 0}),s();return}let t=e(a);if(e(n))!F()&&!x()?t={folder:e(n),file:e(a)}:t=e(n);else if(!F()){const l=e(a).includes("\\")?"\\":"/",_=e(a).split(l);_.length>1&&(t={folder:_.slice(0,-1).join(l),file:e(a)})}await G("vscode:open",t),s()}catch(t){o.error("Failed to open in VSCode:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"VS Code"}))}}async function P(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for JetBrains");return}try{let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t=e(n)),await G("jetbrains:open",t),s()}catch(t){o.error("Failed to open in JetBrains:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"JetBrains"}))}}async function I(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for Xcode");return}try{if(A()&&e(n)){Ve.dispatch(ft(A(),e(n),F()?void 0:e(a))),s();return}let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t={folder:e(n)}),await G("xcode:open",t),s()}catch(t){o.error("Failed to open in Xcode:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openFailed_error({name:"Xcode"}))}}async function D(t){if(o.info("[WorkspaceActionsMenu] openInEditor called",{editorId:t.id,appName:t.appName,handlerType:t.handlerType,resolvedPath:e(a),isDirectory:F()}),!e(a)){o.warn("[WorkspaceActionsMenu] openInEditor: No resolved path, aborting");return}const l=F()?e(a):e(a).substring(0,e(a).lastIndexOf("/"));o.info(`[WorkspaceActionsMenu] openInEditor: targetPath=${l}, handlerType=${t.handlerType}`);try{switch(t.handlerType){case"finder":o.info("[WorkspaceActionsMenu] openInEditor: Invoking shell:showItemInFolder"),await G("shell:showItemInFolder",{path:l});break;case"vscode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInVSCode"),await C();return;case"jetbrains":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInJetBrains"),await P();return;case"xcode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInXcode"),await I();return;case"generic":default:{o.info(`[WorkspaceActionsMenu] openInEditor: Invoking external-editors:open for ${t.id}`);const _=await G("external-editors:open",{editorId:t.id,path:l});o.info("[WorkspaceActionsMenu] openInEditor: external-editors:open result",_);break}}s()}catch(_){o.error(`[WorkspaceActionsMenu] Failed to open in ${t.appName}:`,_),K.error(_ instanceof Error?_.message:k.ui_workspaceActions_openFailed_error({name:t.appName}))}}async function B(){if(!e(a)){o.warn("No resolved path for openWithOther");return}try{let t=e(a);F()&&e(n)&&(t=e(n));const l=await G("external-editors:open-with-other",{path:t});if(!l?.success){l?.error!=="No application selected"&&(o.error("Failed to open with other app:",l?.error),K.error(l?.error||k.ui_workspaceActions_openOtherFailed_error()));return}s()}catch(t){o.error("Failed to open with other app:",t),K.error(t instanceof Error?t.message:k.ui_workspaceActions_openOtherFailed_error())}}async function Z(){if(e(a))try{await navigator.clipboard.writeText(Ue(e(a))),s()}catch(t){o.error("Failed to copy path:",t)}}async function $(){if(u())try{let t=u().replace(/\\/g,"/");if(Le(u())&&e(n)){const l=e(n).endsWith("/")?e(n):e(n)+"/";t.startsWith(l)&&(t=t.slice(l.length))}await navigator.clipboard.writeText(Ue(t)),s()}catch(t){o.error("Failed to copy workspace path:",t)}}async function pe(){if(u())try{const t=u().split(/[/\\]/).pop()||"";await navigator.clipboard.writeText(t),s()}catch(t){o.error("Failed to copy file name:",t)}}function ee(){Y()&&(Y()(),s())}async function te(){if(!(!A()||!e(a)||e(g))){X(g,!0);try{const t=u().split(/[/\\]/).pop()||"file",l=e(a);let _="";try{_=(await G("file:read",{path:l,workspaceId:A()}))?.data?.content??""}catch{}const z=await G("file:delete",{path:l,workspaceId:A()});if(z?.success){f()?.(),s();const le=K.warning(k.ui_workspaceActions_deletedFile_label({name:t}),Ft({duration:15e3,action:{label:k.ui_workspaceActions_undo_label(),onClick:async()=>{try{await G("file:write",{path:l,content:_,workspaceId:A()}),mt("file:changed",{workspaceId:A(),type:"create",filePath:l}),K.dismiss(le)}catch(Oe){o.error("[WorkspaceActionsMenu] Failed to restore file",Oe),K.error(k.ui_workspaceActions_restoreFileFailed_error())}}}}))}else K.error(k.ui_workspaceActions_deleteFileFailedDetail_error({error:z?.error||k.ui_workspaceActions_unknown_error()}))}catch(t){o.error("[WorkspaceActionsMenu] Error deleting file",t),K.error(k.ui_workspaceActions_deleteFileFailed_error())}finally{X(g,!1)}}}function fe(){ie()&&se()?(se()(),s()):!ie()&&ce()&&(ce()(),s())}const he=w(()=>{const t=[];R()&&(i&&Ie()&&t.push({id:"open-in",label:k.ui_openCombo_openInApp_tooltip(),icon:Je,onClick:()=>{},submenu:[...e(ae).map(_=>({id:`editor:${_.id}`,label:k.ui_workspaceActions_openIn_label({name:_.name}),editor:_,onClick:()=>{D(_)}})),{id:"choose-app",label:k.ui_workspaceActions_chooseApp_label(),icon:Je,onClick:()=>{B()}}]}),S()&&t.push({id:"copy-absolute-path",label:k.ui_workspaceActions_copyAbsolutePath_label(),icon:qe,disabled:!e(a),dividerBefore:t.length>0,onClick:()=>{Z()}}),S()&&!x()&&t.push({id:"copy-relative-path",label:k.ui_workspaceActions_copyRelativePath_label(),icon:qe,disabled:!u(),onClick:()=>{$()}}),j()&&!F()&&t.push({id:"copy-file-name",label:k.ui_workspaceActions_copyFileName_label(),icon:wt,disabled:!u(),onClick:()=>{pe()}}));const l=_=>_.map(z=>({...z,submenu:z.submenu?l(z.submenu):void 0,onClick:()=>{z.onClick(),s()}}));return t.push(...l(H())),O()&&(ce()||se())&&t.push({id:"archive-workspace",label:ie()?k.ui_workspaceActions_unarchiveSpace_label():k.ui_workspaceActions_archiveSpace_label(),icon:ie()?yt:At,dividerBefore:t.length>0,onClick:fe}),r()&&Y()&&t.push({id:"delete-workspace",label:k.ui_workspaceActions_deleteSpace_label(),icon:Ge,variant:"destructive",dividerBefore:t.length>0&&t.at(-1)?.id!=="archive-workspace",onClick:ee}),m()&&!F()&&t.push({id:"delete-file",label:k.ui_workspaceActions_deleteFile_label(),icon:Ge,variant:"destructive",disabled:e(g)||!e(a)||!A(),dividerBefore:t.length>0,onClick:()=>{te()}}),t});var ve={get layout(){return E()},set layout(t="list"){E(t),v()},get iconWeight(){return J()},set iconWeight(t){J(t),v()},get filePath(){return u()},set filePath(t=""){u(t),v()},get workspaceId(){return A()},set workspaceId(t=""){A(t),v()},get isDirectory(){return F()},set isDirectory(t=!0){F(t),v()},get onDelete(){return Y()},set onDelete(t=void 0){Y(t),v()},get onArchive(){return ce()},set onArchive(t=void 0){ce(t),v()},get onUnarchive(){return se()},set onUnarchive(t=void 0){se(t),v()},get isArchived(){return ie()},set isArchived(t=!1){ie(t),v()},get onClose(){return p()},set onClose(t=void 0){p(t),v()},get showDeleteOption(){return r()},set showDeleteOption(t=!0){r(t),v()},get showArchiveOption(){return O()},set showArchiveOption(t=!1){O(t),v()},get showPathCopy(){return S()},set showPathCopy(t=!0){S(t),v()},get showFileNameCopy(){return j()},set showFileNameCopy(t=!1){j(t),v()},get showFileActions(){return R()},set showFileActions(t=!0){R(t),v()},get workspaceFolderPath(){return q()},set workspaceFolderPath(t=""){q(t),v()},get isDiff(){return W()},set isDiff(t=!1){W(t),v()},get isWorkspaceRoot(){return x()},set isWorkspaceRoot(t=!1){x(t),v()},get additionalActions(){return H()},set additionalActions(t=[]){H(t),v()},get showDeleteFileOption(){return m()},set showDeleteFileOption(t=!1){m(t),v()},get onFileDeleted(){return f()},set onFileDeleted(t=void 0){f(t),v()},$set:Ze,$on:(t,l)=>$e(d,t,l)};{let t=w(()=>E()!=="list");me(be,{get actions(){return e(he)},get menu(){return e(t)},get iconWeight(){return J()}})}var ye=tt(ve);return we(),ye}export{Zt as default};