@rohansguliani/mux-chat-ui 0.4.0 → 0.4.1

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 (106) hide show
  1. package/kit/THIRD_PARTY_NOTICES.txt +1 -1
  2. package/kit/build.json +1 -1
  3. package/kit/chunks/{abnfDiagram-VCTEODGH-Ekbmv6AY.js → abnfDiagram-VCTEODGH-aawkrAj6.js} +1 -1
  4. package/kit/chunks/{app-chat-kit-CmncbKE7.js → app-chat-kit-C-b6Y63T.js} +169 -169
  5. package/kit/chunks/{arc-CTvemvxA.js → arc-EbFzNw_R.js} +1 -1
  6. package/kit/chunks/architecture-7GRP2DOG-DmopnJBM.js +1 -0
  7. package/kit/chunks/{architectureDiagram-5GKGNRK7-Dfo6x88c.js → architectureDiagram-5GKGNRK7-CD3tEssA.js} +1 -1
  8. package/kit/chunks/{blockDiagram-NRAW4CY4-BREhUg_n.js → blockDiagram-NRAW4CY4-7QgFd2Hk.js} +1 -1
  9. package/kit/chunks/{c4Diagram-UCG6FXSJ-CAoiRqwq.js → c4Diagram-UCG6FXSJ-DYRJHmaW.js} +1 -1
  10. package/kit/chunks/channel-8d3EytTd.js +1 -0
  11. package/kit/chunks/{chunk-2Q5K7J3B-Dfj9NWMK.js → chunk-2Q5K7J3B-C7CILgFW.js} +1 -1
  12. package/kit/chunks/{chunk-5VM5RSS4-DDPHEz3o.js → chunk-5VM5RSS4-DU4ynm4i.js} +1 -1
  13. package/kit/chunks/{chunk-F27PBJKO-DjjkcfXV.js → chunk-F27PBJKO-Cpr4cHiy.js} +1 -1
  14. package/kit/chunks/{chunk-G27WJ6UU-BbKnleUj.js → chunk-G27WJ6UU-CFgs87kn.js} +1 -1
  15. package/kit/chunks/{chunk-JWPE2WC7-CTyE03Ky.js → chunk-JWPE2WC7-Cqwb9v7c.js} +1 -1
  16. package/kit/chunks/{chunk-LCL6LL3I-DLCIPv63.js → chunk-LCL6LL3I-fUhgnbF1.js} +1 -1
  17. package/kit/chunks/{chunk-POPQ4Y6H-vHDe0Ab2.js → chunk-POPQ4Y6H-BMqiEt5Y.js} +1 -1
  18. package/kit/chunks/{chunk-RHFEMEQ7-MYjE_XE-.js → chunk-RHFEMEQ7-UtGL3UWT.js} +1 -1
  19. package/kit/chunks/{chunk-SVP7TREG-B-Z53M0l.js → chunk-SVP7TREG-BNzLngWc.js} +1 -1
  20. package/kit/chunks/{chunk-XXDRQBXY-Byur0hqD.js → chunk-XXDRQBXY--cnGrVD8.js} +1 -1
  21. package/kit/chunks/classDiagram-DTDB5LWJ-Drr-kJqf.js +1 -0
  22. package/kit/chunks/classDiagram-v2-JRS7N3AN-Drr-kJqf.js +1 -0
  23. package/kit/chunks/{cose-bilkent-JH36ORCC-BJBTUpzs.js → cose-bilkent-JH36ORCC-BMartBdb.js} +1 -1
  24. package/kit/chunks/cynefin-OW5HDTMX-DkJ1CWpZ.js +1 -0
  25. package/kit/chunks/{cynefinDiagram-5FMLGOSQ-C_H0NP3V.js → cynefinDiagram-5FMLGOSQ-CUB7w3gK.js} +1 -1
  26. package/kit/chunks/{dagre-3AP2YEHR-B40iBpXe.js → dagre-3AP2YEHR-DwfEgec4.js} +1 -1
  27. package/kit/chunks/{diagram-S7CK7UJ4-B2xIXmUw.js → diagram-S7CK7UJ4-C2_pdRvt.js} +1 -1
  28. package/kit/chunks/{diagram-UQ7AKVKN-DLWlOhvf.js → diagram-UQ7AKVKN-BeOC94i9.js} +1 -1
  29. package/kit/chunks/{diagram-VSXAHHWV-CtxWAwpJ.js → diagram-VSXAHHWV-BJqiCb3J.js} +1 -1
  30. package/kit/chunks/{diagram-VX7I27RA-C0oOsr2R.js → diagram-VX7I27RA-B1ePQWjM.js} +1 -1
  31. package/kit/chunks/{diagram-Z3DM3KII-DguGhB-N.js → diagram-Z3DM3KII-4O4kGxOa.js} +1 -1
  32. package/kit/chunks/{ebnfDiagram-PWID7BFC-CM2jytSc.js → ebnfDiagram-PWID7BFC-BsMWVAzY.js} +1 -1
  33. package/kit/chunks/{engine-compile-BrcillB_.js → engine-compile-BDQHc296.js} +1 -1
  34. package/kit/chunks/{erDiagram-SSCWMZ5O-6AVzexk8.js → erDiagram-SSCWMZ5O-BeGs3Qlf.js} +1 -1
  35. package/kit/chunks/eventmodeling-NTZA5JFV-hzlNNDk-.js +1 -0
  36. package/kit/chunks/{file-p1zS5m55.js → file-BlRQDOFP.js} +2 -2
  37. package/kit/chunks/flowDiagram-A5DVABFB-CT-HpJwj.js +1 -0
  38. package/kit/chunks/{ganttDiagram-EL5Y4UJY-CV7SNBW7.js → ganttDiagram-EL5Y4UJY-Butg8izl.js} +1 -1
  39. package/kit/chunks/gitGraph-4MIJSDKK-4Akf2-by.js +1 -0
  40. package/kit/chunks/{gitGraphDiagram-WWUBYQGX-BCHc9w_M.js → gitGraphDiagram-WWUBYQGX-Djca0Wx-.js} +1 -1
  41. package/kit/chunks/{index-CzdAxbXm.js → index-DxjmYPLk.js} +1 -1
  42. package/kit/chunks/{index-D-Q6ihx1.js → index-iAF0Rn9U.js} +1 -1
  43. package/kit/chunks/info-A6RAGUB7-BuP6VBwF.js +1 -0
  44. package/kit/chunks/{infoDiagram-RXCK75RN-DkViDaAy.js → infoDiagram-RXCK75RN-BAOb8l5A.js} +1 -1
  45. package/kit/chunks/{ishikawaDiagram-5VMMS53U-DxEqVVmG.js → ishikawaDiagram-5VMMS53U-8KBwqPWi.js} +1 -1
  46. package/kit/chunks/{journeyDiagram-EYS64GPL-C6PuEAZM.js → journeyDiagram-EYS64GPL-CawYPIQT.js} +1 -1
  47. package/kit/chunks/{kanban-definition-3QL26DDD-DOTf6YFB.js → kanban-definition-3QL26DDD-Dg_lCGBT.js} +1 -1
  48. package/kit/chunks/{layout-CdSidOqg.js → layout-BM8wHG6o.js} +1 -1
  49. package/kit/chunks/{linear-2B_RRiLc.js → linear-DKhl7N6S.js} +1 -1
  50. package/kit/chunks/{markdown-PrvsCtkO.js → markdown-BDO0KNsJ.js} +2 -2
  51. package/kit/chunks/{markdown-code-BP4ED3mK.js → markdown-code-BTfpGmJj.js} +1 -1
  52. package/kit/chunks/{markdown-mermaid-C7inlIvD.js → markdown-mermaid-BHDm-Eop.js} +1 -1
  53. package/kit/chunks/{marked-parser-ucXGUtxA.js → marked-parser-CQPg9t-F.js} +1 -1
  54. package/kit/chunks/{mermaid-parser.core-mF5sU-Xg.js → mermaid-parser.core-D9Cspzql.js} +2 -2
  55. package/kit/chunks/{mermaid.core-xKeJvOaV.js → mermaid.core-CfB36ohx.js} +4 -4
  56. package/kit/chunks/{mindmap-definition-FBJOCRG2-YJlqhJDe.js → mindmap-definition-FBJOCRG2-BRIAXAUl.js} +1 -1
  57. package/kit/chunks/packet-AYTQ26CC-DvkOaLgE.js +1 -0
  58. package/kit/chunks/{pegDiagram-XKGWAZYB-C4MT3RNK.js → pegDiagram-XKGWAZYB-D6wSK_Nz.js} +1 -1
  59. package/kit/chunks/pie-WAS4IAKB-B3LaxjZ1.js +1 -0
  60. package/kit/chunks/{pieDiagram-E7YTZNPT-Hm0WPgzn.js → pieDiagram-E7YTZNPT-Ch_-MJ_P.js} +1 -1
  61. package/kit/chunks/{quadrantDiagram-AXDQQJYC-BZTp7tGN.js → quadrantDiagram-AXDQQJYC-D76oyHLE.js} +1 -1
  62. package/kit/chunks/radar-RG4KPBEZ-Dt_kds5L.js +1 -0
  63. package/kit/chunks/railroad-74A4TZTK-DScav3I9.js +1 -0
  64. package/kit/chunks/railroad-abnf-HS5TGJTU-DKC5Sh7O.js +1 -0
  65. package/kit/chunks/railroad-ebnf-LZEXJU2U-DWLFQZkd.js +1 -0
  66. package/kit/chunks/railroad-peg-WCYAUIDC-CmBlOEo4.js +1 -0
  67. package/kit/chunks/{railroadDiagram-O6MQD6OU-Cslq_ZZh.js → railroadDiagram-O6MQD6OU-CHtdMlPY.js} +1 -1
  68. package/kit/chunks/{requirementDiagram-EFPCY7ZU-CvFiO4QY.js → requirementDiagram-EFPCY7ZU-l6gDxxdV.js} +1 -1
  69. package/kit/chunks/{sankeyDiagram-P5KCCOFB-Da1DpNmD.js → sankeyDiagram-P5KCCOFB-CjZ3Uu0e.js} +1 -1
  70. package/kit/chunks/{sequenceDiagram-WJ2MYXX4-DxoNyZwj.js → sequenceDiagram-WJ2MYXX4-BRuNs18X.js} +1 -1
  71. package/kit/chunks/{sizeCapture-X5ZJPWSS-BYc4ks_u.js → sizeCapture-X5ZJPWSS-Ckw-xvdD.js} +1 -1
  72. package/kit/chunks/{stateDiagram-HBIQ2CUA-pcNSv_wf.js → stateDiagram-HBIQ2CUA-BAMlzlwn.js} +1 -1
  73. package/kit/chunks/stateDiagram-v2-4QOOHH4V-e0gHn4zn.js +1 -0
  74. package/kit/chunks/{swimlanes-XN3QIQJK-D7wXTch1.js → swimlanes-XN3QIQJK-Dr5fJdVS.js} +1 -1
  75. package/kit/chunks/swimlanesDiagram-VK2B7HYN-DK9V99PO.js +8 -0
  76. package/kit/chunks/{timeline-definition-24CTP7MA-BrPc1tMu.js → timeline-definition-24CTP7MA-DmDeY1TU.js} +1 -1
  77. package/kit/chunks/treeView-Q6P3EWNA-CR7EEU-W.js +1 -0
  78. package/kit/chunks/treemap-WGGIJYW6-dsO-ECH3.js +1 -0
  79. package/kit/chunks/{vennDiagram-4TSXK5OY-CMfntOoF.js → vennDiagram-4TSXK5OY-DhRpgnfs.js} +1 -1
  80. package/kit/chunks/wardley-WFR3VGLG-Cg8qdR8L.js +1 -0
  81. package/kit/chunks/{wardleyDiagram-VM6X3IG4-C9foyd_h.js → wardleyDiagram-VM6X3IG4-BgbweIse.js} +1 -1
  82. package/kit/chunks/{xychartDiagram-S5SC5T6Z-Bp0MWYj-.js → xychartDiagram-S5SC5T6Z-CQWNrkBN.js} +1 -1
  83. package/kit/index.js +1 -1
  84. package/kit/mux-build.json +1 -1
  85. package/package.json +8 -3
  86. package/kit/chunks/architecture-7GRP2DOG-Ek37_97Z.js +0 -1
  87. package/kit/chunks/channel-BCuymVz7.js +0 -1
  88. package/kit/chunks/classDiagram-DTDB5LWJ-RWAJ513G.js +0 -1
  89. package/kit/chunks/classDiagram-v2-JRS7N3AN-RWAJ513G.js +0 -1
  90. package/kit/chunks/cynefin-OW5HDTMX-DximYq9_.js +0 -1
  91. package/kit/chunks/eventmodeling-NTZA5JFV-i5VApXqj.js +0 -1
  92. package/kit/chunks/flowDiagram-A5DVABFB-BXMY48By.js +0 -1
  93. package/kit/chunks/gitGraph-4MIJSDKK-J1V9VTkA.js +0 -1
  94. package/kit/chunks/info-A6RAGUB7-Df1RDY9x.js +0 -1
  95. package/kit/chunks/packet-AYTQ26CC-BVWhELL0.js +0 -1
  96. package/kit/chunks/pie-WAS4IAKB-DOImHQUJ.js +0 -1
  97. package/kit/chunks/radar-RG4KPBEZ-KbpEH3G6.js +0 -1
  98. package/kit/chunks/railroad-74A4TZTK-Cy0CCThT.js +0 -1
  99. package/kit/chunks/railroad-abnf-HS5TGJTU-CvknKf9w.js +0 -1
  100. package/kit/chunks/railroad-ebnf-LZEXJU2U-DPsJAhot.js +0 -1
  101. package/kit/chunks/railroad-peg-WCYAUIDC-CAZC7-ro.js +0 -1
  102. package/kit/chunks/stateDiagram-v2-4QOOHH4V-BdB1HxLL.js +0 -1
  103. package/kit/chunks/swimlanesDiagram-VK2B7HYN-BmYbYnek.js +0 -8
  104. package/kit/chunks/treeView-Q6P3EWNA-hcKZ8Aqa.js +0 -1
  105. package/kit/chunks/treemap-WGGIJYW6-VledEerh.js +0 -1
  106. package/kit/chunks/wardley-WFR3VGLG-Bx5FYIM5.js +0 -1
@@ -1 +1 @@
1
- import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Ze,c0 as Un,c1 as Qe,c2 as Wn,c3 as qn,aa as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core-xKeJvOaV.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Zn=/^[-+]0x[0-9a-f]+$/i,Qn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Qn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Zn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function q(e,n,r){n=="__proto__"&&ye?ye(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var ur=Object.prototype,fr=ur.hasOwnProperty;function X(e,n,r){var t=e[n];(!(fr.call(e,n)&&V(t,r))||r===void 0&&!(n in e))&&q(e,n,r)}function dr(e,n,r,t){var i=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],f=void 0;f===void 0&&(f=e[u]),i?q(r,u,f):X(r,u,f)}return r}function k(e,n,r){if(!y(r))return!1;var t=typeof n;return(t=="number"?U(r)&&Ue(n,r.length):t=="string"&&n in r)?V(r[n],e):!1}function sr(e){return oe(function(n,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t<i;){var u=r[t];u&&e(n,u,t,o)}return n})}function cr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var lr=Object.prototype,hr=lr.hasOwnProperty;function vr(e){if(!y(e))return cr(e);var n=We(e),r=[];for(var t in e)t=="constructor"&&(n||!hr.call(e,t))||r.push(t);return r}function H(e){return U(e)?In(e,!0):vr(e)}function C(e){var n=e==null?0:e.length;return n?qe(e):[]}function pr(e){return _n(kn(e,void 0,C),e+"")}var en=jn(Object.getPrototypeOf,Object),br="[object Object]",wr=Function.prototype,gr=Object.prototype,nn=wr.toString,mr=gr.hasOwnProperty,yr=nn.call(Object);function xr(e){if(!ue(e)||An(e)!=br)return!1;var n=en(e);if(n===null)return!0;var r=mr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&nn.call(r)==yr}var rn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ne=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Or=Ne&&Ne.exports===rn,Ce=Or?Mn.Buffer:void 0,Ie=Ce?Ce.allocUnsafe:void 0;function tn(e,n){if(n)return e.slice();var r=e.length,t=Ie?Ie(r):new e.constructor(r);return e.copy(t),t}var Er=Object.prototype,Tr=Er.hasOwnProperty;function Pr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Tr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ce(e){var n=new e.constructor(e.byteLength);return new xe(n).set(new xe(e)),n}function Lr(e,n){var r=ce(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var Nr=/\w*$/;function Cr(e){var n=new e.constructor(e.source,Nr.exec(e));return n.lastIndex=e.lastIndex,n}var _e=Oe?Oe.prototype:void 0,ke=_e?_e.valueOf:void 0;function Ir(e){return ke?Object(ke.call(e)):{}}function an(e,n){var r=n?ce(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var _r="[object Boolean]",kr="[object Date]",jr="[object Map]",Ar="[object Number]",Mr="[object RegExp]",Rr="[object Set]",Sr="[object String]",$r="[object Symbol]",Fr="[object ArrayBuffer]",Br="[object DataView]",Gr="[object Float32Array]",Dr="[object Float64Array]",Yr="[object Int8Array]",Vr="[object Int16Array]",Ur="[object Int32Array]",Wr="[object Uint8Array]",qr="[object Uint8ClampedArray]",Xr="[object Uint16Array]",Hr="[object Uint32Array]";function Kr(e,n,r){var t=e.constructor;switch(n){case Fr:return ce(e);case _r:case kr:return new t(+e);case Br:return Lr(e);case Gr:case Dr:case Yr:case Vr:case Ur:case Wr:case qr:case Xr:case Hr:return an(e,r);case jr:return new t;case Ar:case Sr:return new t(e);case Mr:return Cr(e);case Rr:return new t;case $r:return Ir(e)}}function on(e){return typeof e.constructor=="function"&&!We(e)?ar(en(e)):{}}var zr="[object Map]";function Jr(e){return ue(e)&&fe(e)==zr}var je=G&&G.isMap,Zr=je?de(je):Jr,Qr="[object Set]";function et(e){return ue(e)&&fe(e)==Qr}var Ae=G&&G.isSet,nt=Ae?de(Ae):et,rt=1,un="[object Arguments]",tt="[object Array]",it="[object Boolean]",at="[object Date]",ot="[object Error]",fn="[object Function]",ut="[object GeneratorFunction]",ft="[object Map]",dt="[object Number]",dn="[object Object]",st="[object RegExp]",ct="[object Set]",lt="[object String]",ht="[object Symbol]",vt="[object WeakMap]",pt="[object ArrayBuffer]",bt="[object DataView]",wt="[object Float32Array]",gt="[object Float64Array]",mt="[object Int8Array]",yt="[object Int16Array]",xt="[object Int32Array]",Ot="[object Uint8Array]",Et="[object Uint8ClampedArray]",Tt="[object Uint16Array]",Pt="[object Uint32Array]",b={};b[un]=b[tt]=b[pt]=b[bt]=b[it]=b[at]=b[wt]=b[gt]=b[mt]=b[yt]=b[xt]=b[ft]=b[dt]=b[dn]=b[st]=b[ct]=b[lt]=b[ht]=b[Ot]=b[Et]=b[Tt]=b[Pt]=!0;b[ot]=b[fn]=b[vt]=!1;function F(e,n,r,t,i,o){var a,u=n&rt;if(a!==void 0)return a;if(!y(e))return e;var f=T(e);if(f)a=Pr(e);else{var d=fe(e),s=d==fn||d==ut;if(Xe(e))return tn(e,u);if(d==dn||d==un||s&&!i)a=s?{}:on(e);else{if(!b[d])return i?e:{};a=Kr(e,d,u)}}o||(o=new He);var l=o.get(e);if(l)return l;o.set(e,a),nt(e)?e.forEach(function(v){a.add(F(v,n,r,v,e,o))}):Zr(e)&&e.forEach(function(v,w){a.set(w,F(v,n,r,w,e,o))});var h=Sn,p=f?void 0:h(e);return Rn(p||e,function(v,w){p&&(w=v,v=e[w]),X(a,w,F(v,n,r,w,e,o))}),a}var Lt=1,Nt=4;function Ct(e){return F(e,Lt|Nt)}var sn=Object.prototype,It=sn.hasOwnProperty,_t=oe(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&k(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=H(o),u=-1,f=a.length;++u<f;){var d=a[u],s=e[d];(s===void 0||V(s,sn[d])&&!It.call(e,d))&&(e[d]=o[d])}return e});function re(e,n,r){(r!==void 0&&!V(e[n],r)||r===void 0&&!(n in e))&&q(e,n,r)}function te(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function kt(e){return dr(e,H(e))}function jt(e,n,r,t,i,o,a){var u=te(e,r),f=te(n,r),d=a.get(f);if(d){re(e,r,d);return}var s=o?o(u,f,r+"",e,n,a):void 0,l=s===void 0;if(l){var h=T(f),p=!h&&Xe(f),v=!h&&!p&&$n(f);s=f,h||p||v?T(u)?s=u:Fn(u)?s=or(u):p?(l=!1,s=tn(f,!0)):v?(l=!1,s=an(f,!0)):s=[]:xr(f)||Ee(f)?(s=u,Ee(u)?s=kt(u):(!y(u)||Bn(u))&&(s=on(f))):l=!1}l&&(a.set(f,s),i(s,f,t,o,a),a.delete(f)),re(e,r,s)}function cn(e,n,r,t,i){e!==n&&Ke(n,function(o,a){if(i||(i=new He),y(o))jt(e,n,a,r,cn,t,i);else{var u=t?t(te(e,a),o,a+"",e,n,i):void 0;u===void 0&&(u=o),re(e,a,u)}},H)}function D(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function At(e){return function(n,r,t){var i=Object(n);if(!U(n)){var o=N(r);n=Gn(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var Mt=Math.max;function Rt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:ir(r);return i<0&&(i=Mt(t+i,0)),Dn(e,N(n),i)}var le=At(Rt);function ln(e,n){var r=-1,t=U(e)?Array(e.length):[];return Yn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=T(e)?S:ln;return r(e,N(n))}function St(e,n){return e==null?e:Ke(e,ze(n),H)}function $t(e,n){return e&&Je(e,ze(n))}function Ft(e,n){return e>n}var Bt=Object.prototype,Gt=Bt.hasOwnProperty;function Dt(e,n){return e!=null&&Gt.call(e,n)}function hn(e,n){return e!=null&&Vn(e,n,Dt)}function vn(e,n){return e<n}function K(e,n){var r={};return n=N(n),Je(e,function(t,i,o){q(r,i,n(t,i,o))}),r}function he(e,n,r){for(var t=-1,i=e.length;++t<i;){var o=e[t],a=n(o);if(a!=null&&(u===void 0?a===a&&!B(a):r(a,u)))var u=a,f=o}return f}function O(e){return e&&e.length?he(e,se,Ft):void 0}var ie=sr(function(e,n,r){cn(e,n,r)});function j(e){return e&&e.length?he(e,se,vn):void 0}function ve(e,n){return e&&e.length?he(e,N(n),vn):void 0}function Yt(e,n,r,t){if(!y(e))return e;n=Ze(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var f=Un(n[i]),d=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=a){var s=u[f];d=void 0,d===void 0&&(d=y(s)?s:Ue(n[i+1])?[]:{})}X(u,f,d),u=u[f]}return e}function Vt(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=Qe(e,a);r(u,a)&&Yt(o,Ze(a,e),u)}return o}function Ut(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Wt(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=B(e),a=n!==void 0,u=n===null,f=n===n,d=B(n);if(!u&&!d&&!o&&e>n||o&&a&&f&&!u&&!d||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!d&&e<n||d&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!f)return-1}return 0}function qt(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var f=Wt(i[t],o[t]);if(f){if(t>=u)return f;var d=r[t];return f*(d=="desc"?-1:1)}}return e.index-n.index}function Xt(e,n,r){n.length?n=S(n,function(o){return T(o)?function(a){return Qe(a,o.length===1?o[0]:o)}:o}):n=[se];var t=-1;n=S(n,de(N));var i=ln(e,function(o,a,u){var f=S(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return Ut(i,function(o,a){return qt(o,a,r)})}function Ht(e,n){return Vt(e,n,function(r,t){return Wn(e,t)})}var Y=pr(function(e,n){return e==null?{}:Ht(e,n)}),Kt=Math.ceil,zt=Math.max;function Jt(e,n,r,t){for(var i=-1,o=zt(Kt((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function Zt(e){return function(n,r,t){return t&&typeof t!="number"&&k(n,r,t)&&(r=t=void 0),n=$(n),r===void 0?(r=n,n=0):r=$(r),t=t===void 0?n<r?1:-1:$(t),Jt(n,r,t)}}var L=Zt(),R=oe(function(e,n){if(e==null)return[];var r=n.length;return r>1&&k(e,n[0],n[1])?n=[]:r>2&&k(n[0],n[1],n[2])&&(n=[n[0]]),Xt(e,qe(n),[])}),Qt=0;function pe(e){var n=++Qt;return qn(e)+n}function ei(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function ni(e,n){return ei(e||[],n||[],X)}class ri{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Me(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Me(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,ti)),t=t._prev;return"["+n.join(", ")+"]"}}function Me(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ti(e,n){if(e!=="_next"&&e!=="_prev")return n}var ii=Xn(1);function ai(e,n){if(e.nodeCount()<=1)return[];var r=ui(e,n||ii),t=oi(r.graph,r.buckets,r.zeroIdx);return C(g(t,function(i){return e.outEdges(i.v,i.w)}))}function oi(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)J(e,n,r,a);for(;a=i.dequeue();)J(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(J(e,n,r,a,!0));break}}}return t}function J(e,n,r,t,i){var o=i?[]:void 0;return c(e.inEdges(t.v),function(a){var u=e.edge(a),f=e.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,ae(n,r,f)}),c(e.outEdges(t.v),function(a){var u=e.edge(a),f=a.w,d=e.node(f);d.in-=u,ae(n,r,d)}),e.removeNode(t.v),o}function ui(e,n){var r=new x,t=0,i=0;c(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(e.edges(),function(u){var f=r.edge(u.v,u.w)||0,d=n(u),s=f+d;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=d),t=Math.max(t,r.node(u.w).in+=d)});var o=L(i+t+3).map(function(){return new ri}),a=t+1;return c(r.nodes(),function(u){ae(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ae(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function fi(e){var n=e.graph().acyclicer==="greedy"?ai(e,r(e)):di(e);c(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,pe("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function di(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return c(e.nodes(),i),n}function si(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function I(e,n,r,t){var i;do i=pe(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function ci(e){var n=new x().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function pn(e){var n=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Re(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,d;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,d=u):(i<0&&(a=-a),f=a,d=a*o/i),{x:r+f,y:t+d}}function z(e){var n=g(L(bn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function li(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);hn(t,"rank")&&(t.rank-=n)})}function hi(e){var n=j(g(e.nodes(),function(o){return e.node(o).rank})),r=[];c(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Se(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),I(e,"border",i,n)}function bn(e){return O(g(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function vi(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function pi(e,n){return n()}function bi(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)$e(e,"borderLeft","_bl",r,i,o),$e(e,"borderRight","_br",r,i,o)}}c(e.children(),n)}function $e(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],f=I(e,"border",a,r);i[n][o]=f,e.setParent(f,t),u&&e.setEdge(u,f,{weight:1})}function wi(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&wn(e)}function gi(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&mi(e),(n==="lr"||n==="rl")&&(yi(e),wn(e))}function wn(e){c(e.nodes(),function(n){Fe(e.node(n))}),c(e.edges(),function(n){Fe(e.edge(n))})}function Fe(e){var n=e.width;e.width=e.height,e.height=n}function mi(e){c(e.nodes(),function(n){Z(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,Z),Object.prototype.hasOwnProperty.call(r,"y")&&Z(r)})}function Z(e){e.y=-e.y}function yi(e){c(e.nodes(),function(n){Q(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,Q),Object.prototype.hasOwnProperty.call(r,"x")&&Q(r)})}function Q(e){var n=e.x;e.x=e.y,e.y=n}function xi(e){e.graph().dummyChains=[],c(e.edges(),function(n){Oi(e,n)})}function Oi(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),f=u.labelRank;if(o!==t+1){e.removeEdge(n);var d=void 0,s,l;for(l=0,++t;t<o;++l,++t)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},s=I(e,"edge",d,"_d"),t===f&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),e.setEdge(r,s,{weight:u.weight},a),l===0&&e.graph().dummyChains.push(s),r=s;e.setEdge(r,i,{weight:u.weight},a)}}function Ei(e){c(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function be(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=j(g(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}c(e.sources(),r)}function A(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function gn(e){var n=new x({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;Ti(n,e)<t;)i=Pi(n,e),o=n.hasNode(i.v)?A(e,i):-A(e,i),Li(n,e,o);return n}function Ti(e,n){function r(t){c(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!A(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return c(e.nodes(),r),e.nodeCount()}function Pi(e,n){return ve(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return A(n,r)})}function Li(e,n,r){c(e.nodes(),function(t){n.node(t).rank+=r})}function Ni(){}Ni.prototype=new Error;function mn(e,n,r){T(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return c(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);yn(e,a,r==="post",o,t,i)}),i}function yn(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),c(i(n),function(a){yn(e,a,r,t,i,o)}),r&&o.push(n))}function Ci(e,n){return mn(e,n,"post")}function Ii(e,n){return mn(e,n,"pre")}E.initLowLimValues=ge;E.initCutValues=we;E.calcCutValue=xn;E.leaveEdge=En;E.enterEdge=Tn;E.exchangeEdges=Pn;function E(e){e=ci(e),be(e);var n=gn(e);ge(n),we(n,e);for(var r,t;r=En(n);)t=Tn(n,e,r),Pn(n,e,r,t)}function we(e,n){var r=Ci(e,e.nodes());r=r.slice(0,r.length-1),c(r,function(t){_i(e,n,t)})}function _i(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=xn(e,n,r)}function xn(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,c(n.nodeEdges(r),function(f){var d=f.v===r,s=d?f.w:f.v;if(s!==i){var l=d===o,h=n.edge(f).weight;if(u+=l?h:-h,ji(e,r,s)){var p=e.edge(r,s).cutvalue;u+=l?-p:p}}}),u}function ge(e,n){arguments.length<2&&(n=e.nodes()[0]),On(e,{},1,n)}function On(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,c(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=On(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function En(e){return le(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Tn(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,f=!1;o.lim>a.lim&&(u=a,f=!0);var d=M(n.edges(),function(s){return f===Be(e,e.node(s.v),u)&&f!==Be(e,e.node(s.w),u)});return ve(d,function(s){return A(n,s)})}function Pn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ge(e),we(e,n),ki(e,n)}function ki(e,n){var r=le(e.nodes(),function(i){return!n.node(i).parent}),t=Ii(e,r);t=t.slice(1),c(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function ji(e,n,r){return e.hasEdge(n,r)}function Be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ai(e){switch(e.graph().ranker){case"network-simplex":Ge(e);break;case"tight-tree":Ri(e);break;case"longest-path":Mi(e);break;default:Ge(e)}}var Mi=be;function Ri(e){be(e),gn(e)}function Ge(e){E(e)}function Si(e){var n=I(e,"root",{},"_root"),r=$i(e),t=O(P(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Fi(e)+1;c(e.children(),function(a){Ln(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ln(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var f=Se(e,"_bt"),d=Se(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){Ln(e,n,r,t,i,o,l);var h=e.node(l),p=h.borderTop?h.borderTop:l,v=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,_=p!==v?1:i-o[a]+1;e.setEdge(f,p,{weight:w,minlen:_,nestingEdge:!0}),e.setEdge(v,d,{weight:w,minlen:_,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function $i(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),n[t]=i}return c(e.children(),function(t){r(t,1)}),n}function Fi(e){return W(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Bi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Gi(e,n,r){var t={},i;c(r,function(o){for(var a=e.parent(o),u,f;a;){if(u=e.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){n.setEdge(f,a);return}a=u}})}function Di(e,n,r){var t=Yi(e),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return c(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(e[r](o),function(f){var d=f.v===o?f.w:f.v,s=i.edge(d,o),l=m(s)?0:s.weight;i.setEdge(d,o,{weight:e.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Yi(e){for(var n;e.hasNode(n=pe("_root")););return n}function Vi(e,n){for(var r=0,t=1;t<n.length;++t)r+=Ui(e,n[t-1],n[t]);return r}function Ui(e,n,r){for(var t=ni(r,g(r,function(d,s){return s})),i=C(g(n,function(d){return R(g(e.outEdges(d),function(s){return{pos:t[s.w],weight:e.edge(s).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=g(new Array(a),function(){return 0}),f=0;return c(i.forEach(function(d){var s=d.pos+o;u[s]+=d.weight;for(var l=0;s>0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=d.weight;f+=d.weight*l})),f}function Wi(e){var n={},r=M(e.nodes(),function(u){return!e.children(u).length}),t=O(g(r,function(u){return e.node(u).rank})),i=g(L(t+1),function(){return[]});function o(u){if(!hn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return c(a,o),i}function qi(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=W(t,function(o,a){var u=e.edge(a),f=e.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Xi(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Hi(t)}function Hi(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Ki(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(M(n,function(o){return!o.merged}),function(o){return Y(o,["vs","i","barycenter","weight"])})}function Ki(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function zi(e,n){var r=vi(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=R(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(Ji(!!n)),f=De(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=De(o,i,f)});var d={vs:C(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function De(e,n,r){for(var t;n.length&&(t=D(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ji(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Nn(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=M(i,function(v){return v!==a&&v!==u}));var d=qi(e,i);c(d,function(v){if(e.children(v.v).length){var w=Nn(e,v.v,r,t);f[v.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Qi(v,w)}});var s=Xi(d,r);Zi(s,f);var l=zi(s,t);if(a&&(l.vs=C([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+p.order)/(l.weight+2),l.weight+=2}return l}function Zi(e,n){c(e,function(r){r.vs=C(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Qi(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function ea(e){var n=bn(e),r=Ye(e,L(1,n+1),"inEdges"),t=Ye(e,L(n-1,-1,-1),"outEdges"),i=Wi(e);Ve(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){na(u%2?r:t,u%4>=2),i=z(e);var d=Vi(e,i);d<o&&(f=0,a=Ct(i),o=d)}Ve(e,a)}function Ye(e,n,r){return g(n,function(t){return Di(e,t,r)})}function na(e,n){var r=new x;c(e,function(t){var i=t.graph().root,o=Nn(t,i,r,n);c(o.vs,function(a,u){t.node(a).order=u}),Gi(t,r,o.vs)})}function Ve(e,n){c(n,function(r){c(r,function(t,i){e.node(t).order=i})})}function ra(e){var n=ia(e);c(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=ta(e,n,i.v,i.w),a=o.path,u=o.lca,f=0,d=a[f],s=!0;r!==i.w;){if(t=e.node(r),s){for(;(d=a[f])!==u&&e.node(d).maxRank<t.rank;)f++;d===u&&(s=!1)}if(!s){for(;f<a.length-1&&e.node(d=a[f+1]).minRank<=t.rank;)f++;d=a[f]}e.setParent(r,d),r=e.successors(r)[0]}})}function ta(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),f,d;f=r;do f=e.parent(f),i.push(f);while(f&&(n[f].low>a||u>n[f].lim));for(d=f,f=t;(f=e.parent(f))!==d;)o.push(f);return{path:i.concat(o.reverse()),lca:d}}function ia(e){var n={},r=0;function t(i){var o=r;c(e.children(i),t),n[i]={low:o,lim:r++}}return c(e.children(),t),n}function aa(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=D(o);return c(o,function(s,l){var h=ua(e,s),p=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(v){c(e.predecessors(v),function(w){var _=e.node(w),me=_.order;(me<a||p<me)&&!(_.dummy&&e.node(v).dummy)&&Cn(r,w,v)})}),u=l+1,a=p)}),o}return W(n,t),r}function oa(e,n){var r={};function t(o,a,u,f,d){var s;c(L(a,u),function(l){s=o[l],e.node(s).dummy&&c(e.predecessors(s),function(h){var p=e.node(h);p.dummy&&(p.order<f||p.order>d)&&Cn(r,h,s)})})}function i(o,a){var u=-1,f,d=0;return c(a,function(s,l){if(e.node(s).dummy==="border"){var h=e.predecessors(s);h.length&&(f=e.node(h[0]).order,t(a,d,l,u,f),d=l,u=f)}t(a,d,a.length,f,o.length)}),a}return W(n,i),r}function ua(e,n){if(e.node(n).dummy)return le(e.predecessors(n),function(r){return e.node(r).dummy})}function Cn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function da(e,n,r,t){var i={},o={},a={};return c(n,function(u){c(u,function(f,d){i[f]=f,o[f]=f,a[f]=d})}),c(n,function(u){var f=-1;c(u,function(d){var s=t(d);if(s.length){s=R(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),p=Math.ceil(l);h<=p;++h){var v=s[h];o[d]===d&&f<a[v]&&!fa(r,d,v)&&(o[v]=d,o[d]=i[d]=i[v],f=a[v])}}})}),{root:i,align:o}}function sa(e,n,r,t,i){var o={},a=ca(e,n,r,i),u=i?"borderLeft":"borderRight";function f(l,h){for(var p=a.nodes(),v=p.pop(),w={};v;)w[v]?l(v):(w[v]=!0,p.push(v),p=p.concat(h(v))),v=p.pop()}function d(l){o[l]=a.inEdges(l).reduce(function(h,p){return Math.max(h,o[p.v]+a.edge(p))},0)}function s(l){var h=a.outEdges(l).reduce(function(v,w){return Math.min(v,o[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),p=e.node(l);h!==Number.POSITIVE_INFINITY&&p.borderType!==u&&(o[l]=Math.max(o[l],h))}return f(d,a.predecessors.bind(a)),f(s,a.successors.bind(a)),c(t,function(l){o[l]=o[r[l]]}),o}function ca(e,n,r,t){var i=new x,o=e.graph(),a=ba(o.nodesep,o.edgesep,t);return c(n,function(u){var f;c(u,function(d){var s=r[d];if(i.setNode(s),f){var l=r[f],h=i.edge(l,s);i.setEdge(l,s,Math.max(a(e,d,f),h||0))}f=d})}),i}function la(e,n){return ve(P(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return St(r,function(o,a){var u=wa(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function ha(e,n){var r=P(n),t=j(r),i=O(r);c(["u","d"],function(o){c(["l","r"],function(a){var u=o+a,f=e[u],d;if(f!==n){var s=P(f);d=a==="l"?t-j(s):i-O(s),d&&(e[u]=K(f,function(l){return l+d}))}})})}function va(e,n){return K(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(g(e,t));return(i[1]+i[2])/2})}function pa(e){var n=z(e),r=ie(aa(e,n),oa(e,n)),t={},i;c(["u","d"],function(a){i=a==="u"?n:P(n).reverse(),c(["l","r"],function(u){u==="r"&&(i=g(i,function(l){return P(l).reverse()}));var f=(a==="u"?e.predecessors:e.successors).bind(e),d=da(e,i,r,f),s=sa(e,i,d.root,d.align,u==="r");u==="r"&&(s=K(s,function(l){return-l})),t[a+u]=s})});var o=la(e,t);return ha(t,o),va(t,e.graph().align)}function ba(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),f=0,d;if(f+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":d=-a.width/2;break;case"r":d=a.width/2;break}if(d&&(f+=r?d:-d),d=0,f+=(a.dummy?n:e)/2,f+=(u.dummy?n:e)/2,f+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":d=u.width/2;break;case"r":d=-u.width/2;break}return d&&(f+=r?d:-d),d=0,f}}function wa(e,n){return e.node(n).width}function ga(e){e=pn(e),ma(e),$t(pa(e),function(n,r){e.node(r).x=n})}function ma(e){var n=z(e),r=e.graph().ranksep,t=0;c(n,function(i){var o=O(g(i,function(a){return e.node(a).height}));c(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Ua(e,n){var r=pi;r("layout",()=>{var t=r(" buildLayoutGraph",()=>_a(e));r(" runLayout",()=>ya(t,r)),r(" updateInputGraph",()=>xa(e,t))})}function ya(e,n){n(" makeSpaceForEdgeLabels",()=>ka(e)),n(" removeSelfEdges",()=>Ga(e)),n(" acyclic",()=>fi(e)),n(" nestingGraph.run",()=>Si(e)),n(" rank",()=>Ai(pn(e))),n(" injectEdgeLabelProxies",()=>ja(e)),n(" removeEmptyRanks",()=>hi(e)),n(" nestingGraph.cleanup",()=>Bi(e)),n(" normalizeRanks",()=>li(e)),n(" assignRankMinMax",()=>Aa(e)),n(" removeEdgeLabelProxies",()=>Ma(e)),n(" normalize.run",()=>xi(e)),n(" parentDummyChains",()=>ra(e)),n(" addBorderSegments",()=>bi(e)),n(" order",()=>ea(e)),n(" insertSelfEdges",()=>Da(e)),n(" adjustCoordinateSystem",()=>wi(e)),n(" position",()=>ga(e)),n(" positionSelfEdges",()=>Ya(e)),n(" removeBorderNodes",()=>Ba(e)),n(" normalize.undo",()=>Ei(e)),n(" fixupEdgeLabelCoords",()=>$a(e)),n(" undoCoordinateSystem",()=>gi(e)),n(" translateGraph",()=>Ra(e)),n(" assignNodeIntersects",()=>Sa(e)),n(" reversePoints",()=>Fa(e)),n(" acyclic.undo",()=>si(e))}function xa(e,n){c(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),c(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Oa=["nodesep","edgesep","ranksep","marginx","marginy"],Ea={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ta=["acyclicer","ranker","rankdir","align"],Pa=["width","height"],La={width:0,height:0},Na=["minlen","weight","width","height","labeloffset"],Ca={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ia=["labelpos"];function _a(e){var n=new x({multigraph:!0,compound:!0}),r=ne(e.graph());return n.setGraph(ie({},Ea,ee(r,Oa),Y(r,Ta))),c(e.nodes(),function(t){var i=ne(e.node(t));n.setNode(t,_t(ee(i,Pa),La)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=ne(e.edge(t));n.setEdge(t,ie({},Ca,ee(i,Na),Y(i,Ia)))}),n}function ka(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function ja(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};I(e,"edge-proxy",o,"_ep")}})}function Aa(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=O(n,t.maxRank))}),e.graph().maxRank=n}function Ma(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ra(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function f(d){var s=d.x,l=d.y,h=d.width,p=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-p/2),i=Math.max(i,l+p/2)}c(e.nodes(),function(d){f(e.node(d))}),c(e.edges(),function(d){var s=e.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&f(s)}),n-=a,t-=u,c(e.nodes(),function(d){var s=e.node(d);s.x-=n,s.y-=t}),c(e.edges(),function(d){var s=e.edge(d);c(s.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Sa(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(Re(t,o)),r.points.push(Re(i,a))})}function $a(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Fa(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ba(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(D(r.borderLeft)),a=e.node(D(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Ga(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Da(e){var n=z(e);c(n,function(r){var t=0;c(r,function(i,o){var a=e.node(i);a.order=o+t,c(a.selfEdges,function(u){I(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Ya(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function ee(e,n){return K(Y(e,n),Number)}function ne(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Ua as l};
1
+ import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Ze,c0 as Un,c1 as Qe,c2 as Wn,c3 as qn,aa as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core-CfB36ohx.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Zn=/^[-+]0x[0-9a-f]+$/i,Qn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Qn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Zn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function q(e,n,r){n=="__proto__"&&ye?ye(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var ur=Object.prototype,fr=ur.hasOwnProperty;function X(e,n,r){var t=e[n];(!(fr.call(e,n)&&V(t,r))||r===void 0&&!(n in e))&&q(e,n,r)}function dr(e,n,r,t){var i=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],f=void 0;f===void 0&&(f=e[u]),i?q(r,u,f):X(r,u,f)}return r}function k(e,n,r){if(!y(r))return!1;var t=typeof n;return(t=="number"?U(r)&&Ue(n,r.length):t=="string"&&n in r)?V(r[n],e):!1}function sr(e){return oe(function(n,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t<i;){var u=r[t];u&&e(n,u,t,o)}return n})}function cr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var lr=Object.prototype,hr=lr.hasOwnProperty;function vr(e){if(!y(e))return cr(e);var n=We(e),r=[];for(var t in e)t=="constructor"&&(n||!hr.call(e,t))||r.push(t);return r}function H(e){return U(e)?In(e,!0):vr(e)}function C(e){var n=e==null?0:e.length;return n?qe(e):[]}function pr(e){return _n(kn(e,void 0,C),e+"")}var en=jn(Object.getPrototypeOf,Object),br="[object Object]",wr=Function.prototype,gr=Object.prototype,nn=wr.toString,mr=gr.hasOwnProperty,yr=nn.call(Object);function xr(e){if(!ue(e)||An(e)!=br)return!1;var n=en(e);if(n===null)return!0;var r=mr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&nn.call(r)==yr}var rn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ne=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Or=Ne&&Ne.exports===rn,Ce=Or?Mn.Buffer:void 0,Ie=Ce?Ce.allocUnsafe:void 0;function tn(e,n){if(n)return e.slice();var r=e.length,t=Ie?Ie(r):new e.constructor(r);return e.copy(t),t}var Er=Object.prototype,Tr=Er.hasOwnProperty;function Pr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Tr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ce(e){var n=new e.constructor(e.byteLength);return new xe(n).set(new xe(e)),n}function Lr(e,n){var r=ce(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var Nr=/\w*$/;function Cr(e){var n=new e.constructor(e.source,Nr.exec(e));return n.lastIndex=e.lastIndex,n}var _e=Oe?Oe.prototype:void 0,ke=_e?_e.valueOf:void 0;function Ir(e){return ke?Object(ke.call(e)):{}}function an(e,n){var r=n?ce(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var _r="[object Boolean]",kr="[object Date]",jr="[object Map]",Ar="[object Number]",Mr="[object RegExp]",Rr="[object Set]",Sr="[object String]",$r="[object Symbol]",Fr="[object ArrayBuffer]",Br="[object DataView]",Gr="[object Float32Array]",Dr="[object Float64Array]",Yr="[object Int8Array]",Vr="[object Int16Array]",Ur="[object Int32Array]",Wr="[object Uint8Array]",qr="[object Uint8ClampedArray]",Xr="[object Uint16Array]",Hr="[object Uint32Array]";function Kr(e,n,r){var t=e.constructor;switch(n){case Fr:return ce(e);case _r:case kr:return new t(+e);case Br:return Lr(e);case Gr:case Dr:case Yr:case Vr:case Ur:case Wr:case qr:case Xr:case Hr:return an(e,r);case jr:return new t;case Ar:case Sr:return new t(e);case Mr:return Cr(e);case Rr:return new t;case $r:return Ir(e)}}function on(e){return typeof e.constructor=="function"&&!We(e)?ar(en(e)):{}}var zr="[object Map]";function Jr(e){return ue(e)&&fe(e)==zr}var je=G&&G.isMap,Zr=je?de(je):Jr,Qr="[object Set]";function et(e){return ue(e)&&fe(e)==Qr}var Ae=G&&G.isSet,nt=Ae?de(Ae):et,rt=1,un="[object Arguments]",tt="[object Array]",it="[object Boolean]",at="[object Date]",ot="[object Error]",fn="[object Function]",ut="[object GeneratorFunction]",ft="[object Map]",dt="[object Number]",dn="[object Object]",st="[object RegExp]",ct="[object Set]",lt="[object String]",ht="[object Symbol]",vt="[object WeakMap]",pt="[object ArrayBuffer]",bt="[object DataView]",wt="[object Float32Array]",gt="[object Float64Array]",mt="[object Int8Array]",yt="[object Int16Array]",xt="[object Int32Array]",Ot="[object Uint8Array]",Et="[object Uint8ClampedArray]",Tt="[object Uint16Array]",Pt="[object Uint32Array]",b={};b[un]=b[tt]=b[pt]=b[bt]=b[it]=b[at]=b[wt]=b[gt]=b[mt]=b[yt]=b[xt]=b[ft]=b[dt]=b[dn]=b[st]=b[ct]=b[lt]=b[ht]=b[Ot]=b[Et]=b[Tt]=b[Pt]=!0;b[ot]=b[fn]=b[vt]=!1;function F(e,n,r,t,i,o){var a,u=n&rt;if(a!==void 0)return a;if(!y(e))return e;var f=T(e);if(f)a=Pr(e);else{var d=fe(e),s=d==fn||d==ut;if(Xe(e))return tn(e,u);if(d==dn||d==un||s&&!i)a=s?{}:on(e);else{if(!b[d])return i?e:{};a=Kr(e,d,u)}}o||(o=new He);var l=o.get(e);if(l)return l;o.set(e,a),nt(e)?e.forEach(function(v){a.add(F(v,n,r,v,e,o))}):Zr(e)&&e.forEach(function(v,w){a.set(w,F(v,n,r,w,e,o))});var h=Sn,p=f?void 0:h(e);return Rn(p||e,function(v,w){p&&(w=v,v=e[w]),X(a,w,F(v,n,r,w,e,o))}),a}var Lt=1,Nt=4;function Ct(e){return F(e,Lt|Nt)}var sn=Object.prototype,It=sn.hasOwnProperty,_t=oe(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&k(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=H(o),u=-1,f=a.length;++u<f;){var d=a[u],s=e[d];(s===void 0||V(s,sn[d])&&!It.call(e,d))&&(e[d]=o[d])}return e});function re(e,n,r){(r!==void 0&&!V(e[n],r)||r===void 0&&!(n in e))&&q(e,n,r)}function te(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function kt(e){return dr(e,H(e))}function jt(e,n,r,t,i,o,a){var u=te(e,r),f=te(n,r),d=a.get(f);if(d){re(e,r,d);return}var s=o?o(u,f,r+"",e,n,a):void 0,l=s===void 0;if(l){var h=T(f),p=!h&&Xe(f),v=!h&&!p&&$n(f);s=f,h||p||v?T(u)?s=u:Fn(u)?s=or(u):p?(l=!1,s=tn(f,!0)):v?(l=!1,s=an(f,!0)):s=[]:xr(f)||Ee(f)?(s=u,Ee(u)?s=kt(u):(!y(u)||Bn(u))&&(s=on(f))):l=!1}l&&(a.set(f,s),i(s,f,t,o,a),a.delete(f)),re(e,r,s)}function cn(e,n,r,t,i){e!==n&&Ke(n,function(o,a){if(i||(i=new He),y(o))jt(e,n,a,r,cn,t,i);else{var u=t?t(te(e,a),o,a+"",e,n,i):void 0;u===void 0&&(u=o),re(e,a,u)}},H)}function D(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function At(e){return function(n,r,t){var i=Object(n);if(!U(n)){var o=N(r);n=Gn(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var Mt=Math.max;function Rt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:ir(r);return i<0&&(i=Mt(t+i,0)),Dn(e,N(n),i)}var le=At(Rt);function ln(e,n){var r=-1,t=U(e)?Array(e.length):[];return Yn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=T(e)?S:ln;return r(e,N(n))}function St(e,n){return e==null?e:Ke(e,ze(n),H)}function $t(e,n){return e&&Je(e,ze(n))}function Ft(e,n){return e>n}var Bt=Object.prototype,Gt=Bt.hasOwnProperty;function Dt(e,n){return e!=null&&Gt.call(e,n)}function hn(e,n){return e!=null&&Vn(e,n,Dt)}function vn(e,n){return e<n}function K(e,n){var r={};return n=N(n),Je(e,function(t,i,o){q(r,i,n(t,i,o))}),r}function he(e,n,r){for(var t=-1,i=e.length;++t<i;){var o=e[t],a=n(o);if(a!=null&&(u===void 0?a===a&&!B(a):r(a,u)))var u=a,f=o}return f}function O(e){return e&&e.length?he(e,se,Ft):void 0}var ie=sr(function(e,n,r){cn(e,n,r)});function j(e){return e&&e.length?he(e,se,vn):void 0}function ve(e,n){return e&&e.length?he(e,N(n),vn):void 0}function Yt(e,n,r,t){if(!y(e))return e;n=Ze(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var f=Un(n[i]),d=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=a){var s=u[f];d=void 0,d===void 0&&(d=y(s)?s:Ue(n[i+1])?[]:{})}X(u,f,d),u=u[f]}return e}function Vt(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=Qe(e,a);r(u,a)&&Yt(o,Ze(a,e),u)}return o}function Ut(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Wt(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=B(e),a=n!==void 0,u=n===null,f=n===n,d=B(n);if(!u&&!d&&!o&&e>n||o&&a&&f&&!u&&!d||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!d&&e<n||d&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!f)return-1}return 0}function qt(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var f=Wt(i[t],o[t]);if(f){if(t>=u)return f;var d=r[t];return f*(d=="desc"?-1:1)}}return e.index-n.index}function Xt(e,n,r){n.length?n=S(n,function(o){return T(o)?function(a){return Qe(a,o.length===1?o[0]:o)}:o}):n=[se];var t=-1;n=S(n,de(N));var i=ln(e,function(o,a,u){var f=S(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return Ut(i,function(o,a){return qt(o,a,r)})}function Ht(e,n){return Vt(e,n,function(r,t){return Wn(e,t)})}var Y=pr(function(e,n){return e==null?{}:Ht(e,n)}),Kt=Math.ceil,zt=Math.max;function Jt(e,n,r,t){for(var i=-1,o=zt(Kt((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function Zt(e){return function(n,r,t){return t&&typeof t!="number"&&k(n,r,t)&&(r=t=void 0),n=$(n),r===void 0?(r=n,n=0):r=$(r),t=t===void 0?n<r?1:-1:$(t),Jt(n,r,t)}}var L=Zt(),R=oe(function(e,n){if(e==null)return[];var r=n.length;return r>1&&k(e,n[0],n[1])?n=[]:r>2&&k(n[0],n[1],n[2])&&(n=[n[0]]),Xt(e,qe(n),[])}),Qt=0;function pe(e){var n=++Qt;return qn(e)+n}function ei(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function ni(e,n){return ei(e||[],n||[],X)}class ri{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Me(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Me(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,ti)),t=t._prev;return"["+n.join(", ")+"]"}}function Me(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ti(e,n){if(e!=="_next"&&e!=="_prev")return n}var ii=Xn(1);function ai(e,n){if(e.nodeCount()<=1)return[];var r=ui(e,n||ii),t=oi(r.graph,r.buckets,r.zeroIdx);return C(g(t,function(i){return e.outEdges(i.v,i.w)}))}function oi(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)J(e,n,r,a);for(;a=i.dequeue();)J(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(J(e,n,r,a,!0));break}}}return t}function J(e,n,r,t,i){var o=i?[]:void 0;return c(e.inEdges(t.v),function(a){var u=e.edge(a),f=e.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,ae(n,r,f)}),c(e.outEdges(t.v),function(a){var u=e.edge(a),f=a.w,d=e.node(f);d.in-=u,ae(n,r,d)}),e.removeNode(t.v),o}function ui(e,n){var r=new x,t=0,i=0;c(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(e.edges(),function(u){var f=r.edge(u.v,u.w)||0,d=n(u),s=f+d;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=d),t=Math.max(t,r.node(u.w).in+=d)});var o=L(i+t+3).map(function(){return new ri}),a=t+1;return c(r.nodes(),function(u){ae(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ae(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function fi(e){var n=e.graph().acyclicer==="greedy"?ai(e,r(e)):di(e);c(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,pe("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function di(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return c(e.nodes(),i),n}function si(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function I(e,n,r,t){var i;do i=pe(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function ci(e){var n=new x().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function pn(e){var n=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Re(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,d;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,d=u):(i<0&&(a=-a),f=a,d=a*o/i),{x:r+f,y:t+d}}function z(e){var n=g(L(bn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function li(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);hn(t,"rank")&&(t.rank-=n)})}function hi(e){var n=j(g(e.nodes(),function(o){return e.node(o).rank})),r=[];c(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Se(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),I(e,"border",i,n)}function bn(e){return O(g(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function vi(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function pi(e,n){return n()}function bi(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)$e(e,"borderLeft","_bl",r,i,o),$e(e,"borderRight","_br",r,i,o)}}c(e.children(),n)}function $e(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],f=I(e,"border",a,r);i[n][o]=f,e.setParent(f,t),u&&e.setEdge(u,f,{weight:1})}function wi(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&wn(e)}function gi(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&mi(e),(n==="lr"||n==="rl")&&(yi(e),wn(e))}function wn(e){c(e.nodes(),function(n){Fe(e.node(n))}),c(e.edges(),function(n){Fe(e.edge(n))})}function Fe(e){var n=e.width;e.width=e.height,e.height=n}function mi(e){c(e.nodes(),function(n){Z(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,Z),Object.prototype.hasOwnProperty.call(r,"y")&&Z(r)})}function Z(e){e.y=-e.y}function yi(e){c(e.nodes(),function(n){Q(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,Q),Object.prototype.hasOwnProperty.call(r,"x")&&Q(r)})}function Q(e){var n=e.x;e.x=e.y,e.y=n}function xi(e){e.graph().dummyChains=[],c(e.edges(),function(n){Oi(e,n)})}function Oi(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),f=u.labelRank;if(o!==t+1){e.removeEdge(n);var d=void 0,s,l;for(l=0,++t;t<o;++l,++t)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},s=I(e,"edge",d,"_d"),t===f&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),e.setEdge(r,s,{weight:u.weight},a),l===0&&e.graph().dummyChains.push(s),r=s;e.setEdge(r,i,{weight:u.weight},a)}}function Ei(e){c(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function be(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=j(g(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}c(e.sources(),r)}function A(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function gn(e){var n=new x({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;Ti(n,e)<t;)i=Pi(n,e),o=n.hasNode(i.v)?A(e,i):-A(e,i),Li(n,e,o);return n}function Ti(e,n){function r(t){c(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!A(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return c(e.nodes(),r),e.nodeCount()}function Pi(e,n){return ve(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return A(n,r)})}function Li(e,n,r){c(e.nodes(),function(t){n.node(t).rank+=r})}function Ni(){}Ni.prototype=new Error;function mn(e,n,r){T(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return c(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);yn(e,a,r==="post",o,t,i)}),i}function yn(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),c(i(n),function(a){yn(e,a,r,t,i,o)}),r&&o.push(n))}function Ci(e,n){return mn(e,n,"post")}function Ii(e,n){return mn(e,n,"pre")}E.initLowLimValues=ge;E.initCutValues=we;E.calcCutValue=xn;E.leaveEdge=En;E.enterEdge=Tn;E.exchangeEdges=Pn;function E(e){e=ci(e),be(e);var n=gn(e);ge(n),we(n,e);for(var r,t;r=En(n);)t=Tn(n,e,r),Pn(n,e,r,t)}function we(e,n){var r=Ci(e,e.nodes());r=r.slice(0,r.length-1),c(r,function(t){_i(e,n,t)})}function _i(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=xn(e,n,r)}function xn(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,c(n.nodeEdges(r),function(f){var d=f.v===r,s=d?f.w:f.v;if(s!==i){var l=d===o,h=n.edge(f).weight;if(u+=l?h:-h,ji(e,r,s)){var p=e.edge(r,s).cutvalue;u+=l?-p:p}}}),u}function ge(e,n){arguments.length<2&&(n=e.nodes()[0]),On(e,{},1,n)}function On(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,c(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=On(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function En(e){return le(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Tn(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,f=!1;o.lim>a.lim&&(u=a,f=!0);var d=M(n.edges(),function(s){return f===Be(e,e.node(s.v),u)&&f!==Be(e,e.node(s.w),u)});return ve(d,function(s){return A(n,s)})}function Pn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ge(e),we(e,n),ki(e,n)}function ki(e,n){var r=le(e.nodes(),function(i){return!n.node(i).parent}),t=Ii(e,r);t=t.slice(1),c(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function ji(e,n,r){return e.hasEdge(n,r)}function Be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ai(e){switch(e.graph().ranker){case"network-simplex":Ge(e);break;case"tight-tree":Ri(e);break;case"longest-path":Mi(e);break;default:Ge(e)}}var Mi=be;function Ri(e){be(e),gn(e)}function Ge(e){E(e)}function Si(e){var n=I(e,"root",{},"_root"),r=$i(e),t=O(P(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Fi(e)+1;c(e.children(),function(a){Ln(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ln(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var f=Se(e,"_bt"),d=Se(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){Ln(e,n,r,t,i,o,l);var h=e.node(l),p=h.borderTop?h.borderTop:l,v=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,_=p!==v?1:i-o[a]+1;e.setEdge(f,p,{weight:w,minlen:_,nestingEdge:!0}),e.setEdge(v,d,{weight:w,minlen:_,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function $i(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),n[t]=i}return c(e.children(),function(t){r(t,1)}),n}function Fi(e){return W(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Bi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Gi(e,n,r){var t={},i;c(r,function(o){for(var a=e.parent(o),u,f;a;){if(u=e.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){n.setEdge(f,a);return}a=u}})}function Di(e,n,r){var t=Yi(e),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return c(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(e[r](o),function(f){var d=f.v===o?f.w:f.v,s=i.edge(d,o),l=m(s)?0:s.weight;i.setEdge(d,o,{weight:e.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Yi(e){for(var n;e.hasNode(n=pe("_root")););return n}function Vi(e,n){for(var r=0,t=1;t<n.length;++t)r+=Ui(e,n[t-1],n[t]);return r}function Ui(e,n,r){for(var t=ni(r,g(r,function(d,s){return s})),i=C(g(n,function(d){return R(g(e.outEdges(d),function(s){return{pos:t[s.w],weight:e.edge(s).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=g(new Array(a),function(){return 0}),f=0;return c(i.forEach(function(d){var s=d.pos+o;u[s]+=d.weight;for(var l=0;s>0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=d.weight;f+=d.weight*l})),f}function Wi(e){var n={},r=M(e.nodes(),function(u){return!e.children(u).length}),t=O(g(r,function(u){return e.node(u).rank})),i=g(L(t+1),function(){return[]});function o(u){if(!hn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return c(a,o),i}function qi(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=W(t,function(o,a){var u=e.edge(a),f=e.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Xi(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Hi(t)}function Hi(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Ki(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(M(n,function(o){return!o.merged}),function(o){return Y(o,["vs","i","barycenter","weight"])})}function Ki(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function zi(e,n){var r=vi(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=R(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(Ji(!!n)),f=De(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=De(o,i,f)});var d={vs:C(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function De(e,n,r){for(var t;n.length&&(t=D(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ji(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Nn(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=M(i,function(v){return v!==a&&v!==u}));var d=qi(e,i);c(d,function(v){if(e.children(v.v).length){var w=Nn(e,v.v,r,t);f[v.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Qi(v,w)}});var s=Xi(d,r);Zi(s,f);var l=zi(s,t);if(a&&(l.vs=C([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+p.order)/(l.weight+2),l.weight+=2}return l}function Zi(e,n){c(e,function(r){r.vs=C(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Qi(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function ea(e){var n=bn(e),r=Ye(e,L(1,n+1),"inEdges"),t=Ye(e,L(n-1,-1,-1),"outEdges"),i=Wi(e);Ve(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){na(u%2?r:t,u%4>=2),i=z(e);var d=Vi(e,i);d<o&&(f=0,a=Ct(i),o=d)}Ve(e,a)}function Ye(e,n,r){return g(n,function(t){return Di(e,t,r)})}function na(e,n){var r=new x;c(e,function(t){var i=t.graph().root,o=Nn(t,i,r,n);c(o.vs,function(a,u){t.node(a).order=u}),Gi(t,r,o.vs)})}function Ve(e,n){c(n,function(r){c(r,function(t,i){e.node(t).order=i})})}function ra(e){var n=ia(e);c(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=ta(e,n,i.v,i.w),a=o.path,u=o.lca,f=0,d=a[f],s=!0;r!==i.w;){if(t=e.node(r),s){for(;(d=a[f])!==u&&e.node(d).maxRank<t.rank;)f++;d===u&&(s=!1)}if(!s){for(;f<a.length-1&&e.node(d=a[f+1]).minRank<=t.rank;)f++;d=a[f]}e.setParent(r,d),r=e.successors(r)[0]}})}function ta(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),f,d;f=r;do f=e.parent(f),i.push(f);while(f&&(n[f].low>a||u>n[f].lim));for(d=f,f=t;(f=e.parent(f))!==d;)o.push(f);return{path:i.concat(o.reverse()),lca:d}}function ia(e){var n={},r=0;function t(i){var o=r;c(e.children(i),t),n[i]={low:o,lim:r++}}return c(e.children(),t),n}function aa(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=D(o);return c(o,function(s,l){var h=ua(e,s),p=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(v){c(e.predecessors(v),function(w){var _=e.node(w),me=_.order;(me<a||p<me)&&!(_.dummy&&e.node(v).dummy)&&Cn(r,w,v)})}),u=l+1,a=p)}),o}return W(n,t),r}function oa(e,n){var r={};function t(o,a,u,f,d){var s;c(L(a,u),function(l){s=o[l],e.node(s).dummy&&c(e.predecessors(s),function(h){var p=e.node(h);p.dummy&&(p.order<f||p.order>d)&&Cn(r,h,s)})})}function i(o,a){var u=-1,f,d=0;return c(a,function(s,l){if(e.node(s).dummy==="border"){var h=e.predecessors(s);h.length&&(f=e.node(h[0]).order,t(a,d,l,u,f),d=l,u=f)}t(a,d,a.length,f,o.length)}),a}return W(n,i),r}function ua(e,n){if(e.node(n).dummy)return le(e.predecessors(n),function(r){return e.node(r).dummy})}function Cn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function da(e,n,r,t){var i={},o={},a={};return c(n,function(u){c(u,function(f,d){i[f]=f,o[f]=f,a[f]=d})}),c(n,function(u){var f=-1;c(u,function(d){var s=t(d);if(s.length){s=R(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),p=Math.ceil(l);h<=p;++h){var v=s[h];o[d]===d&&f<a[v]&&!fa(r,d,v)&&(o[v]=d,o[d]=i[d]=i[v],f=a[v])}}})}),{root:i,align:o}}function sa(e,n,r,t,i){var o={},a=ca(e,n,r,i),u=i?"borderLeft":"borderRight";function f(l,h){for(var p=a.nodes(),v=p.pop(),w={};v;)w[v]?l(v):(w[v]=!0,p.push(v),p=p.concat(h(v))),v=p.pop()}function d(l){o[l]=a.inEdges(l).reduce(function(h,p){return Math.max(h,o[p.v]+a.edge(p))},0)}function s(l){var h=a.outEdges(l).reduce(function(v,w){return Math.min(v,o[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),p=e.node(l);h!==Number.POSITIVE_INFINITY&&p.borderType!==u&&(o[l]=Math.max(o[l],h))}return f(d,a.predecessors.bind(a)),f(s,a.successors.bind(a)),c(t,function(l){o[l]=o[r[l]]}),o}function ca(e,n,r,t){var i=new x,o=e.graph(),a=ba(o.nodesep,o.edgesep,t);return c(n,function(u){var f;c(u,function(d){var s=r[d];if(i.setNode(s),f){var l=r[f],h=i.edge(l,s);i.setEdge(l,s,Math.max(a(e,d,f),h||0))}f=d})}),i}function la(e,n){return ve(P(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return St(r,function(o,a){var u=wa(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function ha(e,n){var r=P(n),t=j(r),i=O(r);c(["u","d"],function(o){c(["l","r"],function(a){var u=o+a,f=e[u],d;if(f!==n){var s=P(f);d=a==="l"?t-j(s):i-O(s),d&&(e[u]=K(f,function(l){return l+d}))}})})}function va(e,n){return K(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(g(e,t));return(i[1]+i[2])/2})}function pa(e){var n=z(e),r=ie(aa(e,n),oa(e,n)),t={},i;c(["u","d"],function(a){i=a==="u"?n:P(n).reverse(),c(["l","r"],function(u){u==="r"&&(i=g(i,function(l){return P(l).reverse()}));var f=(a==="u"?e.predecessors:e.successors).bind(e),d=da(e,i,r,f),s=sa(e,i,d.root,d.align,u==="r");u==="r"&&(s=K(s,function(l){return-l})),t[a+u]=s})});var o=la(e,t);return ha(t,o),va(t,e.graph().align)}function ba(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),f=0,d;if(f+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":d=-a.width/2;break;case"r":d=a.width/2;break}if(d&&(f+=r?d:-d),d=0,f+=(a.dummy?n:e)/2,f+=(u.dummy?n:e)/2,f+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":d=u.width/2;break;case"r":d=-u.width/2;break}return d&&(f+=r?d:-d),d=0,f}}function wa(e,n){return e.node(n).width}function ga(e){e=pn(e),ma(e),$t(pa(e),function(n,r){e.node(r).x=n})}function ma(e){var n=z(e),r=e.graph().ranksep,t=0;c(n,function(i){var o=O(g(i,function(a){return e.node(a).height}));c(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Ua(e,n){var r=pi;r("layout",()=>{var t=r(" buildLayoutGraph",()=>_a(e));r(" runLayout",()=>ya(t,r)),r(" updateInputGraph",()=>xa(e,t))})}function ya(e,n){n(" makeSpaceForEdgeLabels",()=>ka(e)),n(" removeSelfEdges",()=>Ga(e)),n(" acyclic",()=>fi(e)),n(" nestingGraph.run",()=>Si(e)),n(" rank",()=>Ai(pn(e))),n(" injectEdgeLabelProxies",()=>ja(e)),n(" removeEmptyRanks",()=>hi(e)),n(" nestingGraph.cleanup",()=>Bi(e)),n(" normalizeRanks",()=>li(e)),n(" assignRankMinMax",()=>Aa(e)),n(" removeEdgeLabelProxies",()=>Ma(e)),n(" normalize.run",()=>xi(e)),n(" parentDummyChains",()=>ra(e)),n(" addBorderSegments",()=>bi(e)),n(" order",()=>ea(e)),n(" insertSelfEdges",()=>Da(e)),n(" adjustCoordinateSystem",()=>wi(e)),n(" position",()=>ga(e)),n(" positionSelfEdges",()=>Ya(e)),n(" removeBorderNodes",()=>Ba(e)),n(" normalize.undo",()=>Ei(e)),n(" fixupEdgeLabelCoords",()=>$a(e)),n(" undoCoordinateSystem",()=>gi(e)),n(" translateGraph",()=>Ra(e)),n(" assignNodeIntersects",()=>Sa(e)),n(" reversePoints",()=>Fa(e)),n(" acyclic.undo",()=>si(e))}function xa(e,n){c(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),c(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Oa=["nodesep","edgesep","ranksep","marginx","marginy"],Ea={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ta=["acyclicer","ranker","rankdir","align"],Pa=["width","height"],La={width:0,height:0},Na=["minlen","weight","width","height","labeloffset"],Ca={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ia=["labelpos"];function _a(e){var n=new x({multigraph:!0,compound:!0}),r=ne(e.graph());return n.setGraph(ie({},Ea,ee(r,Oa),Y(r,Ta))),c(e.nodes(),function(t){var i=ne(e.node(t));n.setNode(t,_t(ee(i,Pa),La)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=ne(e.edge(t));n.setEdge(t,ie({},Ca,ee(i,Na),Y(i,Ia)))}),n}function ka(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function ja(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};I(e,"edge-proxy",o,"_ep")}})}function Aa(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=O(n,t.maxRank))}),e.graph().maxRank=n}function Ma(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ra(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function f(d){var s=d.x,l=d.y,h=d.width,p=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-p/2),i=Math.max(i,l+p/2)}c(e.nodes(),function(d){f(e.node(d))}),c(e.edges(),function(d){var s=e.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&f(s)}),n-=a,t-=u,c(e.nodes(),function(d){var s=e.node(d);s.x-=n,s.y-=t}),c(e.edges(),function(d){var s=e.edge(d);c(s.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Sa(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(Re(t,o)),r.points.push(Re(i,a))})}function $a(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Fa(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ba(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(D(r.borderLeft)),a=e.node(D(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Ga(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Da(e){var n=z(e);c(n,function(r){var t=0;c(r,function(i,o){var a=e.node(i);a.order=o+t,c(a.selfEdges,function(u){I(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Ya(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function ee(e,n){return K(Y(e,n),Number)}function ne(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Ua as l};
@@ -1 +1 @@
1
- import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-xKeJvOaV.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-CfB36ohx.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
@@ -1,7 +1,7 @@
1
- import{D as Gn,B as _n,h as Et,d as jn,_ as Sn,u as Vn,a as $n,M as Kt,t as qn}from"./app-chat-kit-CmncbKE7.js";import{isServer as Ke,use as Xn,spread as Yn,mergeProps as Kn,createComponent as Zn,template as bn}from"solid-js/web";import{splitProps as Jn,onCleanup as _t,createSignal as Be,createEffect as Ze,createMemo as Zt,untrack as Je,Show as Qn}from"solid-js";import{m as wn,a as er}from"./markdown-code-BP4ED3mK.js";class tr extends Gn{}const nr=new tr;function rr(e,t,n){return nr.diff(e,t,n)}/*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE */const{entries:yn,setPrototypeOf:Jt,isFrozen:or,getPrototypeOf:ir,getOwnPropertyDescriptor:ar}=Object;let{freeze:ae,seal:me,create:Ie}=Object,{apply:xt,construct:kt}=typeof Reflect<"u"&&Reflect;ae||(ae=function(t){return t});me||(me=function(t){return t});xt||(xt=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)});kt||(kt=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const ze=$(Array.prototype.forEach),sr=$(Array.prototype.lastIndexOf),Qt=$(Array.prototype.pop),We=$(Array.prototype.push),cr=$(Array.prototype.splice),oe=Array.isArray,qe=$(String.prototype.toLowerCase),St=$(String.prototype.toString),en=$(String.prototype.match),Me=$(String.prototype.replace),tn=$(String.prototype.indexOf),lr=$(String.prototype.trim),ur=$(Number.prototype.toString),fr=$(Boolean.prototype.toString),nn=typeof BigInt>"u"?null:$(BigInt.prototype.toString),rn=typeof Symbol>"u"?null:$(Symbol.prototype.toString),G=$(Object.prototype.hasOwnProperty),Ge=$(Object.prototype.toString),te=$(RegExp.prototype.test),Qe=dr(TypeError);function $(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return xt(e,t,r)}}function dr(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return kt(e,n)}}function k(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qe;if(Jt&&Jt(e,null),!oe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(or(t)||(t[r]=a),i=a)}e[i]=!0}return e}function mr(e){for(let t=0;t<e.length;t++)G(e,t)||(e[t]=null);return e}function le(e){const t=Ie(null);for(const[n,r]of yn(e))G(e,n)&&(oe(r)?t[n]=mr(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=le(r):t[n]=r);return t}function pr(e){switch(typeof e){case"string":return e;case"number":return ur(e);case"boolean":return fr(e);case"bigint":return nn?nn(e):"0";case"symbol":return rn?rn(e):"Symbol()";case"undefined":return Ge(e);case"function":case"object":{if(e===null)return Ge(e);const t=e,n=Pe(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Ge(r)}return Ge(e)}default:return Ge(e)}}function Pe(e,t){for(;e!==null;){const r=ar(e,t);if(r){if(r.get)return $(r.get);if(typeof r.value=="function")return $(r.value)}e=ir(e)}function n(){return null}return n}function hr(e){try{return te(e,""),!0}catch{return!1}}const on=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bt=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wt=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gr=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),yt=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Tr=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),an=ae(["#text"]),sn=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),vt=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),cn=ae(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),et=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ar=me(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Er=me(/<%[\w\W]*|[\w\W]*%>/gm),_r=me(/\$\{[\w\W]*/gm),Sr=me(/^data-[\-\w.\u00B7-\uFFFF]+$/),br=me(/^aria-[\-\w]+$/),vn=me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wr=me(/^(?:\w+script|data):/i),yr=me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rn=me(/^html$/i),vr=me(/^[a-z][.\w]*(-[.\w]+)+$/i);var ln=Object.freeze({__proto__:null,ARIA_ATTR:br,ATTR_WHITESPACE:yr,CUSTOM_ELEMENT:vr,DATA_ATTR:Sr,DOCTYPE_NAME:Rn,ERB_EXPR:Er,IS_ALLOWED_URI:vn,IS_SCRIPT_OR_DATA:wr,MUSTACHE_EXPR:Ar,TMPLIT_EXPR:_r});const je={element:1,text:3,progressingInstruction:7,comment:8,document:9},Rr=function(){return typeof window>"u"?null:window},Or=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},un=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function On(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rr();const t=A=>On(A);if(t.version="3.4.1",t.removed=[],!e||!e.document||e.document.nodeType!==je.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:u,Element:m,NodeFilter:l,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:w,DOMParser:v,trustedTypes:d}=e,h=m.prototype,x=Pe(h,"cloneNode"),H=Pe(h,"remove"),L=Pe(h,"nextSibling"),W=Pe(h,"childNodes"),P=Pe(h,"parentNode");if(typeof s=="function"){const A=n.createElement("template");A.content&&A.content.ownerDocument&&(n=A.content.ownerDocument)}let F,fe="";const{implementation:re,createNodeIterator:ye,createDocumentFragment:ve,getElementsByTagName:Te}=n,{importNode:Se}=r;let z=un();t.isSupported=typeof yn=="function"&&typeof P=="function"&&re&&re.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Re,ERB_EXPR:U,TMPLIT_EXPR:ue,DATA_ATTR:Ae,ARIA_ATTR:xe,IS_SCRIPT_OR_DATA:Le,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:S}=ln;let{IS_ALLOWED_URI:E}=ln,y=null;const R=k({},[...on,...bt,...wt,...yt,...an]);let _=null;const g=k({},[...sn,...vt,...cn,...et]);let T=Object.seal(Ie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),I=null,b=null;const O=Object.seal(Ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let N=!0,Y=!0,pe=!1,K=!0,Z=!1,C=!0,Q=!1,D=!1,ee=!1,M=!1,q=!1,j=!1,se=!0,Fe=!1;const Mt="user-content-";let ct=!0,Ue=!1,Ce={},Ee=null;const lt=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let It=null;const Pt=k({},["audio","video","img","source","image","track"]);let ut=null;const Ft=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",_e="http://www.w3.org/1999/xhtml";let Ne=_e,ft=!1,dt=null;const Pn=k({},[Xe,Ye,_e],St);let mt=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["annotation-xml"]);const Fn=k({},["title","style","font","a","script"]);let He=null;const Un=["application/xhtml+xml","text/html"],Hn="text/html";let X=null,De=null;const Bn=n.createElement("form"),Ut=function(o){return o instanceof RegExp||o instanceof Function},ht=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(De&&De===o)return;(!o||typeof o!="object")&&(o={}),o=le(o),He=Un.indexOf(o.PARSER_MEDIA_TYPE)===-1?Hn:o.PARSER_MEDIA_TYPE,X=He==="application/xhtml+xml"?St:qe,y=G(o,"ALLOWED_TAGS")&&oe(o.ALLOWED_TAGS)?k({},o.ALLOWED_TAGS,X):R,_=G(o,"ALLOWED_ATTR")&&oe(o.ALLOWED_ATTR)?k({},o.ALLOWED_ATTR,X):g,dt=G(o,"ALLOWED_NAMESPACES")&&oe(o.ALLOWED_NAMESPACES)?k({},o.ALLOWED_NAMESPACES,St):Pn,ut=G(o,"ADD_URI_SAFE_ATTR")&&oe(o.ADD_URI_SAFE_ATTR)?k(le(Ft),o.ADD_URI_SAFE_ATTR,X):Ft,It=G(o,"ADD_DATA_URI_TAGS")&&oe(o.ADD_DATA_URI_TAGS)?k(le(Pt),o.ADD_DATA_URI_TAGS,X):Pt,Ee=G(o,"FORBID_CONTENTS")&&oe(o.FORBID_CONTENTS)?k({},o.FORBID_CONTENTS,X):lt,I=G(o,"FORBID_TAGS")&&oe(o.FORBID_TAGS)?k({},o.FORBID_TAGS,X):le({}),b=G(o,"FORBID_ATTR")&&oe(o.FORBID_ATTR)?k({},o.FORBID_ATTR,X):le({}),Ce=G(o,"USE_PROFILES")?o.USE_PROFILES&&typeof o.USE_PROFILES=="object"?le(o.USE_PROFILES):o.USE_PROFILES:!1,N=o.ALLOW_ARIA_ATTR!==!1,Y=o.ALLOW_DATA_ATTR!==!1,pe=o.ALLOW_UNKNOWN_PROTOCOLS||!1,K=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=o.SAFE_FOR_TEMPLATES||!1,C=o.SAFE_FOR_XML!==!1,Q=o.WHOLE_DOCUMENT||!1,M=o.RETURN_DOM||!1,q=o.RETURN_DOM_FRAGMENT||!1,j=o.RETURN_TRUSTED_TYPE||!1,ee=o.FORCE_BODY||!1,se=o.SANITIZE_DOM!==!1,Fe=o.SANITIZE_NAMED_PROPS||!1,ct=o.KEEP_CONTENT!==!1,Ue=o.IN_PLACE||!1,E=hr(o.ALLOWED_URI_REGEXP)?o.ALLOWED_URI_REGEXP:vn,Ne=typeof o.NAMESPACE=="string"?o.NAMESPACE:_e,mt=G(o,"MATHML_TEXT_INTEGRATION_POINTS")&&o.MATHML_TEXT_INTEGRATION_POINTS&&typeof o.MATHML_TEXT_INTEGRATION_POINTS=="object"?le(o.MATHML_TEXT_INTEGRATION_POINTS):k({},["mi","mo","mn","ms","mtext"]),pt=G(o,"HTML_INTEGRATION_POINTS")&&o.HTML_INTEGRATION_POINTS&&typeof o.HTML_INTEGRATION_POINTS=="object"?le(o.HTML_INTEGRATION_POINTS):k({},["annotation-xml"]);const c=G(o,"CUSTOM_ELEMENT_HANDLING")&&o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING=="object"?le(o.CUSTOM_ELEMENT_HANDLING):Ie(null);if(T=Ie(null),G(c,"tagNameCheck")&&Ut(c.tagNameCheck)&&(T.tagNameCheck=c.tagNameCheck),G(c,"attributeNameCheck")&&Ut(c.attributeNameCheck)&&(T.attributeNameCheck=c.attributeNameCheck),G(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),Z&&(Y=!1),q&&(M=!0),Ce&&(y=k({},an),_=Ie(null),Ce.html===!0&&(k(y,on),k(_,sn)),Ce.svg===!0&&(k(y,bt),k(_,vt),k(_,et)),Ce.svgFilters===!0&&(k(y,wt),k(_,vt),k(_,et)),Ce.mathMl===!0&&(k(y,yt),k(_,cn),k(_,et))),O.tagCheck=null,O.attributeCheck=null,G(o,"ADD_TAGS")&&(typeof o.ADD_TAGS=="function"?O.tagCheck=o.ADD_TAGS:oe(o.ADD_TAGS)&&(y===R&&(y=le(y)),k(y,o.ADD_TAGS,X))),G(o,"ADD_ATTR")&&(typeof o.ADD_ATTR=="function"?O.attributeCheck=o.ADD_ATTR:oe(o.ADD_ATTR)&&(_===g&&(_=le(_)),k(_,o.ADD_ATTR,X))),G(o,"ADD_URI_SAFE_ATTR")&&oe(o.ADD_URI_SAFE_ATTR)&&k(ut,o.ADD_URI_SAFE_ATTR,X),G(o,"FORBID_CONTENTS")&&oe(o.FORBID_CONTENTS)&&(Ee===lt&&(Ee=le(Ee)),k(Ee,o.FORBID_CONTENTS,X)),G(o,"ADD_FORBID_CONTENTS")&&oe(o.ADD_FORBID_CONTENTS)&&(Ee===lt&&(Ee=le(Ee)),k(Ee,o.ADD_FORBID_CONTENTS,X)),ct&&(y["#text"]=!0),Q&&k(y,["html","head","body"]),y.table&&(k(y,["tbody"]),delete I.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=o.TRUSTED_TYPES_POLICY,fe=F.createHTML("")}else F===void 0&&(F=Or(d,i)),F!==null&&typeof fe=="string"&&(fe=F.createHTML(""));ae&&ae(o),De=o},Ht=k({},[...bt,...wt,...gr]),Bt=k({},[...yt,...Tr]),zn=function(o){let c=P(o);(!c||!c.tagName)&&(c={namespaceURI:Ne,tagName:"template"});const p=qe(o.tagName),B=qe(c.tagName);return dt[o.namespaceURI]?o.namespaceURI===Ye?c.namespaceURI===_e?p==="svg":c.namespaceURI===Xe?p==="svg"&&(B==="annotation-xml"||mt[B]):!!Ht[p]:o.namespaceURI===Xe?c.namespaceURI===_e?p==="math":c.namespaceURI===Ye?p==="math"&&pt[B]:!!Bt[p]:o.namespaceURI===_e?c.namespaceURI===Ye&&!pt[B]||c.namespaceURI===Xe&&!mt[B]?!1:!Bt[p]&&(Fn[p]||!Ht[p]):!!(He==="application/xhtml+xml"&&dt[o.namespaceURI]):!1},he=function(o){We(t.removed,{element:o});try{P(o).removeChild(o)}catch{H(o)}},ke=function(o,c){try{We(t.removed,{attribute:c.getAttributeNode(o),from:c})}catch{We(t.removed,{attribute:null,from:c})}if(c.removeAttribute(o),o==="is")if(M||q)try{he(c)}catch{}else try{c.setAttribute(o,"")}catch{}},zt=function(o){let c=null,p=null;if(ee)o="<remove></remove>"+o;else{const V=en(o,/^[\r\n\t ]+/);p=V&&V[0]}He==="application/xhtml+xml"&&Ne===_e&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const B=F?F.createHTML(o):o;if(Ne===_e)try{c=new v().parseFromString(B,He)}catch{}if(!c||!c.documentElement){c=re.createDocument(Ne,"template",null);try{c.documentElement.innerHTML=ft?fe:B}catch{}}const ne=c.body||c.documentElement;return o&&p&&ne.insertBefore(n.createTextNode(p),ne.childNodes[0]||null),Ne===_e?Te.call(c,Q?"html":"body")[0]:Q?c.documentElement:ne},Wt=function(o){return ye.call(o.ownerDocument||o,o,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},gt=function(o){return o instanceof w&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof f)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},Tt=function(o){return typeof u=="function"&&o instanceof u};function we(A,o,c){ze(A,p=>{p.call(t,o,c,De)})}const Gt=function(o){let c=null;if(we(z.beforeSanitizeElements,o,null),gt(o))return he(o),!0;const p=X(o.nodeName);if(we(z.uponSanitizeElement,o,{tagName:p,allowedTags:y}),C&&o.hasChildNodes()&&!Tt(o.firstElementChild)&&te(/<[/\w!]/g,o.innerHTML)&&te(/<[/\w!]/g,o.textContent)||C&&o.namespaceURI===_e&&p==="style"&&Tt(o.firstElementChild)||o.nodeType===je.progressingInstruction||C&&o.nodeType===je.comment&&te(/<[/\w]/g,o.data))return he(o),!0;if(I[p]||!(O.tagCheck instanceof Function&&O.tagCheck(p))&&!y[p]){if(!I[p]&&Vt(p)&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,p)||T.tagNameCheck instanceof Function&&T.tagNameCheck(p)))return!1;if(ct&&!Ee[p]){const B=P(o)||o.parentNode,ne=W(o)||o.childNodes;if(ne&&B){const V=ne.length;for(let ce=V-1;ce>=0;--ce){const de=x(ne[ce],!0);B.insertBefore(de,L(o))}}}return he(o),!0}return o instanceof m&&!zn(o)||(p==="noscript"||p==="noembed"||p==="noframes")&&te(/<\/no(script|embed|frames)/i,o.innerHTML)?(he(o),!0):(Z&&o.nodeType===je.text&&(c=o.textContent,ze([Re,U,ue],B=>{c=Me(c,B," ")}),o.textContent!==c&&(We(t.removed,{element:o.cloneNode()}),o.textContent=c)),we(z.afterSanitizeElements,o,null),!1)},jt=function(o,c,p){if(b[c]||se&&(c==="id"||c==="name")&&(p in n||p in Bn))return!1;if(!(Y&&!b[c]&&te(Ae,c))){if(!(N&&te(xe,c))){if(!(O.attributeCheck instanceof Function&&O.attributeCheck(c,o))){if(!_[c]||b[c]){if(!(Vt(o)&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,o)||T.tagNameCheck instanceof Function&&T.tagNameCheck(o))&&(T.attributeNameCheck instanceof RegExp&&te(T.attributeNameCheck,c)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(c,o))||c==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,p)||T.tagNameCheck instanceof Function&&T.tagNameCheck(p))))return!1}else if(!ut[c]){if(!te(E,Me(p,be,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&o!=="script"&&tn(p,"data:")===0&&It[o])){if(!(pe&&!te(Le,Me(p,be,"")))){if(p)return!1}}}}}}}return!0},Wn=k({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vt=function(o){return!Wn[qe(o)]&&te(S,o)},$t=function(o){we(z.beforeSanitizeAttributes,o,null);const{attributes:c}=o;if(!c||gt(o))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let B=c.length;for(;B--;){const ne=c[B],{name:V,namespaceURI:ce,value:de}=ne,ge=X(V),At=de;let J=V==="value"?At:lr(At);if(p.attrName=ge,p.attrValue=J,p.keepAttr=!0,p.forceKeepAttr=void 0,we(z.uponSanitizeAttribute,o,p),J=p.attrValue,Fe&&(ge==="id"||ge==="name")&&tn(J,Mt)!==0&&(ke(V,o),J=Mt+J),C&&te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,J)){ke(V,o);continue}if(ge==="attributename"&&en(J,"href")){ke(V,o);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){ke(V,o);continue}if(!K&&te(/\/>/i,J)){ke(V,o);continue}Z&&ze([Re,U,ue],Yt=>{J=Me(J,Yt," ")});const Xt=X(o.nodeName);if(!jt(Xt,ge,J)){ke(V,o);continue}if(F&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!ce)switch(d.getAttributeType(Xt,ge)){case"TrustedHTML":{J=F.createHTML(J);break}case"TrustedScriptURL":{J=F.createScriptURL(J);break}}if(J!==At)try{ce?o.setAttributeNS(ce,V,J):o.setAttribute(V,J),gt(o)?he(o):Qt(t.removed)}catch{ke(V,o)}}we(z.afterSanitizeAttributes,o,null)},qt=function(o){let c=null;const p=Wt(o);for(we(z.beforeSanitizeShadowDOM,o,null);c=p.nextNode();)we(z.uponSanitizeShadowNode,c,null),Gt(c),$t(c),c.content instanceof a&&qt(c.content);we(z.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(A){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,p=null,B=null,ne=null;if(ft=!A,ft&&(A="<!-->"),typeof A!="string"&&!Tt(A)&&(A=pr(A),typeof A!="string"))throw Qe("dirty is not a string, aborting");if(!t.isSupported)return A;if(D||ht(o),t.removed=[],typeof A=="string"&&(Ue=!1),Ue){const de=A.nodeName;if(typeof de=="string"){const ge=X(de);if(!y[ge]||I[ge])throw Qe("root node is forbidden and cannot be sanitized in-place")}}else if(A instanceof u)c=zt("<!---->"),p=c.ownerDocument.importNode(A,!0),p.nodeType===je.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?c=p:c.appendChild(p);else{if(!M&&!Z&&!Q&&A.indexOf("<")===-1)return F&&j?F.createHTML(A):A;if(c=zt(A),!c)return M?null:j?fe:""}c&&ee&&he(c.firstChild);const V=Wt(Ue?A:c);for(;B=V.nextNode();)Gt(B),$t(B),B.content instanceof a&&qt(B.content);if(Ue)return A;if(M){if(Z){c.normalize();let de=c.innerHTML;ze([Re,U,ue],ge=>{de=Me(de,ge," ")}),c.innerHTML=de}if(q)for(ne=ve.call(c.ownerDocument);c.firstChild;)ne.appendChild(c.firstChild);else ne=c;return(_.shadowroot||_.shadowrootmode)&&(ne=Se.call(r,ne,!0)),ne}let ce=Q?c.outerHTML:c.innerHTML;return Q&&y["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&te(Rn,c.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
1
+ import{D as Gn,B as _n,h as Et,d as jn,_ as Sn,u as Vn,a as $n,M as Kt,t as qn}from"./app-chat-kit-C-b6Y63T.js";import{isServer as Ke,use as Xn,spread as Yn,mergeProps as Kn,createComponent as Zn,template as bn}from"solid-js/web";import{splitProps as Jn,onCleanup as _t,createSignal as Be,createEffect as Ze,createMemo as Zt,untrack as Je,Show as Qn}from"solid-js";import{m as wn,a as er}from"./markdown-code-BTfpGmJj.js";class tr extends Gn{}const nr=new tr;function rr(e,t,n){return nr.diff(e,t,n)}/*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE */const{entries:yn,setPrototypeOf:Jt,isFrozen:or,getPrototypeOf:ir,getOwnPropertyDescriptor:ar}=Object;let{freeze:ae,seal:me,create:Ie}=Object,{apply:xt,construct:kt}=typeof Reflect<"u"&&Reflect;ae||(ae=function(t){return t});me||(me=function(t){return t});xt||(xt=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)});kt||(kt=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const ze=$(Array.prototype.forEach),sr=$(Array.prototype.lastIndexOf),Qt=$(Array.prototype.pop),We=$(Array.prototype.push),cr=$(Array.prototype.splice),oe=Array.isArray,qe=$(String.prototype.toLowerCase),St=$(String.prototype.toString),en=$(String.prototype.match),Me=$(String.prototype.replace),tn=$(String.prototype.indexOf),lr=$(String.prototype.trim),ur=$(Number.prototype.toString),fr=$(Boolean.prototype.toString),nn=typeof BigInt>"u"?null:$(BigInt.prototype.toString),rn=typeof Symbol>"u"?null:$(Symbol.prototype.toString),G=$(Object.prototype.hasOwnProperty),Ge=$(Object.prototype.toString),te=$(RegExp.prototype.test),Qe=dr(TypeError);function $(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return xt(e,t,r)}}function dr(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return kt(e,n)}}function k(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qe;if(Jt&&Jt(e,null),!oe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(or(t)||(t[r]=a),i=a)}e[i]=!0}return e}function mr(e){for(let t=0;t<e.length;t++)G(e,t)||(e[t]=null);return e}function le(e){const t=Ie(null);for(const[n,r]of yn(e))G(e,n)&&(oe(r)?t[n]=mr(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=le(r):t[n]=r);return t}function pr(e){switch(typeof e){case"string":return e;case"number":return ur(e);case"boolean":return fr(e);case"bigint":return nn?nn(e):"0";case"symbol":return rn?rn(e):"Symbol()";case"undefined":return Ge(e);case"function":case"object":{if(e===null)return Ge(e);const t=e,n=Pe(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Ge(r)}return Ge(e)}default:return Ge(e)}}function Pe(e,t){for(;e!==null;){const r=ar(e,t);if(r){if(r.get)return $(r.get);if(typeof r.value=="function")return $(r.value)}e=ir(e)}function n(){return null}return n}function hr(e){try{return te(e,""),!0}catch{return!1}}const on=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bt=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wt=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gr=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),yt=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Tr=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),an=ae(["#text"]),sn=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),vt=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),cn=ae(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),et=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ar=me(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Er=me(/<%[\w\W]*|[\w\W]*%>/gm),_r=me(/\$\{[\w\W]*/gm),Sr=me(/^data-[\-\w.\u00B7-\uFFFF]+$/),br=me(/^aria-[\-\w]+$/),vn=me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wr=me(/^(?:\w+script|data):/i),yr=me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rn=me(/^html$/i),vr=me(/^[a-z][.\w]*(-[.\w]+)+$/i);var ln=Object.freeze({__proto__:null,ARIA_ATTR:br,ATTR_WHITESPACE:yr,CUSTOM_ELEMENT:vr,DATA_ATTR:Sr,DOCTYPE_NAME:Rn,ERB_EXPR:Er,IS_ALLOWED_URI:vn,IS_SCRIPT_OR_DATA:wr,MUSTACHE_EXPR:Ar,TMPLIT_EXPR:_r});const je={element:1,text:3,progressingInstruction:7,comment:8,document:9},Rr=function(){return typeof window>"u"?null:window},Or=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},un=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function On(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rr();const t=A=>On(A);if(t.version="3.4.1",t.removed=[],!e||!e.document||e.document.nodeType!==je.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:u,Element:m,NodeFilter:l,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:w,DOMParser:v,trustedTypes:d}=e,h=m.prototype,x=Pe(h,"cloneNode"),H=Pe(h,"remove"),L=Pe(h,"nextSibling"),W=Pe(h,"childNodes"),P=Pe(h,"parentNode");if(typeof s=="function"){const A=n.createElement("template");A.content&&A.content.ownerDocument&&(n=A.content.ownerDocument)}let F,fe="";const{implementation:re,createNodeIterator:ye,createDocumentFragment:ve,getElementsByTagName:Te}=n,{importNode:Se}=r;let z=un();t.isSupported=typeof yn=="function"&&typeof P=="function"&&re&&re.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Re,ERB_EXPR:U,TMPLIT_EXPR:ue,DATA_ATTR:Ae,ARIA_ATTR:xe,IS_SCRIPT_OR_DATA:Le,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:S}=ln;let{IS_ALLOWED_URI:E}=ln,y=null;const R=k({},[...on,...bt,...wt,...yt,...an]);let _=null;const g=k({},[...sn,...vt,...cn,...et]);let T=Object.seal(Ie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),I=null,b=null;const O=Object.seal(Ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let N=!0,Y=!0,pe=!1,K=!0,Z=!1,C=!0,Q=!1,D=!1,ee=!1,M=!1,q=!1,j=!1,se=!0,Fe=!1;const Mt="user-content-";let ct=!0,Ue=!1,Ce={},Ee=null;const lt=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let It=null;const Pt=k({},["audio","video","img","source","image","track"]);let ut=null;const Ft=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",_e="http://www.w3.org/1999/xhtml";let Ne=_e,ft=!1,dt=null;const Pn=k({},[Xe,Ye,_e],St);let mt=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["annotation-xml"]);const Fn=k({},["title","style","font","a","script"]);let He=null;const Un=["application/xhtml+xml","text/html"],Hn="text/html";let X=null,De=null;const Bn=n.createElement("form"),Ut=function(o){return o instanceof RegExp||o instanceof Function},ht=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(De&&De===o)return;(!o||typeof o!="object")&&(o={}),o=le(o),He=Un.indexOf(o.PARSER_MEDIA_TYPE)===-1?Hn:o.PARSER_MEDIA_TYPE,X=He==="application/xhtml+xml"?St:qe,y=G(o,"ALLOWED_TAGS")&&oe(o.ALLOWED_TAGS)?k({},o.ALLOWED_TAGS,X):R,_=G(o,"ALLOWED_ATTR")&&oe(o.ALLOWED_ATTR)?k({},o.ALLOWED_ATTR,X):g,dt=G(o,"ALLOWED_NAMESPACES")&&oe(o.ALLOWED_NAMESPACES)?k({},o.ALLOWED_NAMESPACES,St):Pn,ut=G(o,"ADD_URI_SAFE_ATTR")&&oe(o.ADD_URI_SAFE_ATTR)?k(le(Ft),o.ADD_URI_SAFE_ATTR,X):Ft,It=G(o,"ADD_DATA_URI_TAGS")&&oe(o.ADD_DATA_URI_TAGS)?k(le(Pt),o.ADD_DATA_URI_TAGS,X):Pt,Ee=G(o,"FORBID_CONTENTS")&&oe(o.FORBID_CONTENTS)?k({},o.FORBID_CONTENTS,X):lt,I=G(o,"FORBID_TAGS")&&oe(o.FORBID_TAGS)?k({},o.FORBID_TAGS,X):le({}),b=G(o,"FORBID_ATTR")&&oe(o.FORBID_ATTR)?k({},o.FORBID_ATTR,X):le({}),Ce=G(o,"USE_PROFILES")?o.USE_PROFILES&&typeof o.USE_PROFILES=="object"?le(o.USE_PROFILES):o.USE_PROFILES:!1,N=o.ALLOW_ARIA_ATTR!==!1,Y=o.ALLOW_DATA_ATTR!==!1,pe=o.ALLOW_UNKNOWN_PROTOCOLS||!1,K=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=o.SAFE_FOR_TEMPLATES||!1,C=o.SAFE_FOR_XML!==!1,Q=o.WHOLE_DOCUMENT||!1,M=o.RETURN_DOM||!1,q=o.RETURN_DOM_FRAGMENT||!1,j=o.RETURN_TRUSTED_TYPE||!1,ee=o.FORCE_BODY||!1,se=o.SANITIZE_DOM!==!1,Fe=o.SANITIZE_NAMED_PROPS||!1,ct=o.KEEP_CONTENT!==!1,Ue=o.IN_PLACE||!1,E=hr(o.ALLOWED_URI_REGEXP)?o.ALLOWED_URI_REGEXP:vn,Ne=typeof o.NAMESPACE=="string"?o.NAMESPACE:_e,mt=G(o,"MATHML_TEXT_INTEGRATION_POINTS")&&o.MATHML_TEXT_INTEGRATION_POINTS&&typeof o.MATHML_TEXT_INTEGRATION_POINTS=="object"?le(o.MATHML_TEXT_INTEGRATION_POINTS):k({},["mi","mo","mn","ms","mtext"]),pt=G(o,"HTML_INTEGRATION_POINTS")&&o.HTML_INTEGRATION_POINTS&&typeof o.HTML_INTEGRATION_POINTS=="object"?le(o.HTML_INTEGRATION_POINTS):k({},["annotation-xml"]);const c=G(o,"CUSTOM_ELEMENT_HANDLING")&&o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING=="object"?le(o.CUSTOM_ELEMENT_HANDLING):Ie(null);if(T=Ie(null),G(c,"tagNameCheck")&&Ut(c.tagNameCheck)&&(T.tagNameCheck=c.tagNameCheck),G(c,"attributeNameCheck")&&Ut(c.attributeNameCheck)&&(T.attributeNameCheck=c.attributeNameCheck),G(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),Z&&(Y=!1),q&&(M=!0),Ce&&(y=k({},an),_=Ie(null),Ce.html===!0&&(k(y,on),k(_,sn)),Ce.svg===!0&&(k(y,bt),k(_,vt),k(_,et)),Ce.svgFilters===!0&&(k(y,wt),k(_,vt),k(_,et)),Ce.mathMl===!0&&(k(y,yt),k(_,cn),k(_,et))),O.tagCheck=null,O.attributeCheck=null,G(o,"ADD_TAGS")&&(typeof o.ADD_TAGS=="function"?O.tagCheck=o.ADD_TAGS:oe(o.ADD_TAGS)&&(y===R&&(y=le(y)),k(y,o.ADD_TAGS,X))),G(o,"ADD_ATTR")&&(typeof o.ADD_ATTR=="function"?O.attributeCheck=o.ADD_ATTR:oe(o.ADD_ATTR)&&(_===g&&(_=le(_)),k(_,o.ADD_ATTR,X))),G(o,"ADD_URI_SAFE_ATTR")&&oe(o.ADD_URI_SAFE_ATTR)&&k(ut,o.ADD_URI_SAFE_ATTR,X),G(o,"FORBID_CONTENTS")&&oe(o.FORBID_CONTENTS)&&(Ee===lt&&(Ee=le(Ee)),k(Ee,o.FORBID_CONTENTS,X)),G(o,"ADD_FORBID_CONTENTS")&&oe(o.ADD_FORBID_CONTENTS)&&(Ee===lt&&(Ee=le(Ee)),k(Ee,o.ADD_FORBID_CONTENTS,X)),ct&&(y["#text"]=!0),Q&&k(y,["html","head","body"]),y.table&&(k(y,["tbody"]),delete I.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=o.TRUSTED_TYPES_POLICY,fe=F.createHTML("")}else F===void 0&&(F=Or(d,i)),F!==null&&typeof fe=="string"&&(fe=F.createHTML(""));ae&&ae(o),De=o},Ht=k({},[...bt,...wt,...gr]),Bt=k({},[...yt,...Tr]),zn=function(o){let c=P(o);(!c||!c.tagName)&&(c={namespaceURI:Ne,tagName:"template"});const p=qe(o.tagName),B=qe(c.tagName);return dt[o.namespaceURI]?o.namespaceURI===Ye?c.namespaceURI===_e?p==="svg":c.namespaceURI===Xe?p==="svg"&&(B==="annotation-xml"||mt[B]):!!Ht[p]:o.namespaceURI===Xe?c.namespaceURI===_e?p==="math":c.namespaceURI===Ye?p==="math"&&pt[B]:!!Bt[p]:o.namespaceURI===_e?c.namespaceURI===Ye&&!pt[B]||c.namespaceURI===Xe&&!mt[B]?!1:!Bt[p]&&(Fn[p]||!Ht[p]):!!(He==="application/xhtml+xml"&&dt[o.namespaceURI]):!1},he=function(o){We(t.removed,{element:o});try{P(o).removeChild(o)}catch{H(o)}},ke=function(o,c){try{We(t.removed,{attribute:c.getAttributeNode(o),from:c})}catch{We(t.removed,{attribute:null,from:c})}if(c.removeAttribute(o),o==="is")if(M||q)try{he(c)}catch{}else try{c.setAttribute(o,"")}catch{}},zt=function(o){let c=null,p=null;if(ee)o="<remove></remove>"+o;else{const V=en(o,/^[\r\n\t ]+/);p=V&&V[0]}He==="application/xhtml+xml"&&Ne===_e&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const B=F?F.createHTML(o):o;if(Ne===_e)try{c=new v().parseFromString(B,He)}catch{}if(!c||!c.documentElement){c=re.createDocument(Ne,"template",null);try{c.documentElement.innerHTML=ft?fe:B}catch{}}const ne=c.body||c.documentElement;return o&&p&&ne.insertBefore(n.createTextNode(p),ne.childNodes[0]||null),Ne===_e?Te.call(c,Q?"html":"body")[0]:Q?c.documentElement:ne},Wt=function(o){return ye.call(o.ownerDocument||o,o,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},gt=function(o){return o instanceof w&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof f)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},Tt=function(o){return typeof u=="function"&&o instanceof u};function we(A,o,c){ze(A,p=>{p.call(t,o,c,De)})}const Gt=function(o){let c=null;if(we(z.beforeSanitizeElements,o,null),gt(o))return he(o),!0;const p=X(o.nodeName);if(we(z.uponSanitizeElement,o,{tagName:p,allowedTags:y}),C&&o.hasChildNodes()&&!Tt(o.firstElementChild)&&te(/<[/\w!]/g,o.innerHTML)&&te(/<[/\w!]/g,o.textContent)||C&&o.namespaceURI===_e&&p==="style"&&Tt(o.firstElementChild)||o.nodeType===je.progressingInstruction||C&&o.nodeType===je.comment&&te(/<[/\w]/g,o.data))return he(o),!0;if(I[p]||!(O.tagCheck instanceof Function&&O.tagCheck(p))&&!y[p]){if(!I[p]&&Vt(p)&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,p)||T.tagNameCheck instanceof Function&&T.tagNameCheck(p)))return!1;if(ct&&!Ee[p]){const B=P(o)||o.parentNode,ne=W(o)||o.childNodes;if(ne&&B){const V=ne.length;for(let ce=V-1;ce>=0;--ce){const de=x(ne[ce],!0);B.insertBefore(de,L(o))}}}return he(o),!0}return o instanceof m&&!zn(o)||(p==="noscript"||p==="noembed"||p==="noframes")&&te(/<\/no(script|embed|frames)/i,o.innerHTML)?(he(o),!0):(Z&&o.nodeType===je.text&&(c=o.textContent,ze([Re,U,ue],B=>{c=Me(c,B," ")}),o.textContent!==c&&(We(t.removed,{element:o.cloneNode()}),o.textContent=c)),we(z.afterSanitizeElements,o,null),!1)},jt=function(o,c,p){if(b[c]||se&&(c==="id"||c==="name")&&(p in n||p in Bn))return!1;if(!(Y&&!b[c]&&te(Ae,c))){if(!(N&&te(xe,c))){if(!(O.attributeCheck instanceof Function&&O.attributeCheck(c,o))){if(!_[c]||b[c]){if(!(Vt(o)&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,o)||T.tagNameCheck instanceof Function&&T.tagNameCheck(o))&&(T.attributeNameCheck instanceof RegExp&&te(T.attributeNameCheck,c)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(c,o))||c==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&te(T.tagNameCheck,p)||T.tagNameCheck instanceof Function&&T.tagNameCheck(p))))return!1}else if(!ut[c]){if(!te(E,Me(p,be,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&o!=="script"&&tn(p,"data:")===0&&It[o])){if(!(pe&&!te(Le,Me(p,be,"")))){if(p)return!1}}}}}}}return!0},Wn=k({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vt=function(o){return!Wn[qe(o)]&&te(S,o)},$t=function(o){we(z.beforeSanitizeAttributes,o,null);const{attributes:c}=o;if(!c||gt(o))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let B=c.length;for(;B--;){const ne=c[B],{name:V,namespaceURI:ce,value:de}=ne,ge=X(V),At=de;let J=V==="value"?At:lr(At);if(p.attrName=ge,p.attrValue=J,p.keepAttr=!0,p.forceKeepAttr=void 0,we(z.uponSanitizeAttribute,o,p),J=p.attrValue,Fe&&(ge==="id"||ge==="name")&&tn(J,Mt)!==0&&(ke(V,o),J=Mt+J),C&&te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,J)){ke(V,o);continue}if(ge==="attributename"&&en(J,"href")){ke(V,o);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){ke(V,o);continue}if(!K&&te(/\/>/i,J)){ke(V,o);continue}Z&&ze([Re,U,ue],Yt=>{J=Me(J,Yt," ")});const Xt=X(o.nodeName);if(!jt(Xt,ge,J)){ke(V,o);continue}if(F&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!ce)switch(d.getAttributeType(Xt,ge)){case"TrustedHTML":{J=F.createHTML(J);break}case"TrustedScriptURL":{J=F.createScriptURL(J);break}}if(J!==At)try{ce?o.setAttributeNS(ce,V,J):o.setAttribute(V,J),gt(o)?he(o):Qt(t.removed)}catch{ke(V,o)}}we(z.afterSanitizeAttributes,o,null)},qt=function(o){let c=null;const p=Wt(o);for(we(z.beforeSanitizeShadowDOM,o,null);c=p.nextNode();)we(z.uponSanitizeShadowNode,c,null),Gt(c),$t(c),c.content instanceof a&&qt(c.content);we(z.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(A){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,p=null,B=null,ne=null;if(ft=!A,ft&&(A="<!-->"),typeof A!="string"&&!Tt(A)&&(A=pr(A),typeof A!="string"))throw Qe("dirty is not a string, aborting");if(!t.isSupported)return A;if(D||ht(o),t.removed=[],typeof A=="string"&&(Ue=!1),Ue){const de=A.nodeName;if(typeof de=="string"){const ge=X(de);if(!y[ge]||I[ge])throw Qe("root node is forbidden and cannot be sanitized in-place")}}else if(A instanceof u)c=zt("<!---->"),p=c.ownerDocument.importNode(A,!0),p.nodeType===je.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?c=p:c.appendChild(p);else{if(!M&&!Z&&!Q&&A.indexOf("<")===-1)return F&&j?F.createHTML(A):A;if(c=zt(A),!c)return M?null:j?fe:""}c&&ee&&he(c.firstChild);const V=Wt(Ue?A:c);for(;B=V.nextNode();)Gt(B),$t(B),B.content instanceof a&&qt(B.content);if(Ue)return A;if(M){if(Z){c.normalize();let de=c.innerHTML;ze([Re,U,ue],ge=>{de=Me(de,ge," ")}),c.innerHTML=de}if(q)for(ne=ve.call(c.ownerDocument);c.firstChild;)ne.appendChild(c.firstChild);else ne=c;return(_.shadowroot||_.shadowrootmode)&&(ne=Se.call(r,ne,!0)),ne}let ce=Q?c.outerHTML:c.innerHTML;return Q&&y["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&te(Rn,c.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
2
2
  `+ce),Z&&ze([Re,U,ue],de=>{ce=Me(ce,de," ")}),F&&j?F.createHTML(ce):ce},t.setConfig=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ht(A),D=!0},t.clearConfig=function(){De=null,D=!1},t.isValidAttribute=function(A,o,c){De||ht({});const p=X(A),B=X(o);return jt(p,B,c)},t.addHook=function(A,o){typeof o=="function"&&We(z[A],o)},t.removeHook=function(A,o){if(o!==void 0){const c=sr(z[A],o);return c===-1?void 0:cr(z[A],c,1)[0]}return Qt(z[A])},t.removeHooks=function(A){z[A]=[]},t.removeAllHooks=function(){z=un()},t}var ot=On(),fn=11;function xr(e,t){var n=t.attributes,r,i,a,s,u;if(!(t.nodeType===fn||e.nodeType===fn)){for(var m=n.length-1;m>=0;m--)r=n[m],i=r.name,a=r.namespaceURI,s=r.value,a?(i=r.localName||i,u=e.getAttributeNS(a,i),u!==s&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,s))):(u=e.getAttribute(i),u!==s&&e.setAttribute(i,s));for(var l=e.attributes,f=l.length-1;f>=0;f--)r=l[f],i=r.name,a=r.namespaceURI,a?(i=r.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var tt,kr="http://www.w3.org/1999/xhtml",ie=typeof document>"u"?void 0:document,Lr=!!ie&&"content"in ie.createElement("template"),Cr=!!ie&&ie.createRange&&"createContextualFragment"in ie.createRange();function Nr(e){var t=ie.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function Dr(e){tt||(tt=ie.createRange(),tt.selectNode(ie.body));var t=tt.createContextualFragment(e);return t.childNodes[0]}function Mr(e){var t=ie.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Ir(e){return e=e.trim(),Lr?Nr(e):Cr?Dr(e):Mr(e)}function nt(e,t){var n=e.nodeName,r=t.nodeName,i,a;return n===r?!0:(i=n.charCodeAt(0),a=r.charCodeAt(0),i<=90&&a>=97?n===r.toUpperCase():a<=90&&i>=97?r===n.toUpperCase():!1)}function Pr(e,t){return!t||t===kr?ie.createElement(e):ie.createElementNS(t,e)}function Fr(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function Rt(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var dn={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}Rt(e,t,"selected")},INPUT:function(e,t){Rt(e,t,"checked"),Rt(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n=-1,r=0,i=e.firstChild,a,s;i;)if(s=i.nodeName&&i.nodeName.toUpperCase(),s==="OPTGROUP")a=i,i=a.firstChild,i||(i=a.nextSibling,a=null);else{if(s==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=n}}},Ve=1,mn=11,pn=3,hn=8;function Oe(){}function Ur(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Hr(e){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"){var a=r;r=ie.createElement("html"),r.innerHTML=a}else if(n.nodeName==="BODY"){var s=r;r=ie.createElement("html"),r.innerHTML=s;var u=r.querySelector("body");u&&(r=u)}else r=Ir(r);else r.nodeType===mn&&(r=r.firstElementChild);var m=i.getNodeKey||Ur,l=i.onBeforeNodeAdded||Oe,f=i.onNodeAdded||Oe,w=i.onBeforeElUpdated||Oe,v=i.onElUpdated||Oe,d=i.onBeforeNodeDiscarded||Oe,h=i.onNodeDiscarded||Oe,x=i.onBeforeElChildrenUpdated||Oe,H=i.skipFromChildren||Oe,L=i.addChild||function(S,E){return S.appendChild(E)},W=i.childrenOnly===!0,P=Object.create(null),F=[];function fe(S){F.push(S)}function re(S,E){if(S.nodeType===Ve)for(var y=S.firstChild;y;){var R=void 0;E&&(R=m(y))?fe(R):(h(y),y.firstChild&&re(y,E)),y=y.nextSibling}}function ye(S,E,y){d(S)!==!1&&(E&&E.removeChild(S),h(S),re(S,y))}function ve(S){if(S.nodeType===Ve||S.nodeType===mn)for(var E=S.firstChild;E;){var y=m(E);y&&(P[y]=E),ve(E),E=E.nextSibling}}ve(n);function Te(S){f(S);for(var E=S.firstChild;E;){var y=E.nextSibling,R=m(E);if(R){var _=P[R];_&&nt(E,_)?(E.parentNode.replaceChild(_,E),z(_,E)):Te(E)}else Te(E);E=y}}function Se(S,E,y){for(;E;){var R=E.nextSibling;(y=m(E))?fe(y):ye(E,S,!0),E=R}}function z(S,E,y){var R=m(E);if(R&&delete P[R],!y){var _=w(S,E);if(_===!1||(_ instanceof HTMLElement&&(S=_,ve(S)),e(S,E),v(S),x(S,E)===!1))return}S.nodeName!=="TEXTAREA"?Re(S,E):dn.TEXTAREA(S,E)}function Re(S,E){var y=H(S,E),R=E.firstChild,_=S.firstChild,g,T,I,b,O;e:for(;R;){for(b=R.nextSibling,g=m(R);!y&&_;){if(I=_.nextSibling,R.isSameNode&&R.isSameNode(_)){R=b,_=I;continue e}T=m(_);var N=_.nodeType,Y=void 0;if(N===R.nodeType&&(N===Ve?(g?g!==T&&((O=P[g])?I===O?Y=!1:(S.insertBefore(O,_),T?fe(T):ye(_,S,!0),_=O,T=m(_)):Y=!1):T&&(Y=!1),Y=Y!==!1&&nt(_,R),Y&&z(_,R)):(N===pn||N==hn)&&(Y=!0,_.nodeValue!==R.nodeValue&&(_.nodeValue=R.nodeValue))),Y){R=b,_=I;continue e}T?fe(T):ye(_,S,!0),_=I}if(g&&(O=P[g])&&nt(O,R))y||L(S,O),z(O,R);else{var pe=l(R);pe!==!1&&(pe&&(R=pe),R.actualize&&(R=R.actualize(S.ownerDocument||ie)),L(S,R),Te(R))}R=b,_=I}Se(S,_,T);var K=dn[S.nodeName];K&&K(S,E)}var U=n,ue=U.nodeType,Ae=r.nodeType;if(!W){if(ue===Ve)Ae===Ve?nt(n,r)||(h(n),U=Fr(n,Pr(r.nodeName,r.namespaceURI))):U=r;else if(ue===pn||ue===hn){if(Ae===ue)return U.nodeValue!==r.nodeValue&&(U.nodeValue=r.nodeValue),U;U=r}}if(U===r)h(n);else{if(r.isSameNode&&r.isSameNode(U))return;if(z(U,r,W),F)for(var xe=0,Le=F.length;xe<Le;xe++){var be=P[F[xe]];be&&ye(be,be.parentNode,!1)}}return!W&&U!==n&&n.parentNode&&(U.actualize&&(U=U.actualize(n.ownerDocument||ie)),n.parentNode.replaceChild(U,n)),U}}var Br=Hr(xr);function Lt(e){const t=e.match(/(?:<\/[a-zA-Z][\w:-]*>\s*)+$/)?.[0];if(!t)return;const n=e.slice(0,-t.length),r=n.slice(n.lastIndexOf(">")+1);if(!(!r.trim()||/[<&]/.test(r)))return{prefix:n,closing:t,text:r}}function zr(e,t,n){if(!/^[\p{L}\p{N}\p{M} ,;!?'-]+$/u.test(n))return;const r=Lt(t);if(!(!r||!e.endsWith(r.text)||/[\[\]`*_~\\@]|\bwww\.|:\/\//i.test(r.text)))return r.prefix+n+r.closing}function Wr(e,t,n,r){const i=Lt(e);if(!i||t.length<=e.length||!t.startsWith(i.prefix)||!t.endsWith(i.closing))return;const a=t.slice(i.prefix.length,-i.closing.length);if(/[<&]/.test(a))return;const s=Lt(n);if(!(!s||s.text!==i.text||s.closing!==i.closing))return{text:a,previousText:s.text,html:s.prefix+a+s.closing,baseHash:r}}function Gr(e,t){if(e.getAttribute("data-markdown-hash")!==t.baseHash)return!1;let n=e.lastChild;for(;n&&n!==e;){if(n instanceof Text&&n.data.trim())return n.data!==t.previousText||n.parentElement?.closest("code, pre, a, button")?!1:(n.appendData(t.text),!0);if(n.lastChild){n=n.lastChild;continue}for(;n&&n!==e&&!n.previousSibling;)n=n.parentNode;if(!n||n===e)break;n=n.previousSibling}return!1}new _n({renderer:wn});const jr=e=>({html:e});function Vr(e,t,n){const r=Object.entries(n??{}).map(([i,a])=>` ${i}="${a}"`).join("");return{tag:e,attributes:n,children:t,html:`<${e}${r}>${t.map(i=>i.html).join("")}</${e}>`}}function xn(e,t){const n=e.findLastIndex(s=>s.html.trim()!==""),r=e[n];if(!r)return;let i;if(r.tag&&r.children){const s=xn(r.children,t);if(!s)return;i=Vr(r.tag,s,r.attributes)}else{if(/[<&]/.test(r.html))return;i=jr(r.html+t)}const a=e.slice();return a[n]=i,a}function kn(e){return e.includes("]:")?/^[ \t]{0,3}\[[^\]]+\]:[ \t]*(?:\S+|\r?\n[ \t]+\S+)/m.test(e)||/^[ \t]{0,3}\[\^[^\]]+\]:[ \t]*(?:\S+|\r?\n[ \t]+\S+)/m.test(e):!1}function $r(e){return e?.trim().split(/\s+/,1)[0]||void 0}function Ln(e){return e.match(/^[ \t]{0,3}(`{3,}|~{3,})/)?.[1]}function qr(e,t){const r=e.trimEnd().split(/\r?\n/).at(-1)?.trim()??"",i=t[0];return new RegExp(`^${i}{${t.length},}$`).test(r)}function Xr(e){const t=e.indexOf(`
3
3
  `);return t<0?"":e.slice(t+1)}function Yr(e){return[...e.matchAll(/^([ \t]{0,3})(`{3,}|~{3,})([^\r\n]*)$/gm)].map(t=>({markerStart:t.index+t[1].length,marker:t[2],info:t[3]}))}function Cn(e){return e.marker[0]!=="`"||!e.info.includes("`")}function gn(e,t){return e.marker[0]===t.marker[0]&&e.marker.length>=t.marker.length&&e.info.trim()===""}function Kr(e,t){return Cn(e)&&e.marker[0]===t.marker[0]&&e.marker.length>=t.marker.length&&e.info.trim()!==""}function Zr(e){const t=Yr(e),n=[];for(let a=0;a<t.length;){const s=t[a];if(!Cn(s)){a++;continue}let u,m=!1,l=-1,f=s.marker.length;for(let v=a+1;v<t.length;v++){const d=t[v];if(d.marker[0]===s.marker[0]&&(f=Math.max(f,d.marker.length)),u){gn(d,u)&&(u=void 0);continue}if(Kr(d,s)){u=d,m=!0;continue}if(gn(d,s)){l=v;break}}if(!m){if(l<0)break;a=l+1;continue}const w=s.marker[0].repeat(f+1);if(n.push({start:s.markerStart,length:s.marker.length,marker:w}),l>=0){const v=t[l];n.push({start:v.markerStart,length:v.marker.length,marker:w}),a=l+1;continue}break}n.sort((a,s)=>a.start-s.start);const r=[];let i=0;for(const a of n)r.push(e.slice(i,a.start),a.marker),i=a.start+a.length;return r.push(e.slice(i)),r.join("")}function Tn(e,t){const n=Ln(e.raw),r=n?!qr(e.raw,n):!1;return{raw:t,src:r?Xr(e.raw):e.text,mode:"code",language:$r(e.lang),complete:!r}}function Nn(e){return e.mode==="live"?{...e,src:e.raw,mode:"full",preview:void 0,previewTree:void 0}:e.mode==="code"&&!e.complete?{...e,complete:!0}:e}function it(e,t){if(!e)return[];if(!t)return it(e,!0).map(Nn);const n=Zr(e);if(kn(n))return[{raw:n,src:Et(n),mode:"live"}];const r=new jn.Lexer().blockTokens(n),i=r.findIndex(l=>l.type!=="code"&&/(?:^|\n)\${1,2}(?:\r?\n|$)/.test(l.raw)),a=i>=0?i:r.findLastIndex(l=>l.type!=="space");if(a<0)return[{raw:n,src:Et(n),mode:"live"}];const s=[];for(let l=0;l<a;l++){const f=r[l];if(!f||f.type==="space")continue;let w=f.raw;for(;l+1<a&&r[l+1]?.type==="space";)w+=r[++l].raw;if(f.type==="code"){s.push(Tn(f,w));continue}s.push({raw:w,src:w,mode:"full"})}const u=r.slice(a).map(l=>l.raw).join(""),m=r[a];return m?.type==="code"?[...s,Tn(m,u)]:[...s,{raw:u,src:Et(u),mode:"live"}]}function Jr(e,t){const n=Ln(e.raw);if(!n)return!0;const i=`${e.raw.slice(-(n.length-1))}${t}`;return i.includes(n)?!0:new RegExp(`(?:^|\\n)[ \\t]{0,3}${n[0]}{3,}[ \\t]*(?:\\n|$)`).test(i)}function Qr(e,t){if(e.length<2||kn(t))return;const n=e.slice(0,-1),r=eo(n,t);if(!(!r||r>=t.length))return[...n,...it(t.slice(r),!0)]}function eo(e,t){let n=0;for(const r of e){if(!t.startsWith(r.raw,n))return;n+=r.raw.length}return n}function Dn(e,t,n){if(!n&&e&&t.startsWith(e.text)){const i=Dn(e,t,!0);return{text:t,blocks:i.blocks.map(Nn)}}return!n||!e||!t.startsWith(e.text)?{text:t,blocks:it(t,n)}:t.slice(e.text.length)?Ct(e,t)??{text:t,blocks:Qr(e.blocks,t)??it(t,n)}:e}function Ct(e,t){const n=to(e,t);if(n)return n;if(!t.startsWith(e.text))return;const r=e.blocks.at(-1);if(r?.mode!=="live"||r.raw!==r.src||r.preview===void 0)return;const i=t.slice(e.text.length),a=zr(r.raw,r.preview,i);if(a===void 0)return;const s=r.previewTree?xn(r.previewTree,i):void 0;if(!(r.previewTree&&!s))return{text:t,blocks:[...e.blocks.slice(0,-1),{...r,raw:r.raw+i,src:r.src+i,preview:a,...s?{previewTree:s}:{}}]}}function to(e,t){if(!t.startsWith(e.text))return;const n=t.slice(e.text.length),r=e.blocks.at(-1);if(r?.mode==="code"&&!r.complete&&r.raw.includes(`
4
4
  `)&&!Jr(r,n))return{text:t,blocks:[...e.blocks.slice(0,-1),{...r,raw:r.raw+n,src:r.src+n}]}}function $e(e){const t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function no(e,t){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r=0,i=!0,a=!1,s;for(;s=n.nextNode();){const u=s.nodeValue??"";for(let m=0;m<u.length;m++){const l=u[m],f=a&&l===`
5
5
  `;if(a=l==="\r",!f){if(i&&++r>t)return!0;i=l===`
6
6
  `||a}}}return!1}function ro(e,t){const n=window.getComputedStyle(e),r=$e(n.lineHeight);return r<=0?!1:e.getBoundingClientRect().height-$e(n.paddingTop)-$e(n.paddingBottom)-$e(n.borderTopWidth)-$e(n.borderBottomWidth)>r*t+.5}function oo(e){const t=e.querySelector("pre"),n=t?.querySelector("code");return n&&no(n,20)||t&&ro(t,20)?!0:window.innerHeight>0&&e.getBoundingClientRect().height>window.innerHeight}function io(e,t){const n=new Map,r=new Set;let i;const a=()=>{i!==void 0||!r.size||(i=window.requestAnimationFrame(()=>{i=void 0;const l=[...r].filter(f=>e.contains(f)).map(f=>({wrapper:f,bottom:f.querySelector('[data-slot="markdown-copy-button"][data-position="bottom"]'),needed:oo(f)}));r.clear();for(const{wrapper:f,bottom:w,needed:v}of l)v&&!w&&f.appendChild(t()),!v&&w&&w.remove()}))},s=l=>{const f=n.get(l);f&&r.add(f),a()},u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l=>{for(const f of l)s(f.target)}),m=()=>{for(const l of n.values())r.add(l);a()};return window.addEventListener("resize",m),{textChanged:s,sync(l){for(const[f,w]of n)e.contains(f)||(u?.unobserve(f),n.delete(f),r.delete(w));for(const f of l)for(const w of f.querySelectorAll('[data-component="markdown-code"]')){const v=w.querySelector("pre");v&&(n.has(v)||(n.set(v,w),u?.observe(v)),r.add(w))}a()},dispose(){u?.disconnect(),window.removeEventListener("resize",m),i!==void 0&&window.cancelAnimationFrame(i),n.clear(),r.clear()}}}function ao(e){let t,n={text:"",blocks:[]},r,i="",a=0,s=!1,u=!1;const m=()=>t?.text===n.text&&t.live===r,l=d=>{i=d.text,e.commit(d)},f=(d,h)=>{n=d,r=h,e.retain?.(d,h,t?.key),l(d)},w=()=>{if(!t?.live||m())return;const d=Ct(n,t.text);d&&f(d,!0)},v=()=>{if(u||s||!t||m())return;const d=t,h=a;s=!0,e.project(d.text,d.live,d.key).then(x=>{if(!u){if(s=!1,h===a&&!m()&&t.text.startsWith(x.text)){const H=t.live?Ct(x,t.text):void 0,L=H??x;L.text.length>=i.length&&f(L,H?!0:d.live)}v()}}).catch(x=>{if(!u){if(s=!1,h!==a){v();return}m()||e.error(x,t)}})};return{update(d,h,x){if(u)return;const H=t&&t.key!==x,L=t&&(H||!d.startsWith(t.text)||!t.live&&h);if(t={text:d,live:h,key:x},L&&(a++,r=void 0,n={text:"",blocks:[]},i=""),!m()){const W=e.restore?.(d,h,x);if(W){f(W,h);return}}L&&(H||!d)&&l(n),w(),v()},dispose(){u=!0}}}function so(e){const t=e.ownerDocument.getSelection();if(!t||t.isCollapsed||!t.anchorNode||!t.focusNode||!e.contains(t.anchorNode)&&!e.contains(t.focusNode))return;const n=(a,s)=>{if(!e.contains(a))return()=>({node:a,offset:s});const m=(a.nodeType===Node.ELEMENT_NODE?a:a.parentElement)?.closest("[data-markdown-block]"),l=m&&e.contains(m)?m:e,f=l.textContent??"",w=e.ownerDocument.createRange();w.selectNodeContents(l),w.setEnd(a,s);const v=w.toString().length,d=a.nodeType===Node.TEXT_NODE?a.textContent:void 0;return()=>{if(d!==void 0&&l.contains(a)&&a.textContent?.startsWith(d))return{node:a,offset:s};if(!e.contains(l))return{node:e,offset:0};const h=l.textContent??"";let x=v;if(f!==h&&!h.startsWith(f)){let W=0;x=0;for(const P of rr(f,h)){const F=P.value.length;if(P.added){x+=F;continue}if(v<=W+F){P.removed||(x+=v-W);break}W+=F,P.removed||(x+=F)}}const H=e.ownerDocument.createTreeWalker(l,NodeFilter.SHOW_TEXT);let L;for(;L=H.nextNode();){const W=L.textContent?.length??0;if(x<=W)return{node:L,offset:x};x-=W}return{node:l,offset:l.childNodes.length}}},r=n(t.anchorNode,t.anchorOffset),i=n(t.focusNode,t.focusOffset);return()=>{const a=r(),s=i();t.anchorNode===a.node&&t.anchorOffset===a.offset&&t.focusNode===s.node&&t.focusOffset===s.offset||t.setBaseAndExtent(a.node,a.offset,s.node,s.offset)}}function co(e){const t=new WeakMap,n=a=>{let s=a.first;for(;s;){const u=s.nextSibling;if(s.parentNode?.removeChild(s),s===a.last)break;s=u}},r=(a,s,u)=>{for(const[m,l]of s.entries()){const f=a[m];f?.source.html!==l.html&&(l.tag?r(f?.source.tag===l.tag&&JSON.stringify(f.source.attributes)===JSON.stringify(l.attributes)?f.children:[],l.children??[],u):(!f||f.source.tag||/[<&]/.test(l.html)||!(f.first.nextSibling instanceof Text)||f.first.nextSibling.nextSibling!==f.last)&&u.add(l.html))}},i=(a,s,u,m,l,f)=>{const w=[];for(const[v,d]of u.entries()){const h=s[v];if(h?.source.html===d.html){w.push(h);continue}if(h&&h.source.tag===d.tag&&d.tag&&h.first instanceof HTMLElement&&JSON.stringify(h.source.attributes)===JSON.stringify(d.attributes)){h.children=i(h.first,h.children,d.children??[],m,l,f),h.source=d,w.push(h);continue}if(h&&!h.source.tag&&!d.tag&&!/[<&]/.test(d.html)&&h.first.nextSibling instanceof Text&&h.first.nextSibling.nextSibling===h.last){const L=h.first.nextSibling;d.html.startsWith(L.data)?L.appendData(d.html.slice(L.length)):L.data=d.html,h.source=d,m.add(a),w.push(h);continue}const x=h?.first??null;let H;if(d.tag){const L=document.createElement(d.tag);for(const[W,P]of Object.entries(d.attributes??{}))L.setAttribute(W,P);a.insertBefore(L,x),H={source:d,first:L,last:L,children:i(L,[],d.children??[],m,l,f)}}else{const L=document.createComment(""),W=document.createComment(""),P=f.get(d.html).cloneNode(!0);for(a.insertBefore(L,x);P.firstChild;)a.insertBefore(P.firstChild,x);a.insertBefore(W,x),H={source:d,first:L,last:W,children:[]}}h&&n(h),l.add(a),m.add(a),w.push(H)}for(const v of s.slice(u.length))n(v),m.add(a),l.add(a);return w};return{update(a,s){const u=t.get(a);u||a.replaceChildren();const m=new Set;r(u??[],s,m);const l=new Map;if(m.size){const d=[...m],h=document.createElement("div");h.innerHTML=e.sanitize(d.map(x=>`<div>${x}</div>`).join(""));for(const[x,H]of[...h.children].entries())e.decorate(H),l.set(d[x],H)}const f=new Set,w=new Set(u?[]:[a]);t.set(a,i(a,u??[],s,f,w,l));const v=d=>d===a||a.contains(d);return{updated:[...f].filter(v),structural:[...w].filter(v)}},forget(a){t.delete(a)}}}let Ot;function lo(e){return e.includes('class="katex')?(Ot??=Sn(()=>Promise.resolve({}),[],import.meta.url).then(()=>{},()=>{Ot=void 0}),Ot):Promise.resolve()}var uo=bn("<div data-component=markdown>"),fo=bn('<div role=alert class="text-12-regular text-text-weak">Unable to format the latest text. Reload to retry.');const mo=new _n({renderer:wn});function po(e,t){return`${e??"markdown"}:${t}`}function Mn(e,t){const n=t?` class="language-${Nt(t)}"`:"";return er(`<pre class="markdown-code-pending"><code${n}>${Nt(e)}</code></pre>`,t)}function ho(e){if(e.mode==="code")return e.complete?Mn(e.src,e.language):"";if(e.preview!==void 0)return at(e.preview);try{return at(mo.parse(e.src,{async:!1}))}catch{return In(e.src)}}typeof window<"u"&&ot.isSupported&&ot.addHook("afterSanitizeAttributes",e=>{if(!(e instanceof HTMLAnchorElement)||e.target!=="_blank")return;const t=e.getAttribute("rel")??"",n=new Set(t.split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.setAttribute("rel",Array.from(n).join(" "))});const go={USE_PROFILES:{html:!0,mathMl:!0},SANITIZE_NAMED_PROPS:!0,FORBID_TAGS:["style"],FORBID_CONTENTS:["style","script"]},An={copy:'<path d="M6.2513 6.24935V2.91602H17.0846V13.7493H13.7513M13.7513 6.24935V17.0827H2.91797V6.24935H13.7513Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>',check:'<path d="M5 11.9657L8.37838 14.7529L15 5.83398" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"/>'};function at(e){return ot.isSupported?ot.sanitize(e,go):""}function Nt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/'/g,"&#39;")}function In(e){return Nt(e).replace(/\r\n?/g,`
7
- `).replace(/\n/g,"<br>")}const To=/^https?:\/\/[^\s<>()`"']+$/;function Ao(e){const t=e.trim().replace(/[),.;!?]+$/,"");if(To.test(t))try{return new URL(t).toString()}catch{return}}function Dt(e,t){const n=document.createElement("div");n.setAttribute("data-component","icon"),n.setAttribute("data-size","small"),n.setAttribute("data-slot",t);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("data-slot","icon-svg"),r.setAttribute("fill","none"),r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("aria-hidden","true"),r.innerHTML=e,n.appendChild(r),n}function st(e,t){const n=document.createElement("button");return n.type="button",n.setAttribute("data-component","icon-button"),n.setAttribute("data-variant","secondary"),n.setAttribute("data-size","small"),n.setAttribute("data-slot","markdown-copy-button"),t&&n.setAttribute("data-position",t),n.setAttribute("aria-label",e.copy),n.setAttribute("data-tooltip",e.copy),n.appendChild(Dt(An.copy,"copy-icon")),n.appendChild(Dt(An.check,"check-icon")),n}function rt(e,t,n){if(n){e.setAttribute("data-copied","true"),e.setAttribute("aria-label",t.copied),e.setAttribute("data-tooltip",t.copied);return}e.removeAttribute("data-copied"),e.setAttribute("aria-label",t.copy),e.setAttribute("data-tooltip",t.copy)}function Eo(e,t){const n=e.parentElement;if(!n)return;if(!(n.getAttribute("data-component")==="markdown-code")){const u=document.createElement("div");u.setAttribute("data-component","markdown-code"),n.replaceChild(u,e),u.appendChild(e),u.appendChild(st(t,"top"));return}const i=Array.from(n.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(u=>u instanceof HTMLButtonElement),a=i.find(u=>u.getAttribute("data-position")==="top")??i[0],s=i.find(u=>u.getAttribute("data-position")==="bottom");a?a.setAttribute("data-position","top"):n.appendChild(st(t,"top")),s&&s.remove();for(const u of i)u!==a&&u!==s&&u.remove()}function _o(e){const t=Array.from(e.querySelectorAll(":not(pre) > code"));for(const n of t){if(n.closest("a"))continue;const r=Ao(n.textContent??"");if(!r)continue;const i=document.createElement("a");i.href=r,i.className="external-link",i.target="_blank",i.rel="noopener noreferrer",n.parentNode?.replaceChild(i,n),i.appendChild(n)}}function So(e,t){const n=Array.from(e.querySelectorAll('[data-component="file-viewer"]'));for(const r of n){if(!(r instanceof HTMLDivElement)||r.querySelector('[data-slot="file-header"]'))continue;const i=r.getAttribute("data-filename")||"",a=r.getAttribute("data-lang")||"text",s=document.createElement("div");s.setAttribute("data-slot","file-header"),s.className="flex items-center justify-between px-3 py-1.5 bg-surface-raised-base border-b border-border-weaker-base text-12-medium text-text-strong rounded-t-md";const u=document.createElement("div");u.className="flex items-center gap-1.5";const m=Dt('<path d="M4 3H12L16 7V17C16 17.55 15.55 18 15 18H4C3.45 18 3 17.55 3 17V4C3 3.45 3.45 3 4 3ZM11 4H4V17H15V8H11V4ZM12 4.5V7H14.5L12 4.5Z" fill="currentColor"/>',"file-icon");u.appendChild(m);const l=document.createElement("span");l.textContent=i||`code.${a}`,u.appendChild(l),s.appendChild(u);const f=st(t);s.appendChild(f),r.insertBefore(s,r.firstChild),r.className="border border-border-weaker-base rounded-md my-3 bg-surface-raised-base overflow-hidden";const w=r.querySelector('[data-slot="file-content"]');if(w instanceof HTMLDivElement){w.className="relative overflow-x-auto";const v=w.querySelector("pre");v&&(v.className=(v.className||"")+" !m-0 !rounded-none")}}}function En(e,t){const n=Array.from(e.querySelectorAll("pre"));for(const r of n)r.closest('[data-component="file-viewer"]')||Eo(r,t);_o(e),So(e,t)}function bo(e,t){const n=new Map,r=s=>{const u=t(),m=s.getAttribute("data-copied")==="true";rt(s,u,m)},i=async s=>{const u=s.target;if(!(u instanceof Element))return;const m=u.closest('[data-slot="markdown-copy-button"]');if(!(m instanceof HTMLButtonElement))return;const l=m.closest('[data-component="markdown-code"]')||m.closest('[data-component="file-viewer"]'),w=l?.querySelector("code")?.textContent??"";if(!w)return;const v=navigator?.clipboard;if(!v)return;await v.writeText(w);const d=t(),h=l?Array.from(l.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(x=>x instanceof HTMLButtonElement):[m];for(const x of h){rt(x,d,!0);const H=n.get(x);H&&clearTimeout(H);const L=setTimeout(()=>{rt(x,d,!1),n.delete(x)},2e3);n.set(x,L)}},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const s of a)s instanceof HTMLButtonElement&&r(s);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const s of n.values())clearTimeout(s)}}function wo(e){const[t,n]=Jn(e,["text","cacheKey","streaming","onRendered","resolveLink","class","classList"]),r=Vn().createRenderer();_t(r.dispose);const i=$n(),[a,s]=Be(),u=r.visibility(a),m=new WeakMap,[l,f]=Be({text:"",blocks:[]}),[w,v]=Be(!1);let d=!1;if(r.project){const g=r.project;Ze(()=>{const T=r.results;f({text:"",blocks:[]});const I=ao({project:g,restore:T.projection,retain:T.retain,commit(b){v(!1),f(b)},error(b){b instanceof Kt||(d||console.error("Markdown projection unavailable",b),d=!0,v(!0))}});_t(I.dispose),Ze(()=>{u()&&I.update(t.text,t.streaming??!1,t.cacheKey)})})}let h,x;const H=Zt(g=>{if(!u())return g??{text:"",blocks:[]};if(r.project)return l();const T=t.cacheKey,I=r.results,b=t.streaming??!1,O=I.projection(t.text,b,T)??Dn(T===h&&I===x?g:void 0,t.text,b);return I.retain(O,b,T),h=T,x=I,O});let L=new Map,W=0,P=!1;const[F,fe]=Be(0);let re;const ye=()=>{re===void 0&&(re=window.requestAnimationFrame(()=>{re=void 0,fe(g=>g+1)}))},ve=Zt(()=>{const g=r.results,T=new Map;for(const[I,b]of H().blocks.entries()){const O=po(t.cacheKey,I),N=L.get(O);if(N&&N.store===g&&N.source.raw===b.raw&&N.source.src===b.src&&N.source.mode===b.mode&&N.source.complete===b.complete){T.set(O,N);continue}const Y=b.mode==="full"||b.mode==="code"&&b.complete,pe=++W,K=b.mode==="code"?b.raw:b.src,Z=Y?g.html(K):void 0,C=Z!==void 0,Q=!b.previewTree&&N?.source.mode==="live"&&b.mode==="live"&&N.source.preview!==void 0&&b.preview!==void 0?Wr(N.source.preview,b.preview,N.rendered.html,N.rendered.hash):void 0,D=C?void 0:b.previewTree,ee={store:g,source:b,rendered:{key:O,raw:b.raw,hash:`${pe}:${C?"rich":"pending"}`,html:Z??(D&&!Ke?"":Q?.html??(Ke?In(b.src):ho(b))),mode:b.mode,append:Q,previewTree:D},loading:!!Y&&!C&&!Ke};T.set(O,ee),ee.loading&&(async()=>{try{if(await Promise.resolve(),P||L.get(O)!==ee)return;const M=await r.parse(K,O);if(P||L.get(O)!==ee)return;const q=at(M);if(await lo(q),P||L.get(O)!==ee)return;g.retainHTML(K,q),ee.rendered={...ee.rendered,hash:`${pe}:rich`,html:q,previewTree:void 0}}catch(M){!P&&!(M instanceof Kt)&&L.get(O)===ee&&console.error("Markdown render error",M)}finally{!P&&L.get(O)===ee&&(ee.loading=!1,ye())}})()}return L=T,[...T.values()]});qn(()=>(F(),!w()&&t.text.length>0&&H().blocks.length===0||!t.streaming&&ve().some(g=>g.loading)));let Te,Se;const[z,Re]=Be([]);Ze(()=>{for(const g of z()){const T=g.getAttribute("href");if(T===null)continue;const I=m.get(g),b=I?.resolved===T?I.source:T,O=t.resolveLink?.(b);if(/^\/(?![\/\\])/.test(b)&&!O){g.replaceWith(...g.childNodes);continue}const N=O??b;m.set(g,{source:b,resolved:N}),T!==N&&g.setAttribute("href",N)}});let U,ue=0,Ae;const xe=g=>{if(U){U.sync();return}if(!g.querySelector('pre[data-language="mermaid"]:not([data-mermaid-status])'))return;const T=++ue;Sn(()=>import("./markdown-mermaid-C7inlIvD.js"),[],import.meta.url).then(I=>{T!==ue||!g.isConnected||(U=I.createMermaidOwner(g,be),U.sync())})};let Le="";const be=()=>{Le=Je(H).text,Ae===void 0&&(Ae=window.requestAnimationFrame(()=>{Ae=void 0,t.onRendered?.(Le)}))},S=co({sanitize:at,decorate:g=>Je(()=>En(g,{copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))}),E=new WeakMap;let y=!1;const R=new Map;let _;return Ze(()=>{const g=a();if(!u())return;F();const T=ve(),I=T.map(K=>K.rendered);if(!g||Ke)return;re!==void 0&&(window.cancelAnimationFrame(re),re=void 0);const b={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")};let O=!1;const N=[];let Y=!1;const pe=so(g);try{_!==g&&(R.clear(),_=g);const K=new Set(I.map(C=>C.key));for(const[C,Q]of R)K.has(C)||(Q.remove(),Y=!0,R.delete(C),O=!0);const Z=R;I.forEach((C,Q)=>{const D=Z.get(C.key),ee=g.children[Q];if(D&&ee!==D&&(g.insertBefore(D,ee??null),O=!0),D?.getAttribute("data-markdown-hash")===C.hash){D.getAttribute("data-markdown-mode")!==C.mode&&D.setAttribute("data-markdown-mode",C.mode);return}const M=T[Q].source;if(C.previewTree){const j=D??document.createElement("div");j.setAttribute("data-markdown-block",C.key),j.setAttribute("data-markdown-hash",C.hash),j.setAttribute("data-markdown-mode",C.mode);const se=S.update(j,C.previewTree);D||(g.insertBefore(j,g.children[Q]??null),R.set(C.key,j)),N.push(...se.structural),O||=!D||se.updated.length>0;return}if(D&&S.forget(D),D&&C.append&&Gr(D,C.append)){D.setAttribute("data-markdown-hash",C.hash),O=!0;return}if(D&&M.mode==="code"&&!M.complete){const j=E.get(D),se=D.querySelector("pre"),Fe=se?.querySelector("code")?.firstChild;if(se&&j&&j.language===M.language&&M.src.startsWith(j.text)&&Fe instanceof Text){Fe.appendData(M.src.slice(j.text.length)),E.set(D,{text:M.src,language:M.language}),D.setAttribute("data-markdown-hash",C.hash),Se?.textChanged(se),O=!0;return}}const q=document.createElement("div");if(q.setAttribute("data-markdown-block",C.key),q.setAttribute("data-markdown-hash",C.hash),q.setAttribute("data-markdown-mode",C.mode),q.innerHTML=M.mode==="code"&&!M.complete?Mn(M.src,M.language):C.html,Je(()=>En(q,b)),!D){g.insertBefore(q,g.children[Q]??null),R.set(C.key,q),M.mode==="code"&&!M.complete&&E.set(q,{text:M.src,language:M.language}),N.push(q),O=!0;return}Br(D,q,{onBeforeElUpdated:(j,se)=>(j instanceof HTMLButtonElement&&se instanceof HTMLButtonElement&&j.getAttribute("data-slot")==="markdown-copy-button"&&se.getAttribute("data-slot")==="markdown-copy-button"&&j.getAttribute("data-copied")==="true"&&rt(se,b,!0),!j.isEqualNode(se))}),M.mode==="code"&&!M.complete?E.set(D,{text:M.src,language:M.language}):E.delete(D),N.push(D),O=!0})}catch(K){console.error("Morphdom error",K)}finally{pe?.()}(Y||N.length)&&((Je(z).some(Z=>!g.contains(Z))||N.some(Z=>Z.querySelector("a[href]")))&&Re(Array.from(g.querySelectorAll("a[href]"))),!Se&&N.some(Z=>Z.querySelector("pre"))&&(Se=io(g,()=>st({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},"bottom"))),Se?.sync(N),xe(g)),Te||(Te=bo(g,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),y||=O,y&&(t.streaming||!T.some(K=>K.loading))&&(y=!1,be())}),_t(()=>{P=!0,L.clear(),R.clear(),re!==void 0&&window.cancelAnimationFrame(re),Se?.dispose(),ue++,U?.dispose(),Ae!==void 0&&window.cancelAnimationFrame(Ae),Te&&Te()}),[(()=>{var g=uo();return Xn(s,g),Yn(g,Kn({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),g})(),Zn(Qn,{get when(){return w()},get children(){return fo()}})]}const xo=Object.freeze(Object.defineProperty({__proto__:null,Markdown:wo},Symbol.toStringTag,{value:"Module"}));export{xo as m,ot as p};
7
+ `).replace(/\n/g,"<br>")}const To=/^https?:\/\/[^\s<>()`"']+$/;function Ao(e){const t=e.trim().replace(/[),.;!?]+$/,"");if(To.test(t))try{return new URL(t).toString()}catch{return}}function Dt(e,t){const n=document.createElement("div");n.setAttribute("data-component","icon"),n.setAttribute("data-size","small"),n.setAttribute("data-slot",t);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("data-slot","icon-svg"),r.setAttribute("fill","none"),r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("aria-hidden","true"),r.innerHTML=e,n.appendChild(r),n}function st(e,t){const n=document.createElement("button");return n.type="button",n.setAttribute("data-component","icon-button"),n.setAttribute("data-variant","secondary"),n.setAttribute("data-size","small"),n.setAttribute("data-slot","markdown-copy-button"),t&&n.setAttribute("data-position",t),n.setAttribute("aria-label",e.copy),n.setAttribute("data-tooltip",e.copy),n.appendChild(Dt(An.copy,"copy-icon")),n.appendChild(Dt(An.check,"check-icon")),n}function rt(e,t,n){if(n){e.setAttribute("data-copied","true"),e.setAttribute("aria-label",t.copied),e.setAttribute("data-tooltip",t.copied);return}e.removeAttribute("data-copied"),e.setAttribute("aria-label",t.copy),e.setAttribute("data-tooltip",t.copy)}function Eo(e,t){const n=e.parentElement;if(!n)return;if(!(n.getAttribute("data-component")==="markdown-code")){const u=document.createElement("div");u.setAttribute("data-component","markdown-code"),n.replaceChild(u,e),u.appendChild(e),u.appendChild(st(t,"top"));return}const i=Array.from(n.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(u=>u instanceof HTMLButtonElement),a=i.find(u=>u.getAttribute("data-position")==="top")??i[0],s=i.find(u=>u.getAttribute("data-position")==="bottom");a?a.setAttribute("data-position","top"):n.appendChild(st(t,"top")),s&&s.remove();for(const u of i)u!==a&&u!==s&&u.remove()}function _o(e){const t=Array.from(e.querySelectorAll(":not(pre) > code"));for(const n of t){if(n.closest("a"))continue;const r=Ao(n.textContent??"");if(!r)continue;const i=document.createElement("a");i.href=r,i.className="external-link",i.target="_blank",i.rel="noopener noreferrer",n.parentNode?.replaceChild(i,n),i.appendChild(n)}}function So(e,t){const n=Array.from(e.querySelectorAll('[data-component="file-viewer"]'));for(const r of n){if(!(r instanceof HTMLDivElement)||r.querySelector('[data-slot="file-header"]'))continue;const i=r.getAttribute("data-filename")||"",a=r.getAttribute("data-lang")||"text",s=document.createElement("div");s.setAttribute("data-slot","file-header"),s.className="flex items-center justify-between px-3 py-1.5 bg-surface-raised-base border-b border-border-weaker-base text-12-medium text-text-strong rounded-t-md";const u=document.createElement("div");u.className="flex items-center gap-1.5";const m=Dt('<path d="M4 3H12L16 7V17C16 17.55 15.55 18 15 18H4C3.45 18 3 17.55 3 17V4C3 3.45 3.45 3 4 3ZM11 4H4V17H15V8H11V4ZM12 4.5V7H14.5L12 4.5Z" fill="currentColor"/>',"file-icon");u.appendChild(m);const l=document.createElement("span");l.textContent=i||`code.${a}`,u.appendChild(l),s.appendChild(u);const f=st(t);s.appendChild(f),r.insertBefore(s,r.firstChild),r.className="border border-border-weaker-base rounded-md my-3 bg-surface-raised-base overflow-hidden";const w=r.querySelector('[data-slot="file-content"]');if(w instanceof HTMLDivElement){w.className="relative overflow-x-auto";const v=w.querySelector("pre");v&&(v.className=(v.className||"")+" !m-0 !rounded-none")}}}function En(e,t){const n=Array.from(e.querySelectorAll("pre"));for(const r of n)r.closest('[data-component="file-viewer"]')||Eo(r,t);_o(e),So(e,t)}function bo(e,t){const n=new Map,r=s=>{const u=t(),m=s.getAttribute("data-copied")==="true";rt(s,u,m)},i=async s=>{const u=s.target;if(!(u instanceof Element))return;const m=u.closest('[data-slot="markdown-copy-button"]');if(!(m instanceof HTMLButtonElement))return;const l=m.closest('[data-component="markdown-code"]')||m.closest('[data-component="file-viewer"]'),w=l?.querySelector("code")?.textContent??"";if(!w)return;const v=navigator?.clipboard;if(!v)return;await v.writeText(w);const d=t(),h=l?Array.from(l.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(x=>x instanceof HTMLButtonElement):[m];for(const x of h){rt(x,d,!0);const H=n.get(x);H&&clearTimeout(H);const L=setTimeout(()=>{rt(x,d,!1),n.delete(x)},2e3);n.set(x,L)}},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const s of a)s instanceof HTMLButtonElement&&r(s);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const s of n.values())clearTimeout(s)}}function wo(e){const[t,n]=Jn(e,["text","cacheKey","streaming","onRendered","resolveLink","class","classList"]),r=Vn().createRenderer();_t(r.dispose);const i=$n(),[a,s]=Be(),u=r.visibility(a),m=new WeakMap,[l,f]=Be({text:"",blocks:[]}),[w,v]=Be(!1);let d=!1;if(r.project){const g=r.project;Ze(()=>{const T=r.results;f({text:"",blocks:[]});const I=ao({project:g,restore:T.projection,retain:T.retain,commit(b){v(!1),f(b)},error(b){b instanceof Kt||(d||console.error("Markdown projection unavailable",b),d=!0,v(!0))}});_t(I.dispose),Ze(()=>{u()&&I.update(t.text,t.streaming??!1,t.cacheKey)})})}let h,x;const H=Zt(g=>{if(!u())return g??{text:"",blocks:[]};if(r.project)return l();const T=t.cacheKey,I=r.results,b=t.streaming??!1,O=I.projection(t.text,b,T)??Dn(T===h&&I===x?g:void 0,t.text,b);return I.retain(O,b,T),h=T,x=I,O});let L=new Map,W=0,P=!1;const[F,fe]=Be(0);let re;const ye=()=>{re===void 0&&(re=window.requestAnimationFrame(()=>{re=void 0,fe(g=>g+1)}))},ve=Zt(()=>{const g=r.results,T=new Map;for(const[I,b]of H().blocks.entries()){const O=po(t.cacheKey,I),N=L.get(O);if(N&&N.store===g&&N.source.raw===b.raw&&N.source.src===b.src&&N.source.mode===b.mode&&N.source.complete===b.complete){T.set(O,N);continue}const Y=b.mode==="full"||b.mode==="code"&&b.complete,pe=++W,K=b.mode==="code"?b.raw:b.src,Z=Y?g.html(K):void 0,C=Z!==void 0,Q=!b.previewTree&&N?.source.mode==="live"&&b.mode==="live"&&N.source.preview!==void 0&&b.preview!==void 0?Wr(N.source.preview,b.preview,N.rendered.html,N.rendered.hash):void 0,D=C?void 0:b.previewTree,ee={store:g,source:b,rendered:{key:O,raw:b.raw,hash:`${pe}:${C?"rich":"pending"}`,html:Z??(D&&!Ke?"":Q?.html??(Ke?In(b.src):ho(b))),mode:b.mode,append:Q,previewTree:D},loading:!!Y&&!C&&!Ke};T.set(O,ee),ee.loading&&(async()=>{try{if(await Promise.resolve(),P||L.get(O)!==ee)return;const M=await r.parse(K,O);if(P||L.get(O)!==ee)return;const q=at(M);if(await lo(q),P||L.get(O)!==ee)return;g.retainHTML(K,q),ee.rendered={...ee.rendered,hash:`${pe}:rich`,html:q,previewTree:void 0}}catch(M){!P&&!(M instanceof Kt)&&L.get(O)===ee&&console.error("Markdown render error",M)}finally{!P&&L.get(O)===ee&&(ee.loading=!1,ye())}})()}return L=T,[...T.values()]});qn(()=>(F(),!w()&&t.text.length>0&&H().blocks.length===0||!t.streaming&&ve().some(g=>g.loading)));let Te,Se;const[z,Re]=Be([]);Ze(()=>{for(const g of z()){const T=g.getAttribute("href");if(T===null)continue;const I=m.get(g),b=I?.resolved===T?I.source:T,O=t.resolveLink?.(b);if(/^\/(?![\/\\])/.test(b)&&!O){g.replaceWith(...g.childNodes);continue}const N=O??b;m.set(g,{source:b,resolved:N}),T!==N&&g.setAttribute("href",N)}});let U,ue=0,Ae;const xe=g=>{if(U){U.sync();return}if(!g.querySelector('pre[data-language="mermaid"]:not([data-mermaid-status])'))return;const T=++ue;Sn(()=>import("./markdown-mermaid-BHDm-Eop.js"),[],import.meta.url).then(I=>{T!==ue||!g.isConnected||(U=I.createMermaidOwner(g,be),U.sync())})};let Le="";const be=()=>{Le=Je(H).text,Ae===void 0&&(Ae=window.requestAnimationFrame(()=>{Ae=void 0,t.onRendered?.(Le)}))},S=co({sanitize:at,decorate:g=>Je(()=>En(g,{copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))}),E=new WeakMap;let y=!1;const R=new Map;let _;return Ze(()=>{const g=a();if(!u())return;F();const T=ve(),I=T.map(K=>K.rendered);if(!g||Ke)return;re!==void 0&&(window.cancelAnimationFrame(re),re=void 0);const b={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")};let O=!1;const N=[];let Y=!1;const pe=so(g);try{_!==g&&(R.clear(),_=g);const K=new Set(I.map(C=>C.key));for(const[C,Q]of R)K.has(C)||(Q.remove(),Y=!0,R.delete(C),O=!0);const Z=R;I.forEach((C,Q)=>{const D=Z.get(C.key),ee=g.children[Q];if(D&&ee!==D&&(g.insertBefore(D,ee??null),O=!0),D?.getAttribute("data-markdown-hash")===C.hash){D.getAttribute("data-markdown-mode")!==C.mode&&D.setAttribute("data-markdown-mode",C.mode);return}const M=T[Q].source;if(C.previewTree){const j=D??document.createElement("div");j.setAttribute("data-markdown-block",C.key),j.setAttribute("data-markdown-hash",C.hash),j.setAttribute("data-markdown-mode",C.mode);const se=S.update(j,C.previewTree);D||(g.insertBefore(j,g.children[Q]??null),R.set(C.key,j)),N.push(...se.structural),O||=!D||se.updated.length>0;return}if(D&&S.forget(D),D&&C.append&&Gr(D,C.append)){D.setAttribute("data-markdown-hash",C.hash),O=!0;return}if(D&&M.mode==="code"&&!M.complete){const j=E.get(D),se=D.querySelector("pre"),Fe=se?.querySelector("code")?.firstChild;if(se&&j&&j.language===M.language&&M.src.startsWith(j.text)&&Fe instanceof Text){Fe.appendData(M.src.slice(j.text.length)),E.set(D,{text:M.src,language:M.language}),D.setAttribute("data-markdown-hash",C.hash),Se?.textChanged(se),O=!0;return}}const q=document.createElement("div");if(q.setAttribute("data-markdown-block",C.key),q.setAttribute("data-markdown-hash",C.hash),q.setAttribute("data-markdown-mode",C.mode),q.innerHTML=M.mode==="code"&&!M.complete?Mn(M.src,M.language):C.html,Je(()=>En(q,b)),!D){g.insertBefore(q,g.children[Q]??null),R.set(C.key,q),M.mode==="code"&&!M.complete&&E.set(q,{text:M.src,language:M.language}),N.push(q),O=!0;return}Br(D,q,{onBeforeElUpdated:(j,se)=>(j instanceof HTMLButtonElement&&se instanceof HTMLButtonElement&&j.getAttribute("data-slot")==="markdown-copy-button"&&se.getAttribute("data-slot")==="markdown-copy-button"&&j.getAttribute("data-copied")==="true"&&rt(se,b,!0),!j.isEqualNode(se))}),M.mode==="code"&&!M.complete?E.set(D,{text:M.src,language:M.language}):E.delete(D),N.push(D),O=!0})}catch(K){console.error("Morphdom error",K)}finally{pe?.()}(Y||N.length)&&((Je(z).some(Z=>!g.contains(Z))||N.some(Z=>Z.querySelector("a[href]")))&&Re(Array.from(g.querySelectorAll("a[href]"))),!Se&&N.some(Z=>Z.querySelector("pre"))&&(Se=io(g,()=>st({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},"bottom"))),Se?.sync(N),xe(g)),Te||(Te=bo(g,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),y||=O,y&&(t.streaming||!T.some(K=>K.loading))&&(y=!1,be())}),_t(()=>{P=!0,L.clear(),R.clear(),re!==void 0&&window.cancelAnimationFrame(re),Se?.dispose(),ue++,U?.dispose(),Ae!==void 0&&window.cancelAnimationFrame(Ae),Te&&Te()}),[(()=>{var g=uo();return Xn(s,g),Yn(g,Kn({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),g})(),Zn(Qn,{get when(){return w()},get children(){return fo()}})]}const xo=Object.freeze(Object.defineProperty({__proto__:null,Markdown:wo},Symbol.toStringTag,{value:"Module"}));export{xo as m,ot as p};
@@ -1 +1 @@
1
- import{P as o}from"./app-chat-kit-CmncbKE7.js";const l={link(r){return/^\/(?![\/\\])/.test(r.href)&&!/[\\\u0000-\u0020]/.test(r.href)?o.prototype.link.call(this,r):/^(?:https?:\/\/|mailto:|\/\/|#)/i.test(r.href)?o.prototype.link.call(this,r).replace("<a ",'<a class="external-link" target="_blank" rel="noopener noreferrer" '):this.parser.parseInline(r.tokens)}},i=new Set(["text","txt","plaintext","markdown","md"]);function s(r){return r?i.has(r.trim().toLowerCase()):!0}function u(r,e){const t=e?.trim().toLowerCase(),a=[s(e)?'data-wrap="true"':void 0,t?`data-language="${t.replace(/[&"<>]/g,n=>({"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"})[n]??n)}"`:void 0].filter(Boolean).join(" ");return a?r.replace("<pre",`<pre ${a}`):r}export{u as a,l as m};
1
+ import{P as o}from"./app-chat-kit-C-b6Y63T.js";const l={link(r){return/^\/(?![\/\\])/.test(r.href)&&!/[\\\u0000-\u0020]/.test(r.href)?o.prototype.link.call(this,r):/^(?:https?:\/\/|mailto:|\/\/|#)/i.test(r.href)?o.prototype.link.call(this,r).replace("<a ",'<a class="external-link" target="_blank" rel="noopener noreferrer" '):this.parser.parseInline(r.tokens)}},i=new Set(["text","txt","plaintext","markdown","md"]);function s(r){return r?i.has(r.trim().toLowerCase()):!0}function u(r,e){const t=e?.trim().toLowerCase(),a=[s(e)?'data-wrap="true"':void 0,t?`data-language="${t.replace(/[&"<>]/g,n=>({"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"})[n]??n)}"`:void 0].filter(Boolean).join(" ");return a?r.replace("<pre",`<pre ${a}`):r}export{u as a,l as m};
@@ -1,2 +1,2 @@
1
- import{_ as g}from"./app-chat-kit-CmncbKE7.js";import{p as b}from"./markdown-PrvsCtkO.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-code-BP4ED3mK.js";const E=1e5;let S=0,v=Promise.resolve();const h={USE_PROFILES:{svg:!0,svgFilters:!0},SANITIZE_NAMED_PROPS:!0,FORBID_TAGS:["script","foreignObject"],FORBID_CONTENTS:["script","foreignObject"]};function p(){return document.documentElement.dataset.colorScheme==="light"?"default":"dark"}function _(n,u,m){const i=v.then(async()=>{if(!m())return;const{default:o}=await g(async()=>{const{default:l}=await import("./mermaid.core-xKeJvOaV.js").then(e=>e.ca);return{default:l}},[],import.meta.url);if(!m())return;o.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:u,htmlLabels:!1});const{svg:r}=await o.render(`user-content-mux-mermaid-${++S}`,n),c=b.sanitize(r,h);if(!c)throw new Error("Diagram output was rejected");return c});return v=i.then(()=>{},()=>{}),i}function w(n){return n instanceof Error&&n.message?n.message.split(`
1
+ import{_ as g}from"./app-chat-kit-C-b6Y63T.js";import{p as b}from"./markdown-BDO0KNsJ.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-code-BTfpGmJj.js";const E=1e5;let S=0,v=Promise.resolve();const h={USE_PROFILES:{svg:!0,svgFilters:!0},SANITIZE_NAMED_PROPS:!0,FORBID_TAGS:["script","foreignObject"],FORBID_CONTENTS:["script","foreignObject"]};function p(){return document.documentElement.dataset.colorScheme==="light"?"default":"dark"}function _(n,u,m){const i=v.then(async()=>{if(!m())return;const{default:o}=await g(async()=>{const{default:l}=await import("./mermaid.core-CfB36ohx.js").then(e=>e.ca);return{default:l}},[],import.meta.url);if(!m())return;o.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:u,htmlLabels:!1});const{svg:r}=await o.render(`user-content-mux-mermaid-${++S}`,n),c=b.sanitize(r,h);if(!c)throw new Error("Diagram output was rejected");return c});return v=i.then(()=>{},()=>{}),i}function w(n){return n instanceof Error&&n.message?n.message.split(`
2
2
  `,1)[0]:"Unable to render diagram"}function I(n,u){let m=!1,i=p(),o;const r=new Set,c=e=>{const t=++e.revision,s=()=>!m&&!e.disposed&&e.revision===t&&n.isConnected&&n.contains(e.element);_(e.source,i,s).then(a=>{if(!(!s()||a===void 0)){if(e.element instanceof HTMLPreElement){const f=e.element,d=document.createElement("div");d.dataset.component="mermaid",d.setAttribute("role","img"),d.setAttribute("aria-label","Mermaid diagram"),(f.parentElement?.getAttribute("data-component")==="markdown-code"?f.parentElement:f).replaceWith(d),e.element=d}e.element.innerHTML=a,e.element.removeAttribute("data-mermaid-error"),u?.()}}).catch(a=>{s()&&(e.element.dataset.mermaidStatus="error",e.element.setAttribute("data-mermaid-error",w(a)),u?.())})},l=()=>{for(const e of r)n.contains(e.element)||(e.disposed=!0,r.delete(e));r.size===0&&(o?.disconnect(),o=void 0)};return{sync(){if(m)return;l();const e=p();if(e!==i){i=e;for(const t of r)c(t)}for(const t of n.querySelectorAll('pre[data-language="mermaid"]:not([data-mermaid-status])')){if(!(t instanceof HTMLPreElement))continue;const s=t.textContent??"";if(s.length>E){t.dataset.mermaidStatus="error",t.setAttribute("data-mermaid-error","Diagram is too large to render");continue}t.dataset.mermaidStatus="loading";const a={element:t,source:s,disposed:!1,revision:0};r.add(a),c(a)}o||r.size===0||(o=new MutationObserver(()=>{l();const t=p();if(t!==i){i=t;for(const s of r)c(s)}}),o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}))},dispose(){m=!0,o?.disconnect(),o=void 0;for(const e of r)e.disposed=!0,e.element.dataset.mermaidStatus==="loading"&&delete e.element.dataset.mermaidStatus;r.clear()}}}export{I as createMermaidOwner};
@@ -1 +1 @@
1
- import{_ as i,B as d}from"./app-chat-kit-CmncbKE7.js";import{m as l,a as m}from"./markdown-code-BP4ED3mK.js";import"solid-js";import"solid-js/store";import"solid-js/web";const y={name:"Mux",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}};let f;function v(){return f??=i(async()=>{const{createHighlighter:e}=await import("./index-CzdAxbXm.js");return{createHighlighter:e}},[],import.meta.url).then(({createHighlighter:e})=>e({themes:[y],langs:[]}))}async function c(e,n){const r=await v(),{bundledLanguages:a}=await i(async()=>{const{bundledLanguages:o}=await import("./index-CzdAxbXm.js");return{bundledLanguages:o}},[],import.meta.url),t=n in a?n:"text";return t!=="text"&&!r.getLoadedLanguages().includes(t)&&await r.loadLanguage(t),m(r.codeToHtml(e,{lang:t,theme:"Mux",tabindex:!1}),n)}let g;async function $(e){return g??=Promise.all([i(()=>import("./index-CN35FGBT.js"),[],import.meta.url),i(()=>import("./index-CvcU6KJI.js"),[],import.meta.url)]).then(([n,r])=>new d({renderer:l}).use(n.default({throwOnError:!1}),r.default({async highlight(a,t){return c(a,t)}}))),(await g).parse(e)}async function x(e){if(!e.includes("$"))return e;const n=(await i(async()=>{const{default:o}=await import("./katex-HP8lGamR.js");return{default:o}},[],import.meta.url)).default,r=/\$\$([\s\S]*?)\$\$/g;let a=e.replace(r,(o,s)=>{try{return n.renderToString(s,{displayMode:!0,throwOnError:!1})}catch{return`$$${s}$$`}});const t=/(?<![^\s>])\$(?![$\s])((?:[^$\\]|\\.)+?)(?<!\s)\$(?!\$)(?=[\s?!\.,:?!。,:<]|$)/g;return a=a.replace(t,(o,s)=>{try{return n.renderToString(s,{displayMode:!1,throwOnError:!1})}catch{return`$${s}$`}}),a}async function E(e){const n=e.split(/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi);let r=(await Promise.all(n.map((t,o)=>o%2?t:x(t)))).join("");const a=[...r.matchAll(/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g)];for(const[t,o,s]of a){const p=s.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),u=await c(p,o||"text");r=r.replace(t,()=>u)}return r}export{E as enrichNativeMarkdown,$ as parseMarkdown};
1
+ import{_ as i,B as d}from"./app-chat-kit-C-b6Y63T.js";import{m as l,a as m}from"./markdown-code-BTfpGmJj.js";import"solid-js";import"solid-js/store";import"solid-js/web";const y={name:"Mux",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}};let f;function v(){return f??=i(async()=>{const{createHighlighter:e}=await import("./index-DxjmYPLk.js");return{createHighlighter:e}},[],import.meta.url).then(({createHighlighter:e})=>e({themes:[y],langs:[]}))}async function c(e,n){const r=await v(),{bundledLanguages:a}=await i(async()=>{const{bundledLanguages:o}=await import("./index-DxjmYPLk.js");return{bundledLanguages:o}},[],import.meta.url),t=n in a?n:"text";return t!=="text"&&!r.getLoadedLanguages().includes(t)&&await r.loadLanguage(t),m(r.codeToHtml(e,{lang:t,theme:"Mux",tabindex:!1}),n)}let g;async function $(e){return g??=Promise.all([i(()=>import("./index-CN35FGBT.js"),[],import.meta.url),i(()=>import("./index-CvcU6KJI.js"),[],import.meta.url)]).then(([n,r])=>new d({renderer:l}).use(n.default({throwOnError:!1}),r.default({async highlight(a,t){return c(a,t)}}))),(await g).parse(e)}async function x(e){if(!e.includes("$"))return e;const n=(await i(async()=>{const{default:o}=await import("./katex-HP8lGamR.js");return{default:o}},[],import.meta.url)).default,r=/\$\$([\s\S]*?)\$\$/g;let a=e.replace(r,(o,s)=>{try{return n.renderToString(s,{displayMode:!0,throwOnError:!1})}catch{return`$$${s}$$`}});const t=/(?<![^\s>])\$(?![$\s])((?:[^$\\]|\\.)+?)(?<!\s)\$(?!\$)(?=[\s?!\.,:?!。,:<]|$)/g;return a=a.replace(t,(o,s)=>{try{return n.renderToString(s,{displayMode:!1,throwOnError:!1})}catch{return`$${s}$`}}),a}async function E(e){const n=e.split(/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi);let r=(await Promise.all(n.map((t,o)=>o%2?t:x(t)))).join("");const a=[...r.matchAll(/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g)];for(const[t,o,s]of a){const p=s.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),u=await c(p,o||"text");r=r.replace(t,()=>u)}return r}export{E as enrichNativeMarkdown,$ as parseMarkdown};