khoj 2.0.0b16.dev0__py3-none-any.whl → 2.0.0b16.dev8__py3-none-any.whl

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 (132) hide show
  1. khoj/interface/compiled/404/index.html +2 -2
  2. khoj/interface/compiled/_next/static/chunks/02b2f66c-c89cf69943479389.js +53 -0
  3. khoj/interface/compiled/_next/static/chunks/1423.7b1e8bf760d28078.js +1 -0
  4. khoj/interface/compiled/_next/static/chunks/1585.3de407cd92842aed.js +55 -0
  5. khoj/interface/compiled/_next/static/chunks/1822.0cc2f58edae71bbb.js +56 -0
  6. khoj/interface/compiled/_next/static/chunks/1915-cf7bfb14d1d7c694.js +1 -0
  7. khoj/interface/compiled/_next/static/chunks/{2117-080746c8e170c81a.js → 2117-9da935e257b6d677.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/2327-115eb57f8f41544b.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/2526.8ac62b527c9ab703.js +43 -0
  10. khoj/interface/compiled/_next/static/chunks/2626.2125083a1ff3b80a.js +29 -0
  11. khoj/interface/compiled/_next/static/chunks/2684-981c00094da80a42.js +20 -0
  12. khoj/interface/compiled/_next/static/chunks/273.c2bdf48df1dfc5ef.js +93 -0
  13. khoj/interface/compiled/_next/static/chunks/3.87fb50c162c65241.js +59 -0
  14. khoj/interface/compiled/_next/static/chunks/3192.d7a2786f846fe872.js +148 -0
  15. khoj/interface/compiled/_next/static/chunks/{3260-82d2521fab032ff1.js → 3260-babf79aa1083e03a.js} +18 -63
  16. khoj/interface/compiled/_next/static/chunks/3574.7a94c27e6a496a56.js +63 -0
  17. khoj/interface/compiled/_next/static/chunks/{3595-ac8e81e04ecb89cb.js → 3595-a015df928dccf883.js} +1 -1
  18. khoj/interface/compiled/_next/static/chunks/3599.53651e350d023038.js +131 -0
  19. khoj/interface/compiled/_next/static/chunks/3852.822389f445c9b427.js +1 -0
  20. khoj/interface/compiled/_next/static/chunks/3933.a3b09abdf19b7458.js +1 -0
  21. khoj/interface/compiled/_next/static/chunks/4323.3b06bc313e4946af.js +215 -0
  22. khoj/interface/compiled/_next/static/chunks/4447-111dcc7ac33e42ae.js +1 -0
  23. khoj/interface/compiled/_next/static/chunks/453.f8a05823b9d15c24.js +1 -0
  24. khoj/interface/compiled/_next/static/chunks/490.91b737ff35d6fbc1.js +1 -0
  25. khoj/interface/compiled/_next/static/chunks/5097.1129f707069b361f.js +1 -0
  26. khoj/interface/compiled/_next/static/chunks/5111.c8d55e95447d7609.js +5 -0
  27. khoj/interface/compiled/_next/static/chunks/5689.a323537972b343b4.js +1 -0
  28. khoj/interface/compiled/_next/static/chunks/572.3357cc94e3adfcba.js +262 -0
  29. khoj/interface/compiled/_next/static/chunks/62.53fa01be73dcb16e.js +62 -0
  30. khoj/interface/compiled/_next/static/chunks/7079-9cdc83e5ad213e0b.js +1 -0
  31. khoj/interface/compiled/_next/static/chunks/7200-9f1d584275259536.js +1 -0
  32. khoj/interface/compiled/_next/static/chunks/7626-551c62355b7b1b4a.js +1 -0
  33. khoj/interface/compiled/_next/static/chunks/7811.c32bdc47a9144a63.js +1 -0
  34. khoj/interface/compiled/_next/static/chunks/7986.4901bc54aadf59c3.js +1 -0
  35. khoj/interface/compiled/_next/static/chunks/8288.4883743fa40672e2.js +24 -0
  36. khoj/interface/compiled/_next/static/chunks/8382.335eadce6afb5d4a.js +1 -0
  37. khoj/interface/compiled/_next/static/chunks/8501.771e24303bd21479.js +24 -0
  38. khoj/interface/compiled/_next/static/chunks/8623.525c35f02a86ca25.js +174 -0
  39. khoj/interface/compiled/_next/static/chunks/8927.ba4a68dd6424b88c.js +166 -0
  40. khoj/interface/compiled/_next/static/chunks/{8072-e1440cb482a0940e.js → 9002-bd3304de324360eb.js} +1 -1
  41. khoj/interface/compiled/_next/static/chunks/9316-b53a7fb1be7889f3.js +1 -0
  42. khoj/interface/compiled/_next/static/chunks/9498.df45618893b18531.js +4 -0
  43. khoj/interface/compiled/_next/static/chunks/959.aa25ba53e976d0c1.js +36 -0
  44. khoj/interface/compiled/_next/static/chunks/9808-c95c38946322e899.js +1 -0
  45. khoj/interface/compiled/_next/static/chunks/a764ac56.e65af2f7b1ecdaaa.js +136 -0
  46. khoj/interface/compiled/_next/static/chunks/app/agents/{page-e291b49977f43880.js → page-aa86693ebe6a688f.js} +1 -1
  47. khoj/interface/compiled/_next/static/chunks/app/automations/{layout-8639ff99d6c2fec6.js → layout-554744a3bb43b2f1.js} +1 -1
  48. khoj/interface/compiled/_next/static/chunks/app/automations/{page-1047097af99d31c7.js → page-224de8b2f24cd5a8.js} +1 -1
  49. khoj/interface/compiled/_next/static/chunks/app/chat/{layout-2ff3e18a6feae92a.js → layout-63ef3be8435d1c99.js} +1 -1
  50. khoj/interface/compiled/_next/static/chunks/app/chat/{page-ac7ed0a1aff1b145.js → page-60083b8e6276e6ad.js} +1 -1
  51. khoj/interface/compiled/_next/static/chunks/app/{layout-c2de87a25fededbb.js → layout-a7ad6fe9355ea57a.js} +1 -1
  52. khoj/interface/compiled/_next/static/chunks/app/{page-1567cac7b79a7c59.js → page-3699a0ef95d4a5ce.js} +1 -1
  53. khoj/interface/compiled/_next/static/chunks/app/search/{page-3639e50ec3e9acfd.js → page-6ff3715005bdbb48.js} +1 -1
  54. khoj/interface/compiled/_next/static/chunks/app/settings/{layout-f88cedfe9ad4df7c.js → layout-30fa7eff8e7e01d5.js} +1 -1
  55. khoj/interface/compiled/_next/static/chunks/app/settings/{page-6081362437c82470.js → page-464010b2b4389d0d.js} +1 -1
  56. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-819c6536c15e3d31.js → page-5b98a0ed1e0835bf.js} +1 -1
  57. khoj/interface/compiled/_next/static/chunks/{main-fc8e0fefa2ef3d8c.js → main-0daa33fca37d54d4.js} +1 -1
  58. khoj/interface/compiled/_next/static/chunks/webpack-6912ca6b054cee28.js +1 -0
  59. khoj/interface/compiled/_next/static/css/{821d0d60b0b6871d.css → c34713c98384ee87.css} +1 -1
  60. khoj/interface/compiled/_next/static/css/{7889a30fe9c83846.css → d8ec94d00b6bf837.css} +1 -1
  61. khoj/interface/compiled/_next/static/media/140e5638e63f96c7-s.woff2 +0 -0
  62. khoj/interface/compiled/_next/static/media/1755441e3a2fa970-s.p.woff2 +0 -0
  63. khoj/interface/compiled/_next/static/media/4b23ab4cc10b07bc-s.woff2 +0 -0
  64. khoj/interface/compiled/_next/static/media/b8c807255d58fc43-s.woff2 +0 -0
  65. khoj/interface/compiled/agents/index.html +2 -2
  66. khoj/interface/compiled/agents/index.txt +3 -3
  67. khoj/interface/compiled/automations/index.html +2 -2
  68. khoj/interface/compiled/automations/index.txt +4 -4
  69. khoj/interface/compiled/chat/index.html +2 -2
  70. khoj/interface/compiled/chat/index.txt +4 -4
  71. khoj/interface/compiled/index.html +2 -2
  72. khoj/interface/compiled/index.txt +3 -3
  73. khoj/interface/compiled/search/index.html +2 -2
  74. khoj/interface/compiled/search/index.txt +3 -3
  75. khoj/interface/compiled/settings/index.html +2 -2
  76. khoj/interface/compiled/settings/index.txt +5 -5
  77. khoj/interface/compiled/share/chat/index.html +2 -2
  78. khoj/interface/compiled/share/chat/index.txt +3 -3
  79. khoj/processor/conversation/openai/gpt.py +3 -5
  80. khoj/processor/conversation/openai/utils.py +12 -9
  81. khoj/routers/research.py +1 -1
  82. khoj/utils/helpers.py +2 -2
  83. {khoj-2.0.0b16.dev0.dist-info → khoj-2.0.0b16.dev8.dist-info}/METADATA +4 -4
  84. {khoj-2.0.0b16.dev0.dist-info → khoj-2.0.0b16.dev8.dist-info}/RECORD +89 -87
  85. khoj/interface/compiled/_next/static/chunks/1225.ecac11e7421504c4.js +0 -36
  86. khoj/interface/compiled/_next/static/chunks/1320.ae930ad00affe685.js +0 -5
  87. khoj/interface/compiled/_next/static/chunks/1327-e254819a9172cfa7.js +0 -20
  88. khoj/interface/compiled/_next/static/chunks/1915-5c6508f6ebb62a30.js +0 -1
  89. khoj/interface/compiled/_next/static/chunks/1940.d082758bd04e08ae.js +0 -4
  90. khoj/interface/compiled/_next/static/chunks/2327-438aaec1657c5ada.js +0 -1
  91. khoj/interface/compiled/_next/static/chunks/2475.57a0d0fd93d07af0.js +0 -93
  92. khoj/interface/compiled/_next/static/chunks/2481.5ce6524ba0a73f90.js +0 -55
  93. khoj/interface/compiled/_next/static/chunks/2939-4af3fd24b8ffc9ad.js +0 -1
  94. khoj/interface/compiled/_next/static/chunks/297.4c4c823ff6e3255b.js +0 -174
  95. khoj/interface/compiled/_next/static/chunks/3973.dc54a39586ab48be.js +0 -1
  96. khoj/interface/compiled/_next/static/chunks/4241.c1cd170f7f37ac59.js +0 -24
  97. khoj/interface/compiled/_next/static/chunks/4447-cd95608f8e93e711.js +0 -1
  98. khoj/interface/compiled/_next/static/chunks/4505.f09454a346269c3f.js +0 -117
  99. khoj/interface/compiled/_next/static/chunks/549.2bd27f59a91a9668.js +0 -148
  100. khoj/interface/compiled/_next/static/chunks/584.d7ce3505f169b706.js +0 -1
  101. khoj/interface/compiled/_next/static/chunks/6240.34f7c1fa692edd61.js +0 -24
  102. khoj/interface/compiled/_next/static/chunks/6d3fe5a5-f9f3c16e0bc0cdf9.js +0 -10
  103. khoj/interface/compiled/_next/static/chunks/7200-93ab0072359b8028.js +0 -1
  104. khoj/interface/compiled/_next/static/chunks/7553.f5ad54b1f6e92c49.js +0 -131
  105. khoj/interface/compiled/_next/static/chunks/7626-1b630f1654172341.js +0 -1
  106. khoj/interface/compiled/_next/static/chunks/764.dadd316e8e16d191.js +0 -63
  107. khoj/interface/compiled/_next/static/chunks/78.08169ab541abab4f.js +0 -43
  108. khoj/interface/compiled/_next/static/chunks/784.e03acf460df213d1.js +0 -1
  109. khoj/interface/compiled/_next/static/chunks/8086.8d39887215807fcd.js +0 -1
  110. khoj/interface/compiled/_next/static/chunks/8168.f074ab8c7c16d82d.js +0 -59
  111. khoj/interface/compiled/_next/static/chunks/8223.1705878fa7a09292.js +0 -1
  112. khoj/interface/compiled/_next/static/chunks/8483.94f6c9e2bee86f50.js +0 -215
  113. khoj/interface/compiled/_next/static/chunks/8810.fc0e479de78c7c61.js +0 -29
  114. khoj/interface/compiled/_next/static/chunks/8909.14ac3f43d0070cf1.js +0 -88
  115. khoj/interface/compiled/_next/static/chunks/9139-8ac4d9feb10f8869.js +0 -1
  116. khoj/interface/compiled/_next/static/chunks/9167.098534184f03fe92.js +0 -56
  117. khoj/interface/compiled/_next/static/chunks/9537.e934ce37bf314509.js +0 -166
  118. khoj/interface/compiled/_next/static/chunks/9574.3fe8e26e95bf1c34.js +0 -1
  119. khoj/interface/compiled/_next/static/chunks/9643.b34248df52ffc77c.js +0 -262
  120. khoj/interface/compiled/_next/static/chunks/9747.2fd9065b1435abb1.js +0 -1
  121. khoj/interface/compiled/_next/static/chunks/9808-bd5d7361ad026094.js +0 -1
  122. khoj/interface/compiled/_next/static/chunks/9922.98f2b2a9959b4ebe.js +0 -1
  123. khoj/interface/compiled/_next/static/chunks/webpack-820bd66958a5e279.js +0 -1
  124. khoj/interface/compiled/_next/static/media/2aa11a72f7f24b58-s.woff2 +0 -0
  125. khoj/interface/compiled/_next/static/media/383a65b63658737d-s.woff2 +0 -0
  126. khoj/interface/compiled/_next/static/media/85fe2766c5e6072a-s.woff2 +0 -0
  127. khoj/interface/compiled/_next/static/media/c4250770ab8708b6-s.p.woff2 +0 -0
  128. /khoj/interface/compiled/_next/static/{-vo0F0aVQi0xvwp3-9CX- → uYxzoECdaO5T7Rd_Wa44U}/_buildManifest.js +0 -0
  129. /khoj/interface/compiled/_next/static/{-vo0F0aVQi0xvwp3-9CX- → uYxzoECdaO5T7Rd_Wa44U}/_ssgManifest.js +0 -0
  130. {khoj-2.0.0b16.dev0.dist-info → khoj-2.0.0b16.dev8.dist-info}/WHEEL +0 -0
  131. {khoj-2.0.0b16.dev0.dist-info → khoj-2.0.0b16.dev8.dist-info}/entry_points.txt +0 -0
  132. {khoj-2.0.0b16.dev0.dist-info → khoj-2.0.0b16.dev8.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9183],{98280:function(t,e,a){a.d(e,{C1:function(){return d},Lf:function(){return ei},XO:function(){return b},Yn:function(){return en},ZH:function(){return B},aH:function(){return eh},dW:function(){return el},gU:function(){return es},jr:function(){return g},us:function(){return C}});var l=a(59542),r=a(57537),i=a(79296),n=a(56574),s=a(20755),h=a(84370),o=a(90705),d=(0,s.eW)(async(t,e,a)=>{let l,r;let o=e.useHtmlLabels||(0,s.ku)(s.nV()?.htmlLabels);l=a||"node default";let d=t.insert("g").attr("class",l).attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,n.R7)(e.labelStyle));r=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,i.rw)(c,(0,s.oO)((0,n.SH)(r),(0,s.nV)()),{useHtmlLabels:o,width:e.width||s.nV().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),y=g.getBBox(),f=(e?.padding??0)/2;if(o){let t=g.children[0],e=(0,h.Ys)(g),a=t.getElementsByTagName("img");if(a){let t=""===r.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,s.nV)().fontSize?(0,s.nV)().fontSize:window.getComputedStyle(document.body).fontSize,[a=s.vZ.fontSize]=(0,n.VG)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return o?c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):c.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:y,halfPadding:f,label:c}},"labelHelper"),c=(0,s.eW)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,s.ku)(s.nV()?.flowchart?.htmlLabels),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,i.rw)(r,(0,s.oO)((0,n.SH)(e),(0,s.nV)()),{useHtmlLabels:l,width:a.width||s.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,h.Ys)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):r.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:r}},"insertLabel"),g=(0,s.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),y=(0,s.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function f(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function p(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function u(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,s.eW)(f,"createPathFromPoints"),(0,s.eW)(p,"generateFullSineWavePoints"),(0,s.eW)(u,"generateCirclePoints");var m=(0,s.eW)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function x(t,e){e&&t.attr("style",e)}async function w(t){let e=(0,h.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=t.label;t.label&&(0,s.l0)(t.label)&&(l=await (0,s.uT)(t.label.replace(s.SY.lineBreakRegex,"\n"),(0,s.nV)()));let r=t.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+l+"</span>"),x(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.eW)(x,"applyStyle"),(0,s.eW)(w,"addHtmlLabel");var b=(0,s.eW)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,s.ku)((0,s.nV)().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),s.cM.info("vertexText"+r);let t={isNode:l,label:(0,n.SH)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await w(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),$=(0,s.eW)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,0,0,1,t+a,e+r,"V",e+l-r,"A",r,r,0,0,1,t+a-r,e+l,"H",t+r,"A",r,r,0,0,1,t,e+l-r,"V",e+r,"A",r,r,0,0,1,t+r,e,"Z"].join(" "),"createRoundedRectPathD"),k=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:c}),i=t.path($(v,C,D,W,0),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"rect"),M=(0,s.eW)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return m(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),S=(0,s.eW)(async(t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=y.insert("g",":first-child"),p=y.insert("g").attr("class","cluster-label"),u=y.append("rect"),x=p.node().appendChild(await b(e.label,e.labelStyle,void 0,!0)),w=x.getBBox();if((0,s.ku)(l.flowchart.htmlLabels)){let t=x.children[0],e=(0,h.Ys)(x);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}let k=0*e.padding,M=(e.width<=w.width+e.padding?w.width+e.padding:e.width)+k;e.width<=w.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-w.height-6,W=e.x-M/2,v=e.y-S/2;e.width=M;let C=e.y-e.height/2-k/2+w.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=o.Z.svg(y),r=e.rx||e.ry?l.path($(W,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(W,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(W,C,M,D,{fill:t?n:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),u=y.insert(()=>s)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",W).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),u.attr("class","inner").attr("x",W).attr("y",C).attr("width",M).attr("height",D);p.attr("transform",`translate(${e.x-w.width/2}, ${v+1-((0,s.ku)(l.flowchart.htmlLabels)?0:3)})`);let B=a.node().getBBox();return e.height=B.height,e.offsetX=0,e.offsetY=w.height-e.padding/2,e.labelBBox=w,e.intersect=function(t){return m(e,t)},{cluster:y,labelBBox:w}},"roundedWithTitle"),D=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0,width:e.width}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:4,seed:c}),i=t.path($(v,C,D,W,e.rx),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"kanbanSection"),W={rect:k,squareRect:k,roundedWithTitle:S,noteGroup:M,divider:(0,s.eW)((t,e)=>{let a;let{themeVariables:l,handDrawnSeed:r}=(0,s.nV)(),{nodeBorder:i}=l,n=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),h=n.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=o.Z.svg(n).rectangle(y,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:r});a=n.insert(()=>t,":first-child")}else(a=h.insert("rect",":first-child")).attr("class","divider").attr("x",y).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);let p=a.node().getBBox();return e.height=p.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return m(e,t)},{cluster:n,labelBBox:{}}},"divider"),kanbanSection:D},v=new Map,C=(0,s.eW)(async(t,e)=>{let a=e.shape||"rect",l=await W[a](t,e);return v.set(e.id,l),l},"insertCluster"),B=(0,s.eW)(()=>{v=new Map},"clear");function N(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function A(t,e,a){return N(t,e,e,a)}function R(t,e,a,l){var r,i,n,s,h,o,d,c,g,y,f,p,u;if(r=e.y-t.y,n=t.x-e.x,h=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+h,y=r*l.x+n*l.y+h,!(0!==g&&0!==y&&L(g,y))&&(i=l.y-a.y,s=a.x-l.x,o=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+o,c=i*e.x+s*e.y+o,!(0!==d&&0!==c&&L(d,c))&&0!=(f=r*s-i*n)))return p=Math.abs(f/2),{x:(u=n*o-s*h)<0?(u-p)/f:(u+p)/f,y:(u=i*h-r*o)<0?(u-p)/f:(u+p)/f}}function L(t,e){return t*e>0}function q(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=R(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:i===h?0:1}),i[0]):t}(0,s.eW)(function(t,e){return t.intersect(e)},"intersectNode"),(0,s.eW)(N,"intersectEllipse"),(0,s.eW)(A,"intersectCircle"),(0,s.eW)(R,"intersectLine"),(0,s.eW)(L,"sameSign"),(0,s.eW)(q,"intersectPolygon");var _={circle:A,polygon:q,rect:m};function P(t,e){let{labelStyles:a}=(0,r.UG)(e);e.labelStyle=a;let l=y(e),i=l;l||(i="anchor");let h=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:d}=e,c=o.Z.svg(h),f=(0,r._q)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=c.circle(0,0,2,f),u=h.insert(()=>p,":first-child");return u.attr("class","anchor").attr("style",(0,n.R7)(d)),g(e,u),e.intersect=function(t){return s.cM.info("Circle intersect",e,1,t),_.circle(e,1,t)},h}function Z(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function U(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.width+e.padding+20,h=n.height+e.padding,c=h/2,p=c/(2.5+h/50),{cssStyles:u}=e,m=[{x:s/2,y:-h/2},{x:-s/2,y:-h/2},...Z(-s/2,-h/2,-s/2,h/2,p,c,!1),{x:s/2,y:h/2},...Z(s/2,h/2,s/2,-h/2,p,c,!0)],x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=f(m),$=x.path(b,w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${p/2}, 0)`),g(e,k),e.intersect=function(t){return _.polygon(e,m,t)},i}function G(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function T(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=s.width+e.padding+12,p=-h,u=[{x:12,y:p},{x:c,y:p},{x:c,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(u),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),m&&a.attr("style",m)}else a=G(n,c,h,u);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return _.polygon(e,u,t)},n}function I(t,e){let{nodeStyles:a}=(0,r.UG)(e);e.label="";let l=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],h=o.Z.svg(l),d=(0,r._q)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=f(s),g=h.path(c,d),p=l.insert(()=>g,":first-child");return i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return _.polygon(e,s,t)},l}async function E(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f,{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{}),i=t.circle(0,0,2*p,l);(a=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(u))}else a=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0);return g(e,a),e.intersect=function(t){return s.cM.info("Circle intersect",e,p,t),_.circle(e,p,t)},h}function H(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y}
2
- M ${r.x},${r.y} L ${n.x},${n.y}`}function V(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a,e.label="";let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:h}=e,d=o.Z.svg(i),c=(0,r._q)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let f=d.circle(0,0,2*n,c),p=H(n),u=d.path(p,c),m=i.insert(()=>f,":first-child");return m.insert(()=>u),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),g(e,m),e.intersect=function(t){return s.cM.info("crossedCircle intersect",e,{radius:n,point:t}),_.circle(e,n,t)},i}function Y(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function j(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...Y(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...Y(h/2+2*p,-p,p,20,-180,-270),...Y(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...Y(h/2,c/2,p,20,0,90)],x=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...Y(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...Y(h/2+.1*h,-p,p,20,-180,-270),...Y(h/2+.1*h,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...Y(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${p}, 0)`),s.attr("transform",`translate(${-h/2+p-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function O(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90)],x=[{x:-h/2,y:-c/2-p},{x:h/2,y:-c/2-p},...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90),{x:h/2,y:c/2+p},{x:-h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${-p}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function F(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function X(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...F(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...F(h/2,c/2,p,20,0,90)],x=[...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],w=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...F(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...F(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2-p-p/2,y:c/2+p},...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],b=o.Z.svg(i),$=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(m).replace("Z",""),M=b.path(k,$),S=f(x).replace("Z",""),D=b.path(S,$),W=f(w),v=b.path(W,{...$}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>M,":first-child"),C.insert(()=>D,":first-child"),C.attr("class","text"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${p-p/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,C),e.intersect=function(t){return _.polygon(e,w,t)},i}async function J(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(80,(n.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:p}=e,m=o.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-c,b=h/4,$=[{x:w,y:0},{x:b,y:0},{x:0,y:h/2},{x:b,y:h},{x:w,y:h},...u(-w,-h/2,c,50,270,90)],k=f($),M=m.path(k,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-s/2}, ${-h/2})`),g(e,S),e.intersect=function(t){return _.polygon(e,$,t)},i}(0,s.eW)(P,"anchor"),(0,s.eW)(Z,"generateArcPoints"),(0,s.eW)(U,"bowTieRect"),(0,s.eW)(G,"insertPolygonShape"),(0,s.eW)(T,"card"),(0,s.eW)(I,"choice"),(0,s.eW)(E,"circle"),(0,s.eW)(H,"createLine"),(0,s.eW)(V,"crossedCircle"),(0,s.eW)(Y,"generateCirclePoints"),(0,s.eW)(j,"curlyBraceLeft"),(0,s.eW)(O,"generateCirclePoints"),(0,s.eW)(z,"curlyBraceRight"),(0,s.eW)(F,"generateCirclePoints"),(0,s.eW)(X,"curlyBraces"),(0,s.eW)(J,"curvedTrapezoid");var K=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),Q=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),tt=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function te(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+e.padding,e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+e.padding,e.height??0),{cssStyles:x}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=Q(0,0,f,m,p,u),i=tt(0,u,f,m,p,u),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=K(0,0,f,m,p,u);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(x)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(e.padding??0)/1.5-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function ta(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+e.padding,c=n.height+e.padding,f=.2*c,p=-h/2,u=-c/2-f/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.polygon([{x:p,y:u+f},{x:-p,y:u+f},{x:-p,y:-u},{x:p,y:-u},{x:p,y:u},{x:-p,y:u},{x:-p,y:u+f}].map(t=>[t.x,t.y]),w),$=i.insert(()=>b,":first-child");return $.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),s.attr("transform",`translate(${p+(e.padding??0)/2-(n.x-(n.left??0))}, ${u+f+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,$),e.intersect=function(t){return _.rect(e,t)},i}async function tl(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f+5,u=c.width/2+f,{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{roughness:.2,strokeWidth:2.5}),i=(0,r._q)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,l),d=t.circle(0,0,2*u,i);(a=h.insert("g",":first-child")).attr("class",(0,n.R7)(e.cssClasses)).attr("style",(0,n.R7)(m)),a.node()?.appendChild(s),a.node()?.appendChild(d)}else{let t=(a=h.insert("g",":first-child")).insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",i),t.attr("class","outer-circle").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",u).attr("cx",0).attr("cy",0)}return g(e,a),e.intersect=function(t){return s.cM.info("DoubleCircle intersect",e,p,t),_.circle(e,p,t)},h}function tr(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.label="",e.labelStyle=l;let n=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=o.Z.svg(n),{nodeBorder:c}=a,f=(0,r._q)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=d.circle(0,0,14,f),u=n.insert(()=>p,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),h&&h.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),g(e,u),e.intersect=function(t){return s.cM.info("filledCircle intersect",e,{radius:7,point:t}),_.circle(e,7,t)},n}async function ti(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=n.width+(e.padding??0),p=c+n.height,u=c+n.height,m=[{x:0,y:-p},{x:u,y:-p},{x:u/2,y:0}],{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m),k=w.path($,b),M=i.insert(()=>k,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=c,e.height=p,g(e,M),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-p/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,m,t),_.polygon(e,m,t)},i}function tn(t,e,{dir:a,config:{state:l,themeVariables:i}}){let{nodeStyles:n}=(0,r.UG)(e);e.label="";let s=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===a&&(d=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let f=-1*d/2,p=-1*c/2,u=o.Z.svg(s),m=(0,r._q)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=u.rectangle(f,p,d,c,m),w=s.insert(()=>x,":first-child");h&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),g(e,w);let b=l?.padding??0;return e.width&&e.height&&(e.width+=b/2||0,e.height+=b/2||0),e.intersect=function(t){return _.rect(e,t)},s}async function ts(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),h=Math.max(80,n.width+(e.padding??0)*2,e?.width??0),c=Math.max(50,n.height+(e.padding??0)*2,e?.height??0),p=c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2,y:-c/2},{x:h/2-p,y:-c/2},...u(-h/2+p,0,p,50,90,270),{x:h/2-p,y:c/2},{x:-h/2,y:c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),g(e,M),e.intersect=function(t){return s.cM.info("Pill intersect",e,{radius:p,point:t}),_.polygon(e,b,t)},i}(0,s.eW)(te,"cylinder"),(0,s.eW)(ta,"dividedRectangle"),(0,s.eW)(tl,"doublecircle"),(0,s.eW)(tr,"filledCircle"),(0,s.eW)(ti,"flippedTriangle"),(0,s.eW)(tn,"forkJoin"),(0,s.eW)(ts,"halfRoundedRectangle");var th=(0,s.eW)((t,e,a,l,r)=>`M${t+r},${e} L${t+a-r},${e} L${t+a},${e-l/2} L${t+a-r},${e-l} L${t+r},${e-l} L${t},${e-l/2} Z`,"createHexagonPathD");async function to(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=h/4,f=s.width+2*c+e.padding,p=[{x:c,y:0},{x:f-c,y:0},{x:f,y:-h/2},{x:f-c,y:-h},{x:c,y:-h},{x:0,y:-h/2}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=th(0,0,f,h,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),u&&a.attr("style",u)}else a=G(n,f,h,p);return i&&a.attr("style",i),e.width=f,e.height=h,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function td(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let{shapeSvg:i}=await d(t,e,y(e)),n=Math.max(30,e?.width??0),h=Math.max(30,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:0,y:0},{x:n,y:0},{x:0,y:h},{x:n,y:h}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),b.attr("transform",`translate(${-n/2}, ${-h/2})`),g(e,b),e.intersect=function(t){return s.cM.info("Pill intersect",e,{points:m}),_.polygon(e,m,t)},i}async function tc(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u="t"===e.pos,{nodeBorder:m}=a,{stylesMap:x}=(0,r.dT)(e),w=-h/2,b=-h/2,$=e.label?8:0,k=o.Z.svg(y),M=(0,r._q)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(w,b,h,h,M),D=Math.max(h,f.width),W=h+f.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"transparent",stroke:"none"}),C=y.insert(()=>S,":first-child"),B=y.insert(()=>v);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${u?f.height/2+$/2-r/2-s:-f.height/2-$/2-r/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${u?-W/2:W/2-f.height})`),C.attr("transform",`translate(0,${u?f.height/2+$/2:-f.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=u?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+$},{x:a+h/2,y:l-r/2+f.height+$},{x:a+h/2,y:l+r/2},{x:a-h/2,y:l+r/2},{x:a-h/2,y:l-r/2+f.height+$},{x:a-f.width/2,y:l-r/2+f.height+$}]:[{x:a-h/2,y:l-r/2},{x:a+h/2,y:l-r/2},{x:a+h/2,y:l-r/2+h},{x:a+f.width/2,y:l-r/2+h},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+h},{x:a-h/2,y:l-r/2+h}],_.polygon(e,i,t)},y}async function tg(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u=e.label?8:0,m="t"===e.pos,{nodeBorder:x,mainBkg:w}=a,{stylesMap:b}=(0,r.dT)(e),$=o.Z.svg(y),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=b.get("fill");k.stroke=M??w;let S=y.append("g");e.icon&&S.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let D=S.node().getBBox(),W=D.width,v=D.height,C=D.x,B=D.y,N=Math.max(W,v)*Math.SQRT2+40,A=$.circle(0,0,N,k),R=Math.max(N,f.width),L=N+f.height+u,q=$.rectangle(-R/2,-L/2,R,L,{...k,fill:"transparent",stroke:"none"}),P=y.insert(()=>A,":first-child"),Z=y.insert(()=>q);return S.attr("transform",`translate(${-W/2-C},${m?f.height/2+u/2-v/2-B:-f.height/2-u/2-v/2-B})`),S.attr("style",`color: ${b.get("stroke")??x};`),p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-L/2:L/2-f.height})`),P.attr("transform",`translate(0,${m?f.height/2+u/2:-f.height/2-u/2})`),g(e,Z),e.intersect=function(t){return s.cM.info("iconSquare intersect",e,t),_.rect(e,t)},y}async function ty(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,5),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child").attr("class","icon-shape2"),L=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,L),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function tf(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,.1),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child"),L=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,L),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function tp(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let i=Number(l.naturalWidth.toString().replace("px","")),n=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/n;let{labelStyles:h}=(0,r.UG)(e);e.labelStyle=h;let c=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let y=Math.max(e.label?c??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:y,p="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(f,c??0);let{shapeSvg:u,bbox:m,label:x}=await d(t,e,"image-shape default"),w="t"===e.pos,b=-f/2,$=e.label?8:0,k=o.Z.svg(u),M=(0,r._q)(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(b,-p/2,f,p,M),D=Math.max(f,m.width),W=p+m.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"none",stroke:"none"}),C=u.insert(()=>S,":first-child"),B=u.insert(()=>v);if(e.img){let t=u.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${w?W/2-p:-W/2})`)}return x.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${w?-p/2-m.height/2-$/2:p/2-m.height/2+$/2})`),C.attr("transform",`translate(0,${w?m.height/2+$/2:-m.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2+m.height+$},{x:a+f/2,y:l-r/2+m.height+$},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+m.height+$},{x:a-m.width/2,y:l-r/2+m.height+$}]:[{x:a-f/2,y:l-r/2},{x:a+f/2,y:l-r/2},{x:a+f/2,y:l-r/2+p},{x:a+m.width/2,y:l-r/2+p},{x:a+m.width/2/2,y:l+r/2},{x:a-m.width/2,y:l+r/2},{x:a-m.width/2,y:l-r/2+p},{x:a-f/2,y:l-r/2+p}],_.polygon(e,i,t)},u}async function tu(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0)*2,e?.width??0),c=Math.max(s.height+(e.padding??0)*2,e?.height??0),p=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tm(t,e,a){let l;let{labelStyles:i,nodeStyles:s}=(0,r.UG)(e);e.labelStyle=i;let{shapeSvg:h,bbox:c}=await d(t,e,y(e)),f=Math.max(c.width+2*a.labelPaddingX,e?.width||0),p=Math.max(c.height+2*a.labelPaddingY,e?.height||0),u=-f/2,m=-p/2,{rx:x,ry:w}=e,{cssStyles:b}=e;if(a?.rx&&a.ry&&(x=a.rx,w=a.ry),"handDrawn"===e.look){let t=o.Z.svg(h),a=(0,r._q)(e,{}),i=x||w?t.path($(u,m,f,p,x||0),a):t.rectangle(u,m,f,p,a);(l=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(b))}else(l=h.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.R7)(x)).attr("ry",(0,n.R7)(w)).attr("x",u).attr("y",m).attr("width",f).attr("height",p);return g(e,l),e.intersect=function(t){return _.rect(e,t)},h}async function tx(t,e){let{shapeSvg:a,bbox:l,label:r}=await d(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),g(e,i),e.intersect=function(t){return _.rect(e,t)},a}async function tw(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tb(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}function t$(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,h=Math.max(35,e?.width??0),d=Math.max(35,e?.height??0),c=[{x:h,y:0},{x:0,y:d+3.5},{x:h-14,y:d+3.5},{x:0,y:2*d},{x:h,y:d-3.5},{x:14,y:d-3.5}],p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=f(c),x=p.path(m,u),w=i.insert(()=>x,":first-child");return n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),l&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(-${h/2},${-d})`),g(e,w),e.intersect=function(t){return s.cM.info("lightningBolt intersect",e,t),_.polygon(e,c,t)},i}(0,s.eW)(to,"hexagon"),(0,s.eW)(td,"hourglass"),(0,s.eW)(tc,"icon"),(0,s.eW)(tg,"iconCircle"),(0,s.eW)(ty,"iconRounded"),(0,s.eW)(tf,"iconSquare"),(0,s.eW)(tp,"imageSquare"),(0,s.eW)(tu,"inv_trapezoid"),(0,s.eW)(tm,"drawRect"),(0,s.eW)(tx,"labelRect"),(0,s.eW)(tw,"lean_left"),(0,s.eW)(tb,"lean_right"),(0,s.eW)(t$,"lightningBolt");var tk=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tM=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tS=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tD(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0),e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+(e.padding??0),e.height??0),x=.1*m,{cssStyles:w}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tM(0,0,f,m,p,u,x),i=tS(0,u,f,m,p,u),n=(0,r._q)(e,{}),h=t.path(l,n),d=t.path(i,n);s.insert(()=>d,":first-child").attr("class","line"),(a=s.insert(()=>h,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=tk(0,0,f,m,p,u,x);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(w)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+u-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tW(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=c/4,u=c+f,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...p(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],$=x.polygon(b.map(t=>[t.x,t.y]),w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)-f/2-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tv(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:p-5,y:u+5},{x:p-5,y:u+c+5},{x:p+h-5,y:u+c+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u+c-5},{x:p+h+5,y:u+c-5},{x:p+h+5,y:u-5},{x:p+5,y:u-5},{x:p+5,y:u},{x:p,y:u},{x:p,y:u+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:p,y:u+5},{x:p+h-5,y:u+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u},{x:p,y:u}]),S=x.path(M,{...w,fill:"none"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tC(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=c+u,x=-h/2,w=-m/2,{cssStyles:b}=e,$=p(x-5,w+m+5,x+h-5,w+m+5,u,.8),k=$?.[$.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+m+5},...$,{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:k.y-10},{x:x+h+5,y:k.y-10},{x:x+h+5,y:w-5},{x:x+5,y:w-5},{x:x+5,y:w},{x,y:w},{x,y:w+5}],S=[{x,y:w+5},{x:x+h-5,y:w+5},{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:w},{x,y:w}],D=o.Z.svg(i),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=f(M),C=D.path(v,W),B=f(S),N=D.path(B,W),A=i.insert(()=>C,":first-child");return A.insert(()=>N),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tB(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l,e.useHtmlLabels||s.iE().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:n,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0)*2,e?.width??0),p=Math.max(h.height+(e.padding??0)*2,e?.height??0),{cssStyles:u}=e,m=o.Z.svg(n),x=(0,r._q)(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=m.rectangle(-f/2,-p/2,f,p,x),b=n.insert(()=>w,":first-child");return b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),c.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,b),e.intersect=function(t){return _.rect(e,t)},n}(0,s.eW)(tD,"linedCylinder"),(0,s.eW)(tW,"linedWaveEdgedRect"),(0,s.eW)(tv,"multiRect"),(0,s.eW)(tC,"multiWaveEdgedRectangle"),(0,s.eW)(tB,"note");var tN=(0,s.eW)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tA(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:h}=await d(t,e,y(e)),c=h.width+e.padding+(h.height+e.padding),f=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=tN(0,0,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`),p&&a.attr("style",p)}else a=G(n,c,c,f);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return s.cM.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",_.polygon(e,f,t)),_.polygon(e,f,t)},n}async function tR(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0),e?.width??0),c=Math.max(n.height+(e.padding??0),e?.height??0),p=-h/2,u=-c/2,m=u/2,x=[{x:p+m,y:u},{x:p,y:0},{x:p+m,y:-u},{x:-p,y:-u},{x:-p,y:u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-m/2},0)`),s.attr("transform",`translate(${-m/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),g(e,S),e.intersect=function(t){return _.polygon(e,x,t)},i}async function tL(t,e){let a,l,i;let{labelStyles:n,nodeStyles:d}=(0,r.UG)(e);e.labelStyle=n,a=e.cssClasses?"node "+e.cssClasses:"node default";let c=t.insert("g").attr("class",a).attr("id",e.domId||e.id),y=c.insert("g"),f=c.insert("g").attr("class","label").attr("style",d),p=e.description,u=e.label,m=f.node().appendChild(await b(u,e.labelStyle,!0,!0)),x={width:0,height:0};if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=m.children[0],e=(0,h.Ys)(m);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}s.cM.info("Text 2",p);let w=p||[],k=m.getBBox(),M=f.node().appendChild(await b(w.join?w.join("<br/>"):w,e.labelStyle,!0,!0)),S=M.children[0],D=(0,h.Ys)(M);x=S.getBoundingClientRect(),D.attr("width",x.width),D.attr("height",x.height);let W=(e.padding||0)/2;(0,h.Ys)(M).attr("transform","translate( "+(x.width>k.width?0:(k.width-x.width)/2)+", "+(k.height+W+5)+")"),(0,h.Ys)(m).attr("transform","translate( "+(x.width<k.width?0:-(k.width-x.width)/2)+", 0)"),x=f.node().getBBox(),f.attr("transform","translate("+-x.width/2+", "+(-x.height/2-W+3)+")");let v=x.width+(e.padding||0),C=x.height+(e.padding||0),B=-x.width/2-W,N=-x.height/2-W;if("handDrawn"===e.look){let t=o.Z.svg(c),a=(0,r._q)(e,{}),n=t.path($(B,N,v,C,e.rx||0),a),h=t.line(-x.width/2-W,-x.height/2-W+k.height+W,x.width/2+W,-x.height/2-W+k.height+W,a);i=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),h),":first-child"),l=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),n),":first-child")}else l=y.insert("rect",":first-child"),i=y.insert("line"),l.attr("class","outer title-state").attr("style",d).attr("x",-x.width/2-W).attr("y",-x.height/2-W).attr("width",x.width+(e.padding||0)).attr("height",x.height+(e.padding||0)),i.attr("class","divider").attr("x1",-x.width/2-W).attr("x2",x.width/2+W).attr("y1",-x.height/2-W+k.height+W).attr("y2",-x.height/2-W+k.height+W);return g(e,l),e.intersect=function(t){return _.rect(e,t)},c}async function tq(t,e){let a={rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tm(t,e,a)}async function t_(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s,label:h}=await d(t,e,y(e)),c=e?.padding??0,f=Math.max(s.width+(e.padding??0)*2,e?.width??0),p=Math.max(s.height+(e.padding??0)*2,e?.height??0),u=-s.width/2-c,m=-s.height/2-c,{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.polygon([{x:u,y:m},{x:u+f+8,y:m},{x:u+f+8,y:m+p},{x:u-8,y:m+p},{x:u-8,y:m},{x:u,y:m},{x:u,y:m+p}].map(t=>[t.x,t.y]),b),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container").attr("style",(0,n.R7)(x)),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),x&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),h.attr("transform",`translate(${-f/2+4+(e.padding??0)-(s.x-(s.left??0))},${-p/2+(e.padding??0)-(s.y-(s.top??0))})`),g(e,k),e.intersect=function(t){return _.rect(e,t)},i}async function tP(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:p,y:u},{x:p,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u-c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${c/4})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))}, ${-c/4+(e.padding??0)-(n.y-(n.top??0))})`),g(e,M),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tZ(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tm(t,e,a)}async function tU(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h}=await d(t,e,y(e)),c=h.height+e.padding,f=h.width+c/4+e.padding,{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=(0,r._q)(e,{}),i=$(-f/2,-c/2,f,c,c/2),h=t.path(i,l);(a=s.insert(()=>h,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(p))}else(a=s.insert("rect",":first-child")).attr("class","basic label-container").attr("style",i).attr("rx",c/2).attr("ry",c/2).attr("x",-f/2).attr("y",-c/2).attr("width",f).attr("height",c);return g(e,a),e.intersect=function(t){return _.rect(e,t)},s}async function tG(t,e){return tm(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function tT(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{cssStyles:n}=e,{lineColor:s,stateBorder:h,nodeBorder:d}=a,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),y=o.Z.svg(c),f=(0,r._q)(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let p=y.circle(0,0,14,{...f,stroke:s,strokeWidth:2}),u=h??d,m=y.circle(0,0,5,{...f,fill:u,stroke:u,strokeWidth:2,fillStyle:"solid"}),x=c.insert(()=>p,":first-child");return x.insert(()=>m),n&&x.selectAll("path").attr("style",n),i&&x.selectAll("path").attr("style",i),g(e,x),e.intersect=function(t){return _.circle(e,7,t)},c}function tI(t,e,{config:{themeVariables:a}}){let l;let{lineColor:i}=a,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=o.Z.svg(n).circle(0,0,14,(0,r.TA)(i));(l=n.insert(()=>t)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(l=n.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return g(e,l),e.intersect=function(t){return _.circle(e,7,t)},n}async function tE(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s}=await d(t,e,y(e)),h=(e?.padding||0)/2,c=s.width+e.padding,f=s.height+e.padding,p=-s.width/2-h,u=-s.height/2-h,m=[{x:0,y:0},{x:c,y:0},{x:c,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:c+8,y:0},{x:c+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if("handDrawn"===e.look){let t=o.Z.svg(i),a=(0,r._q)(e,{}),l=t.rectangle(p-8,u,c+16,f,a),s=t.line(p,u,p,u+f,a),h=t.line(p+c,u,p+c,u+f,a);i.insert(()=>s,":first-child"),i.insert(()=>h,":first-child");let d=i.insert(()=>l,":first-child"),{cssStyles:y}=e;d.attr("class","basic label-container").attr("style",(0,n.R7)(y)),g(e,d)}else{let t=G(i,c,f,m);l&&t.attr("style",l),g(e,t)}return e.intersect=function(t){return _.polygon(e,m,t)},i}async function tH(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-h/2,u=.2*h,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:c-u/2,y:p},{x:c+s+u/2,y:p},{x:c+s+u/2,y:p+h},{x:c-u/2,y:p+h}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:c+s-u/2,y:p+h},{x:c+s+u/2,y:p+h},{x:c+s+u/2,y:p+h-.2*h}]),S=x.path(M,{...w,fillStyle:"solid"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tV(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=.2*h,x=.2*c,w=c+u,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-h/2*.1,y:w/2},...p(-h/2-h/2*.1,w/2,h/2+h/2*.1,w/2,u,.8),{x:h/2+h/2*.1,y:-w/2},{x:-h/2-h/2*.1,y:-w/2}],S=-h/2+h/2*.1,D=-w/2-.4*x,W=[{x:S+h-m,y:(D+c)*1.4},{x:S+h,y:D+c-x},{x:S+h,y:(D+c)*.9},...p(S+h,(D+c)*1.3,S+h-m,(D+c)*1.5,-(.03*c),.5)],v=f(M),C=$.path(v,k),B=f(W),N=$.path(B,{...k,fillStyle:"solid"}),A=i.insert(()=>N,":first-child");return A.insert(()=>C,":first-child"),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tY(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+e.padding,e?.width||0),h=Math.max(n.height+e.padding,e?.height||0),o=i.insert("rect",":first-child");return o.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",-s/2).attr("y",-h/2).attr("width",s).attr("height",h),g(e,o),e.intersect=function(t){return _.rect(e,t)},i}(0,s.eW)(tA,"question"),(0,s.eW)(tR,"rect_left_inv_arrow"),(0,s.eW)(tL,"rectWithTitle"),(0,s.eW)(tq,"roundedRect"),(0,s.eW)(t_,"shadedProcess"),(0,s.eW)(tP,"slopedRect"),(0,s.eW)(tZ,"squareRect"),(0,s.eW)(tU,"stadium"),(0,s.eW)(tG,"state"),(0,s.eW)(tT,"stateEnd"),(0,s.eW)(tI,"stateStart"),(0,s.eW)(tE,"subroutine"),(0,s.eW)(tH,"taggedRect"),(0,s.eW)(tV,"taggedWaveEdgedRectangle"),(0,s.eW)(tY,"text");var tj=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e}
3
- a${r},${i} 0,0,1 0,${-l}
4
- l${a},0
5
- a${r},${i} 0,0,1 0,${l}
6
- M${a},${-l}
7
- a${r},${i} 0,0,0 0,${l}
8
- l${-a},0`,"createCylinderPathD"),tO=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),tz=(0,s.eW)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function tF(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c,halfPadding:f}=await d(t,e,y(e)),p="neo"===e.look?2*f:f,u=h.height+p,m=u/2,x=m/(2.5+u/50),w=h.width+x+p,{cssStyles:b}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tO(0,0,w,u,x,m),i=tz(0,0,w,u,x,m),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),b&&a.attr("style",b)}else{let t=tj(0,0,w,u,x,m);(a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(b)).attr("style",i)).attr("class","basic label-container"),b&&a.selectAll("path").attr("style",b),i&&a.selectAll("path").attr("style",i)}return a.attr("label-offset-x",x),a.attr("transform",`translate(${-w/2}, ${u/2} )`),c.attr("transform",`translate(${-(h.width/2)-x-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,a),e.intersect=function(t){let a=_.rect(e,t),l=a.y-(e.y??0);if(0!=m&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-x)){let r=x*x*(1-l*l/(m*m));0!=r&&(r=Math.sqrt(Math.abs(r))),r=x-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},s}async function tX(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.width+e.padding,c=s.height+e.padding,p=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tJ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(60,n.width+(e.padding??0)*2,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-s/2*.8,y:-h/2},{x:s/2*.8,y:-h/2},{x:s/2,y:-h/2*.6},{x:s/2,y:h/2},{x:-s/2,y:h/2},{x:-s/2,y:-h/2*.6}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),g(e,b),e.intersect=function(t){return _.polygon(e,m,t)},i}async function tK(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=(0,s.ku)(s.nV().flowchart?.htmlLabels),p=n.width+(e.padding??0),u=p+n.height,m=p+n.height,x=[{x:0,y:0},{x:m,y:0},{x:m/2,y:-u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return w&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),e.width=p,e.height=u,g(e,S),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(e.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,x,t),_.polygon(e,x,t)},i}async function tQ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/8,m=c+u,{cssStyles:x}=e,w=70-h,b=w>0?w/2:0,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-b,y:m/2},...p(-h/2-b,m/2,h/2+b,m/2,u,.8),{x:h/2+b,y:-m/2},{x:-h/2-b,y:-m/2}],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),W.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u-(n.y-(n.top??0))})`),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t0(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=s/h,u=s,m=h;u>m*c?m=u/c:u=m*c,u=Math.max(u,100);let x=Math.min(.2*(m=Math.max(m,50)),m/4),w=m+2*x,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-u/2,y:w/2},...p(-u/2,w/2,u/2,w/2,x,1),{x:u/2,y:-w/2},...p(u/2,-w/2,-u/2,-w/2,x,-1)],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t2(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=-h/2,p=-c/2,{cssStyles:u}=e,m=o.Z.svg(i),x=(0,r._q)(e,{}),w=[{x:f-5,y:p-5},{x:f-5,y:p+c},{x:f+h,y:p+c},{x:f+h,y:p-5}],b=`M${f-5},${p-5} L${f+h},${p-5} L${f+h},${p+c} L${f-5},${p+c} L${f-5},${p-5}
9
- M${f-5},${p} L${f+h},${p}
10
- M${f},${p-5} L${f},${p+c}`;"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let $=m.path(b,x),k=i.insert(()=>$,":first-child");return k.attr("transform","translate(2.5, 2.5)"),k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)+2.5-(n.x-(n.left??0))}, ${-(n.height/2)+2.5-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,w,t)},i}async function t1(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,s.iE)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await t1(t,r)}let a=(0,s.iE)();e.useHtmlLabels=a.htmlLabels;let l=a.er?.diagramPadding??10,i=a.er?.entityPadding??6,{cssStyles:d}=e,{labelStyles:c,nodeStyles:f}=(0,r.UG)(e);if(0===e.attributes.length&&e.label){let r={rx:0,ry:0,labelPaddingX:l,labelPaddingY:1.5*l,classes:""};(0,n.Cq)(e.label,a)+2*r.labelPaddingX<a.er.minEntityWidth&&(e.width=a.er.minEntityWidth);let i=await tm(t,e,r);if(!(0,s.ku)(a.htmlLabels)){let t=i.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return i}a.htmlLabels||(l*=1.25,i*=1.25);let p=y(e);p||(p="node default");let u=t.insert("g").attr("class",p).attr("id",e.domId||e.id),m=await t5(u,e.label??"",a,0,0,["name"],c);m.height+=i;let x=0,w=[],b=[],$=0,k=0,M=0,S=0,D=!0,W=!0;for(let t of e.attributes){let e=await t5(u,t.type,a,0,x,["attribute-type"],c);$=Math.max($,e.width+l);let r=await t5(u,t.name,a,0,x,["attribute-name"],c);k=Math.max(k,r.width+l);let n=await t5(u,t.keys.join(),a,0,x,["attribute-keys"],c);M=Math.max(M,n.width+l);let s=await t5(u,t.comment,a,0,x,["attribute-comment"],c);S=Math.max(S,s.width+l);let h=Math.max(e.height,r.height,n.height,s.height)+i;b.push({yOffset:x,rowHeight:h}),x+=h}let v=4;M<=l&&(D=!1,M=0,v--),S<=l&&(W=!1,S=0,v--);let C=u.node().getBBox();if(m.width+2*l-($+k+M+S)>0){let t=m.width+2*l-($+k+M+S);$+=t/v,k+=t/v,M>0&&(M+=t/v),S>0&&(S+=t/v)}let B=$+k+M+S,N=o.Z.svg(u),A=(0,r._q)(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let R=0;b.length>0&&(R=b.reduce((t,e)=>t+(e?.rowHeight??0),0));let L=Math.max(C.width+2*l,e?.width||0,B),q=Math.max((R??0)+m.height,e?.height||0),P=-L/2,Z=-q/2;u.selectAll("g:not(:first-child)").each((t,e,a)=>{let r=(0,h.Ys)(a[e]),n=r.attr("transform"),s=0,o=0;if(n){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(n);t&&(s=parseFloat(t[1]),o=parseFloat(t[2]),r.attr("class").includes("attribute-name")?s+=$:r.attr("class").includes("attribute-keys")?s+=$+k:r.attr("class").includes("attribute-comment")&&(s+=$+k+M))}r.attr("transform",`translate(${P+l/2+s}, ${o+Z+m.height+i/2})`)}),u.select(".name").attr("transform","translate("+-m.width/2+", "+(Z+i/2)+")");let U=N.rectangle(P,Z,L,q,A),G=u.insert(()=>U,":first-child").attr("style",d.join("")),{themeVariables:T}=(0,s.iE)(),{rowEven:I,rowOdd:E,nodeBorder:H}=T;for(let[t,e]of(w.push(0),b.entries())){let a=(t+1)%2==0&&0!==e.yOffset,l=N.rectangle(P,m.height+Z+e?.yOffset,L,e?.rowHeight,{...A,fill:a?I:E,stroke:H});u.insert(()=>l,"g.label").attr("style",d.join("")).attr("class",`row-rect-${a?"even":"odd"}`)}let V=N.line(P,m.height+Z,L+P,m.height+Z,A);for(let t of(u.insert(()=>V).attr("class","divider"),V=N.line($+P,m.height+Z,$+P,q+Z,A),u.insert(()=>V).attr("class","divider"),D&&(V=N.line($+k+P,m.height+Z,$+k+P,q+Z,A),u.insert(()=>V).attr("class","divider")),W&&(V=N.line($+k+M+P,m.height+Z,$+k+M+P,q+Z,A),u.insert(()=>V).attr("class","divider")),w))V=N.line(P,m.height+Z+t,L+P,m.height+Z+t,A),u.insert(()=>V).attr("class","divider");if(g(e,G),f&&"handDrawn"!==e.look){let t=f.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");u.selectAll("path").attr("style",e??""),u.selectAll(".row-rect-even path").attr("style",f)}return e.intersect=function(t){return _.rect(e,t)},u}async function t5(t,e,a,l=0,r=0,o=[],d=""){let c=t.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${l}, ${r})`).attr("style",d);e!==(0,s.UO)(e)&&(e=(e=(0,s.UO)(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));let g=c.node().appendChild(await (0,i.rw)(c,e,{width:(0,n.Cq)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("&lt;")||e.includes("&gt;")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let y=g.getBBox();if((0,s.ku)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,h.Ys)(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return y}async function t8(t,e,a,l,r=a.class.padding??12){let i=l?0:3,n=t.insert("g").attr("class",y(e)).attr("id",e.domId||e.id),s=null,h=null,o=null,d=null,c=0,g=0,f=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await t4(s,{text:`\xab${t}\xbb`},0),c=s.node().getBBox().height}h=n.insert("g").attr("class","label-group text"),await t4(h,e,0,["font-weight: bolder"]);let p=h.node().getBBox();g=p.height,o=n.insert("g").attr("class","members-group text");let u=0;for(let t of e.members){let e=await t4(o,t,u,[t.parseClassifier()]);u+=e+i}(f=o.node().getBBox().height)<=0&&(f=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await t4(d,t,m,[t.parseClassifier()]);m+=e+i}let x=n.node().getBBox();if(null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return h.attr("transform",`translate(${-p.width/2}, ${c})`),x=n.node().getBBox(),o.attr("transform",`translate(0, ${c+g+2*r})`),x=n.node().getBBox(),d.attr("transform",`translate(0, ${c+g+(f?f+4*r:2*r)})`),x=n.node().getBBox(),{shapeSvg:n,bbox:x}}async function t4(t,e,a,l=[]){let r;let o=t.insert("g").attr("class","label").attr("style",l.join("; ")),d=(0,s.iE)(),c="useHtmlLabels"in e?e.useHtmlLabels:(0,s.ku)(d.htmlLabels)??!0,g="";g="text"in e?e.text:e.label,!c&&g.startsWith("\\")&&(g=g.substring(1)),(0,s.l0)(g)&&(c=!0);let y=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(g)),{width:(0,n.Cq)(g,d)+50,classes:"markdown-node-label",useHtmlLabels:c},d),f=1;if(c){let t=y.children[0],e=(0,h.Ys)(y);f=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(f+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===g.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(d.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{l.includes("font-weight: bolder")&&(0,h.Ys)(y).selectAll("tspan").attr("font-weight",""),f=y.children.length;let t=y.children[0];(""===y.textContent||y.textContent.includes("&gt"))&&(t.textContent=g[0]+g.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim()," "===g[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),r=y.getBBox()}return o.attr("transform","translate(0,"+(-r.height/(2*f)+a)+")"),r.height}async function t7(t,e){let a=(0,s.nV)(),l=a.class.padding??12,i=e.useHtmlLabels??(0,s.ku)(a.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:n,bbox:d}=await t8(t,e,a,i,l),{labelStyles:c,nodeStyles:y}=(0,r.UG)(e);e.labelStyle=c,e.cssStyles=e.styles||"";let f=e.styles?.join(";")||y||"";e.cssStyles||(e.cssStyles=f.replaceAll("!important","").split(";"));let p=0===e.members.length&&0===e.methods.length&&!a.class?.hideEmptyMembersBox,u=o.Z.svg(n),m=(0,r._q)(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=d.width,w=d.height;0===e.members.length&&0===e.methods.length?w+=l:e.members.length>0&&0===e.methods.length&&(w+=2*l);let b=-x/2,$=-w/2,k=u.rectangle(b-l,$-l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0),x+2*l,w+2*l+(p?2*l:0===e.members.length&&0===e.methods.length?-l:0),m),M=n.insert(()=>k,":first-child");M.attr("class","basic label-container");let S=M.node().getBBox();n.selectAll(".text").each((t,a,r)=>{let s=(0,h.Ys)(r[a]),o=s.attr("transform"),d=0;if(o){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);t&&(d=parseFloat(t[2]))}let c=d+$+l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0);i||(c-=4);let g=b;(s.attr("class").includes("label-group")||s.attr("class").includes("annotation-group"))&&(g=-s.node()?.getBBox().width/2||0,n.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),s.attr("transform",`translate(${g}, ${c})`)});let D=n.select(".annotation-group").node().getBBox().height-(p?l/2:0)||0,W=n.select(".label-group").node().getBBox().height-(p?l/2:0)||0,v=n.select(".members-group").node().getBBox().height-(p?l/2:0)||0;if(e.members.length>0||e.methods.length>0||p){let t=u.line(S.x,D+W+$+l,S.x+S.width,D+W+$+l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if(p||e.members.length>0||e.methods.length>0){let t=u.line(S.x,D+W+v+$+2*l+l,S.x+S.width,D+W+v+$+l+2*l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if("handDrawn"!==e.look&&n.selectAll("path").attr("style",f),M.select(":nth-child(2)").attr("style",f),n.selectAll(".divider").select("path").attr("style",f),e.labelStyle?n.selectAll("span").attr("style",e.labelStyle):n.selectAll("span").attr("style",f),!i){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(f);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}else if(c){let e=t.exec(c);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}}}return g(e,M),e.intersect=function(t){return _.rect(e,t)},n}async function t9(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let n="verifyMethod"in e,s=y(e),d=t.insert("g").attr("class",s).attr("id",e.domId??e.id),c=a=n?await t3(d,`&lt;&lt;${e.type}&gt;&gt;`,0,e.labelStyle):await t3(d,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle),f=await t3(d,e.name,c,e.labelStyle+"; font-weight: bold;");if(c+=f+20,n){let t=await t3(d,`${e.requirementId?`id: ${e.requirementId}`:""}`,c,e.labelStyle);c+=t;let a=await t3(d,`${e.text?`Text: ${e.text}`:""}`,c,e.labelStyle);c+=a;let l=await t3(d,`${e.risk?`Risk: ${e.risk}`:""}`,c,e.labelStyle);c+=l,await t3(d,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,c,e.labelStyle)}else{let t=await t3(d,`${e.type?`Type: ${e.type}`:""}`,c,e.labelStyle);c+=t,await t3(d,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,c,e.labelStyle)}let p=(d.node()?.getBBox().width??200)+20,u=(d.node()?.getBBox().height??200)+20,m=-p/2,x=-u/2,w=o.Z.svg(d),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.rectangle(m,x,p,u,b),k=d.insert(()=>$,":first-child");if(k.attr("class","basic label-container").attr("style",i),d.selectAll(".label").each((t,e,a)=>{let l=(0,h.Ys)(a[e]),r=l.attr("transform"),i=0,n=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),n=parseFloat(t[2]))}let s=n-u/2,o=m+10;(0===e||1===e)&&(o=i),l.attr("transform",`translate(${o}, ${s+20})`)}),c>a+f+20){let t=w.line(m,x+a+f+20,m+p,x+a+f+20,b);d.insert(()=>t).attr("style",i)}return g(e,k),e.intersect=function(t){return _.rect(e,t)},d}async function t3(t,e,a,l=""){let r;if(""===e)return 0;let o=t.insert("g").attr("class","label").attr("style",l),d=(0,s.nV)(),c=d.htmlLabels??!0,g=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(e)),{width:(0,n.Cq)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},d);if(c){let t=g.children[0],e=(0,h.Ys)(g);r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{for(let t of g.children[0].children)t.textContent=t.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),l&&t.setAttribute("style",l);r=g.getBBox(),r.height+=6}return o.attr("transform",`translate(${-r.width/2},${-r.height/2+a})`),r.height}(0,s.eW)(tF,"tiltedCylinder"),(0,s.eW)(tX,"trapezoid"),(0,s.eW)(tJ,"trapezoidalPentagon"),(0,s.eW)(tK,"triangle"),(0,s.eW)(tQ,"waveEdgedRectangle"),(0,s.eW)(t0,"waveRectangle"),(0,s.eW)(t2,"windowPane"),(0,s.eW)(t1,"erBox"),(0,s.eW)(t5,"addText"),(0,s.eW)(t8,"textHelper"),(0,s.eW)(t4,"addText"),(0,s.eW)(t7,"classBox"),(0,s.eW)(t9,"requirementBox"),(0,s.eW)(t3,"addText");var t6=(0,s.eW)(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function et(t,e,{config:a}){let l,i,n,s;let{labelStyles:h,nodeStyles:f}=(0,r.UG)(e);e.labelStyle=h||"";let p=e.width;e.width=(e.width??200)-10;let{shapeSvg:u,bbox:m,label:x}=await d(t,e,y(e)),w=e.padding||10,b="";"ticket"in e&&e.ticket&&a?.kanban?.ticketBaseUrl&&(b=a?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),l=u.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",b).attr("target","_blank"));let k={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};l?{label:i,bbox:n}=await c(l,"ticket"in e&&e.ticket||"",k):{label:i,bbox:n}=await c(u,"ticket"in e&&e.ticket||"",k);let{label:M,bbox:S}=await c(u,"assigned"in e&&e.assigned||"",k);e.width=p;let D=e?.width||0,W=Math.max(n.height,S.height)/2,v=Math.max(m.height+20,e?.height||0)+W,C=-D/2,B=-v/2;x.attr("transform","translate("+(w-D/2)+", "+(-W-m.height/2)+")"),i.attr("transform","translate("+(w-D/2)+", "+(-W+m.height/2)+")"),M.attr("transform","translate("+(w+D/2-S.width-20)+", "+(-W+m.height/2)+")");let{rx:N,ry:A}=e,{cssStyles:R}=e;if("handDrawn"===e.look){let t=o.Z.svg(u),a=(0,r._q)(e,{}),l=N||A?t.path($(C,B,D,v,N||0),a):t.rectangle(C,B,D,v,a);(s=u.insert(()=>l,":first-child")).attr("class","basic label-container").attr("style",R||null)}else{(s=u.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",f).attr("rx",N??5).attr("ry",A??5).attr("x",C).attr("y",B).attr("width",D).attr("height",v);let t="priority"in e&&e.priority;if(t){let e=u.append("line"),a=C+2,l=B+Math.floor((N??0)/2),r=B+v-Math.floor((N??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",t6(t))}}return g(e,s),e.height=v,e.intersect=function(t){return _.rect(e,t)},u}(0,s.eW)(et,"kanbanItem");var ee=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tZ},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tq},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:tE},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:te},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:E},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:tA},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:to},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tb},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:tw},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:tX},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:tu},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:tl},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:tY},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:T},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:t_},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:tI},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:tT},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tn},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:td},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:j},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:z},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:X},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:t$},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:tQ},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ts},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:tF},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tD},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:J},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ta},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:tK},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:t2},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:tr},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tJ},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ti},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tP},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tC},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tv},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:U},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:V},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:tV},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:tH},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tR},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:tW}],ea=(0,s.eW)(()=>Object.fromEntries([...Object.entries({state:tG,choice:I,note:tB,rectWithTitle:tL,labelRect:tx,iconSquare:tf,iconCircle:tg,icon:tc,iconRounded:ty,imageSquare:tp,anchor:P,kanbanItem:et,classBox:t7,erBox:t1,requirementBox:t9}),...ee.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))]),"generateShapeMap")();function el(t){return t in ea}(0,s.eW)(el,"isValidShape");var er=new Map;async function ei(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?ea[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),er.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}(0,s.eW)(ei,"insertNode");var en=(0,s.eW)((t,e)=>{er.set(e.id,t)},"setNodeElem"),es=(0,s.eW)(()=>{er.clear()},"clear"),eh=(0,s.eW)(t=>{let e=er.get(t.id);s.cM.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7200],{24369:function(e,t,n){var r=n(2265),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},u=r.useState,a=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=u({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return o(function(){i.value=n,i.getSnapshot=t,c(i)&&s({inst:i})},[e,n,t]),a(function(){return c(i)&&s({inst:i}),e(function(){c(i)&&s({inst:i})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:s},82558:function(e,t,n){e.exports=n(24369)},6952:function(e,t,n){n.d(t,{B:function(){return g},I:function(){return k},O:function(){return c},S:function(){return J},U:function(){return l},a:function(){return f},b:function(){return a},c:function(){return $},d:function(){return z},e:function(){return s},f:function(){return B},g:function(){return Z},i:function(){return w},j:function(){return q},m:function(){return d},n:function(){return N},o:function(){return M},r:function(){return L},s:function(){return F},t:function(){return T},u:function(){return V},z:function(){return O}});var r=n(2265),i=n(98183),u=Object.prototype.hasOwnProperty;let a=new WeakMap,o=()=>{},l=o(),c=Object,s=e=>e===l,f=e=>"function"==typeof e,d=(e,t)=>({...e,...t}),g=e=>f(e.then),h={},p={},v="undefined",w=typeof window!=v,y=typeof document!=v,b=w&&"Deno"in window,m=()=>w&&typeof window.requestAnimationFrame!=v,O=(e,t)=>{let n=a.get(e);return[()=>!s(t)&&e.get(t)||h,r=>{if(!s(t)){let i=e.get(t);t in p||(p[t]=i),n[5](t,d(i,r),i||h)}},n[6],()=>!s(t)&&t in p?p[t]:!s(t)&&e.get(t)||h]},S=!0,[E,_]=w&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[o,o],R={initFocus:e=>(y&&document.addEventListener("visibilitychange",e),E("focus",e),()=>{y&&document.removeEventListener("visibilitychange",e),_("focus",e)}),initReconnect:e=>{let t=()=>{S=!0,e()},n=()=>{S=!1};return E("online",t),E("offline",n),()=>{_("online",t),_("offline",n)}}},k=!r.useId,L=!w||b,T=e=>m()?window.requestAnimationFrame(e):setTimeout(e,1),V=L?r.useEffect:r.useLayoutEffect,j="undefined"!=typeof navigator&&navigator.connection,C=!L&&j&&(["slow-2g","2g"].includes(j.effectiveType)||j.saveData),D=new WeakMap,x=e=>c.prototype.toString.call(e),I=(e,t)=>e==="[object ".concat(t,"]"),P=0,A=e=>{let t,n;let r=typeof e,i=x(e),u=I(i,"Date"),a=I(i,"RegExp"),o=I(i,"Object");if(c(e)!==e||u||a)t=u?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=D.get(e))return t;if(t=++P+"~",D.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=A(e[n])+",";D.set(e,t)}if(o){t="#";let r=c.keys(e).sort();for(;!s(n=r.pop());)s(e[n])||(t+=n+":"+A(e[n])+",");D.set(e,t)}}return t},F=e=>{if(f(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?A(e):"",t]},U=0,M=()=>++U;async function N(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,u,o,c]=t,h=d({populateCache:!0,throwOnError:!0},"boolean"==typeof c?{revalidate:c}:c||{}),p=h.populateCache,v=h.rollbackOnError,w=h.optimisticData,y=e=>"function"==typeof v?v(e):!1!==v,b=h.throwOnError;if(f(u)){let e=[];for(let t of r.keys())!/^\$(inf|sub)\$/.test(t)&&u(r.get(t)._k)&&e.push(t);return Promise.all(e.map(m))}return m(u);async function m(e){let n;let[u]=F(e);if(!u)return;let[c,d]=O(r,u),[v,m,S,E]=a.get(r),_=()=>{let t=v[u];return(f(h.revalidate)?h.revalidate(c().data,e):!1!==h.revalidate)&&(delete S[u],delete E[u],t&&t[0])?t[0](i.QQ).then(()=>c().data):c().data};if(t.length<3)return _();let R=o,k=!1,L=M();m[u]=[L,0];let T=!s(w),V=c(),j=V.data,C=V._c,D=s(C)?j:C;if(T&&d({data:w=f(w)?w(D,j):w,_c:D}),f(R))try{R=R(D)}catch(e){n=e,k=!0}if(R&&g(R)){if(R=await R.catch(e=>{n=e,k=!0}),L!==m[u][0]){if(k)throw n;return R}k&&T&&y(n)&&(p=!0,d({data:D,_c:l}))}if(p&&!k&&(f(p)?d({data:p(R,D),error:l,_c:l}):d({data:R,error:l,_c:l})),m[u][1]=M(),Promise.resolve(_()).then(()=>{d({_c:l})}),k){if(b)throw n;return}return R}}let W=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},Q=(e,t)=>{if(!a.has(e)){let n=d(R,t),r=Object.create(null),u=N.bind(l,e),c=o,s=Object.create(null),f=(e,t)=>{let n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},g=(t,n,r)=>{e.set(t,n);let i=s[t];if(i)for(let e of i)e(n,r)},h=()=>{if(!a.has(e)&&(a.set(e,[r,Object.create(null),Object.create(null),Object.create(null),u,g,f]),!L)){let t=n.initFocus(setTimeout.bind(l,W.bind(l,r,i.N4))),u=n.initReconnect(setTimeout.bind(l,W.bind(l,r,i.l2)));c=()=>{t&&t(),u&&u(),a.delete(e)}}};return h(),[e,u,h,c]}return[e,a.get(e)[4]]},[$,q]=Q(new Map),z=d({onLoadingSlow:o,onSuccess:o,onError:o,onErrorRetry:(e,t,n,r,i)=>{let u=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(s(u)||!(a>u))&&setTimeout(r,o,i)},onDiscarded:o,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:C?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:C?5e3:3e3,compare:function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return -1===i}if(!r||"object"==typeof t){for(r in i=0,t)if(u.call(t,r)&&++i&&!u.call(n,r)||!(r in n)||!e(t[r],n[r]))return!1;return Object.keys(n).length===i}}return t!=t&&n!=n},isPaused:()=>!1,cache:$,mutate:q,fallback:{}},{isOnline:()=>S,isVisible:()=>{let e=y&&document.visibilityState;return s(e)||"hidden"!==e}}),B=(e,t)=>{let n=d(e,t);if(t){let{use:r,fallback:i}=e,{use:u,fallback:a}=t;r&&u&&(n.use=r.concat(u)),i&&a&&(n.fallback=d(i,a))}return n},J=(0,r.createContext)({}),Z=e=>{let{value:t}=e,n=(0,r.useContext)(J),i=f(t),u=(0,r.useMemo)(()=>i?t(n):t,[i,n,t]),a=(0,r.useMemo)(()=>i?u:B(n,u),[i,n,u]),o=u&&u.provider,c=(0,r.useRef)(l);o&&!c.current&&(c.current=Q(o(a.cache||$),u));let s=c.current;return s&&(a.cache=s[0],a.mutate=s[1]),V(()=>{if(s)return s[2]&&s[2](),s[3]},[]),(0,r.createElement)(J.Provider,d(e,{value:a}))}},98183:function(e,t,n){n.d(t,{N4:function(){return r},QQ:function(){return u},aU:function(){return a},l2:function(){return i}});let r=0,i=1,u=2,a=3},17200:function(e,t,n){let r;n.d(t,{ZP:function(){return w}});var i=n(2265),u=n(82558),a=n(6952),o=n(98183);let l=a.i&&window.__SWR_DEVTOOLS_USE__,c=l?window.__SWR_DEVTOOLS_USE__:[],s=e=>(0,a.a)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],f=()=>(0,a.m)(a.d,(0,i.useContext)(a.S)),d=c.concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=(0,a.s)(t),[,,,i]=a.b.get(a.c);if(r.startsWith("$inf$"))return n(...e);let u=i[r];return(0,a.e)(u)?n(...e):(delete i[r],u)});return e(t,i,r)}),g=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};l&&(window.__SWR_DEVTOOLS_REACT__=i);let h=()=>{};h(),new WeakMap;let p=i.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),v={dedupe:!0};a.O.defineProperty(a.g,"defaultValue",{value:a.d});let w=(r=(e,t,n)=>{let{cache:r,compare:l,suspense:c,fallbackData:s,revalidateOnMount:f,revalidateIfStale:d,refreshInterval:h,refreshWhenHidden:w,refreshWhenOffline:y,keepPreviousData:b}=n,[m,O,S,E]=a.b.get(r),[_,R]=(0,a.s)(e),k=(0,i.useRef)(!1),L=(0,i.useRef)(!1),T=(0,i.useRef)(_),V=(0,i.useRef)(t),j=(0,i.useRef)(n),C=()=>j.current,D=()=>C().isVisible()&&C().isOnline(),[x,I,P,A]=(0,a.z)(r,_),F=(0,i.useRef)({}).current,U=(0,a.e)(s)?(0,a.e)(n.fallback)?a.U:n.fallback[_]:s,M=(e,t)=>{for(let n in F)if("data"===n){if(!l(e[n],t[n])&&(!(0,a.e)(e[n])||!l(Z,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},N=(0,i.useMemo)(()=>{let e=!!_&&!!t&&((0,a.e)(f)?!C().isPaused()&&!c&&!1!==d:f),n=t=>{let n=(0,a.m)(t);return(delete n._k,e)?{isValidating:!0,isLoading:!0,...n}:n},r=x(),i=A(),u=n(r),o=r===i?u:n(i),l=u;return[()=>{let e=n(x());return M(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>o]},[r,_]),W=(0,u.useSyncExternalStore)((0,i.useCallback)(e=>P(_,(t,n)=>{M(n,t)||e()}),[r,_]),N[0],N[1]),Q=!k.current,$=m[_]&&m[_].length>0,q=W.data,z=(0,a.e)(q)?U&&(0,a.B)(U)?p(U):U:q,B=W.error,J=(0,i.useRef)(z),Z=b?(0,a.e)(q)?(0,a.e)(J.current)?z:J.current:q:z,G=(!$||!!(0,a.e)(B))&&(Q&&!(0,a.e)(f)?f:!C().isPaused()&&(c?!(0,a.e)(z)&&d:(0,a.e)(z)||d)),H=!!(_&&t&&Q&&G),K=(0,a.e)(W.isValidating)?H:W.isValidating,X=(0,a.e)(W.isLoading)?H:W.isLoading,Y=(0,i.useCallback)(async e=>{let t,r;let i=V.current;if(!_||!i||L.current||C().isPaused())return!1;let u=!0,c=e||{},s=!S[_]||!c.dedupe,f=()=>a.I?!L.current&&_===T.current&&k.current:_===T.current,d={isValidating:!1,isLoading:!1},g=()=>{I(d)},h=()=>{let e=S[_];e&&e[1]===r&&delete S[_]},p={isValidating:!0};(0,a.e)(x().data)&&(p.isLoading=!0);try{if(s&&(I(p),n.loadingTimeout&&(0,a.e)(x().data)&&setTimeout(()=>{u&&f()&&C().onLoadingSlow(_,n)},n.loadingTimeout),S[_]=[i(R),(0,a.o)()]),[t,r]=S[_],t=await t,s&&setTimeout(h,n.dedupingInterval),!S[_]||S[_][1]!==r)return s&&f()&&C().onDiscarded(_),!1;d.error=a.U;let e=O[_];if(!(0,a.e)(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return g(),s&&f()&&C().onDiscarded(_),!1;let o=x().data;d.data=l(o,t)?o:t,s&&f()&&C().onSuccess(t,_,n)}catch(n){h();let e=C(),{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=n,s&&f()&&(e.onError(n,_,e),(!0===t||(0,a.a)(t)&&t(n))&&(!C().revalidateOnFocus||!C().revalidateOnReconnect||D())&&e.onErrorRetry(n,_,e,e=>{let t=m[_];t&&t[0]&&t[0](o.aU,e)},{retryCount:(c.retryCount||0)+1,dedupe:!0})))}return u=!1,g(),!0},[_,r]),ee=(0,i.useCallback)((...e)=>(0,a.n)(r,T.current,...e),[]);if((0,a.u)(()=>{V.current=t,j.current=n,(0,a.e)(q)||(J.current=q)}),(0,a.u)(()=>{if(!_)return;let e=Y.bind(a.U,v),t=0;C().revalidateOnFocus&&(t=Date.now()+C().focusThrottleInterval);let n=g(_,m,(n,r={})=>{if(n==o.N4){let n=Date.now();C().revalidateOnFocus&&n>t&&D()&&(t=n+C().focusThrottleInterval,e())}else if(n==o.l2)C().revalidateOnReconnect&&D()&&e();else if(n==o.QQ)return Y();else if(n==o.aU)return Y(r)});return L.current=!1,T.current=_,k.current=!0,I({_k:R}),G&&!S[_]&&((0,a.e)(z)||a.r?e():(0,a.t)(e)),()=>{L.current=!0,n()}},[_]),(0,a.u)(()=>{let e;function t(){let t=(0,a.a)(h)?h(x().data):h;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!x().error&&(w||C().isVisible())&&(y||C().isOnline())?Y(v).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[h,w,y,_]),(0,i.useDebugValue)(Z),c&&(0,a.e)(z)&&_){if(!a.I&&a.r)throw Error("Fallback data is required when using Suspense in SSR.");V.current=t,j.current=n,L.current=!1;let e=E[_];if((0,a.e)(e)||p(ee(e)),(0,a.e)(B)){let e=Y(v);(0,a.e)(Z)||(e.status="fulfilled",e.value=!0),p(e)}else throw B}return{mutate:ee,get data(){return F.data=!0,Z},get error(){return F.error=!0,B},get isValidating(){return F.isValidating=!0,K},get isLoading(){return F.isLoading=!0,X}}},function(...e){let t=f(),[n,i,u]=s(e),o=(0,a.f)(t,u),l=r,{use:c}=o,g=(c||[]).concat(d);for(let e=g.length;e--;)l=g[e](l);return l(n,i||o.fetcher||null,o)})}}]);