@goondocks/myco 0.14.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/{agent-run-A7YYMN6S.js → agent-run-DUOJ3KDI.js} +6 -6
  2. package/dist/{agent-tasks-MDVJW5SV.js → agent-tasks-LUWBY5JD.js} +6 -6
  3. package/dist/{chunk-X34OFKYU.js → chunk-23FJUKCN.js} +2 -2
  4. package/dist/{chunk-KNTJOMWY.js → chunk-3MEOYXOW.js} +2 -2
  5. package/dist/{chunk-PSYLKCWQ.js → chunk-4BQ5QE76.js} +24 -5
  6. package/dist/chunk-4BQ5QE76.js.map +1 -0
  7. package/dist/{chunk-JTYZRPX5.js → chunk-5ZT2Q6P5.js} +1 -1
  8. package/dist/{chunk-JJXVDCEX.js → chunk-75J2BR4P.js} +486 -488
  9. package/dist/chunk-75J2BR4P.js.map +1 -0
  10. package/dist/{chunk-XRVLSSJY.js → chunk-B3SF2CCW.js} +3 -3
  11. package/dist/{chunk-S6I62FAH.js → chunk-CUADDHHU.js} +4 -2
  12. package/dist/{chunk-S6I62FAH.js.map → chunk-CUADDHHU.js.map} +1 -1
  13. package/dist/{chunk-4VF6KQ2Z.js → chunk-DJQOYEK3.js} +87 -84
  14. package/dist/chunk-DJQOYEK3.js.map +1 -0
  15. package/dist/{chunk-LD6U3L6O.js → chunk-DK5VEBB5.js} +5 -5
  16. package/dist/{chunk-NBPZI5UD.js → chunk-DKGUCEWU.js} +6 -6
  17. package/dist/{chunk-OQVKLTQY.js → chunk-EYMKBNRP.js} +2 -2
  18. package/dist/{chunk-KH64DHOY.js → chunk-GDY63YAW.js} +279 -277
  19. package/dist/chunk-GDY63YAW.js.map +1 -0
  20. package/dist/{chunk-ZESTWGJT.js → chunk-GYIA6XLB.js} +2 -2
  21. package/dist/{chunk-HSMD2COQ.js → chunk-GZ7MXWYX.js} +3 -3
  22. package/dist/{chunk-S66YG6QK.js → chunk-LF5Z62X6.js} +46 -7
  23. package/dist/chunk-LF5Z62X6.js.map +1 -0
  24. package/dist/{chunk-PGYJSXSK.js → chunk-OMZCVRX6.js} +2 -2
  25. package/dist/{chunk-QMGQSA5A.js → chunk-R3YW7XVF.js} +2 -2
  26. package/dist/{chunk-PX5KIOKY.js → chunk-SPJGJEFV.js} +10 -2
  27. package/dist/{chunk-PX5KIOKY.js.map → chunk-SPJGJEFV.js.map} +1 -1
  28. package/dist/{chunk-QFMBZ72S.js → chunk-SV6UCB2Z.js} +2 -2
  29. package/dist/{chunk-NVCGF2DS.js → chunk-X4XFJG6I.js} +10 -6
  30. package/dist/chunk-X4XFJG6I.js.map +1 -0
  31. package/dist/{chunk-TNCBMGWB.js → chunk-X5IXK5KO.js} +262 -226
  32. package/dist/chunk-X5IXK5KO.js.map +1 -0
  33. package/dist/{chunk-TVV6PZOC.js → chunk-Z7TZJ2SP.js} +2 -2
  34. package/dist/{cli-HEPHQSLV.js → cli-YBD2GPK4.js} +45 -44
  35. package/dist/cli-YBD2GPK4.js.map +1 -0
  36. package/dist/{client-ZXC6IY63.js → client-CJ3X252K.js} +4 -4
  37. package/dist/{config-H657SF6B.js → config-MOWCOJJ4.js} +4 -4
  38. package/dist/{detect-27DN6UTL.js → detect-GFYKKHLJ.js} +3 -3
  39. package/dist/{detect-providers-PAVE2X6O.js → detect-providers-EU35RUL3.js} +2 -2
  40. package/dist/{doctor-Q5WJBNSZ.js → doctor-JR7NEL7K.js} +38 -19
  41. package/dist/doctor-JR7NEL7K.js.map +1 -0
  42. package/dist/{executor-YX2MA4T3.js → executor-7XOKS6HS.js} +442 -248
  43. package/dist/executor-7XOKS6HS.js.map +1 -0
  44. package/dist/{init-KWCGGLP3.js → init-PDLKYWQ4.js} +41 -23
  45. package/dist/init-PDLKYWQ4.js.map +1 -0
  46. package/dist/{init-wizard-YUT7MIYZ.js → init-wizard-WH3SXNMB.js} +7 -7
  47. package/dist/{installer-25TSX4SR.js → installer-BTUNKWOU.js} +2 -2
  48. package/dist/{llm-T3QVHC3Y.js → llm-DK44LYO6.js} +4 -4
  49. package/dist/{loader-WQKVWL5D.js → loader-WC4U5NM5.js} +4 -4
  50. package/dist/{loader-JQLO6K44.js → loader-WGDVRGLM.js} +6 -4
  51. package/dist/{logs-LXHPDKUA.js → logs-WFBX2I7C.js} +3 -3
  52. package/dist/{main-WHGJ6UV7.js → main-JB3R3DQE.js} +2346 -1912
  53. package/dist/main-JB3R3DQE.js.map +1 -0
  54. package/dist/{open-CBNGDM32.js → open-AADZPSLW.js} +6 -6
  55. package/dist/{openai-embeddings-5T5ZP7LO.js → openai-embeddings-SEIV7AM3.js} +2 -2
  56. package/dist/{openrouter-RD2COFC7.js → openrouter-ELODIZRP.js} +2 -2
  57. package/dist/{post-compact-AANLN7TR.js → post-compact-KNQ4DYLM.js} +9 -9
  58. package/dist/{post-tool-use-X3IFZEMV.js → post-tool-use-OMWHFQLM.js} +10 -10
  59. package/dist/{post-tool-use-failure-T6KAFDFF.js → post-tool-use-failure-KFP6MB7Z.js} +9 -9
  60. package/dist/{pre-compact-FY7BPS4J.js → pre-compact-2ZYE2HRB.js} +9 -9
  61. package/dist/{provider-check-QN7OGXZA.js → provider-check-B66E5PWS.js} +2 -2
  62. package/dist/{registry-2XQMCPA6.js → registry-DHWVHXWY.js} +5 -5
  63. package/dist/{remove-TN3BLJEC.js → remove-QT7634L5.js} +52 -20
  64. package/dist/remove-QT7634L5.js.map +1 -0
  65. package/dist/{resolution-events-5EVUEWHS.js → resolution-events-DBCRVZGU.js} +4 -4
  66. package/dist/{restart-KT4R3QN5.js → restart-YQNQEHOU.js} +7 -7
  67. package/dist/{search-NQFXQUUQ.js → search-C6JTQDWY.js} +6 -6
  68. package/dist/{server-6QIP325R.js → server-QJ3RWZZZ.js} +8 -8
  69. package/dist/{session-E7B3B4ZQ.js → session-JLVL5TYX.js} +8 -8
  70. package/dist/{session-end-H2E42BZG.js → session-end-XFZRRP5H.js} +10 -10
  71. package/dist/{session-start-FLND66CU.js → session-start-XGINISXO.js} +15 -15
  72. package/dist/{setup-llm-YAXEM23S.js → setup-llm-X2OCM6R7.js} +8 -8
  73. package/dist/src/agent/definitions/tasks/full-intelligence.yaml +8 -7
  74. package/dist/src/agent/definitions/tasks/skill-evolve.yaml +71 -144
  75. package/dist/src/agent/definitions/tasks/skill-generate.yaml +10 -62
  76. package/dist/src/agent/definitions/tasks/skill-survey.yaml +87 -53
  77. package/dist/src/agent/prompts/agent.md +1 -0
  78. package/dist/src/cli.js +1 -1
  79. package/dist/src/daemon/main.js +1 -1
  80. package/dist/src/hooks/post-tool-use.js +1 -1
  81. package/dist/src/hooks/session-end.js +1 -1
  82. package/dist/src/hooks/session-start.js +1 -1
  83. package/dist/src/hooks/stop.js +1 -1
  84. package/dist/src/hooks/user-prompt-submit.js +1 -1
  85. package/dist/src/mcp/server.js +1 -1
  86. package/dist/src/worker/src/schema.ts +14 -0
  87. package/dist/{stats-MD4PUVRL.js → stats-2EAETG2T.js} +9 -9
  88. package/dist/{stop-CFUWXMNB.js → stop-WOBDYTSA.js} +10 -10
  89. package/dist/{stop-failure-ZOHR2EUI.js → stop-failure-QEC7ZGBQ.js} +9 -9
  90. package/dist/{subagent-start-AXZAVBJU.js → subagent-start-H6DVRVOE.js} +9 -9
  91. package/dist/{subagent-stop-FVQGEEZ4.js → subagent-stop-LKENKJ65.js} +9 -9
  92. package/dist/{task-completed-NKJU2SRN.js → task-completed-ZZ47PRPD.js} +9 -9
  93. package/dist/{team-SJPDXELY.js → team-J62N7VMG.js} +34 -26
  94. package/dist/team-J62N7VMG.js.map +1 -0
  95. package/dist/ui/assets/index-Bx9l8uxa.js +837 -0
  96. package/dist/ui/assets/{index-BmsHIwjl.css → index-DlEQ8A8Y.css} +1 -1
  97. package/dist/ui/index.html +2 -2
  98. package/dist/{update-2C4WQ4WP.js → update-LX3CJ4TJ.js} +30 -14
  99. package/dist/update-LX3CJ4TJ.js.map +1 -0
  100. package/dist/{user-prompt-submit-RRSLN6LA.js → user-prompt-submit-NNMLY3EW.js} +10 -10
  101. package/dist/{verify-JHIMXTY5.js → verify-AMRQXQ3K.js} +6 -6
  102. package/dist/{version-CGFXQBSI.js → version-6OJH5HLZ.js} +2 -2
  103. package/package.json +2 -2
  104. package/dist/chunk-4VF6KQ2Z.js.map +0 -1
  105. package/dist/chunk-JJXVDCEX.js.map +0 -1
  106. package/dist/chunk-KH64DHOY.js.map +0 -1
  107. package/dist/chunk-NVCGF2DS.js.map +0 -1
  108. package/dist/chunk-PSYLKCWQ.js.map +0 -1
  109. package/dist/chunk-S66YG6QK.js.map +0 -1
  110. package/dist/chunk-TNCBMGWB.js.map +0 -1
  111. package/dist/cli-HEPHQSLV.js.map +0 -1
  112. package/dist/doctor-Q5WJBNSZ.js.map +0 -1
  113. package/dist/executor-YX2MA4T3.js.map +0 -1
  114. package/dist/init-KWCGGLP3.js.map +0 -1
  115. package/dist/main-WHGJ6UV7.js.map +0 -1
  116. package/dist/remove-TN3BLJEC.js.map +0 -1
  117. package/dist/resolve-3FEUV462.js +0 -9
  118. package/dist/team-SJPDXELY.js.map +0 -1
  119. package/dist/ui/assets/index-Cn6cQwJy.js +0 -842
  120. package/dist/update-2C4WQ4WP.js.map +0 -1
  121. package/dist/version-CGFXQBSI.js.map +0 -1
  122. /package/dist/{agent-run-A7YYMN6S.js.map → agent-run-DUOJ3KDI.js.map} +0 -0
  123. /package/dist/{agent-tasks-MDVJW5SV.js.map → agent-tasks-LUWBY5JD.js.map} +0 -0
  124. /package/dist/{chunk-X34OFKYU.js.map → chunk-23FJUKCN.js.map} +0 -0
  125. /package/dist/{chunk-KNTJOMWY.js.map → chunk-3MEOYXOW.js.map} +0 -0
  126. /package/dist/{chunk-JTYZRPX5.js.map → chunk-5ZT2Q6P5.js.map} +0 -0
  127. /package/dist/{chunk-XRVLSSJY.js.map → chunk-B3SF2CCW.js.map} +0 -0
  128. /package/dist/{chunk-LD6U3L6O.js.map → chunk-DK5VEBB5.js.map} +0 -0
  129. /package/dist/{chunk-NBPZI5UD.js.map → chunk-DKGUCEWU.js.map} +0 -0
  130. /package/dist/{chunk-OQVKLTQY.js.map → chunk-EYMKBNRP.js.map} +0 -0
  131. /package/dist/{chunk-ZESTWGJT.js.map → chunk-GYIA6XLB.js.map} +0 -0
  132. /package/dist/{chunk-HSMD2COQ.js.map → chunk-GZ7MXWYX.js.map} +0 -0
  133. /package/dist/{chunk-PGYJSXSK.js.map → chunk-OMZCVRX6.js.map} +0 -0
  134. /package/dist/{chunk-QMGQSA5A.js.map → chunk-R3YW7XVF.js.map} +0 -0
  135. /package/dist/{chunk-QFMBZ72S.js.map → chunk-SV6UCB2Z.js.map} +0 -0
  136. /package/dist/{chunk-TVV6PZOC.js.map → chunk-Z7TZJ2SP.js.map} +0 -0
  137. /package/dist/{client-ZXC6IY63.js.map → client-CJ3X252K.js.map} +0 -0
  138. /package/dist/{config-H657SF6B.js.map → config-MOWCOJJ4.js.map} +0 -0
  139. /package/dist/{detect-27DN6UTL.js.map → detect-GFYKKHLJ.js.map} +0 -0
  140. /package/dist/{detect-providers-PAVE2X6O.js.map → detect-providers-EU35RUL3.js.map} +0 -0
  141. /package/dist/{init-wizard-YUT7MIYZ.js.map → init-wizard-WH3SXNMB.js.map} +0 -0
  142. /package/dist/{installer-25TSX4SR.js.map → installer-BTUNKWOU.js.map} +0 -0
  143. /package/dist/{llm-T3QVHC3Y.js.map → llm-DK44LYO6.js.map} +0 -0
  144. /package/dist/{loader-JQLO6K44.js.map → loader-WC4U5NM5.js.map} +0 -0
  145. /package/dist/{loader-WQKVWL5D.js.map → loader-WGDVRGLM.js.map} +0 -0
  146. /package/dist/{logs-LXHPDKUA.js.map → logs-WFBX2I7C.js.map} +0 -0
  147. /package/dist/{open-CBNGDM32.js.map → open-AADZPSLW.js.map} +0 -0
  148. /package/dist/{openai-embeddings-5T5ZP7LO.js.map → openai-embeddings-SEIV7AM3.js.map} +0 -0
  149. /package/dist/{openrouter-RD2COFC7.js.map → openrouter-ELODIZRP.js.map} +0 -0
  150. /package/dist/{post-compact-AANLN7TR.js.map → post-compact-KNQ4DYLM.js.map} +0 -0
  151. /package/dist/{post-tool-use-X3IFZEMV.js.map → post-tool-use-OMWHFQLM.js.map} +0 -0
  152. /package/dist/{post-tool-use-failure-T6KAFDFF.js.map → post-tool-use-failure-KFP6MB7Z.js.map} +0 -0
  153. /package/dist/{pre-compact-FY7BPS4J.js.map → pre-compact-2ZYE2HRB.js.map} +0 -0
  154. /package/dist/{provider-check-QN7OGXZA.js.map → provider-check-B66E5PWS.js.map} +0 -0
  155. /package/dist/{registry-2XQMCPA6.js.map → registry-DHWVHXWY.js.map} +0 -0
  156. /package/dist/{resolution-events-5EVUEWHS.js.map → resolution-events-DBCRVZGU.js.map} +0 -0
  157. /package/dist/{restart-KT4R3QN5.js.map → restart-YQNQEHOU.js.map} +0 -0
  158. /package/dist/{search-NQFXQUUQ.js.map → search-C6JTQDWY.js.map} +0 -0
  159. /package/dist/{server-6QIP325R.js.map → server-QJ3RWZZZ.js.map} +0 -0
  160. /package/dist/{session-E7B3B4ZQ.js.map → session-JLVL5TYX.js.map} +0 -0
  161. /package/dist/{session-end-H2E42BZG.js.map → session-end-XFZRRP5H.js.map} +0 -0
  162. /package/dist/{session-start-FLND66CU.js.map → session-start-XGINISXO.js.map} +0 -0
  163. /package/dist/{setup-llm-YAXEM23S.js.map → setup-llm-X2OCM6R7.js.map} +0 -0
  164. /package/dist/{stats-MD4PUVRL.js.map → stats-2EAETG2T.js.map} +0 -0
  165. /package/dist/{stop-CFUWXMNB.js.map → stop-WOBDYTSA.js.map} +0 -0
  166. /package/dist/{stop-failure-ZOHR2EUI.js.map → stop-failure-QEC7ZGBQ.js.map} +0 -0
  167. /package/dist/{subagent-start-AXZAVBJU.js.map → subagent-start-H6DVRVOE.js.map} +0 -0
  168. /package/dist/{subagent-stop-FVQGEEZ4.js.map → subagent-stop-LKENKJ65.js.map} +0 -0
  169. /package/dist/{task-completed-NKJU2SRN.js.map → task-completed-ZZ47PRPD.js.map} +0 -0
  170. /package/dist/{user-prompt-submit-RRSLN6LA.js.map → user-prompt-submit-NNMLY3EW.js.map} +0 -0
  171. /package/dist/{verify-JHIMXTY5.js.map → verify-AMRQXQ3K.js.map} +0 -0
  172. /package/dist/{resolve-3FEUV462.js.map → version-6OJH5HLZ.js.map} +0 -0
@@ -0,0 +1,837 @@
1
+ var OC=e=>{throw TypeError(e)};var ky=(e,t,n)=>t.has(e)||OC("Cannot "+n);var J=(e,t,n)=>(ky(e,t,"read from private field"),n?n.call(e):t.get(e)),et=(e,t,n)=>t.has(e)?OC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,r)=>(ky(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mt=(e,t,n)=>(ky(e,t,"access private method"),n);var iv=(e,t,n,r)=>({set _(a){Be(e,t,a,n)},get _(){return J(e,t,r)}});function h4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function pd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ty={exports:{}},pf={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var LC;function v4(){if(LC)return pf;LC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var o in a)o!=="key"&&(i[o]=a[o])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return pf.Fragment=t,pf.jsx=n,pf.jsxs=n,pf}var _C;function p4(){return _C||(_C=1,Ty.exports=v4()),Ty.exports}var h=p4(),jy={exports:{}},ft={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var BC;function m4(){if(BC)return ft;BC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function y(q){return q===null||typeof q!="object"?null:(q=m&&q[m]||q["@@iterator"],typeof q=="function"?q:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function w(q,X,z){this.props=q,this.context=X,this.refs=S,this.updater=z||x}w.prototype.isReactComponent={},w.prototype.setState=function(q,X){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,X,"setState")},w.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function N(){}N.prototype=w.prototype;function C(q,X,z){this.props=q,this.context=X,this.refs=S,this.updater=z||x}var T=C.prototype=new N;T.constructor=C,b(T,w.prototype),T.isPureReactComponent=!0;var R=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function B(q,X,z){var W=z.ref;return{$$typeof:e,type:q,key:X,ref:W!==void 0?W:null,props:z}}function M(q,X){return B(q.type,X,q.props)}function _(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function P(q){var X={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(z){return X[z]})}var H=/\/+/g;function $(q,X){return typeof q=="object"&&q!==null&&q.key!=null?P(""+q.key):X.toString(36)}function V(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(A,A):(q.status="pending",q.then(function(X){q.status==="pending"&&(q.status="fulfilled",q.value=X)},function(X){q.status==="pending"&&(q.status="rejected",q.reason=X)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function I(q,X,z,W,re){var ae=typeof q;(ae==="undefined"||ae==="boolean")&&(q=null);var ie=!1;if(q===null)ie=!0;else switch(ae){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(q.$$typeof){case e:case t:ie=!0;break;case d:return ie=q._init,I(ie(q._payload),X,z,W,re)}}if(ie)return re=re(q),ie=W===""?"."+$(q,0):W,R(re)?(z="",ie!=null&&(z=ie.replace(H,"$&/")+"/"),I(re,X,z,"",function(ee){return ee})):re!=null&&(_(re)&&(re=M(re,z+(re.key==null||q&&q.key===re.key?"":(""+re.key).replace(H,"$&/")+"/")+ie)),X.push(re)),1;ie=0;var ye=W===""?".":W+":";if(R(q))for(var ue=0;ue<q.length;ue++)W=q[ue],ae=ye+$(W,ue),ie+=I(W,X,z,ae,re);else if(ue=y(q),typeof ue=="function")for(q=ue.call(q),ue=0;!(W=q.next()).done;)W=W.value,ae=ye+$(W,ue++),ie+=I(W,X,z,ae,re);else if(ae==="object"){if(typeof q.then=="function")return I(V(q),X,z,W,re);throw X=String(q),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ie}function U(q,X,z){if(q==null)return q;var W=[],re=0;return I(q,W,"","",function(ae){return X.call(z,ae,re++)}),W}function Y(q){if(q._status===-1){var X=q._result;X=X(),X.then(function(z){(q._status===0||q._status===-1)&&(q._status=1,q._result=z)},function(z){(q._status===0||q._status===-1)&&(q._status=2,q._result=z)}),q._status===-1&&(q._status=0,q._result=X)}if(q._status===1)return q._result.default;throw q._result}var Q=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},F={map:U,forEach:function(q,X,z){U(q,function(){X.apply(this,arguments)},z)},count:function(q){var X=0;return U(q,function(){X++}),X},toArray:function(q){return U(q,function(X){return X})||[]},only:function(q){if(!_(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ft.Activity=p,ft.Children=F,ft.Component=w,ft.Fragment=n,ft.Profiler=a,ft.PureComponent=C,ft.StrictMode=r,ft.Suspense=f,ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ft.__COMPILER_RUNTIME={__proto__:null,c:function(q){return D.H.useMemoCache(q)}},ft.cache=function(q){return function(){return q.apply(null,arguments)}},ft.cacheSignal=function(){return null},ft.cloneElement=function(q,X,z){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var W=b({},q.props),re=q.key;if(X!=null)for(ae in X.key!==void 0&&(re=""+X.key),X)!L.call(X,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&X.ref===void 0||(W[ae]=X[ae]);var ae=arguments.length-2;if(ae===1)W.children=z;else if(1<ae){for(var ie=Array(ae),ye=0;ye<ae;ye++)ie[ye]=arguments[ye+2];W.children=ie}return B(q.type,re,W)},ft.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},ft.createElement=function(q,X,z){var W,re={},ae=null;if(X!=null)for(W in X.key!==void 0&&(ae=""+X.key),X)L.call(X,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(re[W]=X[W]);var ie=arguments.length-2;if(ie===1)re.children=z;else if(1<ie){for(var ye=Array(ie),ue=0;ue<ie;ue++)ye[ue]=arguments[ue+2];re.children=ye}if(q&&q.defaultProps)for(W in ie=q.defaultProps,ie)re[W]===void 0&&(re[W]=ie[W]);return B(q,ae,re)},ft.createRef=function(){return{current:null}},ft.forwardRef=function(q){return{$$typeof:o,render:q}},ft.isValidElement=_,ft.lazy=function(q){return{$$typeof:d,_payload:{_status:-1,_result:q},_init:Y}},ft.memo=function(q,X){return{$$typeof:c,type:q,compare:X===void 0?null:X}},ft.startTransition=function(q){var X=D.T,z={};D.T=z;try{var W=q(),re=D.S;re!==null&&re(z,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(A,Q)}catch(ae){Q(ae)}finally{X!==null&&z.types!==null&&(X.types=z.types),D.T=X}},ft.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ft.use=function(q){return D.H.use(q)},ft.useActionState=function(q,X,z){return D.H.useActionState(q,X,z)},ft.useCallback=function(q,X){return D.H.useCallback(q,X)},ft.useContext=function(q){return D.H.useContext(q)},ft.useDebugValue=function(){},ft.useDeferredValue=function(q,X){return D.H.useDeferredValue(q,X)},ft.useEffect=function(q,X){return D.H.useEffect(q,X)},ft.useEffectEvent=function(q){return D.H.useEffectEvent(q)},ft.useId=function(){return D.H.useId()},ft.useImperativeHandle=function(q,X,z){return D.H.useImperativeHandle(q,X,z)},ft.useInsertionEffect=function(q,X){return D.H.useInsertionEffect(q,X)},ft.useLayoutEffect=function(q,X){return D.H.useLayoutEffect(q,X)},ft.useMemo=function(q,X){return D.H.useMemo(q,X)},ft.useOptimistic=function(q,X){return D.H.useOptimistic(q,X)},ft.useReducer=function(q,X,z){return D.H.useReducer(q,X,z)},ft.useRef=function(q){return D.H.useRef(q)},ft.useState=function(q){return D.H.useState(q)},ft.useSyncExternalStore=function(q,X,z){return D.H.useSyncExternalStore(q,X,z)},ft.useTransition=function(){return D.H.useTransition()},ft.version="19.2.4",ft}var PC;function f1(){return PC||(PC=1,jy.exports=m4()),jy.exports}var j=f1();const $i=pd(j),YA=h4({__proto__:null,default:$i},[j]);var Ay={exports:{}},mf={},Ry={exports:{}},Dy={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var zC;function g4(){return zC||(zC=1,(function(e){function t(I,U){var Y=I.length;I.push(U);e:for(;0<Y;){var Q=Y-1>>>1,F=I[Q];if(0<a(F,U))I[Q]=U,I[Y]=F,Y=Q;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var U=I[0],Y=I.pop();if(Y!==U){I[0]=Y;e:for(var Q=0,F=I.length,q=F>>>1;Q<q;){var X=2*(Q+1)-1,z=I[X],W=X+1,re=I[W];if(0>a(z,Y))W<F&&0>a(re,z)?(I[Q]=re,I[W]=Y,Q=W):(I[Q]=z,I[X]=Y,Q=X);else if(W<F&&0>a(re,Y))I[Q]=re,I[W]=Y,Q=W;else break e}}return U}function a(I,U){var Y=I.sortIndex-U.sortIndex;return Y!==0?Y:I.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var f=[],c=[],d=1,p=null,m=3,y=!1,x=!1,b=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function T(I){for(var U=n(c);U!==null;){if(U.callback===null)r(c);else if(U.startTime<=I)r(c),U.sortIndex=U.expirationTime,t(f,U);else break;U=n(c)}}function R(I){if(b=!1,T(I),!x)if(n(f)!==null)x=!0,A||(A=!0,P());else{var U=n(c);U!==null&&V(R,U.startTime-I)}}var A=!1,D=-1,L=5,B=-1;function M(){return S?!0:!(e.unstable_now()-B<L)}function _(){if(S=!1,A){var I=e.unstable_now();B=I;var U=!0;try{e:{x=!1,b&&(b=!1,N(D),D=-1),y=!0;var Y=m;try{t:{for(T(I),p=n(f);p!==null&&!(p.expirationTime>I&&M());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var F=Q(p.expirationTime<=I);if(I=e.unstable_now(),typeof F=="function"){p.callback=F,T(I),U=!0;break t}p===n(f)&&r(f),T(I)}else r(f);p=n(f)}if(p!==null)U=!0;else{var q=n(c);q!==null&&V(R,q.startTime-I),U=!1}}break e}finally{p=null,m=Y,y=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof C=="function")P=function(){C(_)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,$=H.port2;H.port1.onmessage=_,P=function(){$.postMessage(null)}}else P=function(){w(_,0)};function V(I,U){D=w(function(){I(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var U=3;break;default:U=m}var Y=m;m=U;try{return I()}finally{m=Y}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(I,U){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Y=m;m=I;try{return U()}finally{m=Y}},e.unstable_scheduleCallback=function(I,U,Y){var Q=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,I){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Y+F,I={id:d++,callback:U,priorityLevel:I,startTime:Y,expirationTime:F,sortIndex:-1},Y>Q?(I.sortIndex=Y,t(c,I),n(f)===null&&I===n(c)&&(b?(N(D),D=-1):b=!0,V(R,Y-Q))):(I.sortIndex=F,t(f,I),x||y||(x=!0,A||(A=!0,P()))),I},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(I){var U=m;return function(){var Y=m;m=U;try{return I.apply(this,arguments)}finally{m=Y}}}})(Dy)),Dy}var IC;function y4(){return IC||(IC=1,Ry.exports=g4()),Ry.exports}var My={exports:{}},vr={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var FC;function x4(){if(FC)return vr;FC=1;var e=f1();function t(f){var c="https://react.dev/errors/"+f;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+f+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(f,c,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:f,containerInfo:c,implementation:d}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(f,c){if(f==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vr.createPortal=function(f,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return i(f,c,null,d)},vr.flushSync=function(f){var c=l.T,d=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=c,r.p=d,r.d.f()}},vr.preconnect=function(f,c){typeof f=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(f,c))},vr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},vr.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin),m=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?r.d.S(f,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:y}):d==="script"&&r.d.X(f,{crossOrigin:p,integrity:m,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},vr.preinitModule=function(f,c){if(typeof f=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=o(c.as,c.crossOrigin);r.d.M(f,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(f)},vr.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin);r.d.L(f,d,{crossOrigin:p,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},vr.preloadModule=function(f,c){if(typeof f=="string")if(c){var d=o(c.as,c.crossOrigin);r.d.m(f,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(f)},vr.requestFormReset=function(f){r.d.r(f)},vr.unstable_batchedUpdates=function(f,c){return f(c)},vr.useFormState=function(f,c,d){return l.H.useFormState(f,c,d)},vr.useFormStatus=function(){return l.H.useHostTransitionStatus()},vr.version="19.2.4",vr}var qC;function XA(){if(qC)return My.exports;qC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),My.exports=x4(),My.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var UC;function b4(){if(UC)return mf;UC=1;var e=y4(),t=f1(),n=XA();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)u+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var u=s,v=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(v=u.return),s=u.return;while(s)}return u.tag===3?v:null}function l(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function o(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function f(s){if(i(s)!==s)throw Error(r(188))}function c(s){var u=s.alternate;if(!u){if(u=i(s),u===null)throw Error(r(188));return u!==s?null:s}for(var v=s,g=u;;){var E=v.return;if(E===null)break;var k=E.alternate;if(k===null){if(g=E.return,g!==null){v=g;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===v)return f(E),s;if(k===g)return f(E),u;k=k.sibling}throw Error(r(188))}if(v.return!==g.return)v=E,g=k;else{for(var O=!1,G=E.child;G;){if(G===v){O=!0,v=E,g=k;break}if(G===g){O=!0,g=E,v=k;break}G=G.sibling}if(!O){for(G=k.child;G;){if(G===v){O=!0,v=k,g=E;break}if(G===g){O=!0,g=k,v=E;break}G=G.sibling}if(!O)throw Error(r(189))}}if(v.alternate!==g)throw Error(r(190))}if(v.tag!==3)throw Error(r(188));return v.stateNode.current===v?s:u}function d(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=d(s),u!==null)return u;s=s.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),C=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),_=Symbol.iterator;function P(s){return s===null||typeof s!="object"?null:(s=_&&s[_]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function $(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case C:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case T:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return u=s.displayName||null,u!==null?u:$(s.type)||"Memo";case L:u=s._payload,s=s._init;try{return $(s(u))}catch{}}return null}var V=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],F=-1;function q(s){return{current:s}}function X(s){0>F||(s.current=Q[F],Q[F]=null,F--)}function z(s,u){F++,Q[F]=s.current,s.current=u}var W=q(null),re=q(null),ae=q(null),ie=q(null);function ye(s,u){switch(z(ae,u),z(re,s),z(W,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?nC(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=nC(u),s=rC(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(W),z(W,s)}function ue(){X(W),X(re),X(ae)}function ee(s){s.memoizedState!==null&&z(ie,s);var u=W.current,v=rC(u,s.type);u!==v&&(z(re,s),z(W,v))}function ne(s){re.current===s&&(X(W),X(re)),ie.current===s&&(X(ie),ff._currentValue=Y)}var se,ge;function ke(s){if(se===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);se=u&&u[1]||"",ge=-1<v.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+se+s+ge}var Pe=!1;function lt(s,u){if(!s||Pe)return"";Pe=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var ve=me}Reflect.construct(s,[],Ee)}else{try{Ee.call()}catch(me){ve=me}s.call(Ee.prototype)}}else{try{throw Error()}catch(me){ve=me}(Ee=s())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&ve&&typeof me.stack=="string")return[me.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),O=k[0],G=k[1];if(O&&G){var Z=O.split(`
44
+ `),fe=G.split(`
45
+ `);for(E=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;E<fe.length&&!fe[E].includes("DetermineComponentFrameRoot");)E++;if(g===Z.length||E===fe.length)for(g=Z.length-1,E=fe.length-1;1<=g&&0<=E&&Z[g]!==fe[E];)E--;for(;1<=g&&0<=E;g--,E--)if(Z[g]!==fe[E]){if(g!==1||E!==1)do if(g--,E--,0>E||Z[g]!==fe[E]){var we=`
46
+ `+Z[g].replace(" at new "," at ");return s.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",s.displayName)),we}while(1<=g&&0<=E);break}}}finally{Pe=!1,Error.prepareStackTrace=v}return(v=s?s.displayName||s.name:"")?ke(v):""}function Je(s,u){switch(s.tag){case 26:case 27:case 5:return ke(s.type);case 16:return ke("Lazy");case 13:return s.child!==u&&u!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return lt(s.type,!1);case 11:return lt(s.type.render,!1);case 1:return lt(s.type,!0);case 31:return ke("Activity");default:return""}}function We(s){try{var u="",v=null;do u+=Je(s,v),v=s,s=s.return;while(s);return u}catch(g){return`
47
+ Error generating stack: `+g.message+`
48
+ `+g.stack}}var Ve=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,Ke=e.unstable_cancelCallback,Xe=e.unstable_shouldYield,st=e.unstable_requestPaint,ze=e.unstable_now,dt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,Me=e.unstable_IdlePriority,Oe=e.log,xe=e.unstable_setDisableYieldValue,K=null,oe=null;function pe(s){if(typeof Oe=="function"&&xe(s),oe&&typeof oe.setStrictMode=="function")try{oe.setStrictMode(K,s)}catch{}}var de=Math.clz32?Math.clz32:Ne,be=Math.log,Le=Math.LN2;function Ne(s){return s>>>=0,s===0?32:31-(be(s)/Le|0)|0}var Ge=256,qe=262144,Ze=4194304;function ut(s){var u=s&42;if(u!==0)return u;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ct(s,u,v){var g=s.pendingLanes;if(g===0)return 0;var E=0,k=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var G=g&134217727;return G!==0?(g=G&~k,g!==0?E=ut(g):(O&=G,O!==0?E=ut(O):v||(v=G&~s,v!==0&&(E=ut(v))))):(G=g&~k,G!==0?E=ut(G):O!==0?E=ut(O):v||(v=g&~s,v!==0&&(E=ut(v)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,v=u&-u,k>=v||k===32&&(v&4194048)!==0)?u:E}function He(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function xt(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vt(){var s=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),s}function dn(s){for(var u=[],v=0;31>v;v++)u.push(s);return u}function Ut(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function nr(s,u,v,g,E,k){var O=s.pendingLanes;s.pendingLanes=v,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=v,s.entangledLanes&=v,s.errorRecoveryDisabledLanes&=v,s.shellSuspendCounter=0;var G=s.entanglements,Z=s.expirationTimes,fe=s.hiddenUpdates;for(v=O&~v;0<v;){var we=31-de(v),Ee=1<<we;G[we]=0,Z[we]=-1;var ve=fe[we];if(ve!==null)for(fe[we]=null,we=0;we<ve.length;we++){var me=ve[we];me!==null&&(me.lane&=-536870913)}v&=~Ee}g!==0&&hn(s,g,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(O&~u))}function hn(s,u,v){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-de(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|v&261930}function Sn(s,u){var v=s.entangledLanes|=u;for(s=s.entanglements;v;){var g=31-de(v),E=1<<g;E&u|s[g]&u&&(s[g]|=u),v&=~E}}function gn(s,u){var v=u&-u;return v=(v&42)!==0?1:En(v),(v&(s.suspendedLanes|u))!==0?0:v}function En(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function fa(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function vn(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:kC(s.type))}function da(s,u){var v=U.p;try{return U.p=s,u()}finally{U.p=v}}var $n=Math.random().toString(36).slice(2),on="__reactFiber$"+$n,Bn="__reactProps$"+$n,Mr="__reactContainer$"+$n,Gn="__reactEvents$"+$n,Kn="__reactListeners$"+$n,dr="__reactHandles$"+$n,ds="__reactResources$"+$n,Yn="__reactMarker$"+$n;function Ro(s){delete s[on],delete s[Bn],delete s[Gn],delete s[Kn],delete s[dr]}function hs(s){var u=s[on];if(u)return u;for(var v=s.parentNode;v;){if(u=v[Mr]||v[on]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(s=cC(s);s!==null;){if(v=s[on])return v;s=cC(s)}return u}s=v,v=s.parentNode}return null}function vs(s){if(s=s[on]||s[Mr]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Al(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function ps(s){var u=s[ds];return u||(u=s[ds]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function jn(s){s[Yn]=!0}var $d=new Set,Gd={};function Yr(s,u){Xa(s,u),Xa(s+"Capture",u)}function Xa(s,u){for(Gd[s]=u,s=0;s<u.length;s++)$d.add(u[s])}var Do=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Nc={},kc={};function ym(s){return Ve.call(kc,s)?!0:Ve.call(Nc,s)?!1:Do.test(s)?kc[s]=!0:(Nc[s]=!0,!1)}function hr(s,u,v){if(ym(u))if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+v)}}function ms(s,u,v){if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+v)}}function ha(s,u,v,g){if(g===null)s.removeAttribute(v);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(v);return}s.setAttributeNS(u,v,""+g)}}function Xn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Or(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function xm(s,u,v){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,k=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(O){v=""+O,k.call(this,O)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return v},setValue:function(O){v=""+O},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Kd(s){if(!s._valueTracker){var u=Or(s)?"checked":"value";s._valueTracker=xm(s,u,""+s[u])}}function Yd(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var v=u.getValue(),g="";return s&&(g=Or(s)?s.checked?"true":"false":s.value),s=g,s!==v?(u.setValue(s),!0):!1}function Xd(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var l5=/[\n"\\]/g;function va(s){return s.replace(l5,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function bm(s,u,v,g,E,k,O,G){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),u!=null?O==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Xn(u)):s.value!==""+Xn(u)&&(s.value=""+Xn(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?wm(s,O,Xn(u)):v!=null?wm(s,O,Xn(v)):g!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?s.name=""+Xn(G):s.removeAttribute("name")}function Qw(s,u,v,g,E,k,O,G){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||v!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Kd(s);return}v=v!=null?""+Xn(v):"",u=u!=null?""+Xn(u):v,G||u===s.value||(s.value=u),s.defaultValue=u}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=G?s.checked:!!g,s.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),Kd(s)}function wm(s,u,v){u==="number"&&Xd(s.ownerDocument)===s||s.defaultValue===""+v||(s.defaultValue=""+v)}function Mo(s,u,v,g){if(s=s.options,u){u={};for(var E=0;E<v.length;E++)u["$"+v[E]]=!0;for(v=0;v<s.length;v++)E=u.hasOwnProperty("$"+s[v].value),s[v].selected!==E&&(s[v].selected=E),E&&g&&(s[v].defaultSelected=!0)}else{for(v=""+Xn(v),u=null,E=0;E<s.length;E++){if(s[E].value===v){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function Ww(s,u,v){if(u!=null&&(u=""+Xn(u),u!==s.value&&(s.value=u),v==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=v!=null?""+Xn(v):""}function Zw(s,u,v,g){if(u==null){if(g!=null){if(v!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}v=g}v==null&&(v=""),u=v}v=Xn(u),s.defaultValue=v,g=s.textContent,g===v&&g!==""&&g!==null&&(s.value=g),Kd(s)}function Oo(s,u){if(u){var v=s.firstChild;if(v&&v===s.lastChild&&v.nodeType===3){v.nodeValue=u;return}}s.textContent=u}var o5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jw(s,u,v){var g=u.indexOf("--")===0;v==null||typeof v=="boolean"||v===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,v):typeof v!="number"||v===0||o5.has(u)?u==="float"?s.cssFloat=v:s[u]=(""+v).trim():s[u]=v+"px"}function eS(s,u,v){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,v!=null){for(var g in v)!v.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in u)g=u[E],u.hasOwnProperty(E)&&v[E]!==g&&Jw(s,E,g)}else for(var k in u)u.hasOwnProperty(k)&&Jw(s,k,u[k])}function Sm(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var u5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),c5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qd(s){return c5.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ci(){}var Em=null;function Cm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Lo=null,_o=null;function tS(s){var u=vs(s);if(u&&(s=u.stateNode)){var v=s[Bn]||null;e:switch(s=u.stateNode,u.type){case"input":if(bm(s,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name),u=v.name,v.type==="radio"&&u!=null){for(v=s;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll('input[name="'+va(""+u)+'"][type="radio"]'),u=0;u<v.length;u++){var g=v[u];if(g!==s&&g.form===s.form){var E=g[Bn]||null;if(!E)throw Error(r(90));bm(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<v.length;u++)g=v[u],g.form===s.form&&Yd(g)}break e;case"textarea":Ww(s,v.value,v.defaultValue);break e;case"select":u=v.value,u!=null&&Mo(s,!!v.multiple,u,!1)}}}var Nm=!1;function nS(s,u,v){if(Nm)return s(u,v);Nm=!0;try{var g=s(u);return g}finally{if(Nm=!1,(Lo!==null||_o!==null)&&(Ph(),Lo&&(u=Lo,s=_o,_o=Lo=null,tS(u),s)))for(u=0;u<s.length;u++)tS(s[u])}}function Tc(s,u){var v=s.stateNode;if(v===null)return null;var g=v[Bn]||null;if(g===null)return null;v=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(v&&typeof v!="function")throw Error(r(231,u,typeof v));return v}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),km=!1;if(Ni)try{var jc={};Object.defineProperty(jc,"passive",{get:function(){km=!0}}),window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{km=!1}var gs=null,Tm=null,Wd=null;function rS(){if(Wd)return Wd;var s,u=Tm,v=u.length,g,E="value"in gs?gs.value:gs.textContent,k=E.length;for(s=0;s<v&&u[s]===E[s];s++);var O=v-s;for(g=1;g<=O&&u[v-g]===E[k-g];g++);return Wd=E.slice(s,1<g?1-g:void 0)}function Zd(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function Jd(){return!0}function aS(){return!1}function Lr(s){function u(v,g,E,k,O){this._reactName=v,this._targetInst=E,this.type=g,this.nativeEvent=k,this.target=O,this.currentTarget=null;for(var G in s)s.hasOwnProperty(G)&&(v=s[G],this[G]=v?v(k):k[G]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Jd:aS,this.isPropagationStopped=aS,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=Jd)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=Jd)},persist:function(){},isPersistent:Jd}),u}var Rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eh=Lr(Rl),Ac=p({},Rl,{view:0,detail:0}),f5=Lr(Ac),jm,Am,Rc,th=p({},Ac,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Rc&&(Rc&&s.type==="mousemove"?(jm=s.screenX-Rc.screenX,Am=s.screenY-Rc.screenY):Am=jm=0,Rc=s),jm)},movementY:function(s){return"movementY"in s?s.movementY:Am}}),iS=Lr(th),d5=p({},th,{dataTransfer:0}),h5=Lr(d5),v5=p({},Ac,{relatedTarget:0}),Rm=Lr(v5),p5=p({},Rl,{animationName:0,elapsedTime:0,pseudoElement:0}),m5=Lr(p5),g5=p({},Rl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),y5=Lr(g5),x5=p({},Rl,{data:0}),sS=Lr(x5),b5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},S5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E5(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=S5[s])?!!u[s]:!1}function Dm(){return E5}var C5=p({},Ac,{key:function(s){if(s.key){var u=b5[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Zd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?w5[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(s){return s.type==="keypress"?Zd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Zd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),N5=Lr(C5),k5=p({},th,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lS=Lr(k5),T5=p({},Ac,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),j5=Lr(T5),A5=p({},Rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),R5=Lr(A5),D5=p({},th,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),M5=Lr(D5),O5=p({},Rl,{newState:0,oldState:0}),L5=Lr(O5),_5=[9,13,27,32],Mm=Ni&&"CompositionEvent"in window,Dc=null;Ni&&"documentMode"in document&&(Dc=document.documentMode);var B5=Ni&&"TextEvent"in window&&!Dc,oS=Ni&&(!Mm||Dc&&8<Dc&&11>=Dc),uS=" ",cS=!1;function fS(s,u){switch(s){case"keyup":return _5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bo=!1;function P5(s,u){switch(s){case"compositionend":return dS(u);case"keypress":return u.which!==32?null:(cS=!0,uS);case"textInput":return s=u.data,s===uS&&cS?null:s;default:return null}}function z5(s,u){if(Bo)return s==="compositionend"||!Mm&&fS(s,u)?(s=rS(),Wd=Tm=gs=null,Bo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return oS&&u.locale!=="ko"?null:u.data;default:return null}}var I5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function hS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!I5[s.type]:u==="textarea"}function vS(s,u,v,g){Lo?_o?_o.push(g):_o=[g]:Lo=g,u=Hh(u,"onChange"),0<u.length&&(v=new eh("onChange","change",null,v,g),s.push({event:v,listeners:u}))}var Mc=null,Oc=null;function F5(s){QE(s,0)}function nh(s){var u=Al(s);if(Yd(u))return s}function pS(s,u){if(s==="change")return u}var mS=!1;if(Ni){var Om;if(Ni){var Lm="oninput"in document;if(!Lm){var gS=document.createElement("div");gS.setAttribute("oninput","return;"),Lm=typeof gS.oninput=="function"}Om=Lm}else Om=!1;mS=Om&&(!document.documentMode||9<document.documentMode)}function yS(){Mc&&(Mc.detachEvent("onpropertychange",xS),Oc=Mc=null)}function xS(s){if(s.propertyName==="value"&&nh(Oc)){var u=[];vS(u,Oc,s,Cm(s)),nS(F5,u)}}function q5(s,u,v){s==="focusin"?(yS(),Mc=u,Oc=v,Mc.attachEvent("onpropertychange",xS)):s==="focusout"&&yS()}function U5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return nh(Oc)}function V5(s,u){if(s==="click")return nh(u)}function H5(s,u){if(s==="input"||s==="change")return nh(u)}function $5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Xr=typeof Object.is=="function"?Object.is:$5;function Lc(s,u){if(Xr(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var v=Object.keys(s),g=Object.keys(u);if(v.length!==g.length)return!1;for(g=0;g<v.length;g++){var E=v[g];if(!Ve.call(u,E)||!Xr(s[E],u[E]))return!1}return!0}function bS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function wS(s,u){var v=bS(s);s=0;for(var g;v;){if(v.nodeType===3){if(g=s+v.textContent.length,s<=u&&g>=u)return{node:v,offset:u-s};s=g}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=bS(v)}}function SS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?SS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function ES(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=Xd(s.document);u instanceof s.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)s=u.contentWindow;else break;u=Xd(s.document)}return u}function _m(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var G5=Ni&&"documentMode"in document&&11>=document.documentMode,Po=null,Bm=null,_c=null,Pm=!1;function CS(s,u,v){var g=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Pm||Po==null||Po!==Xd(g)||(g=Po,"selectionStart"in g&&_m(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),_c&&Lc(_c,g)||(_c=g,g=Hh(Bm,"onSelect"),0<g.length&&(u=new eh("onSelect","select",null,u,v),s.push({event:u,listeners:g}),u.target=Po)))}function Dl(s,u){var v={};return v[s.toLowerCase()]=u.toLowerCase(),v["Webkit"+s]="webkit"+u,v["Moz"+s]="moz"+u,v}var zo={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionrun:Dl("Transition","TransitionRun"),transitionstart:Dl("Transition","TransitionStart"),transitioncancel:Dl("Transition","TransitionCancel"),transitionend:Dl("Transition","TransitionEnd")},zm={},NS={};Ni&&(NS=document.createElement("div").style,"AnimationEvent"in window||(delete zo.animationend.animation,delete zo.animationiteration.animation,delete zo.animationstart.animation),"TransitionEvent"in window||delete zo.transitionend.transition);function Ml(s){if(zm[s])return zm[s];if(!zo[s])return s;var u=zo[s],v;for(v in u)if(u.hasOwnProperty(v)&&v in NS)return zm[s]=u[v];return s}var kS=Ml("animationend"),TS=Ml("animationiteration"),jS=Ml("animationstart"),K5=Ml("transitionrun"),Y5=Ml("transitionstart"),X5=Ml("transitioncancel"),AS=Ml("transitionend"),RS=new Map,Im="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Im.push("scrollEnd");function La(s,u){RS.set(s,u),Yr(u,[s])}var rh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},pa=[],Io=0,Fm=0;function ah(){for(var s=Io,u=Fm=Io=0;u<s;){var v=pa[u];pa[u++]=null;var g=pa[u];pa[u++]=null;var E=pa[u];pa[u++]=null;var k=pa[u];if(pa[u++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}k!==0&&DS(v,E,k)}}function ih(s,u,v,g){pa[Io++]=s,pa[Io++]=u,pa[Io++]=v,pa[Io++]=g,Fm|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function qm(s,u,v,g){return ih(s,u,v,g),sh(s)}function Ol(s,u){return ih(s,null,null,u),sh(s)}function DS(s,u,v){s.lanes|=v;var g=s.alternate;g!==null&&(g.lanes|=v);for(var E=!1,k=s.return;k!==null;)k.childLanes|=v,g=k.alternate,g!==null&&(g.childLanes|=v),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-de(v),s=k.hiddenUpdates,g=s[E],g===null?s[E]=[u]:g.push(u),u.lane=v|536870912),k):null}function sh(s){if(50<rf)throw rf=0,Qg=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Fo={};function Q5(s,u,v,g){this.tag=s,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(s,u,v,g){return new Q5(s,u,v,g)}function Um(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ki(s,u){var v=s.alternate;return v===null?(v=Qr(s.tag,u,s.key,s.mode),v.elementType=s.elementType,v.type=s.type,v.stateNode=s.stateNode,v.alternate=s,s.alternate=v):(v.pendingProps=u,v.type=s.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=s.flags&65011712,v.childLanes=s.childLanes,v.lanes=s.lanes,v.child=s.child,v.memoizedProps=s.memoizedProps,v.memoizedState=s.memoizedState,v.updateQueue=s.updateQueue,u=s.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=s.sibling,v.index=s.index,v.ref=s.ref,v.refCleanup=s.refCleanup,v}function MS(s,u){s.flags&=65011714;var v=s.alternate;return v===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=v.childLanes,s.lanes=v.lanes,s.child=v.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=v.memoizedProps,s.memoizedState=v.memoizedState,s.updateQueue=v.updateQueue,s.type=v.type,u=v.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function lh(s,u,v,g,E,k){var O=0;if(g=s,typeof s=="function")Um(s)&&(O=1);else if(typeof s=="string")O=t4(s,v,W.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=Qr(31,v,u,E),s.elementType=B,s.lanes=k,s;case b:return Ll(v.children,E,k,u);case S:O=8,E|=24;break;case w:return s=Qr(12,v,u,E|2),s.elementType=w,s.lanes=k,s;case R:return s=Qr(13,v,u,E),s.elementType=R,s.lanes=k,s;case A:return s=Qr(19,v,u,E),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:O=10;break e;case N:O=9;break e;case T:O=11;break e;case D:O=14;break e;case L:O=16,g=null;break e}O=29,v=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=Qr(O,v,u,E),u.elementType=s,u.type=g,u.lanes=k,u}function Ll(s,u,v,g){return s=Qr(7,s,g,u),s.lanes=v,s}function Vm(s,u,v){return s=Qr(6,s,null,u),s.lanes=v,s}function OS(s){var u=Qr(18,null,null,0);return u.stateNode=s,u}function Hm(s,u,v){return u=Qr(4,s.children!==null?s.children:[],s.key,u),u.lanes=v,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var LS=new WeakMap;function ma(s,u){if(typeof s=="object"&&s!==null){var v=LS.get(s);return v!==void 0?v:(u={value:s,source:u,stack:We(u)},LS.set(s,u),u)}return{value:s,source:u,stack:We(u)}}var qo=[],Uo=0,oh=null,Bc=0,ga=[],ya=0,ys=null,Qa=1,Wa="";function Ti(s,u){qo[Uo++]=Bc,qo[Uo++]=oh,oh=s,Bc=u}function _S(s,u,v){ga[ya++]=Qa,ga[ya++]=Wa,ga[ya++]=ys,ys=s;var g=Qa;s=Wa;var E=32-de(g)-1;g&=~(1<<E),v+=1;var k=32-de(u)+E;if(30<k){var O=E-E%5;k=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Qa=1<<32-de(u)+E|v<<E|g,Wa=k+s}else Qa=1<<k|v<<E|g,Wa=s}function $m(s){s.return!==null&&(Ti(s,1),_S(s,1,0))}function Gm(s){for(;s===oh;)oh=qo[--Uo],qo[Uo]=null,Bc=qo[--Uo],qo[Uo]=null;for(;s===ys;)ys=ga[--ya],ga[ya]=null,Wa=ga[--ya],ga[ya]=null,Qa=ga[--ya],ga[ya]=null}function BS(s,u){ga[ya++]=Qa,ga[ya++]=Wa,ga[ya++]=ys,Qa=u.id,Wa=u.overflow,ys=s}var rr=null,nn=null,Tt=!1,xs=null,xa=!1,Km=Error(r(519));function bs(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pc(ma(u,s)),Km}function PS(s){var u=s.stateNode,v=s.type,g=s.memoizedProps;switch(u[on]=s,u[Bn]=g,v){case"dialog":St("cancel",u),St("close",u);break;case"iframe":case"object":case"embed":St("load",u);break;case"video":case"audio":for(v=0;v<sf.length;v++)St(sf[v],u);break;case"source":St("error",u);break;case"img":case"image":case"link":St("error",u),St("load",u);break;case"details":St("toggle",u);break;case"input":St("invalid",u),Qw(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":St("invalid",u);break;case"textarea":St("invalid",u),Zw(u,g.value,g.defaultValue,g.children)}v=g.children,typeof v!="string"&&typeof v!="number"&&typeof v!="bigint"||u.textContent===""+v||g.suppressHydrationWarning===!0||eC(u.textContent,v)?(g.popover!=null&&(St("beforetoggle",u),St("toggle",u)),g.onScroll!=null&&St("scroll",u),g.onScrollEnd!=null&&St("scrollend",u),g.onClick!=null&&(u.onclick=Ci),u=!0):u=!1,u||bs(s,!0)}function zS(s){for(rr=s.return;rr;)switch(rr.tag){case 5:case 31:case 13:xa=!1;return;case 27:case 3:xa=!0;return;default:rr=rr.return}}function Vo(s){if(s!==rr)return!1;if(!Tt)return zS(s),Tt=!0,!1;var u=s.tag,v;if((v=u!==3&&u!==27)&&((v=u===5)&&(v=s.type,v=!(v!=="form"&&v!=="button")||fy(s.type,s.memoizedProps)),v=!v),v&&nn&&bs(s),zS(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=uC(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=uC(s)}else u===27?(u=nn,Ls(s.type)?(s=my,my=null,nn=s):nn=u):nn=rr?wa(s.stateNode.nextSibling):null;return!0}function _l(){nn=rr=null,Tt=!1}function Ym(){var s=xs;return s!==null&&(zr===null?zr=s:zr.push.apply(zr,s),xs=null),s}function Pc(s){xs===null?xs=[s]:xs.push(s)}var Xm=q(null),Bl=null,ji=null;function ws(s,u,v){z(Xm,u._currentValue),u._currentValue=v}function Ai(s){s._currentValue=Xm.current,X(Xm)}function Qm(s,u,v){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===v)break;s=s.return}}function Wm(s,u,v,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var O=E.child;k=k.firstContext;e:for(;k!==null;){var G=k;k=E;for(var Z=0;Z<u.length;Z++)if(G.context===u[Z]){k.lanes|=v,G=k.alternate,G!==null&&(G.lanes|=v),Qm(k.return,v,s),g||(O=null);break e}k=G.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=v,k=O.alternate,k!==null&&(k.lanes|=v),Qm(O,v,s),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===s){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function Ho(s,u,v,g){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var G=E.type;Xr(E.pendingProps.value,O.value)||(s!==null?s.push(G):s=[G])}}else if(E===ie.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(ff):s=[ff])}E=E.return}s!==null&&Wm(u,s,v,g),u.flags|=262144}function uh(s){for(s=s.firstContext;s!==null;){if(!Xr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Pl(s){Bl=s,ji=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function ar(s){return IS(Bl,s)}function ch(s,u){return Bl===null&&Pl(s),IS(s,u)}function IS(s,u){var v=u._currentValue;if(u={context:u,memoizedValue:v,next:null},ji===null){if(s===null)throw Error(r(308));ji=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else ji=ji.next=u;return v}var W5=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(v,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(v){return v()})}},Z5=e.unstable_scheduleCallback,J5=e.unstable_NormalPriority,An={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zm(){return{controller:new W5,data:new Map,refCount:0}}function zc(s){s.refCount--,s.refCount===0&&Z5(J5,function(){s.controller.abort()})}var Ic=null,Jm=0,$o=0,Go=null;function e3(s,u){if(Ic===null){var v=Ic=[];Jm=0,$o=ny(),Go={status:"pending",value:void 0,then:function(g){v.push(g)}}}return Jm++,u.then(FS,FS),u}function FS(){if(--Jm===0&&Ic!==null){Go!==null&&(Go.status="fulfilled");var s=Ic;Ic=null,$o=0,Go=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function t3(s,u){var v=[],g={status:"pending",value:null,reason:null,then:function(E){v.push(E)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var E=0;E<v.length;E++)(0,v[E])(u)},function(E){for(g.status="rejected",g.reason=E,E=0;E<v.length;E++)(0,v[E])(void 0)}),g}var qS=I.S;I.S=function(s,u){CE=ze(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&e3(s,u),qS!==null&&qS(s,u)};var zl=q(null);function eg(){var s=zl.current;return s!==null?s:Kt.pooledCache}function fh(s,u){u===null?z(zl,zl.current):z(zl,u.pool)}function US(){var s=eg();return s===null?null:{parent:An._currentValue,pool:s}}var Ko=Error(r(460)),tg=Error(r(474)),dh=Error(r(542)),hh={then:function(){}};function VS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function HS(s,u,v){switch(v=s[v],v===void 0?s.push(u):v!==u&&(u.then(Ci,Ci),u=v),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,GS(s),s;default:if(typeof u.status=="string")u.then(Ci,Ci);else{if(s=Kt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=g}},function(g){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,GS(s),s}throw Fl=u,Ko}}function Il(s){try{var u=s._init;return u(s._payload)}catch(v){throw v!==null&&typeof v=="object"&&typeof v.then=="function"?(Fl=v,Ko):v}}var Fl=null;function $S(){if(Fl===null)throw Error(r(459));var s=Fl;return Fl=null,s}function GS(s){if(s===Ko||s===dh)throw Error(r(483))}var Yo=null,Fc=0;function vh(s){var u=Fc;return Fc+=1,Yo===null&&(Yo=[]),HS(Yo,s,u)}function qc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function ph(s,u){throw u.$$typeof===m?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function KS(s){function u(le,te){if(s){var ce=le.deletions;ce===null?(le.deletions=[te],le.flags|=16):ce.push(te)}}function v(le,te){if(!s)return null;for(;te!==null;)u(le,te),te=te.sibling;return null}function g(le){for(var te=new Map;le!==null;)le.key!==null?te.set(le.key,le):te.set(le.index,le),le=le.sibling;return te}function E(le,te){return le=ki(le,te),le.index=0,le.sibling=null,le}function k(le,te,ce){return le.index=ce,s?(ce=le.alternate,ce!==null?(ce=ce.index,ce<te?(le.flags|=67108866,te):ce):(le.flags|=67108866,te)):(le.flags|=1048576,te)}function O(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function G(le,te,ce,Se){return te===null||te.tag!==6?(te=Vm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Z(le,te,ce,Se){var nt=ce.type;return nt===b?we(le,te,ce.props.children,Se,ce.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===L&&Il(nt)===te.type)?(te=E(te,ce.props),qc(te,ce),te.return=le,te):(te=lh(ce.type,ce.key,ce.props,null,le.mode,Se),qc(te,ce),te.return=le,te)}function fe(le,te,ce,Se){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=Hm(ce,le.mode,Se),te.return=le,te):(te=E(te,ce.children||[]),te.return=le,te)}function we(le,te,ce,Se,nt){return te===null||te.tag!==7?(te=Ll(ce,le.mode,Se,nt),te.return=le,te):(te=E(te,ce),te.return=le,te)}function Ee(le,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Vm(""+te,le.mode,ce),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ce=lh(te.type,te.key,te.props,null,le.mode,ce),qc(ce,te),ce.return=le,ce;case x:return te=Hm(te,le.mode,ce),te.return=le,te;case L:return te=Il(te),Ee(le,te,ce)}if(V(te)||P(te))return te=Ll(te,le.mode,ce,null),te.return=le,te;if(typeof te.then=="function")return Ee(le,vh(te),ce);if(te.$$typeof===C)return Ee(le,ch(le,te),ce);ph(le,te)}return null}function ve(le,te,ce,Se){var nt=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return nt!==null?null:G(le,te,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===nt?Z(le,te,ce,Se):null;case x:return ce.key===nt?fe(le,te,ce,Se):null;case L:return ce=Il(ce),ve(le,te,ce,Se)}if(V(ce)||P(ce))return nt!==null?null:we(le,te,ce,Se,null);if(typeof ce.then=="function")return ve(le,te,vh(ce),Se);if(ce.$$typeof===C)return ve(le,te,ch(le,ce),Se);ph(le,ce)}return null}function me(le,te,ce,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,G(te,le,""+Se,nt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return le=le.get(Se.key===null?ce:Se.key)||null,Z(te,le,Se,nt);case x:return le=le.get(Se.key===null?ce:Se.key)||null,fe(te,le,Se,nt);case L:return Se=Il(Se),me(le,te,ce,Se,nt)}if(V(Se)||P(Se))return le=le.get(ce)||null,we(te,le,Se,nt,null);if(typeof Se.then=="function")return me(le,te,ce,vh(Se),nt);if(Se.$$typeof===C)return me(le,te,ce,ch(te,Se),nt);ph(te,Se)}return null}function $e(le,te,ce,Se){for(var nt=null,Mt=null,Ye=te,pt=te=0,kt=null;Ye!==null&&pt<ce.length;pt++){Ye.index>pt?(kt=Ye,Ye=null):kt=Ye.sibling;var Ot=ve(le,Ye,ce[pt],Se);if(Ot===null){Ye===null&&(Ye=kt);break}s&&Ye&&Ot.alternate===null&&u(le,Ye),te=k(Ot,te,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot,Ye=kt}if(pt===ce.length)return v(le,Ye),Tt&&Ti(le,pt),nt;if(Ye===null){for(;pt<ce.length;pt++)Ye=Ee(le,ce[pt],Se),Ye!==null&&(te=k(Ye,te,pt),Mt===null?nt=Ye:Mt.sibling=Ye,Mt=Ye);return Tt&&Ti(le,pt),nt}for(Ye=g(Ye);pt<ce.length;pt++)kt=me(Ye,le,pt,ce[pt],Se),kt!==null&&(s&&kt.alternate!==null&&Ye.delete(kt.key===null?pt:kt.key),te=k(kt,te,pt),Mt===null?nt=kt:Mt.sibling=kt,Mt=kt);return s&&Ye.forEach(function(Is){return u(le,Is)}),Tt&&Ti(le,pt),nt}function it(le,te,ce,Se){if(ce==null)throw Error(r(151));for(var nt=null,Mt=null,Ye=te,pt=te=0,kt=null,Ot=ce.next();Ye!==null&&!Ot.done;pt++,Ot=ce.next()){Ye.index>pt?(kt=Ye,Ye=null):kt=Ye.sibling;var Is=ve(le,Ye,Ot.value,Se);if(Is===null){Ye===null&&(Ye=kt);break}s&&Ye&&Is.alternate===null&&u(le,Ye),te=k(Is,te,pt),Mt===null?nt=Is:Mt.sibling=Is,Mt=Is,Ye=kt}if(Ot.done)return v(le,Ye),Tt&&Ti(le,pt),nt;if(Ye===null){for(;!Ot.done;pt++,Ot=ce.next())Ot=Ee(le,Ot.value,Se),Ot!==null&&(te=k(Ot,te,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot);return Tt&&Ti(le,pt),nt}for(Ye=g(Ye);!Ot.done;pt++,Ot=ce.next())Ot=me(Ye,le,pt,Ot.value,Se),Ot!==null&&(s&&Ot.alternate!==null&&Ye.delete(Ot.key===null?pt:Ot.key),te=k(Ot,te,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot);return s&&Ye.forEach(function(d4){return u(le,d4)}),Tt&&Ti(le,pt),nt}function $t(le,te,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===b&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:e:{for(var nt=ce.key;te!==null;){if(te.key===nt){if(nt=ce.type,nt===b){if(te.tag===7){v(le,te.sibling),Se=E(te,ce.props.children),Se.return=le,le=Se;break e}}else if(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===L&&Il(nt)===te.type){v(le,te.sibling),Se=E(te,ce.props),qc(Se,ce),Se.return=le,le=Se;break e}v(le,te);break}else u(le,te);te=te.sibling}ce.type===b?(Se=Ll(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=lh(ce.type,ce.key,ce.props,null,le.mode,Se),qc(Se,ce),Se.return=le,le=Se)}return O(le);case x:e:{for(nt=ce.key;te!==null;){if(te.key===nt)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){v(le,te.sibling),Se=E(te,ce.children||[]),Se.return=le,le=Se;break e}else{v(le,te);break}else u(le,te);te=te.sibling}Se=Hm(ce,le.mode,Se),Se.return=le,le=Se}return O(le);case L:return ce=Il(ce),$t(le,te,ce,Se)}if(V(ce))return $e(le,te,ce,Se);if(P(ce)){if(nt=P(ce),typeof nt!="function")throw Error(r(150));return ce=nt.call(ce),it(le,te,ce,Se)}if(typeof ce.then=="function")return $t(le,te,vh(ce),Se);if(ce.$$typeof===C)return $t(le,te,ch(le,ce),Se);ph(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(v(le,te.sibling),Se=E(te,ce),Se.return=le,le=Se):(v(le,te),Se=Vm(ce,le.mode,Se),Se.return=le,le=Se),O(le)):v(le,te)}return function(le,te,ce,Se){try{Fc=0;var nt=$t(le,te,ce,Se);return Yo=null,nt}catch(Ye){if(Ye===Ko||Ye===dh)throw Ye;var Mt=Qr(29,Ye,null,le.mode);return Mt.lanes=Se,Mt.return=le,Mt}finally{}}}var ql=KS(!0),YS=KS(!1),Ss=!1;function ng(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rg(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Es(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Cs(s,u,v){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(_t&2)!==0){var E=g.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),g.pending=u,u=sh(s),DS(s,null,v),u}return ih(s,g,u,v),sh(s)}function Uc(s,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,Sn(s,v)}}function ag(s,u){var v=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,v===g)){var E=null,k=null;if(v=v.firstBaseUpdate,v!==null){do{var O={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};k===null?E=k=O:k=k.next=O,v=v.next}while(v!==null);k===null?E=k=u:k=k.next=u}else E=k=u;v={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=v;return}s=v.lastBaseUpdate,s===null?v.firstBaseUpdate=u:s.next=u,v.lastBaseUpdate=u}var ig=!1;function Vc(){if(ig){var s=Go;if(s!==null)throw s}}function Hc(s,u,v,g){ig=!1;var E=s.updateQueue;Ss=!1;var k=E.firstBaseUpdate,O=E.lastBaseUpdate,G=E.shared.pending;if(G!==null){E.shared.pending=null;var Z=G,fe=Z.next;Z.next=null,O===null?k=fe:O.next=fe,O=Z;var we=s.alternate;we!==null&&(we=we.updateQueue,G=we.lastBaseUpdate,G!==O&&(G===null?we.firstBaseUpdate=fe:G.next=fe,we.lastBaseUpdate=Z))}if(k!==null){var Ee=E.baseState;O=0,we=fe=Z=null,G=k;do{var ve=G.lane&-536870913,me=ve!==G.lane;if(me?(Nt&ve)===ve:(g&ve)===ve){ve!==0&&ve===$o&&(ig=!0),we!==null&&(we=we.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var $e=s,it=G;ve=u;var $t=v;switch(it.tag){case 1:if($e=it.payload,typeof $e=="function"){Ee=$e.call($t,Ee,ve);break e}Ee=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=it.payload,ve=typeof $e=="function"?$e.call($t,Ee,ve):$e,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:Ss=!0}}ve=G.callback,ve!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[ve]:me.push(ve))}else me={lane:ve,tag:G.tag,payload:G.payload,callback:G.callback,next:null},we===null?(fe=we=me,Z=Ee):we=we.next=me,O|=ve;if(G=G.next,G===null){if(G=E.shared.pending,G===null)break;me=G,G=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);we===null&&(Z=Ee),E.baseState=Z,E.firstBaseUpdate=fe,E.lastBaseUpdate=we,k===null&&(E.shared.lanes=0),As|=O,s.lanes=O,s.memoizedState=Ee}}function XS(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function QS(s,u){var v=s.callbacks;if(v!==null)for(s.callbacks=null,s=0;s<v.length;s++)XS(v[s],u)}var Xo=q(null),mh=q(0);function WS(s,u){s=zi,z(mh,s),z(Xo,u),zi=s|u.baseLanes}function sg(){z(mh,zi),z(Xo,Xo.current)}function lg(){zi=mh.current,X(Xo),X(mh)}var Wr=q(null),ba=null;function Ns(s){var u=s.alternate;z(Cn,Cn.current&1),z(Wr,s),ba===null&&(u===null||Xo.current!==null||u.memoizedState!==null)&&(ba=s)}function og(s){z(Cn,Cn.current),z(Wr,s),ba===null&&(ba=s)}function ZS(s){s.tag===22?(z(Cn,Cn.current),z(Wr,s),ba===null&&(ba=s)):ks()}function ks(){z(Cn,Cn.current),z(Wr,Wr.current)}function Zr(s){X(Wr),ba===s&&(ba=null),X(Cn)}var Cn=q(0);function gh(s){for(var u=s;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||vy(v)||py(v)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Ri=0,ht=null,Vt=null,Rn=null,yh=!1,Qo=!1,Ul=!1,xh=0,$c=0,Wo=null,n3=0;function yn(){throw Error(r(321))}function ug(s,u){if(u===null)return!1;for(var v=0;v<u.length&&v<s.length;v++)if(!Xr(s[v],u[v]))return!1;return!0}function cg(s,u,v,g,E,k){return Ri=k,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,I.H=s===null||s.memoizedState===null?_2:Ng,Ul=!1,k=v(g,E),Ul=!1,Qo&&(k=e2(u,v,g,E)),JS(s),k}function JS(s){I.H=Yc;var u=Vt!==null&&Vt.next!==null;if(Ri=0,Rn=Vt=ht=null,yh=!1,$c=0,Wo=null,u)throw Error(r(300));s===null||Dn||(s=s.dependencies,s!==null&&uh(s)&&(Dn=!0))}function e2(s,u,v,g){ht=s;var E=0;do{if(Qo&&(Wo=null),$c=0,Qo=!1,25<=E)throw Error(r(301));if(E+=1,Rn=Vt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}I.H=B2,k=u(v,g)}while(Qo);return k}function r3(){var s=I.H,u=s.useState()[0];return u=typeof u.then=="function"?Gc(u):u,s=s.useState()[0],(Vt!==null?Vt.memoizedState:null)!==s&&(ht.flags|=1024),u}function fg(){var s=xh!==0;return xh=0,s}function dg(s,u,v){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~v}function hg(s){if(yh){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}yh=!1}Ri=0,Rn=Vt=ht=null,Qo=!1,$c=xh=0,Wo=null}function Er(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?ht.memoizedState=Rn=s:Rn=Rn.next=s,Rn}function Nn(){if(Vt===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Vt.next;var u=Rn===null?ht.memoizedState:Rn.next;if(u!==null)Rn=u,Vt=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));Vt=s,s={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Rn===null?ht.memoizedState=Rn=s:Rn=Rn.next=s}return Rn}function bh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gc(s){var u=$c;return $c+=1,Wo===null&&(Wo=[]),s=HS(Wo,s,u),u=ht,(Rn===null?u.memoizedState:Rn.next)===null&&(u=u.alternate,I.H=u===null||u.memoizedState===null?_2:Ng),s}function wh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Gc(s);if(s.$$typeof===C)return ar(s)}throw Error(r(438,String(s)))}function vg(s){var u=null,v=ht.updateQueue;if(v!==null&&(u=v.memoCache),u==null){var g=ht.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),v===null&&(v=bh(),ht.updateQueue=v),v.memoCache=u,v=u.data[u.index],v===void 0)for(v=u.data[u.index]=Array(s),g=0;g<s;g++)v[g]=M;return u.index++,v}function Di(s,u){return typeof u=="function"?u(s):u}function Sh(s){var u=Nn();return pg(u,Vt,s)}function pg(s,u,v){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=v;var E=s.baseQueue,k=g.pending;if(k!==null){if(E!==null){var O=E.next;E.next=k.next,k.next=O}u.baseQueue=E=k,g.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var G=O=null,Z=null,fe=u,we=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(Nt&Ee)===Ee:(Ri&Ee)===Ee){var ve=fe.revertLane;if(ve===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===$o&&(we=!0);else if((Ri&ve)===ve){fe=fe.next,ve===$o&&(we=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?(G=Z=Ee,O=k):Z=Z.next=Ee,ht.lanes|=ve,As|=ve;Ee=fe.action,Ul&&v(k,Ee),k=fe.hasEagerState?fe.eagerState:v(k,Ee)}else ve={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Z===null?(G=Z=ve,O=k):Z=Z.next=ve,ht.lanes|=Ee,As|=Ee;fe=fe.next}while(fe!==null&&fe!==u);if(Z===null?O=k:Z.next=G,!Xr(k,s.memoizedState)&&(Dn=!0,we&&(v=Go,v!==null)))throw v;s.memoizedState=k,s.baseState=O,s.baseQueue=Z,g.lastRenderedState=k}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function mg(s){var u=Nn(),v=u.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=s;var g=v.dispatch,E=v.pending,k=u.memoizedState;if(E!==null){v.pending=null;var O=E=E.next;do k=s(k,O.action),O=O.next;while(O!==E);Xr(k,u.memoizedState)||(Dn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,g]}function t2(s,u,v){var g=ht,E=Nn(),k=Tt;if(k){if(v===void 0)throw Error(r(407));v=v()}else v=u();var O=!Xr((Vt||E).memoizedState,v);if(O&&(E.memoizedState=v,Dn=!0),E=E.queue,xg(a2.bind(null,g,E,s),[s]),E.getSnapshot!==u||O||Rn!==null&&Rn.memoizedState.tag&1){if(g.flags|=2048,Zo(9,{destroy:void 0},r2.bind(null,g,E,v,u),null),Kt===null)throw Error(r(349));k||(Ri&127)!==0||n2(g,u,v)}return v}function n2(s,u,v){s.flags|=16384,s={getSnapshot:u,value:v},u=ht.updateQueue,u===null?(u=bh(),ht.updateQueue=u,u.stores=[s]):(v=u.stores,v===null?u.stores=[s]:v.push(s))}function r2(s,u,v,g){u.value=v,u.getSnapshot=g,i2(u)&&s2(s)}function a2(s,u,v){return v(function(){i2(u)&&s2(s)})}function i2(s){var u=s.getSnapshot;s=s.value;try{var v=u();return!Xr(s,v)}catch{return!0}}function s2(s){var u=Ol(s,2);u!==null&&Ir(u,s,2)}function gg(s){var u=Er();if(typeof s=="function"){var v=s;if(s=v(),Ul){pe(!0);try{v()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:s},u}function l2(s,u,v,g){return s.baseState=v,pg(s,Vt,typeof g=="function"?g:Di)}function a3(s,u,v,g,E){if(Nh(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){k.listeners.push(O)}};I.T!==null?v(!0):k.isTransition=!1,g(k),v=u.pending,v===null?(k.next=u.pending=k,o2(u,k)):(k.next=v.next,u.pending=v.next=k)}}function o2(s,u){var v=u.action,g=u.payload,E=s.state;if(u.isTransition){var k=I.T,O={};I.T=O;try{var G=v(E,g),Z=I.S;Z!==null&&Z(O,G),u2(s,u,G)}catch(fe){yg(s,u,fe)}finally{k!==null&&O.types!==null&&(k.types=O.types),I.T=k}}else try{k=v(E,g),u2(s,u,k)}catch(fe){yg(s,u,fe)}}function u2(s,u,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(g){c2(s,u,g)},function(g){return yg(s,u,g)}):c2(s,u,v)}function c2(s,u,v){u.status="fulfilled",u.value=v,f2(u),s.state=v,u=s.pending,u!==null&&(v=u.next,v===u?s.pending=null:(v=v.next,u.next=v,o2(s,v)))}function yg(s,u,v){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=v,f2(u),u=u.next;while(u!==g)}s.action=null}function f2(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function d2(s,u){return u}function h2(s,u){if(Tt){var v=Kt.formState;if(v!==null){e:{var g=ht;if(Tt){if(nn){t:{for(var E=nn,k=xa;E.nodeType!==8;){if(!k){E=null;break t}if(E=wa(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){nn=wa(E.nextSibling),g=E.data==="F!";break e}}bs(g)}g=!1}g&&(u=v[0])}}return v=Er(),v.memoizedState=v.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d2,lastRenderedState:u},v.queue=g,v=M2.bind(null,ht,g),g.dispatch=v,g=gg(!1),k=Cg.bind(null,ht,!1,g.queue),g=Er(),E={state:u,dispatch:null,action:s,pending:null},g.queue=E,v=a3.bind(null,ht,E,k,v),E.dispatch=v,g.memoizedState=s,[u,v,!1]}function v2(s){var u=Nn();return p2(u,Vt,s)}function p2(s,u,v){if(u=pg(s,u,d2)[0],s=Sh(Di)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=Gc(u)}catch(O){throw O===Ko?dh:O}else g=u;u=Nn();var E=u.queue,k=E.dispatch;return v!==u.memoizedState&&(ht.flags|=2048,Zo(9,{destroy:void 0},i3.bind(null,E,v),null)),[g,k,s]}function i3(s,u){s.action=u}function m2(s){var u=Nn(),v=Vt;if(v!==null)return p2(u,v,s);Nn(),u=u.memoizedState,v=Nn();var g=v.queue.dispatch;return v.memoizedState=s,[u,g,!1]}function Zo(s,u,v,g){return s={tag:s,create:v,deps:g,inst:u,next:null},u=ht.updateQueue,u===null&&(u=bh(),ht.updateQueue=u),v=u.lastEffect,v===null?u.lastEffect=s.next=s:(g=v.next,v.next=s,s.next=g,u.lastEffect=s),s}function g2(){return Nn().memoizedState}function Eh(s,u,v,g){var E=Er();ht.flags|=s,E.memoizedState=Zo(1|u,{destroy:void 0},v,g===void 0?null:g)}function Ch(s,u,v,g){var E=Nn();g=g===void 0?null:g;var k=E.memoizedState.inst;Vt!==null&&g!==null&&ug(g,Vt.memoizedState.deps)?E.memoizedState=Zo(u,k,v,g):(ht.flags|=s,E.memoizedState=Zo(1|u,k,v,g))}function y2(s,u){Eh(8390656,8,s,u)}function xg(s,u){Ch(2048,8,s,u)}function s3(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=bh(),ht.updateQueue=u,u.events=[s];else{var v=u.events;v===null?u.events=[s]:v.push(s)}}function x2(s){var u=Nn().memoizedState;return s3({ref:u,nextImpl:s}),function(){if((_t&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function b2(s,u){return Ch(4,2,s,u)}function w2(s,u){return Ch(4,4,s,u)}function S2(s,u){if(typeof u=="function"){s=s();var v=u(s);return function(){typeof v=="function"?v():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function E2(s,u,v){v=v!=null?v.concat([s]):null,Ch(4,4,S2.bind(null,u,s),v)}function bg(){}function C2(s,u){var v=Nn();u=u===void 0?null:u;var g=v.memoizedState;return u!==null&&ug(u,g[1])?g[0]:(v.memoizedState=[s,u],s)}function N2(s,u){var v=Nn();u=u===void 0?null:u;var g=v.memoizedState;if(u!==null&&ug(u,g[1]))return g[0];if(g=s(),Ul){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g}function wg(s,u,v){return v===void 0||(Ri&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=v,s=kE(),ht.lanes|=s,As|=s,v)}function k2(s,u,v,g){return Xr(v,u)?v:Xo.current!==null?(s=wg(s,v,g),Xr(s,u)||(Dn=!0),s):(Ri&42)===0||(Ri&1073741824)!==0&&(Nt&261930)===0?(Dn=!0,s.memoizedState=v):(s=kE(),ht.lanes|=s,As|=s,u)}function T2(s,u,v,g,E){var k=U.p;U.p=k!==0&&8>k?k:8;var O=I.T,G={};I.T=G,Cg(s,!1,u,v);try{var Z=E(),fe=I.S;if(fe!==null&&fe(G,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var we=t3(Z,g);Kc(s,u,we,ta(s))}else Kc(s,u,g,ta(s))}catch(Ee){Kc(s,u,{then:function(){},status:"rejected",reason:Ee},ta())}finally{U.p=k,O!==null&&G.types!==null&&(O.types=G.types),I.T=O}}function l3(){}function Sg(s,u,v,g){if(s.tag!==5)throw Error(r(476));var E=j2(s).queue;T2(s,E,u,Y,v===null?l3:function(){return A2(s),v(g)})}function j2(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:Y},next:null};var v={};return u.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:v},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function A2(s){var u=j2(s);u.next===null&&(u=s.alternate.memoizedState),Kc(s,u.next.queue,{},ta())}function Eg(){return ar(ff)}function R2(){return Nn().memoizedState}function D2(){return Nn().memoizedState}function o3(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var v=ta();s=Es(v);var g=Cs(u,s,v);g!==null&&(Ir(g,u,v),Uc(g,u,v)),u={cache:Zm()},s.payload=u;return}u=u.return}}function u3(s,u,v){var g=ta();v={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Nh(s)?O2(u,v):(v=qm(s,u,v,g),v!==null&&(Ir(v,s,g),L2(v,u,g)))}function M2(s,u,v){var g=ta();Kc(s,u,v,g)}function Kc(s,u,v,g){var E={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(Nh(s))O2(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var O=u.lastRenderedState,G=k(O,v);if(E.hasEagerState=!0,E.eagerState=G,Xr(G,O))return ih(s,u,E,0),Kt===null&&ah(),!1}catch{}finally{}if(v=qm(s,u,E,g),v!==null)return Ir(v,s,g),L2(v,u,g),!0}return!1}function Cg(s,u,v,g){if(g={lane:2,revertLane:ny(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Nh(s)){if(u)throw Error(r(479))}else u=qm(s,v,g,2),u!==null&&Ir(u,s,2)}function Nh(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function O2(s,u){Qo=yh=!0;var v=s.pending;v===null?u.next=u:(u.next=v.next,v.next=u),s.pending=u}function L2(s,u,v){if((v&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,Sn(s,v)}}var Yc={readContext:ar,use:wh,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useLayoutEffect:yn,useInsertionEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useSyncExternalStore:yn,useId:yn,useHostTransitionStatus:yn,useFormState:yn,useActionState:yn,useOptimistic:yn,useMemoCache:yn,useCacheRefresh:yn};Yc.useEffectEvent=yn;var _2={readContext:ar,use:wh,useCallback:function(s,u){return Er().memoizedState=[s,u===void 0?null:u],s},useContext:ar,useEffect:y2,useImperativeHandle:function(s,u,v){v=v!=null?v.concat([s]):null,Eh(4194308,4,S2.bind(null,u,s),v)},useLayoutEffect:function(s,u){return Eh(4194308,4,s,u)},useInsertionEffect:function(s,u){Eh(4,2,s,u)},useMemo:function(s,u){var v=Er();u=u===void 0?null:u;var g=s();if(Ul){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g},useReducer:function(s,u,v){var g=Er();if(v!==void 0){var E=v(u);if(Ul){pe(!0);try{v(u)}finally{pe(!1)}}}else E=u;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=u3.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var u=Er();return s={current:s},u.memoizedState=s},useState:function(s){s=gg(s);var u=s.queue,v=M2.bind(null,ht,u);return u.dispatch=v,[s.memoizedState,v]},useDebugValue:bg,useDeferredValue:function(s,u){var v=Er();return wg(v,s,u)},useTransition:function(){var s=gg(!1);return s=T2.bind(null,ht,s.queue,!0,!1),Er().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,v){var g=ht,E=Er();if(Tt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=u(),Kt===null)throw Error(r(349));(Nt&127)!==0||n2(g,u,v)}E.memoizedState=v;var k={value:v,getSnapshot:u};return E.queue=k,y2(a2.bind(null,g,k,s),[s]),g.flags|=2048,Zo(9,{destroy:void 0},r2.bind(null,g,k,v,u),null),v},useId:function(){var s=Er(),u=Kt.identifierPrefix;if(Tt){var v=Wa,g=Qa;v=(g&~(1<<32-de(g)-1)).toString(32)+v,u="_"+u+"R_"+v,v=xh++,0<v&&(u+="H"+v.toString(32)),u+="_"}else v=n3++,u="_"+u+"r_"+v.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Eg,useFormState:h2,useActionState:h2,useOptimistic:function(s){var u=Er();u.memoizedState=u.baseState=s;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=v,u=Cg.bind(null,ht,!0,v),v.dispatch=u,[s,u]},useMemoCache:vg,useCacheRefresh:function(){return Er().memoizedState=o3.bind(null,ht)},useEffectEvent:function(s){var u=Er(),v={impl:s};return u.memoizedState=v,function(){if((_t&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}},Ng={readContext:ar,use:wh,useCallback:C2,useContext:ar,useEffect:xg,useImperativeHandle:E2,useInsertionEffect:b2,useLayoutEffect:w2,useMemo:N2,useReducer:Sh,useRef:g2,useState:function(){return Sh(Di)},useDebugValue:bg,useDeferredValue:function(s,u){var v=Nn();return k2(v,Vt.memoizedState,s,u)},useTransition:function(){var s=Sh(Di)[0],u=Nn().memoizedState;return[typeof s=="boolean"?s:Gc(s),u]},useSyncExternalStore:t2,useId:R2,useHostTransitionStatus:Eg,useFormState:v2,useActionState:v2,useOptimistic:function(s,u){var v=Nn();return l2(v,Vt,s,u)},useMemoCache:vg,useCacheRefresh:D2};Ng.useEffectEvent=x2;var B2={readContext:ar,use:wh,useCallback:C2,useContext:ar,useEffect:xg,useImperativeHandle:E2,useInsertionEffect:b2,useLayoutEffect:w2,useMemo:N2,useReducer:mg,useRef:g2,useState:function(){return mg(Di)},useDebugValue:bg,useDeferredValue:function(s,u){var v=Nn();return Vt===null?wg(v,s,u):k2(v,Vt.memoizedState,s,u)},useTransition:function(){var s=mg(Di)[0],u=Nn().memoizedState;return[typeof s=="boolean"?s:Gc(s),u]},useSyncExternalStore:t2,useId:R2,useHostTransitionStatus:Eg,useFormState:m2,useActionState:m2,useOptimistic:function(s,u){var v=Nn();return Vt!==null?l2(v,Vt,s,u):(v.baseState=s,[s,v.queue.dispatch])},useMemoCache:vg,useCacheRefresh:D2};B2.useEffectEvent=x2;function kg(s,u,v,g){u=s.memoizedState,v=v(g,u),v=v==null?u:p({},u,v),s.memoizedState=v,s.lanes===0&&(s.updateQueue.baseState=v)}var Tg={enqueueSetState:function(s,u,v){s=s._reactInternals;var g=ta(),E=Es(g);E.payload=u,v!=null&&(E.callback=v),u=Cs(s,E,g),u!==null&&(Ir(u,s,g),Uc(u,s,g))},enqueueReplaceState:function(s,u,v){s=s._reactInternals;var g=ta(),E=Es(g);E.tag=1,E.payload=u,v!=null&&(E.callback=v),u=Cs(s,E,g),u!==null&&(Ir(u,s,g),Uc(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var v=ta(),g=Es(v);g.tag=2,u!=null&&(g.callback=u),u=Cs(s,g,v),u!==null&&(Ir(u,s,v),Uc(u,s,v))}};function P2(s,u,v,g,E,k,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,O):u.prototype&&u.prototype.isPureReactComponent?!Lc(v,g)||!Lc(E,k):!0}function z2(s,u,v,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,g),u.state!==s&&Tg.enqueueReplaceState(u,u.state,null)}function Vl(s,u){var v=u;if("ref"in u){v={};for(var g in u)g!=="ref"&&(v[g]=u[g])}if(s=s.defaultProps){v===u&&(v=p({},v));for(var E in s)v[E]===void 0&&(v[E]=s[E])}return v}function I2(s){rh(s)}function F2(s){console.error(s)}function q2(s){rh(s)}function kh(s,u){try{var v=s.onUncaughtError;v(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function U2(s,u,v){try{var g=s.onCaughtError;g(v.value,{componentStack:v.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function jg(s,u,v){return v=Es(v),v.tag=3,v.payload={element:null},v.callback=function(){kh(s,u)},v}function V2(s){return s=Es(s),s.tag=3,s}function H2(s,u,v,g){var E=v.type.getDerivedStateFromError;if(typeof E=="function"){var k=g.value;s.payload=function(){return E(k)},s.callback=function(){U2(u,v,g)}}var O=v.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){U2(u,v,g),typeof E!="function"&&(Rs===null?Rs=new Set([this]):Rs.add(this));var G=g.stack;this.componentDidCatch(g.value,{componentStack:G!==null?G:""})})}function c3(s,u,v,g,E){if(v.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=v.alternate,u!==null&&Ho(u,v,E,!0),v=Wr.current,v!==null){switch(v.tag){case 31:case 13:return ba===null?zh():v.alternate===null&&xn===0&&(xn=3),v.flags&=-257,v.flags|=65536,v.lanes=E,g===hh?v.flags|=16384:(u=v.updateQueue,u===null?v.updateQueue=new Set([g]):u.add(g),Jg(s,g,E)),!1;case 22:return v.flags|=65536,g===hh?v.flags|=16384:(u=v.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},v.updateQueue=u):(v=u.retryQueue,v===null?u.retryQueue=new Set([g]):v.add(g)),Jg(s,g,E)),!1}throw Error(r(435,v.tag))}return Jg(s,g,E),zh(),!1}if(Tt)return u=Wr.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,g!==Km&&(s=Error(r(422),{cause:g}),Pc(ma(s,v)))):(g!==Km&&(u=Error(r(423),{cause:g}),Pc(ma(u,v))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=ma(g,v),E=jg(s.stateNode,g,E),ag(s,E),xn!==4&&(xn=2)),!1;var k=Error(r(520),{cause:g});if(k=ma(k,v),nf===null?nf=[k]:nf.push(k),xn!==4&&(xn=2),u===null)return!0;g=ma(g,v),v=u;do{switch(v.tag){case 3:return v.flags|=65536,s=E&-E,v.lanes|=s,s=jg(v.stateNode,g,s),ag(v,s),!1;case 1:if(u=v.type,k=v.stateNode,(v.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Rs===null||!Rs.has(k))))return v.flags|=65536,E&=-E,v.lanes|=E,E=V2(E),H2(E,s,v,g),ag(v,E),!1}v=v.return}while(v!==null);return!1}var Ag=Error(r(461)),Dn=!1;function ir(s,u,v,g){u.child=s===null?YS(u,null,v,g):ql(u,s.child,v,g)}function $2(s,u,v,g,E){v=v.render;var k=u.ref;if("ref"in g){var O={};for(var G in g)G!=="ref"&&(O[G]=g[G])}else O=g;return Pl(u),g=cg(s,u,v,O,k,E),G=fg(),s!==null&&!Dn?(dg(s,u,E),Mi(s,u,E)):(Tt&&G&&$m(u),u.flags|=1,ir(s,u,g,E),u.child)}function G2(s,u,v,g,E){if(s===null){var k=v.type;return typeof k=="function"&&!Um(k)&&k.defaultProps===void 0&&v.compare===null?(u.tag=15,u.type=k,K2(s,u,k,g,E)):(s=lh(v.type,null,g,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!Pg(s,E)){var O=k.memoizedProps;if(v=v.compare,v=v!==null?v:Lc,v(O,g)&&s.ref===u.ref)return Mi(s,u,E)}return u.flags|=1,s=ki(k,g),s.ref=u.ref,s.return=u,u.child=s}function K2(s,u,v,g,E){if(s!==null){var k=s.memoizedProps;if(Lc(k,g)&&s.ref===u.ref)if(Dn=!1,u.pendingProps=g=k,Pg(s,E))(s.flags&131072)!==0&&(Dn=!0);else return u.lanes=s.lanes,Mi(s,u,E)}return Rg(s,u,v,g,E)}function Y2(s,u,v,g){var E=g.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|v:v,s!==null){for(g=u.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~k}else g=0,u.child=null;return X2(s,u,k,v,g)}if((v&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&fh(u,k!==null?k.cachePool:null),k!==null?WS(u,k):sg(),ZS(u);else return g=u.lanes=536870912,X2(s,u,k!==null?k.baseLanes|v:v,v,g)}else k!==null?(fh(u,k.cachePool),WS(u,k),ks(),u.memoizedState=null):(s!==null&&fh(u,null),sg(),ks());return ir(s,u,E,v),u.child}function Xc(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function X2(s,u,v,g,E){var k=eg();return k=k===null?null:{parent:An._currentValue,pool:k},u.memoizedState={baseLanes:v,cachePool:k},s!==null&&fh(u,null),sg(),ZS(u),s!==null&&Ho(s,u,g,!0),u.childLanes=E,null}function Th(s,u){return u=Ah({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function Q2(s,u,v){return ql(u,s.child,null,v),s=Th(u,u.pendingProps),s.flags|=2,Zr(u),u.memoizedState=null,s}function f3(s,u,v){var g=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(Tt){if(g.mode==="hidden")return s=Th(u,g),u.lanes=536870912,Xc(null,s);if(og(u),(s=nn)?(s=oC(s,xa),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ys!==null?{id:Qa,overflow:Wa}:null,retryLane:536870912,hydrationErrors:null},v=OS(s),v.return=u,u.child=v,rr=u,nn=null)):s=null,s===null)throw bs(u);return u.lanes=536870912,null}return Th(u,g)}var k=s.memoizedState;if(k!==null){var O=k.dehydrated;if(og(u),E)if(u.flags&256)u.flags&=-257,u=Q2(s,u,v);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Dn||Ho(s,u,v,!1),E=(v&s.childLanes)!==0,Dn||E){if(g=Kt,g!==null&&(O=gn(g,v),O!==0&&O!==k.retryLane))throw k.retryLane=O,Ol(s,O),Ir(g,s,O),Ag;zh(),u=Q2(s,u,v)}else s=k.treeContext,nn=wa(O.nextSibling),rr=u,Tt=!0,xs=null,xa=!1,s!==null&&BS(u,s),u=Th(u,g),u.flags|=4096;return u}return s=ki(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function jh(s,u){var v=u.ref;if(v===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof v!="function"&&typeof v!="object")throw Error(r(284));(s===null||s.ref!==v)&&(u.flags|=4194816)}}function Rg(s,u,v,g,E){return Pl(u),v=cg(s,u,v,g,void 0,E),g=fg(),s!==null&&!Dn?(dg(s,u,E),Mi(s,u,E)):(Tt&&g&&$m(u),u.flags|=1,ir(s,u,v,E),u.child)}function W2(s,u,v,g,E,k){return Pl(u),u.updateQueue=null,v=e2(u,g,v,E),JS(s),g=fg(),s!==null&&!Dn?(dg(s,u,k),Mi(s,u,k)):(Tt&&g&&$m(u),u.flags|=1,ir(s,u,v,k),u.child)}function Z2(s,u,v,g,E){if(Pl(u),u.stateNode===null){var k=Fo,O=v.contextType;typeof O=="object"&&O!==null&&(k=ar(O)),k=new v(g,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Tg,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=g,k.state=u.memoizedState,k.refs={},ng(u),O=v.contextType,k.context=typeof O=="object"&&O!==null?ar(O):Fo,k.state=u.memoizedState,O=v.getDerivedStateFromProps,typeof O=="function"&&(kg(u,v,O,g),k.state=u.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(O=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),O!==k.state&&Tg.enqueueReplaceState(k,k.state,null),Hc(u,g,k,E),Vc(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){k=u.stateNode;var G=u.memoizedProps,Z=Vl(v,G);k.props=Z;var fe=k.context,we=v.contextType;O=Fo,typeof we=="object"&&we!==null&&(O=ar(we));var Ee=v.getDerivedStateFromProps;we=typeof Ee=="function"||typeof k.getSnapshotBeforeUpdate=="function",G=u.pendingProps!==G,we||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(G||fe!==O)&&z2(u,k,g,O),Ss=!1;var ve=u.memoizedState;k.state=ve,Hc(u,g,k,E),Vc(),fe=u.memoizedState,G||ve!==fe||Ss?(typeof Ee=="function"&&(kg(u,v,Ee,g),fe=u.memoizedState),(Z=Ss||P2(u,v,Z,g,ve,fe,O))?(we||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=fe),k.props=g,k.state=fe,k.context=O,g=Z):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{k=u.stateNode,rg(s,u),O=u.memoizedProps,we=Vl(v,O),k.props=we,Ee=u.pendingProps,ve=k.context,fe=v.contextType,Z=Fo,typeof fe=="object"&&fe!==null&&(Z=ar(fe)),G=v.getDerivedStateFromProps,(fe=typeof G=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(O!==Ee||ve!==Z)&&z2(u,k,g,Z),Ss=!1,ve=u.memoizedState,k.state=ve,Hc(u,g,k,E),Vc();var me=u.memoizedState;O!==Ee||ve!==me||Ss||s!==null&&s.dependencies!==null&&uh(s.dependencies)?(typeof G=="function"&&(kg(u,v,G,g),me=u.memoizedState),(we=Ss||P2(u,v,we,g,ve,me,Z)||s!==null&&s.dependencies!==null&&uh(s.dependencies))?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,me,Z),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,me,Z)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),k.props=g,k.state=me,k.context=Z,g=we):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return k=g,jh(s,u),g=(u.flags&128)!==0,k||g?(k=u.stateNode,v=g&&typeof v.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&g?(u.child=ql(u,s.child,null,E),u.child=ql(u,null,v,E)):ir(s,u,v,E),u.memoizedState=k.state,s=u.child):s=Mi(s,u,E),s}function J2(s,u,v,g){return _l(),u.flags|=256,ir(s,u,v,g),u.child}var Dg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mg(s){return{baseLanes:s,cachePool:US()}}function Og(s,u,v){return s=s!==null?s.childLanes&~v:0,u&&(s|=ea),s}function eE(s,u,v){var g=u.pendingProps,E=!1,k=(u.flags&128)!==0,O;if((O=k)||(O=s!==null&&s.memoizedState===null?!1:(Cn.current&2)!==0),O&&(E=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(Tt){if(E?Ns(u):ks(),(s=nn)?(s=oC(s,xa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ys!==null?{id:Qa,overflow:Wa}:null,retryLane:536870912,hydrationErrors:null},v=OS(s),v.return=u,u.child=v,rr=u,nn=null)):s=null,s===null)throw bs(u);return py(s)?u.lanes=32:u.lanes=536870912,null}var G=g.children;return g=g.fallback,E?(ks(),E=u.mode,G=Ah({mode:"hidden",children:G},E),g=Ll(g,E,v,null),G.return=u,g.return=u,G.sibling=g,u.child=G,g=u.child,g.memoizedState=Mg(v),g.childLanes=Og(s,O,v),u.memoizedState=Dg,Xc(null,g)):(Ns(u),Lg(u,G))}var Z=s.memoizedState;if(Z!==null&&(G=Z.dehydrated,G!==null)){if(k)u.flags&256?(Ns(u),u.flags&=-257,u=_g(s,u,v)):u.memoizedState!==null?(ks(),u.child=s.child,u.flags|=128,u=null):(ks(),G=g.fallback,E=u.mode,g=Ah({mode:"visible",children:g.children},E),G=Ll(G,E,v,null),G.flags|=2,g.return=u,G.return=u,g.sibling=G,u.child=g,ql(u,s.child,null,v),g=u.child,g.memoizedState=Mg(v),g.childLanes=Og(s,O,v),u.memoizedState=Dg,u=Xc(null,g));else if(Ns(u),py(G)){if(O=G.nextSibling&&G.nextSibling.dataset,O)var fe=O.dgst;O=fe,g=Error(r(419)),g.stack="",g.digest=O,Pc({value:g,source:null,stack:null}),u=_g(s,u,v)}else if(Dn||Ho(s,u,v,!1),O=(v&s.childLanes)!==0,Dn||O){if(O=Kt,O!==null&&(g=gn(O,v),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,Ol(s,g),Ir(O,s,g),Ag;vy(G)||zh(),u=_g(s,u,v)}else vy(G)?(u.flags|=192,u.child=s.child,u=null):(s=Z.treeContext,nn=wa(G.nextSibling),rr=u,Tt=!0,xs=null,xa=!1,s!==null&&BS(u,s),u=Lg(u,g.children),u.flags|=4096);return u}return E?(ks(),G=g.fallback,E=u.mode,Z=s.child,fe=Z.sibling,g=ki(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,fe!==null?G=ki(fe,G):(G=Ll(G,E,v,null),G.flags|=2),G.return=u,g.return=u,g.sibling=G,u.child=g,Xc(null,g),g=u.child,G=s.child.memoizedState,G===null?G=Mg(v):(E=G.cachePool,E!==null?(Z=An._currentValue,E=E.parent!==Z?{parent:Z,pool:Z}:E):E=US(),G={baseLanes:G.baseLanes|v,cachePool:E}),g.memoizedState=G,g.childLanes=Og(s,O,v),u.memoizedState=Dg,Xc(s.child,g)):(Ns(u),v=s.child,s=v.sibling,v=ki(v,{mode:"visible",children:g.children}),v.return=u,v.sibling=null,s!==null&&(O=u.deletions,O===null?(u.deletions=[s],u.flags|=16):O.push(s)),u.child=v,u.memoizedState=null,v)}function Lg(s,u){return u=Ah({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Ah(s,u){return s=Qr(22,s,null,u),s.lanes=0,s}function _g(s,u,v){return ql(u,s.child,null,v),s=Lg(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function tE(s,u,v){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),Qm(s.return,u,v)}function Bg(s,u,v,g,E,k){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:v,tailMode:E,treeForkCount:k}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=v,O.tailMode=E,O.treeForkCount=k)}function nE(s,u,v){var g=u.pendingProps,E=g.revealOrder,k=g.tail;g=g.children;var O=Cn.current,G=(O&2)!==0;if(G?(O=O&1|2,u.flags|=128):O&=1,z(Cn,O),ir(s,u,g,v),g=Tt?Bc:0,!G&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&tE(s,v,u);else if(s.tag===19)tE(s,v,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(v=u.child,E=null;v!==null;)s=v.alternate,s!==null&&gh(s)===null&&(E=v),v=v.sibling;v=E,v===null?(E=u.child,u.child=null):(E=v.sibling,v.sibling=null),Bg(u,!1,E,v,k,g);break;case"backwards":case"unstable_legacy-backwards":for(v=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&gh(s)===null){u.child=E;break}s=E.sibling,E.sibling=v,v=E,E=s}Bg(u,!0,v,null,k,g);break;case"together":Bg(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Mi(s,u,v){if(s!==null&&(u.dependencies=s.dependencies),As|=u.lanes,(v&u.childLanes)===0)if(s!==null){if(Ho(s,u,v,!1),(v&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,v=ki(s,s.pendingProps),u.child=v,v.return=u;s.sibling!==null;)s=s.sibling,v=v.sibling=ki(s,s.pendingProps),v.return=u;v.sibling=null}return u.child}function Pg(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&uh(s)))}function d3(s,u,v){switch(u.tag){case 3:ye(u,u.stateNode.containerInfo),ws(u,An,s.memoizedState.cache),_l();break;case 27:case 5:ee(u);break;case 4:ye(u,u.stateNode.containerInfo);break;case 10:ws(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,og(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(Ns(u),u.flags|=128,null):(v&u.child.childLanes)!==0?eE(s,u,v):(Ns(u),s=Mi(s,u,v),s!==null?s.sibling:null);Ns(u);break;case 19:var E=(s.flags&128)!==0;if(g=(v&u.childLanes)!==0,g||(Ho(s,u,v,!1),g=(v&u.childLanes)!==0),E){if(g)return nE(s,u,v);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),z(Cn,Cn.current),g)break;return null;case 22:return u.lanes=0,Y2(s,u,v,u.pendingProps);case 24:ws(u,An,s.memoizedState.cache)}return Mi(s,u,v)}function rE(s,u,v){if(s!==null)if(s.memoizedProps!==u.pendingProps)Dn=!0;else{if(!Pg(s,v)&&(u.flags&128)===0)return Dn=!1,d3(s,u,v);Dn=(s.flags&131072)!==0}else Dn=!1,Tt&&(u.flags&1048576)!==0&&_S(u,Bc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Il(u.elementType),u.type=s,typeof s=="function")Um(s)?(g=Vl(s,g),u.tag=1,u=Z2(null,u,s,g,v)):(u.tag=0,u=Rg(null,u,s,g,v));else{if(s!=null){var E=s.$$typeof;if(E===T){u.tag=11,u=$2(null,u,s,g,v);break e}else if(E===D){u.tag=14,u=G2(null,u,s,g,v);break e}}throw u=$(s)||s,Error(r(306,u,""))}}return u;case 0:return Rg(s,u,u.type,u.pendingProps,v);case 1:return g=u.type,E=Vl(g,u.pendingProps),Z2(s,u,g,E,v);case 3:e:{if(ye(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var k=u.memoizedState;E=k.element,rg(s,u),Hc(u,g,null,v);var O=u.memoizedState;if(g=O.cache,ws(u,An,g),g!==k.cache&&Wm(u,[An],v,!0),Vc(),g=O.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=J2(s,u,g,v);break e}else if(g!==E){E=ma(Error(r(424)),u),Pc(E),u=J2(s,u,g,v);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(nn=wa(s.firstChild),rr=u,Tt=!0,xs=null,xa=!0,v=YS(u,null,g,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling}else{if(_l(),g===E){u=Mi(s,u,v);break e}ir(s,u,g,v)}u=u.child}return u;case 26:return jh(s,u),s===null?(v=vC(u.type,null,u.pendingProps,null))?u.memoizedState=v:Tt||(v=u.type,s=u.pendingProps,g=$h(ae.current).createElement(v),g[on]=u,g[Bn]=s,sr(g,v,s),jn(g),u.stateNode=g):u.memoizedState=vC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return ee(u),s===null&&Tt&&(g=u.stateNode=fC(u.type,u.pendingProps,ae.current),rr=u,xa=!0,E=nn,Ls(u.type)?(my=E,nn=wa(g.firstChild)):nn=E),ir(s,u,u.pendingProps.children,v),jh(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&Tt&&((E=g=nn)&&(g=U3(g,u.type,u.pendingProps,xa),g!==null?(u.stateNode=g,rr=u,nn=wa(g.firstChild),xa=!1,E=!0):E=!1),E||bs(u)),ee(u),E=u.type,k=u.pendingProps,O=s!==null?s.memoizedProps:null,g=k.children,fy(E,k)?g=null:O!==null&&fy(E,O)&&(u.flags|=32),u.memoizedState!==null&&(E=cg(s,u,r3,null,null,v),ff._currentValue=E),jh(s,u),ir(s,u,g,v),u.child;case 6:return s===null&&Tt&&((s=v=nn)&&(v=V3(v,u.pendingProps,xa),v!==null?(u.stateNode=v,rr=u,nn=null,s=!0):s=!1),s||bs(u)),null;case 13:return eE(s,u,v);case 4:return ye(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=ql(u,null,g,v):ir(s,u,g,v),u.child;case 11:return $2(s,u,u.type,u.pendingProps,v);case 7:return ir(s,u,u.pendingProps,v),u.child;case 8:return ir(s,u,u.pendingProps.children,v),u.child;case 12:return ir(s,u,u.pendingProps.children,v),u.child;case 10:return g=u.pendingProps,ws(u,u.type,g.value),ir(s,u,g.children,v),u.child;case 9:return E=u.type._context,g=u.pendingProps.children,Pl(u),E=ar(E),g=g(E),u.flags|=1,ir(s,u,g,v),u.child;case 14:return G2(s,u,u.type,u.pendingProps,v);case 15:return K2(s,u,u.type,u.pendingProps,v);case 19:return nE(s,u,v);case 31:return f3(s,u,v);case 22:return Y2(s,u,v,u.pendingProps);case 24:return Pl(u),g=ar(An),s===null?(E=eg(),E===null&&(E=Kt,k=Zm(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=v),E=k),u.memoizedState={parent:g,cache:E},ng(u),ws(u,An,E)):((s.lanes&v)!==0&&(rg(s,u),Hc(u,null,null,v),Vc()),E=s.memoizedState,k=u.memoizedState,E.parent!==g?(E={parent:g,cache:g},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),ws(u,An,g)):(g=k.cache,ws(u,An,g),g!==E.cache&&Wm(u,[An],v,!0))),ir(s,u,u.pendingProps.children,v),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Oi(s){s.flags|=4}function zg(s,u,v,g,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(RE())s.flags|=8192;else throw Fl=hh,tg}else s.flags&=-16777217}function aE(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!xC(u))if(RE())s.flags|=8192;else throw Fl=hh,tg}function Rh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?vt():536870912,s.lanes|=u,nu|=u)}function Qc(s,u){if(!Tt)switch(s.tailMode){case"hidden":u=s.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?s.tail=null:v.sibling=null;break;case"collapsed":v=s.tail;for(var g=null;v!==null;)v.alternate!==null&&(g=v),v=v.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function rn(s){var u=s.alternate!==null&&s.alternate.child===s.child,v=0,g=0;if(u)for(var E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)v|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=v,u}function h3(s,u,v){var g=u.pendingProps;switch(Gm(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(u),null;case 1:return rn(u),null;case 3:return v=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),Ai(An),ue(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Vo(u)?Oi(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ym())),rn(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(Oi(u),k!==null?(rn(u),aE(u,k)):(rn(u),zg(u,E,null,g,v))):k?k!==s.memoizedState?(Oi(u),rn(u),aE(u,k)):(rn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&Oi(u),rn(u),zg(u,E,s,g,v)),null;case 27:if(ne(u),v=ae.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Oi(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return rn(u),null}s=W.current,Vo(u)?PS(u):(s=fC(E,g,v),u.stateNode=s,Oi(u))}return rn(u),null;case 5:if(ne(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Oi(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return rn(u),null}if(k=W.current,Vo(u))PS(u);else{var O=$h(ae.current);switch(k){case 1:k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=O.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}k[on]=u,k[Bn]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)k.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===u)break e;for(;O.sibling===null;){if(O.return===null||O.return===u)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}u.stateNode=k;e:switch(sr(k,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Oi(u)}}return rn(u),zg(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,v),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&Oi(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=ae.current,Vo(u)){if(s=u.stateNode,v=u.memoizedProps,g=null,E=rr,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[on]=u,s=!!(s.nodeValue===v||g!==null&&g.suppressHydrationWarning===!0||eC(s.nodeValue,v)),s||bs(u,!0)}else s=$h(s).createTextNode(g),s[on]=u,u.stateNode=s}return rn(u),null;case 31:if(v=u.memoizedState,s===null||s.memoizedState!==null){if(g=Vo(u),v!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[on]=u}else _l(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),s=!1}else v=Ym(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),s=!0;if(!s)return u.flags&256?(Zr(u),u):(Zr(u),null);if((u.flags&128)!==0)throw Error(r(558))}return rn(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Vo(u),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[on]=u}else _l(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),E=!1}else E=Ym(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(Zr(u),u):(Zr(u),null)}return Zr(u),(u.flags&128)!==0?(u.lanes=v,u):(v=g!==null,s=s!==null&&s.memoizedState!==null,v&&(g=u.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==E&&(g.flags|=2048)),v!==s&&v&&(u.child.flags|=8192),Rh(u,u.updateQueue),rn(u),null);case 4:return ue(),s===null&&sy(u.stateNode.containerInfo),rn(u),null;case 10:return Ai(u.type),rn(u),null;case 19:if(X(Cn),g=u.memoizedState,g===null)return rn(u),null;if(E=(u.flags&128)!==0,k=g.rendering,k===null)if(E)Qc(g,!1);else{if(xn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=gh(s),k!==null){for(u.flags|=128,Qc(g,!1),s=k.updateQueue,u.updateQueue=s,Rh(u,s),u.subtreeFlags=0,s=v,v=u.child;v!==null;)MS(v,s),v=v.sibling;return z(Cn,Cn.current&1|2),Tt&&Ti(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&ze()>_h&&(u.flags|=128,E=!0,Qc(g,!1),u.lanes=4194304)}else{if(!E)if(s=gh(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,Rh(u,s),Qc(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!Tt)return rn(u),null}else 2*ze()-g.renderingStartTime>_h&&v!==536870912&&(u.flags|=128,E=!0,Qc(g,!1),u.lanes=4194304);g.isBackwards?(k.sibling=u.child,u.child=k):(s=g.last,s!==null?s.sibling=k:u.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ze(),s.sibling=null,v=Cn.current,z(Cn,E?v&1|2:v&1),Tt&&Ti(u,g.treeForkCount),s):(rn(u),null);case 22:case 23:return Zr(u),lg(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(v&536870912)!==0&&(u.flags&128)===0&&(rn(u),u.subtreeFlags&6&&(u.flags|=8192)):rn(u),v=u.updateQueue,v!==null&&Rh(u,v.retryQueue),v=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==v&&(u.flags|=2048),s!==null&&X(zl),null;case 24:return v=null,s!==null&&(v=s.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),Ai(An),rn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function v3(s,u){switch(Gm(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Ai(An),ue(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ne(u),null;case 31:if(u.memoizedState!==null){if(Zr(u),u.alternate===null)throw Error(r(340));_l()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(Zr(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));_l()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return X(Cn),null;case 4:return ue(),null;case 10:return Ai(u.type),null;case 22:case 23:return Zr(u),lg(),s!==null&&X(zl),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Ai(An),null;case 25:return null;default:return null}}function iE(s,u){switch(Gm(u),u.tag){case 3:Ai(An),ue();break;case 26:case 27:case 5:ne(u);break;case 4:ue();break;case 31:u.memoizedState!==null&&Zr(u);break;case 13:Zr(u);break;case 19:X(Cn);break;case 10:Ai(u.type);break;case 22:case 23:Zr(u),lg(),s!==null&&X(zl);break;case 24:Ai(An)}}function Wc(s,u){try{var v=u.updateQueue,g=v!==null?v.lastEffect:null;if(g!==null){var E=g.next;v=E;do{if((v.tag&s)===s){g=void 0;var k=v.create,O=v.inst;g=k(),O.destroy=g}v=v.next}while(v!==E)}}catch(G){qt(u,u.return,G)}}function Ts(s,u,v){try{var g=u.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var k=E.next;g=k;do{if((g.tag&s)===s){var O=g.inst,G=O.destroy;if(G!==void 0){O.destroy=void 0,E=u;var Z=v,fe=G;try{fe()}catch(we){qt(E,Z,we)}}}g=g.next}while(g!==k)}}catch(we){qt(u,u.return,we)}}function sE(s){var u=s.updateQueue;if(u!==null){var v=s.stateNode;try{QS(u,v)}catch(g){qt(s,s.return,g)}}}function lE(s,u,v){v.props=Vl(s.type,s.memoizedProps),v.state=s.memoizedState;try{v.componentWillUnmount()}catch(g){qt(s,u,g)}}function Zc(s,u){try{var v=s.ref;if(v!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof v=="function"?s.refCleanup=v(g):v.current=g}}catch(E){qt(s,u,E)}}function Za(s,u){var v=s.ref,g=s.refCleanup;if(v!==null)if(typeof g=="function")try{g()}catch(E){qt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(E){qt(s,u,E)}else v.current=null}function oE(s){var u=s.type,v=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":v.autoFocus&&g.focus();break e;case"img":v.src?g.src=v.src:v.srcSet&&(g.srcset=v.srcSet)}}catch(E){qt(s,s.return,E)}}function Ig(s,u,v){try{var g=s.stateNode;B3(g,s.type,v,u),g[Bn]=u}catch(E){qt(s,s.return,E)}}function uE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ls(s.type)||s.tag===4}function Fg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||uE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ls(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function qg(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(s,u):(u=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,u.appendChild(s),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=Ci));else if(g!==4&&(g===27&&Ls(s.type)&&(v=s.stateNode,u=null),s=s.child,s!==null))for(qg(s,u,v),s=s.sibling;s!==null;)qg(s,u,v),s=s.sibling}function Dh(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?v.insertBefore(s,u):v.appendChild(s);else if(g!==4&&(g===27&&Ls(s.type)&&(v=s.stateNode),s=s.child,s!==null))for(Dh(s,u,v),s=s.sibling;s!==null;)Dh(s,u,v),s=s.sibling}function cE(s){var u=s.stateNode,v=s.memoizedProps;try{for(var g=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);sr(u,g,v),u[on]=s,u[Bn]=v}catch(k){qt(s,s.return,k)}}var Li=!1,Mn=!1,Ug=!1,fE=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function p3(s,u){if(s=s.containerInfo,uy=Zh,s=ES(s),_m(s)){if("selectionStart"in s)var v={start:s.selectionStart,end:s.selectionEnd};else e:{v=(v=s.ownerDocument)&&v.defaultView||window;var g=v.getSelection&&v.getSelection();if(g&&g.rangeCount!==0){v=g.anchorNode;var E=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var O=0,G=-1,Z=-1,fe=0,we=0,Ee=s,ve=null;t:for(;;){for(var me;Ee!==v||E!==0&&Ee.nodeType!==3||(G=O+E),Ee!==k||g!==0&&Ee.nodeType!==3||(Z=O+g),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)ve=Ee,Ee=me;for(;;){if(Ee===s)break t;if(ve===v&&++fe===E&&(G=O),ve===k&&++we===g&&(Z=O),(me=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=me}v=G===-1||Z===-1?null:{start:G,end:Z}}else v=null}v=v||{start:0,end:0}}else v=null;for(cy={focusedElem:s,selectionRange:v},Zh=!1,Qn=u;Qn!==null;)if(u=Qn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Qn=s;else for(;Qn!==null;){switch(u=Qn,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(v=0;v<s.length;v++)E=s[v],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,v=u,E=k.memoizedProps,k=k.memoizedState,g=v.stateNode;try{var $e=Vl(v.type,E);s=g.getSnapshotBeforeUpdate($e,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(it){qt(v,v.return,it)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,v=s.nodeType,v===9)hy(s);else if(v===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":hy(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Qn=s;break}Qn=u.return}}function dE(s,u,v){var g=v.flags;switch(v.tag){case 0:case 11:case 15:Bi(s,v),g&4&&Wc(5,v);break;case 1:if(Bi(s,v),g&4)if(s=v.stateNode,u===null)try{s.componentDidMount()}catch(O){qt(v,v.return,O)}else{var E=Vl(v.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(v,v.return,O)}}g&64&&sE(v),g&512&&Zc(v,v.return);break;case 3:if(Bi(s,v),g&64&&(s=v.updateQueue,s!==null)){if(u=null,v.child!==null)switch(v.child.tag){case 27:case 5:u=v.child.stateNode;break;case 1:u=v.child.stateNode}try{QS(s,u)}catch(O){qt(v,v.return,O)}}break;case 27:u===null&&g&4&&cE(v);case 26:case 5:Bi(s,v),u===null&&g&4&&oE(v),g&512&&Zc(v,v.return);break;case 12:Bi(s,v);break;case 31:Bi(s,v),g&4&&pE(s,v);break;case 13:Bi(s,v),g&4&&mE(s,v),g&64&&(s=v.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(v=C3.bind(null,v),H3(s,v))));break;case 22:if(g=v.memoizedState!==null||Li,!g){u=u!==null&&u.memoizedState!==null||Mn,E=Li;var k=Mn;Li=g,(Mn=u)&&!k?Pi(s,v,(v.subtreeFlags&8772)!==0):Bi(s,v),Li=E,Mn=k}break;case 30:break;default:Bi(s,v)}}function hE(s){var u=s.alternate;u!==null&&(s.alternate=null,hE(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Ro(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var un=null,_r=!1;function _i(s,u,v){for(v=v.child;v!==null;)vE(s,u,v),v=v.sibling}function vE(s,u,v){if(oe&&typeof oe.onCommitFiberUnmount=="function")try{oe.onCommitFiberUnmount(K,v)}catch{}switch(v.tag){case 26:Mn||Za(v,u),_i(s,u,v),v.memoizedState?v.memoizedState.count--:v.stateNode&&(v=v.stateNode,v.parentNode.removeChild(v));break;case 27:Mn||Za(v,u);var g=un,E=_r;Ls(v.type)&&(un=v.stateNode,_r=!1),_i(s,u,v),of(v.stateNode),un=g,_r=E;break;case 5:Mn||Za(v,u);case 6:if(g=un,E=_r,un=null,_i(s,u,v),un=g,_r=E,un!==null)if(_r)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(v.stateNode)}catch(k){qt(v,u,k)}else try{un.removeChild(v.stateNode)}catch(k){qt(v,u,k)}break;case 18:un!==null&&(_r?(s=un,sC(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,v.stateNode),cu(s)):sC(un,v.stateNode));break;case 4:g=un,E=_r,un=v.stateNode.containerInfo,_r=!0,_i(s,u,v),un=g,_r=E;break;case 0:case 11:case 14:case 15:Ts(2,v,u),Mn||Ts(4,v,u),_i(s,u,v);break;case 1:Mn||(Za(v,u),g=v.stateNode,typeof g.componentWillUnmount=="function"&&lE(v,u,g)),_i(s,u,v);break;case 21:_i(s,u,v);break;case 22:Mn=(g=Mn)||v.memoizedState!==null,_i(s,u,v),Mn=g;break;default:_i(s,u,v)}}function pE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{cu(s)}catch(v){qt(u,u.return,v)}}}function mE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{cu(s)}catch(v){qt(u,u.return,v)}}function m3(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new fE),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new fE),u;default:throw Error(r(435,s.tag))}}function Mh(s,u){var v=m3(s);u.forEach(function(g){if(!v.has(g)){v.add(g);var E=N3.bind(null,s,g);g.then(E,E)}})}function Br(s,u){var v=u.deletions;if(v!==null)for(var g=0;g<v.length;g++){var E=v[g],k=s,O=u,G=O;e:for(;G!==null;){switch(G.tag){case 27:if(Ls(G.type)){un=G.stateNode,_r=!1;break e}break;case 5:un=G.stateNode,_r=!1;break e;case 3:case 4:un=G.stateNode.containerInfo,_r=!0;break e}G=G.return}if(un===null)throw Error(r(160));vE(k,O,E),un=null,_r=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)gE(u,s),u=u.sibling}var _a=null;function gE(s,u){var v=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Br(u,s),Pr(s),g&4&&(Ts(3,s,s.return),Wc(3,s),Ts(5,s,s.return));break;case 1:Br(u,s),Pr(s),g&512&&(Mn||v===null||Za(v,v.return)),g&64&&Li&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(v=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=v===null?g:v.concat(g))));break;case 26:var E=_a;if(Br(u,s),Pr(s),g&512&&(Mn||v===null||Za(v,v.return)),g&4){var k=v!==null?v.memoizedState:null;if(g=s.memoizedState,v===null)if(g===null)if(s.stateNode===null){e:{g=s.type,v=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":k=E.getElementsByTagName("title")[0],(!k||k[Yn]||k[on]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(g),E.head.insertBefore(k,E.querySelector("head > title"))),sr(k,g,v),k[on]=s,jn(k),g=k;break e;case"link":var O=gC("link","href",E).get(g+(v.href||""));if(O){for(var G=0;G<O.length;G++)if(k=O[G],k.getAttribute("href")===(v.href==null||v.href===""?null:v.href)&&k.getAttribute("rel")===(v.rel==null?null:v.rel)&&k.getAttribute("title")===(v.title==null?null:v.title)&&k.getAttribute("crossorigin")===(v.crossOrigin==null?null:v.crossOrigin)){O.splice(G,1);break t}}k=E.createElement(g),sr(k,g,v),E.head.appendChild(k);break;case"meta":if(O=gC("meta","content",E).get(g+(v.content||""))){for(G=0;G<O.length;G++)if(k=O[G],k.getAttribute("content")===(v.content==null?null:""+v.content)&&k.getAttribute("name")===(v.name==null?null:v.name)&&k.getAttribute("property")===(v.property==null?null:v.property)&&k.getAttribute("http-equiv")===(v.httpEquiv==null?null:v.httpEquiv)&&k.getAttribute("charset")===(v.charSet==null?null:v.charSet)){O.splice(G,1);break t}}k=E.createElement(g),sr(k,g,v),E.head.appendChild(k);break;default:throw Error(r(468,g))}k[on]=s,jn(k),g=k}s.stateNode=g}else yC(E,s.type,s.stateNode);else s.stateNode=mC(E,g,s.memoizedProps);else k!==g?(k===null?v.stateNode!==null&&(v=v.stateNode,v.parentNode.removeChild(v)):k.count--,g===null?yC(E,s.type,s.stateNode):mC(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Ig(s,s.memoizedProps,v.memoizedProps)}break;case 27:Br(u,s),Pr(s),g&512&&(Mn||v===null||Za(v,v.return)),v!==null&&g&4&&Ig(s,s.memoizedProps,v.memoizedProps);break;case 5:if(Br(u,s),Pr(s),g&512&&(Mn||v===null||Za(v,v.return)),s.flags&32){E=s.stateNode;try{Oo(E,"")}catch($e){qt(s,s.return,$e)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,Ig(s,E,v!==null?v.memoizedProps:E)),g&1024&&(Ug=!0);break;case 6:if(Br(u,s),Pr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,v=s.stateNode;try{v.nodeValue=g}catch($e){qt(s,s.return,$e)}}break;case 3:if(Yh=null,E=_a,_a=Gh(u.containerInfo),Br(u,s),_a=E,Pr(s),g&4&&v!==null&&v.memoizedState.isDehydrated)try{cu(u.containerInfo)}catch($e){qt(s,s.return,$e)}Ug&&(Ug=!1,yE(s));break;case 4:g=_a,_a=Gh(s.stateNode.containerInfo),Br(u,s),Pr(s),_a=g;break;case 12:Br(u,s),Pr(s);break;case 31:Br(u,s),Pr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Mh(s,g)));break;case 13:Br(u,s),Pr(s),s.child.flags&8192&&s.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(Lh=ze()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Mh(s,g)));break;case 22:E=s.memoizedState!==null;var Z=v!==null&&v.memoizedState!==null,fe=Li,we=Mn;if(Li=fe||E,Mn=we||Z,Br(u,s),Mn=we,Li=fe,Pr(s),g&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(v===null||Z||Li||Mn||Hl(s)),v=null,u=s;;){if(u.tag===5||u.tag===26){if(v===null){Z=v=u;try{if(k=Z.stateNode,E)O=k.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{G=Z.stateNode;var Ee=Z.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;G.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch($e){qt(Z,Z.return,$e)}}}else if(u.tag===6){if(v===null){Z=u;try{Z.stateNode.nodeValue=E?"":Z.memoizedProps}catch($e){qt(Z,Z.return,$e)}}}else if(u.tag===18){if(v===null){Z=u;try{var me=Z.stateNode;E?lC(me,!0):lC(Z.stateNode,!1)}catch($e){qt(Z,Z.return,$e)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;v===u&&(v=null),u=u.return}v===u&&(v=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(v=g.retryQueue,v!==null&&(g.retryQueue=null,Mh(s,v))));break;case 19:Br(u,s),Pr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Mh(s,g)));break;case 30:break;case 21:break;default:Br(u,s),Pr(s)}}function Pr(s){var u=s.flags;if(u&2){try{for(var v,g=s.return;g!==null;){if(uE(g)){v=g;break}g=g.return}if(v==null)throw Error(r(160));switch(v.tag){case 27:var E=v.stateNode,k=Fg(s);Dh(s,k,E);break;case 5:var O=v.stateNode;v.flags&32&&(Oo(O,""),v.flags&=-33);var G=Fg(s);Dh(s,G,O);break;case 3:case 4:var Z=v.stateNode.containerInfo,fe=Fg(s);qg(s,fe,Z);break;default:throw Error(r(161))}}catch(we){qt(s,s.return,we)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function yE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;yE(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Bi(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)dE(s,u.alternate,u),u=u.sibling}function Hl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Ts(4,u,u.return),Hl(u);break;case 1:Za(u,u.return);var v=u.stateNode;typeof v.componentWillUnmount=="function"&&lE(u,u.return,v),Hl(u);break;case 27:of(u.stateNode);case 26:case 5:Za(u,u.return),Hl(u);break;case 22:u.memoizedState===null&&Hl(u);break;case 30:Hl(u);break;default:Hl(u)}s=s.sibling}}function Pi(s,u,v){for(v=v&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,E=s,k=u,O=k.flags;switch(k.tag){case 0:case 11:case 15:Pi(E,k,v),Wc(4,k);break;case 1:if(Pi(E,k,v),g=k,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(fe){qt(g,g.return,fe)}if(g=k,E=g.updateQueue,E!==null){var G=g.stateNode;try{var Z=E.shared.hiddenCallbacks;if(Z!==null)for(E.shared.hiddenCallbacks=null,E=0;E<Z.length;E++)XS(Z[E],G)}catch(fe){qt(g,g.return,fe)}}v&&O&64&&sE(k),Zc(k,k.return);break;case 27:cE(k);case 26:case 5:Pi(E,k,v),v&&g===null&&O&4&&oE(k),Zc(k,k.return);break;case 12:Pi(E,k,v);break;case 31:Pi(E,k,v),v&&O&4&&pE(E,k);break;case 13:Pi(E,k,v),v&&O&4&&mE(E,k);break;case 22:k.memoizedState===null&&Pi(E,k,v),Zc(k,k.return);break;case 30:break;default:Pi(E,k,v)}u=u.sibling}}function Vg(s,u){var v=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==v&&(s!=null&&s.refCount++,v!=null&&zc(v))}function Hg(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&zc(s))}function Ba(s,u,v,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)xE(s,u,v,g),u=u.sibling}function xE(s,u,v,g){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ba(s,u,v,g),E&2048&&Wc(9,u);break;case 1:Ba(s,u,v,g);break;case 3:Ba(s,u,v,g),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&zc(s)));break;case 12:if(E&2048){Ba(s,u,v,g),s=u.stateNode;try{var k=u.memoizedProps,O=k.id,G=k.onPostCommit;typeof G=="function"&&G(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){qt(u,u.return,Z)}}else Ba(s,u,v,g);break;case 31:Ba(s,u,v,g);break;case 13:Ba(s,u,v,g);break;case 23:break;case 22:k=u.stateNode,O=u.alternate,u.memoizedState!==null?k._visibility&2?Ba(s,u,v,g):Jc(s,u):k._visibility&2?Ba(s,u,v,g):(k._visibility|=2,Jo(s,u,v,g,(u.subtreeFlags&10256)!==0||!1)),E&2048&&Vg(O,u);break;case 24:Ba(s,u,v,g),E&2048&&Hg(u.alternate,u);break;default:Ba(s,u,v,g)}}function Jo(s,u,v,g,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,O=u,G=v,Z=g,fe=O.flags;switch(O.tag){case 0:case 11:case 15:Jo(k,O,G,Z,E),Wc(8,O);break;case 23:break;case 22:var we=O.stateNode;O.memoizedState!==null?we._visibility&2?Jo(k,O,G,Z,E):Jc(k,O):(we._visibility|=2,Jo(k,O,G,Z,E)),E&&fe&2048&&Vg(O.alternate,O);break;case 24:Jo(k,O,G,Z,E),E&&fe&2048&&Hg(O.alternate,O);break;default:Jo(k,O,G,Z,E)}u=u.sibling}}function Jc(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var v=s,g=u,E=g.flags;switch(g.tag){case 22:Jc(v,g),E&2048&&Vg(g.alternate,g);break;case 24:Jc(v,g),E&2048&&Hg(g.alternate,g);break;default:Jc(v,g)}u=u.sibling}}var ef=8192;function eu(s,u,v){if(s.subtreeFlags&ef)for(s=s.child;s!==null;)bE(s,u,v),s=s.sibling}function bE(s,u,v){switch(s.tag){case 26:eu(s,u,v),s.flags&ef&&s.memoizedState!==null&&n4(v,_a,s.memoizedState,s.memoizedProps);break;case 5:eu(s,u,v);break;case 3:case 4:var g=_a;_a=Gh(s.stateNode.containerInfo),eu(s,u,v),_a=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=ef,ef=16777216,eu(s,u,v),ef=g):eu(s,u,v));break;default:eu(s,u,v)}}function wE(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function tf(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Qn=g,EE(g,s)}wE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)SE(s),s=s.sibling}function SE(s){switch(s.tag){case 0:case 11:case 15:tf(s),s.flags&2048&&Ts(9,s,s.return);break;case 3:tf(s);break;case 12:tf(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Oh(s)):tf(s);break;default:tf(s)}}function Oh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Qn=g,EE(g,s)}wE(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Ts(8,u,u.return),Oh(u);break;case 22:v=u.stateNode,v._visibility&2&&(v._visibility&=-3,Oh(u));break;default:Oh(u)}s=s.sibling}}function EE(s,u){for(;Qn!==null;){var v=Qn;switch(v.tag){case 0:case 11:case 15:Ts(8,v,u);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var g=v.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:zc(v.memoizedState.cache)}if(g=v.child,g!==null)g.return=v,Qn=g;else e:for(v=s;Qn!==null;){g=Qn;var E=g.sibling,k=g.return;if(hE(g),g===v){Qn=null;break e}if(E!==null){E.return=k,Qn=E;break e}Qn=k}}}var g3={getCacheForType:function(s){var u=ar(An),v=u.data.get(s);return v===void 0&&(v=s(),u.data.set(s,v)),v},cacheSignal:function(){return ar(An).controller.signal}},y3=typeof WeakMap=="function"?WeakMap:Map,_t=0,Kt=null,wt=null,Nt=0,Ft=0,Jr=null,js=!1,tu=!1,$g=!1,zi=0,xn=0,As=0,$l=0,Gg=0,ea=0,nu=0,nf=null,zr=null,Kg=!1,Lh=0,CE=0,_h=1/0,Bh=null,Rs=null,Pn=0,Ds=null,ru=null,Ii=0,Yg=0,Xg=null,NE=null,rf=0,Qg=null;function ta(){return(_t&2)!==0&&Nt!==0?Nt&-Nt:I.T!==null?ny():vn()}function kE(){if(ea===0)if((Nt&536870912)===0||Tt){var s=qe;qe<<=1,(qe&3932160)===0&&(qe=262144),ea=s}else ea=536870912;return s=Wr.current,s!==null&&(s.flags|=32),ea}function Ir(s,u,v){(s===Kt&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(au(s,0),Ms(s,Nt,ea,!1)),Ut(s,v),((_t&2)===0||s!==Kt)&&(s===Kt&&((_t&2)===0&&($l|=v),xn===4&&Ms(s,Nt,ea,!1)),Ja(s))}function TE(s,u,v){if((_t&6)!==0)throw Error(r(327));var g=!v&&(u&127)===0&&(u&s.expiredLanes)===0||He(s,u),E=g?w3(s,u):Zg(s,u,!0),k=g;do{if(E===0){tu&&!g&&Ms(s,u,0,!1);break}else{if(v=s.current.alternate,k&&!x3(v)){E=Zg(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){u=O;e:{var G=s;E=nf;var Z=G.current.memoizedState.isDehydrated;if(Z&&(au(G,O).flags|=256),O=Zg(G,O,!1),O!==2){if($g&&!Z){G.errorRecoveryDisabledLanes|=k,$l|=k,E=4;break e}k=zr,zr=E,k!==null&&(zr===null?zr=k:zr.push.apply(zr,k))}E=O}if(k=!1,E!==2)continue}}if(E===1){au(s,0),Ms(s,u,0,!0);break}e:{switch(g=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Ms(g,u,ea,!js);break e;case 2:zr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=Lh+300-ze(),10<E)){if(Ms(g,u,ea,!js),ct(g,0,!0)!==0)break e;Ii=u,g.timeoutHandle=aC(jE.bind(null,g,v,zr,Bh,Kg,u,ea,$l,nu,js,k,"Throttled",-0,0),E);break e}jE(g,v,zr,Bh,Kg,u,ea,$l,nu,js,k,null,-0,0)}}break}while(!0);Ja(s)}function jE(s,u,v,g,E,k,O,G,Z,fe,we,Ee,ve,me){if(s.timeoutHandle=-1,Ee=u.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ci},bE(u,k,Ee);var $e=(k&62914560)===k?Lh-ze():(k&4194048)===k?CE-ze():0;if($e=r4(Ee,$e),$e!==null){Ii=k,s.cancelPendingCommit=$e(BE.bind(null,s,u,k,v,g,E,O,G,Z,we,Ee,null,ve,me)),Ms(s,k,O,!fe);return}}BE(s,u,k,v,g,E,O,G,Z)}function x3(s){for(var u=s;;){var v=u.tag;if((v===0||v===11||v===15)&&u.flags&16384&&(v=u.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var g=0;g<v.length;g++){var E=v[g],k=E.getSnapshot;E=E.value;try{if(!Xr(k(),E))return!1}catch{return!1}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ms(s,u,v,g){u&=~Gg,u&=~$l,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var E=u;0<E;){var k=31-de(E),O=1<<k;g[k]=-1,E&=~O}v!==0&&hn(s,v,u)}function Ph(){return(_t&6)===0?(af(0),!1):!0}function Wg(){if(wt!==null){if(Ft===0)var s=wt.return;else s=wt,ji=Bl=null,hg(s),Yo=null,Fc=0,s=wt;for(;s!==null;)iE(s.alternate,s),s=s.return;wt=null}}function au(s,u){var v=s.timeoutHandle;v!==-1&&(s.timeoutHandle=-1,I3(v)),v=s.cancelPendingCommit,v!==null&&(s.cancelPendingCommit=null,v()),Ii=0,Wg(),Kt=s,wt=v=ki(s.current,null),Nt=u,Ft=0,Jr=null,js=!1,tu=He(s,u),$g=!1,nu=ea=Gg=$l=As=xn=0,zr=nf=null,Kg=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var E=31-de(g),k=1<<E;u|=s[E],g&=~k}return zi=u,ah(),v}function AE(s,u){ht=null,I.H=Yc,u===Ko||u===dh?(u=$S(),Ft=3):u===tg?(u=$S(),Ft=4):Ft=u===Ag?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Jr=u,wt===null&&(xn=1,kh(s,ma(u,s.current)))}function RE(){var s=Wr.current;return s===null?!0:(Nt&4194048)===Nt?ba===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===ba:!1}function DE(){var s=I.H;return I.H=Yc,s===null?Yc:s}function ME(){var s=I.A;return I.A=g3,s}function zh(){xn=4,js||(Nt&4194048)!==Nt&&Wr.current!==null||(tu=!0),(As&134217727)===0&&($l&134217727)===0||Kt===null||Ms(Kt,Nt,ea,!1)}function Zg(s,u,v){var g=_t;_t|=2;var E=DE(),k=ME();(Kt!==s||Nt!==u)&&(Bh=null,au(s,u)),u=!1;var O=xn;e:do try{if(Ft!==0&&wt!==null){var G=wt,Z=Jr;switch(Ft){case 8:Wg(),O=6;break e;case 3:case 2:case 9:case 6:Wr.current===null&&(u=!0);var fe=Ft;if(Ft=0,Jr=null,iu(s,G,Z,fe),v&&tu){O=0;break e}break;default:fe=Ft,Ft=0,Jr=null,iu(s,G,Z,fe)}}b3(),O=xn;break}catch(we){AE(s,we)}while(!0);return u&&s.shellSuspendCounter++,ji=Bl=null,_t=g,I.H=E,I.A=k,wt===null&&(Kt=null,Nt=0,ah()),O}function b3(){for(;wt!==null;)OE(wt)}function w3(s,u){var v=_t;_t|=2;var g=DE(),E=ME();Kt!==s||Nt!==u?(Bh=null,_h=ze()+500,au(s,u)):tu=He(s,u);e:do try{if(Ft!==0&&wt!==null){u=wt;var k=Jr;t:switch(Ft){case 1:Ft=0,Jr=null,iu(s,u,k,1);break;case 2:case 9:if(VS(k)){Ft=0,Jr=null,LE(u);break}u=function(){Ft!==2&&Ft!==9||Kt!==s||(Ft=7),Ja(s)},k.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:VS(k)?(Ft=0,Jr=null,LE(u)):(Ft=0,Jr=null,iu(s,u,k,7));break;case 5:var O=null;switch(wt.tag){case 26:O=wt.memoizedState;case 5:case 27:var G=wt;if(O?xC(O):G.stateNode.complete){Ft=0,Jr=null;var Z=G.sibling;if(Z!==null)wt=Z;else{var fe=G.return;fe!==null?(wt=fe,Ih(fe)):wt=null}break t}}Ft=0,Jr=null,iu(s,u,k,5);break;case 6:Ft=0,Jr=null,iu(s,u,k,6);break;case 8:Wg(),xn=6;break e;default:throw Error(r(462))}}S3();break}catch(we){AE(s,we)}while(!0);return ji=Bl=null,I.H=g,I.A=E,_t=v,wt!==null?0:(Kt=null,Nt=0,ah(),xn)}function S3(){for(;wt!==null&&!Xe();)OE(wt)}function OE(s){var u=rE(s.alternate,s,zi);s.memoizedProps=s.pendingProps,u===null?Ih(s):wt=u}function LE(s){var u=s,v=u.alternate;switch(u.tag){case 15:case 0:u=W2(v,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=W2(v,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:hg(u);default:iE(v,u),u=wt=MS(u,zi),u=rE(v,u,zi)}s.memoizedProps=s.pendingProps,u===null?Ih(s):wt=u}function iu(s,u,v,g){ji=Bl=null,hg(u),Yo=null,Fc=0;var E=u.return;try{if(c3(s,E,u,v,Nt)){xn=1,kh(s,ma(v,s.current)),wt=null;return}}catch(k){if(E!==null)throw wt=E,k;xn=1,kh(s,ma(v,s.current)),wt=null;return}u.flags&32768?(Tt||g===1?s=!0:tu||(Nt&536870912)!==0?s=!1:(js=s=!0,(g===2||g===9||g===3||g===6)&&(g=Wr.current,g!==null&&g.tag===13&&(g.flags|=16384))),_E(u,s)):Ih(u)}function Ih(s){var u=s;do{if((u.flags&32768)!==0){_E(u,js);return}s=u.return;var v=h3(u.alternate,u,zi);if(v!==null){wt=v;return}if(u=u.sibling,u!==null){wt=u;return}wt=u=s}while(u!==null);xn===0&&(xn=5)}function _E(s,u){do{var v=v3(s.alternate,s);if(v!==null){v.flags&=32767,wt=v;return}if(v=s.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!u&&(s=s.sibling,s!==null)){wt=s;return}wt=s=v}while(s!==null);xn=6,wt=null}function BE(s,u,v,g,E,k,O,G,Z){s.cancelPendingCommit=null;do Fh();while(Pn!==0);if((_t&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Fm,nr(s,v,k,O,G,Z),s===Kt&&(wt=Kt=null,Nt=0),ru=u,Ds=s,Ii=v,Yg=k,Xg=E,NE=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,k3(De,function(){return qE(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=I.T,I.T=null,E=U.p,U.p=2,O=_t,_t|=4;try{p3(s,u,v)}finally{_t=O,U.p=E,I.T=g}}Pn=1,PE(),zE(),IE()}}function PE(){if(Pn===1){Pn=0;var s=Ds,u=ru,v=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||v){v=I.T,I.T=null;var g=U.p;U.p=2;var E=_t;_t|=4;try{gE(u,s);var k=cy,O=ES(s.containerInfo),G=k.focusedElem,Z=k.selectionRange;if(O!==G&&G&&G.ownerDocument&&SS(G.ownerDocument.documentElement,G)){if(Z!==null&&_m(G)){var fe=Z.start,we=Z.end;if(we===void 0&&(we=fe),"selectionStart"in G)G.selectionStart=fe,G.selectionEnd=Math.min(we,G.value.length);else{var Ee=G.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var me=ve.getSelection(),$e=G.textContent.length,it=Math.min(Z.start,$e),$t=Z.end===void 0?it:Math.min(Z.end,$e);!me.extend&&it>$t&&(O=$t,$t=it,it=O);var le=wS(G,it),te=wS(G,$t);if(le&&te&&(me.rangeCount!==1||me.anchorNode!==le.node||me.anchorOffset!==le.offset||me.focusNode!==te.node||me.focusOffset!==te.offset)){var ce=Ee.createRange();ce.setStart(le.node,le.offset),me.removeAllRanges(),it>$t?(me.addRange(ce),me.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),me.addRange(ce))}}}}for(Ee=[],me=G;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<Ee.length;G++){var Se=Ee[G];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Zh=!!uy,cy=uy=null}finally{_t=E,U.p=g,I.T=v}}s.current=u,Pn=2}}function zE(){if(Pn===2){Pn=0;var s=Ds,u=ru,v=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||v){v=I.T,I.T=null;var g=U.p;U.p=2;var E=_t;_t|=4;try{dE(s,u.alternate,u)}finally{_t=E,U.p=g,I.T=v}}Pn=3}}function IE(){if(Pn===4||Pn===3){Pn=0,st();var s=Ds,u=ru,v=Ii,g=NE;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Pn=5:(Pn=0,ru=Ds=null,FE(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(Rs=null),fa(v),u=u.stateNode,oe&&typeof oe.onCommitFiberRoot=="function")try{oe.onCommitFiberRoot(K,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=I.T,E=U.p,U.p=2,I.T=null;try{for(var k=s.onRecoverableError,O=0;O<g.length;O++){var G=g[O];k(G.value,{componentStack:G.stack})}}finally{I.T=u,U.p=E}}(Ii&3)!==0&&Fh(),Ja(s),E=s.pendingLanes,(v&261930)!==0&&(E&42)!==0?s===Qg?rf++:(rf=0,Qg=s):rf=0,af(0)}}function FE(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,zc(u)))}function Fh(){return PE(),zE(),IE(),qE()}function qE(){if(Pn!==5)return!1;var s=Ds,u=Yg;Yg=0;var v=fa(Ii),g=I.T,E=U.p;try{U.p=32>v?32:v,I.T=null,v=Xg,Xg=null;var k=Ds,O=Ii;if(Pn=0,ru=Ds=null,Ii=0,(_t&6)!==0)throw Error(r(331));var G=_t;if(_t|=4,SE(k.current),xE(k,k.current,O,v),_t=G,af(0,!1),oe&&typeof oe.onPostCommitFiberRoot=="function")try{oe.onPostCommitFiberRoot(K,k)}catch{}return!0}finally{U.p=E,I.T=g,FE(s,u)}}function UE(s,u,v){u=ma(v,u),u=jg(s.stateNode,u,2),s=Cs(s,u,2),s!==null&&(Ut(s,2),Ja(s))}function qt(s,u,v){if(s.tag===3)UE(s,s,v);else for(;u!==null;){if(u.tag===3){UE(u,s,v);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Rs===null||!Rs.has(g))){s=ma(v,s),v=V2(2),g=Cs(u,v,2),g!==null&&(H2(v,g,u,s),Ut(g,2),Ja(g));break}}u=u.return}}function Jg(s,u,v){var g=s.pingCache;if(g===null){g=s.pingCache=new y3;var E=new Set;g.set(u,E)}else E=g.get(u),E===void 0&&(E=new Set,g.set(u,E));E.has(v)||($g=!0,E.add(v),s=E3.bind(null,s,u,v),u.then(s,s))}function E3(s,u,v){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&v,s.warmLanes&=~v,Kt===s&&(Nt&v)===v&&(xn===4||xn===3&&(Nt&62914560)===Nt&&300>ze()-Lh?(_t&2)===0&&au(s,0):Gg|=v,nu===Nt&&(nu=0)),Ja(s)}function VE(s,u){u===0&&(u=vt()),s=Ol(s,u),s!==null&&(Ut(s,u),Ja(s))}function C3(s){var u=s.memoizedState,v=0;u!==null&&(v=u.retryLane),VE(s,v)}function N3(s,u){var v=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(v=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),VE(s,v)}function k3(s,u){return Re(s,u)}var qh=null,su=null,ey=!1,Uh=!1,ty=!1,Os=0;function Ja(s){s!==su&&s.next===null&&(su===null?qh=su=s:su=su.next=s),Uh=!0,ey||(ey=!0,j3())}function af(s,u){if(!ty&&Uh){ty=!0;do for(var v=!1,g=qh;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var k=0;else{var O=g.suspendedLanes,G=g.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=E&~(O&~G),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(v=!0,KE(g,k))}else k=Nt,k=ct(g,g===Kt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||He(g,k)||(v=!0,KE(g,k));g=g.next}while(v);ty=!1}}function T3(){HE()}function HE(){Uh=ey=!1;var s=0;Os!==0&&z3()&&(s=Os);for(var u=ze(),v=null,g=qh;g!==null;){var E=g.next,k=$E(g,u);k===0?(g.next=null,v===null?qh=E:v.next=E,E===null&&(su=v)):(v=g,(s!==0||(k&3)!==0)&&(Uh=!0)),g=E}Pn!==0&&Pn!==5||af(s),Os!==0&&(Os=0)}function $E(s,u){for(var v=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var O=31-de(k),G=1<<O,Z=E[O];Z===-1?((G&v)===0||(G&g)!==0)&&(E[O]=xt(G,u)):Z<=u&&(s.expiredLanes|=G),k&=~G}if(u=Kt,v=Nt,v=ct(s,s===u?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,v===0||s===u&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ke(g),s.callbackNode=null,s.callbackPriority=0;if((v&3)===0||He(s,v)){if(u=v&-v,u===s.callbackPriority)return u;switch(g!==null&&Ke(g),fa(v)){case 2:case 8:v=Ce;break;case 32:v=De;break;case 268435456:v=Me;break;default:v=De}return g=GE.bind(null,s),v=Re(v,g),s.callbackPriority=u,s.callbackNode=v,u}return g!==null&&g!==null&&Ke(g),s.callbackPriority=2,s.callbackNode=null,2}function GE(s,u){if(Pn!==0&&Pn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var v=s.callbackNode;if(Fh()&&s.callbackNode!==v)return null;var g=Nt;return g=ct(s,s===Kt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(TE(s,g,u),$E(s,ze()),s.callbackNode!=null&&s.callbackNode===v?GE.bind(null,s):null)}function KE(s,u){if(Fh())return null;TE(s,u,!0)}function j3(){F3(function(){(_t&6)!==0?Re(he,T3):HE()})}function ny(){if(Os===0){var s=$o;s===0&&(s=Ge,Ge<<=1,(Ge&261888)===0&&(Ge=256)),Os=s}return Os}function YE(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Qd(""+s)}function XE(s,u){var v=u.ownerDocument.createElement("input");return v.name=u.name,v.value=u.value,s.id&&v.setAttribute("form",s.id),u.parentNode.insertBefore(v,u),s=new FormData(s),v.parentNode.removeChild(v),s}function A3(s,u,v,g,E){if(u==="submit"&&v&&v.stateNode===E){var k=YE((E[Bn]||null).action),O=g.submitter;O&&(u=(u=O[Bn]||null)?YE(u.formAction):O.getAttribute("formAction"),u!==null&&(k=u,O=null));var G=new eh("action","action",null,g,E);s.push({event:G,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Os!==0){var Z=O?XE(E,O):new FormData(E);Sg(v,{pending:!0,data:Z,method:E.method,action:k},null,Z)}}else typeof k=="function"&&(G.preventDefault(),Z=O?XE(E,O):new FormData(E),Sg(v,{pending:!0,data:Z,method:E.method,action:k},k,Z))},currentTarget:E}]})}}for(var ry=0;ry<Im.length;ry++){var ay=Im[ry],R3=ay.toLowerCase(),D3=ay[0].toUpperCase()+ay.slice(1);La(R3,"on"+D3)}La(kS,"onAnimationEnd"),La(TS,"onAnimationIteration"),La(jS,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(K5,"onTransitionRun"),La(Y5,"onTransitionStart"),La(X5,"onTransitionCancel"),La(AS,"onTransitionEnd"),Xa("onMouseEnter",["mouseout","mouseover"]),Xa("onMouseLeave",["mouseout","mouseover"]),Xa("onPointerEnter",["pointerout","pointerover"]),Xa("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),M3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sf));function QE(s,u){u=(u&4)!==0;for(var v=0;v<s.length;v++){var g=s[v],E=g.event;g=g.listeners;e:{var k=void 0;if(u)for(var O=g.length-1;0<=O;O--){var G=g[O],Z=G.instance,fe=G.currentTarget;if(G=G.listener,Z!==k&&E.isPropagationStopped())break e;k=G,E.currentTarget=fe;try{k(E)}catch(we){rh(we)}E.currentTarget=null,k=Z}else for(O=0;O<g.length;O++){if(G=g[O],Z=G.instance,fe=G.currentTarget,G=G.listener,Z!==k&&E.isPropagationStopped())break e;k=G,E.currentTarget=fe;try{k(E)}catch(we){rh(we)}E.currentTarget=null,k=Z}}}}function St(s,u){var v=u[Gn];v===void 0&&(v=u[Gn]=new Set);var g=s+"__bubble";v.has(g)||(WE(u,s,2,!1),v.add(g))}function iy(s,u,v){var g=0;u&&(g|=4),WE(v,s,g,u)}var Vh="_reactListening"+Math.random().toString(36).slice(2);function sy(s){if(!s[Vh]){s[Vh]=!0,$d.forEach(function(v){v!=="selectionchange"&&(M3.has(v)||iy(v,!1,s),iy(v,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Vh]||(u[Vh]=!0,iy("selectionchange",!1,u))}}function WE(s,u,v,g){switch(kC(u)){case 2:var E=s4;break;case 8:E=l4;break;default:E=wy}v=E.bind(null,u,v,s),E=void 0,!km||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(u,v,{capture:!0,passive:E}):s.addEventListener(u,v,!0):E!==void 0?s.addEventListener(u,v,{passive:E}):s.addEventListener(u,v,!1)}function ly(s,u,v,g,E){var k=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var G=g.stateNode.containerInfo;if(G===E)break;if(O===4)for(O=g.return;O!==null;){var Z=O.tag;if((Z===3||Z===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;G!==null;){if(O=hs(G),O===null)return;if(Z=O.tag,Z===5||Z===6||Z===26||Z===27){g=k=O;continue e}G=G.parentNode}}g=g.return}nS(function(){var fe=k,we=Cm(v),Ee=[];e:{var ve=RS.get(s);if(ve!==void 0){var me=eh,$e=s;switch(s){case"keypress":if(Zd(v)===0)break e;case"keydown":case"keyup":me=N5;break;case"focusin":$e="focus",me=Rm;break;case"focusout":$e="blur",me=Rm;break;case"beforeblur":case"afterblur":me=Rm;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=iS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=h5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=j5;break;case kS:case TS:case jS:me=m5;break;case AS:me=R5;break;case"scroll":case"scrollend":me=f5;break;case"wheel":me=M5;break;case"copy":case"cut":case"paste":me=y5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=lS;break;case"toggle":case"beforetoggle":me=L5}var it=(u&4)!==0,$t=!it&&(s==="scroll"||s==="scrollend"),le=it?ve!==null?ve+"Capture":null:ve;it=[];for(var te=fe,ce;te!==null;){var Se=te;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=Tc(te,le),Se!=null&&it.push(lf(te,Se,ce))),$t)break;te=te.return}0<it.length&&(ve=new me(ve,$e,null,v,we),Ee.push({event:ve,listeners:it}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&v!==Em&&($e=v.relatedTarget||v.fromElement)&&(hs($e)||$e[Mr]))break e;if((me||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?($e=v.relatedTarget||v.toElement,me=fe,$e=$e?hs($e):null,$e!==null&&($t=i($e),it=$e.tag,$e!==$t||it!==5&&it!==27&&it!==6)&&($e=null)):(me=null,$e=fe),me!==$e)){if(it=iS,Se="onMouseLeave",le="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(it=lS,Se="onPointerLeave",le="onPointerEnter",te="pointer"),$t=me==null?ve:Al(me),ce=$e==null?ve:Al($e),ve=new it(Se,te+"leave",me,v,we),ve.target=$t,ve.relatedTarget=ce,Se=null,hs(we)===fe&&(it=new it(le,te+"enter",$e,v,we),it.target=ce,it.relatedTarget=$t,Se=it),$t=Se,me&&$e)t:{for(it=O3,le=me,te=$e,ce=0,Se=le;Se;Se=it(Se))ce++;Se=0;for(var nt=te;nt;nt=it(nt))Se++;for(;0<ce-Se;)le=it(le),ce--;for(;0<Se-ce;)te=it(te),Se--;for(;ce--;){if(le===te||te!==null&&le===te.alternate){it=le;break t}le=it(le),te=it(te)}it=null}else it=null;me!==null&&ZE(Ee,ve,me,it,!1),$e!==null&&$t!==null&&ZE(Ee,$t,$e,it,!0)}}e:{if(ve=fe?Al(fe):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var Mt=pS;else if(hS(ve))if(mS)Mt=H5;else{Mt=U5;var Ye=q5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?fe&&Sm(fe.elementType)&&(Mt=pS):Mt=V5;if(Mt&&(Mt=Mt(s,fe))){vS(Ee,Mt,v,we);break e}Ye&&Ye(s,ve,fe),s==="focusout"&&fe&&ve.type==="number"&&fe.memoizedProps.value!=null&&wm(ve,"number",ve.value)}switch(Ye=fe?Al(fe):window,s){case"focusin":(hS(Ye)||Ye.contentEditable==="true")&&(Po=Ye,Bm=fe,_c=null);break;case"focusout":_c=Bm=Po=null;break;case"mousedown":Pm=!0;break;case"contextmenu":case"mouseup":case"dragend":Pm=!1,CS(Ee,v,we);break;case"selectionchange":if(G5)break;case"keydown":case"keyup":CS(Ee,v,we)}var pt;if(Mm)e:{switch(s){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Bo?fS(s,v)&&(kt="onCompositionEnd"):s==="keydown"&&v.keyCode===229&&(kt="onCompositionStart");kt&&(oS&&v.locale!=="ko"&&(Bo||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Bo&&(pt=rS()):(gs=we,Tm="value"in gs?gs.value:gs.textContent,Bo=!0)),Ye=Hh(fe,kt),0<Ye.length&&(kt=new sS(kt,s,null,v,we),Ee.push({event:kt,listeners:Ye}),pt?kt.data=pt:(pt=dS(v),pt!==null&&(kt.data=pt)))),(pt=B5?P5(s,v):z5(s,v))&&(kt=Hh(fe,"onBeforeInput"),0<kt.length&&(Ye=new sS("onBeforeInput","beforeinput",null,v,we),Ee.push({event:Ye,listeners:kt}),Ye.data=pt)),A3(Ee,s,fe,v,we)}QE(Ee,u)})}function lf(s,u,v){return{instance:s,listener:u,currentTarget:v}}function Hh(s,u){for(var v=u+"Capture",g=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=Tc(s,v),E!=null&&g.unshift(lf(s,E,k)),E=Tc(s,u),E!=null&&g.push(lf(s,E,k))),s.tag===3)return g;s=s.return}return[]}function O3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function ZE(s,u,v,g,E){for(var k=u._reactName,O=[];v!==null&&v!==g;){var G=v,Z=G.alternate,fe=G.stateNode;if(G=G.tag,Z!==null&&Z===g)break;G!==5&&G!==26&&G!==27||fe===null||(Z=fe,E?(fe=Tc(v,k),fe!=null&&O.unshift(lf(v,fe,Z))):E||(fe=Tc(v,k),fe!=null&&O.push(lf(v,fe,Z)))),v=v.return}O.length!==0&&s.push({event:u,listeners:O})}var L3=/\r\n?/g,_3=/\u0000|\uFFFD/g;function JE(s){return(typeof s=="string"?s:""+s).replace(L3,`
49
+ `).replace(_3,"")}function eC(s,u){return u=JE(u),JE(s)===u}function Ht(s,u,v,g,E,k){switch(v){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Oo(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Oo(s,""+g);break;case"className":ms(s,"class",g);break;case"tabIndex":ms(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":ms(s,v,g);break;case"style":eS(s,g,k);break;case"data":if(u!=="object"){ms(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||v!=="href")){s.removeAttribute(v);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=Qd(""+g),s.setAttribute(v,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(v,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(v==="formAction"?(u!=="input"&&Ht(s,u,"name",E.name,E,null),Ht(s,u,"formEncType",E.formEncType,E,null),Ht(s,u,"formMethod",E.formMethod,E,null),Ht(s,u,"formTarget",E.formTarget,E,null)):(Ht(s,u,"encType",E.encType,E,null),Ht(s,u,"method",E.method,E,null),Ht(s,u,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=Qd(""+g),s.setAttribute(v,g);break;case"onClick":g!=null&&(s.onclick=Ci);break;case"onScroll":g!=null&&St("scroll",s);break;case"onScrollEnd":g!=null&&St("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}v=Qd(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""+g):s.removeAttribute(v);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""):s.removeAttribute(v);break;case"capture":case"download":g===!0?s.setAttribute(v,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,g):s.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(v,g):s.removeAttribute(v);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(v):s.setAttribute(v,g);break;case"popover":St("beforetoggle",s),St("toggle",s),hr(s,"popover",g);break;case"xlinkActuate":ha(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":ha(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":ha(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":ha(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":ha(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":ha(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":ha(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":ha(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":ha(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":hr(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=u5.get(v)||v,hr(s,v,g))}}function oy(s,u,v,g,E,k){switch(v){case"style":eS(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"children":typeof g=="string"?Oo(s,g):(typeof g=="number"||typeof g=="bigint")&&Oo(s,""+g);break;case"onScroll":g!=null&&St("scroll",s);break;case"onScrollEnd":g!=null&&St("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gd.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(E=v.endsWith("Capture"),u=v.slice(2,E?v.length-7:void 0),k=s[Bn]||null,k=k!=null?k[v]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof g=="function")){typeof k!="function"&&k!==null&&(v in s?s[v]=null:s.hasAttribute(v)&&s.removeAttribute(v)),s.addEventListener(u,g,E);break e}v in s?s[v]=g:g===!0?s.setAttribute(v,""):hr(s,v,g)}}}function sr(s,u,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",s),St("load",s);var g=!1,E=!1,k;for(k in v)if(v.hasOwnProperty(k)){var O=v[k];if(O!=null)switch(k){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,k,O,v,null)}}E&&Ht(s,u,"srcSet",v.srcSet,v,null),g&&Ht(s,u,"src",v.src,v,null);return;case"input":St("invalid",s);var G=k=O=E=null,Z=null,fe=null;for(g in v)if(v.hasOwnProperty(g)){var we=v[g];if(we!=null)switch(g){case"name":E=we;break;case"type":O=we;break;case"checked":Z=we;break;case"defaultChecked":fe=we;break;case"value":k=we;break;case"defaultValue":G=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,u));break;default:Ht(s,u,g,we,v,null)}}Qw(s,k,G,Z,fe,O,E,!1);return;case"select":St("invalid",s),g=O=k=null;for(E in v)if(v.hasOwnProperty(E)&&(G=v[E],G!=null))switch(E){case"value":k=G;break;case"defaultValue":O=G;break;case"multiple":g=G;default:Ht(s,u,E,G,v,null)}u=k,v=O,s.multiple=!!g,u!=null?Mo(s,!!g,u,!1):v!=null&&Mo(s,!!g,v,!0);return;case"textarea":St("invalid",s),k=E=g=null;for(O in v)if(v.hasOwnProperty(O)&&(G=v[O],G!=null))switch(O){case"value":g=G;break;case"defaultValue":E=G;break;case"children":k=G;break;case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(91));break;default:Ht(s,u,O,G,v,null)}Zw(s,g,E,k);return;case"option":for(Z in v)if(v.hasOwnProperty(Z)&&(g=v[Z],g!=null))switch(Z){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ht(s,u,Z,g,v,null)}return;case"dialog":St("beforetoggle",s),St("toggle",s),St("cancel",s),St("close",s);break;case"iframe":case"object":St("load",s);break;case"video":case"audio":for(g=0;g<sf.length;g++)St(sf[g],s);break;case"image":St("error",s),St("load",s);break;case"details":St("toggle",s);break;case"embed":case"source":case"link":St("error",s),St("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in v)if(v.hasOwnProperty(fe)&&(g=v[fe],g!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,fe,g,v,null)}return;default:if(Sm(u)){for(we in v)v.hasOwnProperty(we)&&(g=v[we],g!==void 0&&oy(s,u,we,g,v,void 0));return}}for(G in v)v.hasOwnProperty(G)&&(g=v[G],g!=null&&Ht(s,u,G,g,v,null))}function B3(s,u,v,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,O=null,G=null,Z=null,fe=null,we=null;for(me in v){var Ee=v[me];if(v.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Z=Ee;default:g.hasOwnProperty(me)||Ht(s,u,me,null,g,Ee)}}for(var ve in g){var me=g[ve];if(Ee=v[ve],g.hasOwnProperty(ve)&&(me!=null||Ee!=null))switch(ve){case"type":k=me;break;case"name":E=me;break;case"checked":fe=me;break;case"defaultChecked":we=me;break;case"value":O=me;break;case"defaultValue":G=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==Ee&&Ht(s,u,ve,me,g,Ee)}}bm(s,O,G,Z,fe,we,k,E);return;case"select":me=O=G=ve=null;for(k in v)if(Z=v[k],v.hasOwnProperty(k)&&Z!=null)switch(k){case"value":break;case"multiple":me=Z;default:g.hasOwnProperty(k)||Ht(s,u,k,null,g,Z)}for(E in g)if(k=g[E],Z=v[E],g.hasOwnProperty(E)&&(k!=null||Z!=null))switch(E){case"value":ve=k;break;case"defaultValue":G=k;break;case"multiple":O=k;default:k!==Z&&Ht(s,u,E,k,g,Z)}u=G,v=O,g=me,ve!=null?Mo(s,!!v,ve,!1):!!g!=!!v&&(u!=null?Mo(s,!!v,u,!0):Mo(s,!!v,v?[]:"",!1));return;case"textarea":me=ve=null;for(G in v)if(E=v[G],v.hasOwnProperty(G)&&E!=null&&!g.hasOwnProperty(G))switch(G){case"value":break;case"children":break;default:Ht(s,u,G,null,g,E)}for(O in g)if(E=g[O],k=v[O],g.hasOwnProperty(O)&&(E!=null||k!=null))switch(O){case"value":ve=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&Ht(s,u,O,E,g,k)}Ww(s,ve,me);return;case"option":for(var $e in v)if(ve=v[$e],v.hasOwnProperty($e)&&ve!=null&&!g.hasOwnProperty($e))switch($e){case"selected":s.selected=!1;break;default:Ht(s,u,$e,null,g,ve)}for(Z in g)if(ve=g[Z],me=v[Z],g.hasOwnProperty(Z)&&ve!==me&&(ve!=null||me!=null))switch(Z){case"selected":s.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Ht(s,u,Z,ve,g,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in v)ve=v[it],v.hasOwnProperty(it)&&ve!=null&&!g.hasOwnProperty(it)&&Ht(s,u,it,null,g,ve);for(fe in g)if(ve=g[fe],me=v[fe],g.hasOwnProperty(fe)&&ve!==me&&(ve!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Ht(s,u,fe,ve,g,me)}return;default:if(Sm(u)){for(var $t in v)ve=v[$t],v.hasOwnProperty($t)&&ve!==void 0&&!g.hasOwnProperty($t)&&oy(s,u,$t,void 0,g,ve);for(we in g)ve=g[we],me=v[we],!g.hasOwnProperty(we)||ve===me||ve===void 0&&me===void 0||oy(s,u,we,ve,g,me);return}}for(var le in v)ve=v[le],v.hasOwnProperty(le)&&ve!=null&&!g.hasOwnProperty(le)&&Ht(s,u,le,null,g,ve);for(Ee in g)ve=g[Ee],me=v[Ee],!g.hasOwnProperty(Ee)||ve===me||ve==null&&me==null||Ht(s,u,Ee,ve,g,me)}function tC(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function P3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,v=performance.getEntriesByType("resource"),g=0;g<v.length;g++){var E=v[g],k=E.transferSize,O=E.initiatorType,G=E.duration;if(k&&G&&tC(O)){for(O=0,G=E.responseEnd,g+=1;g<v.length;g++){var Z=v[g],fe=Z.startTime;if(fe>G)break;var we=Z.transferSize,Ee=Z.initiatorType;we&&tC(Ee)&&(Z=Z.responseEnd,O+=we*(Z<G?1:(G-fe)/(Z-fe)))}if(--g,u+=8*(k+O)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var uy=null,cy=null;function $h(s){return s.nodeType===9?s:s.ownerDocument}function nC(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rC(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function fy(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var dy=null;function z3(){var s=window.event;return s&&s.type==="popstate"?s===dy?!1:(dy=s,!0):(dy=null,!1)}var aC=typeof setTimeout=="function"?setTimeout:void 0,I3=typeof clearTimeout=="function"?clearTimeout:void 0,iC=typeof Promise=="function"?Promise:void 0,F3=typeof queueMicrotask=="function"?queueMicrotask:typeof iC<"u"?function(s){return iC.resolve(null).then(s).catch(q3)}:aC;function q3(s){setTimeout(function(){throw s})}function Ls(s){return s==="head"}function sC(s,u){var v=u,g=0;do{var E=v.nextSibling;if(s.removeChild(v),E&&E.nodeType===8)if(v=E.data,v==="/$"||v==="/&"){if(g===0){s.removeChild(E),cu(u);return}g--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")g++;else if(v==="html")of(s.ownerDocument.documentElement);else if(v==="head"){v=s.ownerDocument.head,of(v);for(var k=v.firstChild;k;){var O=k.nextSibling,G=k.nodeName;k[Yn]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&k.rel.toLowerCase()==="stylesheet"||v.removeChild(k),k=O}}else v==="body"&&of(s.ownerDocument.body);v=E}while(v);cu(u)}function lC(s,u){var v=s;s=0;do{var g=v.nextSibling;if(v.nodeType===1?u?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(u?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),g&&g.nodeType===8)if(v=g.data,v==="/$"){if(s===0)break;s--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||s++;v=g}while(v)}function hy(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var v=u;switch(u=u.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":hy(v),Ro(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}s.removeChild(v)}}function U3(s,u,v,g){for(;s.nodeType===1;){var E=v;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Yn])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=wa(s.nextSibling),s===null)break}return null}function V3(s,u,v){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!v||(s=wa(s.nextSibling),s===null))return null;return s}function oC(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=wa(s.nextSibling),s===null))return null;return s}function vy(s){return s.data==="$?"||s.data==="$~"}function py(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function H3(s,u){var v=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||v.readyState!=="loading")u();else{var g=function(){u(),v.removeEventListener("DOMContentLoaded",g)};v.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function wa(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var my=null;function uC(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="/$"||v==="/&"){if(u===0)return wa(s.nextSibling);u--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||u++}s=s.nextSibling}return null}function cC(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(u===0)return s;u--}else v!=="/$"&&v!=="/&"||u++}s=s.previousSibling}return null}function fC(s,u,v){switch(u=$h(v),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function of(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Ro(s)}var Sa=new Map,dC=new Set;function Gh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Fi=U.d;U.d={f:$3,r:G3,D:K3,C:Y3,L:X3,m:Q3,X:Z3,S:W3,M:J3};function $3(){var s=Fi.f(),u=Ph();return s||u}function G3(s){var u=vs(s);u!==null&&u.tag===5&&u.type==="form"?A2(u):Fi.r(s)}var lu=typeof document>"u"?null:document;function hC(s,u,v){var g=lu;if(g&&typeof u=="string"&&u){var E=va(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof v=="string"&&(E+='[crossorigin="'+v+'"]'),dC.has(E)||(dC.add(E),s={rel:s,crossOrigin:v,href:u},g.querySelector(E)===null&&(u=g.createElement("link"),sr(u,"link",s),jn(u),g.head.appendChild(u)))}}function K3(s){Fi.D(s),hC("dns-prefetch",s,null)}function Y3(s,u){Fi.C(s,u),hC("preconnect",s,u)}function X3(s,u,v){Fi.L(s,u,v);var g=lu;if(g&&s&&u){var E='link[rel="preload"][as="'+va(u)+'"]';u==="image"&&v&&v.imageSrcSet?(E+='[imagesrcset="'+va(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(E+='[imagesizes="'+va(v.imageSizes)+'"]')):E+='[href="'+va(s)+'"]';var k=E;switch(u){case"style":k=ou(s);break;case"script":k=uu(s)}Sa.has(k)||(s=p({rel:"preload",href:u==="image"&&v&&v.imageSrcSet?void 0:s,as:u},v),Sa.set(k,s),g.querySelector(E)!==null||u==="style"&&g.querySelector(uf(k))||u==="script"&&g.querySelector(cf(k))||(u=g.createElement("link"),sr(u,"link",s),jn(u),g.head.appendChild(u)))}}function Q3(s,u){Fi.m(s,u);var v=lu;if(v&&s){var g=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+va(g)+'"][href="'+va(s)+'"]',k=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=uu(s)}if(!Sa.has(k)&&(s=p({rel:"modulepreload",href:s},u),Sa.set(k,s),v.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(cf(k)))return}g=v.createElement("link"),sr(g,"link",s),jn(g),v.head.appendChild(g)}}}function W3(s,u,v){Fi.S(s,u,v);var g=lu;if(g&&s){var E=ps(g).hoistableStyles,k=ou(s);u=u||"default";var O=E.get(k);if(!O){var G={loading:0,preload:null};if(O=g.querySelector(uf(k)))G.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":u},v),(v=Sa.get(k))&&gy(s,v);var Z=O=g.createElement("link");jn(Z),sr(Z,"link",s),Z._p=new Promise(function(fe,we){Z.onload=fe,Z.onerror=we}),Z.addEventListener("load",function(){G.loading|=1}),Z.addEventListener("error",function(){G.loading|=2}),G.loading|=4,Kh(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:G},E.set(k,O)}}}function Z3(s,u){Fi.X(s,u);var v=lu;if(v&&s){var g=ps(v).hoistableScripts,E=uu(s),k=g.get(E);k||(k=v.querySelector(cf(E)),k||(s=p({src:s,async:!0},u),(u=Sa.get(E))&&yy(s,u),k=v.createElement("script"),jn(k),sr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function J3(s,u){Fi.M(s,u);var v=lu;if(v&&s){var g=ps(v).hoistableScripts,E=uu(s),k=g.get(E);k||(k=v.querySelector(cf(E)),k||(s=p({src:s,async:!0,type:"module"},u),(u=Sa.get(E))&&yy(s,u),k=v.createElement("script"),jn(k),sr(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function vC(s,u,v,g){var E=(E=ae.current)?Gh(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(u=ou(v.href),v=ps(E).hoistableStyles,g=v.get(u),g||(g={type:"style",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){s=ou(v.href);var k=ps(E).hoistableStyles,O=k.get(s);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,O),(k=E.querySelector(uf(s)))&&!k._p&&(O.instance=k,O.state.loading=5),Sa.has(s)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},Sa.set(s,v),k||e4(E,s,v,O.state))),u&&g===null)throw Error(r(528,""));return O}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=v.async,v=v.src,typeof v=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=uu(v),v=ps(E).hoistableScripts,g=v.get(u),g||(g={type:"script",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ou(s){return'href="'+va(s)+'"'}function uf(s){return'link[rel="stylesheet"]['+s+"]"}function pC(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function e4(s,u,v,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),sr(u,"link",v),jn(u),s.head.appendChild(u))}function uu(s){return'[src="'+va(s)+'"]'}function cf(s){return"script[async]"+s}function mC(s,u,v){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+va(v.href)+'"]');if(g)return u.instance=g,jn(g),g;var E=p({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),jn(g),sr(g,"style",E),Kh(g,v.precedence,s),u.instance=g;case"stylesheet":E=ou(v.href);var k=s.querySelector(uf(E));if(k)return u.state.loading|=4,u.instance=k,jn(k),k;g=pC(v),(E=Sa.get(E))&&gy(g,E),k=(s.ownerDocument||s).createElement("link"),jn(k);var O=k;return O._p=new Promise(function(G,Z){O.onload=G,O.onerror=Z}),sr(k,"link",g),u.state.loading|=4,Kh(k,v.precedence,s),u.instance=k;case"script":return k=uu(v.src),(E=s.querySelector(cf(k)))?(u.instance=E,jn(E),E):(g=v,(E=Sa.get(k))&&(g=p({},v),yy(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),jn(E),sr(E,"link",g),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Kh(g,v.precedence,s));return u.instance}function Kh(s,u,v){for(var g=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,k=E,O=0;O<g.length;O++){var G=g[O];if(G.dataset.precedence===u)k=G;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=v.nodeType===9?v.head:v,u.insertBefore(s,u.firstChild))}function gy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function yy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Yh=null;function gC(s,u,v){if(Yh===null){var g=new Map,E=Yh=new Map;E.set(v,g)}else E=Yh,g=E.get(v),g||(g=new Map,E.set(v,g));if(g.has(s))return g;for(g.set(s,null),v=v.getElementsByTagName(s),E=0;E<v.length;E++){var k=v[E];if(!(k[Yn]||k[on]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var O=k.getAttribute(u)||"";O=s+O;var G=g.get(O);G?G.push(k):g.set(O,[k])}}return g}function yC(s,u,v){s=s.ownerDocument||s,s.head.insertBefore(v,u==="title"?s.querySelector("head > title"):null)}function t4(s,u,v){if(v===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function xC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function n4(s,u,v,g){if(v.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var E=ou(g.href),k=u.querySelector(uf(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Xh.bind(s),u.then(s,s)),v.state.loading|=4,v.instance=k,jn(k);return}k=u.ownerDocument||u,g=pC(g),(E=Sa.get(E))&&gy(g,E),k=k.createElement("link"),jn(k);var O=k;O._p=new Promise(function(G,Z){O.onload=G,O.onerror=Z}),sr(k,"link",g),v.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(v,u),(u=v.state.preload)&&(v.state.loading&3)===0&&(s.count++,v=Xh.bind(s),u.addEventListener("load",v),u.addEventListener("error",v))}}var xy=0;function r4(s,u){return s.stylesheets&&s.count===0&&Wh(s,s.stylesheets),0<s.count||0<s.imgCount?function(v){var g=setTimeout(function(){if(s.stylesheets&&Wh(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&xy===0&&(xy=62500*P3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Wh(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>xy?50:800)+u);return s.unsuspend=v,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Xh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Qh=null;function Wh(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Qh=new Map,u.forEach(a4,s),Qh=null,Xh.call(s))}function a4(s,u){if(!(u.state.loading&4)){var v=Qh.get(s);if(v)var g=v.get(null);else{v=new Map,Qh.set(s,v);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var O=E[k];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(v.set(O.dataset.precedence,O),g=O)}g&&v.set(null,g)}E=u.instance,O=E.getAttribute("data-precedence"),k=v.get(O)||g,k===g&&v.set(null,E),v.set(O,E),this.count++,g=Xh.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var ff={$$typeof:C,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function i4(s,u,v,g,E,k,O,G,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.hiddenUpdates=dn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function bC(s,u,v,g,E,k,O,G,Z,fe,we,Ee){return s=new i4(s,u,v,O,Z,fe,we,Ee,G),u=1,k===!0&&(u|=24),k=Qr(3,null,null,u),s.current=k,k.stateNode=s,u=Zm(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:g,isDehydrated:v,cache:u},ng(k),s}function wC(s){return s?(s=Fo,s):Fo}function SC(s,u,v,g,E,k){E=wC(E),g.context===null?g.context=E:g.pendingContext=E,g=Es(u),g.payload={element:v},k=k===void 0?null:k,k!==null&&(g.callback=k),v=Cs(s,g,u),v!==null&&(Ir(v,s,u),Uc(v,s,u))}function EC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var v=s.retryLane;s.retryLane=v!==0&&v<u?v:u}}function by(s,u){EC(s,u),(s=s.alternate)&&EC(s,u)}function CC(s){if(s.tag===13||s.tag===31){var u=Ol(s,67108864);u!==null&&Ir(u,s,67108864),by(s,67108864)}}function NC(s){if(s.tag===13||s.tag===31){var u=ta();u=En(u);var v=Ol(s,u);v!==null&&Ir(v,s,u),by(s,u)}}var Zh=!0;function s4(s,u,v,g){var E=I.T;I.T=null;var k=U.p;try{U.p=2,wy(s,u,v,g)}finally{U.p=k,I.T=E}}function l4(s,u,v,g){var E=I.T;I.T=null;var k=U.p;try{U.p=8,wy(s,u,v,g)}finally{U.p=k,I.T=E}}function wy(s,u,v,g){if(Zh){var E=Sy(g);if(E===null)ly(s,u,g,Jh,v),TC(s,g);else if(u4(E,s,u,v,g))g.stopPropagation();else if(TC(s,g),u&4&&-1<o4.indexOf(s)){for(;E!==null;){var k=vs(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var O=ut(k.pendingLanes);if(O!==0){var G=k;for(G.pendingLanes|=2,G.entangledLanes|=2;O;){var Z=1<<31-de(O);G.entanglements[1]|=Z,O&=~Z}Ja(k),(_t&6)===0&&(_h=ze()+500,af(0))}}break;case 31:case 13:G=Ol(k,2),G!==null&&Ir(G,k,2),Ph(),by(k,2)}if(k=Sy(g),k===null&&ly(s,u,g,Jh,v),k===E)break;E=k}E!==null&&g.stopPropagation()}else ly(s,u,g,null,v)}}function Sy(s){return s=Cm(s),Ey(s)}var Jh=null;function Ey(s){if(Jh=null,s=hs(s),s!==null){var u=i(s);if(u===null)s=null;else{var v=u.tag;if(v===13){if(s=l(u),s!==null)return s;s=null}else if(v===31){if(s=o(u),s!==null)return s;s=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Jh=s,null}function kC(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case he:return 2;case Ce:return 8;case De:case Fe:return 32;case Me:return 268435456;default:return 32}default:return 32}}var Cy=!1,_s=null,Bs=null,Ps=null,df=new Map,hf=new Map,zs=[],o4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function TC(s,u){switch(s){case"focusin":case"focusout":_s=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":Ps=null;break;case"pointerover":case"pointerout":df.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":hf.delete(u.pointerId)}}function vf(s,u,v,g,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:v,eventSystemFlags:g,nativeEvent:k,targetContainers:[E]},u!==null&&(u=vs(u),u!==null&&CC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function u4(s,u,v,g,E){switch(u){case"focusin":return _s=vf(_s,s,u,v,g,E),!0;case"dragenter":return Bs=vf(Bs,s,u,v,g,E),!0;case"mouseover":return Ps=vf(Ps,s,u,v,g,E),!0;case"pointerover":var k=E.pointerId;return df.set(k,vf(df.get(k)||null,s,u,v,g,E)),!0;case"gotpointercapture":return k=E.pointerId,hf.set(k,vf(hf.get(k)||null,s,u,v,g,E)),!0}return!1}function jC(s){var u=hs(s.target);if(u!==null){var v=i(u);if(v!==null){if(u=v.tag,u===13){if(u=l(v),u!==null){s.blockedOn=u,da(s.priority,function(){NC(v)});return}}else if(u===31){if(u=o(v),u!==null){s.blockedOn=u,da(s.priority,function(){NC(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){s.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}s.blockedOn=null}function ev(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var v=Sy(s.nativeEvent);if(v===null){v=s.nativeEvent;var g=new v.constructor(v.type,v);Em=g,v.target.dispatchEvent(g),Em=null}else return u=vs(v),u!==null&&CC(u),s.blockedOn=v,!1;u.shift()}return!0}function AC(s,u,v){ev(s)&&v.delete(u)}function c4(){Cy=!1,_s!==null&&ev(_s)&&(_s=null),Bs!==null&&ev(Bs)&&(Bs=null),Ps!==null&&ev(Ps)&&(Ps=null),df.forEach(AC),hf.forEach(AC)}function tv(s,u){s.blockedOn===u&&(s.blockedOn=null,Cy||(Cy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,c4)))}var nv=null;function RC(s){nv!==s&&(nv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nv===s&&(nv=null);for(var u=0;u<s.length;u+=3){var v=s[u],g=s[u+1],E=s[u+2];if(typeof g!="function"){if(Ey(g||v)===null)continue;break}var k=vs(v);k!==null&&(s.splice(u,3),u-=3,Sg(k,{pending:!0,data:E,method:v.method,action:g},g,E))}}))}function cu(s){function u(Z){return tv(Z,s)}_s!==null&&tv(_s,s),Bs!==null&&tv(Bs,s),Ps!==null&&tv(Ps,s),df.forEach(u),hf.forEach(u);for(var v=0;v<zs.length;v++){var g=zs[v];g.blockedOn===s&&(g.blockedOn=null)}for(;0<zs.length&&(v=zs[0],v.blockedOn===null);)jC(v),v.blockedOn===null&&zs.shift();if(v=(s.ownerDocument||s).$$reactFormReplay,v!=null)for(g=0;g<v.length;g+=3){var E=v[g],k=v[g+1],O=E[Bn]||null;if(typeof k=="function")O||RC(v);else if(O){var G=null;if(k&&k.hasAttribute("formAction")){if(E=k,O=k[Bn]||null)G=O.formAction;else if(Ey(E)!==null)continue}else G=O.action;typeof G=="function"?v[g+1]=G:(v.splice(g,3),g-=3),RC(v)}}}function DC(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),g||setTimeout(v,20)}function v(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(v,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function Ny(s){this._internalRoot=s}rv.prototype.render=Ny.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var v=u.current,g=ta();SC(v,g,s,u,null,null)},rv.prototype.unmount=Ny.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;SC(s.current,2,null,s,null,null),Ph(),u[Mr]=null}};function rv(s){this._internalRoot=s}rv.prototype.unstable_scheduleHydration=function(s){if(s){var u=vn();s={blockedOn:null,target:s,priority:u};for(var v=0;v<zs.length&&u!==0&&u<zs[v].priority;v++);zs.splice(v,0,s),v===0&&jC(s)}};var MC=t.version;if(MC!=="19.2.4")throw Error(r(527,MC,"19.2.4"));U.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=c(u),s=s!==null?d(s):null,s=s===null?null:s.stateNode,s};var f4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var av=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!av.isDisabled&&av.supportsFiber)try{K=av.inject(f4),oe=av}catch{}}return mf.createRoot=function(s,u){if(!a(s))throw Error(r(299));var v=!1,g="",E=I2,k=F2,O=q2;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=bC(s,1,!1,null,null,v,g,null,E,k,O,DC),s[Mr]=u.current,sy(s),new Ny(u)},mf.hydrateRoot=function(s,u,v){if(!a(s))throw Error(r(299));var g=!1,E="",k=I2,O=F2,G=q2,Z=null;return v!=null&&(v.unstable_strictMode===!0&&(g=!0),v.identifierPrefix!==void 0&&(E=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(O=v.onCaughtError),v.onRecoverableError!==void 0&&(G=v.onRecoverableError),v.formState!==void 0&&(Z=v.formState)),u=bC(s,1,!0,u,v??null,g,E,Z,k,O,G,DC),u.context=wC(null),v=u.current,g=ta(),g=En(g),E=Es(g),E.callback=null,Cs(v,E,g),v=g,u.current.lanes=v,Ut(u,v),Ja(u),s[Mr]=u.current,sy(s),new rv(u)},mf.version="19.2.4",mf}var VC;function w4(){if(VC)return Ay.exports;VC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ay.exports=b4(),Ay.exports}var S4=w4();const E4=pd(S4);var ac=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},no,Xs,Fu,PA,C4=(PA=class extends ac{constructor(){super();et(this,no);et(this,Xs);et(this,Fu);Be(this,Fu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,Xs)||this.setEventListener(J(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,Xs))==null||t.call(this),Be(this,Xs,void 0))}setEventListener(t){var n;Be(this,Fu,t),(n=J(this,Xs))==null||n.call(this),Be(this,Xs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,no)!==t&&(Be(this,no,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof J(this,no)=="boolean"?J(this,no):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},no=new WeakMap,Xs=new WeakMap,Fu=new WeakMap,PA),d1=new C4,N4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Qs,c1,zA,k4=(zA=class{constructor(){et(this,Qs,N4);et(this,c1,!1)}setTimeoutProvider(e){Be(this,Qs,e)}setTimeout(e,t){return J(this,Qs).setTimeout(e,t)}clearTimeout(e){J(this,Qs).clearTimeout(e)}setInterval(e,t){return J(this,Qs).setInterval(e,t)}clearInterval(e){J(this,Qs).clearInterval(e)}},Qs=new WeakMap,c1=new WeakMap,zA),eo=new k4;function T4(e){setTimeout(e,0)}var j4=typeof window>"u"||"Deno"in globalThis;function kr(){}function A4(e,t){return typeof e=="function"?e(t):e}function Q0(e){return typeof e=="number"&&e>=0&&e!==1/0}function QA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ll(e,t){return typeof e=="function"?e(t):e}function ka(e,t){return typeof e=="function"?e(t):e}function HC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==h1(l,t.options))return!1}else if(!Kf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function $C(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ho(t.options.mutationKey)!==ho(i))return!1}else if(!Kf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function h1(e,t){return((t==null?void 0:t.queryKeyHashFn)||ho)(e)}function ho(e){return JSON.stringify(e,(t,n)=>W0(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Kf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kf(e[n],t[n])):!1}var R4=Object.prototype.hasOwnProperty;function WA(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=GC(e)&&GC(t);if(!r&&!(W0(e)&&W0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,f=r?new Array(o):{};let c=0;for(let d=0;d<o;d++){const p=r?d:l[d],m=e[p],y=t[p];if(m===y){f[p]=m,(r?d<i:R4.call(e,p))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[p]=y;continue}const x=WA(m,y,n+1);f[p]=x,x===m&&c++}return i===o&&c===i?e:f}function Jv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function GC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function W0(e){if(!KC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!KC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function KC(e){return Object.prototype.toString.call(e)==="[object Object]"}function D4(e){return new Promise(t=>{eo.setTimeout(t,e)})}function Z0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WA(e,t):t}function M4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var v1=Symbol();function ZA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===v1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function p1(e,t){return typeof e=="function"?e(...t):!!e}function L4(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Yf=(()=>{let e=()=>j4;return{isServer(){return e()},setIsServer(t){e=t}}})();function J0(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var _4=T4;function B4(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=_4;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(f=>{n(f)})})})};return{batch:o=>{let f;t++;try{f=o()}finally{t--,t||l()}return f},batchCalls:o=>(...f)=>{i(()=>{o(...f)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var In=B4(),qu,Ws,Uu,IA,P4=(IA=class extends ac{constructor(){super();et(this,qu,!0);et(this,Ws);et(this,Uu);Be(this,Uu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){J(this,Ws)||this.setEventListener(J(this,Uu))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,Ws))==null||t.call(this),Be(this,Ws,void 0))}setEventListener(t){var n;Be(this,Uu,t),(n=J(this,Ws))==null||n.call(this),Be(this,Ws,t(this.setOnline.bind(this)))}setOnline(t){J(this,qu)!==t&&(Be(this,qu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,qu)}},qu=new WeakMap,Ws=new WeakMap,Uu=new WeakMap,IA),ep=new P4;function z4(e){return Math.min(1e3*2**e,3e4)}function JA(e){return(e??"online")==="online"?ep.isOnline():!0}var eb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eR(e){let t=!1,n=0,r;const a=J0(),i=()=>a.status!=="pending",l=b=>{var S;if(!i()){const w=new eb(b);m(w),(S=e.onCancel)==null||S.call(e,w)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>d1.isFocused()&&(e.networkMode==="always"||ep.isOnline())&&e.canRun(),d=()=>JA(e.networkMode)&&e.canRun(),p=b=>{i()||(r==null||r(),a.resolve(b))},m=b=>{i()||(r==null||r(),a.reject(b))},y=()=>new Promise(b=>{var S;r=w=>{(i()||c())&&b(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;r=void 0,i()||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(i())return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(p).catch(w=>{var A;if(i())return;const N=e.retry??(Yf.isServer()?0:3),C=e.retryDelay??z4,T=typeof C=="function"?C(n,w):C,R=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,w);if(t||!R){m(w);return}n++,(A=e.onFail)==null||A.call(e,n,w),D4(T).then(()=>c()?void 0:y()).then(()=>{t?m(w):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:f,canStart:d,start:()=>(d()?x():y().then(x),a)}}var ro,FA,tR=(FA=class{constructor(){et(this,ro)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Q0(this.gcTime)&&Be(this,ro,eo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yf.isServer()?1/0:300*1e3))}clearGcTimeout(){J(this,ro)&&(eo.clearTimeout(J(this,ro)),Be(this,ro,void 0))}},ro=new WeakMap,FA),ao,Vu,Na,io,Wn,cd,so,ra,nR,Hi,qA,I4=(qA=class extends tR{constructor(t){super();et(this,ra);et(this,ao);et(this,Vu);et(this,Na);et(this,io);et(this,Wn);et(this,cd);et(this,so);Be(this,so,!1),Be(this,cd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Be(this,io,t.client),Be(this,Na,J(this,io).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Be(this,ao,XC(this.options)),this.state=t.state??J(this,ao),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=J(this,Wn))==null?void 0:t.promise}setOptions(t){if(this.options={...J(this,cd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=XC(this.options);n.data!==void 0&&(this.setState(YC(n.data,n.dataUpdatedAt)),Be(this,ao,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&J(this,Na).remove(this)}setData(t,n){const r=Z0(this.state.data,t,this.options);return mt(this,ra,Hi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mt(this,ra,Hi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=J(this,Wn))==null?void 0:r.promise;return(a=J(this,Wn))==null||a.cancel(t),n?n.then(kr).catch(kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return J(this,ao)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ka(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===v1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ll(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!QA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Wn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,Wn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),J(this,Na).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(J(this,Wn)&&(J(this,so)||mt(this,ra,nR).call(this)?J(this,Wn).cancel({revert:!0}):J(this,Wn).cancelRetry()),this.scheduleGc()),J(this,Na).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mt(this,ra,Hi).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,d,p,m,y,x,b,S,w,N,C;if(this.state.fetchStatus!=="idle"&&((f=J(this,Wn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,Wn))return J(this,Wn).continueRetry(),J(this,Wn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,a=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Be(this,so,!0),r.signal)})},i=()=>{const T=ZA(this.options,n),A=(()=>{const D={client:J(this,io),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return Be(this,so,!1),this.options.persister?this.options.persister(T,A,this):T(A)},o=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:J(this,io),state:this.state,fetchFn:i};return a(T),T})();(c=this.options.behavior)==null||c.onFetch(o,this),Be(this,Vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&mt(this,ra,Hi).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Be(this,Wn,eR({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:T=>{T instanceof eb&&T.revert&&this.setState({...J(this,Vu),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{mt(this,ra,Hi).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{mt(this,ra,Hi).call(this,{type:"pause"})},onContinue:()=>{mt(this,ra,Hi).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const T=await J(this,Wn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=J(this,Na).config).onSuccess)==null||y.call(m,T,this),(b=(x=J(this,Na).config).onSettled)==null||b.call(x,T,this.state.error,this),T}catch(T){if(T instanceof eb){if(T.silent)return J(this,Wn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw mt(this,ra,Hi).call(this,{type:"error",error:T}),(w=(S=J(this,Na).config).onError)==null||w.call(S,T,this),(C=(N=J(this,Na).config).onSettled)==null||C.call(N,this.state.data,T,this),T}finally{this.scheduleGc()}}},ao=new WeakMap,Vu=new WeakMap,Na=new WeakMap,io=new WeakMap,Wn=new WeakMap,cd=new WeakMap,so=new WeakMap,ra=new WeakSet,nR=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Hi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...rR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...YC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Be(this,Vu,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),J(this,Na).notify({query:this,type:"updated",action:t})})},qA);function rR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:JA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function YC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var qr,jt,fd,Cr,lo,Hu,Ki,Zs,dd,$u,Gu,oo,uo,Js,Ku,It,_f,tb,nb,rb,ab,ib,sb,lb,aR,UA,F4=(UA=class extends ac{constructor(t,n){super();et(this,It);et(this,qr);et(this,jt);et(this,fd);et(this,Cr);et(this,lo);et(this,Hu);et(this,Ki);et(this,Zs);et(this,dd);et(this,$u);et(this,Gu);et(this,oo);et(this,uo);et(this,Js);et(this,Ku,new Set);this.options=n,Be(this,qr,t),Be(this,Zs,null),Be(this,Ki,J0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,jt).addObserver(this),QC(J(this,jt),this.options)?mt(this,It,_f).call(this):this.updateResult(),mt(this,It,ab).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ob(J(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ob(J(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mt(this,It,ib).call(this),mt(this,It,sb).call(this),J(this,jt).removeObserver(this)}setOptions(t){const n=this.options,r=J(this,jt);if(this.options=J(this,qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ka(this.options.enabled,J(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mt(this,It,lb).call(this),J(this,jt).setOptions(this.options),n._defaulted&&!Jv(this.options,n)&&J(this,qr).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,jt),observer:this});const a=this.hasListeners();a&&WC(J(this,jt),r,this.options,n)&&mt(this,It,_f).call(this),this.updateResult(),a&&(J(this,jt)!==r||ka(this.options.enabled,J(this,jt))!==ka(n.enabled,J(this,jt))||ll(this.options.staleTime,J(this,jt))!==ll(n.staleTime,J(this,jt)))&&mt(this,It,tb).call(this);const i=mt(this,It,nb).call(this);a&&(J(this,jt)!==r||ka(this.options.enabled,J(this,jt))!==ka(n.enabled,J(this,jt))||i!==J(this,Js))&&mt(this,It,rb).call(this,i)}getOptimisticResult(t){const n=J(this,qr).getQueryCache().build(J(this,qr),t),r=this.createResult(n,t);return U4(this,r)&&(Be(this,Cr,r),Be(this,Hu,this.options),Be(this,lo,J(this,jt).state)),r}getCurrentResult(){return J(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&J(this,Ki).status==="pending"&&J(this,Ki).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){J(this,Ku).add(t)}getCurrentQuery(){return J(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,qr).defaultQueryOptions(t),r=J(this,qr).getQueryCache().build(J(this,qr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mt(this,It,_f).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,Cr)))}createResult(t,n){var B;const r=J(this,jt),a=this.options,i=J(this,Cr),l=J(this,lo),o=J(this,Hu),c=t!==r?t.state:J(this,fd),{state:d}=t;let p={...d},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),_=!M&&QC(t,n),P=M&&WC(t,r,n,a);(_||P)&&(p={...p,...rR(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=p;y=p.data;let w=!1;if(n.placeholderData!==void 0&&y===void 0&&S==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,w=!0):M=typeof n.placeholderData=="function"?n.placeholderData((B=J(this,Gu))==null?void 0:B.state.data,J(this,Gu)):n.placeholderData,M!==void 0&&(S="success",y=Z0(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!w)if(i&&y===(l==null?void 0:l.data)&&n.select===J(this,dd))y=J(this,$u);else try{Be(this,dd,n.select),y=n.select(y),y=Z0(i==null?void 0:i.data,y,n),Be(this,$u,y),Be(this,Zs,null)}catch(M){Be(this,Zs,M)}J(this,Zs)&&(x=J(this,Zs),y=J(this,$u),b=Date.now(),S="error");const N=p.fetchStatus==="fetching",C=S==="pending",T=S==="error",R=C&&N,A=y!==void 0,L={status:S,fetchStatus:p.fetchStatus,isPending:C,isSuccess:S==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:T&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:m1(t,n),refetch:this.refetch,promise:J(this,Ki),isEnabled:ka(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=L.data!==void 0,_=L.status==="error"&&!M,P=V=>{_?V.reject(L.error):M&&V.resolve(L.data)},H=()=>{const V=Be(this,Ki,L.promise=J0());P(V)},$=J(this,Ki);switch($.status){case"pending":t.queryHash===r.queryHash&&P($);break;case"fulfilled":(_||L.data!==$.value)&&H();break;case"rejected":(!_||L.error!==$.reason)&&H();break}}return L}updateResult(){const t=J(this,Cr),n=this.createResult(J(this,jt),this.options);if(Be(this,lo,J(this,jt).state),Be(this,Hu,this.options),J(this,lo).data!==void 0&&Be(this,Gu,J(this,jt)),Jv(n,t))return;Be(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!J(this,Ku).size)return!0;const l=new Set(i??J(this,Ku));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,Cr)).some(o=>{const f=o;return J(this,Cr)[f]!==t[f]&&l.has(f)})};mt(this,It,aR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mt(this,It,ab).call(this)}},qr=new WeakMap,jt=new WeakMap,fd=new WeakMap,Cr=new WeakMap,lo=new WeakMap,Hu=new WeakMap,Ki=new WeakMap,Zs=new WeakMap,dd=new WeakMap,$u=new WeakMap,Gu=new WeakMap,oo=new WeakMap,uo=new WeakMap,Js=new WeakMap,Ku=new WeakMap,It=new WeakSet,_f=function(t){mt(this,It,lb).call(this);let n=J(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kr)),n},tb=function(){mt(this,It,ib).call(this);const t=ll(this.options.staleTime,J(this,jt));if(Yf.isServer()||J(this,Cr).isStale||!Q0(t))return;const r=QA(J(this,Cr).dataUpdatedAt,t)+1;Be(this,oo,eo.setTimeout(()=>{J(this,Cr).isStale||this.updateResult()},r))},nb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,jt)):this.options.refetchInterval)??!1},rb=function(t){mt(this,It,sb).call(this),Be(this,Js,t),!(Yf.isServer()||ka(this.options.enabled,J(this,jt))===!1||!Q0(J(this,Js))||J(this,Js)===0)&&Be(this,uo,eo.setInterval(()=>{(this.options.refetchIntervalInBackground||d1.isFocused())&&mt(this,It,_f).call(this)},J(this,Js)))},ab=function(){mt(this,It,tb).call(this),mt(this,It,rb).call(this,mt(this,It,nb).call(this))},ib=function(){J(this,oo)&&(eo.clearTimeout(J(this,oo)),Be(this,oo,void 0))},sb=function(){J(this,uo)&&(eo.clearInterval(J(this,uo)),Be(this,uo,void 0))},lb=function(){const t=J(this,qr).getQueryCache().build(J(this,qr),this.options);if(t===J(this,jt))return;const n=J(this,jt);Be(this,jt,t),Be(this,fd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},aR=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,Cr))}),J(this,qr).getQueryCache().notify({query:J(this,jt),type:"observerResultsUpdated"})})},UA);function q4(e,t){return ka(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function QC(e,t){return q4(e,t)||e.state.data!==void 0&&ob(e,t,t.refetchOnMount)}function ob(e,t,n){if(ka(t.enabled,e)!==!1&&ll(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&m1(e,t)}return!1}function WC(e,t,n,r){return(e!==t||ka(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&m1(e,n)}function m1(e,t){return ka(t.enabled,e)!==!1&&e.isStaleByTime(ll(t.staleTime,e))}function U4(e,t){return!Jv(e.getCurrentResult(),t)}function ZC(e){return{onFetch:(t,n)=>{var d,p,m,y,x;const r=t.options,a=(m=(p=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},f=0;const c=async()=>{let b=!1;const S=C=>{L4(C,()=>t.signal,()=>b=!0)},w=ZA(t.options,t.fetchOptions),N=async(C,T,R)=>{if(b)return Promise.reject();if(T==null&&C.pages.length)return Promise.resolve(C);const D=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:T,direction:R?"backward":"forward",meta:t.options.meta};return S(_),_})(),L=await w(D),{maxPages:B}=t.options,M=R?O4:M4;return{pages:M(C.pages,L,B),pageParams:M(C.pageParams,T,B)}};if(a&&i.length){const C=a==="backward",T=C?V4:JC,R={pages:i,pageParams:l},A=T(r,R);o=await N(R,A,C)}else{const C=e??i.length;do{const T=f===0?l[0]??r.initialPageParam:JC(r,o);if(f>0&&T==null)break;o=await N(o,T),f++}while(f<C)}return o};t.options.persister?t.fetchFn=()=>{var b,S;return(S=(b=t.options).persister)==null?void 0:S.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function JC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V4(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var hd,ii,pr,co,si,Gs,VA,H4=(VA=class extends tR{constructor(t){super();et(this,si);et(this,hd);et(this,ii);et(this,pr);et(this,co);Be(this,hd,t.client),this.mutationId=t.mutationId,Be(this,pr,t.mutationCache),Be(this,ii,[]),this.state=t.state||iR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,ii).includes(t)||(J(this,ii).push(t),this.clearGcTimeout(),J(this,pr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Be(this,ii,J(this,ii).filter(n=>n!==t)),this.scheduleGc(),J(this,pr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,ii).length||(this.state.status==="pending"?this.scheduleGc():J(this,pr).remove(this))}continue(){var t;return((t=J(this,co))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,d,p,m,y,x,b,S,w,N,C,T,R,A,D;const n=()=>{mt(this,si,Gs).call(this,{type:"continue"})},r={client:J(this,hd),meta:this.options.meta,mutationKey:this.options.mutationKey};Be(this,co,eR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,B)=>{mt(this,si,Gs).call(this,{type:"failed",failureCount:L,error:B})},onPause:()=>{mt(this,si,Gs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>J(this,pr).canRun(this)}));const a=this.state.status==="pending",i=!J(this,co).canStart();try{if(a)n();else{mt(this,si,Gs).call(this,{type:"pending",variables:t,isPaused:i}),J(this,pr).config.onMutate&&await J(this,pr).config.onMutate(t,this,r);const B=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));B!==this.state.context&&mt(this,si,Gs).call(this,{type:"pending",context:B,variables:t,isPaused:i})}const L=await J(this,co).start();return await((c=(f=J(this,pr).config).onSuccess)==null?void 0:c.call(f,L,t,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,L,t,this.state.context,r)),await((y=(m=J(this,pr).config).onSettled)==null?void 0:y.call(m,L,null,this.state.variables,this.state.context,this,r)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,L,null,t,this.state.context,r)),mt(this,si,Gs).call(this,{type:"success",data:L}),L}catch(L){try{await((w=(S=J(this,pr).config).onError)==null?void 0:w.call(S,L,t,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((C=(N=this.options).onError)==null?void 0:C.call(N,L,t,this.state.context,r))}catch(B){Promise.reject(B)}try{await((R=(T=J(this,pr).config).onSettled)==null?void 0:R.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,L,t,this.state.context,r))}catch(B){Promise.reject(B)}throw mt(this,si,Gs).call(this,{type:"error",error:L}),L}finally{J(this,pr).runNext(this)}}},hd=new WeakMap,ii=new WeakMap,pr=new WeakMap,co=new WeakMap,si=new WeakSet,Gs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),In.batch(()=>{J(this,ii).forEach(r=>{r.onMutationUpdate(t)}),J(this,pr).notify({mutation:this,type:"updated",action:t})})},VA);function iR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yi,za,vd,HA,$4=(HA=class extends ac{constructor(t={}){super();et(this,Yi);et(this,za);et(this,vd);this.config=t,Be(this,Yi,new Set),Be(this,za,new Map),Be(this,vd,0)}build(t,n,r){const a=new H4({client:t,mutationCache:this,mutationId:++iv(this,vd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){J(this,Yi).add(t);const n=sv(t);if(typeof n=="string"){const r=J(this,za).get(n);r?r.push(t):J(this,za).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(J(this,Yi).delete(t)){const n=sv(t);if(typeof n=="string"){const r=J(this,za).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&J(this,za).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=sv(t);if(typeof n=="string"){const r=J(this,za).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=sv(t);if(typeof n=="string"){const a=(r=J(this,za).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){In.batch(()=>{J(this,Yi).forEach(t=>{this.notify({type:"removed",mutation:t})}),J(this,Yi).clear(),J(this,za).clear()})}getAll(){return Array.from(J(this,Yi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$C(n,r))}findAll(t={}){return this.getAll().filter(n=>$C(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return In.batch(()=>Promise.all(t.map(n=>n.continue().catch(kr))))}},Yi=new WeakMap,za=new WeakMap,vd=new WeakMap,HA);function sv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Xi,el,Ur,Qi,es,_v,ub,$A,G4=($A=class extends ac{constructor(n,r){super();et(this,es);et(this,Xi);et(this,el);et(this,Ur);et(this,Qi);Be(this,Xi,n),this.setOptions(r),this.bindMethods(),mt(this,es,_v).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=J(this,Xi).defaultMutationOptions(n),Jv(this.options,r)||J(this,Xi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:J(this,Ur),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ho(r.mutationKey)!==ho(this.options.mutationKey)?this.reset():((a=J(this,Ur))==null?void 0:a.state.status)==="pending"&&J(this,Ur).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=J(this,Ur))==null||n.removeObserver(this)}onMutationUpdate(n){mt(this,es,_v).call(this),mt(this,es,ub).call(this,n)}getCurrentResult(){return J(this,el)}reset(){var n;(n=J(this,Ur))==null||n.removeObserver(this),Be(this,Ur,void 0),mt(this,es,_v).call(this),mt(this,es,ub).call(this)}mutate(n,r){var a;return Be(this,Qi,r),(a=J(this,Ur))==null||a.removeObserver(this),Be(this,Ur,J(this,Xi).getMutationCache().build(J(this,Xi),this.options)),J(this,Ur).addObserver(this),J(this,Ur).execute(n)}},Xi=new WeakMap,el=new WeakMap,Ur=new WeakMap,Qi=new WeakMap,es=new WeakSet,_v=function(){var r;const n=((r=J(this,Ur))==null?void 0:r.state)??iR();Be(this,el,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ub=function(n){In.batch(()=>{var r,a,i,l,o,f,c,d;if(J(this,Qi)&&this.hasListeners()){const p=J(this,el).variables,m=J(this,el).context,y={client:J(this,Xi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=J(this,Qi)).onSuccess)==null||a.call(r,n.data,p,m,y)}catch(x){Promise.reject(x)}try{(l=(i=J(this,Qi)).onSettled)==null||l.call(i,n.data,null,p,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=J(this,Qi)).onError)==null||f.call(o,n.error,p,m,y)}catch(x){Promise.reject(x)}try{(d=(c=J(this,Qi)).onSettled)==null||d.call(c,void 0,n.error,p,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(J(this,el))})})},$A),li,GA,K4=(GA=class extends ac{constructor(t={}){super();et(this,li);this.config=t,Be(this,li,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??h1(a,n);let l=this.get(i);return l||(l=new I4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){J(this,li).has(t.queryHash)||(J(this,li).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,li).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,li).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,li).get(t)}getAll(){return[...J(this,li).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>HC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>HC(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},li=new WeakMap,GA),bn,tl,nl,Yu,Xu,rl,Qu,Wu,KA,Y4=(KA=class{constructor(e={}){et(this,bn);et(this,tl);et(this,nl);et(this,Yu);et(this,Xu);et(this,rl);et(this,Qu);et(this,Wu);Be(this,bn,e.queryCache||new K4),Be(this,tl,e.mutationCache||new $4),Be(this,nl,e.defaultOptions||{}),Be(this,Yu,new Map),Be(this,Xu,new Map),Be(this,rl,0)}mount(){iv(this,rl)._++,J(this,rl)===1&&(Be(this,Qu,d1.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,bn).onFocus())})),Be(this,Wu,ep.subscribe(async e=>{e&&(await this.resumePausedMutations(),J(this,bn).onOnline())})))}unmount(){var e,t;iv(this,rl)._--,J(this,rl)===0&&((e=J(this,Qu))==null||e.call(this),Be(this,Qu,void 0),(t=J(this,Wu))==null||t.call(this),Be(this,Wu,void 0))}isFetching(e){return J(this,bn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,tl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,bn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=J(this,bn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return J(this,bn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=J(this,bn).get(r.queryHash),i=a==null?void 0:a.state.data,l=A4(t,i);if(l!==void 0)return J(this,bn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>J(this,bn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=J(this,bn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=J(this,bn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,bn);return In.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=In.batch(()=>J(this,bn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(kr).catch(kr)}invalidateQueries(e,t={}){return In.batch(()=>(J(this,bn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=In.batch(()=>J(this,bn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(kr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=J(this,bn).build(this,t);return n.isStaleByTime(ll(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kr).catch(kr)}fetchInfiniteQuery(e){return e.behavior=ZC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e.behavior=ZC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ep.isOnline()?J(this,tl).resumePausedMutations():Promise.resolve()}getQueryCache(){return J(this,bn)}getMutationCache(){return J(this,tl)}getDefaultOptions(){return J(this,nl)}setDefaultOptions(e){Be(this,nl,e)}setQueryDefaults(e,t){J(this,Yu).set(ho(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,Yu).values()],n={};return t.forEach(r=>{Kf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){J(this,Xu).set(ho(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,Xu).values()],n={};return t.forEach(r=>{Kf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...J(this,nl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=h1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===v1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...J(this,nl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,bn).clear(),J(this,tl).clear()}},bn=new WeakMap,tl=new WeakMap,nl=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,rl=new WeakMap,Qu=new WeakMap,Wu=new WeakMap,KA),sR=j.createContext(void 0),Vn=e=>{const t=j.useContext(sR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X4=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(sR.Provider,{value:e,children:t})),lR=j.createContext(!1),Q4=()=>j.useContext(lR);lR.Provider;function W4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Z4=j.createContext(W4()),J4=()=>j.useContext(Z4),eB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?p1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},tB=e=>{j.useEffect(()=>{e.clearReset()},[e])},nB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||p1(n,[e.error,r])),rB=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},aB=(e,t)=>e.isLoading&&e.isFetching&&!t,iB=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,eN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sB(e,t,n){var m,y,x,b;const r=Q4(),a=J4(),i=Vn(),l=i.defaultQueryOptions(e);(y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",rB(l),eB(l,a,o),tB(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),d=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(S=>{const w=p?c.subscribe(In.batchCalls(S)):kr;return c.updateResult(),w},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),iB(l,d))throw eN(l,c,a);if(nB({result:d,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((b=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,l,d),l.experimental_prefetchInRender&&!Yf.isServer()&&aB(d,r)){const S=f?eN(l,c,a):o==null?void 0:o.promise;S==null||S.catch(kr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}function tn(e,t){return sB(e,F4)}function br(e,t){const n=Vn(),[r]=j.useState(()=>new G4(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(In.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((l,o)=>{r.mutate(l,o).catch(kr)},[r]);if(a.error&&p1(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var tN="popstate";function nN(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function lB(e={}){function t(r,a){var c;let i=(c=a.state)==null?void 0:c.masked,{pathname:l,search:o,hash:f}=i||r.location;return cb("",{pathname:l,search:o,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Xf(a)}return uB(t,n,null,e)}function pn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function oB(){return Math.random().toString(36).substring(2,10)}function rN(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function cb(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ic(t):t,state:n,key:t&&t.key||r||oB(),unstable_mask:a}}function Xf({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ic(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function uB(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,o="POP",f=null,c=d();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function d(){return(l.state||{idx:null}).idx}function p(){o="POP";let S=d(),w=S==null?null:S-c;c=S,f&&f({action:o,location:b.location,delta:w})}function m(S,w){o="PUSH";let N=nN(S)?S:cb(b.location,S,w);c=d()+1;let C=rN(N,c),T=b.createHref(N.unstable_mask||N);try{l.pushState(C,"",T)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;a.location.assign(T)}i&&f&&f({action:o,location:b.location,delta:1})}function y(S,w){o="REPLACE";let N=nN(S)?S:cb(b.location,S,w);c=d();let C=rN(N,c),T=b.createHref(N.unstable_mask||N);l.replaceState(C,"",T),i&&f&&f({action:o,location:b.location,delta:0})}function x(S){return cB(S)}let b={get action(){return o},get location(){return e(a,l)},listen(S){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(tN,p),f=S,()=>{a.removeEventListener(tN,p),f=null}},createHref(S){return t(a,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:y,go(S){return l.go(S)}};return b}function cB(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),pn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Xf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function oR(e,t,n="/"){return fB(e,t,n,!1)}function fB(e,t,n,r){let a=typeof t=="string"?ic(t):t,i=ts(a.pathname||"/",n);if(i==null)return null;let l=uR(e);dB(l);let o=null;for(let f=0;o==null&&f<l.length;++f){let c=EB(i);o=wB(l[f],c,r)}return o}function uR(e,t=[],n=[],r="",a=!1){let i=(l,o,f=a,c)=>{let d={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&f)return;pn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let p=fi([r,d.relativePath]),m=n.concat(d);l.children&&l.children.length>0&&(pn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),uR(l.children,t,m,p,f)),!(l.path==null&&!l.index)&&t.push({path:p,score:xB(p,l.index),routesMeta:m})};return e.forEach((l,o)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,o);else for(let c of cR(l.path))i(l,o,!0,c)}),t}function cR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=cR(r.join("/")),o=[];return o.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&o.push(...l),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function dB(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bB(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var hB=/^:[\w-]+$/,vB=3,pB=2,mB=1,gB=10,yB=-2,aN=e=>e==="*";function xB(e,t){let n=e.split("/"),r=n.length;return n.some(aN)&&(r+=yB),t&&(r+=pB),n.filter(a=>!aN(a)).reduce((a,i)=>a+(hB.test(i)?vB:i===""?mB:gB),r)}function bB(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function wB(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let o=0;o<r.length;++o){let f=r[o],c=o===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",p=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:c},d),m=f.route;if(!p&&c&&n&&!r[r.length-1].route.index&&(p=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},d)),!p)return null;Object.assign(a,p.params),l.push({params:a,pathname:fi([i,p.pathname]),pathnameBase:TB(fi([i,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(i=fi([i,p.pathnameBase]))}return l}function tp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=SB(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((c,{paramName:d,isOptional:p},m)=>{if(d==="*"){let x=o[m]||"";l=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=o[m];return p&&!y?c[d]=void 0:c[d]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:l,pattern:e}}function SB(e,t=!1,n=!0){mi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,f,c,d)=>{if(r.push({paramName:o,isOptional:f!=null}),f){let p=d.charAt(c+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function EB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ts(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var CB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function NB(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ic(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=iN(n.substring(1),"/"):i=iN(n,t)):i=t,{pathname:i,search:jB(r),hash:AB(a)}}function iN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Oy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kB(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fR(e){let t=kB(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function g1(e,t,n,r=!1){let a;typeof e=="string"?a=ic(e):(a={...e},pn(!a.pathname||!a.pathname.includes("?"),Oy("?","pathname","search",a)),pn(!a.pathname||!a.pathname.includes("#"),Oy("#","pathname","hash",a)),pn(!a.search||!a.search.includes("#"),Oy("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),p-=1;a.pathname=m.join("/")}o=p>=0?t[p]:"/"}let f=NB(a,o),c=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(c||d)&&(f.pathname+="/"),f}var fi=e=>e.join("/").replace(/\/\/+/g,"/"),TB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jB=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RB=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function DB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function MB(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var dR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hR(e,t){let n=e;if(typeof n!="string"||!CB.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(dR)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=ts(l.pathname,t);l.origin===i.origin&&o!=null?n=o+l.search+l.hash:a=!0}catch{mi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vR=["POST","PUT","PATCH","DELETE"];new Set(vR);var OB=["GET",...vR];new Set(OB);var sc=j.createContext(null);sc.displayName="DataRouter";var jp=j.createContext(null);jp.displayName="DataRouterState";var LB=j.createContext(!1),pR=j.createContext({isTransitioning:!1});pR.displayName="ViewTransition";var _B=j.createContext(new Map);_B.displayName="Fetchers";var BB=j.createContext(null);BB.displayName="Await";var Oa=j.createContext(null);Oa.displayName="Navigation";var md=j.createContext(null);md.displayName="Location";var Ga=j.createContext({outlet:null,matches:[],isDataRoute:!1});Ga.displayName="Route";var y1=j.createContext(null);y1.displayName="RouteError";var mR="REACT_ROUTER_ERROR",PB="REDIRECT",zB="ROUTE_ERROR_RESPONSE";function IB(e){if(e.startsWith(`${mR}:${PB}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function FB(e){if(e.startsWith(`${mR}:${zB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new RB(t.status,t.statusText,t.data)}catch{}}function qB(e,{relative:t}={}){pn(gd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(Oa),{hash:a,pathname:i,search:l}=yd(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:fi([n,i])),r.createHref({pathname:o,search:l,hash:a})}function gd(){return j.useContext(md)!=null}function ls(){return pn(gd(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(md).location}var gR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yR(e){j.useContext(Oa).static||j.useLayoutEffect(e)}function Ka(){let{isDataRoute:e}=j.useContext(Ga);return e?rP():UB()}function UB(){pn(gd(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(sc),{basename:t,navigator:n}=j.useContext(Oa),{matches:r}=j.useContext(Ga),{pathname:a}=ls(),i=JSON.stringify(fR(r)),l=j.useRef(!1);return yR(()=>{l.current=!0}),j.useCallback((f,c={})=>{if(mi(l.current,gR),!l.current)return;if(typeof f=="number"){n.go(f);return}let d=g1(f,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:fi([t,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[t,n,i,a,e])}var VB=j.createContext(null);function HB(e){let t=j.useContext(Ga).outlet;return j.useMemo(()=>t&&j.createElement(VB.Provider,{value:e},t),[t,e])}function $B(){let{matches:e}=j.useContext(Ga),t=e[e.length-1];return t?t.params:{}}function yd(e,{relative:t}={}){let{matches:n}=j.useContext(Ga),{pathname:r}=ls(),a=JSON.stringify(fR(n));return j.useMemo(()=>g1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function GB(e,t){return xR(e,t)}function xR(e,t,n){var S;pn(gd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(Oa),{matches:a}=j.useContext(Ga),i=a[a.length-1],l=i?i.params:{},o=i?i.pathname:"/",f=i?i.pathnameBase:"/",c=i&&i.route;{let w=c&&c.path||"";wR(o,!c||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=ls(),p;if(t){let w=typeof t=="string"?ic(t):t;pn(f==="/"||((S=w.pathname)==null?void 0:S.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=d;let m=p.pathname||"/",y=m;if(f!=="/"){let w=f.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=oR(e,{pathname:y});mi(c||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),mi(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=WB(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:fi([f,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:fi([f,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,n);return t&&b?j.createElement(md.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},b):b}function KB(){let e=nP(),t=DB(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:i},"ErrorBoundary")," or"," ",j.createElement("code",{style:i},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:a},n):null,l)}var YB=j.createElement(KB,null),bR=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=FB(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Ga.Provider,{value:this.props.routeContext},j.createElement(y1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(XB,{error:e},t):t}};bR.contextType=LB;var Ly=new WeakMap;function XB({children:e,error:t}){let{basename:n}=j.useContext(Oa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=IB(t.digest);if(r){let a=Ly.get(t);if(a)throw a;let i=hR(r.location,n);if(dR&&!Ly.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw Ly.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function QB({routeContext:e,match:t,children:n}){let r=j.useContext(sc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Ga.Provider,{value:e},n)}function WB(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let d=a.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);pn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,o=-1;if(n&&r){l=r.renderFallback;for(let d=0;d<a.length;d++){let p=a[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(o=d),p.route.id){let{loaderData:m,errors:y}=r,x=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||x){n.isStatic&&(l=!0),o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,c=r&&f?(d,p)=>{var m,y;f(d,{location:r.location,params:((y=(m=r.matches)==null?void 0:m[0])==null?void 0:y.params)??{},unstable_pattern:MB(r.matches),errorInfo:p})}:void 0;return a.reduceRight((d,p,m)=>{let y,x=!1,b=null,S=null;r&&(y=i&&p.route.id?i[p.route.id]:void 0,b=p.route.errorElement||YB,l&&(o<0&&m===0?(wR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):o===m&&(x=!0,S=p.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,m+1)),N=()=>{let C;return y?C=b:x?C=S:p.route.Component?C=j.createElement(p.route.Component,null):p.route.element?C=p.route.element:C=d,j.createElement(QB,{match:p,routeContext:{outlet:d,matches:w,isDataRoute:r!=null},children:C})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?j.createElement(bR,{location:r.location,revalidation:r.revalidation,component:b,error:y,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:c}):N()},null)}function x1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZB(e){let t=j.useContext(sc);return pn(t,x1(e)),t}function JB(e){let t=j.useContext(jp);return pn(t,x1(e)),t}function eP(e){let t=j.useContext(Ga);return pn(t,x1(e)),t}function b1(e){let t=eP(e),n=t.matches[t.matches.length-1];return pn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function tP(){return b1("useRouteId")}function nP(){var r;let e=j.useContext(y1),t=JB("useRouteError"),n=b1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function rP(){let{router:e}=ZB("useNavigate"),t=b1("useNavigate"),n=j.useRef(!1);return yR(()=>{n.current=!0}),j.useCallback(async(a,i={})=>{mi(n.current,gR),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var sN={};function wR(e,t,n){!t&&!sN[e]&&(sN[e]=!0,mi(!1,n))}j.memo(aP);function aP({routes:e,future:t,state:n,isStatic:r,onError:a}){return xR(e,void 0,{state:n,isStatic:r,onError:a})}function iP(e){return HB(e.context)}function Ea(e){pn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function sP({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){pn(!gd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:o,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[o,a,i,l]);typeof n=="string"&&(n=ic(n));let{pathname:c="/",search:d="",hash:p="",state:m=null,key:y="default",unstable_mask:x}=n,b=j.useMemo(()=>{let S=ts(c,o);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:y,unstable_mask:x},navigationType:r}},[o,c,d,p,m,y,r,x]);return mi(b!=null,`<Router basename="${o}"> is not able to match the URL "${c}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:j.createElement(Oa.Provider,{value:f},j.createElement(md.Provider,{children:t,value:b}))}function lP({children:e,location:t}){return GB(fb(e),t)}function fb(e,t=[]){let n=[];return j.Children.forEach(e,(r,a)=>{if(!j.isValidElement(r))return;let i=[...t,a];if(r.type===j.Fragment){n.push.apply(n,fb(r.props.children,i));return}pn(r.type===Ea,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),pn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=fb(r.props.children,i)),n.push(l)}),n}var Bv="get",Pv="application/x-www-form-urlencoded";function Ap(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function oP(e){return Ap(e)&&e.tagName.toLowerCase()==="button"}function uP(e){return Ap(e)&&e.tagName.toLowerCase()==="form"}function cP(e){return Ap(e)&&e.tagName.toLowerCase()==="input"}function fP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dP(e,t){return e.button===0&&(!t||t==="_self")&&!fP(e)}var lv=null;function hP(){if(lv===null)try{new FormData(document.createElement("form"),0),lv=!1}catch{lv=!0}return lv}var vP=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _y(e){return e!=null&&!vP.has(e)?(mi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pv}"`),null):e}function pP(e,t){let n,r,a,i,l;if(uP(e)){let o=e.getAttribute("action");r=o?ts(o,t):null,n=e.getAttribute("method")||Bv,a=_y(e.getAttribute("enctype"))||Pv,i=new FormData(e)}else if(oP(e)||cP(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||o.getAttribute("action");if(r=f?ts(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Bv,a=_y(e.getAttribute("formenctype"))||_y(o.getAttribute("enctype"))||Pv,i=new FormData(o,e),!hP()){let{name:c,type:d,value:p}=e;if(d==="image"){let m=c?`${c}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else c&&i.append(c,p)}}else{if(Ap(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Bv,r=null,a=Pv,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function w1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mP(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&ts(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function gP(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yP(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function xP(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await gP(i,n);return l.links?l.links():[]}return[]}));return EP(r.flat(1).filter(yP).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function lN(e,t,n,r,a,i){let l=(f,c)=>n[c]?f.route.id!==n[c].route.id:!0,o=(f,c)=>{var d;return n[c].pathname!==f.pathname||((d=n[c].route.path)==null?void 0:d.endsWith("*"))&&n[c].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,c)=>l(f,c)||o(f,c)):i==="data"?t.filter((f,c)=>{var p;let d=r.routes[f.route.id];if(!d||!d.hasLoader)return!1;if(l(f,c)||o(f,c))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function bP(e,t,{includeHydrateFallback:n}={}){return wP(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function wP(e){return[...new Set(e)]}function SP(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function EP(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(SP(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function SR(){let e=j.useContext(sc);return w1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function CP(){let e=j.useContext(jp);return w1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var S1=j.createContext(void 0);S1.displayName="FrameworkContext";function ER(){let e=j.useContext(S1);return w1(e,"You must render this element inside a <HydratedRouter> element"),e}function NP(e,t){let n=j.useContext(S1),[r,a]=j.useState(!1),[i,l]=j.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:c,onMouseLeave:d,onTouchStart:p}=t,m=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=w=>{w.forEach(N=>{l(N.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[e]),j.useEffect(()=>{if(r){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[r]);let y=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:gf(o,y),onBlur:gf(f,x),onMouseEnter:gf(c,y),onMouseLeave:gf(d,x),onTouchStart:gf(p,y)}]:[!1,m,{}]}function gf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kP({page:e,...t}){let{router:n}=SR(),r=j.useMemo(()=>oR(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?j.createElement(jP,{page:e,matches:r,...t}):null}function TP(e){let{manifest:t,routeModules:n}=ER(),[r,a]=j.useState([]);return j.useEffect(()=>{let i=!1;return xP(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function jP({page:e,matches:t,...n}){let r=ls(),{future:a,manifest:i,routeModules:l}=ER(),{basename:o}=SR(),{loaderData:f,matches:c}=CP(),d=j.useMemo(()=>lN(e,t,c,i,r,"data"),[e,t,c,i,r]),p=j.useMemo(()=>lN(e,t,c,i,r,"assets"),[e,t,c,i,r]),m=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,S=!1;if(t.forEach(N=>{var T;let C=i.routes[N.route.id];!C||!C.hasLoader||(!d.some(R=>R.route.id===N.route.id)&&N.route.id in f&&((T=l[N.route.id])!=null&&T.shouldRevalidate)||C.hasClientLoader?S=!0:b.add(N.route.id))}),b.size===0)return[];let w=mP(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return S&&b.size>0&&w.searchParams.set("_routes",t.filter(N=>b.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,d,t,e,l]),y=j.useMemo(()=>bP(p,i),[p,i]),x=TP(p);return j.createElement(j.Fragment,null,m.map(b=>j.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>j.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:S})=>j.createElement("link",{key:b,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function AP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var RP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RP&&(window.__reactRouterVersion="7.13.1")}catch{}function DP({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=j.useRef();a.current==null&&(a.current=lB({window:r,v5Compat:!0}));let i=a.current,[l,o]=j.useState({action:i.action,location:i.location}),f=j.useCallback(c=>{n===!1?o(c):j.startTransition(()=>o(c))},[n]);return j.useLayoutEffect(()=>i.listen(f),[i,f]),j.createElement(sP,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var CR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ra=j.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,unstable_mask:o,state:f,target:c,to:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:y,...x},b){let{basename:S,navigator:w,unstable_useTransitions:N}=j.useContext(Oa),C=typeof d=="string"&&CR.test(d),T=hR(d,S);d=T.to;let R=qB(d,{relative:a}),A=ls(),D=null;if(o){let V=g1(o,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:fi([S,V.pathname])),D=w.createHref(V)}let[L,B,M]=NP(r,x),_=LP(d,{replace:l,unstable_mask:o,state:f,target:c,preventScrollReset:p,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:N});function P(V){t&&t(V),V.defaultPrevented||_(V)}let H=!(T.isExternal||i),$=j.createElement("a",{...x,...M,href:(H?D:void 0)||T.absoluteURL||R,onClick:H?P:t,ref:AP(b,B),target:c,"data-discover":!C&&n==="render"?"true":void 0});return L&&!C?j.createElement(j.Fragment,null,$,j.createElement(kP,{page:R})):$});Ra.displayName="Link";var E1=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:o,children:f,...c},d){let p=yd(l,{relative:c.relative}),m=ls(),y=j.useContext(jp),{navigator:x,basename:b}=j.useContext(Oa),S=y!=null&&IP(p)&&o===!0,w=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,N=m.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(N=N.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&b&&(C=ts(C,b)||C);const T=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let R=N===w||!a&&N.startsWith(w)&&N.charAt(T)==="/",A=C!=null&&(C===w||!a&&C.startsWith(w)&&C.charAt(w.length)==="/"),D={isActive:R,isPending:A,isTransitioning:S},L=R?t:void 0,B;typeof r=="function"?B=r(D):B=[r,R?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(D):i;return j.createElement(Ra,{...c,"aria-current":L,className:B,ref:d,style:M,to:l,viewTransition:o},typeof f=="function"?f(D):f)});E1.displayName="NavLink";var MP=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=Bv,action:o,onSubmit:f,relative:c,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},x)=>{let{unstable_useTransitions:b}=j.useContext(Oa),S=PP(),w=zP(o,{relative:c}),N=l.toLowerCase()==="get"?"get":"post",C=typeof o=="string"&&CR.test(o),T=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let A=R.nativeEvent.submitter,D=(A==null?void 0:A.getAttribute("formmethod"))||l,L=()=>S(A||R.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:i,relative:c,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m});b&&n!==!1?j.startTransition(()=>L()):L()};return j.createElement("form",{ref:x,method:N,action:w,onSubmit:r?f:T,...y,"data-discover":!C&&e==="render"?"true":void 0})});MP.displayName="Form";function OP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NR(e){let t=j.useContext(sc);return pn(t,OP(e)),t}function LP(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:c}={}){let d=Ka(),p=ls(),m=yd(e,{relative:l});return j.useCallback(y=>{if(dP(y,t)){y.preventDefault();let x=n!==void 0?n:Xf(p)===Xf(m),b=()=>d(e,{replace:x,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f});c?j.startTransition(()=>b()):b()}},[p,d,m,n,r,a,t,e,i,l,o,f,c])}var _P=0,BP=()=>`__${String(++_P)}__`;function PP(){let{router:e}=NR("useSubmit"),{basename:t}=j.useContext(Oa),n=tP(),r=e.fetch,a=e.navigate;return j.useCallback(async(i,l={})=>{let{action:o,method:f,encType:c,formData:d,body:p}=pP(i,t);if(l.navigate===!1){let m=l.fetcherKey||BP();await r(m,n,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||f,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||f,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function zP(e,{relative:t}={}){let{basename:n}=j.useContext(Oa),r=j.useContext(Ga);pn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...yd(e||".",{relative:t})},l=ls();if(e==null){i.search=l.search;let o=new URLSearchParams(i.search),f=o.getAll("index");if(f.some(d=>d==="")){o.delete("index"),f.filter(p=>p).forEach(p=>o.append("index",p));let d=o.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:fi([n,i.pathname])),Xf(i)}function IP(e,{relative:t}={}){let n=j.useContext(pR);pn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=NR("useViewTransitionState"),a=yd(e,{relative:t});if(!n.isTransitioning)return!1;let i=ts(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ts(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tp(a.pathname,l)!=null||tp(a.pathname,i)!=null}var xd=XA();const FP=pd(xd),kR="myco-ui-theme",qP="system",oN="light",TR="(prefers-color-scheme: dark)",jR=j.createContext(void 0);function UP(){const e=localStorage.getItem(kR);return e==="light"||e==="dark"||e==="system"?e:qP}function uN(e){const t=document.documentElement;e==="light"||e==="system"&&!window.matchMedia(TR).matches?t.classList.add(oN):t.classList.remove(oN)}function VP({children:e}){const[t,n]=j.useState(UP),r=a=>{localStorage.setItem(kR,a),n(a)};return j.useEffect(()=>{uN(t)},[t]),j.useEffect(()=>{if(t!=="system")return;const a=window.matchMedia(TR),i=()=>uN("system");return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[t]),h.jsx(jR.Provider,{value:{theme:t,setTheme:r},children:e})}function HP(){const e=j.useContext(jR);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const AR="myco-ui-font",$P="default",RR={default:{heading:"'Newsreader', Georgia, serif",ui:"'Inter', system-ui, sans-serif",data:"'JetBrains Mono', 'Fira Code', monospace"},"geist-mono":{heading:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",ui:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",data:"'Geist Mono', 'SF Mono', 'Fira Code', monospace"},system:{heading:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ui:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",data:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"},"sf-mono":{heading:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",ui:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",data:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace"},"fira-code":{heading:"'Fira Code', 'Fira Mono', ui-monospace, monospace",ui:"'Fira Code', 'Fira Mono', ui-monospace, monospace",data:"'Fira Code', 'Fira Mono', ui-monospace, monospace"},"jetbrains-mono":{heading:"'JetBrains Mono', ui-monospace, monospace",ui:"'JetBrains Mono', ui-monospace, monospace",data:"'JetBrains Mono', ui-monospace, monospace"}},GP=new Set(Object.keys(RR)),DR=j.createContext(void 0);function KP(){const e=localStorage.getItem(AR);return e&&GP.has(e)?e:$P}function YP(e){const t=RR[e],n=document.documentElement.style;n.setProperty("--font-heading",t.heading),n.setProperty("--font-ui",t.ui),n.setProperty("--font-data",t.data)}function XP({children:e}){const[t,n]=j.useState(KP),r=a=>{localStorage.setItem(AR,a),n(a)};return j.useEffect(()=>{YP(t)},[t]),h.jsx(DR.Provider,{value:{font:t,setFont:r},children:e})}function QP(){const e=j.useContext(DR);if(!e)throw new Error("useFont must be used within a FontProvider");return e}const cN=6e4,WP=3e5,ZP=200,fN={active:1,idle:2,deep_sleep:5,hidden:10},dN=["mousemove","mousedown","keydown","scroll","touchstart"],MR=j.createContext(void 0);function JP({children:e}){const[t,n]=j.useState("active"),r=j.useRef(null),a=j.useRef(null),i=j.useRef(Date.now()),l=j.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),o=j.useCallback(()=>{l(),r.current=setTimeout(()=>{n("idle"),a.current=setTimeout(()=>{n("deep_sleep")},WP-cN)},cN)},[l]),f=j.useCallback(()=>{const d=Date.now();d-i.current<ZP||(i.current=d,n("active"),o())},[o]),c=j.useCallback(()=>{document.hidden?(l(),n("hidden")):(n("active"),i.current=Date.now(),o())},[l,o]);return j.useEffect(()=>{o();for(const d of dN)document.addEventListener(d,f,{passive:!0});return document.addEventListener("visibilitychange",c),()=>{l();for(const d of dN)document.removeEventListener(d,f);document.removeEventListener("visibilitychange",c)}},[f,c,o,l]),h.jsx(MR.Provider,{value:{powerState:t},children:e})}function ez(){const e=j.useContext(MR);if(!e)throw new Error("usePowerState must be used within a PowerProvider");return e.powerState}/**
61
+ * @license lucide-react v0.460.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const tz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.460.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var nz={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
+ * @license lucide-react v0.460.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const rz=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...o},f)=>j.createElement("svg",{ref:f,...nz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OR("lucide",a),...o},[...l.map(([c,d])=>j.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
76
+ * @license lucide-react v0.460.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Ie=(e,t)=>{const n=j.forwardRef(({className:r,...a},i)=>j.createElement(rz,{ref:i,iconNode:t,className:OR(`lucide-${tz(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
81
+ * @license lucide-react v0.460.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const db=Ie("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
86
+ * @license lucide-react v0.460.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const az=Ie("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
91
+ * @license lucide-react v0.460.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const di=Ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
96
+ * @license lucide-react v0.460.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const hb=Ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
101
+ * @license lucide-react v0.460.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const LR=Ie("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
106
+ * @license lucide-react v0.460.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const iz=Ie("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
111
+ * @license lucide-react v0.460.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const bd=Ie("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
116
+ * @license lucide-react v0.460.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const wd=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
121
+ * @license lucide-react v0.460.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const Ua=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
126
+ * @license lucide-react v0.460.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const C1=Ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
131
+ * @license lucide-react v0.460.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const ua=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
136
+ * @license lucide-react v0.460.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const sz=Ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
141
+ * @license lucide-react v0.460.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Ar=Ie("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
146
+ * @license lucide-react v0.460.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const vb=Ie("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
151
+ * @license lucide-react v0.460.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const _R=Ie("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
156
+ * @license lucide-react v0.460.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Sd=Ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
161
+ * @license lucide-react v0.460.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const lz=Ie("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
166
+ * @license lucide-react v0.460.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Ed=Ie("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
171
+ * @license lucide-react v0.460.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const oz=Ie("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
176
+ * @license lucide-react v0.460.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const BR=Ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
181
+ * @license lucide-react v0.460.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const uz=Ie("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
186
+ * @license lucide-react v0.460.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const PR=Ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
191
+ * @license lucide-react v0.460.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const N1=Ie("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
196
+ * @license lucide-react v0.460.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const cz=Ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
201
+ * @license lucide-react v0.460.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const Cd=Ie("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
206
+ * @license lucide-react v0.460.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const fz=Ie("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
211
+ * @license lucide-react v0.460.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const dz=Ie("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
216
+ * @license lucide-react v0.460.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const hz=Ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
221
+ * @license lucide-react v0.460.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const vz=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
226
+ * @license lucide-react v0.460.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const pz=Ie("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
231
+ * @license lucide-react v0.460.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const mz=Ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
236
+ * @license lucide-react v0.460.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const gz=Ie("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
241
+ * @license lucide-react v0.460.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const zR=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
246
+ * @license lucide-react v0.460.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const yz=Ie("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
251
+ * @license lucide-react v0.460.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const xz=Ie("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
256
+ * @license lucide-react v0.460.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const bz=Ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
261
+ * @license lucide-react v0.460.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const qn=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
266
+ * @license lucide-react v0.460.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const wz=Ie("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);/**
271
+ * @license lucide-react v0.460.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const Sz=Ie("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
276
+ * @license lucide-react v0.460.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const Rp=Ie("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
281
+ * @license lucide-react v0.460.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const Ez=Ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
286
+ * @license lucide-react v0.460.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const IR=Ie("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
291
+ * @license lucide-react v0.460.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const Cz=Ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
296
+ * @license lucide-react v0.460.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const Nz=Ie("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
301
+ * @license lucide-react v0.460.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const kz=Ie("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
306
+ * @license lucide-react v0.460.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const Zu=Ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
311
+ * @license lucide-react v0.460.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const Tz=Ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
316
+ * @license lucide-react v0.460.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const FR=Ie("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
321
+ * @license lucide-react v0.460.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const vo=Ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
326
+ * @license lucide-react v0.460.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const k1=Ie("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
331
+ * @license lucide-react v0.460.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const qR=Ie("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
336
+ * @license lucide-react v0.460.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const lc=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
341
+ * @license lucide-react v0.460.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const jz=Ie("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
346
+ * @license lucide-react v0.460.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const Az=Ie("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
351
+ * @license lucide-react v0.460.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const Rz=Ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
356
+ * @license lucide-react v0.460.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const Dz=Ie("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
361
+ * @license lucide-react v0.460.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const T1=Ie("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
366
+ * @license lucide-react v0.460.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const Mz=Ie("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
371
+ * @license lucide-react v0.460.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const Oz=Ie("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
376
+ * @license lucide-react v0.460.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const Lz=Ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
381
+ * @license lucide-react v0.460.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const dl=Ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
386
+ * @license lucide-react v0.460.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const UR=Ie("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
391
+ * @license lucide-react v0.460.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const _z=Ie("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
396
+ * @license lucide-react v0.460.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const Bz=Ie("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
401
+ * @license lucide-react v0.460.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const Pz=Ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
406
+ * @license lucide-react v0.460.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const zz=Ie("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
411
+ * @license lucide-react v0.460.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const VR=Ie("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
416
+ * @license lucide-react v0.460.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const ns=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
421
+ * @license lucide-react v0.460.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const Iz=Ie("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Fz=6e4,qz=3e4;function Uz(e,t,n){if(t==="heartbeat"){const r=e*fN[n];return n==="hidden"?Math.min(r,Fz):n==="deep_sleep"?Math.min(r,qz):r}return n==="deep_sleep"||n==="hidden"?!1:e*fN[n]}function ca(e){const t=ez(),{pollCategory:n,refetchInterval:r,...a}=e,i=Uz(r,n,t);return tn({...a,refetchInterval:i})}const Vz="/api";async function ot(e,t){var l;const n=(l=t==null?void 0:t.method)==null?void 0:l.toUpperCase(),a=n==="POST"||n==="PUT"?{"Content-Type":"application/json",...t==null?void 0:t.headers}:t==null?void 0:t.headers,i=await fetch(`${Vz}${e}`,{...t,headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Hz(i.status,o)}return i.json()}async function kn(e,t){return ot(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function oc(e,t){return ot(e,{method:"PUT",body:JSON.stringify(t)})}async function j1(e){return ot(e,{method:"DELETE"})}class Hz extends Error{constructor(t,n){super(`API error ${t}`),this.status=t,this.body=n}}const Rr={HEALTH:5e3,STATS:1e4,LOGS:3e3,UPDATE:3e5},$z=1e4,Gz=["debug","info","warn","error"],np={debug:0,info:1,warn:2,error:3},Kz="built-in",A1="user",$r=50,pb=5,HR=5e3,$R=3;function GR(e){switch(e){case"info":return"default";case"warn":return"warning";case"error":return"destructive";default:return"secondary"}}function R1(e){switch(e){case"info":return"bg-primary";case"debug":return"bg-outline";case"warn":return"bg-secondary";case"error":return"bg-tertiary";default:return"bg-outline"}}const D1=["update-status"];function KR(){return ca({queryKey:[...D1],queryFn:({signal:e})=>ot("/update/status",{signal:e}),refetchInterval:Rr.UPDATE,pollCategory:"standard"})}function Yz(){const e=Vn();return br({mutationFn:()=>kn("/update/check"),onSuccess:()=>{e.invalidateQueries({queryKey:[...D1]})}})}function Xz(){return br({mutationFn:()=>kn("/update/apply")})}function Qz(){const e=Vn();return br({mutationFn:t=>oc("/update/channel",{channel:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[...D1]})}})}function Dp(){return ca({queryKey:["daemon-stats"],queryFn:({signal:e})=>ot("/stats",{signal:e}),refetchInterval:Rr.STATS,pollCategory:"standard"})}const By=500,Wz=3e4;function M1(){const[e,t]=j.useState(!1),n=j.useRef(null);return{restart:j.useCallback(async(a=!1)=>{t(!0);try{const i=await kn("/restart",{force:a});if(i.status==="busy")return t(!1),i;const l=Date.now()+Wz;n.current=new AbortController,await new Promise((o,f)=>{const c=async()=>{if(Date.now()>l){f(new Error("Restart timeout"));return}try{if((await fetch("/health",{signal:n.current.signal})).ok){o();return}setTimeout(c,By)}catch{setTimeout(c,By)}};setTimeout(c,By)}),window.location.reload()}catch(i){throw t(!1),i}},[]),isRestarting:e}}function YR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=YR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XR(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=YR(e))&&(r&&(r+=" "),r+=t);return r}const hN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vN=XR,Mp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return vN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(c=>{const d=n==null?void 0:n[c],p=i==null?void 0:i[c];if(d===null)return null;const m=hN(d)||hN(p);return a[c][m]}),o=n&&Object.entries(n).reduce((c,d)=>{let[p,m]=d;return m===void 0||(c[p]=m),c},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:p,className:m,...y}=d;return Object.entries(y).every(x=>{let[b,S]=x;return Array.isArray(S)?S.includes({...i,...o}[b]):{...i,...o}[b]===S})?[...c,p,m]:c},[]);return vN(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},O1="-",Zz=e=>{const t=eI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split(O1);return o[0]===""&&o.length!==1&&o.shift(),QR(o,t)||Jz(l)},getConflictingClassGroupIds:(l,o)=>{const f=n[l]||[];return o&&r[l]?[...f,...r[l]]:f}}},QR=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?QR(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(O1);return(l=t.validators.find(({validator:o})=>o(i)))==null?void 0:l.classGroupId},pN=/^\[(.+)\]$/,Jz=e=>{if(pN.test(e)){const t=pN.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eI=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nI(Object.entries(e.classGroups),n).forEach(([i,l])=>{mb(l,r,i,t)}),r},mb=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:mN(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(tI(a)){mb(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{mb(l,mN(t,i),n,r)})})},mN=(e,t)=>{let n=e;return t.split(O1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tI=e=>e.isThemeGetter,nI=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,o])=>[t+l,o])):i);return[n,a]}):e,rI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},WR="!",aI=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,l=o=>{const f=[];let c=0,d=0,p;for(let S=0;S<o.length;S++){let w=o[S];if(c===0){if(w===a&&(r||o.slice(S,S+i)===t)){f.push(o.slice(d,S)),d=S+i;continue}if(w==="/"){p=S;continue}}w==="["?c++:w==="]"&&c--}const m=f.length===0?o:o.substring(d),y=m.startsWith(WR),x=y?m.substring(1):m,b=p&&p>d?p-d:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:b}};return n?o=>n({className:o,parseClassName:l}):l},iI=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},sI=e=>({cache:rI(e.cacheSize),parseClassName:aI(e),...Zz(e)}),lI=/\s+/,oI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],l=e.trim().split(lI);let o="";for(let f=l.length-1;f>=0;f-=1){const c=l[f],{modifiers:d,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}=n(c);let x=!!y,b=r(x?m.substring(0,y):m);if(!b){if(!x){o=c+(o.length>0?" "+o:o);continue}if(b=r(m),!b){o=c+(o.length>0?" "+o:o);continue}x=!1}const S=iI(d).join(":"),w=p?S+WR:S,N=w+b;if(i.includes(N))continue;i.push(N);const C=a(b,x);for(let T=0;T<C.length;++T){const R=C[T];i.push(w+R)}o=c+(o.length>0?" "+o:o)}return o};function uI(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ZR(t))&&(r&&(r+=" "),r+=n);return r}const ZR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ZR(e[r]))&&(n&&(n+=" "),n+=t);return n};function cI(e,...t){let n,r,a,i=l;function l(f){const c=t.reduce((d,p)=>p(d),e());return n=sI(c),r=n.cache.get,a=n.cache.set,i=o,o(f)}function o(f){const c=r(f);if(c)return c;const d=oI(f,n);return a(f,d),d}return function(){return i(uI.apply(null,arguments))}}const an=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},JR=/^\[(?:([a-z-]+):)?(.+)\]$/i,fI=/^\d+\/\d+$/,dI=new Set(["px","full","screen"]),hI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qi=e=>Du(e)||dI.has(e)||fI.test(e),Fs=e=>uc(e,"length",NI),Du=e=>!!e&&!Number.isNaN(Number(e)),Py=e=>uc(e,"number",Du),yf=e=>!!e&&Number.isInteger(Number(e)),yI=e=>e.endsWith("%")&&Du(e.slice(0,-1)),gt=e=>JR.test(e),qs=e=>hI.test(e),xI=new Set(["length","size","percentage"]),bI=e=>uc(e,xI,eD),wI=e=>uc(e,"position",eD),SI=new Set(["image","url"]),EI=e=>uc(e,SI,TI),CI=e=>uc(e,"",kI),xf=()=>!0,uc=(e,t,n)=>{const r=JR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},NI=e=>vI.test(e)&&!pI.test(e),eD=()=>!1,kI=e=>mI.test(e),TI=e=>gI.test(e),jI=()=>{const e=an("colors"),t=an("spacing"),n=an("blur"),r=an("brightness"),a=an("borderColor"),i=an("borderRadius"),l=an("borderSpacing"),o=an("borderWidth"),f=an("contrast"),c=an("grayscale"),d=an("hueRotate"),p=an("invert"),m=an("gap"),y=an("gradientColorStops"),x=an("gradientColorStopPositions"),b=an("inset"),S=an("margin"),w=an("opacity"),N=an("padding"),C=an("saturate"),T=an("scale"),R=an("sepia"),A=an("skew"),D=an("space"),L=an("translate"),B=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",gt,t],P=()=>[gt,t],H=()=>["",qi,Fs],$=()=>["auto",Du,gt],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",gt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Du,gt];return{cacheSize:500,separator:":",theme:{colors:[xf],spacing:[qi,Fs],blur:["none","",qs,gt],brightness:q(),borderColor:[e],borderRadius:["none","","full",qs,gt],borderSpacing:P(),borderWidth:H(),contrast:q(),grayscale:Q(),hueRotate:q(),invert:Q(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[yI,Fs],inset:_(),margin:_(),opacity:q(),padding:P(),saturate:q(),scale:q(),sepia:Q(),skew:q(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",gt]}],container:["container"],columns:[{columns:[qs]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),gt]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yf,gt]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",yf,gt]}],"grid-cols":[{"grid-cols":[xf]}],"col-start-end":[{col:["auto",{span:["full",yf,gt]},gt]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[xf]}],"row-start-end":[{row:["auto",{span:[yf,gt]},gt]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gt,t]}],"min-w":[{"min-w":[gt,t,"min","max","fit"]}],"max-w":[{"max-w":[gt,t,"none","full","min","max","fit","prose",{screen:[qs]},qs]}],h:[{h:[gt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qs,Fs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Py]}],"font-family":[{font:[xf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gt]}],"line-clamp":[{"line-clamp":["none",Du,Py]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qi,gt]}],"list-image":[{"list-image":["none",gt]}],"list-style-type":[{list:["none","disc","decimal",gt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qi,Fs]}],"underline-offset":[{"underline-offset":["auto",qi,gt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),wI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},EI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:I()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[qi,gt]}],"outline-w":[{outline:[qi,Fs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qi,Fs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qs,CI]}],"shadow-color":[{shadow:[xf]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",qs,gt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[C]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",gt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",gt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[yf,gt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qi,Fs,Py]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},AI=cI(jI);function Te(...e){return AI(XR(e))}const RI=Mp("inline-flex items-center justify-center whitespace-nowrap rounded-md font-sans text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-sm hover:shadow-[0_0_0_1px_rgba(171,207,184,0.4)]",destructive:"bg-gradient-to-br from-tertiary to-tertiary-container text-on-surface shadow-sm hover:shadow-[0_0_0_1px_rgba(255,180,161,0.4)]",outline:"border border-[var(--ghost-border)] bg-transparent shadow-sm hover:bg-surface-container-high hover:text-on-surface",secondary:"border border-outline-variant/20 bg-transparent hover:bg-surface-container-high text-on-surface",ghost:"hover:bg-surface-container-high text-on-surface-variant hover:text-on-surface",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),_e=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>h.jsx("button",{className:Te(RI({variant:t,size:n,className:e})),ref:a,...r}));_e.displayName="Button";function Jt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function gN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tD(...e){return t=>{let n=!1;const r=e.map(a=>{const i=gN(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():gN(e[a],null)}}}}function Tn(...e){return j.useCallback(tD(...e),e)}function DI(e,t){const n=j.createContext(t),r=i=>{const{children:l,...o}=i,f=j.useMemo(()=>o,Object.values(o));return h.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function a(i){const l=j.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function Op(e,t=[]){let n=[];function r(i,l){const o=j.createContext(l),f=n.length;n=[...n,l];const c=p=>{var w;const{scope:m,children:y,...x}=p,b=((w=m==null?void 0:m[e])==null?void 0:w[f])||o,S=j.useMemo(()=>x,Object.values(x));return h.jsx(b.Provider,{value:S,children:y})};c.displayName=i+"Provider";function d(p,m){var b;const y=((b=m==null?void 0:m[e])==null?void 0:b[f])||o,x=j.useContext(y);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,d]}const a=()=>{const i=n.map(l=>j.createContext(l));return function(o){const f=(o==null?void 0:o[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...o,[e]:f}}),[o,f])}};return a.scopeName=e,[r,MI(a,...t)]}function MI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((o,{useScope:f,scopeName:c})=>{const p=f(i)[`__scope${c}`];return{...o,...p}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var gr=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},OI=YA[" useId ".trim().toString()]||(()=>{}),LI=0;function Mu(e){const[t,n]=j.useState(OI());return gr(()=>{n(r=>r??String(LI++))},[e]),t?`radix-${t}`:""}var _I=YA[" useInsertionEffect ".trim().toString()]||gr;function rp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=BI({defaultProp:t,onChange:n}),o=e!==void 0,f=o?e:a;{const d=j.useRef(e!==void 0);j.useEffect(()=>{const p=d.current;p!==o&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const c=j.useCallback(d=>{var p;if(o){const m=PI(d)?d(e):d;m!==e&&((p=l.current)==null||p.call(l,m))}else i(d)},[o,e,i,l]);return[f,c]}function BI({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),a=j.useRef(n),i=j.useRef(t);return _I(()=>{i.current=t},[t]),j.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}function PI(e){return typeof e=="function"}function Qf(e){const t=zI(e),n=j.forwardRef((r,a)=>{const{children:i,...l}=r,o=j.Children.toArray(i),f=o.find(FI);if(f){const c=f.props.children,d=o.map(p=>p===f?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:p);return h.jsx(t,{...l,ref:a,children:j.isValidElement(c)?j.cloneElement(c,void 0,d):null})}return h.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function zI(e){const t=j.forwardRef((n,r)=>{const{children:a,...i}=n;if(j.isValidElement(a)){const l=UI(a),o=qI(i,a.props);return a.type!==j.Fragment&&(o.ref=r?tD(r,l):l),j.cloneElement(a,o)}return j.Children.count(a)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var II=Symbol("radix.slottable");function FI(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===II}function qI(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...o)=>{const f=i(...o);return a(...o),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function UI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var VI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qt=VI.reduce((e,t)=>{const n=Qf(`Primitive.${t}`),r=j.forwardRef((a,i)=>{const{asChild:l,...o}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function HI(e,t){e&&xd.flushSync(()=>e.dispatchEvent(t))}function po(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function $I(e,t=globalThis==null?void 0:globalThis.document){const n=po(e);j.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var GI="DismissableLayer",gb="dismissableLayer.update",KI="dismissableLayer.pointerDownOutside",YI="dismissableLayer.focusOutside",yN,nD=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),L1=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:o,...f}=e,c=j.useContext(nD),[d,p]=j.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=j.useState({}),x=Tn(t,D=>p(D)),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(S),N=d?b.indexOf(d):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,T=N>=w,R=WI(D=>{const L=D.target,B=[...c.branches].some(M=>M.contains(L));!T||B||(a==null||a(D),l==null||l(D),D.defaultPrevented||o==null||o())},m),A=ZI(D=>{const L=D.target;[...c.branches].some(M=>M.contains(L))||(i==null||i(D),l==null||l(D),D.defaultPrevented||o==null||o())},m);return $I(D=>{N===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},m),j.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(yN=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),xN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=yN)}},[d,m,n,c]),j.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),xN())},[d,c]),j.useEffect(()=>{const D=()=>y({});return document.addEventListener(gb,D),()=>document.removeEventListener(gb,D)},[]),h.jsx(Qt.div,{...f,ref:x,style:{pointerEvents:C?T?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,R.onPointerDownCapture)})});L1.displayName=GI;var XI="DismissableLayerBranch",QI=j.forwardRef((e,t)=>{const n=j.useContext(nD),r=j.useRef(null),a=Tn(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(Qt.div,{...e,ref:a})});QI.displayName=XI;function WI(e,t=globalThis==null?void 0:globalThis.document){const n=po(e),r=j.useRef(!1),a=j.useRef(()=>{});return j.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let f=function(){rD(KI,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ZI(e,t=globalThis==null?void 0:globalThis.document){const n=po(e),r=j.useRef(!1);return j.useEffect(()=>{const a=i=>{i.target&&!r.current&&rD(YI,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xN(){const e=new CustomEvent(gb);document.dispatchEvent(e)}function rD(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?HI(a,i):a.dispatchEvent(i)}var zy="focusScope.autoFocusOnMount",Iy="focusScope.autoFocusOnUnmount",bN={bubbles:!1,cancelable:!0},JI="FocusScope",_1=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[o,f]=j.useState(null),c=po(a),d=po(i),p=j.useRef(null),m=Tn(t,b=>f(b)),y=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let b=function(C){if(y.paused||!o)return;const T=C.target;o.contains(T)?p.current=T:Ks(p.current,{select:!0})},S=function(C){if(y.paused||!o)return;const T=C.relatedTarget;T!==null&&(o.contains(T)||Ks(p.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Ks(o)};document.addEventListener("focusin",b),document.addEventListener("focusout",S);const N=new MutationObserver(w);return o&&N.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),N.disconnect()}}},[r,o,y.paused]),j.useEffect(()=>{if(o){SN.add(y);const b=document.activeElement;if(!o.contains(b)){const w=new CustomEvent(zy,bN);o.addEventListener(zy,c),o.dispatchEvent(w),w.defaultPrevented||(e6(i6(aD(o)),{select:!0}),document.activeElement===b&&Ks(o))}return()=>{o.removeEventListener(zy,c),setTimeout(()=>{const w=new CustomEvent(Iy,bN);o.addEventListener(Iy,d),o.dispatchEvent(w),w.defaultPrevented||Ks(b??document.body,{select:!0}),o.removeEventListener(Iy,d),SN.remove(y)},0)}}},[o,c,d,y]);const x=j.useCallback(b=>{if(!n&&!r||y.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(S&&w){const N=b.currentTarget,[C,T]=t6(N);C&&T?!b.shiftKey&&w===T?(b.preventDefault(),n&&Ks(C,{select:!0})):b.shiftKey&&w===C&&(b.preventDefault(),n&&Ks(T,{select:!0})):w===N&&b.preventDefault()}},[n,r,y.paused]);return h.jsx(Qt.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});_1.displayName=JI;function e6(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ks(r,{select:t}),document.activeElement!==n)return}function t6(e){const t=aD(e),n=wN(t,e),r=wN(t.reverse(),e);return[n,r]}function aD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wN(e,t){for(const n of e)if(!n6(n,{upTo:t}))return n}function n6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function r6(e){return e instanceof HTMLInputElement&&"select"in e}function Ks(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&r6(e)&&t&&e.select()}}var SN=a6();function a6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=EN(e,t),e.unshift(t)},remove(t){var n;e=EN(e,t),(n=e[0])==null||n.resume()}}}function EN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function i6(e){return e.filter(t=>t.tagName!=="A")}var s6="Portal",B1=j.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=j.useState(!1);gr(()=>i(!0),[]);const l=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return l?FP.createPortal(h.jsx(Qt.div,{...r,ref:t}),l):null});B1.displayName=s6;function l6(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Lp=e=>{const{present:t,children:n}=e,r=o6(t),a=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=Tn(r.ref,u6(a));return typeof n=="function"||r.isPresent?j.cloneElement(a,{ref:i}):null};Lp.displayName="Presence";function o6(e){const[t,n]=j.useState(),r=j.useRef(null),a=j.useRef(e),i=j.useRef("none"),l=e?"mounted":"unmounted",[o,f]=l6(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=ov(r.current);i.current=o==="mounted"?c:"none"},[o]),gr(()=>{const c=r.current,d=a.current;if(d!==e){const m=i.current,y=ov(c);e?f("MOUNT"):y==="none"||(c==null?void 0:c.display)==="none"?f("UNMOUNT"):f(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),gr(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,p=y=>{const b=ov(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(f("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},m=y=>{y.target===t&&(i.current=ov(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:j.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ov(e){return(e==null?void 0:e.animationName)||"none"}function u6(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fy=0;function iD(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??CN()),document.body.insertAdjacentElement("beforeend",e[1]??CN()),Fy++,()=>{Fy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Fy--}},[])}function CN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var oi=function(){return oi=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},oi.apply(this,arguments)};function sD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function c6(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var zv="right-scroll-bar-position",Iv="width-before-scroll-bar",f6="with-scroll-bars-hidden",d6="--removed-body-scroll-bar-size";function qy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function h6(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var v6=typeof window<"u"?j.useLayoutEffect:j.useEffect,NN=new WeakMap;function p6(e,t){var n=h6(null,function(r){return e.forEach(function(a){return qy(a,r)})});return v6(function(){var r=NN.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(o){i.has(o)||qy(o,null)}),i.forEach(function(o){a.has(o)||qy(o,l)})}NN.set(n,e)},[e]),n}function m6(e){return e}function g6(e,t){t===void 0&&(t=m6);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(o){return o!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var o=n;n=[],o.forEach(i),l=n}var f=function(){var d=l;l=[],d.forEach(i)},c=function(){return Promise.resolve().then(f)};c(),n={push:function(d){l.push(d),c()},filter:function(d){return l=l.filter(d),n}}}};return a}function y6(e){e===void 0&&(e={});var t=g6(null);return t.options=oi({async:!0,ssr:!1},e),t}var lD=function(e){var t=e.sideCar,n=sD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,oi({},n))};lD.isSideCarExport=!0;function x6(e,t){return e.useMedium(t),lD}var oD=y6(),Uy=function(){},_p=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Uy,onWheelCapture:Uy,onTouchMoveCapture:Uy}),a=r[0],i=r[1],l=e.forwardProps,o=e.children,f=e.className,c=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,y=e.noRelative,x=e.noIsolation,b=e.inert,S=e.allowPinchZoom,w=e.as,N=w===void 0?"div":w,C=e.gapMode,T=sD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,A=p6([n,t]),D=oi(oi({},T),a);return j.createElement(j.Fragment,null,d&&j.createElement(R,{sideCar:oD,removeScrollBar:c,shards:p,noRelative:y,noIsolation:x,inert:b,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:C}),l?j.cloneElement(j.Children.only(o),oi(oi({},D),{ref:A})):j.createElement(N,oi({},D,{className:f,ref:A}),o))});_p.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_p.classNames={fullWidth:Iv,zeroRight:zv};var b6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function w6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=b6();return t&&e.setAttribute("nonce",t),e}function S6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function E6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var C6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=w6())&&(S6(t,n),E6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},N6=function(){var e=C6();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uD=function(){var e=N6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},k6={left:0,top:0,right:0,gap:0},Vy=function(e){return parseInt(e||"",10)||0},T6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Vy(n),Vy(r),Vy(a)]},j6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return k6;var t=T6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},A6=uD(),Ou="data-scroll-locked",R6=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,o=e.gap;return n===void 0&&(n="margin"),`
426
+ .`.concat(f6,` {
427
+ overflow: hidden `).concat(r,`;
428
+ padding-right: `).concat(o,"px ").concat(r,`;
429
+ }
430
+ body[`).concat(Ou,`] {
431
+ overflow: hidden `).concat(r,`;
432
+ overscroll-behavior: contain;
433
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
434
+ padding-left: `.concat(a,`px;
435
+ padding-top: `).concat(i,`px;
436
+ padding-right: `).concat(l,`px;
437
+ margin-left:0;
438
+ margin-top:0;
439
+ margin-right: `).concat(o,"px ").concat(r,`;
440
+ `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
441
+ }
442
+
443
+ .`).concat(zv,` {
444
+ right: `).concat(o,"px ").concat(r,`;
445
+ }
446
+
447
+ .`).concat(Iv,` {
448
+ margin-right: `).concat(o,"px ").concat(r,`;
449
+ }
450
+
451
+ .`).concat(zv," .").concat(zv,` {
452
+ right: 0 `).concat(r,`;
453
+ }
454
+
455
+ .`).concat(Iv," .").concat(Iv,` {
456
+ margin-right: 0 `).concat(r,`;
457
+ }
458
+
459
+ body[`).concat(Ou,`] {
460
+ `).concat(d6,": ").concat(o,`px;
461
+ }
462
+ `)},kN=function(){var e=parseInt(document.body.getAttribute(Ou)||"0",10);return isFinite(e)?e:0},D6=function(){j.useEffect(function(){return document.body.setAttribute(Ou,(kN()+1).toString()),function(){var e=kN()-1;e<=0?document.body.removeAttribute(Ou):document.body.setAttribute(Ou,e.toString())}},[])},M6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;D6();var i=j.useMemo(function(){return j6(a)},[a]);return j.createElement(A6,{styles:R6(i,!t,a,n?"":"!important")})},yb=!1;if(typeof window<"u")try{var uv=Object.defineProperty({},"passive",{get:function(){return yb=!0,!0}});window.addEventListener("test",uv,uv),window.removeEventListener("test",uv,uv)}catch{yb=!1}var fu=yb?{passive:!1}:!1,O6=function(e){return e.tagName==="TEXTAREA"},cD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!O6(e)&&n[t]==="visible")},L6=function(e){return cD(e,"overflowY")},_6=function(e){return cD(e,"overflowX")},TN=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=fD(e,r);if(a){var i=dD(e,r),l=i[1],o=i[2];if(l>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},B6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},P6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fD=function(e,t){return e==="v"?L6(t):_6(t)},dD=function(e,t){return e==="v"?B6(t):P6(t)},z6=function(e,t){return e==="h"&&t==="rtl"?-1:1},I6=function(e,t,n,r,a){var i=z6(e,window.getComputedStyle(t).direction),l=i*r,o=n.target,f=t.contains(o),c=!1,d=l>0,p=0,m=0;do{if(!o)break;var y=dD(e,o),x=y[0],b=y[1],S=y[2],w=b-S-i*x;(x||w)&&fD(e,o)&&(p+=w,m+=x);var N=o.parentNode;o=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&o!==document.body||f&&(t.contains(o)||t===o));return(d&&Math.abs(p)<1||!d&&Math.abs(m)<1)&&(c=!0),c},cv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jN=function(e){return[e.deltaX,e.deltaY]},AN=function(e){return e&&"current"in e?e.current:e},F6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},q6=function(e){return`
463
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
464
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
465
+ `)},U6=0,du=[];function V6(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),a=j.useState(U6++)[0],i=j.useState(uD)[0],l=j.useRef(e);j.useEffect(function(){l.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=c6([e.lockRef.current],(e.shards||[]).map(AN),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=j.useCallback(function(b,S){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var w=cv(b),N=n.current,C="deltaX"in b?b.deltaX:N[0]-w[0],T="deltaY"in b?b.deltaY:N[1]-w[1],R,A=b.target,D=Math.abs(C)>Math.abs(T)?"h":"v";if("touches"in b&&D==="h"&&A.type==="range")return!1;var L=window.getSelection(),B=L&&L.anchorNode,M=B?B===A||B.contains(A):!1;if(M)return!1;var _=TN(D,A);if(!_)return!0;if(_?R=D:(R=D==="v"?"h":"v",_=TN(D,A)),!_)return!1;if(!r.current&&"changedTouches"in b&&(C||T)&&(r.current=R),!R)return!0;var P=r.current||R;return I6(P,S,b,P==="h"?C:T)},[]),f=j.useCallback(function(b){var S=b;if(!(!du.length||du[du.length-1]!==i)){var w="deltaY"in S?jN(S):cv(S),N=t.current.filter(function(R){return R.name===S.type&&(R.target===S.target||S.target===R.shadowParent)&&F6(R.delta,w)})[0];if(N&&N.should){S.cancelable&&S.preventDefault();return}if(!N){var C=(l.current.shards||[]).map(AN).filter(Boolean).filter(function(R){return R.contains(S.target)}),T=C.length>0?o(S,C[0]):!l.current.noIsolation;T&&S.cancelable&&S.preventDefault()}}},[]),c=j.useCallback(function(b,S,w,N){var C={name:b,delta:S,target:w,should:N,shadowParent:H6(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(T){return T!==C})},1)},[]),d=j.useCallback(function(b){n.current=cv(b),r.current=void 0},[]),p=j.useCallback(function(b){c(b.type,jN(b),b.target,o(b,e.lockRef.current))},[]),m=j.useCallback(function(b){c(b.type,cv(b),b.target,o(b,e.lockRef.current))},[]);j.useEffect(function(){return du.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,fu),document.addEventListener("touchmove",f,fu),document.addEventListener("touchstart",d,fu),function(){du=du.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,fu),document.removeEventListener("touchmove",f,fu),document.removeEventListener("touchstart",d,fu)}},[]);var y=e.removeScrollBar,x=e.inert;return j.createElement(j.Fragment,null,x?j.createElement(i,{styles:q6(a)}):null,y?j.createElement(M6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $6=x6(oD,V6);var P1=j.forwardRef(function(e,t){return j.createElement(_p,oi({},e,{ref:t,sideCar:$6}))});P1.classNames=_p.classNames;var G6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hu=new WeakMap,fv=new WeakMap,dv={},Hy=0,hD=function(e){return e&&(e.host||hD(e.parentNode))},K6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Y6=function(e,t,n,r){var a=K6(t,Array.isArray(e)?e:[e]);dv[n]||(dv[n]=new WeakMap);var i=dv[n],l=[],o=new Set,f=new Set(a),c=function(p){!p||o.has(p)||(o.add(p),c(p.parentNode))};a.forEach(c);var d=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(o.has(m))d(m);else try{var y=m.getAttribute(r),x=y!==null&&y!=="false",b=(hu.get(m)||0)+1,S=(i.get(m)||0)+1;hu.set(m,b),i.set(m,S),l.push(m),b===1&&x&&fv.set(m,!0),S===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return d(t),o.clear(),Hy++,function(){l.forEach(function(p){var m=hu.get(p)-1,y=i.get(p)-1;hu.set(p,m),i.set(p,y),m||(fv.has(p)||p.removeAttribute(r),fv.delete(p)),y||p.removeAttribute(n)}),Hy--,Hy||(hu=new WeakMap,hu=new WeakMap,fv=new WeakMap,dv={})}},vD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=G6(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Y6(r,a,n,"aria-hidden")):function(){return null}},Bp="Dialog",[pD]=Op(Bp),[X6,Ya]=pD(Bp),mD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,o=j.useRef(null),f=j.useRef(null),[c,d]=rp({prop:r,defaultProp:a??!1,onChange:i,caller:Bp});return h.jsx(X6,{scope:t,triggerRef:o,contentRef:f,contentId:Mu(),titleId:Mu(),descriptionId:Mu(),open:c,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(p=>!p),[d]),modal:l,children:n})};mD.displayName=Bp;var gD="DialogTrigger",yD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(gD,n),i=Tn(t,a.triggerRef);return h.jsx(Qt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":F1(a.open),...r,ref:i,onClick:Jt(e.onClick,a.onOpenToggle)})});yD.displayName=gD;var z1="DialogPortal",[Q6,xD]=pD(z1,{forceMount:void 0}),bD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ya(z1,t);return h.jsx(Q6,{scope:t,forceMount:n,children:j.Children.map(r,l=>h.jsx(Lp,{present:n||i.open,children:h.jsx(B1,{asChild:!0,container:a,children:l})}))})};bD.displayName=z1;var ap="DialogOverlay",wD=j.forwardRef((e,t)=>{const n=xD(ap,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ya(ap,e.__scopeDialog);return i.modal?h.jsx(Lp,{present:r||i.open,children:h.jsx(Z6,{...a,ref:t})}):null});wD.displayName=ap;var W6=Qf("DialogOverlay.RemoveScroll"),Z6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(ap,n);return h.jsx(P1,{as:W6,allowPinchZoom:!0,shards:[a.contentRef],children:h.jsx(Qt.div,{"data-state":F1(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),mo="DialogContent",SD=j.forwardRef((e,t)=>{const n=xD(mo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ya(mo,e.__scopeDialog);return h.jsx(Lp,{present:r||i.open,children:i.modal?h.jsx(J6,{...a,ref:t}):h.jsx(eF,{...a,ref:t})})});SD.displayName=mo;var J6=j.forwardRef((e,t)=>{const n=Ya(mo,e.__scopeDialog),r=j.useRef(null),a=Tn(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return vD(i)},[]),h.jsx(ED,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,o=l.button===0&&l.ctrlKey===!0;(l.button===2||o)&&i.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,i=>i.preventDefault())})}),eF=j.forwardRef((e,t)=>{const n=Ya(mo,e.__scopeDialog),r=j.useRef(!1),a=j.useRef(!1);return h.jsx(ED,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,o;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var f,c;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ED=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,o=Ya(mo,n),f=j.useRef(null),c=Tn(t,f);return iD(),h.jsxs(h.Fragment,{children:[h.jsx(_1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:h.jsx(L1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":F1(o.open),...l,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(tF,{titleId:o.titleId}),h.jsx(rF,{contentRef:f,descriptionId:o.descriptionId})]})]})}),I1="DialogTitle",CD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(I1,n);return h.jsx(Qt.h2,{id:a.titleId,...r,ref:t})});CD.displayName=I1;var ND="DialogDescription",kD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(ND,n);return h.jsx(Qt.p,{id:a.descriptionId,...r,ref:t})});kD.displayName=ND;var TD="DialogClose",jD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(TD,n);return h.jsx(Qt.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>a.onOpenChange(!1))})});jD.displayName=TD;function F1(e){return e?"open":"closed"}var AD="DialogTitleWarning",[Dae,RD]=DI(AD,{contentName:mo,titleName:I1,docsSlug:"dialog"}),tF=({titleId:e})=>{const t=RD(AD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
466
+
467
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
468
+
469
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},nF="DialogDescriptionWarning",rF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${RD(nF).contentName}}.`;return j.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},aF=mD,iF=yD,sF=bD,DD=wD,MD=SD,OD=CD,LD=kD,lF=jD;const Nd=aF,oF=iF,uF=sF,_D=j.forwardRef(({className:e,...t},n)=>h.jsx(DD,{ref:n,className:Te("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));_D.displayName=DD.displayName;const cc=j.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(uF,{children:[h.jsx(_D,{}),h.jsxs(MD,{ref:r,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 [&>*]:min-w-0 border-0 bg-surface-container-highest p-6 shadow-ambient duration-200 sm:rounded-lg",e),...n,children:[t,h.jsxs(lF,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ns,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cc.displayName=MD.displayName;function kd({className:e,...t}){return h.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}kd.displayName="DialogHeader";function Pp({className:e,...t}){return h.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}Pp.displayName="DialogFooter";const fc=j.forwardRef(({className:e,...t},n)=>h.jsx(OD,{ref:n,className:Te("text-lg font-serif font-semibold leading-none tracking-tight",e),...t}));fc.displayName=OD.displayName;const zp=j.forwardRef(({className:e,...t},n)=>h.jsx(LD,{ref:n,className:Te("text-sm text-on-surface-variant",e),...t}));zp.displayName=LD.displayName;const cn=j.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-1 font-sans text-sm text-on-surface shadow-none transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-on-surface","placeholder:text-on-surface-variant/50","focus-visible:outline-none focus-visible:border-primary/40","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));cn.displayName="Input";var BD="Toggle",PD=j.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[l,o]=rp({prop:n,onChange:a,defaultProp:r??!1,caller:BD});return h.jsx(Qt.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Jt(e.onClick,()=>{e.disabled||o(!l)})})});PD.displayName=BD;var zD=PD;const cF=Mp("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-surface-container-high/80 hover:text-on-surface-variant focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-on-primary",{variants:{variant:{default:"bg-surface-container-high text-on-surface-variant",outline:"border border-input bg-surface-container-high text-on-surface-variant shadow-sm hover:bg-surface-container-high/80 hover:text-on-surface-variant"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),xb=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>h.jsx(zD,{ref:a,className:Te(cF({variant:t,size:n,className:e})),...r}));xb.displayName=zD.displayName;const fF=Mp("inline-flex items-center rounded-sm px-2 py-0.5 font-sans text-xs font-medium transition-colors",{variants:{variant:{default:"bg-primary/15 text-primary",secondary:"bg-surface-container-high text-on-surface-variant",destructive:"bg-tertiary/15 text-tertiary",warning:"bg-secondary/15 text-secondary",outline:"border border-[var(--ghost-border)] text-on-surface-variant"}},defaultVariants:{variant:"default"}});function Ct({className:e,variant:t,...n}){return h.jsx("div",{className:Te(fF({variant:t}),e),...n})}const dF=120,hF={session:{label:"Sessions",icon:Rp},spore:{label:"Spores",icon:T1},plan:{label:"Plans",icon:oz},prompt_batch:{label:"Prompt Batches",icon:db},activity:{label:"Activities",icon:db}};function ID(e){return hF[e]??{label:e,icon:hz}}function vF(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function pF({score:e}){const t=Math.round(e*100);return h.jsxs(Ct,{variant:"outline",className:"shrink-0 text-xs tabular-nums text-on-surface-variant",children:[t,"%"]})}function mF({result:e,onSelect:t,isHighlighted:n}){const{icon:r}=ID(e.type);return h.jsxs("button",{type:"button",onClick:()=>t(e),className:["w-full flex items-start gap-3 px-3 py-2 text-left rounded-md transition-colors",n?"bg-surface-container-high text-on-surface":"hover:bg-surface-container-high hover:text-on-surface"].join(" "),children:[h.jsx(r,{className:"h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"text-sm font-medium truncate",children:e.title})}),e.preview&&h.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:vF(e.preview,dF)})]}),h.jsx(pF,{score:e.score})]})}function gF({results:e,onSelect:t,highlightedIndex:n}){const r=e.reduce((i,l)=>{const o=l.type??"unknown";return(i[o]??(i[o]=[])).push(l),i},{});let a=0;return h.jsx("div",{className:"py-2 space-y-1",children:Object.entries(r).map(([i,l])=>{const{label:o}=ID(i),f=a;return a+=l.length,h.jsxs("div",{children:[h.jsx("div",{className:"px-3 py-1",children:h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-on-surface-variant",children:o})}),l.map((c,d)=>h.jsx(mF,{result:c,onSelect:t,isHighlighted:n===f+d},c.id))]},i)})})}const yF=2,xF=3e4;function bF(e,t="semantic"){return tn({queryKey:["search",e,t],queryFn:({signal:n})=>ot(`/search?q=${encodeURIComponent(e)}&mode=${t}`,{signal:n}),enabled:e.length>yF,staleTime:xF})}const wF=300,SF=20;function EF(e){switch(e.type){case"session":return`/sessions/${e.id}`;case"spore":return`/mycelium?tab=spores&spore=${encodeURIComponent(e.id)}`;case"plan":return e.session_id?`/sessions/${e.session_id}?tab=plans&plan=${encodeURIComponent(e.id)}`:"/sessions";case"prompt_batch":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"activity":return e.session_id?`/sessions/${e.session_id}`:"/sessions";default:return"/"}}function CF({open:e,onOpenChange:t}){const n=Ka(),[r,a]=j.useState(""),[i,l]=j.useState(""),[o,f]=j.useState("semantic"),[c,d]=j.useState(0),p=j.useRef(null);j.useEffect(()=>{const C=setTimeout(()=>{l(r.trim())},wF);return()=>clearTimeout(C)},[r]),j.useEffect(()=>{e&&(a(""),l(""),d(0),setTimeout(()=>{var C;return(C=p.current)==null?void 0:C.focus()},50))},[e]);const{data:m,isLoading:y}=bF(i,o),x=((m==null?void 0:m.results)??[]).slice(0,SF);j.useEffect(()=>{d(0)},[x.length,i]);const b=j.useCallback(C=>{const T=EF(C);t(!1),n(T)},[n,t]),S=j.useCallback(C=>{if(x.length!==0){if(C.key==="ArrowDown")C.preventDefault(),d(T=>Math.min(T+1,x.length-1));else if(C.key==="ArrowUp")C.preventDefault(),d(T=>Math.max(T-1,0));else if(C.key==="Enter"){C.preventDefault();const T=x[c];T&&b(T)}}},[x,c,b]),w=i.length>2&&!y&&x.length===0,N=i.length<=2&&!y;return h.jsx(Nd,{open:e,onOpenChange:t,children:h.jsxs(cc,{className:"max-w-2xl p-0 gap-0 overflow-hidden",onKeyDown:S,children:[h.jsx(fc,{className:"sr-only",children:"Search vault"}),h.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--ghost-border)] pl-4 pr-12 py-3",children:[h.jsx(lc,{className:"h-4 w-4 shrink-0 text-on-surface-variant"}),h.jsx(cn,{ref:p,value:r,onChange:C=>a(C.target.value),placeholder:"Search sessions, spores, plans…",className:"border-0 shadow-none focus-visible:ring-0 px-0 h-auto text-base bg-surface-bright font-mono"}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx(xb,{size:"sm",pressed:o==="semantic",onPressedChange:()=>f("semantic"),"aria-label":"Semantic search",title:"Semantic (embedded knowledge)",children:"Semantic"}),h.jsx(xb,{size:"sm",pressed:o==="fts",onPressedChange:()=>f("fts"),"aria-label":"Full-text search",title:"Full text (raw data)",children:"Full Text"})]})]}),h.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[y&&i.length>2&&h.jsx("div",{className:"px-4 py-8 text-center",children:h.jsxs("div",{className:"flex flex-col items-center gap-2 text-on-surface-variant",children:[h.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),h.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),h.jsx("div",{className:"h-3 w-28 rounded bg-muted animate-pulse"})]})}),N&&h.jsx("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:"Type to search your vault…"}),w&&h.jsxs("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:["No results for ",h.jsxs("span",{className:"font-medium text-on-surface",children:['"',i,'"']})]}),x.length>0&&!y&&h.jsx(gF,{results:x,onSelect:b,highlightedIndex:c})]}),h.jsxs("div",{className:"border-t border-[var(--ghost-border)] px-4 py-2 flex items-center gap-4 text-xs text-on-surface-variant",children:[h.jsxs("span",{children:[h.jsx("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),h.jsxs("span",{children:[h.jsx("kbd",{className:"font-mono",children:"↵"})," open"]}),h.jsxs("span",{children:[h.jsx("kbd",{className:"font-mono",children:"Esc"})," close"]}),h.jsx("span",{className:"ml-auto",children:(m==null?void 0:m.mode)&&x.length>0&&`${x.length} result${x.length!==1?"s":""} · ${m.mode}`})]})]})})}const NF=Rr.STATS;function kF(){return ca({queryKey:["notifications","unread-count"],queryFn:({signal:e})=>ot("/notifications/unread-count",{signal:e}),refetchInterval:NF,pollCategory:"standard"})}function q1(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.domain&&t.set("domain",e.domain),e!=null&&e.mode&&t.set("mode",e.mode),e!=null&&e.limit&&t.set("limit",String(e.limit));const n=t.toString(),r=n?`/notifications?${n}`:"/notifications";return tn({queryKey:["notifications","list",e],queryFn:({signal:a})=>ot(r,{signal:a})})}function TF(){return tn({queryKey:["notifications","registry"],queryFn:({signal:e})=>ot("/notifications/registry",{signal:e}),staleTime:6e4})}function FD(){const e=Vn();return br({mutationFn:({id:t,status:n})=>ot(`/notifications/${t}`,{method:"PATCH",body:JSON.stringify({status:n}),headers:{"Content-Type":"application/json"}}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function jF(){const e=Vn();return br({mutationFn:t=>kn("/notifications/dismiss-all",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function AF(){const e=Vn();return br({mutationFn:t=>kn("/notifications/mark-all-read",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}const RF=3,DF=8e3,MF={info:"bg-primary/10 border-primary/20 text-primary",success:"bg-green-500/10 border-green-500/20 text-green-600 dark:text-green-400",warning:"bg-secondary/10 border-secondary/20 text-secondary",error:"bg-tertiary/10 border-tertiary/20 text-tertiary"},OF={info:zR,success:Sd,warning:UR,error:Ar};function LF(){const{data:e}=q1({status:"unread",mode:"banner",limit:RF}),t=FD(),n=Ka(),[r,a]=j.useState(new Set),i=((e==null?void 0:e.items)??[]).filter(f=>!r.has(f.id));if(j.useEffect(()=>{const f=[];for(const c of i)c.level!=="error"&&f.push(setTimeout(()=>{a(d=>new Set(d).add(c.id)),t.mutate({id:c.id,status:"read"})},DF));return()=>f.forEach(clearTimeout)},[i.map(f=>f.id).join(",")]),i.length===0)return null;const l=f=>{t.mutate({id:f.id,status:"read"}),a(c=>new Set(c).add(f.id)),f.link&&n(f.link)},o=(f,c)=>{f.stopPropagation(),a(d=>new Set(d).add(c.id)),t.mutate({id:c.id,status:"read"})};return h.jsx("div",{className:"fixed top-3 right-3 z-50 flex flex-col gap-2 w-80",children:i.map(f=>{const c=OF[f.level];return h.jsxs("div",{onClick:()=>l(f),className:Te("flex items-start gap-2 rounded-md border px-3 py-2.5 text-sm shadow-lg cursor-pointer transition-all animate-in slide-in-from-right-5 fade-in duration-200",MF[f.level]),children:[h.jsx(c,{className:"h-4 w-4 mt-0.5 shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"font-medium truncate",children:f.title}),f.message&&h.jsx("div",{className:"text-xs mt-0.5 opacity-80 line-clamp-2",children:f.message})]}),h.jsx("button",{onClick:d=>o(d,f),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:h.jsx(ns,{className:"h-3.5 w-3.5"})})]},f.id)})})}const _F={info:"bg-primary",success:"bg-green-500",warning:"bg-secondary",error:"bg-tertiary"},BF={info:zR,success:Sd,warning:UR,error:Ar};function PF(e){const t=Math.floor(Date.now()/1e3)-e;if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function zF({open:e,onClose:t}){const{data:n,refetch:r}=q1({limit:50}),a=FD(),i=AF(),l=jF(),o=Ka();j.useEffect(()=>{e&&r()},[e,r]),j.useEffect(()=>{if(!e)return;const m=y=>{y.key==="Escape"&&(y.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]);const f=j.useCallback(m=>{m.status==="unread"&&a.mutate({id:m.id,status:"read"}),m.link&&(o(m.link),t())},[a,o,t]),c=j.useCallback((m,y)=>{m.stopPropagation(),a.mutate({id:y.id,status:"dismissed"})},[a]),d=((n==null?void 0:n.items)??[]).filter(m=>m.status!=="dismissed"),p=(n==null?void 0:n.unread_count)??0;return h.jsxs(h.Fragment,{children:[e&&h.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/40 backdrop-blur-sm transition-opacity",onClick:t,"aria-hidden":"true"}),h.jsxs("aside",{className:Te("fixed top-0 right-0 bottom-0 z-50 w-96 max-w-[calc(100vw-3rem)] flex flex-col bg-surface-container border-l border-outline-variant/20 shadow-2xl transition-transform duration-200 ease-out",e?"translate-x-0":"translate-x-full"),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/20",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h2",{className:"text-sm font-medium text-on-surface",children:"Notifications"}),p>0&&h.jsx("span",{className:"inline-flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full bg-primary/15 text-primary text-xs font-medium",children:p})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[p>0&&h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>i.mutate(void 0),title:"Mark all as read",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[h.jsx(wz,{className:"h-3.5 w-3.5"}),"Read all"]}),d.length>0&&h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>l.mutate(void 0),title:"Clear all notifications",className:"h-7 px-2 gap-1 text-xs text-on-surface-variant",children:[h.jsx(dl,{className:"h-3.5 w-3.5"}),"Clear"]}),h.jsx(_e,{variant:"ghost",size:"sm",onClick:t,className:"h-7 px-2",children:h.jsx(ns,{className:"h-4 w-4"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:d.length===0?h.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-on-surface-variant",children:"No notifications"}):h.jsx("div",{className:"divide-y divide-outline-variant/10",children:d.map(m=>{const y=BF[m.level];return h.jsxs("div",{onClick:()=>f(m),className:Te("flex items-start gap-3 px-4 py-3 transition-colors cursor-pointer hover:bg-surface-container-high",m.status==="unread"&&"bg-primary/[0.03]"),children:[h.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[h.jsx(y,{className:"h-4 w-4 text-on-surface-variant"}),m.status==="unread"&&h.jsx("span",{className:Te("absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full",_F[m.level])})]}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[h.jsx("span",{className:Te("text-sm font-medium truncate",m.status==="unread"?"text-on-surface":"text-on-surface-variant"),children:m.title}),h.jsx("span",{className:"text-[10px] text-on-surface-variant/60 shrink-0 font-mono",children:PF(m.created_at)})]}),m.message&&h.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:m.message}),h.jsx("span",{className:"text-[10px] text-on-surface-variant/40 uppercase tracking-wider mt-1 inline-block",children:m.domain})]}),m.status!=="dismissed"&&h.jsx("button",{onClick:x=>c(x,m),className:"shrink-0 mt-0.5 rounded p-0.5 text-on-surface-variant/40 hover:text-on-surface-variant transition-colors","aria-label":"Dismiss",children:h.jsx(ns,{className:"h-3.5 w-3.5"})})]},m.id)})})})]})]})}function Ip(){const e=Vn(),t=tn({queryKey:["config"],queryFn:({signal:r})=>ot("/config",{signal:r})}),n=br({mutationFn:r=>oc("/config",r),onSuccess:()=>e.invalidateQueries({queryKey:["config"]})});return{config:t.data,isLoading:t.isLoading,error:t.error,saveConfig:n.mutateAsync,isSaving:n.isPending,saveError:n.error}}function IF(){var a;const{config:e}=Ip(),t=((a=e==null?void 0:e.notifications)==null?void 0:a.system_notifications)??!1,{data:n}=q1({status:"unread",limit:5}),r=j.useRef(new Set);return j.useEffect(()=>{t&&"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[t]),j.useEffect(()=>{if(!t||!("Notification"in window)||Notification.permission!=="granted"||document.hasFocus())return;const i=(n==null?void 0:n.items)??[];for(const l of i)r.current.has(l.id)||(r.current.add(l.id),FF(l))},[t,n]),null}function FF(e){try{new window.Notification(e.title,{body:e.message??void 0,tag:e.id,icon:"/favicon.svg"})}catch{}}const qF=[{to:"/",label:"Dashboard",icon:xz},{to:"/sessions",label:"Sessions",icon:Rp},{to:"/mycelium",label:"Mycelium",icon:Nz},{to:"/skills",label:"Skills",icon:T1},{to:"/agent",label:"Agent",icon:bd},{to:"/settings",label:"Settings",icon:Rz},{to:"/operations",label:"Operations",icon:VR},{to:"/team",label:"Team",icon:Pz},{to:"/logs",label:"Logs",icon:qR}],UF=[{value:"default",label:"Default"},{value:"geist-mono",label:"Geist Mono"},{value:"system",label:"System"},{value:"sf-mono",label:"SF Mono"},{value:"fira-code",label:"Fira Code"},{value:"jetbrains-mono",label:"JetBrains"}],qD={compact:.85,normal:1,comfy:1.15},VF={compact:"Compact",normal:"Normal",comfy:"Comfy"},bf=["compact","normal","comfy"],RN="myco-ui-sidebar-collapsed",DN=768,UD="myco-ui-density",HF="--density",$F="normal";function GF(){const e=localStorage.getItem(UD);return e&&e in qD?e:$F}function KF(e){const t=qD[e];document.documentElement.style.setProperty(HF,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function YF(){const[e,t]=j.useState(GF),n=j.useCallback(r=>{localStorage.setItem(UD,r),t(r)},[]);return j.useEffect(()=>{KF(e)},[e]),{density:e,setDensity:n}}function XF(){const[e,t]=j.useState(()=>localStorage.getItem(RN)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(RN,String(a)),a})},[]);return{collapsed:e,toggle:n}}function QF(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<DN);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${DN-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=ls();j.useEffect(()=>{t(!1)},[a.pathname]),j.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);const i=j.useCallback(()=>t(o=>!o),[]),l=j.useCallback(()=>t(!1),[]);return{open:e,isMobile:n,toggle:i,close:l}}const $y=["light","dark","system"],WF={light:Lz,dark:Cz,system:IR},ZF={light:"Light",dark:"Dark",system:"System"};function JF({collapsed:e=!1}){const{theme:t,setTheme:n}=HP(),r=()=>{const l=$y.indexOf(t),o=$y[(l+1)%$y.length];n(o)},a=WF[t]??IR,i=ZF[t]??"System";return h.jsxs(_e,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:Te("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[h.jsx(a,{className:"h-4 w-4"}),!e&&h.jsx("span",{children:i})]})}function eq({collapsed:e=!1}){const{restart:t,isRestarting:n}=M1();return h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:Te("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[h.jsx(k1,{className:Te("h-4 w-4",n&&"animate-spin")}),!e&&h.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function tq(){const{font:e,setFont:t}=QP();return h.jsxs("label",{className:"flex items-center gap-2 px-2 py-1 text-sm text-on-surface-variant hover:text-on-surface cursor-pointer",children:[h.jsx(_z,{className:"h-4 w-4 shrink-0"}),h.jsx("select",{value:e,onChange:n=>t(n.target.value),className:"w-full bg-transparent border-none outline-none cursor-pointer text-sm appearance-none",children:UF.map(n=>h.jsx("option",{value:n.value,children:n.label},n.value))})]})}function nq({density:e,setDensity:t}){const n=bf.indexOf(e),r=()=>{const i=bf[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=bf[n+1];n<bf.length-1&&i!==void 0&&t(i)};return h.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[h.jsx("button",{onClick:r,disabled:n===0,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Decrease density",children:h.jsx(Ez,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex flex-1 justify-center",children:h.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:VF[e]})}),h.jsx("button",{onClick:a,disabled:n===bf.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:h.jsx(Tz,{className:"h-3 w-3"})})]})}function rq({collapsed:e}){const{data:t}=KR(),n=!!(t&&!t.exempt&&t.update_available),r=n?"/operations?tab=system":"/operations";return h.jsxs(E1,{to:r,title:e?"Operations":void 0,className:({isActive:a})=>Te("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",a?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[h.jsx(VR,{className:"h-4 w-4 shrink-0"}),!e&&"Operations",n&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-secondary shrink-0 ml-auto"})]})}function MN({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onNotificationsOpen:i,unreadCount:l,onCollapseToggle:o,showCollapseToggle:f}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Te("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),h.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),h.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&h.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),h.jsxs("div",{className:"px-2 pt-2 pb-1 space-y-0.5",children:[h.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:Te("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[h.jsx(lc,{className:"h-4 w-4 shrink-0"}),!e&&h.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&h.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]}),h.jsxs("button",{type:"button",onClick:i,title:e?"Notifications":void 0,className:Te("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[h.jsx(LR,{className:"h-4 w-4 shrink-0"}),!e&&h.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),l>0&&h.jsx("span",{className:Te("h-2 w-2 rounded-full bg-primary shrink-0",!e&&"ml-auto")})]})]}),h.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:qF.map(c=>c.to==="/operations"?h.jsx(rq,{collapsed:e},c.to):h.jsxs(E1,{to:c.to,end:c.to==="/",title:e?c.label:void 0,className:({isActive:d})=>Te("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",d?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[h.jsx(c.icon,{className:"h-4 w-4 shrink-0"}),!e&&c.label]},c.to))}),h.jsxs("div",{className:Te("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[h.jsx(eq,{collapsed:e}),!e&&h.jsx(tq,{}),!e&&h.jsx(nq,{density:n,setDensity:r}),h.jsx(JF,{collapsed:e})]}),f&&o&&h.jsx("div",{className:Te("px-2 py-2",e&&"flex justify-center"),children:h.jsxs(_e,{variant:"ghost",size:"sm",onClick:o,className:Te("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),title:e?"Expand sidebar":"Collapse sidebar",children:[e?h.jsx(ua,{className:"h-4 w-4"}):h.jsx(C1,{className:"h-4 w-4"}),!e&&h.jsx("span",{children:"Collapse"})]})})]})}function aq(){const{collapsed:e,toggle:t}=XF(),{density:n,setDensity:r}=YF(),{data:a}=Dp(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),[f,c]=j.useState(!1),{data:d}=kF(),p=(d==null?void 0:d.count)??0,m=QF();j.useEffect(()=>{const S=w=>{(w.metaKey||w.ctrlKey)&&w.key==="k"&&(w.preventDefault(),o(N=>!N))};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[]),j.useEffect(()=>{if(!m.open)return;const S=w=>{w.key==="Escape"&&(w.preventDefault(),m.close())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[m.open,m.close]);const y=j.useCallback(()=>o(!0),[]),x=j.useCallback(()=>c(!0),[]),b=j.useCallback(()=>c(!1),[]);return h.jsxs("div",{className:"flex h-screen bg-background",children:[h.jsx(CF,{open:l,onOpenChange:o}),h.jsx(LF,{}),h.jsx(zF,{open:f,onClose:b}),h.jsx(IF,{}),m.isMobile&&h.jsxs("div",{className:"fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3",children:[h.jsx("button",{type:"button",onClick:m.toggle,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":m.open?"Close navigation":"Open navigation",children:m.open?h.jsx(ns,{className:"h-5 w-5"}):h.jsx(Sz,{className:"h-5 w-5"})}),h.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&h.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[h.jsxs("button",{type:"button",onClick:x,className:"relative rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Notifications",children:[h.jsx(LR,{className:"h-4 w-4"}),p>0&&h.jsx("span",{className:"absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary"})]}),h.jsx("button",{type:"button",onClick:y,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Search",children:h.jsx(lc,{className:"h-4 w-4"})})]})]}),m.isMobile&&m.open&&h.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-sm transition-opacity",onClick:m.close,"aria-hidden":"true"}),m.isMobile&&h.jsx("aside",{className:Te("fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out",m.open?"translate-x-0":"-translate-x-full"),children:h.jsx(MN,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,showCollapseToggle:!1})}),!m.isMobile&&h.jsx("aside",{className:Te("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:h.jsx(MN,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,onCollapseToggle:t,showCollapseToggle:!0})}),h.jsx("main",{className:Te("flex-1 overflow-auto bg-surface",m.isMobile&&"pt-12"),"aria-label":"Page content",children:h.jsx(iP,{})})]})}function U1({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?h.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(qn,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{className:"font-sans text-sm",children:n})]}):t?h.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):h.jsx(h.Fragment,{children:r})}const ol=60,Tu=3600,Ff=86400,Ta=1e3;function V1(e){if(e<ol)return`${Math.floor(e)}s`;if(e<Tu)return`${Math.floor(e/ol)}m`;if(e<Ff){const r=Math.floor(e/Tu),a=Math.floor(e%Tu/ol);return`${r}h ${a}m`}const t=Math.floor(e/Ff),n=Math.floor(e%Ff/Tu);return`${t}d ${n}h`}function H1(e){const t=(Date.now()-new Date(e).getTime())/Ta;return t<ol?"just now":t<Tu?`${Math.floor(t/ol)}m ago`:t<Ff?`${Math.floor(t/Tu)}h ago`:`${Math.floor(t/Ff)}d ago`}function gi(e){return H1(new Date(e*Ta).toISOString())}function bb(e){return new Date(e*Ta).toLocaleString()}function wb(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}function $1(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fp(e,t){if(e===null||t===null)return"—";const n=(t-e)*Ta;if(n<Ta)return`${n}ms`;if(n<ol*Ta)return`${(n/Ta).toFixed(1)}s`;const r=Math.floor(n/(ol*Ta)),a=Math.floor(n%(ol*Ta)/Ta);return`${r}m ${a}s`}function iq(e){return e===null?"—":e<Ta?`${e}ms`:`${(e/Ta).toFixed(1)}s`}function Sb(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function qp(e){return e!==null?gi(e):"—"}const ON=100,sq=1;function lq(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?ON:Number((t/n*ON).toFixed(sq))}function oq(e){const t=e.agent.last_run_status==="error",n=e.embedding.queue_depth>0||e.unprocessed_batches>0;return t?"Issues detected in the network":n?"Work in progress across the network":"Network Topology Active"}function uq(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function cq({active:e}){const t=e?"animate-pulse-slow":"";return h.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[h.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),h.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),h.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),h.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),h.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),h.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),h.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),h.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),h.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),h.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),h.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),h.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),h.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),h.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function fq({stats:e}){const t=lq(e),n=oq(e),r=uq(e),a=e.daemon.active_sessions.length,i=V1(e.daemon.uptime_seconds);return h.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[h.jsx(cq,{active:r}),h.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[h.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),h.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),h.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),h.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),h.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),h.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),h.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function dq({data:e,width:t=120,height:n=40,className:r}){if(e.length<2)return null;const a=Math.min(...e),l=Math.max(...e)-a||1,o=e.map((d,p)=>({x:p/(e.length-1)*t,y:n-(d-a)/l*n}));let f=`M ${o[0].x} ${o[0].y}`;for(let d=0;d<o.length-1;d++){const p=o[Math.max(0,d-1)],m=o[d],y=o[d+1],x=o[Math.min(o.length-1,d+2)],b=m.x+(y.x-p.x)/6,S=m.y+(y.y-p.y)/6,w=y.x-(x.x-m.x)/6,N=y.y-(x.y-m.y)/6;f+=` C ${b} ${S}, ${w} ${N}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return h.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),h.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),h.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),h.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const hq={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},vq={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function sn({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=Te("rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 transition-[border-color,background-color] duration-200 hover:border-outline-variant/25 hover:bg-surface-container/80",l&&"cursor-pointer",hq[r],i),f=h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),h.jsxs("div",{className:"flex items-end justify-between gap-2",children:[h.jsx("p",{className:Te("font-serif text-2xl font-bold",vq[r]),children:t}),a&&a.length>=2&&h.jsx(dq,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&h.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?h.jsx(Ra,{to:l,className:Te(o,"block no-underline"),children:f}):h.jsx("div",{className:o,children:f})}function pq({stats:e}){const t=e.embedding.total_embeddable>0?Math.round(e.embedding.embedded_count/e.embedding.total_embeddable*100):0,n=e.digest.tiers_available.length>0?`${e.digest.tiers_available.length} tiers`:"None",r=e.agent.last_run_at?gi(e.agent.last_run_at):"Never";return h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[h.jsx(sn,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),h.jsx(sn,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),h.jsx(sn,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),h.jsx(sn,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),h.jsx(sn,{label:"Digest",value:n,sublabel:e.digest.generated_at?gi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),h.jsx(sn,{label:"Uptime",value:V1(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function VD(e=20){return ca({queryKey:["activity",e],queryFn:({signal:t})=>ot(`/activity?limit=${e}`,{signal:t}),refetchInterval:Rr.STATS,pollCategory:"standard"})}function mq(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function gq(e){switch(e){case"sage":return{label:"STABLE",dotClass:"bg-sage shadow-sage-glow"};case"ochre":return{label:"ACTIVE",dotClass:"bg-ochre shadow-ochre-glow"};case"terracotta":return{label:"WARNING",dotClass:"bg-terracotta shadow-terracotta-glow"}}}const yq={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},xq={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},bq={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},wq={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function Sq(e){return`#${e.slice(-6).toUpperCase()}`}function LN(e){return e.summary}function Eq({event:e}){const t=Ka(),n=mq(e.type),r=gq(n),a=gi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null;return h.jsxs("div",{className:Te("p-5 rounded-lg border-l-4 bg-surface-container/60 hover:bg-surface-container-high group hover-lift transition-colors",i&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",yq[n]),onClick:()=>i&&t(i),onKeyDown:l=>{i&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t(i))},tabIndex:i?0:void 0,role:i?"link":void 0,"aria-label":`${LN(e)} - ${r.label} - ${a}`,children:[h.jsxs("div",{className:"flex justify-between items-start mb-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:Te("font-mono text-xs font-bold",xq[n]),children:Sq(e.id)}),h.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:LN(e)})]}),h.jsx("div",{className:Te("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",wq[n]),children:h.jsx("div",{className:Te("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),h.jsxs("p",{className:"text-xs text-on-surface/60 line-clamp-2 leading-relaxed italic mb-3",children:["> ",e.type.replace(/_/g," ")," event recorded ",a]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:Te("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",bq[n]),children:r.label}),h.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const _N=6,Cq=3;function Nq(){return h.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[h.jsxs("div",{className:"flex justify-between items-start mb-3",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),h.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),h.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),h.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),h.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function kq(){const{data:e,isLoading:t}=VD(_N*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,_N);return h.jsxs("section",{className:"space-y-5",children:[h.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:h.jsxs("div",{children:[h.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),h.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:Cq}).map((r,a)=>h.jsx(Nq,{},a))}):n.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(FR,{className:"h-10 w-10 text-outline/30"}),h.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),h.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>h.jsx(Eq,{event:r},r.id))})]})}const Tq=Rr.STATS,jq=Rr.HEALTH,Aq=Rr.STATS,G1=new Set(["completed","failed","skipped"]),Rq=Rr.STATS,K1=6e4,Dq=50;function HD(e){const t=(e==null?void 0:e.limit)??Dq,n=new URLSearchParams;n.set("limit",String(t)),(e==null?void 0:e.offset)!==void 0&&n.set("offset",String(e.offset)),e!=null&&e.search&&n.set("search",e.search),e!=null&&e.status&&n.set("status",e.status),e!=null&&e.task&&n.set("task",e.task);const r=n.toString();return ca({queryKey:["agent-runs",e],queryFn:({signal:a})=>ot(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:Tq})}function Mq(e){return tn({queryKey:["agent-run",e],queryFn:({signal:n})=>ot(`/agent/runs/${e}`,{signal:n}),enabled:e!==void 0,refetchInterval:n=>{var a,i;const r=(i=(a=n.state.data)==null?void 0:a.run)==null?void 0:i.status;return r&&G1.has(r)?!1:jq}})}function Oq(e,t){const n=t?G1.has(t):!1;return ca({queryKey:["agent-reports",e],queryFn:({signal:r})=>ot(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:Aq})}function Lq(e,t){const n=t?G1.has(t):!1;return ca({queryKey:["agent-turns",e],queryFn:({signal:r})=>ot(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:Rq})}function dc(){return tn({queryKey:["agent-tasks"],queryFn:({signal:e})=>ot("/agent/tasks",{signal:e}),staleTime:K1})}function _q(e){return tn({queryKey:["agent-task",e],queryFn:({signal:t})=>ot(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:K1})}function Bq(){const e=Vn();return br({mutationFn:({taskId:t,name:n})=>kn(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function Pq(){const e=Vn();return br({mutationFn:t=>j1(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function zq(e){return tn({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>ot(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:K1})}function Iq(){const e=Vn();return br({mutationFn:({taskId:t,yaml:n})=>oc(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function Y1(){const e=Vn();return br({mutationFn:t=>kn("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function X1(e){return e===null?"—":`$${e.toFixed(4)}`}function Q1(e){return e===null?"—":e.toLocaleString()}function $D(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function GD(e){return e===A1?"warning":"secondary"}const KD="Default task";function YD(e,t){if(!e)return KD;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const Fq=5,BN={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function qq({run:e,taskName:t,onClick:n}){const r=BN[e.status]??BN.pending;return h.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-outline-variant/5 last:border-0 cursor-pointer hover:bg-surface-container-high/50 -mx-2 px-2 rounded transition-colors",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n())},role:"link",tabIndex:0,"aria-label":`View run: ${t}`,children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[h.jsx("span",{className:Te("h-2 w-2 shrink-0 rounded-full",r)}),h.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),h.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[h.jsx("span",{children:e.started_at!==null?gi(e.started_at):"—"}),h.jsx("span",{children:Fp(e.started_at,e.completed_at)})]})]})}function Uq(){const{data:e,isLoading:t}=HD({limit:Fq}),{data:n}=dc(),r=Ka(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return h.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[h.jsxs("div",{className:"flex justify-between items-center mb-6",children:[h.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),h.jsx(bd,{className:"h-5 w-5 text-outline"})]}),t?h.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?h.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):h.jsx("div",{children:i.map(l=>h.jsx(qq,{run:l,taskName:YD(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const Vq=12,Hq=8;function $q(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const Gq={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},Kq={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function Yq(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Xq(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function Qq({event:e,onClick:t}){const n=$q(e.type);return h.jsxs("div",{className:Te("flex gap-4 items-start border-b border-outline-variant/5 pb-2 font-mono text-[11px] transition-all duration-150",t&&"cursor-pointer hover:bg-surface-container-high/50 hover:translate-x-1 -mx-2 px-2 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"),onClick:t,onKeyDown:t?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())}:void 0,tabIndex:t?0:void 0,role:t?"link":void 0,"aria-label":t?`${e.type.replace(/_/g," ")}: ${e.summary}`:void 0,children:[h.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:Yq(e.timestamp)}),h.jsx("span",{className:Te("shrink-0 font-bold",Kq[n]),children:Gq[n]}),h.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function Wq(){const{data:e,isLoading:t}=VD(Vq),n=Ka(),r=(e==null?void 0:e.slice(0,Hq))??[];return h.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10 transition-[border-color] duration-200 hover:border-outline-variant/25",children:[h.jsxs("div",{className:"flex justify-between items-center mb-6",children:[h.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),h.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>h.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[h.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),h.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),h.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[h.jsx(qR,{className:"h-8 w-8 text-outline/20"}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):h.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=Xq(a);return h.jsx(Qq,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function Zq(e){const{embedded_count:t,total_embeddable:n}=e.embedding;if(n===0)return"Initializing";const r=t/n;return r>=.95?"Optimal":r>=.7?"Good":"Degraded"}function Jq({stats:e}){const t=Zq(e);return h.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),h.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function eU(){const{data:e,isLoading:t,isError:n,error:r}=Dp();return h.jsx(U1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&h.jsxs("div",{className:"relative min-h-full",children:[h.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:h.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[h.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),h.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),h.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),h.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[h.jsx(fq,{stats:e}),h.jsx(pq,{stats:e}),h.jsx(kq,{}),h.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(Uq,{}),h.jsx(Wq,{})]}),h.jsx(Jq,{stats:e})]})]})})}const tU=Mp("rounded-md transition-colors",{variants:{level:{lowest:"bg-surface-container-lowest",low:"bg-surface-container-low",default:"bg-surface-container",high:"bg-surface-container-high",highest:"bg-surface-container-highest",bright:"bg-surface-bright"},interactive:{true:"cursor-pointer hover-lift hover:brightness-[1.08]",false:""},ghostBorder:{true:"border border-[var(--ghost-border)]",false:""},glass:{true:"backdrop-blur-xl bg-surface-variant/60",false:""},glow:{true:"shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]",false:""}},defaultVariants:{level:"low",interactive:!1,ghostBorder:!1,glass:!1,glow:!1}}),Qe=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>h.jsx("div",{ref:o,className:Te(tU({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));Qe.displayName="Surface";function nU({tabs:e,activeTab:t,onTabChange:n,className:r}){return h.jsx("div",{className:Te("flex items-center gap-6",r),children:e.map(a=>h.jsx("button",{onClick:()=>n(a.id),className:Te("pb-2 font-sans text-sm font-medium transition-colors border-b-2",t===a.id?"text-primary border-primary":"text-on-surface-variant border-transparent hover:text-on-surface"),children:a.label},a.id))})}function yi({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return h.jsxs("div",{className:Te("pb-6",l),children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&h.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&h.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&h.jsx(nU,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function W1({open:e,onOpenChange:t,title:n,description:r,icon:a,meta:i,impact:l,confirmLabel:o="Confirm",variant:f="destructive",onConfirm:c,isPending:d=!1}){var p,m;return h.jsx(Nd,{open:e,onOpenChange:t,children:h.jsxs(cc,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[h.jsxs(kd,{children:[h.jsxs("div",{className:"flex items-center gap-3",children:[a&&h.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),h.jsx(fc,{children:n})]}),h.jsx(zp,{children:r})]}),i&&i.length>0&&h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[h.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(p=i[0])==null?void 0:p.value}),i.length>1&&h.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&h.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>h.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[h.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),h.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),h.jsxs(Pp,{children:[h.jsx(_e,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),h.jsxs(_e,{variant:f,size:"sm",onClick:c,disabled:d,className:"gap-2",children:[d&&h.jsx(qn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function PN(e,[t,n]){return Math.min(n,Math.max(t,e))}function rU(e){const t=e+"CollectionProvider",[n,r]=Op(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:S,children:w}=b,N=$i.useRef(null),C=$i.useRef(new Map).current;return h.jsx(a,{scope:S,itemMap:C,collectionRef:N,children:w})};l.displayName=t;const o=e+"CollectionSlot",f=Qf(o),c=$i.forwardRef((b,S)=>{const{scope:w,children:N}=b,C=i(o,w),T=Tn(S,C.collectionRef);return h.jsx(f,{ref:T,children:N})});c.displayName=o;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Qf(d),y=$i.forwardRef((b,S)=>{const{scope:w,children:N,...C}=b,T=$i.useRef(null),R=Tn(S,T),A=i(d,w);return $i.useEffect(()=>(A.itemMap.set(T,{ref:T,...C}),()=>void A.itemMap.delete(T))),h.jsx(m,{[p]:"",ref:R,children:N})});y.displayName=d;function x(b){const S=i(e+"CollectionConsumer",b);return $i.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const C=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((A,D)=>C.indexOf(A.ref.current)-C.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var aU=j.createContext(void 0);function iU(e){const t=j.useContext(aU);return e||t||"ltr"}const sU=["top","right","bottom","left"],hl=Math.min,aa=Math.max,ip=Math.round,hv=Math.floor,hi=e=>({x:e,y:e}),lU={left:"right",right:"left",bottom:"top",top:"bottom"};function Eb(e,t,n){return aa(e,hl(t,n))}function rs(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function hc(e){return e.split("-")[1]}function Z1(e){return e==="x"?"y":"x"}function J1(e){return e==="y"?"height":"width"}function ui(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ew(e){return Z1(ui(e))}function oU(e,t,n){n===void 0&&(n=!1);const r=hc(e),a=ew(e),i=J1(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=sp(l)),[l,sp(l)]}function uU(e){const t=sp(e);return[Cb(e),t,Cb(t)]}function Cb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const zN=["left","right"],IN=["right","left"],cU=["top","bottom"],fU=["bottom","top"];function dU(e,t,n){switch(e){case"top":case"bottom":return n?t?IN:zN:t?zN:IN;case"left":case"right":return t?cU:fU;default:return[]}}function hU(e,t,n,r){const a=hc(e);let i=dU(as(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Cb)))),i}function sp(e){const t=as(e);return lU[t]+e.slice(t.length)}function vU(e){return{top:0,right:0,bottom:0,left:0,...e}}function XD(e){return typeof e!="number"?vU(e):{top:e,right:e,bottom:e,left:e}}function lp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function FN(e,t,n){let{reference:r,floating:a}=e;const i=ui(t),l=ew(t),o=J1(l),f=as(t),c=i==="y",d=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let y;switch(f){case"top":y={x:d,y:r.y-a.height};break;case"bottom":y={x:d,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(hc(t)){case"start":y[l]-=m*(n&&c?-1:1);break;case"end":y[l]+=m*(n&&c?-1:1);break}return y}async function pU(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:o,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=rs(t,e),x=XD(y),S=o[m?p==="floating"?"reference":"floating":p],w=lp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:f})),N=p==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),T=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},R=lp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:N,offsetParent:C,strategy:f}):N);return{top:(w.top-R.top+x.top)/T.y,bottom:(R.bottom-w.bottom+x.bottom)/T.y,left:(w.left-R.left+x.left)/T.x,right:(R.right-w.right+x.right)/T.x}}const mU=50,gU=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:pU},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=FN(c,r,f),m=r,y=0;const x={};for(let b=0;b<i.length;b++){const S=i[b];if(!S)continue;const{name:w,fn:N}=S,{x:C,y:T,data:R,reset:A}=await N({x:d,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});d=C??d,p=T??p,x[w]={...x[w],...R},A&&y<mU&&(y++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:d,y:p}=FN(c,m,f)),b=-1)}return{x:d,y:p,placement:m,strategy:a,middlewareData:x}},yU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:o,middlewareData:f}=t,{element:c,padding:d=0}=rs(e,t)||{};if(c==null)return{};const p=XD(d),m={x:n,y:r},y=ew(a),x=J1(y),b=await l.getDimensions(c),S=y==="y",w=S?"top":"left",N=S?"bottom":"right",C=S?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=A?A[C]:0;(!D||!await(l.isElement==null?void 0:l.isElement(A)))&&(D=o.floating[C]||i.floating[x]);const L=T/2-R/2,B=D/2-b[x]/2-1,M=hl(p[w],B),_=hl(p[N],B),P=M,H=D-b[x]-_,$=D/2-b[x]/2+L,V=Eb(P,$,H),I=!f.arrow&&hc(a)!=null&&$!==V&&i.reference[x]/2-($<P?M:_)-b[x]/2<0,U=I?$<P?$-P:$-H:0;return{[y]:m[y]+U,data:{[y]:V,centerOffset:$-V-U,...I&&{alignmentOffset:U}},reset:I}}}),xU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:o,platform:f,elements:c}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...S}=rs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=as(a),N=ui(o),C=as(o)===o,T=await(f.isRTL==null?void 0:f.isRTL(c.floating)),R=m||(C||!b?[sp(o)]:uU(o)),A=x!=="none";!m&&A&&R.push(...hU(o,b,x,T));const D=[o,...R],L=await f.detectOverflow(t,S),B=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&B.push(L[w]),p){const $=oU(a,l,T);B.push(L[$[0]],L[$[1]])}if(M=[...M,{placement:a,overflows:B}],!B.every($=>$<=0)){var _,P;const $=(((_=i.flip)==null?void 0:_.index)||0)+1,V=D[$];if(V&&(!(p==="alignment"?N!==ui(V):!1)||M.every(Y=>ui(Y.placement)===N?Y.overflows[0]>0:!0)))return{data:{index:$,overflows:M},reset:{placement:V}};let I=(P=M.filter(U=>U.overflows[0]<=0).sort((U,Y)=>U.overflows[1]-Y.overflows[1])[0])==null?void 0:P.placement;if(!I)switch(y){case"bestFit":{var H;const U=(H=M.filter(Y=>{if(A){const Q=ui(Y.placement);return Q===N||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,F)=>Q+F,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:H[0];U&&(I=U);break}case"initialPlacement":I=o;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function qN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function UN(e){return sU.some(t=>e[t]>=0)}const bU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=rs(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=qN(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:UN(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=qN(l,n.floating);return{data:{escapedOffsets:o,escaped:UN(o)}}}default:return{}}}}},QD=new Set(["left","top"]);async function wU(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=as(n),o=hc(n),f=ui(n)==="y",c=QD.has(l)?-1:1,d=i&&f?-1:1,p=rs(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof x=="number"&&(y=o==="end"?x*-1:x),f?{x:y*d,y:m*c}:{x:m*c,y:y*d}}const SU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:o}=t,f=await wU(t,e);return l===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},EU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:o=!1,limiter:f={fn:w=>{let{x:N,y:C}=w;return{x:N,y:C}}},...c}=rs(e,t),d={x:n,y:r},p=await i.detectOverflow(t,c),m=ui(as(a)),y=Z1(m);let x=d[y],b=d[m];if(l){const w=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=x+p[w],T=x-p[N];x=Eb(C,x,T)}if(o){const w=m==="y"?"top":"left",N=m==="y"?"bottom":"right",C=b+p[w],T=b-p[N];b=Eb(C,b,T)}const S=f.fn({...t,[y]:x,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:l,[m]:o}}}}}},CU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:f=!0,crossAxis:c=!0}=rs(e,t),d={x:n,y:r},p=ui(a),m=Z1(p);let y=d[m],x=d[p];const b=rs(o,t),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const C=m==="y"?"height":"width",T=i.reference[m]-i.floating[C]+S.mainAxis,R=i.reference[m]+i.reference[C]-S.mainAxis;y<T?y=T:y>R&&(y=R)}if(c){var w,N;const C=m==="y"?"width":"height",T=QD.has(as(a)),R=i.reference[p]-i.floating[C]+(T&&((w=l.offset)==null?void 0:w[p])||0)+(T?0:S.crossAxis),A=i.reference[p]+i.reference[C]+(T?0:((N=l.offset)==null?void 0:N[p])||0)-(T?S.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[m]:y,[p]:x}}}},NU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:o}=t,{apply:f=()=>{},...c}=rs(e,t),d=await l.detectOverflow(t,c),p=as(a),m=hc(a),y=ui(a)==="y",{width:x,height:b}=i.floating;let S,w;p==="top"||p==="bottom"?(S=p,w=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(w=p,S=m==="end"?"top":"bottom");const N=b-d.top-d.bottom,C=x-d.left-d.right,T=hl(b-d[S],N),R=hl(x-d[w],C),A=!t.middlewareData.shift;let D=T,L=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=N),A&&!m){const M=aa(d.left,0),_=aa(d.right,0),P=aa(d.top,0),H=aa(d.bottom,0);y?L=x-2*(M!==0||_!==0?M+_:aa(d.left,d.right)):D=b-2*(P!==0||H!==0?P+H:aa(d.top,d.bottom))}await f({...t,availableWidth:L,availableHeight:D});const B=await l.getDimensions(o.floating);return x!==B.width||b!==B.height?{reset:{rects:!0}}:{}}}};function Up(){return typeof window<"u"}function vc(e){return WD(e)?(e.nodeName||"").toLowerCase():"#document"}function sa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bi(e){var t;return(t=(WD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function WD(e){return Up()?e instanceof Node||e instanceof sa(e).Node:!1}function Va(e){return Up()?e instanceof Element||e instanceof sa(e).Element:!1}function os(e){return Up()?e instanceof HTMLElement||e instanceof sa(e).HTMLElement:!1}function VN(e){return!Up()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sa(e).ShadowRoot}function Td(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function kU(e){return/^(table|td|th)$/.test(vc(e))}function Vp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const TU=/transform|translate|scale|rotate|perspective|filter/,jU=/paint|layout|strict|content/,Gl=e=>!!e&&e!=="none";let Gy;function tw(e){const t=Va(e)?Ha(e):e;return Gl(t.transform)||Gl(t.translate)||Gl(t.scale)||Gl(t.rotate)||Gl(t.perspective)||!nw()&&(Gl(t.backdropFilter)||Gl(t.filter))||TU.test(t.willChange||"")||jU.test(t.contain||"")}function AU(e){let t=vl(e);for(;os(t)&&!Ju(t);){if(tw(t))return t;if(Vp(t))return null;t=vl(t)}return null}function nw(){return Gy==null&&(Gy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gy}function Ju(e){return/^(html|body|#document)$/.test(vc(e))}function Ha(e){return sa(e).getComputedStyle(e)}function Hp(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vl(e){if(vc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||VN(e)&&e.host||bi(e);return VN(t)?t.host:t}function ZD(e){const t=vl(e);return Ju(t)?e.ownerDocument?e.ownerDocument.body:e.body:os(t)&&Td(t)?t:ZD(t)}function Wf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=ZD(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=sa(a);if(i){const o=Nb(l);return t.concat(l,l.visualViewport||[],Td(a)?a:[],o&&n?Wf(o):[])}else return t.concat(a,Wf(a,[],n))}function Nb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function JD(e){const t=Ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=os(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=ip(n)!==i||ip(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function rw(e){return Va(e)?e:e.contextElement}function Lu(e){const t=rw(e);if(!os(t))return hi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=JD(t);let l=(i?ip(n.width):n.width)/r,o=(i?ip(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const RU=hi(0);function eM(e){const t=sa(e);return!nw()||!t.visualViewport?RU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sa(e)?!1:t}function go(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=rw(e);let l=hi(1);t&&(r?Va(r)&&(l=Lu(r)):l=Lu(e));const o=DU(i,n,r)?eM(i):hi(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,d=a.width/l.x,p=a.height/l.y;if(i){const m=sa(i),y=r&&Va(r)?sa(r):r;let x=m,b=Nb(x);for(;b&&r&&y!==x;){const S=Lu(b),w=b.getBoundingClientRect(),N=Ha(b),C=w.left+(b.clientLeft+parseFloat(N.paddingLeft))*S.x,T=w.top+(b.clientTop+parseFloat(N.paddingTop))*S.y;f*=S.x,c*=S.y,d*=S.x,p*=S.y,f+=C,c+=T,x=sa(b),b=Nb(x)}}return lp({width:d,height:p,x:f,y:c})}function $p(e,t){const n=Hp(e).scrollLeft;return t?t.left+n:go(bi(e)).left+n}function tM(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$p(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function MU(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=bi(r),o=t?Vp(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=hi(1);const d=hi(0),p=os(r);if((p||!p&&!i)&&((vc(r)!=="body"||Td(l))&&(f=Hp(r)),p)){const y=go(r);c=Lu(r),d.x=y.x+r.clientLeft,d.y=y.y+r.clientTop}const m=l&&!p&&!i?tM(l,f):hi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-f.scrollTop*c.y+d.y+m.y}}function OU(e){return Array.from(e.getClientRects())}function LU(e){const t=bi(e),n=Hp(e),r=e.ownerDocument.body,a=aa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=aa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+$p(e);const o=-n.scrollTop;return Ha(r).direction==="rtl"&&(l+=aa(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const HN=25;function _U(e,t){const n=sa(e),r=bi(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,o=0,f=0;if(a){i=a.width,l=a.height;const d=nw();(!d||d&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=$p(r);if(c<=0){const d=r.ownerDocument,p=d.body,m=getComputedStyle(p),y=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=HN&&(i-=x)}else c<=HN&&(i+=c);return{width:i,height:l,x:o,y:f}}function BU(e,t){const n=go(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=os(e)?Lu(e):hi(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,f=a*i.x,c=r*i.y;return{width:l,height:o,x:f,y:c}}function $N(e,t,n){let r;if(t==="viewport")r=_U(e,n);else if(t==="document")r=LU(bi(e));else if(Va(t))r=BU(t,n);else{const a=eM(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return lp(r)}function nM(e,t){const n=vl(e);return n===t||!Va(n)||Ju(n)?!1:Ha(n).position==="fixed"||nM(n,t)}function PU(e,t){const n=t.get(e);if(n)return n;let r=Wf(e,[],!1).filter(o=>Va(o)&&vc(o)!=="body"),a=null;const i=Ha(e).position==="fixed";let l=i?vl(e):e;for(;Va(l)&&!Ju(l);){const o=Ha(l),f=tw(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Td(l)&&!f&&nM(e,l))?r=r.filter(d=>d!==l):a=o,l=vl(l)}return t.set(e,r),r}function zU(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Vp(t)?[]:PU(t,this._c):[].concat(n),r],o=$N(t,l[0],a);let f=o.top,c=o.right,d=o.bottom,p=o.left;for(let m=1;m<l.length;m++){const y=$N(t,l[m],a);f=aa(y.top,f),c=hl(y.right,c),d=hl(y.bottom,d),p=aa(y.left,p)}return{width:c-p,height:d-f,x:p,y:f}}function IU(e){const{width:t,height:n}=JD(e);return{width:t,height:n}}function FU(e,t,n){const r=os(t),a=bi(t),i=n==="fixed",l=go(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=hi(0);function c(){f.x=$p(a)}if(r||!r&&!i)if((vc(t)!=="body"||Td(a))&&(o=Hp(t)),r){const y=go(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&c();i&&!r&&a&&c();const d=a&&!r&&!i?tM(a,o):hi(0),p=l.left+o.scrollLeft-f.x-d.x,m=l.top+o.scrollTop-f.y-d.y;return{x:p,y:m,width:l.width,height:l.height}}function Ky(e){return Ha(e).position==="static"}function GN(e,t){if(!os(e)||Ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bi(e)===n&&(n=n.ownerDocument.body),n}function rM(e,t){const n=sa(e);if(Vp(e))return n;if(!os(e)){let a=vl(e);for(;a&&!Ju(a);){if(Va(a)&&!Ky(a))return a;a=vl(a)}return n}let r=GN(e,t);for(;r&&kU(r)&&Ky(r);)r=GN(r,t);return r&&Ju(r)&&Ky(r)&&!tw(r)?n:r||AU(e)||n}const qU=async function(e){const t=this.getOffsetParent||rM,n=this.getDimensions,r=await n(e.floating);return{reference:FU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function UU(e){return Ha(e).direction==="rtl"}const VU={convertOffsetParentRelativeRectToViewportRelativeRect:MU,getDocumentElement:bi,getClippingRect:zU,getOffsetParent:rM,getElementRects:qU,getClientRects:OU,getDimensions:IU,getScale:Lu,isElement:Va,isRTL:UU};function aM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HU(e,t){let n=null,r;const a=bi(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function l(o,f){o===void 0&&(o=!1),f===void 0&&(f=1),i();const c=e.getBoundingClientRect(),{left:d,top:p,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=hv(p),b=hv(a.clientWidth-(d+m)),S=hv(a.clientHeight-(p+y)),w=hv(d),C={rootMargin:-x+"px "+-b+"px "+-S+"px "+-w+"px",threshold:aa(0,hl(1,f))||1};let T=!0;function R(A){const D=A[0].intersectionRatio;if(D!==f){if(!T)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!aM(c,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(R,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return l(!0),i}function $U(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,c=rw(e),d=a||i?[...c?Wf(c):[],...t?Wf(t):[]]:[];d.forEach(w=>{a&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const p=c&&o?HU(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(w=>{let[N]=w;N&&N.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(t)})),n()}),c&&!f&&y.observe(c),t&&y.observe(t));let x,b=f?go(e):null;f&&S();function S(){const w=go(e);b&&!aM(b,w)&&n(),b=w,x=requestAnimationFrame(S)}return n(),()=>{var w;d.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p==null||p(),(w=y)==null||w.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const GU=SU,KU=EU,YU=xU,XU=NU,QU=bU,KN=yU,WU=CU,ZU=(e,t,n)=>{const r=new Map,a={platform:VU,...n},i={...a.platform,_c:r};return gU(e,t,{...a,platform:i})};var JU=typeof document<"u",e8=function(){},Fv=JU?j.useLayoutEffect:e8;function op(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!op(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!op(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function iM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YN(e,t){const n=iM(e);return Math.round(t*n)/n}function Yy(e){const t=j.useRef(e);return Fv(()=>{t.current=e}),t}function t8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:f,open:c}=e,[d,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);op(m,r)||y(r);const[x,b]=j.useState(null),[S,w]=j.useState(null),N=j.useCallback(Y=>{Y!==A.current&&(A.current=Y,b(Y))},[]),C=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,w(Y))},[]),T=i||x,R=l||S,A=j.useRef(null),D=j.useRef(null),L=j.useRef(d),B=f!=null,M=Yy(f),_=Yy(a),P=Yy(c),H=j.useCallback(()=>{if(!A.current||!D.current)return;const Y={placement:t,strategy:n,middleware:m};_.current&&(Y.platform=_.current),ZU(A.current,D.current,Y).then(Q=>{const F={...Q,isPositioned:P.current!==!1};$.current&&!op(L.current,F)&&(L.current=F,xd.flushSync(()=>{p(F)}))})},[m,t,n,_,P]);Fv(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[c]);const $=j.useRef(!1);Fv(()=>($.current=!0,()=>{$.current=!1}),[]),Fv(()=>{if(T&&(A.current=T),R&&(D.current=R),T&&R){if(M.current)return M.current(T,R,H);H()}},[T,R,H,M,B]);const V=j.useMemo(()=>({reference:A,floating:D,setReference:N,setFloating:C}),[N,C]),I=j.useMemo(()=>({reference:T,floating:R}),[T,R]),U=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!I.floating)return Y;const Q=YN(I.floating,d.x),F=YN(I.floating,d.y);return o?{...Y,transform:"translate("+Q+"px, "+F+"px)",...iM(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:F}},[n,o,I.floating,d.x,d.y]);return j.useMemo(()=>({...d,update:H,refs:V,elements:I,floatingStyles:U}),[d,H,V,I,U])}const n8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?KN({element:r.current,padding:a}).fn(n):{}:r?KN({element:r,padding:a}).fn(n):{}}}},r8=(e,t)=>{const n=GU(e);return{name:n.name,fn:n.fn,options:[e,t]}},a8=(e,t)=>{const n=KU(e);return{name:n.name,fn:n.fn,options:[e,t]}},i8=(e,t)=>({fn:WU(e).fn,options:[e,t]}),s8=(e,t)=>{const n=YU(e);return{name:n.name,fn:n.fn,options:[e,t]}},l8=(e,t)=>{const n=XU(e);return{name:n.name,fn:n.fn,options:[e,t]}},o8=(e,t)=>{const n=QU(e);return{name:n.name,fn:n.fn,options:[e,t]}},u8=(e,t)=>{const n=n8(e);return{name:n.name,fn:n.fn,options:[e,t]}};var c8="Arrow",sM=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return h.jsx(Qt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});sM.displayName=c8;var f8=sM;function d8(e){const[t,n]=j.useState(void 0);return gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,o;if("borderBoxSize"in i){const f=i.borderBoxSize,c=Array.isArray(f)?f[0]:f;l=c.inlineSize,o=c.blockSize}else l=e.offsetWidth,o=e.offsetHeight;n({width:l,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var aw="Popper",[lM,oM]=Op(aw),[h8,uM]=lM(aw),cM=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return h.jsx(h8,{scope:t,anchor:r,onAnchorChange:a,children:n})};cM.displayName=aw;var fM="PopperAnchor",dM=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=uM(fM,n),l=j.useRef(null),o=Tn(t,l),f=j.useRef(null);return j.useEffect(()=>{const c=f.current;f.current=(r==null?void 0:r.current)||l.current,c!==f.current&&i.onAnchorChange(f.current)}),r?null:h.jsx(Qt.div,{...a,ref:o})});dM.displayName=fM;var iw="PopperContent",[v8,p8]=lM(iw),hM=j.forwardRef((e,t)=>{var ie,ye,ue,ee,ne,se;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...b}=e,S=uM(iw,n),[w,N]=j.useState(null),C=Tn(t,ge=>N(ge)),[T,R]=j.useState(null),A=d8(T),D=(A==null?void 0:A.width)??0,L=(A==null?void 0:A.height)??0,B=r+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(c)?c:[c],P=_.length>0,H={padding:M,boundary:_.filter(g8),altBoundary:P},{refs:$,floatingStyles:V,placement:I,isPositioned:U,middlewareData:Y}=t8({strategy:"fixed",placement:B,whileElementsMounted:(...ge)=>$U(...ge,{animationFrame:y==="always"}),elements:{reference:S.anchor},middleware:[r8({mainAxis:a+L,alignmentAxis:l}),f&&a8({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?i8():void 0,...H}),f&&s8({...H}),l8({...H,apply:({elements:ge,rects:ke,availableWidth:Pe,availableHeight:lt})=>{const{width:Je,height:We}=ke.reference,Ve=ge.floating.style;Ve.setProperty("--radix-popper-available-width",`${Pe}px`),Ve.setProperty("--radix-popper-available-height",`${lt}px`),Ve.setProperty("--radix-popper-anchor-width",`${Je}px`),Ve.setProperty("--radix-popper-anchor-height",`${We}px`)}}),T&&u8({element:T,padding:o}),y8({arrowWidth:D,arrowHeight:L}),m&&o8({strategy:"referenceHidden",...H})]}),[Q,F]=mM(I),q=po(x);gr(()=>{U&&(q==null||q())},[U,q]);const X=(ie=Y.arrow)==null?void 0:ie.x,z=(ye=Y.arrow)==null?void 0:ye.y,W=((ue=Y.arrow)==null?void 0:ue.centerOffset)!==0,[re,ae]=j.useState();return gr(()=>{w&&ae(window.getComputedStyle(w).zIndex)},[w]),h.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ee=Y.transformOrigin)==null?void 0:ee.x,(ne=Y.transformOrigin)==null?void 0:ne.y].join(" "),...((se=Y.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(v8,{scope:n,placedSide:Q,onArrowChange:R,arrowX:X,arrowY:z,shouldHideArrow:W,children:h.jsx(Qt.div,{"data-side":Q,"data-align":F,...b,ref:C,style:{...b.style,animation:U?void 0:"none"}})})})});hM.displayName=iw;var vM="PopperArrow",m8={top:"bottom",right:"left",bottom:"top",left:"right"},pM=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=p8(vM,r),l=m8[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(f8,{...a,ref:n,style:{...a.style,display:"block"}})})});pM.displayName=vM;function g8(e){return e!==null}var y8=e=>({name:"transformOrigin",options:e,fn(t){var S,w,N;const{placement:n,rects:r,middlewareData:a}=t,l=((S=a.arrow)==null?void 0:S.centerOffset)!==0,o=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[c,d]=mM(n),p={start:"0%",center:"50%",end:"100%"}[d],m=(((w=a.arrow)==null?void 0:w.x)??0)+o/2,y=(((N=a.arrow)==null?void 0:N.y)??0)+f/2;let x="",b="";return c==="bottom"?(x=l?p:`${m}px`,b=`${-f}px`):c==="top"?(x=l?p:`${m}px`,b=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,b=l?p:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,b=l?p:`${y}px`),{data:{x,y:b}}}});function mM(e){const[t,n="center"]=e.split("-");return[t,n]}var x8=cM,b8=dM,w8=hM,S8=pM;function E8(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),C8="VisuallyHidden",N8=j.forwardRef((e,t)=>h.jsx(Qt.span,{...e,ref:t,style:{...gM,...e.style}}));N8.displayName=C8;var k8=[" ","Enter","ArrowUp","ArrowDown"],T8=[" ","Enter"],yo="Select",[Gp,Kp,j8]=rU(yo),[pc]=Op(yo,[j8,oM]),Yp=oM(),[A8,wl]=pc(yo),[R8,D8]=pc(yo),yM=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:d,autoComplete:p,disabled:m,required:y,form:x}=e,b=Yp(t),[S,w]=j.useState(null),[N,C]=j.useState(null),[T,R]=j.useState(!1),A=iU(c),[D,L]=rp({prop:r,defaultProp:a??!1,onChange:i,caller:yo}),[B,M]=rp({prop:l,defaultProp:o,onChange:f,caller:yo}),_=j.useRef(null),P=S?x||!!S.closest("form"):!0,[H,$]=j.useState(new Set),V=Array.from(H).map(I=>I.props.value).join(";");return h.jsx(x8,{...b,children:h.jsxs(A8,{required:y,scope:t,trigger:S,onTriggerChange:w,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:Mu(),value:B,onValueChange:M,open:D,onOpenChange:L,dir:A,triggerPointerDownPosRef:_,disabled:m,children:[h.jsx(Gp.Provider,{scope:t,children:h.jsx(R8,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(I=>{$(U=>new Set(U).add(I))},[]),onNativeOptionRemove:j.useCallback(I=>{$(U=>{const Y=new Set(U);return Y.delete(I),Y})},[]),children:n})}),P?h.jsxs(zM,{"aria-hidden":!0,required:y,tabIndex:-1,name:d,autoComplete:p,value:B,onChange:I=>M(I.target.value),disabled:m,form:x,children:[B===void 0?h.jsx("option",{value:""}):null,Array.from(H)]},V):null]})})};yM.displayName=yo;var xM="SelectTrigger",bM=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Yp(n),l=wl(xM,n),o=l.disabled||r,f=Tn(t,l.onTriggerChange),c=Kp(n),d=j.useRef("touch"),[p,m,y]=FM(b=>{const S=c().filter(C=>!C.disabled),w=S.find(C=>C.value===l.value),N=qM(S,b,w);N!==void 0&&l.onValueChange(N.value)}),x=b=>{o||(l.onOpenChange(!0),y()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return h.jsx(b8,{asChild:!0,...i,children:h.jsx(Qt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":IM(l.value)?"":void 0,...a,ref:f,onClick:Jt(a.onClick,b=>{b.currentTarget.focus(),d.current!=="mouse"&&x(b)}),onPointerDown:Jt(a.onPointerDown,b=>{d.current=b.pointerType;const S=b.target;S.hasPointerCapture(b.pointerId)&&S.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(x(b),b.preventDefault())}),onKeyDown:Jt(a.onKeyDown,b=>{const S=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(S&&b.key===" ")&&k8.includes(b.key)&&(x(),b.preventDefault())})})})});bM.displayName=xM;var wM="SelectValue",SM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=wl(wM,n),{onValueNodeHasChildrenChange:c}=f,d=i!==void 0,p=Tn(t,f.onValueNodeChange);return gr(()=>{c(d)},[c,d]),h.jsx(Qt.span,{...o,ref:p,style:{pointerEvents:"none"},children:IM(f.value)?h.jsx(h.Fragment,{children:l}):i})});SM.displayName=wM;var M8="SelectIcon",EM=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return h.jsx(Qt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});EM.displayName=M8;var O8="SelectPortal",CM=e=>h.jsx(B1,{asChild:!0,...e});CM.displayName=O8;var xo="SelectContent",NM=j.forwardRef((e,t)=>{const n=wl(xo,e.__scopeSelect),[r,a]=j.useState();if(gr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?xd.createPortal(h.jsx(kM,{scope:e.__scopeSelect,children:h.jsx(Gp.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),i):null}return h.jsx(TM,{...e,ref:t})});NM.displayName=xo;var Pa=10,[kM,Sl]=pc(xo),L8="SelectContentImpl",_8=Qf("SelectContent.RemoveScroll"),TM=j.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:o,sideOffset:f,align:c,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:S,...w}=e,N=wl(xo,n),[C,T]=j.useState(null),[R,A]=j.useState(null),D=Tn(t,ie=>T(ie)),[L,B]=j.useState(null),[M,_]=j.useState(null),P=Kp(n),[H,$]=j.useState(!1),V=j.useRef(!1);j.useEffect(()=>{if(C)return vD(C)},[C]),iD();const I=j.useCallback(ie=>{const[ye,...ue]=P().map(se=>se.ref.current),[ee]=ue.slice(-1),ne=document.activeElement;for(const se of ie)if(se===ne||(se==null||se.scrollIntoView({block:"nearest"}),se===ye&&R&&(R.scrollTop=0),se===ee&&R&&(R.scrollTop=R.scrollHeight),se==null||se.focus(),document.activeElement!==ne))return},[P,R]),U=j.useCallback(()=>I([L,C]),[I,L,C]);j.useEffect(()=>{H&&U()},[H,U]);const{onOpenChange:Y,triggerPointerDownPosRef:Q}=N;j.useEffect(()=>{if(C){let ie={x:0,y:0};const ye=ee=>{var ne,se;ie={x:Math.abs(Math.round(ee.pageX)-(((ne=Q.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((se=Q.current)==null?void 0:se.y)??0))}},ue=ee=>{ie.x<=10&&ie.y<=10?ee.preventDefault():C.contains(ee.target)||Y(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ue,{capture:!0})}}},[C,Y,Q]),j.useEffect(()=>{const ie=()=>Y(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[Y]);const[F,q]=FM(ie=>{const ye=P().filter(ne=>!ne.disabled),ue=ye.find(ne=>ne.ref.current===document.activeElement),ee=qM(ye,ie,ue);ee&&setTimeout(()=>ee.ref.current.focus())}),X=j.useCallback((ie,ye,ue)=>{const ee=!V.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&(B(ie),ee&&(V.current=!0))},[N.value]),z=j.useCallback(()=>C==null?void 0:C.focus(),[C]),W=j.useCallback((ie,ye,ue)=>{const ee=!V.current&&!ue;(N.value!==void 0&&N.value===ye||ee)&&_(ie)},[N.value]),re=r==="popper"?kb:jM,ae=re===kb?{side:o,sideOffset:f,align:c,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:S}:{};return h.jsx(kM,{scope:n,content:C,viewport:R,onViewportChange:A,itemRefCallback:X,selectedItem:L,onItemLeave:z,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:M,position:r,isPositioned:H,searchRef:F,children:h.jsx(P1,{as:_8,allowPinchZoom:!0,children:h.jsx(_1,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Jt(a,ie=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),ie.preventDefault()}),children:h.jsx(L1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:h.jsx(re,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...w,...ae,onPlaced:()=>$(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Jt(w.onKeyDown,ie=>{const ye=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ye&&ie.key.length===1&&q(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ee=P().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ne=ie.target,se=ee.indexOf(ne);ee=ee.slice(se+1)}setTimeout(()=>I(ee)),ie.preventDefault()}})})})})})})});TM.displayName=L8;var B8="SelectItemAlignedPosition",jM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=wl(xo,n),l=Sl(xo,n),[o,f]=j.useState(null),[c,d]=j.useState(null),p=Tn(t,D=>d(D)),m=Kp(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:b,selectedItem:S,selectedItemText:w,focusSelectedItem:N}=l,C=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&b&&S&&w){const D=i.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),B=i.valueNode.getBoundingClientRect(),M=w.getBoundingClientRect();if(i.dir!=="rtl"){const ne=M.left-L.left,se=B.left-ne,ge=D.left-se,ke=D.width+ge,Pe=Math.max(ke,L.width),lt=window.innerWidth-Pa,Je=PN(se,[Pa,Math.max(Pa,lt-Pe)]);o.style.minWidth=ke+"px",o.style.left=Je+"px"}else{const ne=L.right-M.right,se=window.innerWidth-B.right-ne,ge=window.innerWidth-D.right-se,ke=D.width+ge,Pe=Math.max(ke,L.width),lt=window.innerWidth-Pa,Je=PN(se,[Pa,Math.max(Pa,lt-Pe)]);o.style.minWidth=ke+"px",o.style.right=Je+"px"}const _=m(),P=window.innerHeight-Pa*2,H=b.scrollHeight,$=window.getComputedStyle(c),V=parseInt($.borderTopWidth,10),I=parseInt($.paddingTop,10),U=parseInt($.borderBottomWidth,10),Y=parseInt($.paddingBottom,10),Q=V+I+H+Y+U,F=Math.min(S.offsetHeight*5,Q),q=window.getComputedStyle(b),X=parseInt(q.paddingTop,10),z=parseInt(q.paddingBottom,10),W=D.top+D.height/2-Pa,re=P-W,ae=S.offsetHeight/2,ie=S.offsetTop+ae,ye=V+I+ie,ue=Q-ye;if(ye<=W){const ne=_.length>0&&S===_[_.length-1].ref.current;o.style.bottom="0px";const se=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(re,ae+(ne?z:0)+se+U),ke=ye+ge;o.style.height=ke+"px"}else{const ne=_.length>0&&S===_[0].ref.current;o.style.top="0px";const ge=Math.max(W,V+b.offsetTop+(ne?X:0)+ae)+ue;o.style.height=ge+"px",b.scrollTop=ye-W+b.offsetTop}o.style.margin=`${Pa}px 0`,o.style.minHeight=F+"px",o.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,b,S,w,i.dir,r]);gr(()=>C(),[C]);const[T,R]=j.useState();gr(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);const A=j.useCallback(D=>{D&&x.current===!0&&(C(),N==null||N(),x.current=!1)},[C,N]);return h.jsx(z8,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:h.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:h.jsx(Qt.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});jM.displayName=B8;var P8="SelectPopperPosition",kb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Pa,...i}=e,l=Yp(n);return h.jsx(w8,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});kb.displayName=P8;var[z8,sw]=pc(xo,{}),Tb="SelectViewport",AM=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Sl(Tb,n),l=sw(Tb,n),o=Tn(t,i.onViewportChange),f=j.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Gp.Slot,{scope:n,children:h.jsx(Qt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Jt(a.onScroll,c=>{const d=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&p){const y=Math.abs(f.current-d.scrollTop);if(y>0){const x=window.innerHeight-Pa*2,b=parseFloat(p.style.minHeight),S=parseFloat(p.style.height),w=Math.max(b,S);if(w<x){const N=w+y,C=Math.min(x,N),T=N-C;p.style.height=C+"px",p.style.bottom==="0px"&&(d.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});AM.displayName=Tb;var RM="SelectGroup",[I8,F8]=pc(RM),q8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Mu();return h.jsx(I8,{scope:n,id:a,children:h.jsx(Qt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});q8.displayName=RM;var DM="SelectLabel",U8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=F8(DM,n);return h.jsx(Qt.div,{id:a.id,...r,ref:t})});U8.displayName=DM;var up="SelectItem",[V8,MM]=pc(up),OM=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=wl(up,n),f=Sl(up,n),c=o.value===r,[d,p]=j.useState(i??""),[m,y]=j.useState(!1),x=Tn(t,N=>{var C;return(C=f.itemRefCallback)==null?void 0:C.call(f,N,r,a)}),b=Mu(),S=j.useRef("touch"),w=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(V8,{scope:n,value:r,disabled:a,textId:b,isSelected:c,onItemTextChange:j.useCallback(N=>{p(C=>C||((N==null?void 0:N.textContent)??"").trim())},[]),children:h.jsx(Gp.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:h.jsx(Qt.div,{role:"option","aria-labelledby":b,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:Jt(l.onFocus,()=>y(!0)),onBlur:Jt(l.onBlur,()=>y(!1)),onClick:Jt(l.onClick,()=>{S.current!=="mouse"&&w()}),onPointerUp:Jt(l.onPointerUp,()=>{S.current==="mouse"&&w()}),onPointerDown:Jt(l.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:Jt(l.onPointerMove,N=>{var C;S.current=N.pointerType,a?(C=f.onItemLeave)==null||C.call(f):S.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Jt(l.onPointerLeave,N=>{var C;N.currentTarget===document.activeElement&&((C=f.onItemLeave)==null||C.call(f))}),onKeyDown:Jt(l.onKeyDown,N=>{var T;((T=f.searchRef)==null?void 0:T.current)!==""&&N.key===" "||(T8.includes(N.key)&&w(),N.key===" "&&N.preventDefault())})})})})});OM.displayName=up;var Bf="SelectItemText",LM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=wl(Bf,n),o=Sl(Bf,n),f=MM(Bf,n),c=D8(Bf,n),[d,p]=j.useState(null),m=Tn(t,w=>p(w),f.onItemTextChange,w=>{var N;return(N=o.itemTextRefCallback)==null?void 0:N.call(o,w,f.value,f.disabled)}),y=d==null?void 0:d.textContent,x=j.useMemo(()=>h.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=c;return gr(()=>(b(x),()=>S(x)),[b,S,x]),h.jsxs(h.Fragment,{children:[h.jsx(Qt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?xd.createPortal(i.children,l.valueNode):null]})});LM.displayName=Bf;var _M="SelectItemIndicator",BM=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return MM(_M,n).isSelected?h.jsx(Qt.span,{"aria-hidden":!0,...r,ref:t}):null});BM.displayName=_M;var jb="SelectScrollUpButton",H8=j.forwardRef((e,t)=>{const n=Sl(jb,e.__scopeSelect),r=sw(jb,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return gr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollTop>0;i(c)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?h.jsx(PM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});H8.displayName=jb;var Ab="SelectScrollDownButton",$8=j.forwardRef((e,t)=>{const n=Sl(Ab,e.__scopeSelect),r=sw(Ab,e.__scopeSelect),[a,i]=j.useState(!1),l=Tn(t,r.onScrollButtonChange);return gr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollHeight-f.clientHeight,d=Math.ceil(f.scrollTop)<c;i(d)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?h.jsx(PM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});$8.displayName=Ab;var PM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Sl("SelectScrollButton",n),l=j.useRef(null),o=Kp(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),gr(()=>{var d;const c=o().find(p=>p.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),h.jsx(Qt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Jt(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Jt(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Jt(a.onPointerLeave,()=>{f()})})}),G8="SelectSeparator",K8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(Qt.div,{"aria-hidden":!0,...r,ref:t})});K8.displayName=G8;var Rb="SelectArrow",Y8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Yp(n),i=wl(Rb,n),l=Sl(Rb,n);return i.open&&l.position==="popper"?h.jsx(S8,{...a,...r,ref:t}):null});Y8.displayName=Rb;var X8="SelectBubbleInput",zM=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=Tn(r,a),l=E8(t);return j.useEffect(()=>{const o=a.current;if(!o)return;const f=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&d){const p=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(p)}},[l,t]),h.jsx(Qt.select,{...n,style:{...gM,...n.style},ref:i,defaultValue:t})});zM.displayName=X8;function IM(e){return e===""||e===void 0}function FM(e){const t=po(e),n=j.useRef(""),r=j.useRef(0),a=j.useCallback(l=>{const o=n.current+l;t(o),(function f(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(o)},[t]),i=j.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function qM(e,t,n){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Q8(e,Math.max(i,0));a.length===1&&(l=l.filter(c=>c!==n));const f=l.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function Q8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var W8=yM,UM=bM,Z8=SM,J8=EM,eV=CM,VM=NM,tV=AM,HM=OM,nV=LM,rV=BM;const Zi=W8,Ji=Z8,vi=j.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(UM,{ref:r,className:Te("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,h.jsx(J8,{asChild:!0,children:h.jsx(Ua,{className:"h-4 w-4 opacity-50"})})]}));vi.displayName=UM.displayName;const pi=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>h.jsx(eV,{children:h.jsx(VM,{ref:a,className:Te("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border-0 bg-surface-container-highest text-card-foreground shadow-ambient",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:h.jsx(tV,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));pi.displayName=VM.displayName;const ia=j.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(HM,{ref:r,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-surface-bright focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(rV,{children:h.jsx(wd,{className:"h-4 w-4"})})}),h.jsx(nV,{children:t})]}));ia.displayName=HM.displayName;function jd({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return h.jsxs(Qe,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[h.jsx(lc,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),h.jsx(cn,{placeholder:e,value:t,onChange:l=>n(l.target.value),className:"bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1","aria-label":e}),r.map(l=>h.jsx("div",{className:"w-40 shrink-0",children:h.jsxs(Zi,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[h.jsx(vi,{children:h.jsx(Ji,{placeholder:l.label})}),h.jsx(pi,{children:l.options.map(o=>h.jsx(ia,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function mc({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;const i=t>0,l=t+n<e,o=t+1,f=Math.min(t+n,e);return h.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[h.jsxs(_e,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[h.jsx(C1,{className:"h-4 w-4"}),"Prev"]}),h.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),h.jsxs(_e,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",h.jsx(ua,{className:"h-4 w-4"})]})]})}const aV=Rr.STATS,iV=Rr.STATS,sV=Rr.STATS,lV=3e4,oV=6e4,uV=1e4,cV=6e4;function fV(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.agent&&t.set("agent",e.agent),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/sessions?${n}`:"/sessions";return ca({queryKey:["sessions",e],queryFn:({signal:a})=>ot(r,{signal:a}),pollCategory:"standard",refetchInterval:aV})}function dV(e){return ca({queryKey:["session",e],queryFn:({signal:t})=>ot(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:iV})}function hV(e){return ca({queryKey:["session-batches",e],queryFn:({signal:t})=>ot(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:sV})}function vV(e){return tn({queryKey:["batch-activities",e],queryFn:({signal:t})=>ot(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:lV})}function pV(e){return tn({queryKey:["session-attachments",e],queryFn:({signal:t})=>ot(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:oV})}function $M(){const e=Vn();return br({mutationFn:t=>j1(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function GM(e){return tn({queryKey:["session-impact",e],queryFn:({signal:t})=>ot(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:uV})}function KM(e){return tn({queryKey:["session-plans",e],queryFn:({signal:t})=>ot(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:cV})}const mV=300;function gV(e,t=mV){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const Jn="all";function Ad({initialFilters:e}){const[t,n]=j.useState(""),r=gV(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((p,m)=>{i(y=>({...y,[p]:m})),o(0)},[]),c=j.useCallback(p=>{n(p),o(0)},[]),d=j.useCallback(p=>{const m=a[p];return m&&m!==Jn?m:void 0},[a]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:a,offset:l,setOffset:o,handleSearchChange:c,handleFilterChange:f,activeFilter:d}}function YM(e){return e==="active"?"active":e==="completed"?"completed":"error"}const yV={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},xV={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function bV({status:e}){const t=YM(e);return h.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0",yV[t])})}function XM({status:e}){const t=YM(e),n=e.charAt(0).toUpperCase()+e.slice(1);return h.jsxs("span",{className:Te("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",xV[t]),children:[h.jsx(bV,{status:e}),n]})}const wV=5,Db=8,SV=12,EV=[{key:"status",label:"Status",options:[{value:Jn,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]},{key:"agent",label:"Agent",options:[{value:Jn,label:"All agents"},{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"}]}];function CV({session:e,onClick:t,onDelete:n}){const r=e.title||e.id.slice(0,Db);return h.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Session: ${r}`,children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,SV)})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:r})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:e.agent||"unknown"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx(XM,{status:e.status})}),h.jsx("td",{className:"px-4 py-3 text-center",children:h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),h.jsx("td",{className:"px-4 py-3",children:h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),h.jsx("button",{onClick:a=>{a.stopPropagation(),n()},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-tertiary/10 hover:text-tertiary transition-all shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tertiary/40","aria-label":`Delete session ${r}`,title:"Delete session",children:h.jsx(dl,{className:"h-3.5 w-3.5"})})]})})]})}function NV(){return h.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function vu({children:e,className:t}){return h.jsx("th",{className:Te("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function kV(){const e=Ka(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Ad({initialFilters:{status:Jn,agent:Jn}}),[c,d]=j.useState(null),p=$M(),{data:m}=GM((c==null?void 0:c.id)??null),y=f("status"),x=f("agent"),{data:b,isLoading:S,isError:w,error:N}=fV({limit:$r,offset:a,status:y,agent:x,search:n});function C(){c&&p.mutate(c.id,{onSuccess:()=>d(null)})}const T=(b==null?void 0:b.sessions)??[],R=(b==null?void 0:b.total)??0,A=h.jsx(jd,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:EV,filterValues:r,onFilterChange:o}),D=h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[h.jsx(vu,{children:"Session ID"}),h.jsx(vu,{children:"Title"}),h.jsx(vu,{children:"Agent"}),h.jsx(vu,{children:"Status"}),h.jsx(vu,{className:"text-center",children:"Turns"}),h.jsx(vu,{children:"Date"})]})});return w?h.jsxs("div",{children:[h.jsx(yi,{title:"Session Archive"}),A,h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:N instanceof Error?N.message:"Unknown error"})]})]}):h.jsxs("div",{children:[h.jsx(yi,{title:"Session Archive",subtitle:S?"Loading...":`${R} session${R!==1?"s":""} captured`}),A,S?h.jsx(Qe,{level:"low",className:"rounded-md overflow-hidden mt-4",children:h.jsxs("table",{className:"w-full",children:[D,h.jsx("tbody",{children:Array.from({length:wV}).map((L,B)=>h.jsx(NV,{},B))})]})}):T.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[h.jsx(Rp,{className:"h-8 w-8 opacity-30"}),h.jsx("span",{className:"font-sans text-sm",children:R===0&&!n&&!y&&!x?"No sessions yet":"No matching sessions"}),R===0&&!n&&!y&&!x&&h.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):h.jsx(Qe,{level:"low",className:"rounded-md overflow-hidden mt-4",children:h.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[D,h.jsx("tbody",{children:T.map(L=>h.jsx(CV,{session:L,onClick:()=>e(`/sessions/${L.id}`),onDelete:()=>d(L)},L.id))})]})}),h.jsx(mc,{total:R,offset:a,limit:$r,onPageChange:i}),h.jsx(W1,{open:c!==null,onOpenChange:L=>{L||d(null)},title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:h.jsx(dl,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:c.id.slice(0,Db)},{label:"Title",value:c.title||c.id.slice(0,Db)}]:[],impact:m?[{label:"Prompts",value:m.promptCount},{label:"Spores",value:m.sporeCount},{label:"Attachments",value:m.attachmentCount},{label:"Graph Edges",value:m.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:C,isPending:p.isPending})]})}function Bt({children:e,className:t}){return h.jsx("div",{className:Te("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}const TV=3e5;function jV(){return tn({queryKey:["symbionts"],queryFn:({signal:e})=>ot("/symbionts",{signal:e}),staleTime:TV})}function AV(e,t,n){const r=e.find(a=>a.name===t);return r!=null&&r.resumeCommand?r.resumeCommand.replace("{sessionId}",n):null}function RV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const DV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OV={};function XN(e,t){return(OV.jsx?MV:DV).test(e)}const LV=/[ \t\n\f\r]/g;function _V(e){return typeof e=="object"?e.type==="text"?QN(e.value):!1:QN(e)}function QN(e){return e.replace(LV,"")===""}class Rd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rd.prototype.normal={};Rd.prototype.property={};Rd.prototype.space=void 0;function QM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Rd(n,r,t)}function Mb(e){return e.toLowerCase()}class Kr{constructor(t,n){this.attribute=n,this.property=t}}Kr.prototype.attribute="";Kr.prototype.booleanish=!1;Kr.prototype.boolean=!1;Kr.prototype.commaOrSpaceSeparated=!1;Kr.prototype.commaSeparated=!1;Kr.prototype.defined=!1;Kr.prototype.mustUseProperty=!1;Kr.prototype.number=!1;Kr.prototype.overloadedBoolean=!1;Kr.prototype.property="";Kr.prototype.spaceSeparated=!1;Kr.prototype.space=void 0;let BV=0;const yt=To(),On=To(),Ob=To(),je=To(),Zt=To(),_u=To(),na=To();function To(){return 2**++BV}const Lb=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:On,commaOrSpaceSeparated:na,commaSeparated:_u,number:je,overloadedBoolean:Ob,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Xy=Object.keys(Lb);class lw extends Kr{constructor(t,n,r,a){let i=-1;if(super(t,n),WN(this,"space",a),typeof r=="number")for(;++i<Xy.length;){const l=Xy[i];WN(this,Xy[i],(r&Lb[l])===Lb[l])}}}lw.prototype.defined=!0;function WN(e,t,n){n&&(e[t]=n)}function gc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new lw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Mb(r)]=r,n[Mb(i.attribute)]=r}return new Rd(t,n,e.space)}const WM=gc({properties:{ariaActiveDescendant:null,ariaAtomic:On,ariaAutoComplete:null,ariaBusy:On,ariaChecked:On,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:On,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:On,ariaFlowTo:Zt,ariaGrabbed:On,ariaHasPopup:null,ariaHidden:On,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:je,ariaLive:null,ariaModal:On,ariaMultiLine:On,ariaMultiSelectable:On,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:On,ariaReadOnly:On,ariaRelevant:null,ariaRequired:On,ariaRoleDescription:Zt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:On,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ZM(e,t){return t in e?e[t]:t}function JM(e,t){return ZM(e,t.toLowerCase())}const PV=gc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_u,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Zt,autoFocus:yt,autoPlay:yt,blocking:Zt,capture:null,charSet:null,checked:yt,cite:null,className:Zt,cols:je,colSpan:null,content:null,contentEditable:On,controls:yt,controlsList:Zt,coords:je|_u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Ob,draggable:On,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Zt,height:je,hidden:Ob,high:je,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:yt,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:je,pattern:null,ping:Zt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Zt,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:Zt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:On,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:On,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:On,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:JM}),zV=gc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:na,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_u,g2:_u,glyphName:_u,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:na,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:na,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:na,rev:na,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:na,requiredFeatures:na,requiredFonts:na,requiredFormats:na,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:na,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:na,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:na,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ZM}),eO=gc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),tO=gc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:JM}),nO=gc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IV={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},FV=/[A-Z]/g,ZN=/-[a-z]/g,qV=/^data[-\w.:]+$/i;function UV(e,t){const n=Mb(t);let r=t,a=Kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&qV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ZN,HV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ZN.test(i)){let l=i.replace(FV,VV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=lw}return new a(r,t)}function VV(e){return"-"+e.toLowerCase()}function HV(e){return e.charAt(1).toUpperCase()}const $V=QM([WM,PV,eO,tO,nO],"html"),ow=QM([WM,zV,eO,tO,nO],"svg");function GV(e){return e.join(" ").trim()}var pu={},Qy,JN;function KV(){if(JN)return Qy;JN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,f=`
470
+ `,c="/",d="*",p="",m="comment",y="declaration";function x(S,w){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];w=w||{};var N=1,C=1;function T($){var V=$.match(t);V&&(N+=V.length);var I=$.lastIndexOf(f);C=~I?$.length-I:C+$.length}function R(){var $={line:N,column:C};return function(V){return V.position=new A($),B(),V}}function A($){this.start=$,this.end={line:N,column:C},this.source=w.source}A.prototype.content=S;function D($){var V=new Error(w.source+":"+N+":"+C+": "+$);if(V.reason=$,V.filename=w.source,V.line=N,V.column=C,V.source=S,!w.silent)throw V}function L($){var V=$.exec(S);if(V){var I=V[0];return T(I),S=S.slice(I.length),V}}function B(){L(n)}function M($){var V;for($=$||[];V=_();)V!==!1&&$.push(V);return $}function _(){var $=R();if(!(c!=S.charAt(0)||d!=S.charAt(1))){for(var V=2;p!=S.charAt(V)&&(d!=S.charAt(V)||c!=S.charAt(V+1));)++V;if(V+=2,p===S.charAt(V-1))return D("End of comment missing");var I=S.slice(2,V-2);return C+=2,T(I),S=S.slice(V),C+=2,$({type:m,comment:I})}}function P(){var $=R(),V=L(r);if(V){if(_(),!L(a))return D("property missing ':'");var I=L(i),U=$({type:y,property:b(V[0].replace(e,p)),value:I?b(I[0].replace(e,p)):p});return L(l),U}}function H(){var $=[];M($);for(var V;V=P();)V!==!1&&($.push(V),M($));return $}return B(),H()}function b(S){return S?S.replace(o,p):p}return Qy=x,Qy}var ek;function YV(){if(ek)return pu;ek=1;var e=pu&&pu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pu,"__esModule",{value:!0}),pu.default=n;const t=e(KV());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),o=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:d}=f;o?a(c,d,f):d&&(i=i||{},i[c]=d)}),i}return pu}var wf={},tk;function XV(){if(tk)return wf;tk=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},l=function(c,d){return d.toUpperCase()},o=function(c,d){return"".concat(d,"-")},f=function(c,d){return d===void 0&&(d={}),i(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,l))};return wf.camelCase=f,wf}var Sf,nk;function QV(){if(nk)return Sf;nk=1;var e=Sf&&Sf.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(YV()),n=XV();function r(a,i){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(o,f){o&&f&&(l[(0,n.camelCase)(o,i)]=f)}),l}return r.default=r,Sf=r,Sf}var WV=QV();const ZV=pd(WV),rO=aO("end"),uw=aO("start");function aO(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function JV(e){const t=uw(e),n=rO(e);if(t&&n)return{start:t,end:n}}function qf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rk(e.position):"start"in e||"end"in e?rk(e):"line"in e||"column"in e?_b(e):""}function _b(e){return ak(e&&e.line)+":"+ak(e&&e.column)}function rk(e){return _b(e&&e.start)+"-"+_b(e&&e.end)}function ak(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=qf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const cw={}.hasOwnProperty,e9=new Map,t9=/[A-Z]/g,n9=new Set(["table","tbody","thead","tfoot","tr"]),r9=new Set(["td","th"]),iO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a9(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=d9(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=f9(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ow:$V,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=sO(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function sO(e,t,n){if(t.type==="element")return i9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return s9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return o9(e,t,n);if(t.type==="mdxjsEsm")return l9(e,t);if(t.type==="root")return u9(e,t,n);if(t.type==="text")return c9(e,t)}function i9(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=ow,e.schema=a),e.ancestors.push(t);const i=oO(e,t.tagName,!1),l=h9(e,t);let o=dw(e,t);return n9.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!_V(f):!0})),lO(e,l,i,t),fw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function s9(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Zf(e,t.position)}function l9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zf(e,t.position)}function o9(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=ow,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:oO(e,t.name,!0),l=v9(e,t),o=dw(e,t);return lO(e,l,i,t),fw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function u9(e,t,n){const r={};return fw(r,dw(e,t)),e.create(t,e.Fragment,r,n)}function c9(e,t){return t.value}function lO(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function f9(e,t,n){return r;function r(a,i,l,o){const c=Array.isArray(l.children)?n:t;return o?c(i,l,o):c(i,l)}}function d9(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=uw(r);return t(a,i,l,o,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function h9(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&cw.call(t.properties,a)){const i=p9(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&r9.has(t.tagName)?r=o:n[l]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function v9(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Zf(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Zf(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function dw(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:e9;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const c=a.get(f)||0;l=f+"-"+c,a.set(f,c+1)}}const o=sO(e,i,l);o!==void 0&&n.push(o)}return n}function p9(e,t,n){const r=UV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?RV(n):GV(n)),r.property==="style"){let a=typeof n=="object"?n:m9(e,String(n));return e.stylePropertyNameCase==="css"&&(a=g9(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?IV[r.property]||r.property:r.attribute,n]}}function m9(e,t){try{return ZV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new wr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=iO+"#cannot-parse-style-attribute",a}}function oO(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,l;for(;++i<a.length;){const o=XN(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=l}else r=XN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return cw.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zf(e)}function Zf(e,t){const n=new wr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=iO+"#cannot-handle-mdx-estrees-without-createevaluater",n}function g9(e){const t={};let n;for(n in e)cw.call(e,n)&&(t[y9(n)]=e[n]);return t}function y9(e){let t=e.replace(t9,x9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function x9(e){return"-"+e.toLowerCase()}const Wy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},b9={};function hw(e,t){const n=b9,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return uO(e,r,a)}function uO(e,t,n){if(w9(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ik(e.children,t,n)}return Array.isArray(e)?ik(e,t,n):""}function ik(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=uO(e[a],t,n);return r.join("")}function w9(e){return!!(e&&typeof e=="object")}const sk=document.createElement("i");function vw(e){const t="&"+e+";";sk.innerHTML=t;const n=sk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function la(e,t,n,r){const a=e.length;let i=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function ja(e,t){return e.length>0?(la(e,e.length,0,t),e):t}const lk={}.hasOwnProperty;function cO(e){const t={};let n=-1;for(;++n<e.length;)S9(t,e[n]);return t}function S9(e,t){let n;for(n in t){const a=(lk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){lk.call(a,l)||(a[l]=[]);const o=i[l];E9(a[l],Array.isArray(o)?o:o?[o]:[])}}}function E9(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);la(e,0,0,r)}function fO(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=El(/[A-Za-z]/),mr=El(/[\dA-Za-z]/),C9=El(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const Bb=El(/\d/),N9=El(/[\dA-Fa-f]/),k9=El(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Xt(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Xp=El(new RegExp("\\p{P}|\\p{S}","u")),bo=El(/\s/);function El(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&mr(e.charCodeAt(n+1))&&mr(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),a=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return Et(f)?(e.enter(n),o(f)):t(f)}function o(f){return Et(f)&&i++<a?(e.consume(f),o):(e.exit(n),t(f))}}const T9={tokenize:j9};function j9(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),At(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return rt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const A9={tokenize:R9},ok={tokenize:D9};function R9(e){const t=this,n=[];let r=0,a,i,l;return o;function o(C){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,f,c)(C)}return c(C)}function f(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&N();const T=t.events.length;let R=T,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){A=t.events[R][1].end;break}w(r);let D=T;for(;D<t.events.length;)t.events[D][1].end={...A},D++;return la(t.events,R+1,0,t.events.slice(T)),t.events.length=D,c(C)}return o(C)}function c(C){if(r===n.length){if(!a)return m(C);if(a.currentConstruct&&a.currentConstruct.concrete)return x(C);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ok,d,p)(C)}function d(C){return a&&N(),w(r),m(C)}function p(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(C)}function m(C){return t.containerState={},e.attempt(ok,y,x)(C)}function y(C){return r++,n.push([t.currentConstruct,t.containerState]),m(C)}function x(C){if(C===null){a&&N(),w(0),e.consume(C);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),b(C)}function b(C){if(C===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return rt(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(C),b)}function S(C,T){const R=t.sliceStream(C);if(T&&R.push(null),C.previous=i,i&&(i.next=C),i=C,a.defineSkip(C.start),a.write(R),t.parser.lazy[C.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const D=t.events.length;let L=D,B,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(B){M=t.events[L][1].end;break}B=!0}for(w(r),A=D;A<t.events.length;)t.events[A][1].end={...M},A++;la(t.events,L+1,0,t.events.slice(D)),t.events.length=A}}function w(C){let T=n.length;for(;T-- >C;){const R=n[T];t.containerState=R[1],R[0].exit.call(t,e)}n.length=C}function N(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function D9(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ec(e){if(e===null||Xt(e)||bo(e))return 1;if(Xp(e))return 2}function Qp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Pb={name:"attention",resolveAll:M9,tokenize:O9};function M9(e,t){let n=-1,r,a,i,l,o,f,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};uk(p,-f),uk(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ja(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ja(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=ja(c,Qp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ja(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ja(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,la(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function O9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=ec(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),o(f)}function o(f){if(f===i)return e.consume(f),o;const c=e.exit("attentionSequence"),d=ec(f),p=!d||d===2&&a||n.includes(f),m=!a||a===2&&d||n.includes(r);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(d||!p)),t(f)}}function uk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const L9={name:"autolink",tokenize:_9};function _9(e,t,n){let r=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return Tr(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||mr(y)?(r=1,o(y)):c(y)}function o(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||mr(y))&&r++<32?(e.consume(y),o):(r=0,c(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||cp(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),d):C9(y)?(e.consume(y),c):n(y)}function d(y){return mr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,d):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||mr(y))&&r++<63){const x=y===45?m:p;return e.consume(y),x}return n(y)}}const Dd={partial:!0,tokenize:B9};function B9(e,t,n){return r;function r(i){return Et(i)?At(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||rt(i)?t(i):n(i)}}const dO={continuation:{tokenize:z9},exit:I9,name:"blockQuote",tokenize:P9};function P9(e,t,n){const r=this;return a;function a(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return Et(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function z9(e,t,n){const r=this;return a;function a(l){return Et(l)?At(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(dO,t,n)(l)}}function I9(e){e.exit("blockQuote")}const hO={name:"characterEscape",tokenize:F9};function F9(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return k9(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const vO={name:"characterReference",tokenize:q9};function q9(e,t,n){const r=this;let a=0,i,l;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=mr,d(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=N9,d):(e.enter("characterReferenceValue"),i=7,l=Bb,d(p))}function d(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return l===mr&&!vw(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<i?(e.consume(p),d):n(p)}}const ck={partial:!0,tokenize:V9},fk={concrete:!0,name:"codeFenced",tokenize:U9};function U9(e,t,n){const r=this,a={partial:!0,tokenize:R};let i=0,l=0,o;return f;function f(A){return c(A)}function c(A){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(A)}function d(A){return A===o?(l++,e.consume(A),d):l<3?n(A):(e.exit("codeFencedFenceSequence"),Et(A)?At(e,p,"whitespace")(A):p(A))}function p(A){return A===null||rt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(ck,b,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Et(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,y,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function y(A){return A===null||rt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?n(A):(e.consume(A),x)}function b(A){return e.attempt(a,T,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),w}function w(A){return i>0&&Et(A)?At(e,N,"linePrefix",i+1)(A):N(A)}function N(A){return A===null||rt(A)?e.check(ck,b,T)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||rt(A)?(e.exit("codeFlowValue"),N(A)):(e.consume(A),C)}function T(A){return e.exit("codeFenced"),t(A)}function R(A,D,L){let B=0;return M;function M(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),_}function _(V){return A.enter("codeFencedFence"),Et(V)?At(A,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):P(V)}function P(V){return V===o?(A.enter("codeFencedFenceSequence"),H(V)):L(V)}function H(V){return V===o?(B++,A.consume(V),H):B>=l?(A.exit("codeFencedFenceSequence"),Et(V)?At(A,$,"whitespace")(V):$(V)):L(V)}function $(V){return V===null||rt(V)?(A.exit("codeFencedFence"),D(V)):L(V)}}}function V9(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Zy={name:"codeIndented",tokenize:$9},H9={partial:!0,tokenize:G9};function $9(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),At(e,i,"linePrefix",5)(c)}function i(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?f(c):rt(c)?e.attempt(H9,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||rt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function G9(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):At(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):rt(l)?a(l):n(l)}}const K9={name:"codeText",previous:X9,resolve:Y9,tokenize:Q9};function Y9(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function X9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Q9(e,t,n){let r=0,a,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),r++,o):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||rt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class W9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Ef(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ef(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ef(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ef(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ef(this.left,n.reverse())}}}function Ef(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function pO(e){const t={};let n=-1,r,a,i,l,o,f,c;const d=new W9(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Z9(d,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(l=d.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return la(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Z9(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,f=[],c={};let d,p,m=-1,y=n,x=0,b=0;const S=[b];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(d=r.sliceStream(y),y.next||d.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(b=m+1,S.push(b),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),m=S.length;m--;){const w=o.slice(S[m],S[m+1]),N=i.pop();f.push([N,N+w.length-1]),e.splice(N,2,w)}for(f.reverse(),m=-1;++m<f.length;)c[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return c}const J9={resolve:tH,tokenize:nH},eH={partial:!0,tokenize:rH};function tH(e){return pO(e),e}function nH(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):rt(o)?e.check(eH,l,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function rH(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,i,"linePrefix")}function i(l){if(l===null||rt(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function mO(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(w),e.exit(i),m):w===null||w===32||w===41||cp(w)?n(w):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(w))}function m(w){return w===62?(e.enter(i),e.consume(w),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===62?(e.exit("chunkString"),e.exit(o),m(w)):w===null||w===60||rt(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===60||w===62||w===92?(e.consume(w),y):y(w)}function b(w){return!d&&(w===null||w===41||Xt(w))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,b):w===41?(e.consume(w),d--,b):w===null||w===32||w===40||cp(w)?n(w):(e.consume(w),w===92?S:b)}function S(w){return w===40||w===41||w===92?(e.consume(w),b):b(w)}}function gO(e,t,n,r,a,i){const l=this;let o=0,f;return c;function c(y){return e.enter(r),e.enter(a),e.consume(y),e.exit(a),e.enter(i),d}function d(y){return o>999||y===null||y===91||y===93&&!f||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||rt(y)||o++>999?(e.exit("chunkString"),d(y)):(e.consume(y),f||(f=!Et(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,p):p(y)}}function yO(e,t,n,r,a,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),l=m===40?41:m,f):n(m)}function f(m){return m===l?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),c(m))}function c(m){return m===l?(e.exit(i),f(l)):m===null?n(m):rt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),At(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===l||m===null||rt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===l||m===92?(e.consume(m),d):d(m)}}function Uf(e,t){let n;return r;function r(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Et(a)?At(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const aH={name:"definition",tokenize:sH},iH={partial:!0,tokenize:lH};function sH(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return gO.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=Fa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return Xt(y)?Uf(e,c)(y):c(y)}function c(y){return mO(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function d(y){return e.attempt(iH,p,p)(y)}function p(y){return Et(y)?At(e,m,"whitespace")(y):m(y)}function m(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function lH(e,t,n){return r;function r(o){return Xt(o)?Uf(e,a)(o):n(o)}function a(o){return yO(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Et(o)?At(e,l,"whitespace")(o):l(o)}function l(o){return o===null||rt(o)?t(o):n(o)}}const oH={name:"hardBreakEscape",tokenize:uH};function uH(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const cH={name:"headingAtx",resolve:fH,tokenize:dH};function fH(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},la(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function dH(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||Xt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),f(d)):d===null||rt(d)?(e.exit("atxHeading"),t(d)):Et(d)?At(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function f(d){return d===35?(e.consume(d),f):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Xt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const hH=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dk=["pre","script","style","textarea"],vH={concrete:!0,name:"htmlFlow",resolveTo:gH,tokenize:yH},pH={partial:!0,tokenize:bH},mH={partial:!0,tokenize:xH};function gH(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function yH(e,t,n){const r=this;let a,i,l,o,f;return c;function c(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),p}function p(z){return z===33?(e.consume(z),m):z===47?(e.consume(z),i=!0,b):z===63?(e.consume(z),a=3,r.interrupt?t:F):Tr(z)?(e.consume(z),l=String.fromCharCode(z),S):n(z)}function m(z){return z===45?(e.consume(z),a=2,y):z===91?(e.consume(z),a=5,o=0,x):Tr(z)?(e.consume(z),a=4,r.interrupt?t:F):n(z)}function y(z){return z===45?(e.consume(z),r.interrupt?t:F):n(z)}function x(z){const W="CDATA[";return z===W.charCodeAt(o++)?(e.consume(z),o===W.length?r.interrupt?t:P:x):n(z)}function b(z){return Tr(z)?(e.consume(z),l=String.fromCharCode(z),S):n(z)}function S(z){if(z===null||z===47||z===62||Xt(z)){const W=z===47,re=l.toLowerCase();return!W&&!i&&dk.includes(re)?(a=1,r.interrupt?t(z):P(z)):hH.includes(l.toLowerCase())?(a=6,W?(e.consume(z),w):r.interrupt?t(z):P(z)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):i?N(z):C(z))}return z===45||mr(z)?(e.consume(z),l+=String.fromCharCode(z),S):n(z)}function w(z){return z===62?(e.consume(z),r.interrupt?t:P):n(z)}function N(z){return Et(z)?(e.consume(z),N):M(z)}function C(z){return z===47?(e.consume(z),M):z===58||z===95||Tr(z)?(e.consume(z),T):Et(z)?(e.consume(z),C):M(z)}function T(z){return z===45||z===46||z===58||z===95||mr(z)?(e.consume(z),T):R(z)}function R(z){return z===61?(e.consume(z),A):Et(z)?(e.consume(z),R):C(z)}function A(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),f=z,D):Et(z)?(e.consume(z),A):L(z)}function D(z){return z===f?(e.consume(z),f=null,B):z===null||rt(z)?n(z):(e.consume(z),D)}function L(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Xt(z)?R(z):(e.consume(z),L)}function B(z){return z===47||z===62||Et(z)?C(z):n(z)}function M(z){return z===62?(e.consume(z),_):n(z)}function _(z){return z===null||rt(z)?P(z):Et(z)?(e.consume(z),_):n(z)}function P(z){return z===45&&a===2?(e.consume(z),I):z===60&&a===1?(e.consume(z),U):z===62&&a===4?(e.consume(z),q):z===63&&a===3?(e.consume(z),F):z===93&&a===5?(e.consume(z),Q):rt(z)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(pH,X,H)(z)):z===null||rt(z)?(e.exit("htmlFlowData"),H(z)):(e.consume(z),P)}function H(z){return e.check(mH,$,X)(z)}function $(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),V}function V(z){return z===null||rt(z)?H(z):(e.enter("htmlFlowData"),P(z))}function I(z){return z===45?(e.consume(z),F):P(z)}function U(z){return z===47?(e.consume(z),l="",Y):P(z)}function Y(z){if(z===62){const W=l.toLowerCase();return dk.includes(W)?(e.consume(z),q):P(z)}return Tr(z)&&l.length<8?(e.consume(z),l+=String.fromCharCode(z),Y):P(z)}function Q(z){return z===93?(e.consume(z),F):P(z)}function F(z){return z===62?(e.consume(z),q):z===45&&a===2?(e.consume(z),F):P(z)}function q(z){return z===null||rt(z)?(e.exit("htmlFlowData"),X(z)):(e.consume(z),q)}function X(z){return e.exit("htmlFlow"),t(z)}}function xH(e,t,n){const r=this;return a;function a(l){return rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function bH(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Dd,t,n)}}const wH={name:"htmlText",tokenize:SH};function SH(e,t,n){const r=this;let a,i,l;return o;function o(F){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(F),f}function f(F){return F===33?(e.consume(F),c):F===47?(e.consume(F),R):F===63?(e.consume(F),C):Tr(F)?(e.consume(F),L):n(F)}function c(F){return F===45?(e.consume(F),d):F===91?(e.consume(F),i=0,x):Tr(F)?(e.consume(F),N):n(F)}function d(F){return F===45?(e.consume(F),y):n(F)}function p(F){return F===null?n(F):F===45?(e.consume(F),m):rt(F)?(l=p,U(F)):(e.consume(F),p)}function m(F){return F===45?(e.consume(F),y):p(F)}function y(F){return F===62?I(F):F===45?m(F):p(F)}function x(F){const q="CDATA[";return F===q.charCodeAt(i++)?(e.consume(F),i===q.length?b:x):n(F)}function b(F){return F===null?n(F):F===93?(e.consume(F),S):rt(F)?(l=b,U(F)):(e.consume(F),b)}function S(F){return F===93?(e.consume(F),w):b(F)}function w(F){return F===62?I(F):F===93?(e.consume(F),w):b(F)}function N(F){return F===null||F===62?I(F):rt(F)?(l=N,U(F)):(e.consume(F),N)}function C(F){return F===null?n(F):F===63?(e.consume(F),T):rt(F)?(l=C,U(F)):(e.consume(F),C)}function T(F){return F===62?I(F):C(F)}function R(F){return Tr(F)?(e.consume(F),A):n(F)}function A(F){return F===45||mr(F)?(e.consume(F),A):D(F)}function D(F){return rt(F)?(l=D,U(F)):Et(F)?(e.consume(F),D):I(F)}function L(F){return F===45||mr(F)?(e.consume(F),L):F===47||F===62||Xt(F)?B(F):n(F)}function B(F){return F===47?(e.consume(F),I):F===58||F===95||Tr(F)?(e.consume(F),M):rt(F)?(l=B,U(F)):Et(F)?(e.consume(F),B):I(F)}function M(F){return F===45||F===46||F===58||F===95||mr(F)?(e.consume(F),M):_(F)}function _(F){return F===61?(e.consume(F),P):rt(F)?(l=_,U(F)):Et(F)?(e.consume(F),_):B(F)}function P(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),a=F,H):rt(F)?(l=P,U(F)):Et(F)?(e.consume(F),P):(e.consume(F),$)}function H(F){return F===a?(e.consume(F),a=void 0,V):F===null?n(F):rt(F)?(l=H,U(F)):(e.consume(F),H)}function $(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||Xt(F)?B(F):(e.consume(F),$)}function V(F){return F===47||F===62||Xt(F)?B(F):n(F)}function I(F){return F===62?(e.consume(F),e.exit("htmlTextData"),e.exit("htmlText"),t):n(F)}function U(F){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),Y}function Y(F){return Et(F)?At(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):Q(F)}function Q(F){return e.enter("htmlTextData"),l(F)}}const pw={name:"labelEnd",resolveAll:kH,resolveTo:TH,tokenize:jH},EH={tokenize:AH},CH={tokenize:RH},NH={tokenize:DH};function kH(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&la(e,0,e.length,n),e}function TH(e,t){let n=e.length,r=0,a,i,l,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",f,t],["enter",c,t]],o=ja(o,e.slice(i+1,i+r+3)),o=ja(o,[["enter",d,t]]),o=ja(o,Qp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=ja(o,[["exit",d,t],e[l-2],e[l-1],["exit",c,t]]),o=ja(o,e.slice(l+1)),o=ja(o,[["exit",f,t]]),la(e,i,e.length,o),e}function jH(e,t,n){const r=this;let a=r.events.length,i,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?p(m):(l=r.parser.defined.includes(Fa(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(EH,d,l?d:p)(m):m===91?e.attempt(CH,d,l?c:p)(m):l?d(m):p(m)}function c(m){return e.attempt(NH,d,p)(m)}function d(m){return t(m)}function p(m){return i._balanced=!0,n(m)}}function AH(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Xt(p)?Uf(e,i)(p):i(p)}function i(p){return p===41?d(p):mO(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Xt(p)?Uf(e,f)(p):d(p)}function o(p){return n(p)}function f(p){return p===34||p===39||p===40?yO(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function c(p){return Xt(p)?Uf(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function RH(e,t,n){const r=this;return a;function a(o){return gO.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Fa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function DH(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const MH={name:"labelStartImage",resolveAll:pw.resolveAll,tokenize:OH};function OH(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const LH={name:"labelStartLink",resolveAll:pw.resolveAll,tokenize:_H};function _H(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Jy={name:"lineEnding",tokenize:BH};function BH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const qv={name:"thematicBreak",tokenize:PH};function PH(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),l(c)}function l(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||rt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function f(c){return c===a?(e.consume(c),r++,f):(e.exit("thematicBreakSequence"),Et(c)?At(e,o,"whitespace")(c):o(c))}}const Fr={continuation:{tokenize:qH},exit:VH,name:"list",tokenize:FH},zH={partial:!0,tokenize:HH},IH={partial:!0,tokenize:UH};function FH(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return o;function o(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Bb(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(qv,n,c)(y):c(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return Bb(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),c(y)):n(y)}function c(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Dd,r.interrupt?n:d,e.attempt(zH,m,p))}function d(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function p(y){return Et(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function qH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Dd,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Et(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(IH,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Fr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function UH(e,t,n){const r=this;return At(e,a,"listItemIndent",r.containerState.size+1);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function VH(e){e.exit(this.containerState.type)}function HH(e,t,n){const r=this;return At(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=r.events[r.events.length-1];return!Et(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const hk={name:"setextUnderline",resolveTo:$H,tokenize:GH};function $H(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function GH(e,t,n){const r=this;let a;return i;function i(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Et(c)?At(e,f,"lineSuffix")(c):f(c))}function f(c){return c===null||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const KH={tokenize:YH};function YH(e){const t=this,n=e.attempt(Dd,r,e.attempt(this.parser.constructs.flowInitial,a,At(e,e.attempt(this.parser.constructs.flow,a,e.attempt(J9,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const XH={resolveAll:bO()},QH=xO("string"),WH=xO("text");function xO(e){return{resolveAll:bO(e==="text"?ZH:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,l,o);return l;function l(d){return c(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),f}function f(d){return c(d)?(n.exit("data"),i(d)):(n.consume(d),f)}function c(d){if(d===null)return!0;const p=a[d];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function bO(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function ZH(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,l=-1,o=0,f;for(;i--;){const c=a[i];if(typeof c=="string"){for(l=c.length;c.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(c===-2)f=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const JH={42:Fr,43:Fr,45:Fr,48:Fr,49:Fr,50:Fr,51:Fr,52:Fr,53:Fr,54:Fr,55:Fr,56:Fr,57:Fr,62:dO},e7={91:aH},t7={[-2]:Zy,[-1]:Zy,32:Zy},n7={35:cH,42:qv,45:[hk,qv],60:vH,61:hk,95:qv,96:fk,126:fk},r7={38:vO,92:hO},a7={[-5]:Jy,[-4]:Jy,[-3]:Jy,33:MH,38:vO,42:Pb,60:[L9,wH],91:LH,92:[oH,hO],93:pw,95:Pb,96:K9},i7={null:[Pb,XH]},s7={null:[42,95]},l7={null:[]},o7=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:s7,contentInitial:e7,disable:l7,document:JH,flow:n7,flowInitial:t7,insideSpan:i7,string:r7,text:a7},Symbol.toStringTag,{value:"Module"}));function u7(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let l=[],o=[];const f={attempt:D(R),check:D(A),consume:N,enter:C,exit:T,interrupt:D(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let d=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function p(_){return l=ja(l,_),S(),l[l.length-1]!==null?[]:(L(t,0),c.events=Qp(i,c.events,c),c.events)}function m(_,P){return f7(y(_),P)}function y(_){return c7(l,_)}function x(){const{_bufferIndex:_,_index:P,line:H,column:$,offset:V}=r;return{_bufferIndex:_,_index:P,line:H,column:$,offset:V}}function b(_){a[_.line]=_.column,M()}function S(){let _;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<P.length;)w(P.charCodeAt(r._bufferIndex));else w(P)}}function w(_){d=d(_)}function N(_){rt(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,M()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=_}function C(_,P){const H=P||{};return H.type=_,H.start=x(),c.events.push(["enter",H,c]),o.push(H),H}function T(_){const P=o.pop();return P.end=x(),c.events.push(["exit",P,c]),P}function R(_,P){L(_,P.from)}function A(_,P){P.restore()}function D(_,P){return H;function H($,V,I){let U,Y,Q,F;return Array.isArray($)?X($):"tokenize"in $?X([$]):q($);function q(ae){return ie;function ie(ye){const ue=ye!==null&&ae[ye],ee=ye!==null&&ae.null,ne=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return X(ne)(ye)}}function X(ae){return U=ae,Y=0,ae.length===0?I:z(ae[Y])}function z(ae){return ie;function ie(ye){return F=B(),Q=ae,ae.partial||(c.currentConstruct=ae),ae.name&&c.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(P?Object.assign(Object.create(c),P):c,f,W,re)(ye)}}function W(ae){return _(Q,F),V}function re(ae){return F.restore(),++Y<U.length?z(U[Y]):I}}}function L(_,P){_.resolveAll&&!i.includes(_)&&i.push(_),_.resolve&&la(c.events,P,c.events.length-P,_.resolve(c.events.slice(P),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function B(){const _=x(),P=c.previous,H=c.currentConstruct,$=c.events.length,V=Array.from(o);return{from:$,restore:I};function I(){r=_,c.previous=P,c.currentConstruct=H,c.events.length=$,o=V,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function c7(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,i)];else{if(l=e.slice(n,a),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function f7(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
471
+ `;break}case-3:{l=`\r
472
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function d7(e){const r={constructs:cO([o7,...(e||{}).extensions||[]]),content:a(T9),defined:[],document:a(A9),flow:a(KH),lazy:{},string:a(QH),text:a(WH)};return r;function a(i){return l;function l(o){return u7(r,i,o)}}}function h7(e){for(;!pO(e););return e}const vk=/[\0\t\n\r]/g;function v7(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,d,p,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(vk.lastIndex=p,c=vk.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(p);break}if(y===10&&p===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<m&&(f.push(i.slice(p,m)),e+=m-p),y){case 0:{f.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,f.push(-2);e++<d;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const p7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m7(e){return e.replace(p7,g7)}function g7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return fO(n.slice(i?2:1),i?16:10)}return vw(n)||e}const wO={}.hasOwnProperty;function y7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),x7(n)(h7(d7(n).document().write(v7()(e,t,!0))))}function x7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ve),autolinkProtocol:B,autolinkEmail:B,atxHeading:i(Pe),blockQuote:i(ee),characterEscape:B,characterReference:B,codeFenced:i(ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ne,l),codeText:i(se,l),codeTextData:B,data:B,codeFlowValue:B,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(ke),hardBreakEscape:i(lt),hardBreakTrailing:i(lt),htmlFlow:i(Je,l),htmlFlowData:B,htmlText:i(Je,l),htmlTextData:B,image:i(We),label:l,link:i(Ve),listItem:i(Ke),listItemValue:m,listOrdered:i(Re,p),listUnordered:i(Re),paragraph:i(Xe),reference:z,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Pe),strong:i(st),thematicBreak:i(dt)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:ue,autolinkProtocol:ye,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:ie,codeFenced:f(S),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(w),codeText:f(V),codeTextData:M,data:M,definition:f(),definitionDestinationString:T,definitionLabelString:N,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(P),hardBreakTrailing:f(P),htmlFlow:f(H),htmlFlowData:M,htmlText:f($),htmlTextData:M,image:f(U),label:Q,labelText:Y,lineEnding:_,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:W,resourceDestinationString:F,resourceTitleString:q,resource:X,setextHeading:f(L),setextHeadingLineSequence:D,setextHeadingText:A,strong:f(),thematicBreak:f()}};SO(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const De={stack:[Ce],tokenStack:[],config:t,enter:o,exit:c,buffer:l,resume:d,data:n},Fe=[];let Me=-1;for(;++Me<he.length;)if(he[Me][1].type==="listOrdered"||he[Me][1].type==="listUnordered")if(he[Me][0]==="enter")Fe.push(Me);else{const Oe=Fe.pop();Me=a(he,Oe,Me)}for(Me=-1;++Me<he.length;){const Oe=t[he[Me][0]];wO.call(Oe,he[Me][1].type)&&Oe[he[Me][1].type].call(Object.assign({sliceSerialize:he[Me][2].sliceSerialize},De),he[Me][1])}if(De.tokenStack.length>0){const Oe=De.tokenStack[De.tokenStack.length-1];(Oe[1]||pk).call(De,void 0,Oe[0])}for(Ce.position={start:Us(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Us(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<t.transforms.length;)Ce=t.transforms[Me](Ce)||Ce;return Ce}function a(he,Ce,De){let Fe=Ce-1,Me=-1,Oe=!1,xe,K,oe,pe;for(;++Fe<=De;){const de=he[Fe];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?Me++:Me--,pe=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(xe&&!pe&&!Me&&!oe&&(oe=Fe),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!Me&&de[0]==="enter"&&de[1].type==="listItemPrefix"||Me===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(xe){let be=Fe;for(K=void 0;be--;){const Le=he[be];if(Le[1].type==="lineEnding"||Le[1].type==="lineEndingBlank"){if(Le[0]==="exit")continue;K&&(he[K][1].type="lineEndingBlank",Oe=!0),Le[1].type="lineEnding",K=be}else if(!(Le[1].type==="linePrefix"||Le[1].type==="blockQuotePrefix"||Le[1].type==="blockQuotePrefixWhitespace"||Le[1].type==="blockQuoteMarker"||Le[1].type==="listItemIndent"))break}oe&&(!K||oe<K)&&(xe._spread=!0),xe.end=Object.assign({},K?he[K][1].start:de[1].end),he.splice(K||Fe,0,["exit",xe,de[2]]),Fe++,De++}if(de[1].type==="listItemPrefix"){const be={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};xe=be,he.splice(Fe,0,["enter",be,de[2]]),Fe++,De++,oe=void 0,pe=!0}}}return he[Ce][1]._spread=Oe,De}function i(he,Ce){return De;function De(Fe){o.call(this,he(Fe),Fe),Ce&&Ce.call(this,Fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,De){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,De||void 0]),he.position={start:Us(Ce.start),end:void 0}}function f(he){return Ce;function Ce(De){he&&he.call(this,De),c.call(this,De)}}function c(he,Ce){const De=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==he.type&&(Ce?Ce.call(this,he,Fe[0]):(Fe[1]||pk).call(this,he,Fe[0]));else throw new Error("Cannot close `"+he.type+"` ("+qf({start:he.start,end:he.end})+"): it’s not open");De.position.end=Us(he.end)}function d(){return hw(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function x(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function N(he){const Ce=this.resume(),De=this.stack[this.stack.length-1];De.label=Ce,De.identifier=Fa(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function R(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const De=this.sliceSerialize(he).length;Ce.depth=De}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function B(he){const De=this.stack[this.stack.length-1].children;let Fe=De[De.length-1];(!Fe||Fe.type!=="text")&&(Fe=ze(),Fe.position={start:Us(he.start),end:void 0},De.push(Fe)),this.stack.push(Fe)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Us(he.end)}function _(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Ce.children[Ce.children.length-1];De.position.end=Us(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(B.call(this,he),M.call(this,he))}function P(){this.data.atHardBreak=!0}function H(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function $(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function I(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function U(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(he){const Ce=this.sliceSerialize(he),De=this.stack[this.stack.length-2];De.label=m7(Ce),De.identifier=Fa(Ce).toLowerCase()}function Q(){const he=this.stack[this.stack.length-1],Ce=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Fe=he.children;De.children=Fe}else De.alt=Ce}function F(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function X(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function W(he){const Ce=this.resume(),De=this.stack[this.stack.length-1];De.label=Ce,De.identifier=Fa(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function re(he){this.data.characterReferenceType=he.type}function ae(he){const Ce=this.sliceSerialize(he),De=this.data.characterReferenceType;let Fe;De?(Fe=fO(Ce,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=vw(Ce);const Me=this.stack[this.stack.length-1];Me.value+=Fe}function ie(he){const Ce=this.stack.pop();Ce.position.end=Us(he.end)}function ye(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ue(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function ee(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Je(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function Re(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ke(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Xe(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function ze(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function Us(e){return{line:e.line,column:e.column,offset:e.offset}}function SO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?SO(e,r):b7(e,r)}}function b7(e,t){let n;for(n in t)if(wO.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+qf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+qf({start:t.start,end:t.end})+") is still open")}function w7(e){const t=this;t.parser=n;function n(r){return y7(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function S7(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function E7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
473
+ `}]}function C7(e,t){const n=t.value?t.value+`
474
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function N7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=yc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,o+=1,e.footnoteCounts.set(r,o);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,c),e.applyData(t,c)}function j7(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function EO(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function R7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EO(e,t);const a={src:yc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function D7(e,t){const n={src:yc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function M7(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function O7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EO(e,t);const a={href:yc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function L7(e,t){const n={href:yc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _7(e,t,n){const r=e.all(t),a=n?B7(n):CO(t),i={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(a||o!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
475
+ `}),d.type==="element"&&d.tagName==="p"&&!a?l.push(...d.children):l.push(d)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
476
+ `});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function B7(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=CO(n[r])}return t}function CO(e){const t=e.spread;return t??e.children.length>1}function P7(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function z7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function F7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q7(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=uw(t.children[1]),f=rO(t.children[t.children.length-1]);o&&f&&(l.position={start:o,end:f}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function U7(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let f=-1;const c=[];for(;++f<o;){const p=t.children[f],m={},y=l?l[f]:void 0;y&&(m.align=y);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),c.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function V7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mk=9,gk=32;function H7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(yk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(yk(t.slice(a),a>0,!1)),i.join("")}function yk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===mk||i===gk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===mk||i===gk;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function $7(e,t){const n={type:"text",value:H7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function G7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const K7={blockquote:S7,break:E7,code:C7,delete:N7,emphasis:k7,footnoteReference:T7,heading:j7,html:A7,imageReference:R7,image:D7,inlineCode:M7,linkReference:O7,link:L7,listItem:_7,list:P7,paragraph:z7,root:I7,strong:F7,table:q7,tableCell:V7,tableRow:U7,text:$7,thematicBreak:G7,toml:vv,yaml:vv,definition:vv,footnoteDefinition:vv};function vv(){}const NO=-1,Wp=0,Vf=1,fp=2,mw=3,gw=4,yw=5,xw=6,kO=7,TO=8,xk=typeof self=="object"?self:globalThis,Y7=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,l]=t[a];switch(i){case Wp:case NO:return n(l,a);case Vf:{const o=n([],a);for(const f of l)o.push(r(f));return o}case fp:{const o=n({},a);for(const[f,c]of l)o[r(f)]=r(c);return o}case mw:return n(new Date(l),a);case gw:{const{source:o,flags:f}=l;return n(new RegExp(o,f),a)}case yw:{const o=n(new Map,a);for(const[f,c]of l)o.set(r(f),r(c));return o}case xw:{const o=n(new Set,a);for(const f of l)o.add(r(f));return o}case kO:{const{name:o,message:f}=l;return n(new xk[o](f),a)}case TO:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(new xk[i](l),a)};return r},bk=e=>Y7(new Map,e)(0),mu="",{toString:X7}={},{keys:Q7}=Object,Cf=e=>{const t=typeof e;if(t!=="object"||!e)return[Wp,t];const n=X7.call(e).slice(8,-1);switch(n){case"Array":return[Vf,mu];case"Object":return[fp,mu];case"Date":return[mw,mu];case"RegExp":return[gw,mu];case"Map":return[yw,mu];case"Set":return[xw,mu];case"DataView":return[Vf,n]}return n.includes("Array")?[Vf,n]:n.includes("Error")?[kO,n]:[fp,n]},pv=([e,t])=>e===Wp&&(t==="function"||t==="symbol"),W7=(e,t,n,r)=>{const a=(l,o)=>{const f=r.push(l)-1;return n.set(o,f),f},i=l=>{if(n.has(l))return n.get(l);let[o,f]=Cf(l);switch(o){case Wp:{let d=l;switch(f){case"bigint":o=TO,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);d=null;break;case"undefined":return a([NO],l)}return a([o,d],l)}case Vf:{if(f){let m=l;return f==="DataView"?m=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(m=new Uint8Array(l)),a([f,[...m]],l)}const d=[],p=a([o,d],l);for(const m of l)d.push(i(m));return p}case fp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const d=[],p=a([o,d],l);for(const m of Q7(l))(e||!pv(Cf(l[m])))&&d.push([i(m),i(l[m])]);return p}case mw:return a([o,l.toISOString()],l);case gw:{const{source:d,flags:p}=l;return a([o,{source:d,flags:p}],l)}case yw:{const d=[],p=a([o,d],l);for(const[m,y]of l)(e||!(pv(Cf(m))||pv(Cf(y))))&&d.push([i(m),i(y)]);return p}case xw:{const d=[],p=a([o,d],l);for(const m of l)(e||!pv(Cf(m)))&&d.push(i(m));return p}}const{message:c}=l;return a([o,{name:f,message:c}],l)};return i},wk=(e,{json:t,lossy:n}={})=>{const r=[];return W7(!(t||n),!!t,new Map,r)(e),r},dp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bk(wk(e,t)):structuredClone(e):(e,t)=>bk(wk(e,t));function Z7(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function J7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function e$(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Z7,r=e.options.footnoteBackLabel||J7,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let f=-1;for(;++f<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[f]);if(!c)continue;const d=e.all(c),p=String(c.identifier).toUpperCase(),m=yc(p.toLowerCase());let y=0;const x=[],b=e.footnoteCounts.get(p);for(;b!==void 0&&++y<=b;){x.length>0&&x.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,y);typeof N=="string"&&(N={type:"text",value:N}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const N=S.children[S.children.length-1];N&&N.type==="text"?N.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...x)}else d.push(...x);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...dp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
477
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
478
+ `}]}}const Zp=(function(e){if(e==null)return a$;if(typeof e=="function")return Jp(e);if(typeof e=="object")return Array.isArray(e)?t$(e):n$(e);if(typeof e=="string")return r$(e);throw new Error("Expected function, string, or object as test")});function t$(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Zp(e[n]);return Jp(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function n$(e){const t=e;return Jp(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function r$(e){return Jp(t);function t(n){return n&&n.type===e}}function Jp(e){return t;function t(n,r,a){return!!(i$(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function a$(){return!0}function i$(e){return e!==null&&typeof e=="object"&&"type"in e}const jO=[],s$=!0,zb=!1,l$="skip";function AO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Zp(a),l=r?-1:1;o(e,void 0,[])();function o(f,c,d){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=jO,x,b,S;if((!t||i(f,c,d[d.length-1]||void 0))&&(y=o$(n(f,d)),y[0]===zb))return y;if("children"in f&&f.children){const w=f;if(w.children&&y[0]!==l$)for(b=(r?w.children.length:-1)+l,S=d.concat(w);b>-1&&b<w.children.length;){const N=w.children[b];if(x=o(N,b,S)(),x[0]===zb)return x;b=typeof x[1]=="number"?x[1]:b+l}}return y}}}function o$(e){return Array.isArray(e)?e:typeof e=="number"?[s$,e]:e==null?jO:[e]}function bw(e,t,n,r){let a,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,a=n):(i=t,l=n,a=r),AO(e,i,o,a);function o(f,c){const d=c[c.length-1],p=d?d.children.indexOf(f):void 0;return l(f,p,d)}}const Ib={}.hasOwnProperty,u$={};function c$(e,t){const n=t||u$,r=new Map,a=new Map,i=new Map,l={...K7,...n.handlers},o={all:c,applyData:d$,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:f$,wrap:v$};return bw(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?r:a,m=String(d.identifier).toUpperCase();p.has(m)||p.set(m,d)}}),o;function f(d,p){const m=d.type,y=o.handlers[m];if(Ib.call(o.handlers,m)&&y)return y(o,d,p);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in d){const{children:b,...S}=d,w=dp(S);return w.children=o.all(d),w}return dp(d)}return(o.options.unknownHandler||h$)(o,d,p)}function c(d){const p=[];if("children"in d){const m=d.children;let y=-1;for(;++y<m.length;){const x=o.one(m[y],d);if(x){if(y&&m[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Sk(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=Sk(b.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function f$(e,t){e.position&&(t.position=JV(e))}function d$(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,dp(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function h$(e,t){const n=t.data||{},r="value"in t&&!(Ib.call(n,"hProperties")||Ib.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function v$(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
479
+ `});++r<e.length;)r&&n.push({type:"text",value:`
480
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
481
+ `}),n}function Sk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ek(e,t){const n=c$(e,t),r=n.one(e,void 0),a=e$(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
482
+ `},a),i}function p$(e,t){return e&&"run"in e?async function(n,r){const a=Ek(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Ek(n,{file:r,...e||t})}}function Ck(e){if(e)throw e}var ex,Nk;function m$(){if(Nk)return ex;Nk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return ex=function f(){var c,d,p,m,y,x,b=arguments[0],S=1,w=arguments.length,N=!1;for(typeof b=="boolean"&&(N=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<w;++S)if(c=arguments[S],c!=null)for(d in c)p=o(b,d),m=o(c,d),b!==m&&(N&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=p&&a(p)?p:[]):x=p&&i(p)?p:{},l(b,{name:d,newValue:f(N,x,m)})):typeof m<"u"&&l(b,{name:d,newValue:m}));return b},ex}var g$=m$();const tx=pd(g$);function Fb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function y$(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...a);function o(f,...c){const d=e[++i];let p=-1;if(f){l(f);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,d?x$(d,o)(...c):l(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function x$(e,t){let n;return r;function r(...l){const o=e.length>l.length;let f;o&&l.push(a);try{f=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return a(d)}o||(f&&f.then&&typeof f.then=="function"?f.then(i,a):f instanceof Error?a(f):i(f))}function a(l,...o){n||(n=!0,t(l,...o))}function i(l){a(null,l)}}const ai={basename:b$,dirname:w$,extname:S$,join:E$,sep:"/"};function b$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Md(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function w$(e){if(Md(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function S$(e){Md(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function E$(...e){let t=-1,n;for(;++t<e.length;)Md(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":C$(n)}function C$(e){Md(e);const t=e.codePointAt(0)===47;let n=N$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function N$(e,t){let n="",r=0,a=-1,i=0,l=-1,o,f;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",r=0,a=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,i=0}else o===46&&i>-1?i++:i=-1}return n}function Md(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const k$={cwd:T$};function T$(){return"/"}function qb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function j$(e){if(typeof e=="string")e=new URL(e);else if(!qb(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return A$(e)}function A$(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const nx=["history","path","basename","stem","extname","dirname"];class RO{constructor(t){let n;t?qb(t)?n={path:t}:typeof t=="string"||R$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":k$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nx.length;){const i=nx[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)nx.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ai.basename(this.path):void 0}set basename(t){ax(t,"basename"),rx(t,"basename"),this.path=ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ai.dirname(this.path):void 0}set dirname(t){kk(this.basename,"dirname"),this.path=ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ai.extname(this.path):void 0}set extname(t){if(rx(t,"extname"),kk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){qb(t)&&(t=j$(t)),ax(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ai.basename(this.path,this.extname):void 0}set stem(t){ax(t,"stem"),rx(t,"stem"),this.path=ai.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new wr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rx(e,t){if(e&&e.includes(ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ai.sep+"`")}function ax(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function R$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const D$=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),M$={}.hasOwnProperty;class ww extends D${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=y$()}copy(){const t=new ww;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(tx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lx("data",this.frozen),this.namespace[t]=n,this):M$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=mv(t),r=this.parser||this.Parser;return ix("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ix("process",this.parser||this.Parser),sx("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=mv(t),f=r.parse(o);r.run(f,o,function(d,p,m){if(d||!p||!m)return c(d);const y=p,x=r.stringify(y,m);_$(x)?m.value=x:m.result=x,c(d,m)});function c(d,p){d||!p?l(d):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),ix("processSync",this.parser||this.Parser),sx("processSync",this.compiler||this.Compiler),this.process(t,a),jk("processSync","process",n),r;function a(i,l){n=!0,Ck(i),r=l}}run(t,n,r){Tk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,o){const f=mv(n);a.run(t,f,c);function c(d,p,m){const y=p||t;d?o(d):l?l(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),jk("runSync","run",r),a;function i(l,o){Ck(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=mv(n),a=this.compiler||this.Compiler;return sx("stringify",a),Tk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(lx("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...p]=c;f(d,p)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(a.settings=tx(!0,a.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const p=c[d];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,d){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===c){m=p;break}if(m===-1)r.push([c,...d]);else if(d.length>0){let[y,...x]=d;const b=r[m][1];Fb(b)&&Fb(y)&&(y=tx(!0,b,y)),r[m]=[c,y,...x]}}}}const O$=new ww().freeze();function ix(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Tk(e){if(!Fb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mv(e){return L$(e)?e:new RO(e)}function L$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _$(e){return typeof e=="string"||B$(e)}function B$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ak=[],Rk={allowDangerousHtml:!0},z$=/^(https?|ircs?|mailto|xmpp)$/i,I$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function F$(e){const t=q$(e),n=U$(e);return V$(t.runSync(t.parse(n),n),e)}function q$(e){const t=e.rehypePlugins||Ak,n=e.remarkPlugins||Ak,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rk}:Rk;return O$().use(w7).use(n).use(p$,r).use(t)}function U$(e){const t=e.children||"",n=new RO;return typeof t=="string"&&(n.value=t),n}function V$(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||H$;for(const d of I$)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+P$+d.id,void 0);return bw(e,c),a9(e,{Fragment:h.Fragment,components:a,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let y;for(y in Wy)if(Object.hasOwn(Wy,y)&&Object.hasOwn(d.properties,y)){const x=d.properties[y],b=Wy[y];(b===null||b.includes(d.tagName))&&(d.properties[y]=f(String(x||""),y,d))}}if(d.type==="element"){let y=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(d,p,m)),y&&m&&typeof p=="number")return o&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function H$(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||z$.test(e.slice(0,t))?e:""}function Dk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function $$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function G$(e,t,n){const a=Zp((n||{}).ignore||[]),i=K$(t);let l=-1;for(;++l<i.length;)AO(e,"text",o);function o(c,d){let p=-1,m;for(;++p<d.length;){const y=d[p],x=m?m.children:void 0;if(a(y,x?x.indexOf(y):void 0,m))return;m=y}if(m)return f(c,d)}function f(c,d){const p=d[d.length-1],m=i[l][0],y=i[l][1];let x=0;const S=p.children.indexOf(c);let w=!1,N=[];m.lastIndex=0;let C=m.exec(c.value);for(;C;){const T=C.index,R={index:C.index,input:C.input,stack:[...d,c]};let A=y(...C,R);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=T+1:(x!==T&&N.push({type:"text",value:c.value.slice(x,T)}),Array.isArray(A)?N.push(...A):A&&N.push(A),x=T+C[0].length,w=!0),!m.global)break;C=m.exec(c.value)}return w?(x<c.value.length&&N.push({type:"text",value:c.value.slice(x)}),p.children.splice(S,1,...N)):N=[c],S+N.length}}function K$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([Y$(a[0]),X$(a[1])])}return t}function Y$(e){return typeof e=="string"?new RegExp($$(e),"g"):e}function X$(e){return typeof e=="function"?e:function(){return e}}const ox="phrasing",ux=["autolink","link","image","label"];function Q$(){return{transforms:[rG],enter:{literalAutolink:Z$,literalAutolinkEmail:cx,literalAutolinkHttp:cx,literalAutolinkWww:cx},exit:{literalAutolink:nG,literalAutolinkEmail:tG,literalAutolinkHttp:J$,literalAutolinkWww:eG}}}function W$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ox,notInConstruct:ux},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ox,notInConstruct:ux},{character:":",before:"[ps]",after:"\\/",inConstruct:ox,notInConstruct:ux}]}}function Z$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function cx(e){this.config.enter.autolinkProtocol.call(this,e)}function J$(e){this.config.exit.autolinkProtocol.call(this,e)}function eG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function tG(e){this.config.exit.autolinkEmail.call(this,e)}function nG(e){this.exit(e)}function rG(e){G$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),iG]],{ignore:["link","linkReference"]})}function aG(e,t,n,r,a){let i="";if(!DO(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!sG(n)))return!1;const l=lG(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function iG(e,t,n,r){return!DO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function lG(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Dk(e,"(");let i=Dk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function DO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bo(n)||Xp(n))&&(!t||n!==47)}MO.peek=mG;function oG(){this.buffer()}function uG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cG(){this.buffer()}function fG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hG(e){this.exit(e)}function vG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pG(e){this.exit(e)}function mG(){return"["}function MO(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),l(),i+=a.move("]"),i}function gG(){return{enter:{gfmFootnoteCallString:oG,gfmFootnoteCall:uG,gfmFootnoteDefinitionLabelString:cG,gfmFootnoteDefinition:fG},exit:{gfmFootnoteCallString:dG,gfmFootnoteCall:hG,gfmFootnoteDefinitionLabelString:vG,gfmFootnoteDefinition:pG}}}function yG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:MO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,l){const o=i.createTracker(l);let f=o.move("[^");const c=i.enter("footnoteDefinition"),d=i.enter("label");return f+=o.move(i.safe(i.associationId(r),{before:f,after:"]"})),d(),f+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),f+=o.move((t?`
483
+ `:" ")+i.indentLines(i.containerFlow(r,o.current()),t?OO:xG))),c(),f}}function xG(e,t,n){return t===0?e:OO(e,t,n)}function OO(e,t,n){return(n?"":" ")+e}const bG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];LO.peek=NG;function wG(){return{canContainEols:["delete"],enter:{strikethrough:EG},exit:{strikethrough:CG}}}function SG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bG}],handlers:{delete:LO}}}function EG(e){this.enter({type:"delete",children:[]},e)}function CG(e){this.exit(e)}function LO(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function NG(){return"~"}function kG(e){return e.length}function TG(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||kG,i=[],l=[],o=[],f=[];let c=0,d=-1;for(;++d<e.length;){const b=[],S=[];let w=-1;for(e[d].length>c&&(c=e[d].length);++w<e[d].length;){const N=jG(e[d][w]);if(n.alignDelimiters!==!1){const C=a(N);S[w]=C,(f[w]===void 0||C>f[w])&&(f[w]=C)}b.push(N)}l[d]=b,o[d]=S}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<c;)i[p]=Mk(r[p]);else{const b=Mk(r);for(;++p<c;)i[p]=b}p=-1;const m=[],y=[];for(;++p<c;){const b=i[p];let S="",w="";b===99?(S=":",w=":"):b===108?S=":":b===114&&(w=":");let N=n.alignDelimiters===!1?1:Math.max(1,f[p]-S.length-w.length);const C=S+"-".repeat(N)+w;n.alignDelimiters!==!1&&(N=S.length+N+w.length,N>f[p]&&(f[p]=N),y[p]=N),m[p]=C}l.splice(1,0,m),o.splice(1,0,y),d=-1;const x=[];for(;++d<l.length;){const b=l[d],S=o[d];p=-1;const w=[];for(;++p<c;){const N=b[p]||"";let C="",T="";if(n.alignDelimiters!==!1){const R=f[p]-(S[p]||0),A=i[p];A===114?C=" ".repeat(R):A===99?R%2?(C=" ".repeat(R/2+.5),T=" ".repeat(R/2-.5)):(C=" ".repeat(R/2),T=C):T=" ".repeat(R)}n.delimiterStart!==!1&&!p&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||p)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(N),n.alignDelimiters!==!1&&w.push(T),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||p!==c-1)&&w.push("|")}x.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return x.join(`
484
+ `)}function jG(e){return e==null?"":String(e)}function Mk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AG(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),RG);return a(),l}function RG(e,t,n){return">"+(n?"":" ")+e}function DG(e,t){return Ok(e,t.inConstruct,!0)&&!Ok(e,t.notInConstruct,!1)}function Ok(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Lk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
485
+ `&&DG(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
486
+ `}function MG(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>l&&(l=i):i=1,a=r+t.length,r=n.indexOf(t,a);return l}function OG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function LG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _G(e,t,n,r){const a=LG(n),i=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(OG(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(i,BG);return p(),m}const o=n.createTracker(r),f=a.repeat(Math.max(MG(i,a)+1,3)),c=n.enter("codeFenced");let d=o.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
487
+ `,encode:["`"],...o.current()})),p()}return d+=o.move(`
488
+ `),i&&(d+=o.move(i+`
489
+ `)),d+=o.move(f),c(),d}function BG(e,t,n){return(n?"":" ")+e}function Sw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PG(e,t,n,r){const a=Sw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("[");return c+=f.move(n.safe(n.associationId(e),{before:c,after:"]",...f.current()})),c+=f.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":`
490
+ `,...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),l(),c}function zG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Jf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hp(e,t,n){const r=ec(e),a=ec(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_O.peek=IG;function _O(e,t,n,r){const a=zG(n),i=n.enter("emphasis"),l=n.createTracker(r),o=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),d=hp(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Jf(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=hp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+Jf(p));const y=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function IG(e,t,n){return n.options.emphasis||"*"}function FG(e,t){let n=!1;return bw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zb}),!!((!e.depth||e.depth<3)&&hw(e)&&(t.options.setext||n))}function qG(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(FG(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
491
+ `,after:`
492
+ `});return p(),d(),m+`
493
+ `+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
494
+ `))+1))}const l="#".repeat(a),o=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
495
+ `,...i.current()});return/^[\t ]/.test(c)&&(c=Jf(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),f(),o(),c}BO.peek=UG;function BO(e){return e.value||""}function UG(){return"<"}PO.peek=VG;function PO(e,t,n,r){const a=Sw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(e.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":")",...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),c+=f.move(")"),l(),c}function VG(){return"!"}zO.peek=HG;function zO(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("![");const c=n.safe(e.alt,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const d=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function HG(){return"!"}IO.peek=$G;function IO(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],o=n.compilePattern(l);let f;if(l.atBreak)for(;f=o.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return a+r+a}function $G(){return"`"}function FO(e,t){const n=hw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}qO.peek=GG;function qO(e,t,n,r){const a=Sw(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let o,f;if(FO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),o(),n.stack=d,p}o=n.enter("link"),f=n.enter("label");let c=l.move("[");return c+=l.move(n.containerPhrasing(e,{before:c,after:"](",...l.current()})),c+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(f=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(n.safe(e.title,{before:c,after:a,...l.current()})),c+=l.move(a),f()),c+=l.move(")"),o(),c}function GG(e,t,n){return FO(e,n)?"<":"["}UO.peek=KG;function UO(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("[");const c=n.containerPhrasing(e,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const d=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function KG(){return"["}function Ew(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YG(e){const t=Ew(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function VO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QG(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?XG(n):Ew(n);const o=e.ordered?l==="."?")":".":YG(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),VO(n)===l&&d){let p=-1;for(;++p<e.children.length;){const m=e.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,a(),c}function WG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ZG(e,t,n,r){const a=WG(n);let i=n.bulletCurrent||Ew(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(l-i.length)),o.shift(l);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return f(),c;function d(p,m,y){return m?(y?"":" ".repeat(l))+p:(y?i:i+" ".repeat(l-i.length))+p}}function JG(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),a(),l}const eK=Zp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tK(e,t,n,r){return(e.children.some(function(l){return eK(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}HO.peek=rK;function HO(e,t,n,r){const a=nK(n),i=n.enter("strong"),l=n.createTracker(r),o=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),d=hp(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Jf(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=hp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+Jf(p));const y=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function rK(e,t,n){return n.options.strong||"*"}function aK(e,t,n,r){return n.safe(e.value,r)}function iK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sK(e,t,n){const r=(VO(n)+(n.options.ruleSpaces?" ":"")).repeat(iK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $O={blockquote:AG,break:Lk,code:_G,definition:PG,emphasis:_O,hardBreak:Lk,heading:qG,html:BO,image:PO,imageReference:zO,inlineCode:IO,link:qO,linkReference:UO,list:QG,listItem:ZG,paragraph:JG,root:tK,strong:HO,text:aK,thematicBreak:sK};function lK(){return{enter:{table:oK,tableData:_k,tableHeader:_k,tableRow:cK},exit:{codeText:fK,table:uK,tableData:fx,tableHeader:fx,tableRow:fx}}}function oK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function uK(e){this.exit(e),this.data.inTable=void 0}function cK(e){this.enter({type:"tableRow",children:[]},e)}function fx(e){this.exit(e)}function _k(e){this.enter({type:"tableCell",children:[]},e)}function fK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,dK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function dK(e,t){return t==="|"?t:e}function hK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
496
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:f,tableRow:o}};function l(y,x,b,S){return c(d(y,b,S),y.align)}function o(y,x,b,S){const w=p(y,b,S),N=c([w]);return N.slice(0,N.indexOf(`
497
+ `))}function f(y,x,b,S){const w=b.enter("tableCell"),N=b.enter("phrasing"),C=b.containerPhrasing(y,{...S,before:i,after:i});return N(),w(),C}function c(y,x){return TG(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function d(y,x,b){const S=y.children;let w=-1;const N=[],C=x.enter("table");for(;++w<S.length;)N[w]=p(S[w],x,b);return C(),N}function p(y,x,b){const S=y.children;let w=-1;const N=[],C=x.enter("tableRow");for(;++w<S.length;)N[w]=f(S[w],y,x,b);return C(),N}function m(y,x,b){let S=$O.inlineCode(y,x,b);return b.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function vK(){return{exit:{taskListCheckValueChecked:Bk,taskListCheckValueUnchecked:Bk,paragraph:mK}}}function pK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:gK}}}function Bk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function mK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,l;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function gK(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(l);let f=$O.listItem(e,t,n,{...r,...o.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(d){return d+l}}function yK(){return[Q$(),gG(),wG(),lK(),vK()]}function xK(e){return{extensions:[W$(),yG(e),SG(),hK(e),pK()]}}const bK={tokenize:kK,partial:!0},GO={tokenize:TK,partial:!0},KO={tokenize:jK,partial:!0},YO={tokenize:AK,partial:!0},wK={tokenize:RK,partial:!0},XO={name:"wwwAutolink",tokenize:CK,previous:WO},QO={name:"protocolAutolink",tokenize:NK,previous:ZO},us={name:"emailAutolink",tokenize:EK,previous:JO},wi={};function SK(){return{text:wi}}let Kl=48;for(;Kl<123;)wi[Kl]=us,Kl++,Kl===58?Kl=65:Kl===91&&(Kl=97);wi[43]=us;wi[45]=us;wi[46]=us;wi[95]=us;wi[72]=[us,QO];wi[104]=[us,QO];wi[87]=[us,XO];wi[119]=[us,XO];function EK(e,t,n){const r=this;let a,i;return l;function l(p){return!Ub(p)||!JO.call(r,r.previous)||Cw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Ub(p)?(e.consume(p),o):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(wK,d,c)(p):p===45||p===95||mr(p)?(i=!0,e.consume(p),f):d(p)}function c(p){return e.consume(p),a=!0,f}function d(p){return i&&a&&Tr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function CK(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!WO.call(r,r.previous)||Cw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bK,e.attempt(GO,e.attempt(KO,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function NK(e,t,n){const r=this;let a="",i=!1;return l;function l(p){return(p===72||p===104)&&ZO.call(r,r.previous)&&!Cw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),o):n(p)}function o(p){if(Tr(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),i?c:(i=!0,f)):n(p)}function c(p){return p===null||cp(p)||Xt(p)||bo(p)||Xp(p)?n(p):e.attempt(GO,e.attempt(KO,d),n)(p)}function d(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function kK(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function TK(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(YO,f,o)(c):c===null||Xt(c)||bo(c)||c!==45&&Xp(c)?f(c):(i=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),l}function f(c){return a||r||!i?n(c):t(c)}}function jK(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(YO,t,i)(l):l===null||Xt(l)||bo(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function AK(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),i):o===93?(e.consume(o),a):o===60||o===null||Xt(o)||bo(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Xt(o)||bo(o)?t(o):r(o)}function i(o){return Tr(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Tr(o)?(e.consume(o),l):n(o)}}function RK(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return mr(i)?n(i):t(i)}}function WO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Xt(e)}function ZO(e){return!Tr(e)}function JO(e){return!(e===47||Ub(e))}function Ub(e){return e===43||e===45||e===46||e===95||mr(e)}function Cw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DK={tokenize:IK,partial:!0};function MK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:BK,continuation:{tokenize:PK},exit:zK}},text:{91:{name:"gfmFootnoteCall",tokenize:_K},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:OK,resolveTo:LK}}}}function OK(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return o;function o(f){if(!l||!l._balanced)return n(f);const c=Fa(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function LK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function _K(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(i>999||p===93&&!l||p===null||p===91||Xt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(Fa(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Xt(p)||(l=!0),i++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),i++,c):c(p)}}function BK(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(x)}function d(x){if(l>999||x===93&&!o||x===null||x===91||Xt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=Fa(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Xt(x)||(o=!0),l++,e.consume(x),x===92?p:d}function p(x){return x===91||x===92||x===93?(e.consume(x),l++,d):d(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(i)||a.push(i),At(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function PK(e,t,n){return e.check(Dd,t,e.attempt(DK,t,n))}function zK(e){e.exit("gfmFootnoteDefinition")}function IK(e,t,n){const r=this;return At(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function FK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,o){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let c=f;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[f][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[f][1].start)},m=[["enter",d,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",p,o]],y=o.parser.constructs.insideSpan.null;y&&la(m,m.length,0,Qp(y,l.slice(c+1,f),o)),la(m,m.length,0,[["exit",p,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",d,o]]),la(l,c-1,f-c+3,m),f=c+m.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,o,f){const c=this.previous,d=this.events;let p=0;return m;function m(x){return c===126&&d[d.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const b=ec(c);if(x===126)return p>1?f(x):(l.consume(x),p++,y);if(p<2&&!n)return f(x);const S=l.exit("strikethroughSequenceTemporary"),w=ec(x);return S._open=!w||w===2&&!!b,S._close=!b||b===2&&!!w,o(x)}}}class qK{constructor(){this.map=[]}add(t,n,r){UK(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function UK(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function VK(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function HK(){return{flow:{null:{name:"table",tokenize:$K,resolveAll:GK}}}}function $K(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let _=r.events.length-1;for(;_>-1;){const $=r.events[_][1].type;if($==="lineEnding"||$==="linePrefix")_--;else break}const P=_>-1?r.events[_][1].type:null,H=P==="tableHead"||P==="tableRow"?A:f;return H===A&&r.parser.lazy[r.now().line]?n(M):H(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(l=!0,i+=1),d(M)}function d(M){return M===null?n(M):rt(M)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),y):n(M):Et(M)?At(e,d,"whitespace")(M):(i+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,d):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||Xt(M)?(e.exit("data"),d(M)):(e.consume(M),M===92?m:p)}function m(M){return M===92||M===124?(e.consume(M),p):p(M)}function y(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Et(M)?At(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?S(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),b):R(M)}function b(M){return Et(M)?At(e,S,"whitespace")(M):S(M)}function S(M){return M===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),w):M===45?(i+=1,w(M)):M===null||rt(M)?T(M):R(M)}function w(M){return M===45?(e.enter("tableDelimiterFiller"),N(M)):R(M)}function N(M){return M===45?(e.consume(M),N):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return Et(M)?At(e,T,"whitespace")(M):T(M)}function T(M){return M===124?x(M):M===null||rt(M)?!l||a!==i?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function A(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||rt(M)?(e.exit("tableRow"),t(M)):Et(M)?At(e,D,"whitespace")(M):(e.enter("data"),L(M))}function L(M){return M===null||M===124||Xt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?B:L)}function B(M){return M===92||M===124?(e.consume(M),L):L(M)}}function GK(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,f=0,c,d,p;const m=new qK;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(Pk(m,t,f,c,d),d=void 0,f=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",d,t]])),a=x.type==="tableDelimiterRow"?2:d?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=gv(m,t,i,a,void 0,p),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=gv(m,t,i,a,void 0,p)),i=l,l=[i[1],n,0,0])):x.type==="tableHead"?(o=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],p=gv(m,t,i,a,n,p)):l[1]!==0&&(p=gv(m,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Pk(m,t,f,c,d),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=VK(t.events,n))}return e}function gv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Nu(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=Nu(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=Nu(t.events,n[2]),d=Nu(t.events,n[3]),p={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(i.end=Object.assign({},Nu(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Pk(e,t,n,r,a){const i=[],l=Nu(t.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Nu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const KK={name:"tasklistCheck",tokenize:XK};function YK(){return{text:{91:KK}}}function XK(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return Xt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(f)}function o(f){return rt(f)?t(f):Et(f)?e.check({tokenize:QK},t,n)(f):n(f)}}function QK(e,t,n){return At(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function WK(e){return cO([SK(),MK(),FK(e),HK(),YK()])}const ZK={};function JK(e){const t=this,n=e||ZK,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(WK(n)),i.push(yK()),l.push(xK(n))}function Ma({content:e,className:t}){return h.jsx("div",{className:Te("prose-myco",t),children:h.jsx(F$,{remarkPlugins:[JK],children:e})})}function eY({images:e,index:t,onClose:n,onNavigate:r}){const a=e[t],i=t>0,l=t<e.length-1;j.useEffect(()=>{const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[]);const o=j.useCallback(f=>{f.key==="Escape"&&n(),f.key==="ArrowLeft"&&i&&r(t-1),f.key==="ArrowRight"&&l&&r(t+1)},[n,r,t,i,l]);return j.useEffect(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),a?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[h.jsx("button",{onClick:n,className:"absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:h.jsx(ns,{className:"h-5 w-5"})}),e.length>1&&h.jsxs("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10",children:[t+1," / ",e.length]}),i&&h.jsx("button",{onClick:f=>{f.stopPropagation(),r(t-1)},className:"absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:h.jsx(C1,{className:"h-6 w-6"})}),l&&h.jsx("button",{onClick:f=>{f.stopPropagation(),r(t+1)},className:"absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:h.jsx(ua,{className:"h-6 w-6"})}),h.jsx("img",{src:a.src,alt:a.alt,className:"max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain",onClick:f=>f.stopPropagation()})]}):null}const tY=3;function nY({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return h.jsxs("div",{className:Te("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[h.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all",onClick:()=>n(i=>!i),"aria-expanded":t,children:[t?h.jsx(Ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):h.jsx(ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),h.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&h.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),h.jsx("span",{className:"shrink-0 ml-auto"}),h.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:iq(e.duration_ms)}),r?h.jsx(Sd,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):h.jsx(Ed,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),h.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:h.jsx("div",{className:"overflow-hidden",children:h.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&h.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&h.jsxs("div",{children:[h.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),h.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_input})]}),e.tool_output_summary&&h.jsxs("div",{children:[h.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),h.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_output_summary})]}),e.error_message&&h.jsxs("div",{children:[h.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),h.jsx("pre",{className:"font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all",children:e.error_message})]})]})})})]})}function rY({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=vV(n?e:void 0);if(t===0)return null;const l=a??[];return h.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[h.jsxs("button",{type:"button",className:Te("w-full flex items-center gap-2 px-4 py-2 text-left transition-colors","hover:bg-surface-container/30"),onClick:()=>r(o=>!o),children:[n?h.jsx(Ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):h.jsx(ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),h.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),h.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:h.jsxs("div",{className:"overflow-hidden",children:[i&&h.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,tY)}).map((o,f)=>h.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&h.jsx("div",{className:"space-y-0",children:l.map(o=>h.jsx(nY,{activity:o},o.id))})]})})]})}const Vb=120,aY="h-7 w-7",iY=3;function sY(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function lY(e){return e?e.length>Vb?e.slice(0,Vb)+"…":e:"(no prompt)"}function oY({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return h.jsxs("div",{className:"relative flex gap-4",children:[h.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&h.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),h.jsx("div",{className:Te(aY,"rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10",i?"bg-primary text-on-primary":"bg-surface-container-high text-on-surface-variant border border-outline-variant/40"),children:r+1}),!a&&h.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),h.jsxs(Qe,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[h.jsxs("button",{type:"button",className:Te("flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden","hover:bg-surface-container/40",i&&"bg-surface-container/20"),onClick:()=>l(c=>!c),"aria-expanded":i,children:[i?h.jsx(Ua,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):h.jsx(ua,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),h.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[h.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&h.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/70 shrink-0",children:[e.activity_count," tool call",e.activity_count!==1?"s":""]}),e.started_at&&h.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:sY(e.started_at)})]}),h.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":lY(e.user_prompt)})]})]}),h.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:h.jsxs("div",{className:"overflow-hidden",children:[h.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>Vb&&h.jsx(Ma,{content:e.user_prompt}),t.length>0&&h.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,d)=>h.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(d),children:h.jsx("img",{src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??"",className:"max-w-[200px] max-h-[140px] object-cover rounded-md",loading:"lazy"})},c.id))}),o!==null&&h.jsx(eY,{images:t.map(c=>({src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??""})),index:o,onNavigate:f,onClose:()=>f(null)})]}),e.activity_count>0&&h.jsx(rY,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&h.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:h.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[h.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),h.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[h.jsx(bd,{className:"h-3 w-3 text-primary/60"}),h.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),h.jsx(Ma,{content:e.response_summary})]})]})})]})})]})]})}function uY({sessionId:e}){const{data:t,isLoading:n}=hV(e),{data:r}=pV(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var d;const f=new Map,c=new Map;for(const p of a){if(p.prompt_batch_id!=null){const y=f.get(p.prompt_batch_id)??[];y.push(p),f.set(p.prompt_batch_id,y)}const m=(d=p.file_path)==null?void 0:d.match(/-t(\d+)-/);if(m!=null&&m[1]){const y=parseInt(m[1]),x=c.get(y)??[];x.push(p),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return h.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:iY}).map((f,c)=>h.jsx("div",{className:"h-16 animate-pulse rounded-md bg-surface-container-low"},c))});const o=[...t??[]].sort((f,c)=>(f.started_at??0)-(c.started_at??0));return o.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(Rp,{className:"h-8 w-8 opacity-30"}),h.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):h.jsx("div",{children:o.map((f,c)=>{const d=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return h.jsx(oY,{batch:f,batchAttachments:d,defaultOpen:c===o.length-1,promptIndex:c,isLast:c===o.length-1},f.id)})})}const cY="▲",fY="▼";function dY(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const hY={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},vY="bg-muted text-muted-foreground";function pY({status:e}){const t=Te("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",hY[e]??vY);return h.jsx("span",{className:t,children:e})}function mY({plan:e,initialExpanded:t=!1}){const[n,r]=j.useState(t),a=j.useMemo(()=>e.content?dY(e.content):null,[e.content]),i=a!==null&&a.total>0,l=i?Math.round(a.checked/a.total*100):0;return h.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[h.jsxs("div",{className:"flex items-start gap-3 p-4",children:[h.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(pY,{status:e.status}),e.title&&h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&h.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),h.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Created ",gi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&h.jsxs("span",{title:bb(e.updated_at),children:["Updated ",gi(e.updated_at)]})]}),i&&h.jsxs("div",{className:"space-y-1 pt-0.5",children:[h.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[h.jsxs("span",{children:[a.checked,"/",a.total," items"]}),h.jsxs("span",{children:[l,"%"]})]}),h.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})})]})]}),e.content&&h.jsx("button",{onClick:()=>r(o=>!o),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":n?"Collapse plan":"Expand plan",children:n?cY:fY})]}),n&&e.content&&h.jsx("div",{className:"border-t border-border px-4 py-3",children:h.jsx(Ma,{content:e.content,className:"text-sm"})})]})}function gY({sessionId:e,expandedPlanId:t}){const{data:n,isLoading:r,isError:a}=KM(e);return r?h.jsx("div",{className:"flex h-32 items-center justify-center",children:h.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):a?h.jsx("div",{className:"flex h-32 items-center justify-center",children:h.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!n||n.length===0?h.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:h.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):h.jsx("div",{className:"space-y-3",children:n.map(i=>h.jsx(mY,{plan:i,initialExpanded:String(i.id)===t},i.id))})}const dx=8;function yY(e){return e===null?"—":H1(new Date(e*1e3).toISOString())}const xY=1500;function Nf({label:e,value:t,mono:n=!0,copyable:r=!1,code:a=!1}){const[i,l]=j.useState(!1),o=j.useCallback(()=>{navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),xY)},[t]),f=a?h.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):h.jsx("span",{className:Te("text-xs text-on-surface",n&&"font-mono"),children:t});return h.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[h.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?h.jsxs("button",{onClick:o,title:"Click to copy",className:"flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer",children:[f,i&&h.jsx(wd,{className:"h-3 w-3 text-primary shrink-0"})]}):h.jsx("span",{className:"min-w-0",children:f})]})}function zk({label:e,value:t,activeTab:n,onClick:r}){return h.jsx("button",{onClick:()=>r(t),className:Te("px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer",n===t?"border-b-2 border-primary text-on-surface":"text-muted-foreground hover:text-on-surface"),children:e})}function bY({id:e}){const t=Ka(),{data:n,isLoading:r,isError:a,error:i}=dV(e),{data:l}=jV(),o=Y1(),[f,c]=j.useState("idle"),[d,p]=j.useState(!1),[m,y]=j.useState(()=>new URLSearchParams(window.location.search).get("tab")==="plans"?"plans":"conversation"),[x]=j.useState(()=>new URLSearchParams(window.location.search).get("plan")),b=$M(),{data:S}=GM(d?e:null),{data:w}=KM(e);if(r)return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),h.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),h.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(qn,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),h.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const N=l?AV(l.symbionts,n.agent,e):null;return h.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),h.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??n.id.slice(0,dx)}),h.jsx(XM,{status:n.status}),n.agent&&h.jsx(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),h.jsxs(_e,{variant:"secondary",size:"sm",className:"ml-auto gap-2",disabled:f==="running",onClick:async()=>{c("running");try{await o.mutateAsync({task:"title-summary",instruction:`Process session ${e} only`}),c("done")}catch{c("error")}},children:[f==="running"?h.jsx(qn,{className:"h-4 w-4 animate-spin"}):h.jsx(T1,{className:"h-4 w-4"}),f==="done"?"Summary Requested":"Generate Summary"]}),h.jsxs(_e,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>p(!0),children:[h.jsx(dl,{className:"h-4 w-4"}),"Delete"]})]}),h.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&h.jsxs("span",{children:["User: ",h.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&h.jsxs("span",{children:["Branch: ",h.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),h.jsxs("span",{children:["Started ",yY(n.started_at)]}),n.ended_at&&h.jsxs("span",{children:["Duration: ",Fp(n.started_at,n.ended_at)]})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsx(sn,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),h.jsx(sn,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),h.jsx(sn,{label:"Plans",value:String((w==null?void 0:w.length)??0),accent:"outline"})]}),h.jsxs(Qe,{level:"low",className:"p-4 overflow-hidden",children:[h.jsx(Bt,{className:"mb-3",children:"Metadata"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[h.jsx(Nf,{label:"Session ID",value:e,copyable:!0}),N&&h.jsx(Nf,{label:"Resume",value:N,copyable:!0,code:!0}),n.parent_session_id&&h.jsx(Nf,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&h.jsx(Nf,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&h.jsx(Nf,{label:"Project",value:n.project_root})]})]}),n.summary&&h.jsxs(Qe,{level:"low",className:"p-4 overflow-hidden",children:[h.jsx(Bt,{className:"mb-2",children:"Summary"}),h.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),h.jsxs("div",{className:"min-w-0 overflow-hidden",children:[h.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[h.jsx(zk,{label:"Conversation",value:"conversation",activeTab:m,onClick:y}),h.jsx(zk,{label:"Plans",value:"plans",activeTab:m,onClick:y})]}),m==="conversation"&&h.jsx(uY,{sessionId:e}),m==="plans"&&h.jsx(gY,{sessionId:e,expandedPlanId:x})]}),h.jsx(W1,{open:d,onOpenChange:p,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:h.jsx(dl,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:n.id.slice(0,dx)},{label:"Title",value:n.title||n.id.slice(0,dx)}]:[],impact:S?[{label:"Prompts",value:S.promptCount},{label:"Spores",value:S.sporeCount},{label:"Attachments",value:S.attachmentCount},{label:"Graph Edges",value:S.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{b.mutate(n.id,{onSuccess:()=>{p(!1),t("/sessions")}})},isPending:b.isPending})]})}function Ik(){const{id:e}=$B();return e?h.jsx(bY,{id:e}):h.jsx("div",{className:"p-6",children:h.jsx(kV,{})})}function Hb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wY(e){if(Array.isArray(e))return e}function SY(e){if(Array.isArray(e))return Hb(e)}function Cl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tL(r.key),r)}}function Nl(e,t,n){return t&&EY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Nw(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
498
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return l=f.done,f},e:function(f){o=!0,i=f},f:function(){try{l||n.return==null||n.return()}finally{if(o)throw i}}}}function eL(e,t,n){return(t=tL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,o=[],f=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);f=!0);}catch(d){c=!0,a=d}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw a}}return o}}function kY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
499
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
500
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,t){return wY(e)||NY(e,t)||Nw(e,t)||kY()}function vp(e){return SY(e)||CY(e)||Nw(e)||TY()}function jY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tL(e){var t=jY(e,"string");return typeof t=="symbol"?t:t+""}function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Nw(e,t){if(e){if(typeof e=="string")return Hb(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hb(e,t):void 0}}var zn=typeof window>"u"?null:window,Fk=zn?zn.navigator:null;zn&&zn.document;var AY=Un(""),nL=Un({}),RY=Un(function(){}),DY=typeof HTMLElement>"u"?"undefined":Un(HTMLElement),Od=function(t){return t&&t.instanceString&&mn(t.instanceString)?t.instanceString():null},tt=function(t){return t!=null&&Un(t)==AY},mn=function(t){return t!=null&&Un(t)===RY},Yt=function(t){return!oa(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},Dt=function(t){return t!=null&&Un(t)===nL&&!Yt(t)&&t.constructor===Object},MY=function(t){return t!=null&&Un(t)===nL},Ae=function(t){return t!=null&&Un(t)===Un(1)&&!isNaN(t)},OY=function(t){return Ae(t)&&Math.floor(t)===t},pp=function(t){if(DY!=="undefined")return t!=null&&t instanceof HTMLElement},oa=function(t){return Ld(t)||rL(t)},Ld=function(t){return Od(t)==="collection"&&t._private.single},rL=function(t){return Od(t)==="collection"&&!t._private.single},kw=function(t){return Od(t)==="core"},aL=function(t){return Od(t)==="stylesheet"},LY=function(t){return Od(t)==="event"},pl=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},_Y=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},BY=function(t){return Dt(t)&&Ae(t.x1)&&Ae(t.x2)&&Ae(t.y1)&&Ae(t.y2)},PY=function(t){return MY(t)&&mn(t.then)},zY=function(){return Fk&&Fk.userAgent.match(/msie|trident|edge/i)},tc=function(t,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],l=0;l<arguments.length;l++)i.push(arguments[l]);return i.join("$")});var r=function(){var i=this,l=arguments,o,f=n.apply(i,l),c=r.cache;return(o=c[f])||(o=c[f]=t.apply(i,l)),o};return r.cache={},r},Tw=tc(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),em=tc(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),iL=tc(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),qk=function(t){return pl(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},al=function(t,n){return t.slice(-1*n.length)===n},Fn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",IY="rgb[a]?\\(("+Fn+"[%]?)\\s*,\\s*("+Fn+"[%]?)\\s*,\\s*("+Fn+"[%]?)(?:\\s*,\\s*("+Fn+"))?\\)",FY="rgb[a]?\\((?:"+Fn+"[%]?)\\s*,\\s*(?:"+Fn+"[%]?)\\s*,\\s*(?:"+Fn+"[%]?)(?:\\s*,\\s*(?:"+Fn+"))?\\)",qY="hsl[a]?\\(("+Fn+")\\s*,\\s*("+Fn+"[%])\\s*,\\s*("+Fn+"[%])(?:\\s*,\\s*("+Fn+"))?\\)",UY="hsl[a]?\\((?:"+Fn+")\\s*,\\s*(?:"+Fn+"[%])\\s*,\\s*(?:"+Fn+"[%])(?:\\s*,\\s*(?:"+Fn+"))?\\)",VY="\\#[0-9a-fA-F]{3}",HY="\\#[0-9a-fA-F]{6}",sL=function(t,n){return t<n?-1:t>n?1:0},$Y=function(t,n){return-1*sL(t,n)},at=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var l=a[i];e[l]=r[l]}}return e},GY=function(t){if(!(!(t.length===4||t.length===7)||t[0]!=="#")){var n=t.length===4,r,a,i,l=16;return n?(r=parseInt(t[1]+t[1],l),a=parseInt(t[2]+t[2],l),i=parseInt(t[3]+t[3],l)):(r=parseInt(t[1]+t[2],l),a=parseInt(t[3]+t[4],l),i=parseInt(t[5]+t[6],l)),[r,a,i]}},KY=function(t){var n,r,a,i,l,o,f,c;function d(x,b,S){return S<0&&(S+=1),S>1&&(S-=1),S<1/6?x+(b-x)*6*S:S<1/2?b:S<2/3?x+(b-x)*(2/3-S)*6:x}var p=new RegExp("^"+qY+"$").exec(t);if(p){if(r=parseInt(p[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(p[2]),a<0||a>100||(a=a/100,i=parseFloat(p[3]),i<0||i>100)||(i=i/100,l=p[4],l!==void 0&&(l=parseFloat(l),l<0||l>1)))return;if(a===0)o=f=c=Math.round(i*255);else{var m=i<.5?i*(1+a):i+a-i*a,y=2*i-m;o=Math.round(255*d(y,m,r+1/3)),f=Math.round(255*d(y,m,r)),c=Math.round(255*d(y,m,r-1/3))}n=[o,f,c,l]}return n},YY=function(t){var n,r=new RegExp("^"+IY+"$").exec(t);if(r){n=[];for(var a=[],i=1;i<=3;i++){var l=r[i];if(l[l.length-1]==="%"&&(a[i]=!0),l=parseFloat(l),a[i]&&(l=l/100*255),l<0||l>255)return;n.push(Math.floor(l))}var o=a[1]||a[2]||a[3],f=a[1]&&a[2]&&a[3];if(o&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},XY=function(t){return QY[t.toLowerCase()]},lL=function(t){return(Yt(t)?t:null)||XY(t)||GY(t)||YY(t)||KY(t)},QY={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},oL=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Dt(l))throw Error("Tried to set map with object key");i<r.length-1?(n[l]==null&&(n[l]={}),n=n[l]):n[l]=t.value}},uL=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Dt(l))throw Error("Tried to get map with object key");if(n=n[l],n==null)return n}return n},yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hx,Uk;function Bd(){if(Uk)return hx;Uk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return hx=e,hx}var vx,Vk;function WY(){if(Vk)return vx;Vk=1;var e=typeof yv=="object"&&yv&&yv.Object===Object&&yv;return vx=e,vx}var px,Hk;function tm(){if(Hk)return px;Hk=1;var e=WY(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return px=n,px}var mx,$k;function ZY(){if($k)return mx;$k=1;var e=tm(),t=function(){return e.Date.now()};return mx=t,mx}var gx,Gk;function JY(){if(Gk)return gx;Gk=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return gx=t,gx}var yx,Kk;function eX(){if(Kk)return yx;Kk=1;var e=JY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return yx=n,yx}var xx,Yk;function jw(){if(Yk)return xx;Yk=1;var e=tm(),t=e.Symbol;return xx=t,xx}var bx,Xk;function tX(){if(Xk)return bx;Xk=1;var e=jw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var o=n.call(l,a),f=l[a];try{l[a]=void 0;var c=!0}catch{}var d=r.call(l);return c&&(o?l[a]=f:delete l[a]),d}return bx=i,bx}var wx,Qk;function nX(){if(Qk)return wx;Qk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return wx=n,wx}var Sx,Wk;function cL(){if(Wk)return Sx;Wk=1;var e=jw(),t=tX(),n=nX(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(o){return o==null?o===void 0?a:r:i&&i in Object(o)?t(o):n(o)}return Sx=l,Sx}var Ex,Zk;function rX(){if(Zk)return Ex;Zk=1;function e(t){return t!=null&&typeof t=="object"}return Ex=e,Ex}var Cx,Jk;function Pd(){if(Jk)return Cx;Jk=1;var e=cL(),t=rX(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Cx=r,Cx}var Nx,eT;function aX(){if(eT)return Nx;eT=1;var e=eX(),t=Bd(),n=Pd(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=i.test(c);return p||l.test(c)?o(c.slice(2),p?2:8):a.test(c)?r:+c}return Nx=f,Nx}var kx,tT;function iX(){if(tT)return kx;tT=1;var e=Bd(),t=ZY(),n=aX(),r="Expected a function",a=Math.max,i=Math.min;function l(o,f,c){var d,p,m,y,x,b,S=0,w=!1,N=!1,C=!0;if(typeof o!="function")throw new TypeError(r);f=n(f)||0,e(c)&&(w=!!c.leading,N="maxWait"in c,m=N?a(n(c.maxWait)||0,f):m,C="trailing"in c?!!c.trailing:C);function T(H){var $=d,V=p;return d=p=void 0,S=H,y=o.apply(V,$),y}function R(H){return S=H,x=setTimeout(L,f),w?T(H):y}function A(H){var $=H-b,V=H-S,I=f-$;return N?i(I,m-V):I}function D(H){var $=H-b,V=H-S;return b===void 0||$>=f||$<0||N&&V>=m}function L(){var H=t();if(D(H))return B(H);x=setTimeout(L,A(H))}function B(H){return x=void 0,C&&d?T(H):(d=p=void 0,y)}function M(){x!==void 0&&clearTimeout(x),S=0,d=b=p=x=void 0}function _(){return x===void 0?y:B(t())}function P(){var H=t(),$=D(H);if(d=arguments,p=this,b=H,$){if(x===void 0)return R(b);if(N)return clearTimeout(x),x=setTimeout(L,f),T(b)}return x===void 0&&(x=setTimeout(L,f)),y}return P.cancel=M,P.flush=_,P}return kx=l,kx}var sX=iX(),zd=_d(sX),Tx=zn?zn.performance:null,fL=Tx&&Tx.now?function(){return Tx.now()}:function(){return Date.now()},lX=(function(){if(zn){if(zn.requestAnimationFrame)return function(e){zn.requestAnimationFrame(e)};if(zn.mozRequestAnimationFrame)return function(e){zn.mozRequestAnimationFrame(e)};if(zn.webkitRequestAnimationFrame)return function(e){zn.webkitRequestAnimationFrame(e)};if(zn.msRequestAnimationFrame)return function(e){zn.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(fL())},1e3/60)}})(),mp=function(t){return lX(t)},is=fL,Zl=9261,dL=65599,ku=5381,hL=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zl,r=n,a;a=t.next(),!a.done;)r=r*dL+a.value|0;return r},ed=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zl;return n*dL+t|0},td=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ku;return(n<<5)+n+t|0},oX=function(t,n){return t*2097152+n},Vs=function(t){return t[0]*2097152+t[1]},xv=function(t,n){return[ed(t[0],n[0]),td(t[1],n[1])]},nT=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t[a++]:r.done=!0,r}};return hL(l,n)},wo=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t.charCodeAt(a++):r.done=!0,r}};return hL(l,n)},vL=function(){return uX(arguments)},uX=function(t){for(var n,r=0;r<t.length;r++){var a=t[r];r===0?n=wo(a):n=wo(a,n)}return n};function cX(e,t,n,r,a){var i=a*Math.PI/180,l=Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,o=Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r;return{x:l,y:o}}var fX=function(t,n,r,a,i,l){return{x:(t-r)*i+r,y:(n-a)*l+a}};function dX(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,l=1/i,o=cX(e.x,e.y,r,a,n),f=fX(o.x,o.y,r,a,i,l);return{x:f.x,y:f.y}}var rT=!0,hX=console.warn!=null,vX=console.trace!=null,Aw=Number.MAX_SAFE_INTEGER||9007199254740991,pL=function(){return!0},gp=function(){return!1},aT=function(){return 0},Rw=function(){},fn=function(t){throw new Error(t)},mL=function(t){if(t!==void 0)rT=!!t;else return rT},zt=function(t){mL()&&(hX?console.warn(t):(console.log(t),vX&&console.trace()))},pX=function(t){return at({},t)},ci=function(t){return t==null?t:Yt(t)?t.slice():Dt(t)?pX(t):t},mX=function(t){return t.slice()},gL=function(t,n){for(n=t="";t++<36;n+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return n},gX={},yL=function(){return gX},cr=function(t){var n=Object.keys(t);return function(r){for(var a={},i=0;i<n.length;i++){var l=n[i],o=r==null?void 0:r[l];a[l]=o===void 0?t[l]:o}return a}},ml=function(t,n,r){for(var a=t.length-1;a>=0;a--)t[a]===n&&t.splice(a,1)},Dw=function(t){t.splice(0,t.length)},yX=function(t,n){for(var r=0;r<n.length;r++){var a=n[r];t.push(a)}},Vr=function(t,n,r){return r&&(n=iL(r,n)),t[n]},Gi=function(t,n,r,a){r&&(n=iL(r,n)),t[n]=a},xX=(function(){function e(){Cl(this,e),this._obj={}}return Nl(e,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),Wi=typeof Map<"u"?Map:xX,bX="undefined",wX=(function(){function e(t){if(Cl(this,e),this._obj=Object.create(null),this.size=0,t!=null){var n;t.instanceString!=null&&t.instanceString()===this.instanceString()?n=t.toArray():n=t;for(var r=0;r<n.length;r++)this.add(n[r])}}return Nl(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),xc=(typeof Set>"u"?"undefined":Un(Set))!==bX?Set:wX,nm=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||n===void 0||!kw(t)){fn("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){fn("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new xc,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var l=n.renderedPosition,o=t.pan(),f=t.zoom();i.position={x:(l.x-o.x)/f,y:(l.y-o.y)/f}}var c=[];Yt(n.classes)?c=n.classes:tt(n.classes)&&(c=n.classes.split(/\s+/));for(var d=0,p=c.length;d<p;d++){var m=c[d];!m||m===""||i.classes.add(m)}this.createEmitter(),(r===void 0||r)&&this.restore();var y=n.style||n.css;y&&(zt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(y))},iT=function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},function(r,a,i){var l;Dt(r)&&!oa(r)&&(l=r,r=l.roots||l.root,a=l.visit,i=l.directed),i=arguments.length===2&&!mn(a)?a:i,a=mn(a)?a:function(){};for(var o=this._private.cy,f=r=tt(r)?this.filter(r):r,c=[],d=[],p={},m={},y={},x=0,b,S=this.byGroup(),w=S.nodes,N=S.edges,C=0;C<f.length;C++){var T=f[C],R=T.id();T.isNode()&&(c.unshift(T),t.bfs&&(y[R]=!0,d.push(T)),m[R]=0)}for(var A=function(){var H=t.bfs?c.shift():c.pop(),$=H.id();if(t.dfs){if(y[$])return 0;y[$]=!0,d.push(H)}var V=m[$],I=p[$],U=I!=null?I.source():null,Y=I!=null?I.target():null,Q=I==null?void 0:H.same(U)?Y[0]:U[0],F;if(F=a(H,I,Q,x++,V),F===!0)return b=H,1;if(F===!1)return 1;for(var q=H.connectedEdges().filter(function(ae){return(!i||ae.source().same(H))&&N.has(ae)}),X=0;X<q.length;X++){var z=q[X],W=z.connectedNodes().filter(function(ae){return!ae.same(H)&&w.has(ae)}),re=W.id();W.length!==0&&!y[re]&&(W=W[0],c.push(W),t.bfs&&(y[re]=!0,d.push(W)),p[re]=z,m[re]=m[$]+1)}},D;c.length!==0&&(D=A(),!(D!==0&&D===1)););for(var L=o.collection(),B=0;B<d.length;B++){var M=d[B],_=p[M.id()];_!=null&&L.push(_),L.push(M)}return{path:o.collection(L),found:o.collection(b)}}},nd={breadthFirstSearch:iT({bfs:!0}),depthFirstSearch:iT({dfs:!0})};nd.bfs=nd.breadthFirstSearch;nd.dfs=nd.depthFirstSearch;var Uv={exports:{}},SX=Uv.exports,sT;function EX(){return sT||(sT=1,(function(e,t){(function(){var n,r,a,i,l,o,f,c,d,p,m,y,x,b,S;a=Math.floor,p=Math.min,r=function(w,N){return w<N?-1:w>N?1:0},d=function(w,N,C,T,R){var A;if(C==null&&(C=0),R==null&&(R=r),C<0)throw new Error("lo must be non-negative");for(T==null&&(T=w.length);C<T;)A=a((C+T)/2),R(N,w[A])<0?T=A:C=A+1;return[].splice.apply(w,[C,C-C].concat(N)),N},o=function(w,N,C){return C==null&&(C=r),w.push(N),b(w,0,w.length-1,C)},l=function(w,N){var C,T;return N==null&&(N=r),C=w.pop(),w.length?(T=w[0],w[0]=C,S(w,0,N)):T=C,T},c=function(w,N,C){var T;return C==null&&(C=r),T=w[0],w[0]=N,S(w,0,C),T},f=function(w,N,C){var T;return C==null&&(C=r),w.length&&C(w[0],N)<0&&(T=[w[0],N],N=T[0],w[0]=T[1],S(w,0,C)),N},i=function(w,N){var C,T,R,A,D,L;for(N==null&&(N=r),A=(function(){L=[];for(var B=0,M=a(w.length/2);0<=M?B<M:B>M;0<=M?B++:B--)L.push(B);return L}).apply(this).reverse(),D=[],T=0,R=A.length;T<R;T++)C=A[T],D.push(S(w,C,N));return D},x=function(w,N,C){var T;if(C==null&&(C=r),T=w.indexOf(N),T!==-1)return b(w,0,T,C),S(w,T,C)},m=function(w,N,C){var T,R,A,D,L;if(C==null&&(C=r),R=w.slice(0,N),!R.length)return R;for(i(R,C),L=w.slice(N),A=0,D=L.length;A<D;A++)T=L[A],f(R,T,C);return R.sort(C).reverse()},y=function(w,N,C){var T,R,A,D,L,B,M,_,P;if(C==null&&(C=r),N*10<=w.length){if(A=w.slice(0,N).sort(C),!A.length)return A;for(R=A[A.length-1],M=w.slice(N),D=0,B=M.length;D<B;D++)T=M[D],C(T,R)<0&&(d(A,T,0,null,C),A.pop(),R=A[A.length-1]);return A}for(i(w,C),P=[],L=0,_=p(N,w.length);0<=_?L<_:L>_;0<=_?++L:--L)P.push(l(w,C));return P},b=function(w,N,C,T){var R,A,D;for(T==null&&(T=r),R=w[C];C>N;){if(D=C-1>>1,A=w[D],T(R,A)<0){w[C]=A,C=D;continue}break}return w[C]=R},S=function(w,N,C){var T,R,A,D,L;for(C==null&&(C=r),R=w.length,L=N,A=w[N],T=2*N+1;T<R;)D=T+1,D<R&&!(C(w[T],w[D])<0)&&(T=D),w[N]=w[T],N=T,T=2*N+1;return w[N]=A,b(w,L,N,C)},n=(function(){w.push=o,w.pop=l,w.replace=c,w.pushpop=f,w.heapify=i,w.updateItem=x,w.nlargest=m,w.nsmallest=y;function w(N){this.cmp=N??r,this.nodes=[]}return w.prototype.push=function(N){return o(this.nodes,N,this.cmp)},w.prototype.pop=function(){return l(this.nodes,this.cmp)},w.prototype.peek=function(){return this.nodes[0]},w.prototype.contains=function(N){return this.nodes.indexOf(N)!==-1},w.prototype.replace=function(N){return c(this.nodes,N,this.cmp)},w.prototype.pushpop=function(N){return f(this.nodes,N,this.cmp)},w.prototype.heapify=function(){return i(this.nodes,this.cmp)},w.prototype.updateItem=function(N){return x(this.nodes,N,this.cmp)},w.prototype.clear=function(){return this.nodes=[]},w.prototype.empty=function(){return this.nodes.length===0},w.prototype.size=function(){return this.nodes.length},w.prototype.clone=function(){var N;return N=new w,N.nodes=this.nodes.slice(0),N},w.prototype.toArray=function(){return this.nodes.slice(0)},w.prototype.insert=w.prototype.push,w.prototype.top=w.prototype.peek,w.prototype.front=w.prototype.peek,w.prototype.has=w.prototype.contains,w.prototype.copy=w.prototype.clone,w})(),(function(w,N){return e.exports=N()})(this,function(){return n})}).call(SX)})(Uv)),Uv.exports}var jx,lT;function CX(){return lT||(lT=1,jx=EX()),jx}var NX=CX(),Id=_d(NX),kX=cr({root:null,weight:function(t){return 1},directed:!1}),TX={dijkstra:function(t){if(!Dt(t)){var n=arguments;t={root:n[0],weight:n[1],directed:n[2]}}var r=kX(t),a=r.root,i=r.weight,l=r.directed,o=this,f=i,c=tt(a)?this.filter(a)[0]:a[0],d={},p={},m={},y=this.byGroup(),x=y.nodes,b=y.edges;b.unmergeBy(function(V){return V.isLoop()});for(var S=function(I){return d[I.id()]},w=function(I,U){d[I.id()]=U,N.updateItem(I)},N=new Id(function(V,I){return S(V)-S(I)}),C=0;C<x.length;C++){var T=x[C];d[T.id()]=T.same(c)?0:1/0,N.push(T)}for(var R=function(I,U){for(var Y=(l?I.edgesTo(U):I.edgesWith(U)).intersect(b),Q=1/0,F,q=0;q<Y.length;q++){var X=Y[q],z=f(X);(z<Q||!F)&&(Q=z,F=X)}return{edge:F,dist:Q}};N.size()>0;){var A=N.pop(),D=S(A),L=A.id();if(m[L]=D,D!==1/0)for(var B=A.neighborhood().intersect(x),M=0;M<B.length;M++){var _=B[M],P=_.id(),H=R(A,_),$=D+H.dist;$<S(_)&&(w(_,$),p[P]={node:A,edge:H.edge})}}return{distanceTo:function(I){var U=tt(I)?x.filter(I)[0]:I[0];return m[U.id()]},pathTo:function(I){var U=tt(I)?x.filter(I)[0]:I[0],Y=[],Q=U,F=Q.id();if(U.length>0)for(Y.unshift(U);p[F];){var q=p[F];Y.unshift(q.edge),Y.unshift(q.node),Q=q.node,F=Q.id()}return o.spawn(Y)}}}},jX={kruskal:function(t){t=t||function(C){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,l=new Array(i),o=r,f=function(T){for(var R=0;R<l.length;R++){var A=l[R];if(A.has(T))return R}},c=0;c<i;c++)l[c]=this.spawn(r[c]);for(var d=a.sort(function(C,T){return t(C)-t(T)}),p=0;p<d.length;p++){var m=d[p],y=m.source()[0],x=m.target()[0],b=f(y),S=f(x),w=l[b],N=l[S];b!==S&&(o.merge(m),w.merge(N),l.splice(S,1))}return o}},AX=cr({root:null,goal:null,weight:function(t){return 1},heuristic:function(t){return 0},directed:!1}),RX={aStar:function(t){var n=this.cy(),r=AX(t),a=r.root,i=r.goal,l=r.heuristic,o=r.directed,f=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),d=i.id(),p={},m={},y={},x=new Id(function(F,q){return m[F.id()]-m[q.id()]}),b=new xc,S={},w={},N=function(q,X){x.push(q),b.add(X)},C,T,R=function(){C=x.pop(),T=C.id(),b.delete(T)},A=function(q){return b.has(q)};N(a,c),p[c]=0,m[c]=l(a);for(var D=0;x.size()>0;){if(R(),D++,T===d){for(var L=[],B=i,M=d,_=w[M];L.unshift(B),_!=null&&L.unshift(_),B=S[M],B!=null;)M=B.id(),_=w[M];return{found:!0,distance:p[T],path:this.spawn(L),steps:D}}y[T]=!0;for(var P=C._private.edges,H=0;H<P.length;H++){var $=P[H];if(this.hasElementWithId($.id())&&!(o&&$.data("source")!==T)){var V=$.source(),I=$.target(),U=V.id()!==T?V:I,Y=U.id();if(this.hasElementWithId(Y)&&!y[Y]){var Q=p[T]+f($);if(!A(Y)){p[Y]=Q,m[Y]=Q+l(U),N(U,Y),S[Y]=C,w[Y]=$;continue}Q<p[Y]&&(p[Y]=Q,m[Y]=Q+l(U),S[Y]=C,w[Y]=$)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},DX=cr({weight:function(t){return 1},directed:!1}),MX={floydWarshall:function(t){for(var n=this.cy(),r=DX(t),a=r.weight,i=r.directed,l=a,o=this.byGroup(),f=o.nodes,c=o.edges,d=f.length,p=d*d,m=function(z){return f.indexOf(z)},y=function(z){return f[z]},x=new Array(p),b=0;b<p;b++){var S=b%d,w=(b-S)/d;w===S?x[b]=0:x[b]=1/0}for(var N=new Array(p),C=new Array(p),T=0;T<c.length;T++){var R=c[T],A=R.source()[0],D=R.target()[0];if(A!==D){var L=m(A),B=m(D),M=L*d+B,_=l(R);if(x[M]>_&&(x[M]=_,N[M]=B,C[M]=R),!i){var P=B*d+L;!i&&x[P]>_&&(x[P]=_,N[P]=L,C[P]=R)}}}for(var H=0;H<d;H++)for(var $=0;$<d;$++)for(var V=$*d+H,I=0;I<d;I++){var U=$*d+I,Y=H*d+I;x[V]+x[Y]<x[U]&&(x[U]=x[V]+x[Y],N[U]=N[V])}var Q=function(z){return(tt(z)?n.filter(z):z)[0]},F=function(z){return m(Q(z))},q={distance:function(z,W){var re=F(z),ae=F(W);return x[re*d+ae]},path:function(z,W){var re=F(z),ae=F(W),ie=y(re);if(re===ae)return ie.collection();if(N[re*d+ae]==null)return n.collection();var ye=n.collection(),ue=re,ee;for(ye.merge(ie);re!==ae;)ue=re,re=N[re*d+ae],ee=C[ue*d+re],ye.merge(ee),ye.merge(y(re));return ye}};return q}},OX=cr({weight:function(t){return 1},directed:!1,root:null}),LX={bellmanFord:function(t){var n=this,r=OX(t),a=r.weight,i=r.directed,l=r.root,o=a,f=this,c=this.cy(),d=this.byGroup(),p=d.edges,m=d.nodes,y=m.length,x=new Wi,b=!1,S=[];l=c.collection(l)[0],p.unmergeBy(function(Je){return Je.isLoop()});for(var w=p.length,N=function(We){var Ve=x.get(We.id());return Ve||(Ve={},x.set(We.id(),Ve)),Ve},C=function(We){return(tt(We)?c.$(We):We)[0]},T=function(We){return N(C(We)).dist},R=function(We){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,Re=C(We),Ke=[],Xe=Re;;){if(Xe==null)return n.spawn();var st=N(Xe),ze=st.edge,dt=st.pred;if(Ke.unshift(Xe[0]),Xe.same(Ve)&&Ke.length>0)break;ze!=null&&Ke.unshift(ze),Xe=dt}return f.spawn(Ke)},A=0;A<y;A++){var D=m[A],L=N(D);D.same(l)?L.dist=0:L.dist=1/0,L.pred=null,L.edge=null}for(var B=!1,M=function(We,Ve,Re,Ke,Xe,st){var ze=Ke.dist+st;ze<Xe.dist&&!Re.same(Ke.edge)&&(Xe.dist=ze,Xe.pred=We,Xe.edge=Re,B=!0)},_=1;_<y;_++){B=!1;for(var P=0;P<w;P++){var H=p[P],$=H.source(),V=H.target(),I=o(H),U=N($),Y=N(V);M($,V,H,U,Y,I),i||M(V,$,H,Y,U,I)}if(!B)break}if(B)for(var Q=[],F=0;F<w;F++){var q=p[F],X=q.source(),z=q.target(),W=o(q),re=N(X).dist,ae=N(z).dist;if(re+W<ae||!i&&ae+W<re)if(b||(zt("Graph contains a negative weight cycle for Bellman-Ford"),b=!0),t.findNegativeWeightCycles!==!1){var ie=[];re+W<ae&&ie.push(X),!i&&ae+W<re&&ie.push(z);for(var ye=ie.length,ue=0;ue<ye;ue++){var ee=ie[ue],ne=[ee];ne.push(N(ee).edge);for(var se=N(ee).pred;ne.indexOf(se)===-1;)ne.push(se),ne.push(N(se).edge),se=N(se).pred;ne=ne.slice(ne.indexOf(se));for(var ge=ne[0].id(),ke=0,Pe=2;Pe<ne.length;Pe+=2)ne[Pe].id()<ge&&(ge=ne[Pe].id(),ke=Pe);ne=ne.slice(ke).concat(ne.slice(0,ke)),ne.push(ne[0]);var lt=ne.map(function(Je){return Je.id()}).join(",");Q.indexOf(lt)===-1&&(S.push(f.spawn(ne)),Q.push(lt))}}else break}return{distanceTo:T,pathTo:R,hasNegativeWeightCycle:b,negativeWeightCycles:S}}},_X=Math.sqrt(2),BX=function(t,n,r){r.length===0&&fn("Karger-Stein must be run on a connected (sub)graph");for(var a=r[t],i=a[1],l=a[2],o=n[i],f=n[l],c=r,d=c.length-1;d>=0;d--){var p=c[d],m=p[1],y=p[2];(n[m]===o&&n[y]===f||n[m]===f&&n[y]===o)&&c.splice(d,1)}for(var x=0;x<c.length;x++){var b=c[x];b[1]===f?(c[x]=b.slice(),c[x][1]=o):b[2]===f&&(c[x]=b.slice(),c[x][2]=o)}for(var S=0;S<n.length;S++)n[S]===f&&(n[S]=o);return c},Ax=function(t,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=BX(i,t,n),r--}return n},PX={kargerStein:function(){var t=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(Y){return Y.isLoop()});var i=r.length,l=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),f=Math.floor(i/_X);if(i<2){fn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<l;d++){var p=a[d];c.push([d,r.indexOf(p.source()),r.indexOf(p.target())])}for(var m=1/0,y=[],x=new Array(i),b=new Array(i),S=new Array(i),w=function(Q,F){for(var q=0;q<i;q++)F[q]=Q[q]},N=0;N<=o;N++){for(var C=0;C<i;C++)b[C]=C;var T=Ax(b,c.slice(),i,f),R=T.slice();w(b,S);var A=Ax(b,T,f,2),D=Ax(S,R,f,2);A.length<=D.length&&A.length<m?(m=A.length,y=A,w(b,x)):D.length<=A.length&&D.length<m&&(m=D.length,y=D,w(S,x))}for(var L=this.spawn(y.map(function(Y){return a[Y[0]]})),B=this.spawn(),M=this.spawn(),_=x[0],P=0;P<x.length;P++){var H=x[P],$=r[P];H===_?B.merge($):M.merge($)}var V=function(Q){var F=t.spawn();return Q.forEach(function(q){F.merge(q),q.connectedEdges().forEach(function(X){t.contains(X)&&!L.contains(X)&&F.merge(X)})}),F},I=[V(B),V(M)],U={cut:L,components:I,partition1:B,partition2:M};return U}},Rx,zX=function(t){return{x:t.x,y:t.y}},rm=function(t,n,r){return{x:t.x*n+r.x,y:t.y*n+r.y}},xL=function(t,n,r){return{x:(t.x-r.x)/n,y:(t.y-r.y)/n}},ju=function(t){return{x:t[0],y:t[1]}},IX=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.min(l,a))}return a},FX=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=-1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.max(l,a))}return a},qX=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=0,i=0,l=n;l<r;l++){var o=t[l];isFinite(o)&&(a+=o,i++)}return a/i},UX=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?t=t.slice(n,r):(r<t.length&&t.splice(r,t.length-r),n>0&&t.splice(0,n));for(var o=0,f=t.length-1;f>=0;f--){var c=t[f];l?isFinite(c)||(t[f]=-1/0,o++):t.splice(f,1)}i&&t.sort(function(m,y){return m-y});var d=t.length,p=Math.floor(d/2);return d%2!==0?t[p+1+o]:(t[p-1+o]+t[p+o])/2},VX=function(t){return Math.PI*t/180},bv=function(t,n){return Math.atan2(n,t)-Math.PI/2},Mw=Math.log2||function(e){return Math.log(e)/Math.log(2)},Ow=function(t){return t>0?1:t<0?-1:0},So=function(t,n){return Math.sqrt(Ql(t,n))},Ql=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r*r+a*a},HX=function(t){for(var n=t.length,r=0,a=0;a<n;a++)r+=t[a];for(var i=0;i<n;i++)t[i]=t[i]/r;return t},Zn=function(t,n,r,a){return(1-a)*(1-a)*t+2*(1-a)*a*n+a*a*r},Bu=function(t,n,r,a){return{x:Zn(t.x,n.x,r.x,a),y:Zn(t.y,n.y,r.y,a)}},$X=function(t,n,r,a){var i={x:n.x-t.x,y:n.y-t.y},l=So(t,n),o={x:i.x/l,y:i.y/l};return r=r??0,a=a??r*l,{x:t.x+o.x*a,y:t.y+o.y*a}},rd=function(t,n,r){return Math.max(t,Math.min(r,n))},jr=function(t){if(t==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},GX=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},KX=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},YX=function(t,n){t.x1=Math.min(t.x1,n.x1),t.x2=Math.max(t.x2,n.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n.y1),t.y2=Math.max(t.y2,n.y2),t.h=t.y2-t.y1},bL=function(t,n,r){t.x1=Math.min(t.x1,n),t.x2=Math.max(t.x2,n),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1},Vv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=n,t.x2+=n,t.y1-=n,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},Hv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,l;if(n.length===1)r=a=i=l=n[0];else if(n.length===2)r=i=n[0],l=a=n[1];else if(n.length===4){var o=_n(n,4);r=o[0],a=o[1],i=o[2],l=o[3]}return t.x1-=l,t.x2+=a,t.y1-=r,t.y2+=i,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},oT=function(t,n){t.x1=n.x1,t.y1=n.y1,t.x2=n.x2,t.y2=n.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},Lw=function(t,n){return!(t.x1>n.x2||n.x1>t.x2||t.x2<n.x1||n.x2<t.x1||t.y2<n.y1||n.y2<t.y1||t.y1>n.y2||n.y1>t.y2)},il=function(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2},uT=function(t,n){return il(t,n.x,n.y)},wL=function(t,n){return il(t,n.x1,n.y1)&&il(t,n.x2,n.y2)},XX=(Rx=Math.hypot)!==null&&Rx!==void 0?Rx:function(e,t){return Math.sqrt(e*e+t*t)};function QX(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(L,B){return{x:L.x+B.x,y:L.y+B.y}},r=function(L,B){return{x:L.x-B.x,y:L.y-B.y}},a=function(L,B){return{x:L.x*B,y:L.y*B}},i=function(L,B){return L.x*B.y-L.y*B.x},l=function(L){var B=XX(L.x,L.y);return B===0?{x:0,y:0}:{x:L.x/B,y:L.y/B}},o=function(L){for(var B=0,M=0;M<L.length;M++){var _=L[M],P=L[(M+1)%L.length];B+=_.x*P.y-P.x*_.y}return B/2},f=function(L,B,M,_){var P=r(B,L),H=r(_,M),$=i(P,H);if(Math.abs($)<1e-9)return n(L,a(P,.5));var V=i(r(M,L),H)/$;return n(L,a(P,V))},c=e.map(function(D){return{x:D.x,y:D.y}});o(c)<0&&c.reverse();for(var d=c.length,p=[],m=0;m<d;m++){var y=c[m],x=c[(m+1)%d],b=r(x,y),S=l({x:b.y,y:-b.x});p.push(S)}for(var w=p.map(function(D,L){var B=n(c[L],a(D,t)),M=n(c[(L+1)%d],a(D,t));return{p1:B,p2:M}}),N=[],C=0;C<d;C++){var T=w[(C-1+d)%d],R=w[C],A=f(T.p1,T.p2,R.p1,R.p2);N.push(A)}return N}function WX(e,t,n,r,a,i){var l=sQ(e,t,n,r,a),o=QX(l,i),f=jr();return o.forEach(function(c){return bL(f,c.x,c.y)}),f}var SL=function(t,n,r,a,i,l,o){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?gl(i,l):f,d=i/2,p=l/2;c=Math.min(c,d,p);var m=c!==d,y=c!==p,x;if(m){var b=r-d+c-o,S=a-p-o,w=r+d-c+o,N=S;if(x=sl(t,n,r,a,b,S,w,N,!1),x.length>0)return x}if(y){var C=r+d+o,T=a-p+c-o,R=C,A=a+p-c+o;if(x=sl(t,n,r,a,C,T,R,A,!1),x.length>0)return x}if(m){var D=r-d+c-o,L=a+p+o,B=r+d-c+o,M=L;if(x=sl(t,n,r,a,D,L,B,M,!1),x.length>0)return x}if(y){var _=r-d-o,P=a-p+c-o,H=_,$=a+p-c+o;if(x=sl(t,n,r,a,_,P,H,$,!1),x.length>0)return x}var V;{var I=r-d+c,U=a-p+c;if(V=Pf(t,n,r,a,I,U,c+o),V.length>0&&V[0]<=I&&V[1]<=U)return[V[0],V[1]]}{var Y=r+d-c,Q=a-p+c;if(V=Pf(t,n,r,a,Y,Q,c+o),V.length>0&&V[0]>=Y&&V[1]<=Q)return[V[0],V[1]]}{var F=r+d-c,q=a+p-c;if(V=Pf(t,n,r,a,F,q,c+o),V.length>0&&V[0]>=F&&V[1]>=q)return[V[0],V[1]]}{var X=r-d+c,z=a+p-c;if(V=Pf(t,n,r,a,X,z,c+o),V.length>0&&V[0]<=X&&V[1]>=z)return[V[0],V[1]]}return[]},ZX=function(t,n,r,a,i,l,o){var f=o,c=Math.min(r,i),d=Math.max(r,i),p=Math.min(a,l),m=Math.max(a,l);return c-f<=t&&t<=d+f&&p-f<=n&&n<=m+f},JX=function(t,n,r,a,i,l,o,f,c){var d={x1:Math.min(r,o,i)-c,x2:Math.max(r,o,i)+c,y1:Math.min(a,f,l)-c,y2:Math.max(a,f,l)+c};return!(t<d.x1||t>d.x2||n<d.y1||n>d.y2)},eQ=function(t,n,r,a){r-=a;var i=n*n-4*t*r;if(i<0)return[];var l=Math.sqrt(i),o=2*t,f=(-n+l)/o,c=(-n-l)/o;return[f,c]},tQ=function(t,n,r,a,i){var l=1e-5;t===0&&(t=l),n/=t,r/=t,a/=t;var o,f,c,d,p,m,y,x;if(f=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,o=f*f*f+c*c,i[1]=0,y=n/3,o>0){p=c+Math.sqrt(o),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),m=c-Math.sqrt(o),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),i[0]=-y+p+m,y+=(p+m)/2,i[4]=i[2]=-y,y=Math.sqrt(3)*(-m+p)/2,i[3]=y,i[5]=-y;return}if(i[5]=i[3]=0,o===0){x=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-y+2*x,i[4]=i[2]=-(x+y);return}f=-f,d=f*f*f,d=Math.acos(c/Math.sqrt(d)),x=2*Math.sqrt(f),i[0]=-y+x*Math.cos(d/3),i[2]=-y+x*Math.cos((d+2*Math.PI)/3),i[4]=-y+x*Math.cos((d+4*Math.PI)/3)},nQ=function(t,n,r,a,i,l,o,f){var c=1*r*r-4*r*i+2*r*o+4*i*i-4*i*o+o*o+a*a-4*a*l+2*a*f+4*l*l-4*l*f+f*f,d=9*r*i-3*r*r-3*r*o-6*i*i+3*i*o+9*a*l-3*a*a-3*a*f-6*l*l+3*l*f,p=3*r*r-6*r*i+r*o-r*t+2*i*i+2*i*t-o*t+3*a*a-6*a*l+a*f-a*n+2*l*l+2*l*n-f*n,m=1*r*i-r*r+r*t-i*t+a*l-a*a+a*n-l*n,y=[];tQ(c,d,p,m,y);for(var x=1e-7,b=[],S=0;S<6;S+=2)Math.abs(y[S+1])<x&&y[S]>=0&&y[S]<=1&&b.push(y[S]);b.push(1),b.push(0);for(var w=-1,N,C,T,R=0;R<b.length;R++)N=Math.pow(1-b[R],2)*r+2*(1-b[R])*b[R]*i+b[R]*b[R]*o,C=Math.pow(1-b[R],2)*a+2*(1-b[R])*b[R]*l+b[R]*b[R]*f,T=Math.pow(N-t,2)+Math.pow(C-n,2),w>=0?T<w&&(w=T):w=T;return w},rQ=function(t,n,r,a,i,l){var o=[t-r,n-a],f=[i-r,l-a],c=f[0]*f[0]+f[1]*f[1],d=o[0]*o[0]+o[1]*o[1],p=o[0]*f[0]+o[1]*f[1],m=p*p/c;return p<0?d:m>c?(t-i)*(t-i)+(n-l)*(n-l):d-m},Hr=function(t,n,r){for(var a,i,l,o,f,c=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(l=r[(d+1)*2],o=r[(d+1)*2+1]):(l=r[(d+1-r.length/2)*2],o=r[(d+1-r.length/2)*2+1]),!(a==t&&l==t))if(a>=t&&t>=l||a<=t&&t<=l)f=(t-a)/(l-a)*(o-i)+i,f>n&&c++;else continue;return c%2!==0},ss=function(t,n,r,a,i,l,o,f,c){var d=new Array(r.length),p;f[0]!=null?(p=Math.atan(f[1]/f[0]),f[0]<0?p=p+Math.PI/2:p=-p-Math.PI/2):p=f;for(var m=Math.cos(-p),y=Math.sin(-p),x=0;x<d.length/2;x++)d[x*2]=l/2*(r[x*2]*m-r[x*2+1]*y),d[x*2+1]=o/2*(r[x*2+1]*m+r[x*2]*y),d[x*2]+=a,d[x*2+1]+=i;var b;if(c>0){var S=xp(d,-c);b=yp(S)}else b=d;return Hr(t,n,b)},aQ=function(t,n,r,a,i,l,o,f){for(var c=new Array(r.length*2),d=0;d<f.length;d++){var p=f[d];c[d*4+0]=p.startX,c[d*4+1]=p.startY,c[d*4+2]=p.stopX,c[d*4+3]=p.stopY;var m=Math.pow(p.cx-t,2)+Math.pow(p.cy-n,2);if(m<=Math.pow(p.radius,2))return!0}return Hr(t,n,c)},yp=function(t){for(var n=new Array(t.length/2),r,a,i,l,o,f,c,d,p=0;p<t.length/4;p++){r=t[p*4],a=t[p*4+1],i=t[p*4+2],l=t[p*4+3],p<t.length/4-1?(o=t[(p+1)*4],f=t[(p+1)*4+1],c=t[(p+1)*4+2],d=t[(p+1)*4+3]):(o=t[0],f=t[1],c=t[2],d=t[3]);var m=sl(r,a,i,l,o,f,c,d,!0);n[p*2]=m[0],n[p*2+1]=m[1]}return n},xp=function(t,n){for(var r=new Array(t.length*2),a,i,l,o,f=0;f<t.length/2;f++){a=t[f*2],i=t[f*2+1],f<t.length/2-1?(l=t[(f+1)*2],o=t[(f+1)*2+1]):(l=t[0],o=t[1]);var c=o-i,d=-(l-a),p=Math.sqrt(c*c+d*d),m=c/p,y=d/p;r[f*4]=a+m*n,r[f*4+1]=i+y*n,r[f*4+2]=l+m*n,r[f*4+3]=o+y*n}return r},iQ=function(t,n,r,a,i,l){var o=r-t,f=a-n;o/=i,f/=l;var c=Math.sqrt(o*o+f*f),d=c-1;if(d<0)return[];var p=d/c;return[(r-t)*p+t,(a-n)*p+n]},to=function(t,n,r,a,i,l,o){return t-=i,n-=l,t/=r/2+o,n/=a/2+o,t*t+n*n<=1},Pf=function(t,n,r,a,i,l,o){var f=[r-t,a-n],c=[t-i,n-l],d=f[0]*f[0]+f[1]*f[1],p=2*(c[0]*f[0]+c[1]*f[1]),m=c[0]*c[0]+c[1]*c[1]-o*o,y=p*p-4*d*m;if(y<0)return[];var x=(-p+Math.sqrt(y))/(2*d),b=(-p-Math.sqrt(y))/(2*d),S=Math.min(x,b),w=Math.max(x,b),N=[];if(S>=0&&S<=1&&N.push(S),w>=0&&w<=1&&N.push(w),N.length===0)return[];var C=N[0]*f[0]+t,T=N[0]*f[1]+n;if(N.length>1){if(N[0]==N[1])return[C,T];var R=N[1]*f[0]+t,A=N[1]*f[1]+n;return[C,T,R,A]}else return[C,T]},Dx=function(t,n,r){return n<=t&&t<=r||r<=t&&t<=n?t:t<=n&&n<=r||r<=n&&n<=t?n:r},sl=function(t,n,r,a,i,l,o,f,c){var d=t-i,p=r-t,m=o-i,y=n-l,x=a-n,b=f-l,S=m*y-b*d,w=p*y-x*d,N=b*p-m*x;if(N!==0){var C=S/N,T=w/N,R=.001,A=0-R,D=1+R;return A<=C&&C<=D&&A<=T&&T<=D?[t+C*p,n+C*x]:c?[t+C*p,n+C*x]:[]}else return S===0||w===0?Dx(t,r,o)===o?[o,f]:Dx(t,r,i)===i?[i,l]:Dx(i,o,r)===r?[r,a]:[]:[]},sQ=function(t,n,r,a,i){var l=[],o=a/2,f=i/2,c=n,d=r;l.push({x:c+o*t[0],y:d+f*t[1]});for(var p=1;p<t.length/2;p++)l.push({x:c+o*t[p*2],y:d+f*t[p*2+1]});return l},ad=function(t,n,r,a,i,l,o,f){var c=[],d,p=new Array(r.length),m=!0;l==null&&(m=!1);var y;if(m){for(var x=0;x<p.length/2;x++)p[x*2]=r[x*2]*l+a,p[x*2+1]=r[x*2+1]*o+i;if(f>0){var b=xp(p,-f);y=yp(b)}else y=p}else y=r;for(var S,w,N,C,T=0;T<y.length/2;T++)S=y[T*2],w=y[T*2+1],T<y.length/2-1?(N=y[(T+1)*2],C=y[(T+1)*2+1]):(N=y[0],C=y[1]),d=sl(t,n,a,i,S,w,N,C),d.length!==0&&c.push(d[0],d[1]);return c},lQ=function(t,n,r,a,i,l,o,f,c){var d=[],p,m=new Array(r.length*2);c.forEach(function(N,C){C===0?(m[m.length-2]=N.startX,m[m.length-1]=N.startY):(m[C*4-2]=N.startX,m[C*4-1]=N.startY),m[C*4]=N.stopX,m[C*4+1]=N.stopY,p=Pf(t,n,a,i,N.cx,N.cy,N.radius),p.length!==0&&d.push(p[0],p[1])});for(var y=0;y<m.length/4;y++)p=sl(t,n,a,i,m[y*4],m[y*4+1],m[y*4+2],m[y*4+3],!1),p.length!==0&&d.push(p[0],p[1]);if(d.length>2){for(var x=[d[0],d[1]],b=Math.pow(x[0]-t,2)+Math.pow(x[1]-n,2),S=1;S<d.length/2;S++){var w=Math.pow(d[S*2]-t,2)+Math.pow(d[S*2+1]-n,2);w<=b&&(x[0]=d[S*2],x[1]=d[S*2+1],b=w)}return x}return d},wv=function(t,n,r){var a=[t[0]-n[0],t[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=(i-r)/i;return l<0&&(l=1e-5),[n[0]+l*a[0],n[1]+l*a[1]]},Nr=function(t,n){var r=$b(t,n);return r=EL(r),r},EL=function(t){for(var n,r,a=t.length/2,i=1/0,l=1/0,o=-1/0,f=-1/0,c=0;c<a;c++)n=t[2*c],r=t[2*c+1],i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);for(var d=2/(o-i),p=2/(f-l),m=0;m<a;m++)n=t[2*m]=t[2*m]*d,r=t[2*m+1]=t[2*m+1]*p,i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);if(l<-1)for(var y=0;y<a;y++)r=t[2*y+1]=t[2*y+1]+(-1-l);return t},$b=function(t,n){var r=1/t*2*Math.PI,a=t%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(t*2),l,o=0;o<t;o++)l=o*r+a,i[2*o]=Math.cos(l),i[2*o+1]=Math.sin(-l);return i},gl=function(t,n){return Math.min(t/4,n/4,8)},CL=function(t,n){return Math.min(t/10,n/10,8)},_w=function(){return 8},oQ=function(t,n,r){return[t-2*n+r,2*(n-t),t]},Gb=function(t,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};function Mx(e,t){function n(p){for(var m=[],y=0;y<p.length;y++){var x=p[y],b=p[(y+1)%p.length],S={x:b.x-x.x,y:b.y-x.y},w={x:-S.y,y:S.x},N=Math.sqrt(w.x*w.x+w.y*w.y);m.push({x:w.x/N,y:w.y/N})}return m}function r(p,m){var y=1/0,x=-1/0,b=Gr(p),S;try{for(b.s();!(S=b.n()).done;){var w=S.value,N=w.x*m.x+w.y*m.y;y=Math.min(y,N),x=Math.max(x,N)}}catch(C){b.e(C)}finally{b.f()}return{min:y,max:x}}function a(p,m){return!(p.max<m.min||m.max<p.min)}var i=[].concat(vp(n(e)),vp(n(t))),l=Gr(i),o;try{for(l.s();!(o=l.n()).done;){var f=o.value,c=r(e,f),d=r(t,f);if(!a(c,d))return!1}}catch(p){l.e(p)}finally{l.f()}return!0}var uQ=cr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(t){return 1}}),cQ={pageRank:function(t){for(var n=uQ(t),r=n.dampingFactor,a=n.precision,i=n.iterations,l=n.weight,o=this._private.cy,f=this.byGroup(),c=f.nodes,d=f.edges,p=c.length,m=p*p,y=d.length,x=new Array(m),b=new Array(p),S=(1-r)/p,w=0;w<p;w++){for(var N=0;N<p;N++){var C=w*p+N;x[C]=0}b[w]=0}for(var T=0;T<y;T++){var R=d[T],A=R.data("source"),D=R.data("target");if(A!==D){var L=c.indexOfId(A),B=c.indexOfId(D),M=l(R),_=B*p+L;x[_]+=M,b[L]+=M}}for(var P=1/p+S,H=0;H<p;H++)if(b[H]===0)for(var $=0;$<p;$++){var V=$*p+H;x[V]=P}else for(var I=0;I<p;I++){var U=I*p+H;x[U]=x[U]/b[H]+S}for(var Y=new Array(p),Q=new Array(p),F,q=0;q<p;q++)Y[q]=1;for(var X=0;X<i;X++){for(var z=0;z<p;z++)Q[z]=0;for(var W=0;W<p;W++)for(var re=0;re<p;re++){var ae=W*p+re;Q[W]+=x[ae]*Y[re]}HX(Q),F=Y,Y=Q,Q=F;for(var ie=0,ye=0;ye<p;ye++){var ue=F[ye]-Y[ye];ie+=ue*ue}if(ie<a)break}var ee={rank:function(se){return se=o.collection(se)[0],Y[c.indexOf(se)]}};return ee}},cT=cr({root:null,weight:function(t){return 1},directed:!1,alpha:0}),Pu={degreeCentralityNormalized:function(t){t=cT(t);var n=this.cy(),r=this.nodes(),a=r.length;if(t.directed){for(var d={},p={},m=0,y=0,x=0;x<a;x++){var b=r[x],S=b.id();t.root=b;var w=this.degreeCentrality(t);m<w.indegree&&(m=w.indegree),y<w.outdegree&&(y=w.outdegree),d[S]=w.indegree,p[S]=w.outdegree}return{indegree:function(C){return m==0?0:(tt(C)&&(C=n.filter(C)),d[C.id()]/m)},outdegree:function(C){return y===0?0:(tt(C)&&(C=n.filter(C)),p[C.id()]/y)}}}else{for(var i={},l=0,o=0;o<a;o++){var f=r[o];t.root=f;var c=this.degreeCentrality(t);l<c.degree&&(l=c.degree),i[f.id()]=c.degree}return{degree:function(C){return l===0?0:(tt(C)&&(C=n.filter(C)),i[C.id()]/l)}}}},degreeCentrality:function(t){t=cT(t);var n=this.cy(),r=this,a=t,i=a.root,l=a.weight,o=a.directed,f=a.alpha;if(i=n.collection(i)[0],o){for(var y=i.connectedEdges(),x=y.filter(function(A){return A.target().same(i)&&r.has(A)}),b=y.filter(function(A){return A.source().same(i)&&r.has(A)}),S=x.length,w=b.length,N=0,C=0,T=0;T<x.length;T++)N+=l(x[T]);for(var R=0;R<b.length;R++)C+=l(b[R]);return{indegree:Math.pow(S,1-f)*Math.pow(N,f),outdegree:Math.pow(w,1-f)*Math.pow(C,f)}}else{for(var c=i.connectedEdges().intersection(r),d=c.length,p=0,m=0;m<c.length;m++)p+=l(c[m]);return{degree:Math.pow(d,1-f)*Math.pow(p,f)}}}};Pu.dc=Pu.degreeCentrality;Pu.dcn=Pu.degreeCentralityNormalised=Pu.degreeCentralityNormalized;var fT=cr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),zu={closenessCentralityNormalized:function(t){for(var n=fT(t),r=n.harmonic,a=n.weight,i=n.directed,l=this.cy(),o={},f=0,c=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),p=0;p<c.length;p++){for(var m=0,y=c[p],x=0;x<c.length;x++)if(p!==x){var b=d.distance(y,c[x]);r?m+=1/b:m+=b}r||(m=1/m),f<m&&(f=m),o[y.id()]=m}return{closeness:function(w){return f==0?0:(tt(w)?w=l.filter(w)[0].id():w=w.id(),o[w]/f)}}},closenessCentrality:function(t){var n=fT(t),r=n.root,a=n.weight,i=n.directed,l=n.harmonic;r=this.filter(r)[0];for(var o=this.dijkstra({root:r,weight:a,directed:i}),f=0,c=this.nodes(),d=0;d<c.length;d++){var p=c[d];if(!p.same(r)){var m=o.distanceTo(p);l?f+=1/m:f+=m}}return l?f:1/f}};zu.cc=zu.closenessCentrality;zu.ccn=zu.closenessCentralityNormalised=zu.closenessCentralityNormalized;var fQ=cr({weight:null,directed:!1}),Kb={betweennessCentrality:function(t){for(var n=fQ(t),r=n.directed,a=n.weight,i=a!=null,l=this.cy(),o=this.nodes(),f={},c={},d=0,p={set:function(C,T){c[C]=T,T>d&&(d=T)},get:function(C){return c[C]}},m=0;m<o.length;m++){var y=o[m],x=y.id();r?f[x]=y.outgoers().nodes():f[x]=y.openNeighborhood().nodes(),p.set(x,0)}for(var b=function(){for(var C=o[S].id(),T=[],R={},A={},D={},L=new Id(function(W,re){return D[W]-D[re]}),B=0;B<o.length;B++){var M=o[B].id();R[M]=[],A[M]=0,D[M]=1/0}for(A[C]=1,D[C]=0,L.push(C);!L.empty();){var _=L.pop();if(T.push(_),i)for(var P=0;P<f[_].length;P++){var H=f[_][P],$=l.getElementById(_),V=void 0;$.edgesTo(H).length>0?V=$.edgesTo(H)[0]:V=H.edgesTo($)[0];var I=a(V);H=H.id(),D[H]>D[_]+I&&(D[H]=D[_]+I,L.nodes.indexOf(H)<0?L.push(H):L.updateItem(H),A[H]=0,R[H]=[]),D[H]==D[_]+I&&(A[H]=A[H]+A[_],R[H].push(_))}else for(var U=0;U<f[_].length;U++){var Y=f[_][U].id();D[Y]==1/0&&(L.push(Y),D[Y]=D[_]+1),D[Y]==D[_]+1&&(A[Y]=A[Y]+A[_],R[Y].push(_))}}for(var Q={},F=0;F<o.length;F++)Q[o[F].id()]=0;for(;T.length>0;){for(var q=T.pop(),X=0;X<R[q].length;X++){var z=R[q][X];Q[z]=Q[z]+A[z]/A[q]*(1+Q[q])}q!=o[S].id()&&p.set(q,p.get(q)+Q[q])}},S=0;S<o.length;S++)b();var w={betweenness:function(C){var T=l.collection(C).id();return p.get(T)},betweennessNormalized:function(C){if(d==0)return 0;var T=l.collection(C).id();return p.get(T)/d}};return w.betweennessNormalised=w.betweennessNormalized,w}};Kb.bc=Kb.betweennessCentrality;var dQ=cr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),hQ=function(t){return dQ(t)},vQ=function(t,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](t);return r},pQ=function(t,n,r){for(var a=0;a<n;a++)t[a*n+a]=r},NL=function(t,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=t[i*n+a];for(var l=0;l<n;l++)t[l*n+a]=t[l*n+a]/r}},mQ=function(t,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var l=0;l<r;l++)a[i*r+l]=0;for(var o=0;o<r;o++)for(var f=0;f<r;f++)a[i*r+f]+=t[i*r+o]*n[o*r+f]}return a},gQ=function(t,n,r){for(var a=t.slice(0),i=1;i<r;i++)t=mQ(t,a,n);return t},yQ=function(t,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(t[i],r);return NL(a,n),a},xQ=function(t,n,r,a){for(var i=0;i<r;i++){var l=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(l!==o)return!1}return!0},bQ=function(t,n,r,a){for(var i=[],l=0;l<n;l++){for(var o=[],f=0;f<n;f++)Math.round(t[l*n+f]*1e3)/1e3>0&&o.push(r[f]);o.length!==0&&i.push(a.collection(o))}return i},wQ=function(t,n){for(var r=0;r<t.length;r++)if(!n[r]||t[r].id()!==n[r].id())return!1;return!0},SQ=function(t){for(var n=0;n<t.length;n++)for(var r=0;r<t.length;r++)n!=r&&wQ(t[n],t[r])&&t.splice(r,1);return t},dT=function(t){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=hQ(t),l={},o=0;o<n.length;o++)l[n[o].id()]=o;for(var f=n.length,c=f*f,d=new Array(c),p,m=0;m<c;m++)d[m]=0;for(var y=0;y<r.length;y++){var x=r[y],b=l[x.source().id()],S=l[x.target().id()],w=vQ(x,i.attributes);d[b*f+S]+=w,d[S*f+b]+=w}pQ(d,f,i.multFactor),NL(d,f);for(var N=!0,C=0;N&&C<i.maxIterations;)N=!1,p=gQ(d,f,i.expandFactor),d=yQ(p,f,i.inflateFactor),xQ(d,p,c,4)||(N=!0),C++;var T=bQ(d,f,n,a);return T=SQ(T),T},EQ={markovClustering:dT,mcl:dT},CQ=function(t){return t},kL=function(t,n){return Math.abs(n-t)},hT=function(t,n,r){return t+kL(n,r)},vT=function(t,n,r){return t+Math.pow(r-n,2)},NQ=function(t){return Math.sqrt(t)},kQ=function(t,n,r){return Math.max(t,kL(n,r))},kf=function(t,n,r,a,i){for(var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:CQ,o=a,f,c,d=0;d<t;d++)f=n(d),c=r(d),o=i(o,f,c);return l(o)},nc={euclidean:function(t,n,r){return t>=2?kf(t,n,r,0,vT,NQ):kf(t,n,r,0,hT)},squaredEuclidean:function(t,n,r){return kf(t,n,r,0,vT)},manhattan:function(t,n,r){return kf(t,n,r,0,hT)},max:function(t,n,r){return kf(t,n,r,-1/0,kQ)}};nc["squared-euclidean"]=nc.squaredEuclidean;nc.squaredeuclidean=nc.squaredEuclidean;function am(e,t,n,r,a,i){var l;return mn(e)?l=e:l=nc[e]||nc.euclidean,t===0&&mn(e)?l(a,i):l(t,n,r,a,i)}var TQ=cr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Bw=function(t){return TQ(t)},bp=function(t,n,r,a,i){var l=i!=="kMedoids",o=l?function(p){return r[p]}:function(p){return a[p](r)},f=function(m){return a[m](n)},c=r,d=n;return am(t,a.length,o,f,c,d)},Ox=function(t,n,r){for(var a=r.length,i=new Array(a),l=new Array(a),o=new Array(n),f=null,c=0;c<a;c++)i[c]=t.min(r[c]).value,l[c]=t.max(r[c]).value;for(var d=0;d<n;d++){f=[];for(var p=0;p<a;p++)f[p]=Math.random()*(l[p]-i[p])+i[p];o[d]=f}return o},TL=function(t,n,r,a,i){for(var l=1/0,o=0,f=0;f<n.length;f++){var c=bp(r,t,n[f],a,i);c<l&&(l=c,o=f)}return o},jL=function(t,n,r){for(var a=[],i=null,l=0;l<n.length;l++)i=n[l],r[i.id()]===t&&a.push(i);return a},jQ=function(t,n,r){return Math.abs(n-t)<=r},AQ=function(t,n,r){for(var a=0;a<t.length;a++)for(var i=0;i<t[a].length;i++){var l=Math.abs(t[a][i]-n[a][i]);if(l>r)return!1}return!0},RQ=function(t,n,r){for(var a=0;a<r;a++)if(t===n[a])return!0;return!1},pT=function(t,n){var r=new Array(n);if(t.length<50)for(var a=0;a<n;a++){for(var i=t[Math.floor(Math.random()*t.length)];RQ(i,r,a);)i=t[Math.floor(Math.random()*t.length)];r[a]=i}else for(var l=0;l<n;l++)r[l]=t[Math.floor(Math.random()*t.length)];return r},mT=function(t,n,r){for(var a=0,i=0;i<n.length;i++)a+=bp("manhattan",n[i],t,r,"kMedoids");return a},DQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Bw(t),l=new Array(i.k),o={},f;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,f=Ox(r,i.k,i.attributes)):Un(i.testCentroids)==="object"?f=i.testCentroids:f=Ox(r,i.k,i.attributes):f=Ox(r,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var p=0;p<r.length;p++)a=r[p],o[a.id()]=TL(a,f,i.distance,i.attributes,"kMeans");c=!1;for(var m=0;m<i.k;m++){var y=jL(m,r,o);if(y.length!==0){for(var x=i.attributes.length,b=f[m],S=new Array(x),w=new Array(x),N=0;N<x;N++){w[N]=0;for(var C=0;C<y.length;C++)a=y[C],w[N]+=i.attributes[N](a);S[N]=w[N]/y.length,jQ(S[N],b[N],i.sensitivityThreshold)||(c=!0)}f[m]=S,l[m]=n.collection(y)}}d++}return l},MQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Bw(t),l=new Array(i.k),o,f={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Un(i.testCentroids)==="object"?o=i.testCentroids:o=pT(r,i.k)):o=pT(r,i.k);for(var p=!0,m=0;p&&m<i.maxIterations;){for(var y=0;y<r.length;y++)a=r[y],f[a.id()]=TL(a,o,i.distance,i.attributes,"kMedoids");p=!1;for(var x=0;x<o.length;x++){var b=jL(x,r,f);if(b.length!==0){d[x]=mT(o[x],b,i.attributes);for(var S=0;S<b.length;S++)c=mT(b[S],b,i.attributes),c<d[x]&&(d[x]=c,o[x]=b[S],p=!0);l[x]=n.collection(b)}}m++}return l},OQ=function(t,n,r,a,i){for(var l,o,f=0;f<n.length;f++)for(var c=0;c<t.length;c++)a[f][c]=Math.pow(r[f][c],i.m);for(var d=0;d<t.length;d++)for(var p=0;p<i.attributes.length;p++){l=0,o=0;for(var m=0;m<n.length;m++)l+=a[m][d]*i.attributes[p](n[m]),o+=a[m][d];t[d][p]=l/o}},LQ=function(t,n,r,a,i){for(var l=0;l<t.length;l++)n[l]=t[l].slice();for(var o,f,c,d=2/(i.m-1),p=0;p<r.length;p++)for(var m=0;m<a.length;m++){o=0;for(var y=0;y<r.length;y++)f=bp(i.distance,a[m],r[p],i.attributes,"cmeans"),c=bp(i.distance,a[m],r[y],i.attributes,"cmeans"),o+=Math.pow(f/c,d);t[m][p]=1/o}},_Q=function(t,n,r,a){for(var i=new Array(r.k),l=0;l<i.length;l++)i[l]=[];for(var o,f,c=0;c<n.length;c++){o=-1/0,f=-1;for(var d=0;d<n[0].length;d++)n[c][d]>o&&(o=n[c][d],f=d);i[f].push(t[c])}for(var p=0;p<i.length;p++)i[p]=a.collection(i[p]);return i},gT=function(t){var n=this.cy(),r=this.nodes(),a=Bw(t),i,l,o,f,c;f=new Array(r.length);for(var d=0;d<r.length;d++)f[d]=new Array(a.k);o=new Array(r.length);for(var p=0;p<r.length;p++)o[p]=new Array(a.k);for(var m=0;m<r.length;m++){for(var y=0,x=0;x<a.k;x++)o[m][x]=Math.random(),y+=o[m][x];for(var b=0;b<a.k;b++)o[m][b]=o[m][b]/y}l=new Array(a.k);for(var S=0;S<a.k;S++)l[S]=new Array(a.attributes.length);c=new Array(r.length);for(var w=0;w<r.length;w++)c[w]=new Array(a.k);for(var N=!0,C=0;N&&C<a.maxIterations;)N=!1,OQ(l,r,o,c,a),LQ(o,f,l,r,a),AQ(o,f,a.sensitivityThreshold)||(N=!0),C++;return i=_Q(r,o,a,n),{clusters:i,degreeOfMembership:o}},BQ={kMeans:DQ,kMedoids:MQ,fuzzyCMeans:gT,fcm:gT},PQ=cr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),zQ={single:"min",complete:"max"},IQ=function(t){var n=PQ(t),r=zQ[n.linkage];return r!=null&&(n.linkage=r),n},yT=function(t,n,r,a,i){for(var l=0,o=1/0,f,c=i.attributes,d=function(B,M){return am(i.distance,c.length,function(_){return c[_](B)},function(_){return c[_](M)},B,M)},p=0;p<t.length;p++){var m=t[p].key,y=r[m][a[m]];y<o&&(l=m,o=y)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&t.length===1)return!1;var x=n[l],b=n[a[l]],S;i.mode==="dendrogram"?S={left:x,right:b,key:x.key}:S={value:x.value.concat(b.value),key:x.key},t[x.index]=S,t.splice(b.index,1),n[x.key]=S;for(var w=0;w<t.length;w++){var N=t[w];x.key===N.key?f=1/0:i.linkage==="min"?(f=r[x.key][N.key],r[x.key][N.key]>r[b.key][N.key]&&(f=r[b.key][N.key])):i.linkage==="max"?(f=r[x.key][N.key],r[x.key][N.key]<r[b.key][N.key]&&(f=r[b.key][N.key])):i.linkage==="mean"?f=(r[x.key][N.key]*x.size+r[b.key][N.key]*b.size)/(x.size+b.size):i.mode==="dendrogram"?f=d(N.value,x.value):f=d(N.value[0],x.value[0]),r[x.key][N.key]=r[N.key][x.key]=f}for(var C=0;C<t.length;C++){var T=t[C].key;if(a[T]===x.key||a[T]===b.key){for(var R=T,A=0;A<t.length;A++){var D=t[A].key;r[T][D]<r[T][R]&&(R=D)}a[T]=R}t[C].index=C}return x.key=b.key=x.index=b.index=null,!0},Au=function(t,n,r){t&&(t.value?n.push(t.value):(t.left&&Au(t.left,n),t.right&&Au(t.right,n)))},Yb=function(t,n){if(!t)return"";if(t.left&&t.right){var r=Yb(t.left,n),a=Yb(t.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(t.value)return t.value.id()},Xb=function(t,n,r){if(!t)return[];var a=[],i=[],l=[];return n===0?(t.left&&Au(t.left,a),t.right&&Au(t.right,i),l=a.concat(i),[r.collection(l)]):n===1?t.value?[r.collection(t.value)]:(t.left&&Au(t.left,a),t.right&&Au(t.right,i),[r.collection(a),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(a=Xb(t.left,n-1,r)),t.right&&(i=Xb(t.right,n-1,r)),a.concat(i))},xT=function(t){for(var n=this.cy(),r=this.nodes(),a=IQ(t),i=a.attributes,l=function(C,T){return am(a.distance,i.length,function(R){return i[R](C)},function(R){return i[R](T)},C,T)},o=[],f=[],c=[],d=[],p=0;p<r.length;p++){var m={value:a.mode==="dendrogram"?r[p]:[r[p]],key:p,index:p};o[p]=m,d[p]=m,f[p]=[],c[p]=0}for(var y=0;y<o.length;y++)for(var x=0;x<=y;x++){var b=void 0;a.mode==="dendrogram"?b=y===x?1/0:l(o[y].value,o[x].value):b=y===x?1/0:l(o[y].value[0],o[x].value[0]),f[y][x]=b,f[x][y]=b,b<f[y][c[y]]&&(c[y]=x)}for(var S=yT(o,d,f,c,a);S;)S=yT(o,d,f,c,a);var w;return a.mode==="dendrogram"?(w=Xb(o[0],a.dendrogramDepth,n),a.addDendrogram&&Yb(o[0],n)):(w=new Array(o.length),o.forEach(function(N,C){N.key=N.index=null,w[C]=n.collection(N.value)})),w},FQ={hierarchicalClustering:xT,hca:xT},qQ=cr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),UQ=function(t){var n=t.damping,r=t.preference;.5<=n&&n<1||fn("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||Ae(r)||fn("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),qQ(t)},VQ=function(t,n,r,a){var i=function(o,f){return a[f](o)};return-am(t,a.length,function(l){return i(n,l)},function(l){return i(r,l)},n,r)},HQ=function(t,n){var r=null;return n==="median"?r=UX(t):n==="mean"?r=qX(t):n==="min"?r=IX(t):n==="max"?r=FX(t):r=n,r},$Q=function(t,n,r){for(var a=[],i=0;i<t;i++)n[i*t+i]+r[i*t+i]>0&&a.push(i);return a},bT=function(t,n,r){for(var a=[],i=0;i<t;i++){for(var l=-1,o=-1/0,f=0;f<r.length;f++){var c=r[f];n[i*t+c]>o&&(l=c,o=n[i*t+c])}l>0&&a.push(l)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},GQ=function(t,n,r){for(var a=bT(t,n,r),i=0;i<r.length;i++){for(var l=[],o=0;o<a.length;o++)a[o]===r[i]&&l.push(o);for(var f=-1,c=-1/0,d=0;d<l.length;d++){for(var p=0,m=0;m<l.length;m++)p+=n[l[m]*t+l[d]];p>c&&(f=d,c=p)}r[i]=l[f]}return a=bT(t,n,r),a},wT=function(t){for(var n=this.cy(),r=this.nodes(),a=UQ(t),i={},l=0;l<r.length;l++)i[r[l].id()]=l;var o,f,c,d,p,m;o=r.length,f=o*o,c=new Array(f);for(var y=0;y<f;y++)c[y]=-1/0;for(var x=0;x<o;x++)for(var b=0;b<o;b++)x!==b&&(c[x*o+b]=VQ(a.distance,r[x],r[b],a.attributes));d=HQ(c,a.preference);for(var S=0;S<o;S++)c[S*o+S]=d;p=new Array(f);for(var w=0;w<f;w++)p[w]=0;m=new Array(f);for(var N=0;N<f;N++)m[N]=0;for(var C=new Array(o),T=new Array(o),R=new Array(o),A=0;A<o;A++)C[A]=0,T[A]=0,R[A]=0;for(var D=new Array(o*a.minIterations),L=0;L<D.length;L++)D[L]=0;var B;for(B=0;B<a.maxIterations;B++){for(var M=0;M<o;M++){for(var _=-1/0,P=-1/0,H=-1,$=0,V=0;V<o;V++)C[V]=p[M*o+V],$=m[M*o+V]+c[M*o+V],$>=_?(P=_,_=$,H=V):$>P&&(P=$);for(var I=0;I<o;I++)p[M*o+I]=(1-a.damping)*(c[M*o+I]-_)+a.damping*C[I];p[M*o+H]=(1-a.damping)*(c[M*o+H]-P)+a.damping*C[H]}for(var U=0;U<o;U++){for(var Y=0,Q=0;Q<o;Q++)C[Q]=m[Q*o+U],T[Q]=Math.max(0,p[Q*o+U]),Y+=T[Q];Y-=T[U],T[U]=p[U*o+U],Y+=T[U];for(var F=0;F<o;F++)m[F*o+U]=(1-a.damping)*Math.min(0,Y-T[F])+a.damping*C[F];m[U*o+U]=(1-a.damping)*(Y-T[U])+a.damping*C[U]}for(var q=0,X=0;X<o;X++){var z=m[X*o+X]+p[X*o+X]>0?1:0;D[B%a.minIterations*o+X]=z,q+=z}if(q>0&&(B>=a.minIterations-1||B==a.maxIterations-1)){for(var W=0,re=0;re<o;re++){R[re]=0;for(var ae=0;ae<a.minIterations;ae++)R[re]+=D[ae*o+re];(R[re]===0||R[re]===a.minIterations)&&W++}if(W===o)break}}for(var ie=$Q(o,p,m),ye=GQ(o,c,ie),ue={},ee=0;ee<ie.length;ee++)ue[ie[ee]]=[];for(var ne=0;ne<r.length;ne++){var se=i[r[ne].id()],ge=ye[se];ge!=null&&ue[ge].push(r[ne])}for(var ke=new Array(ie.length),Pe=0;Pe<ie.length;Pe++)ke[Pe]=n.collection(ue[ie[Pe]]);return ke},KQ={affinityPropagation:wT,ap:wT},YQ=cr({root:void 0,directed:!1}),XQ={hierholzer:function(t){if(!Dt(t)){var n=arguments;t={root:n[0],directed:n[1]}}var r=YQ(t),a=r.root,i=r.directed,l=this,o=!1,f,c,d;a&&(d=tt(a)?this.filter(a)[0].id():a[0].id());var p={},m={};i?l.forEach(function(N){var C=N.id();if(N.isNode()){var T=N.indegree(!0),R=N.outdegree(!0),A=T-R,D=R-T;A==1?f?o=!0:f=C:D==1?c?o=!0:c=C:(D>1||A>1)&&(o=!0),p[C]=[],N.outgoers().forEach(function(L){L.isEdge()&&p[C].push(L.id())})}else m[C]=[void 0,N.target().id()]}):l.forEach(function(N){var C=N.id();if(N.isNode()){var T=N.degree(!0);T%2&&(f?c?o=!0:c=C:f=C),p[C]=[],N.connectedEdges().forEach(function(R){return p[C].push(R.id())})}else m[C]=[N.source().id(),N.target().id()]});var y={found:!1,trail:void 0};if(o)return y;if(c&&f)if(i){if(d&&c!=d)return y;d=c}else{if(d&&c!=d&&f!=d)return y;d||(d=c)}else d||(d=l[0].id());var x=function(C){for(var T=C,R=[C],A,D,L;p[T].length;)A=p[T].shift(),D=m[A][0],L=m[A][1],T!=L?(p[L]=p[L].filter(function(B){return B!=A}),T=L):!i&&T!=D&&(p[D]=p[D].filter(function(B){return B!=A}),T=D),R.unshift(A),R.unshift(T);return R},b=[],S=[];for(S=x(d);S.length!=1;)p[S[0]].length==0?(b.unshift(l.getElementById(S.shift())),b.unshift(l.getElementById(S.shift()))):S=x(S.shift()).concat(S);b.unshift(l.getElementById(S.shift()));for(var w in p)if(p[w].length)return y;return y.found=!0,y.trail=this.spawn(b,!0),y}},Sv=function(){var t=this,n={},r=0,a=0,i=[],l=[],o={},f=function(m,y){for(var x=l.length-1,b=[],S=t.spawn();l[x].x!=m||l[x].y!=y;)b.push(l.pop().edge),x--;b.push(l.pop().edge),b.forEach(function(w){var N=w.connectedNodes().intersection(t);S.merge(w),N.forEach(function(C){var T=C.id(),R=C.connectedEdges().intersection(t);S.merge(C),n[T].cutVertex?S.merge(R.filter(function(A){return A.isLoop()})):S.merge(R)})}),i.push(S)},c=function(m,y,x){m===x&&(a+=1),n[y]={id:r,low:r++,cutVertex:!1};var b=t.getElementById(y).connectedEdges().intersection(t);if(b.size()===0)i.push(t.spawn(t.getElementById(y)));else{var S,w,N,C;b.forEach(function(T){S=T.source().id(),w=T.target().id(),N=S===y?w:S,N!==x&&(C=T.id(),o[C]||(o[C]=!0,l.push({x:y,y:N,edge:T})),N in n?n[y].low=Math.min(n[y].low,n[N].id):(c(m,N,y),n[y].low=Math.min(n[y].low,n[N].low),n[y].id<=n[N].low&&(n[y].cutVertex=!0,f(y,N))))})}};t.forEach(function(p){if(p.isNode()){var m=p.id();m in n||(a=0,c(m,m),n[m].cutVertex=a>1)}});var d=Object.keys(n).filter(function(p){return n[p].cutVertex}).map(function(p){return t.getElementById(p)});return{cut:t.spawn(d),components:i}},QQ={hopcroftTarjanBiconnected:Sv,htbc:Sv,htb:Sv,hopcroftTarjanBiconnectedComponents:Sv},Ev=function(){var t=this,n={},r=0,a=[],i=[],l=t.spawn(t),o=function(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var d=t.getElementById(c).connectedEdges().intersection(t);if(d.forEach(function(b){var S=b.target().id();S!==c&&(S in n||o(S),n[S].explored||(n[c].low=Math.min(n[c].low,n[S].low)))}),n[c].index===n[c].low){for(var p=t.spawn();;){var m=i.pop();if(p.merge(t.getElementById(m)),n[m].low=n[c].index,n[m].explored=!0,m===c)break}var y=p.edgesWith(p),x=p.merge(y);a.push(x),l=l.difference(x)}};return t.forEach(function(f){if(f.isNode()){var c=f.id();c in n||o(c)}}),{cut:l,components:a}},WQ={tarjanStronglyConnected:Ev,tsc:Ev,tscc:Ev,tarjanStronglyConnectedComponents:Ev},AL={};[nd,TX,jX,RX,MX,LX,PX,cQ,Pu,zu,Kb,EQ,BQ,FQ,KQ,XQ,QQ,WQ].forEach(function(e){at(AL,e)});/*!
501
+ Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
502
+ Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
503
+ Licensed under The MIT License (http://opensource.org/licenses/MIT)
504
+ */var RL=0,DL=1,ML=2,$a=function(t){if(!(this instanceof $a))return new $a(t);this.id="Thenable/1.0.7",this.state=RL,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};$a.prototype={fulfill:function(t){return ST(this,DL,"fulfillValue",t)},reject:function(t){return ST(this,ML,"rejectReason",t)},then:function(t,n){var r=this,a=new $a;return r.onFulfilled.push(CT(t,a,"fulfill")),r.onRejected.push(CT(n,a,"reject")),OL(r),a.proxy}};var ST=function(t,n,r,a){return t.state===RL&&(t.state=n,t[r]=a,OL(t)),t},OL=function(t){t.state===DL?ET(t,"onFulfilled",t.fulfillValue):t.state===ML&&ET(t,"onRejected",t.rejectReason)},ET=function(t,n,r){if(t[n].length!==0){var a=t[n];t[n]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},CT=function(t,n,r){return function(a){if(typeof t!="function")n[r].call(n,a);else{var i;try{i=t(a)}catch(l){n.reject(l);return}LL(n,i)}}},LL=function(t,n){if(t===n||t.proxy===n){t.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Un(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){t.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?t.reject(new TypeError("circular thenable chain")):LL(t,i))},function(i){a||(a=!0,t.reject(i))})}catch(i){a||t.reject(i)}return}t.fulfill(n)};$a.all=function(e){return new $a(function(t,n){for(var r=new Array(e.length),a=0,i=function(f,c){r[f]=c,a++,a===e.length&&t(r)},l=0;l<e.length;l++)(function(o){var f=e[o],c=f!=null&&f.then!=null;if(c)f.then(function(p){i(o,p)},function(p){n(p)});else{var d=f;i(o,d)}})(l)})};$a.resolve=function(e){return new $a(function(t,n){t(e)})};$a.reject=function(e){return new $a(function(t,n){n(e)})};var bc=typeof Promise<"u"?Promise:$a,Qb=function(t,n,r){var a=kw(t),i=!a,l=this._private=at({duration:1e3},n,r);if(l.target=t,l.style=l.style||l.css,l.started=!1,l.playing=!1,l.hooked=!1,l.applying=!1,l.progress=0,l.completes=[],l.frames=[],l.complete&&mn(l.complete)&&l.completes.push(l.complete),i){var o=t.position();l.startPosition=l.startPosition||{x:o.x,y:o.y},l.startStyle=l.startStyle||t.cy().style().getAnimationStartStyle(t,l.style)}if(a){var f=t.pan();l.startPan={x:f.x,y:f.y},l.startZoom=t.zoom()}this.length=1,this[0]=this},Eo=Qb.prototype;at(Eo,{instanceString:function(){return"animation"},hook:function(){var t=this._private;if(!t.hooked){var n,r=t.target._private.animation;t.queue?n=r.queue:n=r.current,n.push(this),oa(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this},play:function(){var t=this._private;return t.progress===1&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var t=this._private;return t.playing=!1,t.started=!1,this},stop:function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(t){var n=this._private;return t===void 0?n.progress*n.duration:this.progress(t/n.duration)},progress:function(t){var n=this._private,r=n.playing;return t===void 0?n.progress:(r&&this.pause(),n.progress=t,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var t=this._private,n=t.playing;n&&this.pause(),t.progress=1-t.progress,t.started=!1;var r=function(c,d){var p=t[c];p!=null&&(t[c]=t[d],t[d]=p)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),t.style)for(var a=0;a<t.style.length;a++){var i=t.style[a],l=i.name,o=t.startStyle[l];t.startStyle[l]=i,t.style[a]=o}return n&&this.play(),this},promise:function(t){var n=this._private,r;switch(t){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new bc(function(a,i){r.push(function(){a()})})}});Eo.complete=Eo.completed;Eo.run=Eo.play;Eo.running=Eo.playing;var ZQ={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var l=a[0];if(l)return l._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var l=0;l<a.length;l++){var o=a[l];o._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this,f=!i,c=!f;if(!o.styleEnabled())return this;var d=o.style();n=at({},n,r);var p=Object.keys(n).length===0;if(p)return new Qb(l[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var m=n.renderedPosition,y=o.pan(),x=o.zoom();n.position=xL(m,x,y)}if(f&&n.panBy!=null){var b=n.panBy,S=o.pan();n.pan={x:S.x+b.x,y:S.y+b.y}}var w=n.center||n.centre;if(f&&w!=null){var N=o.getCenterPan(w.eles,n.zoom);N!=null&&(n.pan=N)}if(f&&n.fit!=null){var C=n.fit,T=o.getFitViewport(C.eles||C.boundingBox,C.padding);T!=null&&(n.pan=T.pan,n.zoom=T.zoom)}if(f&&Dt(n.zoom)){var R=o.getZoomedViewport(n.zoom);R!=null?(R.zoomed&&(n.zoom=R.zoom),R.panned&&(n.pan=R.pan)):n.zoom=null}return new Qb(l[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;r&&(n=at({},n,r));for(var f=0;f<l.length;f++){var c=l[f],d=c.animated()&&(n.queue===void 0||n.queue),p=c.animation(n,d?{queue:!0}:void 0);p.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var f=0;f<l.length;f++){for(var c=l[f],d=c._private,p=d.animation.current,m=0;m<p.length;m++){var y=p[m],x=y._private;r&&(x.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return o.notify("draw"),this}}},Lx,NT;function im(){if(NT)return Lx;NT=1;var e=Array.isArray;return Lx=e,Lx}var _x,kT;function JQ(){if(kT)return _x;kT=1;var e=im(),t=Pd(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,l){if(e(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||l!=null&&i in Object(l)}return _x=a,_x}var Bx,TT;function eW(){if(TT)return Bx;TT=1;var e=cL(),t=Bd(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function l(o){if(!t(o))return!1;var f=e(o);return f==r||f==a||f==n||f==i}return Bx=l,Bx}var Px,jT;function tW(){if(jT)return Px;jT=1;var e=tm(),t=e["__core-js_shared__"];return Px=t,Px}var zx,AT;function nW(){if(AT)return zx;AT=1;var e=tW(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return zx=n,zx}var Ix,RT;function rW(){if(RT)return Ix;RT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ix=n,Ix}var Fx,DT;function aW(){if(DT)return Fx;DT=1;var e=eW(),t=nW(),n=Bd(),r=rW(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,l=Function.prototype,o=Object.prototype,f=l.toString,c=o.hasOwnProperty,d=RegExp("^"+f.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!n(m)||t(m))return!1;var y=e(m)?d:i;return y.test(r(m))}return Fx=p,Fx}var qx,MT;function iW(){if(MT)return qx;MT=1;function e(t,n){return t==null?void 0:t[n]}return qx=e,qx}var Ux,OT;function Pw(){if(OT)return Ux;OT=1;var e=aW(),t=iW();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Ux=n,Ux}var Vx,LT;function sm(){if(LT)return Vx;LT=1;var e=Pw(),t=e(Object,"create");return Vx=t,Vx}var Hx,_T;function sW(){if(_T)return Hx;_T=1;var e=sm();function t(){this.__data__=e?e(null):{},this.size=0}return Hx=t,Hx}var $x,BT;function lW(){if(BT)return $x;BT=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return $x=e,$x}var Gx,PT;function oW(){if(PT)return Gx;PT=1;var e=sm(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var l=this.__data__;if(e){var o=l[i];return o===t?void 0:o}return r.call(l,i)?l[i]:void 0}return Gx=a,Gx}var Kx,zT;function uW(){if(zT)return Kx;zT=1;var e=sm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Kx=r,Kx}var Yx,IT;function cW(){if(IT)return Yx;IT=1;var e=sm(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Yx=n,Yx}var Xx,FT;function fW(){if(FT)return Xx;FT=1;var e=sW(),t=lW(),n=oW(),r=uW(),a=cW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Xx=i,Xx}var Qx,qT;function dW(){if(qT)return Qx;qT=1;function e(){this.__data__=[],this.size=0}return Qx=e,Qx}var Wx,UT;function _L(){if(UT)return Wx;UT=1;function e(t,n){return t===n||t!==t&&n!==n}return Wx=e,Wx}var Zx,VT;function lm(){if(VT)return Zx;VT=1;var e=_L();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Zx=t,Zx}var Jx,HT;function hW(){if(HT)return Jx;HT=1;var e=lm(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,l=e(i,a);if(l<0)return!1;var o=i.length-1;return l==o?i.pop():n.call(i,l,1),--this.size,!0}return Jx=r,Jx}var e0,$T;function vW(){if($T)return e0;$T=1;var e=lm();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return e0=t,e0}var t0,GT;function pW(){if(GT)return t0;GT=1;var e=lm();function t(n){return e(this.__data__,n)>-1}return t0=t,t0}var n0,KT;function mW(){if(KT)return n0;KT=1;var e=lm();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return n0=t,n0}var r0,YT;function gW(){if(YT)return r0;YT=1;var e=dW(),t=hW(),n=vW(),r=pW(),a=mW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,r0=i,r0}var a0,XT;function yW(){if(XT)return a0;XT=1;var e=Pw(),t=tm(),n=e(t,"Map");return a0=n,a0}var i0,QT;function xW(){if(QT)return i0;QT=1;var e=fW(),t=gW(),n=yW();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return i0=r,i0}var s0,WT;function bW(){if(WT)return s0;WT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return s0=e,s0}var l0,ZT;function om(){if(ZT)return l0;ZT=1;var e=bW();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return l0=t,l0}var o0,JT;function wW(){if(JT)return o0;JT=1;var e=om();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return o0=t,o0}var u0,ej;function SW(){if(ej)return u0;ej=1;var e=om();function t(n){return e(this,n).get(n)}return u0=t,u0}var c0,tj;function EW(){if(tj)return c0;tj=1;var e=om();function t(n){return e(this,n).has(n)}return c0=t,c0}var f0,nj;function CW(){if(nj)return f0;nj=1;var e=om();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return f0=t,f0}var d0,rj;function NW(){if(rj)return d0;rj=1;var e=xW(),t=wW(),n=SW(),r=EW(),a=CW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,d0=i,d0}var h0,aj;function kW(){if(aj)return h0;aj=1;var e=NW(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var l=arguments,o=a?a.apply(this,l):l[0],f=i.cache;if(f.has(o))return f.get(o);var c=r.apply(this,l);return i.cache=f.set(o,c)||f,c};return i.cache=new(n.Cache||e),i}return n.Cache=e,h0=n,h0}var v0,ij;function TW(){if(ij)return v0;ij=1;var e=kW(),t=500;function n(r){var a=e(r,function(l){return i.size===t&&i.clear(),l}),i=a.cache;return a}return v0=n,v0}var p0,sj;function BL(){if(sj)return p0;sj=1;var e=TW(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(l,o,f,c){i.push(f?c.replace(n,"$1"):o||l)}),i});return p0=r,p0}var m0,lj;function PL(){if(lj)return m0;lj=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return m0=e,m0}var g0,oj;function jW(){if(oj)return g0;oj=1;var e=jw(),t=PL(),n=im(),r=Pd(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function l(o){if(typeof o=="string")return o;if(n(o))return t(o,l)+"";if(r(o))return i?i.call(o):"";var f=o+"";return f=="0"&&1/o==-1/0?"-0":f}return g0=l,g0}var y0,uj;function zL(){if(uj)return y0;uj=1;var e=jW();function t(n){return n==null?"":e(n)}return y0=t,y0}var x0,cj;function IL(){if(cj)return x0;cj=1;var e=im(),t=JQ(),n=BL(),r=zL();function a(i,l){return e(i)?i:t(i,l)?[i]:n(r(i))}return x0=a,x0}var b0,fj;function zw(){if(fj)return b0;fj=1;var e=Pd();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return b0=t,b0}var w0,dj;function AW(){if(dj)return w0;dj=1;var e=IL(),t=zw();function n(r,a){a=e(a,r);for(var i=0,l=a.length;r!=null&&i<l;)r=r[t(a[i++])];return i&&i==l?r:void 0}return w0=n,w0}var S0,hj;function RW(){if(hj)return S0;hj=1;var e=AW();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return S0=t,S0}var DW=RW(),MW=_d(DW),E0,vj;function OW(){if(vj)return E0;vj=1;var e=Pw(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return E0=t,E0}var C0,pj;function LW(){if(pj)return C0;pj=1;var e=OW();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return C0=t,C0}var N0,mj;function _W(){if(mj)return N0;mj=1;var e=LW(),t=_L(),n=Object.prototype,r=n.hasOwnProperty;function a(i,l,o){var f=i[l];(!(r.call(i,l)&&t(f,o))||o===void 0&&!(l in i))&&e(i,l,o)}return N0=a,N0}var k0,gj;function BW(){if(gj)return k0;gj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return k0=n,k0}var T0,yj;function PW(){if(yj)return T0;yj=1;var e=_W(),t=IL(),n=BW(),r=Bd(),a=zw();function i(l,o,f,c){if(!r(l))return l;o=t(o,l);for(var d=-1,p=o.length,m=p-1,y=l;y!=null&&++d<p;){var x=a(o[d]),b=f;if(x==="__proto__"||x==="constructor"||x==="prototype")return l;if(d!=m){var S=y[x];b=c?c(S,x,y):void 0,b===void 0&&(b=r(S)?S:n(o[d+1])?[]:{})}e(y,x,b),y=y[x]}return l}return T0=i,T0}var j0,xj;function zW(){if(xj)return j0;xj=1;var e=PW();function t(n,r,a){return n==null?n:e(n,r,a)}return j0=t,j0}var IW=zW(),FW=_d(IW),A0,bj;function qW(){if(bj)return A0;bj=1;function e(t,n){var r=-1,a=t.length;for(n||(n=Array(a));++r<a;)n[r]=t[r];return n}return A0=e,A0}var R0,wj;function UW(){if(wj)return R0;wj=1;var e=PL(),t=qW(),n=im(),r=Pd(),a=BL(),i=zw(),l=zL();function o(f){return n(f)?e(f,i):r(f)?[f]:t(a(l(f)))}return R0=o,R0}var VW=UW(),HW=_d(VW),$W={data:function(t){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return t=at({},n,t),function(a,i){var l=t,o=this,f=o.length!==void 0,c=f?o:[o],d=f?o[0]:o;if(tt(a)){var p=a.indexOf(".")!==-1,m=p&&HW(a);if(l.allowGetting&&i===void 0){var y;return d&&(l.beforeGet(d),m&&d._private[l.field][a]===void 0?y=MW(d._private[l.field],m):y=d._private[l.field][a]),y}else if(l.allowSetting&&i!==void 0){var x=!l.immutableKeys[a];if(x){var b=eL({},a,i);l.beforeSet(o,b);for(var S=0,w=c.length;S<w;S++){var N=c[S];l.canSet(N)&&(m&&d._private[l.field][a]===void 0?FW(N._private[l.field],m,i):N._private[l.field][a]=i)}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}}}else if(l.allowSetting&&Dt(a)){var C=a,T,R,A=Object.keys(C);l.beforeSet(o,C);for(var D=0;D<A.length;D++){T=A[D],R=C[T];var L=!l.immutableKeys[T];if(L)for(var B=0;B<c.length;B++){var M=c[B];l.canSet(M)&&(M._private[l.field][T]=R)}}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}else if(l.allowBinding&&mn(a)){var _=a;o.on(l.bindingEvent,_)}else if(l.allowGetting&&a===void 0){var P;return d&&(l.beforeGet(d),P=d._private[l.field]),P}return o}},removeData:function(t){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=at({},n,t),function(a){var i=t,l=this,o=l.length!==void 0,f=o?l:[l];if(tt(a)){for(var c=a.split(/\s+/),d=c.length,p=0;p<d;p++){var m=c[p];if(!pl(m)){var y=!i.immutableKeys[m];if(y)for(var x=0,b=f.length;x<b;x++)f[x]._private[i.field][m]=void 0}}i.triggerEvent&&l[i.triggerFnName](i.event)}else if(a===void 0){for(var S=0,w=f.length;S<w;S++)for(var N=f[S]._private[i.field],C=Object.keys(N),T=0;T<C.length;T++){var R=C[T],A=!i.immutableKeys[R];A&&(N[R]=void 0)}i.triggerEvent&&l[i.triggerFnName](i.event)}return l}}},GW={eventAliasesOn:function(t){var n=t;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,l=Array.prototype.slice.call(arguments,0);return new bc(function(o,f){var c=function(y){i.off.apply(i,p),o(y)},d=l.concat([c]),p=d.concat([]);i.on.apply(i,d)})}}},Pt={};[ZQ,$W,GW].forEach(function(e){at(Pt,e)});var KW={animate:Pt.animate(),animation:Pt.animation(),animated:Pt.animated(),clearQueue:Pt.clearQueue(),delay:Pt.delay(),delayAnimation:Pt.delayAnimation(),stop:Pt.stop()},$v={classes:function(t){var n=this;if(t===void 0){var r=[];return n[0]._private.classes.forEach(function(x){return r.push(x)}),r}else Yt(t)||(t=(t||"").match(/\S+/g)||[]);for(var a=[],i=new xc(t),l=0;l<n.length;l++){for(var o=n[l],f=o._private,c=f.classes,d=!1,p=0;p<t.length;p++){var m=t[p],y=c.has(m);if(!y){d=!0;break}}d||(d=c.size!==t.length),d&&(f.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(t){return this.toggleClass(t,!0)},hasClass:function(t){var n=this[0];return n!=null&&n._private.classes.has(t)},toggleClass:function(t,n){Yt(t)||(t=t.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],l=0,o=r.length;l<o;l++)for(var f=r[l],c=f._private.classes,d=!1,p=0;p<t.length;p++){var m=t[p],y=c.has(m),x=!1;n||a&&!y?(c.add(m),x=!0):(!n||a&&y)&&(c.delete(m),x=!0),!d&&x&&(i.push(f),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(t){return this.toggleClass(t,!1)},flashClass:function(t,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(t),setTimeout(function(){r.removeClass(t)},n),r}};$v.className=$v.classNames=$v.classes;var Rt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Fn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Rt.variable="(?:[\\w-.]|(?:\\\\"+Rt.metaChar+"))+";Rt.className="(?:[\\w-]|(?:\\\\"+Rt.metaChar+"))+";Rt.value=Rt.string+"|"+Rt.number;Rt.id=Rt.variable;(function(){var e,t,n;for(e=Rt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],Rt.comparatorOp+="|@"+t;for(e=Rt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],!(t.indexOf("!")>=0)&&t!=="="&&(Rt.comparatorOp+="|\\!"+t)})();var Gt=function(){return{checks:[]}},Ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Wb=[{selector:":selected",matches:function(t){return t.selected()}},{selector:":unselected",matches:function(t){return!t.selected()}},{selector:":selectable",matches:function(t){return t.selectable()}},{selector:":unselectable",matches:function(t){return!t.selectable()}},{selector:":locked",matches:function(t){return t.locked()}},{selector:":unlocked",matches:function(t){return!t.locked()}},{selector:":visible",matches:function(t){return t.visible()}},{selector:":hidden",matches:function(t){return!t.visible()}},{selector:":transparent",matches:function(t){return t.transparent()}},{selector:":grabbed",matches:function(t){return t.grabbed()}},{selector:":free",matches:function(t){return!t.grabbed()}},{selector:":removed",matches:function(t){return t.removed()}},{selector:":inside",matches:function(t){return!t.removed()}},{selector:":grabbable",matches:function(t){return t.grabbable()}},{selector:":ungrabbable",matches:function(t){return!t.grabbable()}},{selector:":animated",matches:function(t){return t.animated()}},{selector:":unanimated",matches:function(t){return!t.animated()}},{selector:":parent",matches:function(t){return t.isParent()}},{selector:":childless",matches:function(t){return t.isChildless()}},{selector:":child",matches:function(t){return t.isChild()}},{selector:":orphan",matches:function(t){return t.isOrphan()}},{selector:":nonorphan",matches:function(t){return t.isChild()}},{selector:":compound",matches:function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}},{selector:":loop",matches:function(t){return t.isLoop()}},{selector:":simple",matches:function(t){return t.isSimple()}},{selector:":active",matches:function(t){return t.active()}},{selector:":inactive",matches:function(t){return!t.active()}},{selector:":backgrounding",matches:function(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function(t){return!t.backgrounding()}}].sort(function(e,t){return $Y(e.selector,t.selector)}),YW=(function(){for(var e={},t,n=0;n<Wb.length;n++)t=Wb[n],e[t.selector]=t.matches;return e})(),XW=function(t,n){return YW[t](n)},QW="("+Wb.map(function(e){return e.selector}).join("|")+")",gu=function(t){return t.replace(new RegExp("\\\\("+Rt.metaChar+")","g"),function(n,r){return r})},Hs=function(t,n,r){t[t.length-1]=r},Zb=[{name:"group",query:!0,regex:"("+Rt.group+")",populate:function(t,n,r){var a=_n(r,1),i=a[0];n.checks.push({type:Ue.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:QW,populate:function(t,n,r){var a=_n(r,1),i=a[0];n.checks.push({type:Ue.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Rt.id+")",populate:function(t,n,r){var a=_n(r,1),i=a[0];n.checks.push({type:Ue.ID,value:gu(i)})}},{name:"className",query:!0,regex:"\\.("+Rt.className+")",populate:function(t,n,r){var a=_n(r,1),i=a[0];n.checks.push({type:Ue.CLASS,value:gu(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=_n(r,1),i=a[0];n.checks.push({type:Ue.DATA_EXIST,field:gu(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*("+Rt.comparatorOp+")\\s*("+Rt.value+")\\s*\\]",populate:function(t,n,r){var a=_n(r,3),i=a[0],l=a[1],o=a[2],f=new RegExp("^"+Rt.string+"$").exec(o)!=null;f?o=o.substring(1,o.length-1):o=parseFloat(o),n.checks.push({type:Ue.DATA_COMPARE,field:gu(i),operator:l,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Rt.boolOp+")\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=_n(r,2),i=a[0],l=a[1];n.checks.push({type:Ue.DATA_BOOL,field:gu(l),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Rt.meta+")\\s*("+Rt.comparatorOp+")\\s*("+Rt.number+")\\s*\\]\\]",populate:function(t,n,r){var a=_n(r,3),i=a[0],l=a[1],o=a[2];n.checks.push({type:Ue.META_COMPARE,field:gu(i),operator:l,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Rt.separator,populate:function(t,n){var r=t.currentSubject,a=t.edgeCount,i=t.compoundCount,l=t[t.length-1];r!=null&&(l.subject=r,t.currentSubject=null),l.edgeCount=a,l.compoundCount=i,t.edgeCount=0,t.compoundCount=0;var o=t[t.length++]=Gt();return o}},{name:"directedEdge",separator:!0,regex:Rt.directedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Gt(),a=n,i=Gt();return r.checks.push({type:Ue.DIRECTED_EDGE,source:a,target:i}),Hs(t,n,r),t.edgeCount++,i}else{var l=Gt(),o=n,f=Gt();return l.checks.push({type:Ue.NODE_SOURCE,source:o,target:f}),Hs(t,n,l),t.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:Rt.undirectedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Gt(),a=n,i=Gt();return r.checks.push({type:Ue.UNDIRECTED_EDGE,nodes:[a,i]}),Hs(t,n,r),t.edgeCount++,i}else{var l=Gt(),o=n,f=Gt();return l.checks.push({type:Ue.NODE_NEIGHBOR,node:o,neighbor:f}),Hs(t,n,l),f}}},{name:"child",separator:!0,regex:Rt.child,populate:function(t,n){if(t.currentSubject==null){var r=Gt(),a=Gt(),i=t[t.length-1];return r.checks.push({type:Ue.CHILD,parent:i,child:a}),Hs(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Gt(),o=t[t.length-1],f=Gt(),c=Gt(),d=Gt(),p=Gt();return l.checks.push({type:Ue.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Ue.TRUE}],p.checks.push({type:Ue.TRUE}),f.checks.push({type:Ue.PARENT,parent:p,child:d}),Hs(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=Gt(),y=Gt(),x=[{type:Ue.PARENT,parent:m,child:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"descendant",separator:!0,regex:Rt.descendant,populate:function(t,n){if(t.currentSubject==null){var r=Gt(),a=Gt(),i=t[t.length-1];return r.checks.push({type:Ue.DESCENDANT,ancestor:i,descendant:a}),Hs(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Gt(),o=t[t.length-1],f=Gt(),c=Gt(),d=Gt(),p=Gt();return l.checks.push({type:Ue.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Ue.TRUE}],p.checks.push({type:Ue.TRUE}),f.checks.push({type:Ue.ANCESTOR,ancestor:p,descendant:d}),Hs(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=Gt(),y=Gt(),x=[{type:Ue.ANCESTOR,ancestor:m,descendant:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"subject",modifier:!0,regex:Rt.subject,populate:function(t,n){if(t.currentSubject!=null&&t.currentSubject!==n)return zt("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=n;var r=t[t.length-1],a=r.checks[0],i=a==null?null:a.type;i===Ue.DIRECTED_EDGE?a.type=Ue.NODE_TARGET:i===Ue.UNDIRECTED_EDGE&&(a.type=Ue.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Zb.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});var WW=function(t){for(var n,r,a,i=0;i<Zb.length;i++){var l=Zb[i],o=l.name,f=t.match(l.regexObj);if(f!=null){r=f,n=l,a=o;var c=f[0];t=t.substring(c.length);break}}return{expr:n,match:r,name:a,remaining:t}},ZW=function(t){var n=t.match(/^\s+/);if(n){var r=n[0];t=t.substring(r.length)}return t},JW=function(t){var n=this,r=n.inputText=t,a=n[0]=Gt();for(n.length=1,r=ZW(r);;){var i=WW(r);if(i.expr==null)return zt("The selector `"+t+"`is invalid"),!1;var l=i.match.slice(1),o=i.expr.populate(n,a,l);if(o===!1)return!1;if(o!=null&&(a=o),r=i.remaining,r.match(/^\s*$/))break}var f=n[n.length-1];n.currentSubject!=null&&(f.subject=n.currentSubject),f.edgeCount=n.edgeCount,f.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var d=n[c];if(d.compoundCount>0&&d.edgeCount>0)return zt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return zt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&zt("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},eZ=function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=function(d){return d??""},n=function(d){return tt(d)?'"'+d+'"':t(d)},r=function(d){return" "+d+" "},a=function(d,p){var m=d.type,y=d.value;switch(m){case Ue.GROUP:{var x=t(y);return x.substring(0,x.length-1)}case Ue.DATA_COMPARE:{var b=d.field,S=d.operator;return"["+b+r(t(S))+n(y)+"]"}case Ue.DATA_BOOL:{var w=d.operator,N=d.field;return"["+t(w)+N+"]"}case Ue.DATA_EXIST:{var C=d.field;return"["+C+"]"}case Ue.META_COMPARE:{var T=d.operator,R=d.field;return"[["+R+r(t(T))+n(y)+"]]"}case Ue.STATE:return y;case Ue.ID:return"#"+y;case Ue.CLASS:return"."+y;case Ue.PARENT:case Ue.CHILD:return i(d.parent,p)+r(">")+i(d.child,p);case Ue.ANCESTOR:case Ue.DESCENDANT:return i(d.ancestor,p)+" "+i(d.descendant,p);case Ue.COMPOUND_SPLIT:{var A=i(d.left,p),D=i(d.subject,p),L=i(d.right,p);return A+(A.length>0?" ":"")+D+L}case Ue.TRUE:return""}},i=function(d,p){return d.checks.reduce(function(m,y,x){return m+(p===d&&x===0?"$":"")+a(y,p)},"")},l="",o=0;o<this.length;o++){var f=this[o];l+=i(f,f.subject),this.length>1&&o<this.length-1&&(l+=", ")}return this.toStringCache=l,l},tZ={parse:JW,toString:eZ},FL=function(t,n,r){var a,i=tt(t),l=Ae(t),o=tt(r),f,c,d=!1,p=!1,m=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),p=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||o||d)&&(f=!i&&!l?"":""+t,c=""+r),d&&(t=f=f.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":a=f.indexOf(c)>=0;break;case"$=":a=f.indexOf(c,f.length-c.length)>=0;break;case"^=":a=f.indexOf(c)===0;break;case"=":a=t===r;break;case">":m=!0,a=t>r;break;case">=":m=!0,a=t>=r;break;case"<":m=!0,a=t<r;break;case"<=":m=!0,a=t<=r;break;default:a=!1;break}return p&&(t!=null||!m)&&(a=!a),a},nZ=function(t,n){switch(n){case"?":return!!t;case"!":return!t;case"^":return t===void 0}},rZ=function(t){return t!==void 0},Iw=function(t,n){return t.data(n)},aZ=function(t,n){return t[n]()},wn=[],ln=function(t,n){return t.checks.every(function(r){return wn[r.type](r,n)})};wn[Ue.GROUP]=function(e,t){var n=e.value;return n==="*"||n===t.group()};wn[Ue.STATE]=function(e,t){var n=e.value;return XW(n,t)};wn[Ue.ID]=function(e,t){var n=e.value;return t.id()===n};wn[Ue.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)};wn[Ue.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return FL(aZ(t,n),r,a)};wn[Ue.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return FL(Iw(t,n),r,a)};wn[Ue.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return nZ(Iw(t,n),r)};wn[Ue.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,rZ(Iw(t,n))};wn[Ue.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],a=t.source(),i=t.target();return ln(n,a)&&ln(r,i)||ln(r,a)&&ln(n,i)};wn[Ue.NODE_NEIGHBOR]=function(e,t){return ln(e.node,t)&&t.neighborhood().some(function(n){return n.isNode()&&ln(e.neighbor,n)})};wn[Ue.DIRECTED_EDGE]=function(e,t){return ln(e.source,t.source())&&ln(e.target,t.target())};wn[Ue.NODE_SOURCE]=function(e,t){return ln(e.source,t)&&t.outgoers().some(function(n){return n.isNode()&&ln(e.target,n)})};wn[Ue.NODE_TARGET]=function(e,t){return ln(e.target,t)&&t.incomers().some(function(n){return n.isNode()&&ln(e.source,n)})};wn[Ue.CHILD]=function(e,t){return ln(e.child,t)&&ln(e.parent,t.parent())};wn[Ue.PARENT]=function(e,t){return ln(e.parent,t)&&t.children().some(function(n){return ln(e.child,n)})};wn[Ue.DESCENDANT]=function(e,t){return ln(e.descendant,t)&&t.ancestors().some(function(n){return ln(e.ancestor,n)})};wn[Ue.ANCESTOR]=function(e,t){return ln(e.ancestor,t)&&t.descendants().some(function(n){return ln(e.descendant,n)})};wn[Ue.COMPOUND_SPLIT]=function(e,t){return ln(e.subject,t)&&ln(e.left,t)&&ln(e.right,t)};wn[Ue.TRUE]=function(){return!0};wn[Ue.COLLECTION]=function(e,t){var n=e.value;return n.has(t)};wn[Ue.FILTER]=function(e,t){var n=e.value;return n(t)};var iZ=function(t){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===Ue.ID)return t.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var l=0;l<n.length;l++){var o=n[l];if(ln(o,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),t.filter(r)},sZ=function(t){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(ln(a,t))return!0}return!1},lZ={matches:sZ,filter:iZ},yl=function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,t==null||tt(t)&&t.match(/^\s*$/)||(oa(t)?this.addQuery({checks:[{type:Ue.COLLECTION,value:t.collection()}]}):mn(t)?this.addQuery({checks:[{type:Ue.FILTER,value:t}]}):tt(t)?this.parse(t)||(this.invalid=!0):fn("A selector must be created from a string; found "))},xl=yl.prototype;[tZ,lZ].forEach(function(e){return at(xl,e)});xl.text=function(){return this.inputText};xl.size=function(){return this.length};xl.eq=function(e){return this[e]};xl.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};xl.addQuery=function(e){this[this.length++]=e};xl.selector=xl.toString;var ul={allAre:function(t){var n=new yl(t);return this.every(function(r){return n.matches(r)})},is:function(t){var n=new yl(t);return this.some(function(r){return n.matches(r)})},some:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(a)return!0}return!1},every:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(!a)return!1}return!0},same:function(t){if(this===t)return!0;t=this.cy().collection(t);var n=this.length,r=t.length;return n!==r?!1:n===1?this[0]===t[0]:this.every(function(a){return t.hasElementWithId(a.id())})},anySame:function(t){return t=this.cy().collection(t),this.some(function(n){return t.hasElementWithId(n.id())})},allAreNeighbors:function(t){t=this.cy().collection(t);var n=this.neighborhood();return t.every(function(r){return n.hasElementWithId(r.id())})},contains:function(t){t=this.cy().collection(t);var n=this;return t.every(function(r){return n.hasElementWithId(r.id())})}};ul.allAreNeighbours=ul.allAreNeighbors;ul.has=ul.contains;ul.equal=ul.equals=ul.same;var Da=function(t,n){return function(a,i,l,o){var f=a,c=this,d;if(f==null?d="":oa(f)&&f.length===1&&(d=f.id()),c.length===1&&d){var p=c[0]._private,m=p.traversalCache=p.traversalCache||{},y=m[n]=m[n]||[],x=wo(d),b=y[x];return b||(y[x]=t.call(c,a,i,l,o))}else return t.call(c,a,i,l,o)}},rc={parent:function(t){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],l=i._private.parent;l&&n.push(l)}return this.spawn(n,!0).filter(t)},parents:function(t){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(t)},commonAncestors:function(t){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(t)},orphans:function(t){return this.stdFilter(function(n){return n.isOrphan()}).filter(t)},nonorphans:function(t){return this.stdFilter(function(n){return n.isChild()}).filter(t)},children:Da(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)t.push(a[i]);return this.spawn(t,!0).filter(e)},"children"),siblings:function(t){return this.parent().children().not(this).filter(t)},isParent:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length!==0},isChildless:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length===0},isChild:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent!=null},isOrphan:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent==null},descendants:function(t){var n=[];function r(a){for(var i=0;i<a.length;i++){var l=a[i];n.push(l),l.children().nonempty()&&r(l.children())}}return r(this.children()),this.spawn(n,!0).filter(t)}};function Fw(e,t,n,r){for(var a=[],i=new xc,l=e.cy(),o=l.hasCompoundNodes(),f=0;f<e.length;f++){var c=e[f];n?a.push(c):o&&r(a,i,c)}for(;a.length>0;){var d=a.shift();t(d),i.add(d.id()),o&&r(a,i,d)}return e}function qL(e,t,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];t.has(i.id())||e.push(i)}}rc.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fw(this,e,t,qL)};function UL(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}rc.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fw(this,e,t,UL)};function oZ(e,t,n){UL(e,t,n),qL(e,t,n)}rc.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fw(this,e,t,oZ)};rc.ancestors=rc.parents;var id,VL;id=VL={data:Pt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Pt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Pt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Pt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Pt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Pt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var t=this[0];if(t)return t._private.data.id}};id.attr=id.data;id.removeAttr=id.removeData;var uZ=VL,um={};function D0(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,l=0;l<i.length;l++){var o=i[l];!t&&o.isLoop()||(r+=e(a,o))}return r}else return}}at(um,{degree:D0(function(e,t){return t.source().same(t.target())?2:1}),indegree:D0(function(e,t){return t.target().same(e)?1:0}),outdegree:D0(function(e,t){return t.source().same(e)?1:0})});function yu(e,t){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var l=a[i],o=l[e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}at(um,{minDegree:yu("degree",function(e,t){return e<t}),maxDegree:yu("degree",function(e,t){return e>t}),minIndegree:yu("indegree",function(e,t){return e<t}),maxIndegree:yu("indegree",function(e,t){return e>t}),minOutdegree:yu("outdegree",function(e,t){return e<t}),maxOutdegree:yu("outdegree",function(e,t){return e>t})});at(um,{totalDegree:function(t){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(t);return n}});var qa,HL,$L=function(t,n,r){for(var a=0;a<t.length;a++){var i=t[a];if(!i.locked()){var l=i._private.position,o={x:n.x!=null?n.x-l.x:0,y:n.y!=null?n.y-l.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,r),i.dirtyBoundingBoxCache()}}},Sj={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(t){t.updateCompoundBounds()},beforeSet:function(t,n){$L(t,n,!1)},onSet:function(t){t.dirtyCompoundBoundsCache()},canSet:function(t){return!t.locked()}};qa=HL={position:Pt.data(Sj),silentPosition:Pt.data(at({},Sj,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(t,n){$L(t,n,!0)},onSet:function(t){t.dirtyCompoundBoundsCache()}})),positions:function(t,n){if(Dt(t))n?this.silentPosition(t):this.position(t);else if(mn(t)){var r=t,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var l=this[i],o=void 0;(o=r(l,i))&&(n?l.silentPosition(o):l.position(o))}a.endBatch()}return this},silentPositions:function(t){return this.positions(t,!0)},shift:function(t,n,r){var a;if(Dt(t)?(a={x:Ae(t.x)?t.x:0,y:Ae(t.y)?t.y:0},r=n):tt(t)&&Ae(n)&&(a={x:0,y:0},a[t]=n),a!=null){var i=this.cy();i.startBatch();for(var l=0;l<this.length;l++){var o=this[l];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var f=o.position(),c={x:f.x+a.x,y:f.y+a.y};r?o.silentPosition(c):o.position(c)}}i.endBatch()}return this},silentShift:function(t,n){return Dt(t)?this.shift(t,!0):tt(t)&&Ae(n)&&this.shift(t,n,!0),this},renderedPosition:function(t,n){var r=this[0],a=this.cy(),i=a.zoom(),l=a.pan(),o=Dt(t)?t:void 0,f=o!==void 0||n!==void 0&&tt(t);if(r&&r.isNode())if(f)for(var c=0;c<this.length;c++){var d=this[c];n!==void 0?d.position(t,(n-l[t])/i):o!==void 0&&d.position(xL(o,i,l))}else{var p=r.position();return o=rm(p,i,l),t===void 0?o:o[t]}else if(!f)return;return this},relativePosition:function(t,n){var r=this[0],a=this.cy(),i=Dt(t)?t:void 0,l=i!==void 0||n!==void 0&&tt(t),o=a.hasCompoundNodes();if(r&&r.isNode())if(l)for(var f=0;f<this.length;f++){var c=this[f],d=o?c.parent():null,p=d&&d.length>0,m=p;p&&(d=d[0]);var y=m?d.position():{x:0,y:0};n!==void 0?c.position(t,n+y[t]):i!==void 0&&c.position({x:i.x+y.x,y:i.y+y.y})}else{var x=r.position(),b=o?r.parent():null,S=b&&b.length>0,w=S;S&&(b=b[0]);var N=w?b.position():{x:0,y:0};return i={x:x.x-N.x,y:x.y-N.y},t===void 0?i:i[t]}else if(!l)return;return this}};qa.modelPosition=qa.point=qa.position;qa.modelPositions=qa.points=qa.positions;qa.renderedPoint=qa.renderedPosition;qa.relativePoint=qa.relativePosition;var cZ=HL,Iu,kl;Iu=kl={};kl.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),a=n.pan(),i=t.x1*r+a.x,l=t.x2*r+a.x,o=t.y1*r+a.y,f=t.y2*r+a.y;return{x1:i,x2:l,y1:o,y2:f,w:l-i,h:f-o}};kl.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,e||n.emitAndNotify("bounds")}}),this)};kl.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(l){if(!l.isParent())return;var o=l._private,f=l.children(),c=l.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:l.pstyle("min-width").pfValue,left:l.pstyle("min-width-bias-left"),right:l.pstyle("min-width-bias-right")},height:{val:l.pstyle("min-height").pfValue,top:l.pstyle("min-height-bias-top"),bottom:l.pstyle("min-height-bias-bottom")}},p=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),m=o.position;(p.w===0||p.h===0)&&(p={w:l.pstyle("width").pfValue,h:l.pstyle("height").pfValue},p.x1=m.x-p.w/2,p.x2=m.x+p.w/2,p.y1=m.y-p.h/2,p.y2=m.y+p.h/2);function y(B,M,_){var P=0,H=0,$=M+_;return B>0&&$>0&&(P=M/$*B,H=_/$*B),{biasDiff:P,biasComplementDiff:H}}function x(B,M,_,P){if(_.units==="%")switch(P){case"width":return B>0?_.pfValue*B:0;case"height":return M>0?_.pfValue*M:0;case"average":return B>0&&M>0?_.pfValue*(B+M)/2:0;case"min":return B>0&&M>0?B>M?_.pfValue*M:_.pfValue*B:0;case"max":return B>0&&M>0?B>M?_.pfValue*B:_.pfValue*M:0;default:return 0}else return _.units==="px"?_.pfValue:0}var b=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(b=b*100/d.width.val);var S=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(S=S*100/d.width.val);var w=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(w=w*100/d.height.val);var N=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(N=N*100/d.height.val);var C=y(d.width.val-p.w,b,S),T=C.biasDiff,R=C.biasComplementDiff,A=y(d.height.val-p.h,w,N),D=A.biasDiff,L=A.biasComplementDiff;o.autoPadding=x(p.w,p.h,l.pstyle("padding"),l.pstyle("padding-relative-to").value),o.autoWidth=Math.max(p.w,d.width.val),m.x=(-T+p.x1+p.x2+R)/2,o.autoHeight=Math.max(p.h,d.height.val),m.y=(-D+p.y1+p.y2+L)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||e)&&(n(a),t.batching()||(i.compoundBoundsClean=!0))}return this};var Aa=function(t){return t===1/0||t===-1/0?0:t},Ia=function(t,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(t.x1=n<t.x1?n:t.x1,t.x2=a>t.x2?a:t.x2,t.y1=r<t.y1?r:t.y1,t.y2=i>t.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)},Ys=function(t,n){return n==null?t:Ia(t,n.x1,n.y1,n.x2,n.y2)},Tf=function(t,n,r){return Vr(t,n,r)},Cv=function(t,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,l=i.arrowWidth/2,o=n.pstyle(r+"-arrow-shape").value,f,c;if(o!=="none"){r==="source"?(f=i.srcX,c=i.srcY):r==="target"?(f=i.tgtX,c=i.tgtY):(f=i.midX,c=i.midY);var d=a.arrowBounds=a.arrowBounds||{},p=d[r]=d[r]||{};p.x1=f-l,p.y1=c-l,p.x2=f+l,p.y2=c+l,p.w=p.x2-p.x1,p.h=p.y2-p.y1,Vv(p,1),Ia(t,p.x1,p.y1,p.x2,p.y2)}}},M0=function(t,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,l=i.rstyle,o=n.pstyle(a+"label").strValue;if(o){var f=n.pstyle("text-halign"),c=n.pstyle("text-valign"),d=Tf(l,"labelWidth",r),p=Tf(l,"labelHeight",r),m=Tf(l,"labelX",r),y=Tf(l,"labelY",r),x=n.pstyle(a+"text-margin-x").pfValue,b=n.pstyle(a+"text-margin-y").pfValue,S=n.isEdge(),w=n.pstyle(a+"text-rotation"),N=n.pstyle("text-outline-width").pfValue,C=n.pstyle("text-border-width").pfValue,T=C/2,R=n.pstyle("text-background-padding").pfValue,A=2,D=p,L=d,B=L/2,M=D/2,_,P,H,$;if(S)_=m-B,P=m+B,H=y-M,$=y+M;else{switch(f.value){case"left":_=m-L,P=m;break;case"center":_=m-B,P=m+B;break;case"right":_=m,P=m+L;break}switch(c.value){case"top":H=y-D,$=y;break;case"center":H=y-M,$=y+M;break;case"bottom":H=y,$=y+D;break}}var V=x-Math.max(N,T)-R-A,I=x+Math.max(N,T)+R+A,U=b-Math.max(N,T)-R-A,Y=b+Math.max(N,T)+R+A;_+=V,P+=I,H+=U,$+=Y;var Q=r||"main",F=i.labelBounds,q=F[Q]=F[Q]||{};q.x1=_,q.y1=H,q.x2=P,q.y2=$,q.w=P-_,q.h=$-H,q.leftPad=V,q.rightPad=I,q.topPad=U,q.botPad=Y;var X=S&&w.strValue==="autorotate",z=w.pfValue!=null&&w.pfValue!==0;if(X||z){var W=X?Tf(i.rstyle,"labelAngle",r):w.pfValue,re=Math.cos(W),ae=Math.sin(W),ie=(_+P)/2,ye=(H+$)/2;if(!S){switch(f.value){case"left":ie=P;break;case"right":ie=_;break}switch(c.value){case"top":ye=$;break;case"bottom":ye=H;break}}var ue=function(Je,We){return Je=Je-ie,We=We-ye,{x:Je*re-We*ae+ie,y:Je*ae+We*re+ye}},ee=ue(_,H),ne=ue(_,$),se=ue(P,H),ge=ue(P,$);_=Math.min(ee.x,ne.x,se.x,ge.x),P=Math.max(ee.x,ne.x,se.x,ge.x),H=Math.min(ee.y,ne.y,se.y,ge.y),$=Math.max(ee.y,ne.y,se.y,ge.y)}var ke=Q+"Rot",Pe=F[ke]=F[ke]||{};Pe.x1=_,Pe.y1=H,Pe.x2=P,Pe.y2=$,Pe.w=P-_,Pe.h=$-H,Ia(t,_,H,P,$),Ia(i.labelBounds.all,_,H,P,$)}return t}},Ej=function(t,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value,i=n.pstyle("outline-offset").value,l=a+i;GL(t,n,r,l,"outside",l/2)}},GL=function(t,n,r,a,i,l){if(!(r===0||a<=0||i==="inside")){var o=n.cy(),f=n.pstyle("shape").value,c=o.renderer().nodeShapes[f],d=n.position(),p=d.x,m=d.y,y=n.width(),x=n.height();if(c.hasMiterBounds){i==="center"&&(a/=2);var b=c.miterBounds(p,m,y,x,a);Ys(t,b)}else l!=null&&l>0&&Hv(t,[l,l,l,l])}},fZ=function(t,n){if(!n.cy().headless()){var r=n.pstyle("border-opacity").value,a=n.pstyle("border-width").pfValue,i=n.pstyle("border-position").value;GL(t,n,r,a,i)}},dZ=function(t,n){var r=t._private.cy,a=r.styleEnabled(),i=r.headless(),l=jr(),o=t._private,f=t.isNode(),c=t.isEdge(),d,p,m,y,x,b,S=o.rstyle,w=f&&a?t.pstyle("bounds-expansion").pfValue:[0],N=function(lt){return lt.pstyle("display").value!=="none"},C=!a||N(t)&&(!c||N(t.source())&&N(t.target()));if(C){var T=0,R=0;a&&n.includeOverlays&&(T=t.pstyle("overlay-opacity").value,T!==0&&(R=t.pstyle("overlay-padding").value));var A=0,D=0;a&&n.includeUnderlays&&(A=t.pstyle("underlay-opacity").value,A!==0&&(D=t.pstyle("underlay-padding").value));var L=Math.max(R,D),B=0,M=0;if(a&&(B=t.pstyle("width").pfValue,M=B/2),f&&n.includeNodes){var _=t.position();x=_.x,b=_.y;var P=t.outerWidth(),H=P/2,$=t.outerHeight(),V=$/2;d=x-H,p=x+H,m=b-V,y=b+V,Ia(l,d,m,p,y),a&&Ej(l,t),a&&n.includeOutlines&&!i&&Ej(l,t),a&&fZ(l,t)}else if(c&&n.includeEdges)if(a&&!i){var I=t.pstyle("curve-style").strValue;if(d=Math.min(S.srcX,S.midX,S.tgtX),p=Math.max(S.srcX,S.midX,S.tgtX),m=Math.min(S.srcY,S.midY,S.tgtY),y=Math.max(S.srcY,S.midY,S.tgtY),d-=M,p+=M,m-=M,y+=M,Ia(l,d,m,p,y),I==="haystack"){var U=S.haystackPts;if(U&&U.length===2){if(d=U[0].x,m=U[0].y,p=U[1].x,y=U[1].y,d>p){var Y=d;d=p,p=Y}if(m>y){var Q=m;m=y,y=Q}Ia(l,d-M,m-M,p+M,y+M)}}else if(I==="bezier"||I==="unbundled-bezier"||al(I,"segments")||al(I,"taxi")){var F;switch(I){case"bezier":case"unbundled-bezier":F=S.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=S.linePts;break}if(F!=null)for(var q=0;q<F.length;q++){var X=F[q];d=X.x-M,p=X.x+M,m=X.y-M,y=X.y+M,Ia(l,d,m,p,y)}}}else{var z=t.source(),W=z.position(),re=t.target(),ae=re.position();if(d=W.x,p=ae.x,m=W.y,y=ae.y,d>p){var ie=d;d=p,p=ie}if(m>y){var ye=m;m=y,y=ye}d-=M,p+=M,m-=M,y+=M,Ia(l,d,m,p,y)}if(a&&n.includeEdges&&c&&(Cv(l,t,"mid-source"),Cv(l,t,"mid-target"),Cv(l,t,"source"),Cv(l,t,"target")),a){var ue=t.pstyle("ghost").value==="yes";if(ue){var ee=t.pstyle("ghost-offset-x").pfValue,ne=t.pstyle("ghost-offset-y").pfValue;Ia(l,l.x1+ee,l.y1+ne,l.x2+ee,l.y2+ne)}}var se=o.bodyBounds=o.bodyBounds||{};oT(se,l),Hv(se,w),Vv(se,1),a&&(d=l.x1,p=l.x2,m=l.y1,y=l.y2,Ia(l,d-L,m-L,p+L,y+L));var ge=o.overlayBounds=o.overlayBounds||{};oT(ge,l),Hv(ge,w),Vv(ge,1);var ke=o.labelBounds=o.labelBounds||{};ke.all!=null?KX(ke.all):ke.all=jr(),a&&n.includeLabels&&(n.includeMainLabels&&M0(l,t,null),c&&(n.includeSourceLabels&&M0(l,t,"source"),n.includeTargetLabels&&M0(l,t,"target")))}return l.x1=Aa(l.x1),l.y1=Aa(l.y1),l.x2=Aa(l.x2),l.y2=Aa(l.y2),l.w=Aa(l.x2-l.x1),l.h=Aa(l.y2-l.y1),l.w>0&&l.h>0&&C&&(Hv(l,w),Vv(l,1)),l},KL=function(t){var n=0,r=function(l){return(l?1:0)<<n++},a=0;return a+=r(t.incudeNodes),a+=r(t.includeEdges),a+=r(t.includeLabels),a+=r(t.includeMainLabels),a+=r(t.includeSourceLabels),a+=r(t.includeTargetLabels),a+=r(t.includeOverlays),a+=r(t.includeOutlines),a},YL=function(t){var n=function(o){return Math.round(o)};if(t.isEdge()){var r=t.source().position(),a=t.target().position();return nT([n(r.x),n(r.y),n(a.x),n(a.y)])}else{var i=t.position();return nT([n(i.x),n(i.y)])}},Cj=function(t,n){var r=t._private,a,i=t.isEdge(),l=n==null?Nj:KL(n),o=l===Nj;if(r.bbCache==null?(a=dZ(t,sd),r.bbCache=a,r.bbCachePosKey=YL(t)):a=r.bbCache,!o){var f=t.isNode();a=jr(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?Ys(a,r.overlayBounds):Ys(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?Ys(a,r.labelBounds.all):(n.includeMainLabels&&Ys(a,r.labelBounds.mainRot),n.includeSourceLabels&&Ys(a,r.labelBounds.sourceRot),n.includeTargetLabels&&Ys(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},sd={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Nj=KL(sd),kj=cr(sd);kl.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=tc(function(d){var p=d._private;return p.bbCache==null||p.styleDirty||p.bbCachePosKey!==YL(d)},function(d){return d.id()});if(n&&this.length===1&&!r(this[0]))e===void 0?e=sd:e=kj(e),t=Cj(this[0],e);else{t=jr(),e=e||sd;var a=kj(e),i=this,l=i.cy(),o=l.styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var f=0;f<i.length;f++){var c=i[f];r(c)&&c.dirtyBoundingBoxCache(),Ys(t,Cj(c,a))}}return t.x1=Aa(t.x1),t.y1=Aa(t.y1),t.x2=Aa(t.x2),t.y2=Aa(t.y2),t.w=Aa(t.x2-t.x1),t.h=Aa(t.y2-t.y1),t};kl.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};kl.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=t.filter(function(c){return c.isParent()}),t=t.not(a)),Dt(e)){var i=e;e=function(){return i}}var l=function(d,p){return d._private.bbAtOldPos=e(d,p)},o=function(d){return d._private.bbAtOldPos};n.startBatch(),t.forEach(l).silentPositions(e),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var f=GX(this.boundingBox({useCache:!1}));return t.silentPositions(o),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),f};Iu.boundingbox=Iu.bb=Iu.boundingBox;Iu.renderedBoundingbox=Iu.renderedBoundingBox;var hZ=kl,zf,Fd;zf=Fd={};var XL=function(t){t.uppercaseName=qk(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=qk(t.outerName),zf[t.name]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){if(r.isParent())return r.updateCompoundBounds(),a[t.autoName]||0;var o=r.pstyle(t.name);switch(o.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[t.labelName]||0;default:return o.pfValue}}else return 1},zf["outer"+t.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){var o=r[t.name](),f=r.pstyle("border-position").value,c;f==="center"?c=r.pstyle("border-width").pfValue:f==="outside"?c=2*r.pstyle("border-width").pfValue:c=0;var d=2*r.padding();return o+c+d}else return 1},zf["rendered"+t.uppercaseName]=function(){var r=this[0];if(r){var a=r[t.name]();return a*this.cy().zoom()}},zf["rendered"+t.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[t.outerName]();return a*this.cy().zoom()}}};XL({name:"width"});XL({name:"height"});Fd.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding!==void 0?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue};Fd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};Fd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var vZ=Fd,pZ=function(t,n){if(t.isEdge()&&t.takesUpSpace())return n(t)},mZ=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy();return rm(n(t),r.zoom(),r.pan())}},gZ=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy(),a=r.pan(),i=r.zoom();return n(t).map(function(l){return rm(l,i,a)})}},yZ=function(t){return t.renderer().getControlPoints(t)},xZ=function(t){return t.renderer().getSegmentPoints(t)},bZ=function(t){return t.renderer().getSourceEndpoint(t)},wZ=function(t){return t.renderer().getTargetEndpoint(t)},SZ=function(t){return t.renderer().getEdgeMidpoint(t)},Tj={controlPoints:{get:yZ,mult:!0},segmentPoints:{get:xZ,mult:!0},sourceEndpoint:{get:bZ},targetEndpoint:{get:wZ},midpoint:{get:SZ}},EZ=function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)},CZ=Object.keys(Tj).reduce(function(e,t){var n=Tj[t],r=EZ(t);return e[t]=function(){return pZ(this,n.get)},n.mult?e[r]=function(){return gZ(this,n.get)}:e[r]=function(){return mZ(this,n.get)},e},{}),NZ=at({},cZ,hZ,vZ,CZ);/*!
505
+ Event object based on jQuery events, MIT license
506
+
507
+ https://jquery.org/license/
508
+ https://tldrlegal.com/license/mit-license
509
+ https://github.com/jquery/jquery/blob/master/src/event.js
510
+ */var QL=function(t,n){this.recycle(t,n)};function jf(){return!1}function Nv(){return!0}QL.prototype={instanceString:function(){return"event"},recycle:function(t,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=jf,t!=null&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?Nv:jf):t!=null&&t.type?n=t:this.type=t,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Nv;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Nv;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Nv,this.stopPropagation()},isDefaultPrevented:jf,isPropagationStopped:jf,isImmediatePropagationStopped:jf};var WL=/^([^.]+)(\.(?:[^.]+))?$/,kZ=".*",ZL={qualifierCompare:function(t,n){return t===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(t){return t},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},jj=Object.keys(ZL),TZ={};function cm(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TZ,t=arguments.length>1?arguments[1]:void 0,n=0;n<jj.length;n++){var r=jj[n];this[r]=e[r]||ZL[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var bl=cm.prototype,JL=function(t,n,r,a,i,l,o){mn(a)&&(i=a,a=null),o&&(l==null?l=o:l=at({},l,o));for(var f=Yt(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var d=f[c];if(!pl(d)){var p=d.match(WL);if(p){var m=p[1],y=p[2]?p[2]:null,x=n(t,d,m,y,a,i,l);if(x===!1)break}}}},Aj=function(t,n){return t.addEventFields(t.context,n),new QL(n.type,n)},jZ=function(t,n,r){if(LY(r)){n(t,r);return}else if(Dt(r)){n(t,Aj(t,r));return}for(var a=Yt(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var l=a[i];if(!pl(l)){var o=l.match(WL);if(o){var f=o[1],c=o[2]?o[2]:null,d=Aj(t,{type:f,namespace:c,target:t.context});n(t,d)}}}};bl.on=bl.addListener=function(e,t,n,r,a){return JL(this,function(i,l,o,f,c,d,p){mn(d)&&i.listeners.push({event:l,callback:d,type:o,namespace:f,qualifier:c,conf:p})},e,t,n,r,a),this};bl.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})};bl.removeListener=bl.off=function(e,t,n,r){var a=this;this.emitting!==0&&(this.listeners=mX(this.listeners));for(var i=this.listeners,l=function(c){var d=i[c];JL(a,function(p,m,y,x,b,S){if((d.type===y||e==="*")&&(!x&&d.namespace!==".*"||d.namespace===x)&&(!b||p.qualifierCompare(d.qualifier,b))&&(!S||d.callback===S))return i.splice(c,1),!1},e,t,n,r)},o=i.length-1;o>=0;o--)l(o);return this};bl.removeAllListeners=function(){return this.removeListener("*")};bl.emit=bl.trigger=function(e,t,n){var r=this.listeners,a=r.length;return this.emitting++,Yt(t)||(t=[t]),jZ(this,function(i,l){n!=null&&(r=[{event:l.event,type:l.type,namespace:l.namespace,callback:n}],a=r.length);for(var o=function(){var d=r[f];if(d.type===l.type&&(!d.namespace||d.namespace===l.namespace||d.namespace===kZ)&&i.eventMatches(i.context,d,l)){var p=[l];t!=null&&yX(p,t),i.beforeEmit(i.context,d,l),d.conf&&d.conf.one&&(i.listeners=i.listeners.filter(function(x){return x!==d}));var m=i.callbackContext(i.context,d,l),y=d.callback.apply(m,p);i.afterEmit(i.context,d,l),y===!1&&(l.stopPropagation(),l.preventDefault())}},f=0;f<a;f++)o();i.bubble(i.context)&&!l.isPropagationStopped()&&i.parent(i.context).emit(l,t)},e),this.emitting--,this};var AZ={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&Ld(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t.cy(),n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t},beforeEmit:function(t,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(t){return t.isChild()?t.parent():t.cy()}},kv=function(t){return tt(t)?new yl(t):t},e_={createEmitter:function(){for(var t=0;t<this.length;t++){var n=this[t],r=n._private;r.emitter||(r.emitter=new cm(AZ,n))}return this},emitter:function(){return this._private.emitter},on:function(t,n,r){for(var a=kv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r)}return this},removeListener:function(t,n,r){for(var a=kv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().removeListener(t,a,r)}return this},removeAllListeners:function(){for(var t=0;t<this.length;t++){var n=this[t];n.emitter().removeAllListeners()}return this},one:function(t,n,r){for(var a=kv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().one(t,a,r)}return this},once:function(t,n,r){for(var a=kv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r,{once:!0,onceCollection:this})}},emit:function(t,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(t,n)}return this},emitAndNotify:function(t,n){if(this.length!==0)return this.cy().notify(t,this),this.emit(t,n),this}};Pt.eventAliasesOn(e_);var t_={nodes:function(t){return this.filter(function(n){return n.isNode()}).filter(t)},edges:function(t){return this.filter(function(n){return n.isEdge()}).filter(t)},byGroup:function(){for(var t=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?t.push(a):n.push(a)}return{nodes:t,edges:n}},filter:function(t,n){if(t===void 0)return this;if(tt(t)||oa(t))return new yl(t).filter(this);if(mn(t)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);o&&r.push(l)}return r}return this.spawn()},not:function(t){if(t){tt(t)&&(t=this.filter(t));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=t.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var t=this.cy();return t.mutableElements().not(this)},intersect:function(t){if(tt(t)){var n=t;return this.filter(n)}for(var r=this.spawn(),a=this,i=t,l=this.length<t.length,o=l?a:i,f=l?i:a,c=0;c<o.length;c++){var d=o[c];f.has(d)&&r.push(d)}return r},xor:function(t){var n=this._private.cy;tt(t)&&(t=n.$(t));var r=this.spawn(),a=this,i=t,l=function(f,c){for(var d=0;d<f.length;d++){var p=f[d],m=p._private.data.id,y=c.hasElementWithId(m);y||r.push(p)}};return l(a,i),l(i,a),r},diff:function(t){var n=this._private.cy;tt(t)&&(t=n.$(t));var r=this.spawn(),a=this.spawn(),i=this.spawn(),l=this,o=t,f=function(d,p,m){for(var y=0;y<d.length;y++){var x=d[y],b=x._private.data.id,S=p.hasElementWithId(b);S?i.merge(x):m.push(x)}};return f(l,o,r),f(o,l,a),{left:r,right:a,both:i}},add:function(t){var n=this._private.cy;if(!t)return this;if(tt(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<t.length;i++){var l=t[i],o=!this.has(l);o&&a.push(l)}return a},merge:function(t){var n=this._private,r=n.cy;if(!t)return this;if(t&&tt(t)){var a=t;t=r.mutableElements().filter(a)}for(var i=n.map,l=0;l<t.length;l++){var o=t[l],f=o._private.data.id,c=!i.has(f);if(c){var d=this.length++;this[d]=o,i.set(f,{ele:o,index:d})}}return this},unmergeAt:function(t){var n=this[t],r=n.id(),a=this._private,i=a.map;this[t]=void 0,i.delete(r);var l=t===this.length-1;if(this.length>1&&!l){var o=this.length-1,f=this[o],c=f._private.data.id;this[o]=void 0,this[t]=f,i.set(c,{ele:f,index:t})}return this.length--,this},unmergeOne:function(t){t=t[0];var n=this._private,r=t._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var l=i.index;return this.unmergeAt(l),this},unmerge:function(t){var n=this._private.cy;if(!t)return this;if(t&&tt(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=0;a<t.length;a++)this.unmergeOne(t[a]);return this},unmergeBy:function(t){for(var n=this.length-1;n>=0;n--){var r=this[n];t(r)&&this.unmergeAt(n)}return this},map:function(t,n){for(var r=[],a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);r.push(o)}return r},reduce:function(t,n){for(var r=n,a=this,i=0;i<a.length;i++)r=t(r,a[i],i,a);return r},max:function(t,n){for(var r=-1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f>r&&(r=f,a=o)}return{value:r,ele:a}},min:function(t,n){for(var r=1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f<r&&(r=f,a=o)}return{value:r,ele:a}}},Lt=t_;Lt.u=Lt["|"]=Lt["+"]=Lt.union=Lt.or=Lt.add;Lt["\\"]=Lt["!"]=Lt["-"]=Lt.difference=Lt.relativeComplement=Lt.subtract=Lt.not;Lt.n=Lt["&"]=Lt["."]=Lt.and=Lt.intersection=Lt.intersect;Lt["^"]=Lt["(+)"]=Lt["(-)"]=Lt.symmetricDifference=Lt.symdiff=Lt.xor;Lt.fnFilter=Lt.filterFn=Lt.stdFilter=Lt.filter;Lt.complement=Lt.abscomp=Lt.absoluteComplement;var RZ={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var t=this[0];if(t)return t._private.group}},n_=function(t,n){var r=t.cy(),a=r.hasCompoundNodes();function i(d){var p=d.pstyle("z-compound-depth");return p.value==="auto"?a?d.zDepth():0:p.value==="bottom"?-1:p.value==="top"?Aw:0}var l=i(t)-i(n);if(l!==0)return l;function o(d){var p=d.pstyle("z-index-compare");return p.value==="auto"&&d.isNode()?1:0}var f=o(t)-o(n);if(f!==0)return f;var c=t.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:t.poolIndex()-n.poolIndex()},wp={forEach:function(t,n){if(mn(t))for(var r=this.length,a=0;a<r;a++){var i=this[a],l=n?t.apply(n,[i,a,this]):t(i,a,this);if(l===!1)break}return this},toArray:function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},slice:function(t,n){var r=[],a=this.length;n==null&&(n=a),t==null&&(t=0),t<0&&(t=a+t),n<0&&(n=a+n);for(var i=t;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},size:function(){return this.length},eq:function(t){return this[t]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(t){if(!mn(t))return this;var n=this.toArray().sort(t);return this.spawn(n)},sortByZIndex:function(){return this.sort(n_)},zDepth:function(){var t=this[0];if(t){var n=t._private,r=n.group;if(r==="nodes"){var a=n.data.parent?t.parents().size():0;return t.isParent()?a:Aw-1}else{var i=n.source,l=n.target,o=i.zDepth(),f=l.zDepth();return Math.max(o,f,0)}}}};wp.each=wp.forEach;var DZ=function(){var t="undefined",n=(typeof Symbol>"u"?"undefined":Un(Symbol))!=t&&Un(Symbol.iterator)!=t;n&&(wp[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,l=this.length;return eL({next:function(){return i<l?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};DZ();var MZ=cr({nodeDimensionsIncludeLabels:!1}),Gv={layoutDimensions:function(t){t=MZ(t);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(t.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(t,n,r){var a=this.nodes().filter(function(R){return!R.isParent()}),i=this.cy(),l=n.eles,o=function(A){return A.id()},f=tc(r,o);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=function(A,D,L){var B={x:D.x1+D.w/2,y:D.y1+D.h/2},M={x:(L.x-B.x)*A,y:(L.y-B.y)*A};return{x:B.x+M.x,y:B.y+M.y}},d=n.spacingFactor&&n.spacingFactor!==1,p=function(){if(!d)return null;for(var A=jr(),D=0;D<a.length;D++){var L=a[D],B=f(L,D);bL(A,B.x,B.y)}return A},m=p(),y=tc(function(R,A){var D=f(R,A);if(d){var L=Math.abs(n.spacingFactor);D=c(L,m,D)}return n.transform!=null&&(D=n.transform(R,D)),D},o);if(n.animate){for(var x=0;x<a.length;x++){var b=a[x],S=y(b,x),w=n.animateFilter==null||n.animateFilter(b,x);if(w){var N=b.animation({position:S,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(N)}else b.position(S)}if(n.fit){var C=i.animation({fit:{boundingBox:l.boundingBoxAt(y),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});t.animations.push(C)}else if(n.zoom!==void 0&&n.pan!==void 0){var T=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(T)}t.animations.forEach(function(R){return R.play()}),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),bc.all(t.animations.map(function(R){return R.promise()})).then(function(){t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t})})}else a.positions(y),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t});return this},layout:function(t){var n=this.cy();return n.makeLayout(at({},t,{eles:this}))}};Gv.createLayout=Gv.makeLayout=Gv.layout;function r_(e,t,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[e])!=null||(i=a[e]=t(n)),i}function fm(e,t){return e=wo(e),function(r){return r_(e,t,r)}}function dm(e,t){e=wo(e);var n=function(a){return t.call(a)};return function(){var a=this[0];if(a)return r_(e,n,a)}}var or={recalculateRenderedStyle:function(t){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,t),this},dirtyStyleCache:function(){var t=this.cy(),n=function(i){return i._private.styleCache=null};if(t.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(t){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;t=!!(t||t===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var l=i;return t?l.emitAndNotify("style"):l.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var t=this.cy();if(t.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,t.style().apply(r))}},parsedStyle:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,a.style().apply(r));var i=r._private.style[t];return i??(n?a.style().getDefaultProperty(t):null)}},numericStyle:function(t){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(t);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(t){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(t).units},renderedStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,t)},style:function(t,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Dt(t)){var l=t;i.applyBypass(this,l,a),this.emitAndNotify("style")}else if(tt(t))if(n===void 0){var o=this[0];return o?i.getStylePropertyValue(o,t):void 0}else i.applyBypass(this,t,n,a),this.emitAndNotify("style");else if(t===void 0){var f=this[0];return f?i.getRawStyle(f):void 0}return this},removeStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(t===void 0)for(var l=0;l<i.length;l++){var o=i[l];a.removeAllBypasses(o,r)}else{t=t.split(/\s+/);for(var f=0;f<i.length;f++){var c=i[f];a.removeBypasses(c,t,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var t=this.cy();if(!t.styleEnabled())return 1;var n=t.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var l=a.data.parent?r.parents():null;if(l)for(var o=0;o<l.length;o++){var f=l[o],c=f.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function O0(e,t){var n=e._private,r=n.data.parent?e.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!t(i))return!1}return!0}function qw(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],l=a.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!l||O0(i,r);var f=o.source,c=o.target;return n(f)&&(!l||O0(f,n))&&(f===c||n(c)&&(!l||O0(c,n)))}}}var wc=fm("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});or.takesUpSpace=dm("takesUpSpace",qw({ok:wc}));var OZ=fm("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&wc(e)}),LZ=fm("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&wc(e)});or.interactive=dm("interactive",qw({ok:OZ,parentOk:LZ,edgeOkViaNode:wc}));or.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var _Z=fm("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&wc(e)}),BZ=wc;or.visible=dm("visible",qw({ok:_Z,edgeOkViaNode:BZ}));or.hidden=function(){var e=this[0];if(e)return!e.visible()};or.isBundledBezier=dm("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});or.bypass=or.css=or.style;or.renderedCss=or.renderedStyle;or.removeBypass=or.removeCss=or.removeStyle;or.pstyle=or.parsedStyle;var cl={};function Rj(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],a=t[1];this.on(e.event,r,a)}else if(t.length===1&&mn(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&Yt(t[0])){for(var l=t.length===1?t[0]:null,o=0;o<this.length;o++){var f=this[o],c=!e.ableField||f._private[e.ableField],d=f._private[e.field]!=e.value;if(e.overrideAble){var p=e.overrideAble(f);if(p!==void 0&&(c=p,!p))return this}c&&(f._private[e.field]=e.value,d&&n.push(f))}var m=this.spawn(n);m.updateStyle(),m.emit(e.event),l&&m.emit(l)}return this}}function Sc(e){cl[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},cl[e.on]=Rj({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),cl[e.off]=Rj({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}Sc({field:"locked",overrideField:function(t){return t.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Sc({field:"grabbable",overrideField:function(t){return t.cy().autoungrabify()||t.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Sc({field:"selected",ableField:"selectable",overrideAble:function(t){return t.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Sc({field:"selectable",overrideField:function(t){return t.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});cl.deselect=cl.unselect;cl.grabbed=function(){var e=this[0];if(e)return e._private.grabbed};Sc({field:"active",on:"activate",off:"unactivate"});Sc({field:"pannable",on:"panify",off:"unpanify"});cl.inactive=function(){var e=this[0];if(e)return!e._private.active};var yr={},Dj=function(t){return function(r){for(var a=this,i=[],l=0;l<a.length;l++){var o=a[l];if(o.isNode()){for(var f=!1,c=o.connectedEdges(),d=0;d<c.length;d++){var p=c[d],m=p.source(),y=p.target();if(t.noIncomingEdges&&y===o&&m!==o||t.noOutgoingEdges&&m===o&&y!==o){f=!0;break}}f||i.push(o)}}return this.spawn(i,!0).filter(r)}},Mj=function(t){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var l=r[i];if(l.isNode())for(var o=l.connectedEdges(),f=0;f<o.length;f++){var c=o[f],d=c.source(),p=c.target();t.outgoing&&d===l?(a.push(c),a.push(p)):t.incoming&&p===l&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(n)}},Oj=function(t){return function(n){for(var r=this,a=[],i={};;){var l=t.outgoing?r.outgoers():r.incomers();if(l.length===0)break;for(var o=!1,f=0;f<l.length;f++){var c=l[f],d=c.id();i[d]||(i[d]=!0,a.push(c),o=!0)}if(!o)break;r=l}return this.spawn(a,!0).filter(n)}};yr.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null};at(yr,{roots:Dj({noIncomingEdges:!0}),leaves:Dj({noOutgoingEdges:!0}),outgoers:Da(Mj({outgoing:!0}),"outgoers"),successors:Oj({outgoing:!0}),incomers:Da(Mj({incoming:!0}),"incomers"),predecessors:Oj({})});at(yr,{neighborhood:Da(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),l=0;l<i.length;l++){var o=i[l],f=o.source(),c=o.target(),d=a===f?c:f;d.length>0&&t.push(d[0]),t.push(o[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function(t){return this.neighborhood(t)}});yr.neighbourhood=yr.neighborhood;yr.closedNeighbourhood=yr.closedNeighborhood;yr.openNeighbourhood=yr.openNeighborhood;at(yr,{source:Da(function(t){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&t?r.filter(t):r},"source"),target:Da(function(t){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&t?r.filter(t):r},"target"),sources:Lj({attr:"source"}),targets:Lj({attr:"target"})});function Lj(e){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],l=i._private[e.attr];l&&r.push(l)}return this.spawn(r,!0).filter(n)}}at(yr,{edgesWith:Da(_j(),"edgesWith"),edgesTo:Da(_j({thisIsSrc:!0}),"edgesTo")});function _j(e){return function(n){var r=[],a=this._private.cy,i=e||{};tt(n)&&(n=a.$(n));for(var l=0;l<n.length;l++)for(var o=n[l]._private.edges,f=0;f<o.length;f++){var c=o[f],d=c._private.data,p=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),m=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),y=p||m;y&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!p||i.thisIsTgt&&!m)||r.push(c))}return this.spawn(r,!0)}}at(yr,{connectedEdges:Da(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,l=0;l<i.length;l++){var o=i[l];t.push(o)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:Da(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(t.push(a.source()[0]),t.push(a.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:Da(Bj(),"parallelEdges"),codirectedEdges:Da(Bj({codirected:!0}),"codirectedEdges")});function Bj(e){var t={codirected:!1};return e=at({},t,e),function(r){for(var a=[],i=this.edges(),l=e,o=0;o<i.length;o++)for(var f=i[o],c=f._private,d=c.source,p=d._private.data.id,m=c.data.target,y=d._private.edges,x=0;x<y.length;x++){var b=y[x],S=b._private.data,w=S.target,N=S.source,C=w===m&&N===p,T=p===w&&m===N;(l.codirected&&C||!l.codirected&&(C||T))&&a.push(b)}return this.spawn(a,!0).filter(r)}}at(yr,{components:function(t){var n=this,r=n.cy(),a=r.collection(),i=t==null?n.nodes():t.nodes(),l=[];t!=null&&i.empty()&&(i=t.sources());var o=function(d,p){a.merge(d),i.unmerge(d),p.merge(d)};if(i.empty())return n.spawn();var f=function(){var d=r.collection();l.push(d);var p=i[0];o(p,d),n.bfs({directed:!1,roots:p,visit:function(y){return o(y,d)}}),d.forEach(function(m){m.connectedEdges().forEach(function(y){n.has(y)&&d.has(y.source())&&d.has(y.target())&&d.merge(y)})})};do f();while(i.length>0);return l},component:function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});yr.componentsOf=yr.components;var ur=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t===void 0){fn("A collection must have a reference to the core");return}var i=new Wi,l=!1;if(!n)n=[];else if(n.length>0&&Dt(n[0])&&!Ld(n[0])){l=!0;for(var o=[],f=new xc,c=0,d=n.length;c<d;c++){var p=n[c];p.data==null&&(p.data={});var m=p.data;if(m.id==null)m.id=gL();else if(t.hasElementWithId(m.id)||f.has(m.id))continue;var y=new nm(t,p,!1);o.push(y),f.add(m.id)}n=o}this.length=0;for(var x=0,b=n.length;x<b;x++){var S=n[x][0];if(S!=null){var w=S._private.data.id;(!r||!i.has(w))&&(r&&i.set(w,{index:this.length,ele:S}),this[this.length]=S,this.length++)}}this._private={eles:this,cy:t,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(N){this.lazyMap=N},rebuildMap:function(){for(var C=this.lazyMap=new Wi,T=this.eles,R=0;R<T.length;R++){var A=T[R];C.set(A.id(),{index:R,ele:A})}}},r&&(this._private.map=i),l&&!a&&this.restore()},en=nm.prototype=ur.prototype=Object.create(Array.prototype);en.instanceString=function(){return"collection"};en.spawn=function(e,t){return new ur(this.cy(),e,t)};en.spawnSelf=function(){return this.spawn(this)};en.cy=function(){return this._private.cy};en.renderer=function(){return this._private.cy.renderer()};en.element=function(){return this[0]};en.collection=function(){return rL(this)?this:new ur(this._private.cy,[this])};en.unique=function(){return new ur(this._private.cy,this,!0)};en.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)};en.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new ur(t)};en.$id=en.getElementById;en.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index};en.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};en.indexOfId=function(e){return e=""+e,this._private.map.get(e).index};en.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(Dt(e)){if(n.startBatch(),e.data){t.data(e.data);var a=r.data;if(t.isEdge()){var i=!1,l={},o=e.data.source,f=e.data.target;o!=null&&o!=a.source&&(l.source=""+o,i=!0),f!=null&&f!=a.target&&(l.target=""+f,i=!0),i&&(t=t.move(l))}else{var c="parent"in e.data,d=e.data.parent;c&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),t=t.move({parent:d}))}}e.position&&t.position(e.position);var p=function(b,S,w){var N=e[b];N!=null&&N!==r[b]&&(N?t[S]():t[w]())};return p("removed","remove","restore"),p("selected","select","unselect"),p("selectable","selectify","unselectify"),p("locked","lock","unlock"),p("grabbable","grabify","ungrabify"),p("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var m={data:ci(r.data),position:ci(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};m.classes="";var y=0;return r.classes.forEach(function(x){return m.classes+=y++===0?x:" "+x}),m}}};en.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],r=n.json();e.push(r)}return e};en.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new nm(e,a,!1);t.push(i)}return new ur(e,t)};en.copy=en.clone;en.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],l=[],o,f=0,c=n.length;f<c;f++){var d=n[f];t&&!d.removed()||(d.isNode()?i.push(d):l.push(d))}o=i.concat(l);var p,m=function(){o.splice(p,1),p--};for(p=0;p<o.length;p++){var y=o[p],x=y._private,b=x.data;if(y.clearTraversalCache(),!(!t&&!x.removed)){if(b.id===void 0)b.id=gL();else if(Ae(b.id))b.id=""+b.id;else if(pl(b.id)||!tt(b.id)){fn("Can not create element with invalid string ID `"+b.id+"`"),m();continue}else if(r.hasElementWithId(b.id)){fn("Can not create second element with ID `"+b.id+"`"),m();continue}}var S=b.id;if(y.isNode()){var w=x.position;w.x==null&&(w.x=0),w.y==null&&(w.y=0)}if(y.isEdge()){for(var N=y,C=["source","target"],T=C.length,R=!1,A=0;A<T;A++){var D=C[A],L=b[D];Ae(L)&&(L=b[D]=""+b[D]),L==null||L===""?(fn("Can not create edge `"+S+"` with unspecified "+D),R=!0):r.hasElementWithId(L)||(fn("Can not create edge `"+S+"` with nonexistant "+D+" `"+L+"`"),R=!0)}if(R){m();continue}var B=r.getElementById(b.source),M=r.getElementById(b.target);B.same(M)?B._private.edges.push(N):(B._private.edges.push(N),M._private.edges.push(N)),N._private.source=B,N._private.target=M}x.map=new Wi,x.map.set(S,{ele:y,index:0}),x.removed=!1,t&&r.addToPool(y)}for(var _=0;_<i.length;_++){var P=i[_],H=P._private.data;Ae(H.parent)&&(H.parent=""+H.parent);var $=H.parent,V=$!=null;if(V||P._private.parent){var I=P._private.parent?r.collection().merge(P._private.parent):r.getElementById($);if(I.empty())H.parent=void 0;else if(I[0].removed())zt("Node added with missing parent, reference to parent removed"),H.parent=void 0,P._private.parent=null;else{for(var U=!1,Y=I;!Y.empty();){if(P.same(Y)){U=!0,H.parent=void 0;break}Y=Y.parent()}U||(I[0]._private.children.push(P),P._private.parent=I[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Q=o.length===n.length?n:new ur(r,o),F=0;F<Q.length;F++){var q=Q[F];q.isNode()||(q.parallelEdges().clearTraversalCache(),q.source().clearTraversalCache(),q.target().clearTraversalCache())}var X;a.hasCompoundNodes?X=r.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):X=Q,X.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?Q.emitAndNotify("add"):t&&Q.emit("add")}return n};en.removed=function(){var e=this[0];return e&&e._private.removed};en.inside=function(){var e=this[0];return e&&!e._private.removed};en.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function l($){for(var V=$._private.edges,I=0;I<V.length;I++)f(V[I])}function o($){for(var V=$._private.children,I=0;I<V.length;I++)f(V[I])}function f($){var V=a[$.id()];t&&$.removed()||V||(a[$.id()]=!0,$.isNode()?(r.push($),l($),o($)):r.unshift($))}for(var c=0,d=n.length;c<d;c++){var p=n[c];f(p)}function m($,V){var I=$._private.edges;ml(I,V),$.clearTraversalCache()}function y($){$.clearTraversalCache()}var x=[];x.ids={};function b($,V){V=V[0],$=$[0];var I=$._private.children,U=$.id();ml(I,V),V._private.parent=null,x.ids[U]||(x.ids[U]=!0,x.push($))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var S=0;S<r.length;S++){var w=r[S];if(w.isEdge()){var N=w.source()[0],C=w.target()[0];m(N,w),m(C,w);for(var T=w.parallelEdges(),R=0;R<T.length;R++){var A=T[R];y(A),A.isBundledBezier()&&A.dirtyBoundingBoxCache()}}else{var D=w.parent();D.length!==0&&b(D,w)}t&&(w._private.removed=!0)}var L=i._private.elements;i._private.hasCompoundNodes=!1;for(var B=0;B<L.length;B++){var M=L[B];if(M.isParent()){i._private.hasCompoundNodes=!0;break}}var _=new ur(this.cy(),r);_.size()>0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var P=0;P<x.length;P++){var H=x[P];(!t||!H.removed())&&H.updateStyle()}return _};en.move=function(e){var t=this._private.cy,n=this,r=!1,a=!1,i=function(x){return x==null?x:""+x};if(e.source!==void 0||e.target!==void 0){var l=i(e.source),o=i(e.target),f=l!=null&&t.hasElementWithId(l),c=o!=null&&t.hasElementWithId(o);(f||c)&&(t.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var y=0;y<n.length;y++){var x=n[y],b=x._private.data;x.isEdge()&&(f&&(b.source=l),c&&(b.target=o))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var d=i(e.parent),p=d===null||t.hasElementWithId(d);if(p){var m=d===null?void 0:d;t.batch(function(){var y=n.remove(r,a);y.emitAndNotify("moveout");for(var x=0;x<n.length;x++){var b=n[x],S=b._private.data;b.isNode()&&(S.parent=m)}y.restore(r,a)}),n.emitAndNotify("move")}}return this};[AL,KW,$v,ul,rc,uZ,um,NZ,e_,t_,RZ,wp,Gv,or,cl,yr].forEach(function(e){at(en,e)});var PZ={add:function(t){var n,r=this;if(oa(t)){var a=t;if(a._private.cy===r)n=a.restore();else{for(var i=[],l=0;l<a.length;l++){var o=a[l];i.push(o.json())}n=new ur(r,i)}}else if(Yt(t)){var f=t;n=new ur(r,f)}else if(Dt(t)&&(Yt(t.nodes)||Yt(t.edges))){for(var c=t,d=[],p=["nodes","edges"],m=0,y=p.length;m<y;m++){var x=p[m],b=c[x];if(Yt(b))for(var S=0,w=b.length;S<w;S++){var N=at({group:x},b[S]);d.push(N)}}n=new ur(r,d)}else{var C=t;n=new nm(r,C).collection()}return n},remove:function(t){if(!oa(t)){if(tt(t)){var n=t;t=this.$(n)}}return t.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function zZ(e,t,n,r){var a=4,i=.001,l=1e-7,o=10,f=11,c=1/(f-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var p=0;p<4;++p)if(typeof arguments[p]!="number"||isNaN(arguments[p])||!isFinite(arguments[p]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var m=d?new Float32Array(f):new Array(f);function y(M,_){return 1-3*_+3*M}function x(M,_){return 3*_-6*M}function b(M){return 3*M}function S(M,_,P){return((y(_,P)*M+x(_,P))*M+b(_))*M}function w(M,_,P){return 3*y(_,P)*M*M+2*x(_,P)*M+b(_)}function N(M,_){for(var P=0;P<a;++P){var H=w(_,e,n);if(H===0)return _;var $=S(_,e,n)-M;_-=$/H}return _}function C(){for(var M=0;M<f;++M)m[M]=S(M*c,e,n)}function T(M,_,P){var H,$,V=0;do $=_+(P-_)/2,H=S($,e,n)-M,H>0?P=$:_=$;while(Math.abs(H)>l&&++V<o);return $}function R(M){for(var _=0,P=1,H=f-1;P!==H&&m[P]<=M;++P)_+=c;--P;var $=(M-m[P])/(m[P+1]-m[P]),V=_+$*c,I=w(V,e,n);return I>=i?N(M,V):I===0?V:T(M,_,_+c)}var A=!1;function D(){A=!0,(e!==t||n!==r)&&C()}var L=function(_){return A||D(),e===t&&n===r?_:_===0?0:_===1?1:S(R(_),t,r)};L.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var B="generateBezier("+[e,t,n,r]+")";return L.toString=function(){return B},L}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var IZ=(function(){function e(r){return-r.tension*r.x-r.friction*r.v}function t(r,a,i){var l={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:l.v,dv:e(l)}}function n(r,a){var i={dx:r.v,dv:e(r)},l=t(r,a*.5,i),o=t(r,a*.5,l),f=t(r,a,o),c=1/6*(i.dx+2*(l.dx+o.dx)+f.dx),d=1/6*(i.dv+2*(l.dv+o.dv)+f.dv);return r.x=r.x+c*a,r.v=r.v+d*a,r}return function r(a,i,l){var o={x:-1,v:0,tension:null,friction:null},f=[0],c=0,d=1/1e4,p=16/1e3,m,y,x;for(a=parseFloat(a)||500,i=parseFloat(i)||20,l=l||null,o.tension=a,o.friction=i,m=l!==null,m?(c=r(a,i),y=c/l*p):y=p;x=n(x||o,y),f.push(1+x.x),c+=16,Math.abs(x.x)>d&&Math.abs(x.v)>d;);return m?function(b){return f[b*(f.length-1)|0]}:c}})(),Wt=function(t,n,r,a){var i=zZ(t,n,r,a);return function(l,o,f){return l+(o-l)*i(f)}},Kv={linear:function(t,n,r){return t+(n-t)*r},ease:Wt(.25,.1,.25,1),"ease-in":Wt(.42,0,1,1),"ease-out":Wt(0,0,.58,1),"ease-in-out":Wt(.42,0,.58,1),"ease-in-sine":Wt(.47,0,.745,.715),"ease-out-sine":Wt(.39,.575,.565,1),"ease-in-out-sine":Wt(.445,.05,.55,.95),"ease-in-quad":Wt(.55,.085,.68,.53),"ease-out-quad":Wt(.25,.46,.45,.94),"ease-in-out-quad":Wt(.455,.03,.515,.955),"ease-in-cubic":Wt(.55,.055,.675,.19),"ease-out-cubic":Wt(.215,.61,.355,1),"ease-in-out-cubic":Wt(.645,.045,.355,1),"ease-in-quart":Wt(.895,.03,.685,.22),"ease-out-quart":Wt(.165,.84,.44,1),"ease-in-out-quart":Wt(.77,0,.175,1),"ease-in-quint":Wt(.755,.05,.855,.06),"ease-out-quint":Wt(.23,1,.32,1),"ease-in-out-quint":Wt(.86,0,.07,1),"ease-in-expo":Wt(.95,.05,.795,.035),"ease-out-expo":Wt(.19,1,.22,1),"ease-in-out-expo":Wt(1,0,0,1),"ease-in-circ":Wt(.6,.04,.98,.335),"ease-out-circ":Wt(.075,.82,.165,1),"ease-in-out-circ":Wt(.785,.135,.15,.86),spring:function(t,n,r){if(r===0)return Kv.linear;var a=IZ(t,n,r);return function(i,l,o){return i+(l-i)*a(o)}},"cubic-bezier":Wt};function Pj(e,t,n,r,a){if(r===1||t===n)return n;var i=a(t,n,r);return e==null||((e.roundValue||e.color)&&(i=Math.round(i)),e.min!==void 0&&(i=Math.max(i,e.min)),e.max!==void 0&&(i=Math.min(i,e.max))),i}function zj(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function xu(e,t,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var l=zj(e,a),o=zj(t,a);if(Ae(l)&&Ae(o))return Pj(i,l,o,n,r);if(Yt(l)&&Yt(o)){for(var f=[],c=0;c<o.length;c++){var d=l[c],p=o[c];if(d!=null&&p!=null){var m=Pj(i,d,p,n,r);f.push(m)}else f.push(p)}return f}}function FZ(e,t,n,r){var a=!r,i=e._private,l=t._private,o=l.easing,f=l.startTime,c=r?e:e.cy(),d=c.style();if(!l.easingImpl)if(o==null)l.easingImpl=Kv.linear;else{var p;if(tt(o)){var m=d.parse("transition-timing-function",o);p=m.value}else p=o;var y,x;tt(p)?(y=p,x=[]):(y=p[1],x=p.slice(2).map(function(Q){return+Q})),x.length>0?(y==="spring"&&x.push(l.duration),l.easingImpl=Kv[y].apply(null,x)):l.easingImpl=Kv[y]}var b=l.easingImpl,S;if(l.duration===0?S=1:S=(n-f)/l.duration,l.applying&&(S=l.progress),S<0?S=0:S>1&&(S=1),l.delay==null){var w=l.startPosition,N=l.position;if(N&&a&&!e.locked()){var C={};Af(w.x,N.x)&&(C.x=xu(w.x,N.x,S,b)),Af(w.y,N.y)&&(C.y=xu(w.y,N.y,S,b)),e.position(C)}var T=l.startPan,R=l.pan,A=i.pan,D=R!=null&&r;D&&(Af(T.x,R.x)&&(A.x=xu(T.x,R.x,S,b)),Af(T.y,R.y)&&(A.y=xu(T.y,R.y,S,b)),e.emit("pan"));var L=l.startZoom,B=l.zoom,M=B!=null&&r;M&&(Af(L,B)&&(i.zoom=rd(i.minZoom,xu(L,B,S,b),i.maxZoom)),e.emit("zoom")),(D||M)&&e.emit("viewport");var _=l.style;if(_&&_.length>0&&a){for(var P=0;P<_.length;P++){var H=_[P],$=H.name,V=H,I=l.startStyle[$],U=d.properties[I.name],Y=xu(I,V,S,b,U);d.overrideBypass(e,$,Y)}e.emit("style")}}return l.progress=S,S}function Af(e,t){return e==null||t==null?!1:Ae(e)&&Ae(t)?!0:!!(e&&t)}function qZ(e,t,n,r){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Ij(e,t){var n=t._private.aniEles,r=[];function a(d,p){var m=d._private,y=m.animation.current,x=m.animation.queue,b=!1;if(y.length===0){var S=x.shift();S&&y.push(S)}for(var w=function(A){for(var D=A.length-1;D>=0;D--){var L=A[D];L()}A.splice(0,A.length)},N=y.length-1;N>=0;N--){var C=y[N],T=C._private;if(T.stopped){y.splice(N,1),T.hooked=!1,T.playing=!1,T.started=!1,w(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||qZ(d,C,e),FZ(d,C,e,p),T.applying&&(T.applying=!1),w(T.frames),T.step!=null&&T.step(e),C.completed()&&(y.splice(N,1),T.hooked=!1,T.playing=!1,T.started=!1,w(T.completes)),b=!0)}return!p&&y.length===0&&x.length===0&&r.push(d),b}for(var i=!1,l=0;l<n.length;l++){var o=n[l],f=a(o);i=i||f}var c=a(t,!0);(i||c)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var UZ={animate:Pt.animate(),animation:Pt.animation(),animated:Pt.animated(),clearQueue:Pt.clearQueue(),delay:Pt.delay(),delayAnimation:Pt.delayAnimation(),stop:Pt.stop(),addToAnimationPool:function(t){var n=this;n.styleEnabled()&&n._private.aniEles.merge(t)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var t=this;if(t._private.animationsRunning=!0,!t.styleEnabled())return;function n(){t._private.animationsRunning&&mp(function(i){Ij(i,t),n()})}var r=t.renderer();r&&r.beforeRender?r.beforeRender(function(i,l){Ij(l,t)},r.beforeRenderPriorities.animations):n()}},VZ={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&Ld(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t,n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t}},Tv=function(t){return tt(t)?new yl(t):t},a_={createEmitter:function(){var t=this._private;return t.emitter||(t.emitter=new cm(VZ,this)),this},emitter:function(){return this._private.emitter},on:function(t,n,r){return this.emitter().on(t,Tv(n),r),this},removeListener:function(t,n,r){return this.emitter().removeListener(t,Tv(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(t,n,r){return this.emitter().one(t,Tv(n),r),this},once:function(t,n,r){return this.emitter().one(t,Tv(n),r),this},emit:function(t,n){return this.emitter().emit(t,n),this},emitAndNotify:function(t,n){return this.emit(t),this.notify(t,n),this}};Pt.eventAliasesOn(a_);var Jb={png:function(t){var n=this._private.renderer;return t=t||{},n.png(t)},jpg:function(t){var n=this._private.renderer;return t=t||{},t.bg=t.bg||"#fff",n.jpg(t)}};Jb.jpeg=Jb.jpg;var Yv={layout:function(t){var n=this;if(t==null){fn("Layout options must be specified to make a layout");return}if(t.name==null){fn("A `name` must be specified to make a layout");return}var r=t.name,a=n.extension("layout",r);if(a==null){fn("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;tt(t.eles)?i=n.$(t.eles):i=t.eles!=null?t.eles:n.$();var l=new a(at({},t,{cy:n,eles:i}));return l}};Yv.createLayout=Yv.makeLayout=Yv.layout;var HZ={notify:function(t,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(t,n)}},notifications:function(t){var n=this._private;return t===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!t,this)},noNotifications:function(t){this.notifications(!1),t(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var t=this._private;return t.batchCount==null&&(t.batchCount=0),t.batchCount===0&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this},endBatch:function(){var t=this._private;if(t.batchCount===0)return this;if(t.batchCount--,t.batchCount===0){t.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(t.batchNotifications).forEach(function(r){var a=t.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(t){return this.startBatch(),t(),this.endBatch(),this},batchData:function(t){var n=this;return this.batch(function(){for(var r=Object.keys(t),a=0;a<r.length;a++){var i=r[a],l=t[i],o=n.getElementById(i);o.data(l)}})}},$Z=cr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),e1={renderTo:function(t,n,r,a){var i=this._private.renderer;return i.renderTo(t,n,r,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(t){var n=this,r=n.extension("renderer",t.name);if(r==null){fn("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}t.wheelSensitivity!==void 0&&zt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=$Z(t);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var t=this;t.notify("destroy");var n=t.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach(function(r){var a=r._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(t){return this.on("render",t)},offRender:function(t){return this.off("render",t)}};e1.invalidateDimensions=e1.resize;var Xv={collection:function(t,n){return tt(t)?this.$(t):oa(t)?t.collection():Yt(t)?(n||(n={}),new ur(this,t,n.unique,n.removed)):new ur(this)},nodes:function(t){var n=this.$(function(r){return r.isNode()});return t?n.filter(t):n},edges:function(t){var n=this.$(function(r){return r.isEdge()});return t?n.filter(t):n},$:function(t){var n=this._private.elements;return t?n.filter(t):n.spawnSelf()},mutableElements:function(){return this._private.elements}};Xv.elements=Xv.filter=Xv.$;var tr={},Hf="t",GZ="f";tr.apply=function(e){for(var t=this,n=t._private,r=n.cy,a=r.collection(),i=0;i<e.length;i++){var l=e[i],o=t.getContextMeta(l);if(!o.empty){var f=t.getContextStyle(o),c=t.applyContextStyle(o,f,l);l._private.appliedInitStyle?t.updateTransitions(l,c.diffProps):l._private.appliedInitStyle=!0;var d=t.updateStyleHints(l);d&&a.push(l)}}return a};tr.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,i=r[a];if(i)return i;for(var l=[],o={},f=0;f<n.length;f++){var c=n[f],d=e[f]===Hf,p=t[f]===Hf,m=d!==p,y=c.mappedProperties.length>0;if(m||p&&y){var x=void 0;m&&y||m?x=c.properties:y&&(x=c.mappedProperties);for(var b=0;b<x.length;b++){for(var S=x[b],w=S.name,N=!1,C=f+1;C<n.length;C++){var T=n[C],R=t[C]===Hf;if(R&&(N=T.properties[S.name]!=null,N))break}!o[w]&&!N&&(o[w]=!0,l.push(w))}}}return r[a]=l,l};tr.getContextMeta=function(e){for(var t=this,n="",r,a=e._private.styleCxtKey||"",i=0;i<t.length;i++){var l=t[i],o=l.selector&&l.selector.matches(e);o?n+=Hf:n+=GZ}return r=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};tr.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var a={_private:{key:t}},i=0;i<n.length;i++){var l=n[i],o=t[i]===Hf;if(o)for(var f=0;f<l.properties.length;f++){var c=l.properties[f];a[c.name]=c}}return r[t]=a,a};tr.applyContextStyle=function(e,t,n){for(var r=this,a=e.diffPropNames,i={},l=r.types,o=0;o<a.length;o++){var f=a[o],c=t[f],d=n.pstyle(f);if(!c)if(d)d.bypass?c={name:f,deleteBypassed:!0}:c={name:f,delete:!0};else continue;if(d!==c){if(c.mapped===l.fn&&d!=null&&d.mapping!=null&&d.mapping.value===c.value){var p=d.mapping,m=p.fnValue=c.value(n);if(m===p.prevFnValue)continue}var y=i[f]={prev:d};r.applyParsedProperty(n,c),y.next=n.pstyle(f),y.next&&y.next.bypass&&(y.next=y.next.bypassed)}}return{diffProps:i}};tr.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(se,ge,ke){return n.getPropertiesHash(se,ge,ke)},l=t.styleKey;if(e.removed())return!1;var o=t.group==="nodes",f=e._private.style;r=Object.keys(f);for(var c=0;c<a.length;c++){var d=a[c];t.styleKeys[d]=[Zl,ku]}for(var p=function(se,ge){return t.styleKeys[ge][0]=ed(se,t.styleKeys[ge][0])},m=function(se,ge){return t.styleKeys[ge][1]=td(se,t.styleKeys[ge][1])},y=function(se,ge){p(se,ge),m(se,ge)},x=function(se,ge){for(var ke=0;ke<se.length;ke++){var Pe=se.charCodeAt(ke);p(Pe,ge),m(Pe,ge)}},b=2e9,S=function(se){return-128<se&&se<128&&Math.floor(se)!==se?b-(se*1024|0):se},w=0;w<r.length;w++){var N=r[w],C=f[N];if(C!=null){var T=this.properties[N],R=T.type,A=T.groupKey,D=void 0;T.hashOverride!=null?D=T.hashOverride(e,C):C.pfValue!=null&&(D=C.pfValue);var L=T.enums==null?C.value:null,B=D!=null,M=L!=null,_=B||M,P=C.units;if(R.number&&_&&!R.multiple){var H=B?D:L;y(S(H),A),!B&&P!=null&&x(P,A)}else x(C.strValue,A)}}for(var $=[Zl,ku],V=0;V<a.length;V++){var I=a[V],U=t.styleKeys[I];$[0]=ed(U[0],$[0]),$[1]=td(U[1],$[1])}t.styleKey=oX($[0],$[1]);var Y=t.styleKeys;t.labelDimsKey=Vs(Y.labelDimensions);var Q=i(e,["label"],Y.labelDimensions);if(t.labelKey=Vs(Q),t.labelStyleKey=Vs(xv(Y.commonLabel,Q)),!o){var F=i(e,["source-label"],Y.labelDimensions);t.sourceLabelKey=Vs(F),t.sourceLabelStyleKey=Vs(xv(Y.commonLabel,F));var q=i(e,["target-label"],Y.labelDimensions);t.targetLabelKey=Vs(q),t.targetLabelStyleKey=Vs(xv(Y.commonLabel,q))}if(o){var X=t.styleKeys,z=X.nodeBody,W=X.nodeBorder,re=X.nodeOutline,ae=X.backgroundImage,ie=X.compound,ye=X.pie,ue=X.stripe,ee=[z,W,re,ae,ie,ye,ue].filter(function(ne){return ne!=null}).reduce(xv,[Zl,ku]);t.nodeKey=Vs(ee),t.hasPie=ye!=null&&ye[0]!==Zl&&ye[1]!==ku,t.hasStripe=ue!=null&&ue[0]!==Zl&&ue[1]!==ku}return l!==t.styleKey};tr.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null};tr.applyParsedProperty=function(e,t){var n=this,r=t,a=e._private.style,i,l=n.types,o=n.properties[r.name].type,f=r.bypass,c=a[r.name],d=c&&c.bypass,p=e._private,m="mapping",y=function(z){return z==null?null:z.pfValue!=null?z.pfValue:z.value},x=function(){var z=y(c),W=y(r);n.checkTriggers(e,r.name,z,W)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,"bezier",f)),r.delete)return a[r.name]=void 0,x(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,x(),!0):!1:(x(),!0);if(r.deleteBypass)return c?c.bypass?(a[r.name]=c.bypassed,x(),!0):!1:(x(),!0);var b=function(){zt("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case l.mapData:{for(var S=r.field.split("."),w=p.data,N=0;N<S.length&&w;N++){var C=S[N];w=w[C]}if(w==null)return b(),!1;var T;if(Ae(w)){var R=r.fieldMax-r.fieldMin;R===0?T=0:T=(w-r.fieldMin)/R}else return zt("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+w+"` for `"+e.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var A=r.valueMin[0],D=r.valueMax[0],L=r.valueMin[1],B=r.valueMax[1],M=r.valueMin[2],_=r.valueMax[2],P=r.valueMin[3]==null?1:r.valueMin[3],H=r.valueMax[3]==null?1:r.valueMax[3],$=[Math.round(A+(D-A)*T),Math.round(L+(B-L)*T),Math.round(M+(_-M)*T),Math.round(P+(H-P)*T)];i={bypass:r.bypass,name:r.name,value:$,strValue:"rgb("+$[0]+", "+$[1]+", "+$[2]+")"}}else if(o.number){var V=r.valueMin+(r.valueMax-r.valueMin)*T;i=this.parse(r.name,V,r.bypass,m)}else return!1;if(!i)return b(),!1;i.mapping=r,r=i;break}case l.data:{for(var I=r.field.split("."),U=p.data,Y=0;Y<I.length&&U;Y++){var Q=I[Y];U=U[Q]}if(U!=null&&(i=this.parse(r.name,U,r.bypass,m)),!i)return b(),!1;i.mapping=r,r=i;break}case l.fn:{var F=r.value,q=r.fnValue!=null?r.fnValue:F(e);if(r.prevFnValue=q,q==null)return zt("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(r.name,q,r.bypass,m),!i)return zt("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=ci(r),r=i;break}case void 0:break;default:return!1}return f?(d?r.bypassed=c.bypassed:r.bypassed=c,a[r.name]=r):d?c.bypassed=r:a[r.name]=r,x(),!0};tr.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),l=0;l<i.length;l++){var o=i[l],f=a[o];f!=null&&(f.bypass?f.bypassed=null:a[o]=null)}}};tr.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()};tr.updateTransitions=function(e,t){var n=this,r=e._private,a=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,l=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},f=!1,c=0;c<a.length;c++){var d=a[c],p=e.pstyle(d),m=t[d];if(m){var y=m.prev,x=y,b=m.next!=null?m.next:p,S=!1,w=void 0,N=1e-6;x&&(Ae(x.pfValue)&&Ae(b.pfValue)?(S=b.pfValue-x.pfValue,w=x.pfValue+N*S):Ae(x.value)&&Ae(b.value)?(S=b.value-x.value,w=x.value+N*S):Yt(x.value)&&Yt(b.value)&&(S=x.value[0]!==b.value[0]||x.value[1]!==b.value[1]||x.value[2]!==b.value[2],w=x.strValue),S&&(o[d]=b.strValue,this.applyBypass(e,d,w),f=!0))}}if(!f)return;r.transitioning=!0,new bc(function(C){l>0?e.delayAnimation(l).play().promise().then(C):C()}).then(function(){return e.animation({style:o,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1)};tr.checkTrigger=function(e,t,n,r,a,i){var l=this.properties[t],o=a(l);e.removed()||o!=null&&o(n,r,e)&&i(l)};tr.checkZOrderTrigger=function(e,t,n,r){var a=this;this.checkTrigger(e,t,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",e)})};tr.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};tr.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfConnectedEdges},function(a){e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};tr.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfParallelEdges},function(a){e.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};tr.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var qd={};qd.applyBypass=function(e,t,n,r){var a=this,i=[],l=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var o=0;o<a.properties.length;o++){var f=a.properties[o],c=f.name,d=this.parse(c,n,!0);d&&i.push(d)}}else if(tt(t)){var p=this.parse(t,n,!0);p&&i.push(p)}else if(Dt(t)){var m=t;r=n;for(var y=Object.keys(m),x=0;x<y.length;x++){var b=y[x],S=m[b];if(S===void 0&&(S=m[em(b)]),S!==void 0){var w=this.parse(b,S,!0);w&&i.push(w)}}}else return!1;if(i.length===0)return!1;for(var N=!1,C=0;C<e.length;C++){for(var T=e[C],R={},A=void 0,D=0;D<i.length;D++){var L=i[D];if(r){var B=T.pstyle(L.name);A=R[L.name]={prev:B}}N=this.applyParsedProperty(T,ci(L))||N,r&&(A.next=T.pstyle(L.name))}N&&this.updateStyleHints(T),r&&this.updateTransitions(T,R,l)}return N};qd.overrideBypass=function(e,t,n){t=Tw(t);for(var r=0;r<e.length;r++){var a=e[r],i=a._private.style[t],l=this.properties[t].type,o=l.color,f=l.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,t,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),o?i.strValue="rgb("+n.join(",")+")":f?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,t,c,n)}};qd.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};qd.removeBypasses=function(e,t,n){for(var r=!0,a=0;a<e.length;a++){for(var i=e[a],l={},o=0;o<t.length;o++){var f=t[o],c=this.properties[f],d=i.pstyle(c.name);if(!(!d||!d.bypass)){var p="",m=this.parse(f,p,!0),y=l[c.name]={prev:d};this.applyParsedProperty(i,m),y.next=i.pstyle(c.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,l,r)}};var Uw={};Uw.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1};Uw.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var xi={};xi.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)};xi.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],l=n.getStylePropertyValue(e,i.name,t);l!=null&&(r[i.name]=l,r[em(i.name)]=l)}return r}};xi.getIndexedStyle=function(e,t,n,r){var a=e.pstyle(t)[n][r];return a??e.cy().style().getDefaultProperty(t)[n][0]};xi.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var a=r.properties[t];a.alias&&(a=a.pointsTo);var i=a.type,l=e.pstyle(a.name);if(l){var o=l.value,f=l.units,c=l.strValue;if(n&&i.number&&o!=null&&Ae(o)){var d=e.cy().zoom(),p=function(S){return S*d},m=function(S,w){return p(S)+w},y=Yt(o),x=y?f.every(function(b){return b!=null}):f!=null;return x?y?o.map(function(b,S){return m(b,f[S])}).join(" "):m(o,f):y?o.map(function(b){return tt(b)?b:""+p(b)}).join(" "):""+p(o)}else if(c!=null)return c}return null}};xi.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var a=t[r],i=a.name,l=e.pstyle(i);l!==void 0&&(Dt(l)?l=this.parse(i,l.strValue):l=this.parse(i,l)),l&&(n[i]=l)}return n};xi.getPropsList=function(e){var t=this,n=[],r=e,a=t.properties;if(r)for(var i=Object.keys(r),l=0;l<i.length;l++){var o=i[l],f=r[o],c=a[o]||a[Tw(o)],d=this.parse(c.name,f);d&&n.push(d)}return n};xi.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),a,i,l,o,f,c;for(f=0;f<t.length;f++)if(a=t[f],i=e.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=ed(o,r[0]),r[1]=td(o,r[1]);else for(l=i.strValue,c=0;c<l.length;c++)o=l.charCodeAt(c),r[0]=ed(o,r[0]),r[1]=td(o,r[1]);return r};xi.getPropertiesHash=xi.getNonDefaultPropertiesHash;var hm={};hm.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],a=r.selector,i=r.style||r.css,l=Object.keys(i);t.selector(a);for(var o=0;o<l.length;o++){var f=l[o],c=i[f];t.css(f,c)}}return t};hm.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t};hm.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,a=n.properties,i={},l=0;l<a.length;l++){var o=a[l];i[o.name]=o.strValue}e.push({selector:r?r.toString():"core",style:i})}return e};var Vw={};Vw.appendFromString=function(e){var t=this,n=this,r=""+e,a,i,l;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){r.length>a.length?r=r.substr(a.length):r=""}function f(){i.length>l.length?i=i.substr(l.length):i=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){zt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var p=d[1];if(p!=="core"){var m=new yl(p);if(m.invalid){zt("Skipping parsing of block: Invalid selector found in string stylesheet: "+p),o();continue}}var y=d[2],x=!1;i=y;for(var b=[];;){var S=i.match(/^\s*$/);if(S)break;var w=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!w){zt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+y),x=!0;break}l=w[0];var N=w[1],C=w[2],T=t.properties[N];if(!T){zt("Skipping property: Invalid property name in: "+l),f();continue}var R=n.parse(N,C);if(!R){zt("Skipping property: Invalid property definition in: "+l),f();continue}b.push({name:N,val:C}),f()}if(x){o();break}n.selector(p);for(var A=0;A<b.length;A++){var D=b[A];n.css(D.name,D.val)}o()}return n};Vw.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var Ln={};(function(){var e=Fn,t=FY,n=UY,r=VY,a=HY,i=function(ne){return"^"+ne+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},l=function(ne){var se=e+"|\\w+|"+t+"|"+n+"|"+r+"|"+a;return"^"+ne+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+se+")\\s*\\,\\s*("+se+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ln.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:l("mapData")},mapLayoutData:{mapping:!0,regex:l("mapLayoutData")},mapScratch:{mapping:!0,regex:l("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(ne,se){switch(ne.length){case 2:return se[0]!=="deg"&&se[0]!=="rad"&&se[1]!=="deg"&&se[1]!=="rad";case 1:return tt(ne[0])||se[0]==="deg"||se[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(ne){var se=ne.length;return se===1||se===2||se===4}}};var f={zeroNonZero:function(ne,se){return(ne==null||se==null)&&ne!==se||ne==0&&se!=0?!0:ne!=0&&se==0},any:function(ne,se){return ne!=se},emptyNonEmpty:function(ne,se){var ge=pl(ne),ke=pl(se);return ge&&!ke||!ge&&ke}},c=Ln.types,d=[{name:"label",type:c.text,triggersBounds:f.any,triggersZOrder:f.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any}],p=[{name:"source-label",type:c.text,triggersBounds:f.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-offset",type:c.size,triggersBounds:f.any}],m=[{name:"target-label",type:c.text,triggersBounds:f.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-offset",type:c.size,triggersBounds:f.any}],y=[{name:"font-family",type:c.fontFamily,triggersBounds:f.any},{name:"font-style",type:c.fontStyle,triggersBounds:f.any},{name:"font-weight",type:c.fontWeight,triggersBounds:f.any},{name:"font-size",type:c.size,triggersBounds:f.any},{name:"text-transform",type:c.textTransform,triggersBounds:f.any},{name:"text-wrap",type:c.textWrap,triggersBounds:f.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:f.any},{name:"text-max-width",type:c.size,triggersBounds:f.any},{name:"text-outline-width",type:c.size,triggersBounds:f.any},{name:"line-height",type:c.positiveNumber,triggersBounds:f.any}],x=[{name:"text-valign",type:c.valign,triggersBounds:f.any},{name:"text-halign",type:c.halign,triggersBounds:f.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:f.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:f.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:f.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:f.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:f.any}],b=[{name:"events",type:c.bool,triggersZOrder:f.any},{name:"text-events",type:c.bool,triggersZOrder:f.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:f.any}],S=[{name:"display",type:c.display,triggersZOrder:f.any,triggersBounds:f.any,triggersBoundsOfConnectedEdges:f.any,triggersBoundsOfParallelEdges:function(ne,se,ge){return ne===se?!1:ge.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:f.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:f.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:f.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:f.any},{name:"z-index",type:c.number,triggersZOrder:f.any}],w=[{name:"overlay-padding",type:c.size,triggersBounds:f.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"overlay-corner-radius",type:c.cornerRadius}],N=[{name:"underlay-padding",type:c.size,triggersBounds:f.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"underlay-corner-radius",type:c.cornerRadius}],C=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],T=function(ne,se){return se.value==="label"?-ne.poolIndex():se.pfValue},R=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:T},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:T},{name:"shape",type:c.nodeShape,triggersBounds:f.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:f.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:f.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:f.any}],A=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:f.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],D=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:f.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:f.any}],L=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],B=[{name:"position",type:c.position,triggersBounds:f.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:f.any},{name:"min-width",type:c.size,triggersBounds:f.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height",type:c.size,triggersBounds:f.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:f.any}],M=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:f.any,triggersBoundsOfParallelEdges:function(ne,se){return ne===se?!1:ne==="bezier"||se==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:f.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"control-point-step-size",type:c.size,triggersBounds:f.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"control-point-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"segment-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-radii",type:c.numbers,triggersBounds:f.any},{name:"radius-type",type:c.radiusType,triggersBounds:f.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:f.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:f.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:f.any},{name:"taxi-radius",type:c.number,triggersBounds:f.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:f.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:f.any},{name:"loop-direction",type:c.angle,triggersBounds:f.any},{name:"loop-sweep",type:c.angle,triggersBounds:f.any},{name:"source-distance-from-node",type:c.size,triggersBounds:f.any},{name:"target-distance-from-node",type:c.size,triggersBounds:f.any}],_=[{name:"ghost",type:c.bool,triggersBounds:f.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-opacity",type:c.zeroOneNumber}],P=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],H=[];Ln.pieBackgroundN=16,H.push({name:"pie-size",type:c.sizeMaybePercent}),H.push({name:"pie-hole",type:c.sizeMaybePercent}),H.push({name:"pie-start-angle",type:c.angle});for(var $=1;$<=Ln.pieBackgroundN;$++)H.push({name:"pie-"+$+"-background-color",type:c.color}),H.push({name:"pie-"+$+"-background-size",type:c.percent}),H.push({name:"pie-"+$+"-background-opacity",type:c.zeroOneNumber});var V=[];Ln.stripeBackgroundN=16,V.push({name:"stripe-size",type:c.sizeMaybePercent}),V.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var I=1;I<=Ln.stripeBackgroundN;I++)V.push({name:"stripe-"+I+"-background-color",type:c.color}),V.push({name:"stripe-"+I+"-background-size",type:c.percent}),V.push({name:"stripe-"+I+"-background-opacity",type:c.zeroOneNumber});var U=[],Y=Ln.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:f.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(ee){Y.forEach(function(ne){var se=ne+"-"+ee.name,ge=ee.type,ke=ee.triggersBounds;U.push({name:se,type:ge,triggersBounds:ke})})},{});var Q=Ln.properties=[].concat(b,C,S,w,N,_,x,y,d,p,m,R,A,D,L,H,V,B,M,U,P),F=Ln.propertyGroups={behavior:b,transition:C,visibility:S,overlay:w,underlay:N,ghost:_,commonLabel:x,labelDimensions:y,mainLabel:d,sourceLabel:p,targetLabel:m,nodeBody:R,nodeBorder:A,nodeOutline:D,backgroundImage:L,pie:H,stripe:V,compound:B,edgeLine:M,edgeArrow:U,core:P},q=Ln.propertyGroupNames={},X=Ln.propertyGroupKeys=Object.keys(F);X.forEach(function(ee){q[ee]=F[ee].map(function(ne){return ne.name}),F[ee].forEach(function(ne){return ne.groupKey=ee})});var z=Ln.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ln.propertyNames=Q.map(function(ee){return ee.name});for(var W=0;W<Q.length;W++){var re=Q[W];Q[re.name]=re}for(var ae=0;ae<z.length;ae++){var ie=z[ae],ye=Q[ie.pointsTo],ue={name:ie.name,alias:!0,pointsTo:ye};Q.push(ue),Q[ie.name]=ue}})();Ln.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};Ln.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=at({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var d=1;d<=Ln.pieBackgroundN;d++){var p=c.name.replace("{{i}}",d),m=c.value;f[p]=m}return f},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var d=1;d<=Ln.stripeBackgroundN;d++){var p=c.name.replace("{{i}}",d),m=c.value;f[p]=m}return f},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(f,c){return Ln.arrowPrefixes.forEach(function(d){var p=d+"-"+c.name,m=c.value;f[p]=m}),f},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,l=t[i],o=this.parse(i,l);n[i]=o}}return e.defaultProperties=n,e.defaultProperties};Ln.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var vm={};vm.parse=function(e,t,n,r){var a=this;if(mn(t))return a.parseImplWarn(e,t,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,l=n?"t":"f",o=""+t,f=vL(e,o,l,i),c=a.propCache=a.propCache||[],d;return(d=c[f])||(d=c[f]=a.parseImplWarn(e,t,n,r)),(n||r==="mapping")&&(d=ci(d),d&&(d.value=ci(d.value))),d};vm.parseImplWarn=function(e,t,n,r){var a=this.parseImpl(e,t,n,r);return!a&&t!=null&&zt("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&zt("The style value of `label` is deprecated for `"+a.name+"`"),a};vm.parseImpl=function(e,t,n,r){var a=this;e=Tw(e);var i=a.properties[e],l=t,o=a.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var f=tt(t);f&&(t=t.trim());var c=i.type;if(!c)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(mn(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};var d,p;if(!(!f||r||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(d=new RegExp(o.data.regex).exec(t))){if(n)return!1;var m=o.data;return{name:e,value:d,strValue:""+t,mapped:m,field:d[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(p=new RegExp(o.mapData.regex).exec(t))){if(n||c.multiple)return!1;var y=o.mapData;if(!(c.color||c.number))return!1;var x=this.parse(e,p[4]);if(!x||x.mapped)return!1;var b=this.parse(e,p[5]);if(!b||b.mapped)return!1;if(x.pfValue===b.pfValue||x.strValue===b.strValue)return zt("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+x.strValue+"`"),this.parse(e,x.strValue);if(c.color){var S=x.value,w=b.value,N=S[0]===w[0]&&S[1]===w[1]&&S[2]===w[2]&&(S[3]===w[3]||(S[3]==null||S[3]===1)&&(w[3]==null||w[3]===1));if(N)return!1}return{name:e,value:p,strValue:""+t,mapped:y,field:p[1],fieldMin:parseFloat(p[2]),fieldMax:parseFloat(p[3]),valueMin:x.value,valueMax:b.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var C;if(f?C=t.split(/\s+/):Yt(t)?C=t:C=[t],c.evenMultiple&&C.length%2!==0)return null;for(var T=[],R=[],A=[],D="",L=!1,B=0;B<C.length;B++){var M=a.parse(e,C[B],n,"multiple");L=L||tt(M.value),T.push(M.value),A.push(M.pfValue!=null?M.pfValue:M.value),R.push(M.units),D+=(B>0?" ":"")+M.strValue}return c.validate&&!c.validate(T,R)?null:c.singleEnum&&L?T.length===1&&tt(T[0])?{name:e,value:T[0],strValue:T[0],bypass:n}:null:{name:e,value:T,pfValue:A,strValue:D,bypass:n,units:R}}var _=function(){for(var ue=0;ue<c.enums.length;ue++){var ee=c.enums[ue];if(ee===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(c.number){var P,H="px";if(c.units&&(P=c.units),c.implicitUnits&&(H=c.implicitUnits),!c.unitless)if(f){var $="px|em"+(c.allowPercent?"|\\%":"");P&&($=P);var V=t.match("^("+Fn+")("+$+")?$");V&&(t=V[1],P=V[2]||H)}else(!P||c.implicitUnits)&&(P=H);if(t=parseFloat(t),isNaN(t)&&c.enums===void 0)return null;if(isNaN(t)&&c.enums!==void 0)return t=l,_();if(c.integer&&!OY(t)||c.min!==void 0&&(t<c.min||c.strictMin&&t===c.min)||c.max!==void 0&&(t>c.max||c.strictMax&&t===c.max))return null;var I={name:e,value:t,strValue:""+t+(P||""),units:P,bypass:n};return c.unitless||P!=="px"&&P!=="em"?I.pfValue=t:I.pfValue=P==="px"||!P?t:this.getEmSizeInPixels()*t,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?t:1e3*t),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?t:VX(t)),P==="%"&&(I.pfValue=t/100),I}else if(c.propList){var U=[],Y=""+t;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),F=0;F<Q.length;F++){var q=Q[F].trim();a.properties[q]?U.push(q):zt("`"+q+"` is not a valid property name")}if(U.length===0)return null}return{name:e,value:U,strValue:U.length===0?"none":U.join(" "),bypass:n}}else if(c.color){var X=lL(t);return X?{name:e,value:X,pfValue:X,strValue:"rgb("+X[0]+","+X[1]+","+X[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var z=_();if(z)return z}for(var W=c.regexes?c.regexes:[c.regex],re=0;re<W.length;re++){var ae=new RegExp(W[re]),ie=ae.exec(t);if(ie)return{name:e,value:c.singleRegexMatchValue?ie[1]:ie,strValue:""+t,bypass:n}}return null}else return c.string?{name:e,value:""+t,strValue:""+t,bypass:n}:c.enums?_():null};var er=function(t){if(!(this instanceof er))return new er(t);if(!kw(t)){fn("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},xr=er.prototype;xr.instanceString=function(){return"style"};xr.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};xr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};xr.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};xr.selector=function(e){var t=e==="core"?null:new yl(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this};xr.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var a=e.properties[r],i=n[a.name];i===void 0&&(i=n[em(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this};xr.style=xr.css;xr.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this};xr.append=function(e){return aL(e)?e.appendToStyle(this):Yt(e)?this.appendFromJson(e):tt(e)&&this.appendFromString(e),this};er.fromJson=function(e,t){var n=new er(e);return n.fromJson(t),n};er.fromString=function(e,t){return new er(e).fromString(t)};[tr,qd,Uw,xi,hm,Vw,Ln,vm].forEach(function(e){at(xr,e)});er.types=xr.types;er.properties=xr.properties;er.propertyGroups=xr.propertyGroups;er.propertyGroupNames=xr.propertyGroupNames;er.propertyGroupKeys=xr.propertyGroupKeys;var KZ={style:function(t){if(t){var n=this.setStyle(t);n.update()}return this._private.style},setStyle:function(t){var n=this._private;return aL(t)?n.style=t.generateStyle(this):Yt(t)?n.style=er.fromJson(this,t):tt(t)?n.style=er.fromString(this,t):n.style=er(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},YZ="single",Co={autolock:function(t){if(t!==void 0)this._private.autolock=!!t;else return this._private.autolock;return this},autoungrabify:function(t){if(t!==void 0)this._private.autoungrabify=!!t;else return this._private.autoungrabify;return this},autounselectify:function(t){if(t!==void 0)this._private.autounselectify=!!t;else return this._private.autounselectify;return this},selectionType:function(t){var n=this._private;if(n.selectionType==null&&(n.selectionType=YZ),t!==void 0)(t==="additive"||t==="single")&&(n.selectionType=t);else return n.selectionType;return this},panningEnabled:function(t){if(t!==void 0)this._private.panningEnabled=!!t;else return this._private.panningEnabled;return this},userPanningEnabled:function(t){if(t!==void 0)this._private.userPanningEnabled=!!t;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(t){if(t!==void 0)this._private.zoomingEnabled=!!t;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(t){if(t!==void 0)this._private.userZoomingEnabled=!!t;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(t){if(t!==void 0)this._private.boxSelectionEnabled=!!t;else return this._private.boxSelectionEnabled;return this},pan:function(){var t=arguments,n=this._private.pan,r,a,i,l,o;switch(t.length){case 0:return n;case 1:if(tt(t[0]))return r=t[0],n[r];if(Dt(t[0])){if(!this._private.panningEnabled)return this;i=t[0],l=i.x,o=i.y,Ae(l)&&(n.x=l),Ae(o)&&(n.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=t[0],a=t[1],(r==="x"||r==="y")&&Ae(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(t,n){var r=arguments,a=this._private.pan,i,l,o,f,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Dt(t)&&(o=r[0],f=o.x,c=o.y,Ae(f)&&(a.x+=f),Ae(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=t,l=n,(i==="x"||i==="y")&&Ae(l)&&(a[i]+=l),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(t,n){var r=this.getFitViewport(t,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(t,n){if(Ae(t)&&n===void 0&&(n=t,t=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(tt(t)){var a=t;t=this.$(a)}else if(BY(t)){var i=t;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else oa(t)||(t=this.mutableElements());if(!(oa(t)&&t.empty())){r=r||t.boundingBox();var l=this.width(),o=this.height(),f;if(n=Ae(n)?n:0,!isNaN(l)&&!isNaN(o)&&l>0&&o>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){f=Math.min((l-2*n)/r.w,(o-2*n)/r.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f<this._private.minZoom?this._private.minZoom:f;var c={x:(l-f*(r.x1+r.x2))/2,y:(o-f*(r.y1+r.y2))/2};return{zoom:f,pan:c}}}}},zoomRange:function(t,n){var r=this._private;if(n==null){var a=t;t=a.min,n=a.max}return Ae(t)&&Ae(n)&&t<=n?(r.minZoom=t,r.maxZoom=n):Ae(t)&&n===void 0&&t<=r.maxZoom?r.minZoom=t:Ae(n)&&t===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(t){return t===void 0?this._private.minZoom:this.zoomRange({min:t})},maxZoom:function(t){return t===void 0?this._private.maxZoom:this.zoomRange({max:t})},getZoomedViewport:function(t){var n=this._private,r=n.pan,a=n.zoom,i,l,o=!1;if(n.zoomingEnabled||(o=!0),Ae(t)?l=t:Dt(t)&&(l=t.level,t.position!=null?i=rm(t.position,a,r):t.renderedPosition!=null&&(i=t.renderedPosition),i!=null&&!n.panningEnabled&&(o=!0)),l=l>n.maxZoom?n.maxZoom:l,l=l<n.minZoom?n.minZoom:l,o||!Ae(l)||l===a||i!=null&&(!Ae(i.x)||!Ae(i.y)))return null;if(i!=null){var f=r,c=a,d=l,p={x:-d/c*(i.x-f.x)+i.x,y:-d/c*(i.y-f.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:p}}else return{zoomed:!0,panned:!1,zoom:l,pan:r}},zoom:function(t){if(t===void 0)return this._private.zoom;var n=this.getZoomedViewport(t),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(t){var n=this._private,r=!0,a=!0,i=[],l=!1,o=!1;if(!t)return this;if(Ae(t.zoom)||(r=!1),Dt(t.pan)||(a=!1),!r&&!a)return this;if(r){var f=t.zoom;f<n.minZoom||f>n.maxZoom||!n.zoomingEnabled?l=!0:(n.zoom=f,i.push("zoom"))}if(a&&(!l||!t.cancelOnFailedZoom)&&n.panningEnabled){var c=t.pan;Ae(c.x)&&(n.pan.x=c.x,o=!1),Ae(c.y)&&(n.pan.y=c.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(t){var n=this.getCenterPan(t);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(t,n){if(this._private.panningEnabled){if(tt(t)){var r=t;t=this.mutableElements().filter(r)}else oa(t)||(t=this.mutableElements());if(t.length!==0){var a=t.boundingBox(),i=this.width(),l=this.height();n=n===void 0?this._private.zoom:n;var o={x:(i-n*(a.x1+a.x2))/2,y:(l-n*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var t=this._private,n=t.container,r=this;return t.sizeCache=t.sizeCache||(n?(function(){var a=r.window().getComputedStyle(n),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var t=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-t.x)/n,x2:(r.x2-t.x)/n,y1:(r.y1-t.y)/n,y2:(r.y2-t.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var t=this.width(),n=this.height();return{x1:0,y1:0,x2:t,y2:n,w:t,h:n}},multiClickDebounceTime:function(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};Co.centre=Co.center;Co.autolockNodes=Co.autolock;Co.autoungrabifyNodes=Co.autoungrabify;var ld={data:Pt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Pt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Pt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Pt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ld.attr=ld.data;ld.removeAttr=ld.removeData;var od=function(t){var n=this;t=at({},t);var r=t.container;r&&!pp(r)&&pp(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var l=zn!==void 0&&r!==void 0&&!t.headless,o=t;o.layout=at({name:l?"grid":"null"},o.layout),o.renderer=at({name:l?"canvas":"null"},o.renderer);var f=function(x,b,S){return b!==void 0?b:S!==void 0?S:x},c=this._private={container:r,ready:!1,options:o,elements:new ur(this),listeners:[],aniEles:new ur(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,o.zoomingEnabled),userZoomingEnabled:f(!0,o.userZoomingEnabled),panningEnabled:f(!0,o.panningEnabled),userPanningEnabled:f(!0,o.userPanningEnabled),boxSelectionEnabled:f(!0,o.boxSelectionEnabled),autolock:f(!1,o.autolock,o.autolockNodes),autoungrabify:f(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:f(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?l:o.styleEnabled,zoom:Ae(o.zoom)?o.zoom:1,pan:{x:Dt(o.pan)&&Ae(o.pan.x)?o.pan.x:0,y:Dt(o.pan)&&Ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var d=function(x,b){var S=x.some(PY);if(S)return bc.all(x).then(b);b(x)};c.styleEnabled&&n.setStyle([]);var p=at({},o,o.renderer);n.initRenderer(p);var m=function(x,b,S){n.notifications(!1);var w=n.mutableElements();w.length>0&&w.remove(),x!=null&&(Dt(x)||Yt(x))&&n.add(x),n.one("layoutready",function(C){n.notifications(!0),n.emit(C),n.one("load",b),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",S),n.emit("done")});var N=at({},n._private.options.layout);N.eles=n.elements(),n.layout(N).run()};d([o.style,o.elements],function(y){var x=y[0],b=y[1];c.styleEnabled&&n.style().append(x),m(b,function(){n.startAnimationLoop(),c.ready=!0,mn(o.ready)&&n.on("ready",o.ready);for(var S=0;S<i.length;S++){var w=i[S];n.on("ready",w)}a&&(a.readies=[]),n.emit("ready")},o.done)})},Sp=od.prototype;at(Sp,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this},destroy:function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t},hasElementWithId:function(t){return this._private.elements.hasElementWithId(t)},getElementById:function(t){return this._private.elements.getElementById(t)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(t){return this._private.elements.merge(t),this},removeFromPool:function(t){return this._private.elements.unmerge(t),this},container:function(){return this._private.container||null},window:function(){var t=this._private.container;if(t==null)return zn;var n=this._private.container.ownerDocument;return n===void 0||n==null?zn:n.defaultView||zn},mount:function(t){if(t!=null){var n=this,r=n._private,a=r.options;return!pp(t)&&pp(t[0])&&(t=t[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=t,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(at({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t},options:function(){return ci(this._private.options)},json:function(t){var n=this,r=n._private,a=n.mutableElements(),i=function(T){return n.getElementById(T.id())};if(Dt(t)){if(n.startBatch(),t.elements){var l={},o=function(T,R){for(var A=[],D=[],L=0;L<T.length;L++){var B=T[L];if(!B.data.id){zt("cy.json() cannot handle elements without an ID attribute");continue}var M=""+B.data.id,_=n.getElementById(M);l[M]=!0,_.length!==0?D.push({ele:_,json:B}):(R&&(B.group=R),A.push(B))}n.add(A);for(var P=0;P<D.length;P++){var H=D[P],$=H.ele,V=H.json;$.json(V)}};if(Yt(t.elements))o(t.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var d=f[c],p=t.elements[d];Yt(p)&&o(p,d)}var m=n.collection();a.filter(function(C){return!l[C.id()]}).forEach(function(C){C.isParent()?m.merge(C):C.remove()}),m.forEach(function(C){return C.children().move({parent:null})}),m.forEach(function(C){return i(C).remove()})}t.style&&n.style(t.style),t.zoom!=null&&t.zoom!==r.zoom&&n.zoom(t.zoom),t.pan&&(t.pan.x!==r.pan.x||t.pan.y!==r.pan.y)&&n.pan(t.pan),t.data&&n.data(t.data);for(var y=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],x=0;x<y.length;x++){var b=y[x];t[b]!=null&&n[b](t[b])}return n.endBatch(),this}else{var S=!!t,w={};S?w.elements=this.elements().map(function(C){return C.json()}):(w.elements={},a.forEach(function(C){var T=C.group();w.elements[T]||(w.elements[T]=[]),w.elements[T].push(C.json())})),this._private.styleEnabled&&(w.style=n.style().json()),w.data=ci(n.data());var N=r.options;return w.zoomingEnabled=r.zoomingEnabled,w.userZoomingEnabled=r.userZoomingEnabled,w.zoom=r.zoom,w.minZoom=r.minZoom,w.maxZoom=r.maxZoom,w.panningEnabled=r.panningEnabled,w.userPanningEnabled=r.userPanningEnabled,w.pan=ci(r.pan),w.boxSelectionEnabled=r.boxSelectionEnabled,w.renderer=ci(N.renderer),w.hideEdgesOnViewport=N.hideEdgesOnViewport,w.textureOnViewport=N.textureOnViewport,w.wheelSensitivity=N.wheelSensitivity,w.motionBlur=N.motionBlur,w.multiClickDebounceTime=N.multiClickDebounceTime,w}}});Sp.$id=Sp.getElementById;[PZ,UZ,a_,Jb,Yv,HZ,e1,Xv,KZ,Co,ld].forEach(function(e){at(Sp,e)});var XZ={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}},QZ={maximal:!1,acyclic:!1},bu=function(t){return t.scratch("breadthfirst")},Fj=function(t,n){return t.scratch("breadthfirst",n)};function i_(e){this.options=at({},XZ,QZ,e)}i_.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(Ve){return Ve.isChildless()}),a=n,i=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,o=!!e.boundingBox,f=jr(o?e.boundingBox:structuredClone(t.extent())),c;if(oa(e.roots))c=e.roots;else if(Yt(e.roots)){for(var d=[],p=0;p<e.roots.length;p++){var m=e.roots[p],y=t.getElementById(m);d.push(y)}c=t.collection(d)}else if(tt(e.roots))c=t.$(e.roots);else if(i)c=r.roots();else{var x=n.components();c=t.collection();for(var b=function(){var Re=x[S],Ke=Re.maxDegree(!1),Xe=Re.filter(function(st){return st.degree(!1)===Ke});c=c.add(Xe)},S=0;S<x.length;S++)b()}var w=[],N={},C=function(Re,Ke){w[Ke]==null&&(w[Ke]=[]);var Xe=w[Ke].length;w[Ke].push(Re),Fj(Re,{index:Xe,depth:Ke})},T=function(Re,Ke){var Xe=bu(Re),st=Xe.depth,ze=Xe.index;w[st][ze]=null,Re.isChildless()&&C(Re,Ke)};a.bfs({roots:c,directed:e.directed,visit:function(Re,Ke,Xe,st,ze){var dt=Re[0],he=dt.id();dt.isChildless()&&C(dt,ze),N[he]=!0}});for(var R=[],A=0;A<r.length;A++){var D=r[A];N[D.id()]||R.push(D)}var L=function(Re){for(var Ke=w[Re],Xe=0;Xe<Ke.length;Xe++){var st=Ke[Xe];if(st==null){Ke.splice(Xe,1),Xe--;continue}Fj(st,{depth:Re,index:Xe})}},B=function(Re,Ke){for(var Xe=bu(Re),st=Re.incomers().filter(function(Me){return Me.isNode()&&n.has(Me)}),ze=-1,dt=Re.id(),he=0;he<st.length;he++){var Ce=st[he],De=bu(Ce);ze=Math.max(ze,De.depth)}if(Xe.depth<=ze){if(!e.acyclic&&Ke[dt])return null;var Fe=ze+1;return T(Re,Fe),Ke[dt]=Fe,!0}return!1};if(i&&l){var M=[],_={},P=function(Re){return M.push(Re)},H=function(){return M.shift()};for(r.forEach(function(Ve){return M.push(Ve)});M.length>0;){var $=H(),V=B($,_);if(V)$.outgoers().filter(function(Ve){return Ve.isNode()&&n.has(Ve)}).forEach(P);else if(V===null){zt("Detected double maximal shift for node `"+$.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(e.avoidOverlap)for(var U=0;U<r.length;U++){var Y=r[U],Q=Y.layoutDimensions(e),F=Q.w,q=Q.h;I=Math.max(I,F,q)}var X={},z=function(Re){if(X[Re.id()])return X[Re.id()];for(var Ke=bu(Re).depth,Xe=Re.neighborhood(),st=0,ze=0,dt=0;dt<Xe.length;dt++){var he=Xe[dt];if(!(he.isEdge()||he.isParent()||!r.has(he))){var Ce=bu(he);if(Ce!=null){var De=Ce.index,Fe=Ce.depth;if(!(De==null||Fe==null)){var Me=w[Fe].length;Fe<Ke&&(st+=De/Me,ze++)}}}}return ze=Math.max(1,ze),st=st/ze,ze===0&&(st=0),X[Re.id()]=st,st},W=function(Re,Ke){var Xe=z(Re),st=z(Ke),ze=Xe-st;return ze===0?sL(Re.id(),Ke.id()):ze};e.depthSort!==void 0&&(W=e.depthSort);for(var re=w.length,ae=0;ae<re;ae++)w[ae].sort(W),L(ae);for(var ie=[],ye=0;ye<R.length;ye++)ie.push(R[ye]);var ue=function(){for(var Re=0;Re<re;Re++)L(Re)};ie.length&&(w.unshift(ie),re=w.length,ue());for(var ee=0,ne=0;ne<re;ne++)ee=Math.max(w[ne].length,ee);var se={x:f.x1+f.w/2,y:f.y1+f.h/2},ge=r.reduce(function(Ve,Re){return(function(Ke){return{w:Ve.w===-1?Ke.w:(Ve.w+Ke.w)/2,h:Ve.h===-1?Ke.h:(Ve.h+Ke.h)/2}})(Re.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ke=Math.max(re===1?0:o?(f.h-e.padding*2-ge.h)/(re-1):(f.h-e.padding*2-ge.h)/(re+1),I),Pe=w.reduce(function(Ve,Re){return Math.max(Ve,Re.length)},0),lt=function(Re){var Ke=bu(Re),Xe=Ke.depth,st=Ke.index;if(e.circle){var ze=Math.min(f.w/2/re,f.h/2/re);ze=Math.max(ze,I);var dt=ze*Xe+ze-(re>0&&w[0].length<=3?ze/2:0),he=2*Math.PI/w[Xe].length*st;return Xe===0&&w[0].length===1&&(dt=1),{x:se.x+dt*Math.cos(he),y:se.y+dt*Math.sin(he)}}else{var Ce=w[Xe].length,De=Math.max(Ce===1?0:o?(f.w-e.padding*2-ge.w)/((e.grid?Pe:Ce)-1):(f.w-e.padding*2-ge.w)/((e.grid?Pe:Ce)+1),I),Fe={x:se.x+(st+1-(Ce+1)/2)*De,y:se.y+(Xe+1-(re+1)/2)*ke};return Fe}},Je={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Je).indexOf(e.direction)===-1&&fn("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Je).join(", ")));var We=function(Re){return dX(lt(Re),f,Je[e.direction])};return n.nodes().layoutPositions(this,e,We),this};var WZ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function s_(e){this.options=at({},WZ,e)}s_.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var l=jr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,c=f/Math.max(1,i.length-1),d,p=0,m=0;m<i.length;m++){var y=i[m],x=y.layoutDimensions(t),b=x.w,S=x.h;p=Math.max(p,b,S)}if(Ae(t.radius)?d=t.radius:i.length<=1?d=0:d=Math.min(l.h,l.w)/2-p,i.length>1&&t.avoidOverlap){p*=1.75;var w=Math.cos(c)-Math.cos(0),N=Math.sin(c)-Math.sin(0),C=Math.sqrt(p*p/(w*w+N*N));d=Math.max(C,d)}var T=function(A,D){var L=t.startAngle+D*c*(a?1:-1),B=d*Math.cos(L),M=d*Math.sin(L),_={x:o.x+B,y:o.y+M};return _};return r.nodes().layoutPositions(this,t,T),this};var ZZ={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(t){return t.degree()},levelWidth:function(t){return t.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function l_(e){this.options=at({},ZZ,e)}l_.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,r=e.cy,a=t.eles,i=a.nodes().not(":parent"),l=jr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=[],c=0,d=0;d<i.length;d++){var p=i[d],m=void 0;m=t.concentric(p),f.push({value:m,node:p}),p._private.scratch.concentric=m}i.updateStyle();for(var y=0;y<i.length;y++){var x=i[y],b=x.layoutDimensions(t);c=Math.max(c,b.w,b.h)}f.sort(function(ke,Pe){return Pe.value-ke.value});for(var S=t.levelWidth(i),w=[[]],N=w[0],C=0;C<f.length;C++){var T=f[C];if(N.length>0){var R=Math.abs(N[0].value-T.value);R>=S&&(N=[],w.push(N))}N.push(T)}var A=c+t.minNodeSpacing;if(!t.avoidOverlap){var D=w.length>0&&w[0].length>1,L=Math.min(l.w,l.h)/2-A,B=L/(w.length+D?1:0);A=Math.min(A,B)}for(var M=0,_=0;_<w.length;_++){var P=w[_],H=t.sweep===void 0?2*Math.PI-2*Math.PI/P.length:t.sweep,$=P.dTheta=H/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var V=Math.cos($)-Math.cos(0),I=Math.sin($)-Math.sin(0),U=Math.sqrt(A*A/(V*V+I*I));M=Math.max(U,M)}P.r=M,M+=A}if(t.equidistant){for(var Y=0,Q=0,F=0;F<w.length;F++){var q=w[F],X=q.r-Q;Y=Math.max(Y,X)}Q=0;for(var z=0;z<w.length;z++){var W=w[z];z===0&&(Q=W.r),W.r=Q,Q+=Y}}for(var re={},ae=0;ae<w.length;ae++)for(var ie=w[ae],ye=ie.dTheta,ue=ie.r,ee=0;ee<ie.length;ee++){var ne=ie[ee],se=t.startAngle+(n?1:-1)*ye*ee,ge={x:o.x+ue*Math.cos(se),y:o.y+ue*Math.sin(se)};re[ne.node.id()]=ge}return a.nodes().layoutPositions(this,t,function(ke){var Pe=ke.id();return re[Pe]}),this};var L0,JZ={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(t,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(t){return 2048},nodeOverlap:4,idealEdgeLength:function(t){return 32},edgeElasticity:function(t){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function pm(e){this.options=at({},JZ,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),l=a.target().data("id"),o=t.some(function(c){return c.data("id")===i}),f=t.some(function(c){return c.data("id")===l});return!o||!f});this.options.eles=this.options.eles.not(r)}pm.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:"layoutstart",layout:n}),e.debug===!0?L0=!0:L0=!1;var r=eJ(t,n,e);L0&&nJ(r),e.randomize&&rJ(r);var a=is(),i=function(){aJ(r,t,e),e.fit===!0&&t.fit(e.padding)},l=function(m){return!(n.stopped||m>=e.numIter||(iJ(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},o=function(){if(e.animate===!0||e.animate===!1)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var m=e.eles.nodes(),y=u_(r,e,m);m.layoutPositions(n,e,y)}},f=0,c=!0;if(e.animate===!0){var d=function(){for(var m=0;c&&m<e.refresh;)c=l(f),f++,m++;if(!c)Uj(r,e),o();else{var y=is();y-a>=e.animationThreshold&&i(),mp(d)}};d()}else{for(;c;)c=l(f),f++;Uj(r,e),o()}return this};pm.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};pm.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var eJ=function(t,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),l=jr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:l.w,clientHeight:l.h,boundingBox:l},f=r.eles.components(),c={},d=0;d<f.length;d++)for(var p=f[d],m=0;m<p.length;m++){var y=p[m];c[y.id()]=d}for(var d=0;d<o.nodeSize;d++){var x=i[d],b=x.layoutDimensions(r),S={};S.isLocked=x.locked(),S.id=x.data("id"),S.parentId=x.data("parent"),S.cmptId=c[x.id()],S.children=[],S.positionX=x.position("x"),S.positionY=x.position("y"),S.offsetX=0,S.offsetY=0,S.height=b.w,S.width=b.h,S.maxX=S.positionX+S.width/2,S.minX=S.positionX-S.width/2,S.maxY=S.positionY+S.height/2,S.minY=S.positionY-S.height/2,S.padLeft=parseFloat(x.style("padding")),S.padRight=parseFloat(x.style("padding")),S.padTop=parseFloat(x.style("padding")),S.padBottom=parseFloat(x.style("padding")),S.nodeRepulsion=mn(r.nodeRepulsion)?r.nodeRepulsion(x):r.nodeRepulsion,o.layoutNodes.push(S),o.idToIndex[S.id]=d}for(var w=[],N=0,C=-1,T=[],d=0;d<o.nodeSize;d++){var x=o.layoutNodes[d],R=x.parentId;R!=null?o.layoutNodes[o.idToIndex[R]].children.push(x.id):(w[++C]=x.id,T.push(x.id))}for(o.graphSet.push(T);N<=C;){var A=w[N++],D=o.idToIndex[A],y=o.layoutNodes[D],L=y.children;if(L.length>0){o.graphSet.push(L);for(var d=0;d<L.length;d++)w[++C]=L[d]}}for(var d=0;d<o.graphSet.length;d++)for(var B=o.graphSet[d],m=0;m<B.length;m++){var M=o.idToIndex[B[m]];o.indexToGraph[M]=d}for(var d=0;d<o.edgeSize;d++){var _=a[d],P={};P.id=_.data("id"),P.sourceId=_.data("source"),P.targetId=_.data("target");var H=mn(r.idealEdgeLength)?r.idealEdgeLength(_):r.idealEdgeLength,$=mn(r.edgeElasticity)?r.edgeElasticity(_):r.edgeElasticity,V=o.idToIndex[P.sourceId],I=o.idToIndex[P.targetId],U=o.indexToGraph[V],Y=o.indexToGraph[I];if(U!=Y){for(var Q=tJ(P.sourceId,P.targetId,o),F=o.graphSet[Q],q=0,S=o.layoutNodes[V];F.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],q++;for(S=o.layoutNodes[I];F.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],q++;H*=q*r.nestingFactor}P.idealLength=H,P.elasticity=$,o.layoutEdges.push(P)}return o},tJ=function(t,n,r){var a=o_(t,n,0,r);return 2>a.count?0:a.graph},o_=function(t,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:r};for(var l=0,o=0;o<i.length;o++){var f=i[o],c=a.idToIndex[f],d=a.layoutNodes[c].children;if(d.length!==0){var p=a.indexToGraph[a.idToIndex[d[0]]],m=o_(t,n,p,a);if(m.count!==0)if(m.count===1){if(l++,l===2)break}else return m}}return{count:l,graph:r}},nJ,rJ=function(t,n){for(var r=t.clientWidth,a=t.clientHeight,i=0;i<t.nodeSize;i++){var l=t.layoutNodes[i];l.children.length===0&&!l.isLocked&&(l.positionX=Math.random()*r,l.positionY=Math.random()*a)}},u_=function(t,n,r){var a=t.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(l){var o=t.layoutNodes[t.idToIndex[l.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(l,o){var f=t.layoutNodes[t.idToIndex[l.data("id")]];if(n.boundingBox){var c=i.w===0?.5:(f.positionX-i.x1)/i.w,d=i.h===0?.5:(f.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+d*a.h}}else return{x:f.positionX,y:f.positionY}}},aJ=function(t,n,r){var a=r.layout,i=r.eles.nodes(),l=u_(t,r,i);i.positions(l),t.ready!==!0&&(t.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},iJ=function(t,n,r){sJ(t,n),uJ(t),cJ(t,n),fJ(t),dJ(t)},sJ=function(t,n){for(var r=0;r<t.graphSet.length;r++)for(var a=t.graphSet[r],i=a.length,l=0;l<i;l++)for(var o=t.layoutNodes[t.idToIndex[a[l]]],f=l+1;f<i;f++){var c=t.layoutNodes[t.idToIndex[a[f]]];lJ(o,c,t,n)}},qj=function(t){return-1+2*t*Math.random()},lJ=function(t,n,r,a){var i=t.cmptId,l=n.cmptId;if(!(i!==l&&!r.isCompound)){var o=n.positionX-t.positionX,f=n.positionY-t.positionY,c=1;o===0&&f===0&&(o=qj(c),f=qj(c));var d=oJ(t,n,o,f);if(d>0)var p=a.nodeOverlap*d,m=Math.sqrt(o*o+f*f),y=p*o/m,x=p*f/m;else var b=Ep(t,o,f),S=Ep(n,-1*o,-1*f),w=S.x-b.x,N=S.y-b.y,C=w*w+N*N,m=Math.sqrt(C),p=(t.nodeRepulsion+n.nodeRepulsion)/C,y=p*w/m,x=p*N/m;t.isLocked||(t.offsetX-=y,t.offsetY-=x),n.isLocked||(n.offsetX+=y,n.offsetY+=x)}},oJ=function(t,n,r,a){if(r>0)var i=t.maxX-n.minX;else var i=n.maxX-t.minX;if(a>0)var l=t.maxY-n.minY;else var l=n.maxY-t.minY;return i>=0&&l>=0?Math.sqrt(i*i+l*l):0},Ep=function(t,n,r){var a=t.positionX,i=t.positionY,l=t.height||1,o=t.width||1,f=r/n,c=l/o,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+l/2,d):0<n&&-1*c<=f&&f<=c?(d.x=a+o/2,d.y=i+o*r/2/n,d):0>n&&-1*c<=f&&f<=c?(d.x=a-o/2,d.y=i-o*r/2/n,d):0<r&&(f<=-1*c||f>=c)?(d.x=a+l*n/2/r,d.y=i+l/2,d):(0>r&&(f<=-1*c||f>=c)&&(d.x=a-l*n/2/r,d.y=i-l/2),d)},uJ=function(t,n){for(var r=0;r<t.edgeSize;r++){var a=t.layoutEdges[r],i=t.idToIndex[a.sourceId],l=t.layoutNodes[i],o=t.idToIndex[a.targetId],f=t.layoutNodes[o],c=f.positionX-l.positionX,d=f.positionY-l.positionY;if(!(c===0&&d===0)){var p=Ep(l,c,d),m=Ep(f,-1*c,-1*d),y=m.x-p.x,x=m.y-p.y,b=Math.sqrt(y*y+x*x),S=Math.pow(a.idealLength-b,2)/a.elasticity;if(b!==0)var w=S*y/b,N=S*x/b;else var w=0,N=0;l.isLocked||(l.offsetX+=w,l.offsetY+=N),f.isLocked||(f.offsetX-=w,f.offsetY-=N)}}},cJ=function(t,n){if(n.gravity!==0)for(var r=1,a=0;a<t.graphSet.length;a++){var i=t.graphSet[a],l=i.length;if(a===0)var o=t.clientHeight/2,f=t.clientWidth/2;else var c=t.layoutNodes[t.idToIndex[i[0]]],d=t.layoutNodes[t.idToIndex[c.parentId]],o=d.positionX,f=d.positionY;for(var p=0;p<l;p++){var m=t.layoutNodes[t.idToIndex[i[p]]];if(!m.isLocked){var y=o-m.positionX,x=f-m.positionY,b=Math.sqrt(y*y+x*x);if(b>r){var S=n.gravity*y/b,w=n.gravity*x/b;m.offsetX+=S,m.offsetY+=w}}}}},fJ=function(t,n){var r=[],a=0,i=-1;for(r.push.apply(r,t.graphSet[0]),i+=t.graphSet[0].length;a<=i;){var l=r[a++],o=t.idToIndex[l],f=t.layoutNodes[o],c=f.children;if(0<c.length&&!f.isLocked){for(var d=f.offsetX,p=f.offsetY,m=0;m<c.length;m++){var y=t.layoutNodes[t.idToIndex[c[m]]];y.offsetX+=d,y.offsetY+=p,r[++i]=c[m]}f.offsetX=0,f.offsetY=0}}},dJ=function(t,n){for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=hJ(a.offsetX,a.offsetY,t.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,c_(a,t)}}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},hJ=function(t,n,r){var a=Math.sqrt(t*t+n*n);if(a>r)var i={x:r*t/a,y:r*n/a};else var i={x:t,y:n};return i},c_=function(t,n){var r=t.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],i=!1;if((a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,i=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,i=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,i=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,i=!0),i)return c_(a,n)}},Uj=function(t,n){for(var r=t.layoutNodes,a=[],i=0;i<r.length;i++){var l=r[i],o=l.cmptId,f=a[o]=a[o]||[];f.push(l)}for(var c=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var p=0;p<d.length;p++){var m=d[p];d.x1=Math.min(d.x1,m.positionX-m.width/2),d.x2=Math.max(d.x2,m.positionX+m.width/2),d.y1=Math.min(d.y1,m.positionY-m.height/2),d.y2=Math.max(d.y2,m.positionY+m.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}a.sort(function(N,C){return C.w*C.h-N.w*N.h});for(var y=0,x=0,b=0,S=0,w=Math.sqrt(c)*t.clientWidth/t.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var p=0;p<d.length;p++){var m=d[p];m.isLocked||(m.positionX+=y-d.x1,m.positionY+=x-d.y1)}y+=d.w+n.componentSpacing,b+=d.w+n.componentSpacing,S=Math.max(S,d.h),b>w&&(x+=S+n.componentSpacing,y=0,b=0,S=0)}}},vJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(t){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function f_(e){this.options=at({},vJ,e)}f_.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var i=jr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,t,function(z){return{x:i.x1,y:i.y1}});else{var l=a.size(),o=Math.sqrt(l*i.h/i.w),f=Math.round(o),c=Math.round(i.w/i.h*o),d=function(W){if(W==null)return Math.min(f,c);var re=Math.min(f,c);re==f?f=W:c=W},p=function(W){if(W==null)return Math.max(f,c);var re=Math.max(f,c);re==f?f=W:c=W},m=t.rows,y=t.cols!=null?t.cols:t.columns;if(m!=null&&y!=null)f=m,c=y;else if(m!=null&&y==null)f=m,c=Math.ceil(l/f);else if(m==null&&y!=null)c=y,f=Math.ceil(l/c);else if(c*f>l){var x=d(),b=p();(x-1)*b>=l?d(x-1):(b-1)*x>=l&&p(b-1)}else for(;c*f<l;){var S=d(),w=p();(w+1)*S>=l?p(w+1):d(S+1)}var N=i.w/c,C=i.h/f;if(t.condense&&(N=0,C=0),t.avoidOverlap)for(var T=0;T<a.length;T++){var R=a[T],A=R._private.position;(A.x==null||A.y==null)&&(A.x=0,A.y=0);var D=R.layoutDimensions(t),L=t.avoidOverlapPadding,B=D.w+L,M=D.h+L;N=Math.max(N,B),C=Math.max(C,M)}for(var _={},P=function(W,re){return!!_["c-"+W+"-"+re]},H=function(W,re){_["c-"+W+"-"+re]=!0},$=0,V=0,I=function(){V++,V>=c&&(V=0,$++)},U={},Y=0;Y<a.length;Y++){var Q=a[Y],F=t.position(Q);if(F&&(F.row!==void 0||F.col!==void 0)){var q={row:F.row,col:F.col};if(q.col===void 0)for(q.col=0;P(q.row,q.col);)q.col++;else if(q.row===void 0)for(q.row=0;P(q.row,q.col);)q.row++;U[Q.id()]=q,H(q.row,q.col)}}var X=function(W,re){var ae,ie;if(W.locked()||W.isParent())return!1;var ye=U[W.id()];if(ye)ae=ye.col*N+N/2+i.x1,ie=ye.row*C+C/2+i.y1;else{for(;P($,V);)I();ae=V*N+N/2+i.x1,ie=$*C+C/2+i.y1,H($,V),I()}return{x:ae,y:ie}};a.layoutPositions(this,t,X)}return this};var pJ={ready:function(){},stop:function(){}};function Hw(e){this.options=at({},pJ,e)}Hw.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this};Hw.prototype.stop=function(){return this};var mJ={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function d_(e){this.options=at({},mJ,e)}d_.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),r=mn(e.positions);function a(i){if(e.positions==null)return zX(i.position());if(r)return e.positions(i);var l=e.positions[i._private.data.id];return l??null}return n.layoutPositions(this,e,function(i,l){var o=a(i);return i.locked()||o==null?!1:o}),this};var gJ={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function h_(e){this.options=at({},gJ,e)}h_.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=jr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),a=function(l,o){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,e,a),this};var yJ=[{name:"breadthfirst",impl:i_},{name:"circle",impl:s_},{name:"concentric",impl:l_},{name:"cose",impl:pm},{name:"grid",impl:f_},{name:"null",impl:Hw},{name:"preset",impl:d_},{name:"random",impl:h_}];function v_(e){this.options=e,this.notifications=0}var Vj=function(){},Hj=function(){throw new Error("A headless instance can not render images")};v_.prototype={recalculateRenderedStyle:Vj,notify:function(){this.notifications++},init:Vj,isHeadless:function(){return!0},png:Hj,jpg:Hj};var $w={};$w.arrowShapeWidth=.3;$w.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,d,p,m,y,x,b){var S=y.x-p/2-b,w=y.x+p/2+b,N=y.y-p/2-b,C=y.y+p/2+b,T=S<=c&&c<=w&&N<=d&&d<=C;return T},r=function(c,d,p,m,y){var x=c*Math.cos(m)-d*Math.sin(m),b=c*Math.sin(m)+d*Math.cos(m),S=x*p,w=b*p,N=S+y.x,C=w+y.y;return{x:N,y:C}},a=function(c,d,p,m){for(var y=[],x=0;x<c.length;x+=2){var b=c[x],S=c[x+1];y.push(r(b,S,d,p,m))}return y},i=function(c){for(var d=[],p=0;p<c.length;p++){var m=c[p];d.push(m.x,m.y)}return d},l=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},o=function(c,d){tt(d)&&(d=e[d]),e[c]=at({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(m,y,x,b,S,w){var N=i(a(this.points,x+2*w,b,S)),C=Hr(m,y,N);return C},roughCollide:n,draw:function(m,y,x,b){var S=a(this.points,y,x,b);t.arrowShapeImpl("polygon")(m,S)},spacing:function(m){return 0},gap:l},d)};o("none",{collide:gp,roughCollide:gp,draw:Rw,spacing:aT,gap:aT}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,p,m,y){var x=a(this.points,d,p,m),b=this.controlPoint,S=r(b[0],b[1],d,p,m);t.arrowShapeImpl(this.name)(c,x,S)},gap:function(c){return l(c)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,p,m,y,x,b){var S=i(a(this.points,p+2*b,m,y)),w=i(a(this.pointsTee,p+2*b,m,y)),N=Hr(c,d,S)||Hr(c,d,w);return N},draw:function(c,d,p,m,y){var x=a(this.points,d,p,m),b=a(this.pointsTee,d,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,p,m,y,x,b){var S=y,w=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((p+2*b)*this.radius,2),N=i(a(this.points,p+2*b,m,y));return Hr(c,d,N)||w},draw:function(c,d,p,m,y){var x=a(this.pointsTr,d,p,m);t.arrowShapeImpl(this.name)(c,x,m.x,m.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,d){var p=this.baseCrossLinePts.slice(),m=d/c,y=3,x=5;return p[y]=p[y]-m,p[x]=p[x]-m,p},collide:function(c,d,p,m,y,x,b){var S=i(a(this.points,p+2*b,m,y)),w=i(a(this.crossLinePts(p,x),p+2*b,m,y)),N=Hr(c,d,S)||Hr(c,d,w);return N},draw:function(c,d,p,m,y){var x=a(this.points,d,p,m),b=a(this.crossLinePts(d,y),d,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return l(c)*.525}}),o("circle",{radius:.15,collide:function(c,d,p,m,y,x,b){var S=y,w=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((p+2*b)*this.radius,2);return w},draw:function(c,d,p,m,y){t.arrowShapeImpl(this.name)(c,m.x,m.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var jo={};jo.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],l=r[4],o=n.pan(),f=n.zoom(),c=((e-a)/l-o.x)/f,d=((t-i)/l-o.y)/f;return[c,d]};jo.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(w){return parseFloat(n.getPropertyValue(w))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},l=e.clientWidth,o=e.clientHeight,f=a.left+a.right,c=a.top+a.bottom,d=i.left+i.right,p=t.width/(l+d),m=l-f,y=o-c,x=t.left+a.left+i.left,b=t.top+a.top+i.top;return this.containerBB=[x,b,m,y,p]};jo.invalidateContainerClientCoordsCache=function(){this.containerBB=null};jo.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]};jo.findNearestElements=function(e,t,n,r){var a=this,i=this,l=i.getCachedZSortedEles(),o=[],f=i.cy.zoom(),c=i.cy.hasCompoundNodes(),d=(r?24:8)/f,p=(r?8:2)/f,m=(r?8:2)/f,y=1/0,x,b;n&&(l=l.interactive);function S(D,L){if(D.isNode()){if(b)return;b=D,o.push(D)}if(D.isEdge()&&(L==null||L<y))if(x){if(x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value&&x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value){for(var B=0;B<o.length;B++)if(o[B].isEdge()){o[B]=D,x=D,y=L??y;break}}}else o.push(D),x=D,y=L??y}function w(D){var L=D.outerWidth()+2*p,B=D.outerHeight()+2*p,M=L/2,_=B/2,P=D.position(),H=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,$=D._private.rscratch;if(P.x-M<=e&&e<=P.x+M&&P.y-_<=t&&t<=P.y+_){var V=i.nodeShapes[a.getNodeShape(D)];if(V.checkPoint(e,t,0,L,B,P.x,P.y,H,$))return S(D,0),!0}}function N(D){var L=D._private,B=L.rscratch,M=D.pstyle("width").pfValue,_=D.pstyle("arrow-scale").value,P=M/2+d,H=P*P,$=P*2,Y=L.source,Q=L.target,V;if(B.edgeType==="segments"||B.edgeType==="straight"||B.edgeType==="haystack"){for(var I=B.allpts,U=0;U+3<I.length;U+=2)if(ZX(e,t,I[U],I[U+1],I[U+2],I[U+3],$)&&H>(V=rQ(e,t,I[U],I[U+1],I[U+2],I[U+3])))return S(D,V),!0}else if(B.edgeType==="bezier"||B.edgeType==="multibezier"||B.edgeType==="self"||B.edgeType==="compound"){for(var I=B.allpts,U=0;U+5<B.allpts.length;U+=4)if(JX(e,t,I[U],I[U+1],I[U+2],I[U+3],I[U+4],I[U+5],$)&&H>(V=nQ(e,t,I[U],I[U+1],I[U+2],I[U+3],I[U+4],I[U+5])))return S(D,V),!0}for(var Y=Y||L.source,Q=Q||L.target,F=a.getArrowWidth(M,_),q=[{name:"source",x:B.arrowStartX,y:B.arrowStartY,angle:B.srcArrowAngle},{name:"target",x:B.arrowEndX,y:B.arrowEndY,angle:B.tgtArrowAngle},{name:"mid-source",x:B.midX,y:B.midY,angle:B.midsrcArrowAngle},{name:"mid-target",x:B.midX,y:B.midY,angle:B.midtgtArrowAngle}],U=0;U<q.length;U++){var X=q[U],z=i.arrowShapes[D.pstyle(X.name+"-arrow-shape").value],W=D.pstyle("width").pfValue;if(z.roughCollide(e,t,F,X.angle,{x:X.x,y:X.y},W,d)&&z.collide(e,t,F,X.angle,{x:X.x,y:X.y},W,d))return S(D),!0}c&&o.length>0&&(w(Y),w(Q))}function C(D,L,B){return Vr(D,L,B)}function T(D,L){var B=D._private,M=m,_;L?_=L+"-":_="",D.boundingBox();var P=B.labelBounds[L||"main"],H=D.pstyle(_+"label").value,$=D.pstyle("text-events").strValue==="yes";if(!(!$||!H)){var V=C(B.rscratch,"labelX",L),I=C(B.rscratch,"labelY",L),U=C(B.rscratch,"labelAngle",L),Y=D.pstyle(_+"text-margin-x").pfValue,Q=D.pstyle(_+"text-margin-y").pfValue,F=P.x1-M-Y,q=P.x2+M-Y,X=P.y1-M-Q,z=P.y2+M-Q;if(U){var W=Math.cos(U),re=Math.sin(U),ae=function(ge,ke){return ge=ge-V,ke=ke-I,{x:ge*W-ke*re+V,y:ge*re+ke*W+I}},ie=ae(F,X),ye=ae(F,z),ue=ae(q,X),ee=ae(q,z),ne=[ie.x+Y,ie.y+Q,ue.x+Y,ue.y+Q,ee.x+Y,ee.y+Q,ye.x+Y,ye.y+Q];if(Hr(e,t,ne))return S(D),!0}else if(il(P,e,t))return S(D),!0}}for(var R=l.length-1;R>=0;R--){var A=l[R];A.isNode()?w(A)||T(A):N(A)||T(A)||T(A,"source")||T(A,"target")}return o};jo.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),l=2/i,o=[],f=Math.min(e,n),c=Math.max(e,n),d=Math.min(t,r),p=Math.max(t,r);e=f,n=c,t=d,r=p;var m=jr({x1:e,y1:t,x2:n,y2:r}),y=[{x:m.x1,y:m.y1},{x:m.x2,y:m.y1},{x:m.x2,y:m.y2},{x:m.x1,y:m.y2}],x=[[y[0],y[1]],[y[1],y[2]],[y[2],y[3]],[y[3],y[0]]];function b(ge,ke,Pe){return Vr(ge,ke,Pe)}function S(ge,ke){var Pe=ge._private,lt=l,Je="";ge.boundingBox();var We=Pe.labelBounds.main;if(!We)return null;var Ve=b(Pe.rscratch,"labelX",ke),Re=b(Pe.rscratch,"labelY",ke),Ke=b(Pe.rscratch,"labelAngle",ke),Xe=ge.pstyle(Je+"text-margin-x").pfValue,st=ge.pstyle(Je+"text-margin-y").pfValue,ze=We.x1-lt-Xe,dt=We.x2+lt-Xe,he=We.y1-lt-st,Ce=We.y2+lt-st;if(Ke){var De=Math.cos(Ke),Fe=Math.sin(Ke),Me=function(xe,K){return xe=xe-Ve,K=K-Re,{x:xe*De-K*Fe+Ve,y:xe*Fe+K*De+Re}};return[Me(ze,he),Me(dt,he),Me(dt,Ce),Me(ze,Ce)]}else return[{x:ze,y:he},{x:dt,y:he},{x:dt,y:Ce},{x:ze,y:Ce}]}function w(ge,ke,Pe,lt){function Je(We,Ve,Re){return(Re.y-We.y)*(Ve.x-We.x)>(Ve.y-We.y)*(Re.x-We.x)}return Je(ge,Pe,lt)!==Je(ke,Pe,lt)&&Je(ge,ke,Pe)!==Je(ge,ke,lt)}for(var N=0;N<a.length;N++){var C=a[N];if(C.isNode()){var T=C,R=T.pstyle("text-events").strValue==="yes",A=T.pstyle("box-selection").strValue,D=T.pstyle("box-select-labels").strValue==="yes";if(A==="none")continue;var L=(A==="overlap"||D)&&R,B=T.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:L});if(A==="contain"){var M=!1;if(D&&R){var _=S(T);_&&Mx(_,y)&&(o.push(T),M=!0)}!M&&wL(m,B)&&o.push(T)}else if(A==="overlap"&&Lw(m,B)){var P=T.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),H=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(Mx(H,y))o.push(T);else{var $=S(T);$&&Mx($,y)&&o.push(T)}}}else{var V=C,I=V._private,U=I.rscratch,Y=V.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(U.startX!=null&&U.startY!=null&&!il(m,U.startX,U.startY)||U.endX!=null&&U.endY!=null&&!il(m,U.endX,U.endY))continue;if(U.edgeType==="bezier"||U.edgeType==="multibezier"||U.edgeType==="self"||U.edgeType==="compound"||U.edgeType==="segments"||U.edgeType==="haystack"){for(var Q=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts,F=!0,q=0;q<Q.length;q++)if(!uT(m,Q[q])){F=!1;break}F&&o.push(V)}else U.edgeType==="straight"&&o.push(V)}else if(Y==="overlap"){var X=!1;if(U.startX!=null&&U.startY!=null&&U.endX!=null&&U.endY!=null&&(il(m,U.startX,U.startY)||il(m,U.endX,U.endY)))o.push(V),X=!0;else if(!X&&U.edgeType==="haystack"){for(var z=I.rstyle.haystackPts,W=0;W<z.length;W++)if(uT(m,z[W])){o.push(V),X=!0;break}}if(!X){var re=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts;if((!re||re.length<2)&&U.edgeType==="straight"&&U.startX!=null&&U.startY!=null&&U.endX!=null&&U.endY!=null&&(re=[{x:U.startX,y:U.startY},{x:U.endX,y:U.endY}]),!re||re.length<2)continue;for(var ae=0;ae<re.length-1;ae++){for(var ie=re[ae],ye=re[ae+1],ue=0;ue<x.length;ue++){var ee=_n(x[ue],2),ne=ee[0],se=ee[1];if(w(ie,ye,ne,se)){o.push(V),X=!0;break}}if(X)break}}}}}return o};var Cp={};Cp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",r=t.edgeType==="bezier",a=t.edgeType==="multibezier",i=t.edgeType==="segments",l=t.edgeType==="compound",o=t.edgeType==="self",f,c,d,p,m,y,w,N;if(n?(d=t.haystackPts[0],p=t.haystackPts[1],m=t.haystackPts[2],y=t.haystackPts[3]):(d=t.arrowStartX,p=t.arrowStartY,m=t.arrowEndX,y=t.arrowEndY),w=t.midX,N=t.midY,i)f=d-t.segpts[0],c=p-t.segpts[1];else if(a||l||o||r){var x=t.allpts,b=Zn(x[0],x[2],x[4],.1),S=Zn(x[1],x[3],x[5],.1);f=d-b,c=p-S}else f=d-w,c=p-N;t.srcArrowAngle=bv(f,c);var w=t.midX,N=t.midY;if(n&&(w=(d+m)/2,N=(p+y)/2),f=m-d,c=y-p,i){var x=t.allpts;if(x.length/2%2===0){var C=x.length/2,T=C-2;f=x[C]-x[T],c=x[C+1]-x[T+1]}else if(t.isRound)f=t.midVector[1],c=-t.midVector[0];else{var C=x.length/2-1,T=C-2;f=x[C]-x[T],c=x[C+1]-x[T+1]}}else if(a||l||o){var x=t.allpts,R=t.ctrlpts,A,D,L,B;if(R.length/2%2===0){var M=x.length/2-1,_=M+2,P=_+2;A=Zn(x[M],x[_],x[P],0),D=Zn(x[M+1],x[_+1],x[P+1],0),L=Zn(x[M],x[_],x[P],1e-4),B=Zn(x[M+1],x[_+1],x[P+1],1e-4)}else{var _=x.length/2-1,M=_-2,P=_+2;A=Zn(x[M],x[_],x[P],.4999),D=Zn(x[M+1],x[_+1],x[P+1],.4999),L=Zn(x[M],x[_],x[P],.5),B=Zn(x[M+1],x[_+1],x[P+1],.5)}f=L-A,c=B-D}if(t.midtgtArrowAngle=bv(f,c),t.midDispX=f,t.midDispY=c,f*=-1,c*=-1,i){var x=t.allpts;if(x.length/2%2!==0){if(!t.isRound){var C=x.length/2-1,H=C+2;f=-(x[H]-x[C]),c=-(x[H+1]-x[C+1])}}}if(t.midsrcArrowAngle=bv(f,c),i)f=m-t.segpts[t.segpts.length-2],c=y-t.segpts[t.segpts.length-1];else if(a||l||o||r){var x=t.allpts,$=x.length,b=Zn(x[$-6],x[$-4],x[$-2],.9),S=Zn(x[$-5],x[$-3],x[$-1],.9);f=m-b,c=y-S}else f=m-w,c=y-N;t.tgtArrowAngle=bv(f,c)};Cp.getArrowWidth=Cp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=r,r)};var t1,n1,ri={},Ca={},$j,Gj,Jl,Qv,Ui,Yl,Wl,ei,wu,jv,p_,m_,r1,a1,Kj,Yj=function(t,n,r){r.x=n.x-t.x,r.y=n.y-t.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},xJ=function(t,n){n.x=t.x*-1,n.y=t.y*-1,n.nx=t.nx*-1,n.ny=t.ny*-1,n.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang},bJ=function(t,n,r,a,i){if(t!==Kj?Yj(n,t,ri):xJ(Ca,ri),Yj(n,r,Ca),$j=ri.nx*Ca.ny-ri.ny*Ca.nx,Gj=ri.nx*Ca.nx-ri.ny*-Ca.ny,Ui=Math.asin(Math.max(-1,Math.min(1,$j))),Math.abs(Ui)<1e-6){t1=n.x,n1=n.y,Wl=wu=0;return}Jl=1,Qv=!1,Gj<0?Ui<0?Ui=Math.PI+Ui:(Ui=Math.PI-Ui,Jl=-1,Qv=!0):Ui>0&&(Jl=-1,Qv=!0),n.radius!==void 0?wu=n.radius:wu=a,Yl=Ui/2,jv=Math.min(ri.len/2,Ca.len/2),i?(ei=Math.abs(Math.cos(Yl)*wu/Math.sin(Yl)),ei>jv?(ei=jv,Wl=Math.abs(ei*Math.sin(Yl)/Math.cos(Yl))):Wl=wu):(ei=Math.min(jv,wu),Wl=Math.abs(ei*Math.sin(Yl)/Math.cos(Yl))),r1=n.x+Ca.nx*ei,a1=n.y+Ca.ny*ei,t1=r1-Ca.ny*Wl*Jl,n1=a1+Ca.nx*Wl*Jl,p_=n.x+ri.nx*ei,m_=n.y+ri.ny*ei,Kj=n};function g_(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Gw(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(bJ(e,t,n,r,a),{cx:t1,cy:n1,radius:Wl,startX:p_,startY:m_,stopX:r1,stopY:a1,startAngle:ri.ang+Math.PI/2*Jl,endAngle:Ca.ang-Math.PI/2*Jl,counterClockwise:Qv})}var ud=.01,wJ=Math.sqrt(2*ud),Sr={};Sr.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,a=t.vectorNormInverse,i,l=e.pstyle("source-endpoint"),o=e.pstyle("target-endpoint"),f=l.units!=null&&o.units!=null,c=function(R,A,D,L){var B=L-A,M=D-R,_=Math.sqrt(M*M+B*B);return{x:-B/_,y:M/_}},d=e.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(f){var p=this.manualEndptToPx(e.source()[0],l),m=_n(p,2),y=m[0],x=m[1],b=this.manualEndptToPx(e.target()[0],o),S=_n(b,2),w=S[0],N=S[1],C={x1:y,y1:x,x2:w,y2:N};a=c(y,x,w,N),i=C}else zt("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}};Sr.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,a=r.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var l=r.source,o=r.target,f=l.position(),c=o.position(),d=l.width(),p=o.width(),m=l.height(),y=o.height(),x=n.pstyle("haystack-radius").value,b=x/2;a.haystackPts=a.allpts=[a.source.x*d*b+f.x,a.source.y*m*b+f.y,a.target.x*p*b+c.x,a.target.y*y*b+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}};Sr.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),l=e.pstyle("radius-type"),o=Math.min(r.pfValue.length,a.pfValue.length),f=i.pfValue[i.pfValue.length-1],c=l.pfValue[l.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<o;d++){var p=r.pfValue[d],m=a.pfValue[d],y=1-p,x=p,b=this.findMidptPtsEtc(e,t),S=b.midptPts,w=b.vectorNormInverse,N={x:S.x1*y+S.x2*x,y:S.y1*y+S.y2*x};n.segpts.push(N.x+w.x*m,N.y+w.y*m),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:f),n.isArcRadius.push((l.pfValue[d]!==void 0?l.pfValue[d]:c)==="arc-radius")}};Sr.findLoopPoints=function(e,t,n,r){var a=e._private.rscratch,i=t.dirCounts,l=t.srcPos,o=e.pstyle("control-point-distances"),f=o?o.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,d=e.pstyle("loop-sweep").pfValue,p=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var m=n,y=p;r&&(m=0,y=f);var x=c-Math.PI/2,b=x-d/2,S=x+d/2,w=c+"_"+d;m=i[w]===void 0?i[w]=0:++i[w],a.ctrlpts=[l.x+Math.cos(b)*1.4*y*(m/3+1),l.y+Math.sin(b)*1.4*y*(m/3+1),l.x+Math.cos(S)*1.4*y*(m/3+1),l.y+Math.sin(S)*1.4*y*(m/3+1)]};Sr.findCompoundLoopPoints=function(e,t,n,r){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,l=t.tgtPos,o=t.srcW,f=t.srcH,c=t.tgtW,d=t.tgtH,p=e.pstyle("control-point-step-size").pfValue,m=e.pstyle("control-point-distances"),y=m?m.pfValue[0]:void 0,x=n,b=p;r&&(x=0,b=y);var S=50,w={x:i.x-o/2,y:i.y-f/2},N={x:l.x-c/2,y:l.y-d/2},C={x:Math.min(w.x,N.x),y:Math.min(w.y,N.y)},T=.5,R=Math.max(T,Math.log(o*ud)),A=Math.max(T,Math.log(c*ud));a.ctrlpts=[C.x,C.y-(1+Math.pow(S,1.12)/100)*b*(x/3+1)*R,C.x-(1+Math.pow(S,1.12)/100)*b*(x/3+1)*A,C.y]};Sr.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};Sr.findBezierPoints=function(e,t,n,r,a){var i=e._private.rscratch,l=e.pstyle("control-point-step-size").pfValue,o=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),c=o&&f?Math.min(o.value.length,f.value.length):1,d=o?o.pfValue[0]:void 0,p=f.value[0],m=r;i.edgeType=m?"multibezier":"bezier",i.ctrlpts=[];for(var y=0;y<c;y++){var x=(.5-t.eles.length/2+n)*l*(a?-1:1),b=void 0,S=Ow(x);m&&(d=o?o.pfValue[y]:l,p=f.value[y]),r?b=d:b=d!==void 0?S*d:void 0;var w=b!==void 0?b:x,N=1-p,C=p,T=this.findMidptPtsEtc(e,t),R=T.midptPts,A=T.vectorNormInverse,D={x:R.x1*N+R.x2*C,y:R.y1*N+R.y2*C};i.ctrlpts.push(D.x+A.x*w,D.y+A.y*w)}};Sr.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",l="rightward",o="downward",f="upward",c="auto",d=t.posPts,p=t.srcW,m=t.srcH,y=t.tgtW,x=t.tgtH,b=e.pstyle("edge-distances").value,S=b!=="node-position",w=e.pstyle("taxi-direction").value,N=w,C=e.pstyle("taxi-turn"),T=C.units==="%",R=C.pfValue,A=R<0,D=e.pstyle("taxi-turn-min-distance").pfValue,L=S?(p+y)/2:0,B=S?(m+x)/2:0,M=d.x2-d.x1,_=d.y2-d.y1,P=function(K,oe){return K>0?Math.max(K-oe,0):Math.min(K+oe,0)},H=P(M,L),$=P(_,B),V=!1;N===c?w=Math.abs(H)>Math.abs($)?a:r:N===f||N===o?(w=r,V=!0):(N===i||N===l)&&(w=a,V=!0);var I=w===r,U=I?$:H,Y=I?_:M,Q=Ow(Y),F=!1;!(V&&(T||A))&&(N===o&&Y<0||N===f&&Y>0||N===i&&Y>0||N===l&&Y<0)&&(Q*=-1,U=Q*Math.abs(U),F=!0);var q;if(T){var X=R<0?1+R:R;q=X*U}else{var z=R<0?U:0;q=z+R*Q}var W=function(K){return Math.abs(K)<D||Math.abs(K)>=Math.abs(U)},re=W(q),ae=W(Math.abs(U)-Math.abs(q)),ie=re||ae;if(ie&&!F)if(I){var ye=Math.abs(Y)<=m/2,ue=Math.abs(M)<=y/2;if(ye){var ee=(d.x1+d.x2)/2,ne=d.y1,se=d.y2;n.segpts=[ee,ne,ee,se]}else if(ue){var ge=(d.y1+d.y2)/2,ke=d.x1,Pe=d.x2;n.segpts=[ke,ge,Pe,ge]}else n.segpts=[d.x1,d.y2]}else{var lt=Math.abs(Y)<=p/2,Je=Math.abs(_)<=x/2;if(lt){var We=(d.y1+d.y2)/2,Ve=d.x1,Re=d.x2;n.segpts=[Ve,We,Re,We]}else if(Je){var Ke=(d.x1+d.x2)/2,Xe=d.y1,st=d.y2;n.segpts=[Ke,Xe,Ke,st]}else n.segpts=[d.x2,d.y1]}else if(I){var ze=d.y1+q+(S?m/2*Q:0),dt=d.x1,he=d.x2;n.segpts=[dt,ze,he,ze]}else{var Ce=d.x1+q+(S?p/2*Q:0),De=d.y1,Fe=d.y2;n.segpts=[Ce,De,Ce,Fe]}if(n.isRound){var Me=e.pstyle("taxi-radius").value,Oe=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(Me),n.isArcRadius=new Array(n.segpts.length/2).fill(Oe)}};Sr.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,a=t.tgtPos,i=t.srcW,l=t.srcH,o=t.tgtW,f=t.tgtH,c=t.srcShape,d=t.tgtShape,p=t.srcCornerRadius,m=t.tgtCornerRadius,y=t.srcRs,x=t.tgtRs,b=!Ae(n.startX)||!Ae(n.startY),S=!Ae(n.arrowStartX)||!Ae(n.arrowStartY),w=!Ae(n.endX)||!Ae(n.endY),N=!Ae(n.arrowEndX)||!Ae(n.arrowEndY),C=3,T=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=C*T,A=So({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),D=A<R,L=So({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),B=L<R,M=!1;if(b||S||D){M=!0;var _={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},P=Math.sqrt(_.x*_.x+_.y*_.y),H={x:_.x/P,y:_.y/P},$=Math.max(i,l),V={x:n.ctrlpts[0]+H.x*2*$,y:n.ctrlpts[1]+H.y*2*$},I=c.intersectLine(r.x,r.y,i,l,V.x,V.y,0,p,y);D?(n.ctrlpts[0]=n.ctrlpts[0]+H.x*(R-A),n.ctrlpts[1]=n.ctrlpts[1]+H.y*(R-A)):(n.ctrlpts[0]=I[0]+H.x*R,n.ctrlpts[1]=I[1]+H.y*R)}if(w||N||B){M=!0;var U={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},Y=Math.sqrt(U.x*U.x+U.y*U.y),Q={x:U.x/Y,y:U.y/Y},F=Math.max(i,l),q={x:n.ctrlpts[0]+Q.x*2*F,y:n.ctrlpts[1]+Q.y*2*F},X=d.intersectLine(a.x,a.y,o,f,q.x,q.y,0,m,x);B?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(R-L),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(R-L)):(n.ctrlpts[0]=X[0]+Q.x*R,n.ctrlpts[1]=X[1]+Q.y*R)}M&&this.findEndpoints(e)}};Sr.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,a;t.ctrlpts.length/2%2===0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,a=.5,t.midX=Zn(t.allpts[r],t.allpts[r+2],t.allpts[r+4],a),t.midY=Zn(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],a))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var i=2;i+3<t.allpts.length;i+=2){var l=t.radii[i/2-1],o=t.isArcRadius[i/2-1];t.roundCorners.push(Gw({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:l},{x:t.allpts[i+2],y:t.allpts[i+3]},l,o))}}if(t.segpts.length%4===0){var f=t.segpts.length/2,c=f-2;t.midX=(t.segpts[c]+t.segpts[f])/2,t.midY=(t.segpts[c+1]+t.segpts[f+1])/2}else{var d=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[d],t.midY=t.segpts[d+1];else{var p={x:t.segpts[d],y:t.segpts[d+1]},m=t.roundCorners[d/2];if(m.radius===0){var y={x:t.segpts[d+2],y:t.segpts[d+3]};t.midX=p.x,t.midY=p.y,t.midVector=[p.y-y.y,y.x-p.x]}else{var x=[p.x-m.cx,p.y-m.cy],b=m.radius/Math.sqrt(Math.pow(x[0],2)+Math.pow(x[1],2));x=x.map(function(S){return S*b}),t.midX=m.cx+x[0],t.midY=m.cy+x[1],t.midVector=x}}}}};Sr.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ae(t.startX)&&Ae(t.startY)&&Ae(t.endX)&&Ae(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,zt("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};Sr.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i=new Wi,l=function(B,M){return[].concat(vp(B),[M?1:0]).join("-")},o=[],f=[],c=0;c<e.length;c++){var d=e[c],p=d._private,m=d.pstyle("curve-style").value;if(!(d.removed()||!d.takesUpSpace())){if(m==="haystack"){f.push(d);continue}var y=m==="unbundled-bezier"||al(m,"segments")||m==="straight"||m==="straight-triangle"||al(m,"taxi"),x=m==="unbundled-bezier"||m==="bezier",b=p.source,S=p.target,w=b.poolIndex(),N=S.poolIndex(),C=[w,N].sort(),T=l(C,y),R=i.get(T);R==null&&(R={eles:[]},o.push({pairId:C,edgeIsUnbundled:y}),i.set(T,R)),R.eles.push(d),y&&(R.hasUnbundled=!0),x&&(R.hasBezier=!0)}}for(var A=function(){var B=o[D],M=B.pairId,_=B.edgeIsUnbundled,P=l(M,_),H=i.get(P),$;if(!H.hasUnbundled){var V=H.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});Dw(H.eles),V.forEach(function(Oe){return H.eles.push(Oe)}),H.eles.sort(function(Oe,xe){return Oe.poolIndex()-xe.poolIndex()})}var I=H.eles[0],U=I.source(),Y=I.target();if(U.poolIndex()>Y.poolIndex()){var Q=U;U=Y,Y=Q}var F=H.srcPos=U.position(),q=H.tgtPos=Y.position(),X=H.srcW=U.outerWidth(),z=H.srcH=U.outerHeight(),W=H.tgtW=Y.outerWidth(),re=H.tgtH=Y.outerHeight(),ae=H.srcShape=n.nodeShapes[t.getNodeShape(U)],ie=H.tgtShape=n.nodeShapes[t.getNodeShape(Y)],ye=H.srcCornerRadius=U.pstyle("corner-radius").value==="auto"?"auto":U.pstyle("corner-radius").pfValue,ue=H.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,ee=H.tgtRs=Y._private.rscratch,ne=H.srcRs=U._private.rscratch;H.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var se=0;se<H.eles.length;se++){var ge=H.eles[se],ke=ge[0]._private.rscratch,Pe=ge.pstyle("curve-style").value,lt=Pe==="unbundled-bezier"||al(Pe,"segments")||al(Pe,"taxi"),Je=!U.same(ge.source());if(!H.calculatedIntersection&&U!==Y&&(H.hasBezier||H.hasUnbundled)){H.calculatedIntersection=!0;var We=ae.intersectLine(F.x,F.y,X,z,q.x,q.y,0,ye,ne),Ve=H.srcIntn=We,Re=ie.intersectLine(q.x,q.y,W,re,F.x,F.y,0,ue,ee),Ke=H.tgtIntn=Re,Xe=H.intersectionPts={x1:We[0],x2:Re[0],y1:We[1],y2:Re[1]},st=H.posPts={x1:F.x,x2:q.x,y1:F.y,y2:q.y},ze=Re[1]-We[1],dt=Re[0]-We[0],he=Math.sqrt(dt*dt+ze*ze);Ae(he)&&he>=wJ||(he=Math.sqrt(Math.max(dt*dt,ud)+Math.max(ze*ze,ud)));var Ce=H.vector={x:dt,y:ze},De=H.vectorNorm={x:Ce.x/he,y:Ce.y/he},Fe={x:-De.y,y:De.x};H.nodesOverlap=!Ae(he)||ie.checkPoint(We[0],We[1],0,W,re,q.x,q.y,ue,ee)||ae.checkPoint(Re[0],Re[1],0,X,z,F.x,F.y,ye,ne),H.vectorNormInverse=Fe,$={nodesOverlap:H.nodesOverlap,dirCounts:H.dirCounts,calculatedIntersection:!0,hasBezier:H.hasBezier,hasUnbundled:H.hasUnbundled,eles:H.eles,srcPos:q,srcRs:ee,tgtPos:F,tgtRs:ne,srcW:W,srcH:re,tgtW:X,tgtH:z,srcIntn:Ke,tgtIntn:Ve,srcShape:ie,tgtShape:ae,posPts:{x1:st.x2,y1:st.y2,x2:st.x1,y2:st.y1},intersectionPts:{x1:Xe.x2,y1:Xe.y2,x2:Xe.x1,y2:Xe.y1},vector:{x:-Ce.x,y:-Ce.y},vectorNorm:{x:-De.x,y:-De.y},vectorNormInverse:{x:-Fe.x,y:-Fe.y}}}var Me=Je?$:H;ke.nodesOverlap=Me.nodesOverlap,ke.srcIntn=Me.srcIntn,ke.tgtIntn=Me.tgtIntn,ke.isRound=Pe.startsWith("round"),a&&(U.isParent()||U.isChild()||Y.isParent()||Y.isChild())&&(U.parents().anySame(Y)||Y.parents().anySame(U)||U.same(Y)&&U.isParent())?t.findCompoundLoopPoints(ge,Me,se,lt):U===Y?t.findLoopPoints(ge,Me,se,lt):Pe.endsWith("segments")?t.findSegmentsPoints(ge,Me):Pe.endsWith("taxi")?t.findTaxiPoints(ge,Me):Pe==="straight"||!lt&&H.eles.length%2===1&&se===Math.floor(H.eles.length/2)?t.findStraightEdgePoints(ge):t.findBezierPoints(ge,Me,se,lt,Je),t.findEndpoints(ge),t.tryToCorrectInvalidPoints(ge,Me),t.checkForInvalidEdgeWarning(ge),t.storeAllpts(ge),t.storeEdgeProjections(ge),t.calculateArrowAngles(ge),t.recalculateEdgeLabelProjections(ge),t.calculateLabelAngles(ge)}},D=0;D<o.length;D++)A();this.findHaystackPoints(f)}};function y_(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];t.push({x:r,y:a})}return t}}Sr.getSegmentPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="segments")return y_(t.segpts)};Sr.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return y_(t.ctrlpts)};Sr.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Ud={};Ud.manualEndptToPx=function(e,t){var n=this,r=e.position(),a=e.outerWidth(),i=e.outerHeight(),l=e._private.rscratch;if(t.value.length===2){var o=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(o[0]=o[0]*a),t.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=r.x,o[1]+=r.y,o}else{var f=t.pfValue[0];f=-Math.PI/2+f;var c=2*Math.max(a,i),d=[r.x+Math.cos(f)*c,r.y+Math.sin(f)*c];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,l)}};Ud.findEndpoints=function(e){var t,n,r,a,i=this,l,o=e.source()[0],f=e.target()[0],c=o.position(),d=f.position(),p=e.pstyle("target-arrow-shape").value,m=e.pstyle("source-arrow-shape").value,y=e.pstyle("target-distance-from-node").pfValue,x=e.pstyle("source-distance-from-node").pfValue,b=o._private.rscratch,S=f._private.rscratch,w=e.pstyle("curve-style").value,N=e._private.rscratch,C=N.edgeType,T=al(w,"taxi"),R=C==="self"||C==="compound",A=C==="bezier"||C==="multibezier"||R,D=C!=="bezier",L=C==="straight"||C==="segments",B=C==="segments",M=A||D||L,_=R||T,P=e.pstyle("source-endpoint"),H=_?"outside-to-node":P.value,$=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,V=e.pstyle("target-endpoint"),I=_?"outside-to-node":V.value,U=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;N.srcManEndpt=P,N.tgtManEndpt=V;var Y,Q,F,q,X=(t=(V==null||(n=V.pfValue)===null||n===void 0?void 0:n.length)===2?V.pfValue:null)!==null&&t!==void 0?t:[0,0],z=(r=(P==null||(a=P.pfValue)===null||a===void 0?void 0:a.length)===2?P.pfValue:null)!==null&&r!==void 0?r:[0,0];if(A){var W=[N.ctrlpts[0],N.ctrlpts[1]],re=D?[N.ctrlpts[N.ctrlpts.length-2],N.ctrlpts[N.ctrlpts.length-1]]:W;Y=re,Q=W}else if(L){var ae=B?N.segpts.slice(0,2):[d.x+X[0],d.y+X[1]],ie=B?N.segpts.slice(N.segpts.length-2):[c.x+z[0],c.y+z[1]];Y=ie,Q=ae}if(I==="inside-to-node")l=[d.x,d.y];else if(V.units)l=this.manualEndptToPx(f,V);else if(I==="outside-to-line")l=N.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?F=Y:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(F=[c.x,c.y]),l=i.nodeShapes[this.getNodeShape(f)].intersectLine(d.x,d.y,f.outerWidth(),f.outerHeight(),F[0],F[1],0,U,S),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var ye=f._private.rscratch,ue=ye.labelWidth,ee=ye.labelHeight,ne=ye.labelX,se=ye.labelY,ge=ue/2,ke=ee/2,Pe=f.pstyle("text-valign").value;Pe==="top"?se-=ke:Pe==="bottom"&&(se+=ke);var lt=f.pstyle("text-halign").value;lt==="left"?ne-=ge:lt==="right"&&(ne+=ge);var Je=ad(F[0],F[1],[ne-ge,se-ke,ne+ge,se-ke,ne+ge,se+ke,ne-ge,se+ke],d.x,d.y);if(Je.length>0){var We=c,Ve=Ql(We,ju(l)),Re=Ql(We,ju(Je)),Ke=Ve;if(Re<Ve&&(l=Je,Ke=Re),Je.length>2){var Xe=Ql(We,{x:Je[2],y:Je[3]});Xe<Ke&&(l=[Je[2],Je[3]])}}}var st=wv(l,Y,i.arrowShapes[p].spacing(e)+y),ze=wv(l,Y,i.arrowShapes[p].gap(e)+y);if(N.endX=ze[0],N.endY=ze[1],N.arrowEndX=st[0],N.arrowEndY=st[1],H==="inside-to-node")l=[c.x,c.y];else if(P.units)l=this.manualEndptToPx(o,P);else if(H==="outside-to-line")l=N.srcIntn;else if(H==="outside-to-node"||H==="outside-to-node-or-label"?q=Q:(H==="outside-to-line"||H==="outside-to-line-or-label")&&(q=[d.x,d.y]),l=i.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),q[0],q[1],0,$,b),H==="outside-to-node-or-label"||H==="outside-to-line-or-label"){var dt=o._private.rscratch,he=dt.labelWidth,Ce=dt.labelHeight,De=dt.labelX,Fe=dt.labelY,Me=he/2,Oe=Ce/2,xe=o.pstyle("text-valign").value;xe==="top"?Fe-=Oe:xe==="bottom"&&(Fe+=Oe);var K=o.pstyle("text-halign").value;K==="left"?De-=Me:K==="right"&&(De+=Me);var oe=ad(q[0],q[1],[De-Me,Fe-Oe,De+Me,Fe-Oe,De+Me,Fe+Oe,De-Me,Fe+Oe],c.x,c.y);if(oe.length>0){var pe=d,de=Ql(pe,ju(l)),be=Ql(pe,ju(oe)),Le=de;if(be<de&&(l=[oe[0],oe[1]],Le=be),oe.length>2){var Ne=Ql(pe,{x:oe[2],y:oe[3]});Ne<Le&&(l=[oe[2],oe[3]])}}}var Ge=wv(l,Q,i.arrowShapes[m].spacing(e)+x),qe=wv(l,Q,i.arrowShapes[m].gap(e)+x);N.startX=qe[0],N.startY=qe[1],N.arrowStartX=Ge[0],N.arrowStartY=Ge[1],M&&(!Ae(N.startX)||!Ae(N.startY)||!Ae(N.endX)||!Ae(N.endY)?N.badLine=!0:N.badLine=!1)};Ud.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};Ud.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var Kw={};function SJ(e,t,n){for(var r=function(c,d,p,m){return Zn(c,d,p,m)},a=t._private,i=a.rstyle.bezierPts,l=0;l<e.bezierProjPcts.length;l++){var o=e.bezierProjPcts[l];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}Kw.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)SJ(this,e,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=t.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var l=n.haystackPts;t.rstyle.haystackPts=[{x:l[0],y:l[1]},{x:l[2],y:l[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};Kw.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Si={};Si.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!pl(t)){var n,r,a=e._private,i=e.width(),l=e.height(),o=e.padding(),f=e.position(),c=e.pstyle("text-halign").strValue,d=e.pstyle("text-valign").strValue,p=a.rscratch,m=a.rstyle;switch(c){case"left":n=f.x-i/2-o;break;case"right":n=f.x+i/2+o;break;default:n=f.x}switch(d){case"top":r=f.y-l/2-o;break;case"bottom":r=f.y+l/2+o;break;default:r=f.y}p.labelX=n,p.labelY=r,m.labelX=n,m.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var x_=function(t,n){var r=Math.atan(n/t);return t===0&&r<0&&(r=r*-1),r},b_=function(t,n){var r=n.x-t.x,a=n.y-t.y;return x_(r,a)},EJ=function(t,n,r,a){var i=rd(0,a-.001,1),l=rd(0,a+.001,1),o=Bu(t,n,r,i),f=Bu(t,n,r,l);return b_(o,f)};Si.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,a=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:r.midX,y:r.midY};var l=function(p,m,y){Gi(n.rscratch,p,m,y),Gi(n.rstyle,p,m,y)};l("labelX",null,t.x),l("labelY",null,t.y);var o=x_(r.midDispX,r.midDispY);l("labelAutoAngle",null,o);var f=function(){if(f.cache)return f.cache;for(var p=[],m=0;m+5<r.allpts.length;m+=4){var y={x:r.allpts[m],y:r.allpts[m+1]},x={x:r.allpts[m+2],y:r.allpts[m+3]},b={x:r.allpts[m+4],y:r.allpts[m+5]};p.push({p0:y,p1:x,p2:b,startDist:0,length:0,segments:[]})}var S=n.rstyle.bezierPts,w=a.bezierProjPcts.length;function N(D,L,B,M,_){var P=So(L,B),H=D.segments[D.segments.length-1],$={p0:L,p1:B,t0:M,t1:_,startDist:H?H.startDist+H.length:0,length:P};D.segments.push($),D.length+=P}for(var C=0;C<p.length;C++){var T=p[C],R=p[C-1];R&&(T.startDist=R.startDist+R.length),N(T,T.p0,S[C*w],0,a.bezierProjPcts[0]);for(var A=0;A<w-1;A++)N(T,S[C*w+A],S[C*w+A+1],a.bezierProjPcts[A],a.bezierProjPcts[A+1]);N(T,S[C*w+w-1],T.p2,a.bezierProjPcts[w-1],1)}return f.cache=p},c=function(p){var m,y=p==="source";if(i[p]){var x=e.pstyle(p+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var b=f(),S,w=0,N=0,C=0;C<b.length;C++){for(var T=b[y?C:b.length-1-C],R=0;R<T.segments.length;R++){var A=T.segments[y?R:T.segments.length-1-R],D=C===b.length-1&&R===T.segments.length-1;if(w=N,N+=A.length,N>=x||D){S={cp:T,segment:A};break}}if(S)break}var L=S.cp,B=S.segment,M=(x-w)/B.length,_=B.t1-B.t0,P=y?B.t0+_*M:B.t1-_*M;P=rd(0,P,1),t=Bu(L.p0,L.p1,L.p2,P),m=EJ(L.p0,L.p1,L.p2,P);break}case"straight":case"segments":case"haystack":{for(var H=0,$,V,I,U,Y=r.allpts.length,Q=0;Q+3<Y&&(y?(I={x:r.allpts[Q],y:r.allpts[Q+1]},U={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(I={x:r.allpts[Y-2-Q],y:r.allpts[Y-1-Q]},U={x:r.allpts[Y-4-Q],y:r.allpts[Y-3-Q]}),$=So(I,U),V=H,H+=$,!(H>=x));Q+=2);var F=x-V,q=F/$;q=rd(0,q,1),t=$X(I,U,q),m=b_(I,U);break}}l("labelX",p,t.x),l("labelY",p,t.y),l("labelAutoAngle",p,m)}};c("source"),c("target"),this.applyLabelDimensions(e)}};Si.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};Si.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),a=wo(r,e._private.labelDimsKey);if(Vr(n.rscratch,"prefixedLabelDimsKey",t)!==a){Gi(n.rscratch,"prefixedLabelDimsKey",t,a);var i=this.calculateLabelDimensions(e,r),l=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,f=Vr(n.rscratch,"labelWrapCachedLines",t)||[],c=o!=="wrap"?1:Math.max(f.length,1),d=i.height/c,p=d*l,m=i.width,y=i.height+(c-1)*(l-1)*d;Gi(n.rstyle,"labelWidth",t,m),Gi(n.rscratch,"labelWidth",t,m),Gi(n.rstyle,"labelHeight",t,y),Gi(n.rscratch,"labelHeight",t,y),Gi(n.rscratch,"labelLineHeight",t,p)}};Si.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",a=e.pstyle(r+"label").strValue,i=e.pstyle("text-transform").value,l=function(z,W){return W?(Gi(n.rscratch,z,t,W),W):Vr(n.rscratch,z,t)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=e.pstyle("text-wrap").value;if(o==="wrap"){var f=l("labelKey");if(f!=null&&l("labelWrapKey")===f)return l("labelWrapCachedText");for(var c="​",d=a.split(`
511
+ `),p=e.pstyle("text-max-width").pfValue,m=e.pstyle("text-overflow-wrap").value,y=m==="anywhere",x=[],b=/[\s\u200b]+|$/g,S=0;S<d.length;S++){var w=d[S],N=this.calculateLabelDimensions(e,w),C=N.width;if(y){var T=w.split("").join(c);w=T}if(C>p){var R=w.matchAll(b),A="",D=0,L=Gr(R),B;try{for(L.s();!(B=L.n()).done;){var M=B.value,_=M[0],P=w.substring(D,M.index);D=M.index+_.length;var H=A.length===0?P:A+P+_,$=this.calculateLabelDimensions(e,H),V=$.width;V<=p?A+=P+_:(A&&x.push(A),A=P+_)}}catch(X){L.e(X)}finally{L.f()}A.match(/^[\s\u200b]+$/)||x.push(A)}else x.push(w)}l("labelWrapCachedLines",x),a=l("labelWrapCachedText",x.join(`
512
+ `)),l("labelWrapKey",f)}else if(o==="ellipsis"){var I=e.pstyle("text-max-width").pfValue,U="",Y="…",Q=!1;if(this.calculateLabelDimensions(e,a).width<I)return a;for(var F=0;F<a.length;F++){var q=this.calculateLabelDimensions(e,U+a[F]+Y).width;if(q>I)break;U+=a[F],F===a.length-1&&(Q=!0)}return Q||(U+=Y),U}return a};Si.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t};Si.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window(),a=r.document,i=0,l=e.pstyle("font-style").strValue,o=e.pstyle("font-size").pfValue,f=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=d.getContext("2d");var m=d.style;m.position="absolute",m.left="-9999px",m.top="-9999px",m.zIndex="-1",m.visibility="hidden",m.pointerEvents="none"}p.font="".concat(l," ").concat(c," ").concat(o,"px ").concat(f);for(var y=0,x=0,b=t.split(`
513
+ `),S=0;S<b.length;S++){var w=b[S],N=p.measureText(w),C=Math.ceil(N.width),T=o;y=Math.max(C,y),x+=T}return y+=i,x+=i,{width:y,height:x}};Si.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,a=e.isEdge(),i=t?t+"-":"",l=e.pstyle(i+"text-rotation"),o=l.strValue;return o==="none"?0:a&&o==="autorotate"?r.labelAutoAngle:o==="autorotate"?0:l.pfValue};Si.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,a=r.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var w_={},Xj=28,Qj=!1;w_.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<Xj||e.height()<Xj))return Qj||(zt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Qj=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var mm={};mm.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(l),o)for(var f=0;f<l.length;f++){var c=l[f],d=c._private,p=d.rstyle;p.clean=!1,p.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(l){var o=l.target;r(o)}).on("style.* background.*",function(l){var o=l.target;r(o,!1)});var a=function(l){if(l){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var f=0;f<t.length;f++){var c=t[f],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(r(c.connectedEdges()),d.cleanConnected=!0)}if(o)for(var p=0;p<o.length;p++){var m=o[p];m(l,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)};mm.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};mm.recalculateRenderedStyle=function(e,t){var n=function(T){return T._private.rstyle.cleanConnected};if(e.length!==0){var r=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var l=e[i],o=l._private,f=o.rstyle;l.isEdge()&&(!n(l.source())||!n(l.target()))&&(f.clean=!1),l.isEdge()&&l.isBundledBezier()&&l.parallelEdges().some(function(C){return!C._private.rstyle.clean&&C.isBundledBezier()})&&(f.clean=!1),!(t&&f.clean||l.removed())&&l.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(l):r.push(l),f.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],p=d._private,m=p.rstyle,y=d.position();this.recalculateNodeLabelProjection(d),m.nodeX=y.x,m.nodeY=y.y,m.nodeW=d.pstyle("width").pfValue,m.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var x=0;x<r.length;x++){var b=r[x],S=b._private,w=S.rstyle,N=S.rscratch;w.srcX=N.arrowStartX,w.srcY=N.arrowStartY,w.tgtX=N.arrowEndX,w.tgtY=N.arrowEndY,w.midX=N.midX,w.midY=N.midY,w.labelAngle=N.labelAngle,w.sourceLabelAngle=N.sourceLabelAngle,w.targetLabelAngle=N.targetLabelAngle}}}};var gm={};gm.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):a.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}};gm.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};gm.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(n_),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var S_={};[jo,Cp,Sr,Ud,Kw,Si,w_,mm,gm].forEach(function(e){at(S_,e)});var E_={};E_.getCachedImage=function(e,t,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var l=i.image=new Image;l.addEventListener("load",n),l.addEventListener("error",function(){l.error=!0});var o="data:",f=e.substring(0,o.length).toLowerCase()===o;return f||(t=t==="null"?null:t,l.crossOrigin=t),l.src=e,l};var Ec={};Ec.registerBinding=function(e,t,n,r){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var i=[],l=0;l<e.length;l++){var o=e[l];if(o!==void 0){var f=this.binder(o);i.push(f.on.apply(f,a))}}return i}var f=this.binder(e);return f.on.apply(f,a)};Ec.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||_Y(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var l=function(f,c,d){var p=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(p[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:p}),(e.addEventListener||e.on).apply(e,p),this};return{on:l,addEventListener:l,addListener:l,bind:l}};Ec.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};Ec.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};Ec.load=function(){var e=this,t=e.cy.window(),n=function(K){return K.selected()},r=function(K){var oe=K.getRootNode();if(oe&&oe.nodeType===11&&oe.host!==void 0)return oe},a=function(K,oe,pe,de){K==null&&(K=e.cy);for(var be=0;be<oe.length;be++){var Le=oe[be];K.emit({originalEvent:pe,type:Le,position:de})}},i=function(K){return K.shiftKey||K.metaKey||K.ctrlKey},l=function(K,oe){var pe=!0;if(e.cy.hasCompoundNodes()&&K&&K.pannable())for(var de=0;oe&&de<oe.length;de++){var K=oe[de];if(K.isNode()&&K.isParent()&&!K.pannable()){pe=!1;break}}else pe=!0;return pe},o=function(K){K[0]._private.grabbed=!0},f=function(K){K[0]._private.grabbed=!1},c=function(K){K[0]._private.rscratch.inDragLayer=!0},d=function(K){K[0]._private.rscratch.inDragLayer=!1},p=function(K){K[0]._private.rscratch.isGrabTarget=!0},m=function(K){K[0]._private.rscratch.isGrabTarget=!1},y=function(K,oe){var pe=oe.addToList,de=pe.has(K);!de&&K.grabbable()&&!K.locked()&&(pe.merge(K),o(K))},x=function(K,oe){if(K.cy().hasCompoundNodes()&&!(oe.inDragLayer==null&&oe.addToList==null)){var pe=K.descendants();oe.inDragLayer&&(pe.forEach(c),pe.connectedEdges().forEach(c)),oe.addToList&&y(pe,oe)}},b=function(K,oe){oe=oe||{};var pe=K.cy().hasCompoundNodes();oe.inDragLayer&&(K.forEach(c),K.neighborhood().stdFilter(function(de){return!pe||de.isEdge()}).forEach(c)),oe.addToList&&K.forEach(function(de){y(de,oe)}),x(K,oe),N(K,{inDragLayer:oe.inDragLayer}),e.updateCachedGrabbedEles()},S=b,w=function(K){K&&(e.getCachedZSortedEles().forEach(function(oe){f(oe),d(oe),m(oe)}),e.updateCachedGrabbedEles())},N=function(K,oe){if(!(oe.inDragLayer==null&&oe.addToList==null)&&K.cy().hasCompoundNodes()){var pe=K.ancestors().orphans();if(!pe.same(K)){var de=pe.descendants().spawnSelf().merge(pe).unmerge(K).unmerge(K.descendants()),be=de.connectedEdges();oe.inDragLayer&&(be.forEach(c),de.forEach(c)),oe.addToList&&de.forEach(function(Le){y(Le,oe)})}}},C=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";T?(e.removeObserver=new MutationObserver(function(xe){for(var K=0;K<xe.length;K++){var oe=xe[K],pe=oe.removedNodes;if(pe)for(var de=0;de<pe.length;de++){var be=pe[de];if(be===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(xe){e.destroy()});var A=zd(function(){e.cy.resize()},100);T&&(e.styleObserver=new MutationObserver(A),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",A),R&&(e.resizeObserver=new ResizeObserver(A),e.resizeObserver.observe(e.container));var D=function(K,oe){for(;K!=null;)oe(K),K=K.parentNode},L=function(){e.invalidateContainerClientCoordsCache()};D(e.container,function(xe){e.registerBinding(xe,"transitionend",L),e.registerBinding(xe,"animationend",L),e.registerBinding(xe,"scroll",L)}),e.registerBinding(e.container,"contextmenu",function(xe){xe.preventDefault()});var B=function(){return e.selection[4]!==0},M=function(K){for(var oe=e.findContainerClientCoords(),pe=oe[0],de=oe[1],be=oe[2],Le=oe[3],Ne=K.touches?K.touches:[K],Ge=!1,qe=0;qe<Ne.length;qe++){var Ze=Ne[qe];if(pe<=Ze.clientX&&Ze.clientX<=pe+be&&de<=Ze.clientY&&Ze.clientY<=de+Le){Ge=!0;break}}if(!Ge)return!1;for(var ut=e.container,ct=K.target,He=ct.parentNode,xt=!1;He;){if(He===ut){xt=!0;break}He=He.parentNode}return!!xt};e.registerBinding(e.container,"mousedown",function(K){if(M(K)&&!(e.hoverData.which===1&&K.which!==1)){K.preventDefault(),C(),e.hoverData.capture=!0,e.hoverData.which=K.which;var oe=e.cy,pe=[K.clientX,K.clientY],de=e.projectIntoViewport(pe[0],pe[1]),be=e.selection,Le=e.findNearestElements(de[0],de[1],!0,!1),Ne=Le[0],Ge=e.dragData.possibleDragElements;e.hoverData.mdownPos=de,e.hoverData.mdownGPos=pe;var qe=function(vt){return{originalEvent:K,type:vt,position:{x:de[0],y:de[1]}}},Ze=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var vt=e.hoverData.down;vt?vt.emit(qe("taphold")):oe.emit(qe("taphold"))}},e.tapholdDuration)};if(K.which==3){e.hoverData.cxtStarted=!0;var ut={originalEvent:K,type:"cxttapstart",position:{x:de[0],y:de[1]}};Ne?(Ne.activate(),Ne.emit(ut),e.hoverData.down=Ne):oe.emit(ut),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(K.which==1){Ne&&Ne.activate();{if(Ne!=null&&e.nodeIsGrabbable(Ne)){var ct=function(vt){vt.emit(qe("grab"))};if(p(Ne),!Ne.selected())Ge=e.dragData.possibleDragElements=oe.collection(),S(Ne,{addToList:Ge}),Ne.emit(qe("grabon")).emit(qe("grab"));else{Ge=e.dragData.possibleDragElements=oe.collection();var He=oe.$(function(xt){return xt.isNode()&&xt.selected()&&e.nodeIsGrabbable(xt)});b(He,{addToList:Ge}),Ne.emit(qe("grabon")),He.forEach(ct)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=Ne,e.hoverData.downs=Le,e.hoverData.downTime=new Date().getTime()}a(Ne,["mousedown","tapstart","vmousedown"],K,{x:de[0],y:de[1]}),Ne==null?(be[4]=1,e.data.bgActivePosistion={x:de[0],y:de[1]},e.redrawHint("select",!0),e.redraw()):Ne.pannable()&&(be[4]=1),Ze()}be[0]=be[2]=de[0],be[1]=be[3]=de[1]}},!1);var _=r(e.container);e.registerBinding([t,_],"mousemove",function(K){var oe=e.hoverData.capture;if(!(!oe&&!M(K))){var pe=!1,de=e.cy,be=de.zoom(),Le=[K.clientX,K.clientY],Ne=e.projectIntoViewport(Le[0],Le[1]),Ge=e.hoverData.mdownPos,qe=e.hoverData.mdownGPos,Ze=e.selection,ut=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(ut=e.findNearestElement(Ne[0],Ne[1],!0,!1));var ct=e.hoverData.last,He=e.hoverData.down,xt=[Ne[0]-Ze[2],Ne[1]-Ze[3]],vt=e.dragData.possibleDragElements,dn;if(qe){var Ut=Le[0]-qe[0],nr=Ut*Ut,hn=Le[1]-qe[1],Sn=hn*hn,gn=nr+Sn;e.hoverData.isOverThresholdDrag=dn=gn>=e.desktopTapThreshold2}var En=i(K);dn&&(e.hoverData.tapholdCancelled=!0);var fa=function(){var Yn=e.hoverData.dragDelta=e.hoverData.dragDelta||[];Yn.length===0?(Yn.push(xt[0]),Yn.push(xt[1])):(Yn[0]+=xt[0],Yn[1]+=xt[1])};pe=!0,a(ut,["mousemove","vmousemove","tapdrag"],K,{x:Ne[0],y:Ne[1]});var vn=function(Yn){return{originalEvent:K,type:Yn,position:{x:Ne[0],y:Ne[1]}}},da=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||de.emit(vn("boxstart")),Ze[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(dn){var $n=vn("cxtdrag");He?He.emit($n):de.emit($n),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||ut!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(vn("cxtdragout")),e.hoverData.cxtOver=ut,ut&&ut.emit(vn("cxtdragover")))}}else if(e.hoverData.dragging){if(pe=!0,de.panningEnabled()&&de.userPanningEnabled()){var on;if(e.hoverData.justStartedPan){var Bn=e.hoverData.mdownPos;on={x:(Ne[0]-Bn[0])*be,y:(Ne[1]-Bn[1])*be},e.hoverData.justStartedPan=!1}else on={x:xt[0]*be,y:xt[1]*be};de.panBy(on),de.emit(vn("dragpan")),e.hoverData.dragged=!0}Ne=e.projectIntoViewport(K.clientX,K.clientY)}else if(Ze[4]==1&&(He==null||He.pannable())){if(dn){if(!e.hoverData.dragging&&de.boxSelectionEnabled()&&(En||!de.panningEnabled()||!de.userPanningEnabled()))da();else if(!e.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var Mr=l(He,e.hoverData.downs);Mr&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,Ze[4]=0,e.data.bgActivePosistion=ju(Ge),e.redrawHint("select",!0),e.redraw())}He&&He.pannable()&&He.active()&&He.unactivate()}}else{if(He&&He.pannable()&&He.active()&&He.unactivate(),(!He||!He.grabbed())&&ut!=ct&&(ct&&a(ct,["mouseout","tapdragout"],K,{x:Ne[0],y:Ne[1]}),ut&&a(ut,["mouseover","tapdragover"],K,{x:Ne[0],y:Ne[1]}),e.hoverData.last=ut),He)if(dn){if(de.boxSelectionEnabled()&&En)He&&He.grabbed()&&(w(vt),He.emit(vn("freeon")),vt.emit(vn("free")),e.dragData.didDrag&&(He.emit(vn("dragfreeon")),vt.emit(vn("dragfree")))),da();else if(He&&He.grabbed()&&e.nodeIsDraggable(He)){var Gn=!e.dragData.didDrag;Gn&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||b(vt,{inDragLayer:!0});var Kn={x:0,y:0};if(Ae(xt[0])&&Ae(xt[1])&&(Kn.x+=xt[0],Kn.y+=xt[1],Gn)){var dr=e.hoverData.dragDelta;dr&&Ae(dr[0])&&Ae(dr[1])&&(Kn.x+=dr[0],Kn.y+=dr[1])}e.hoverData.draggingEles=!0,vt.silentShift(Kn).emit(vn("position")).emit(vn("drag")),e.redrawHint("drag",!0),e.redraw()}}else fa();pe=!0}if(Ze[2]=Ne[0],Ze[3]=Ne[1],pe)return K.stopPropagation&&K.stopPropagation(),K.preventDefault&&K.preventDefault(),!1}},!1);var P,H,$;e.registerBinding(t,"mouseup",function(K){if(!(e.hoverData.which===1&&K.which!==1&&e.hoverData.capture)){var oe=e.hoverData.capture;if(oe){e.hoverData.capture=!1;var pe=e.cy,de=e.projectIntoViewport(K.clientX,K.clientY),be=e.selection,Le=e.findNearestElement(de[0],de[1],!0,!1),Ne=e.dragData.possibleDragElements,Ge=e.hoverData.down,qe=i(K);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var Ze=function(Ut){return{originalEvent:K,type:Ut,position:{x:de[0],y:de[1]}}};if(e.hoverData.which===3){var ut=Ze("cxttapend");if(Ge?Ge.emit(ut):pe.emit(ut),!e.hoverData.cxtDragged){var ct=Ze("cxttap");Ge?Ge.emit(ct):pe.emit(ct)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(a(Le,["mouseup","tapend","vmouseup"],K,{x:de[0],y:de[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(a(Ge,["click","tap","vclick"],K,{x:de[0],y:de[1]}),H=!1,K.timeStamp-$<=pe.multiClickDebounceTime()?(P&&clearTimeout(P),H=!0,$=null,a(Ge,["dblclick","dbltap","vdblclick"],K,{x:de[0],y:de[1]})):(P=setTimeout(function(){H||a(Ge,["oneclick","onetap","voneclick"],K,{x:de[0],y:de[1]})},pe.multiClickDebounceTime()),$=K.timeStamp)),Ge==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!i(K)&&(pe.$(n).unselect(["tapunselect"]),Ne.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=Ne=pe.collection()),Le==Ge&&!e.dragData.didDrag&&!e.hoverData.selecting&&Le!=null&&Le._private.selectable&&(e.hoverData.dragging||(pe.selectionType()==="additive"||qe?Le.selected()?Le.unselect(["tapunselect"]):Le.select(["tapselect"]):qe||(pe.$(n).unmerge(Le).unselect(["tapunselect"]),Le.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var He=pe.collection(e.getAllInBox(be[0],be[1],be[2],be[3]));e.redrawHint("select",!0),He.length>0&&e.redrawHint("eles",!0),pe.emit(Ze("boxend"));var xt=function(Ut){return Ut.selectable()&&!Ut.selected()};pe.selectionType()==="additive"||qe||pe.$(n).unmerge(He).unselect(),He.emit(Ze("box")).stdFilter(xt).select().emit(Ze("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!be[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var vt=Ge&&Ge.grabbed();w(Ne),vt&&(Ge.emit(Ze("freeon")),Ne.emit(Ze("free")),e.dragData.didDrag&&(Ge.emit(Ze("dragfreeon")),Ne.emit(Ze("dragfree"))))}}be[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},!1);var V=[],I=4,U,Y=1e5,Q=function(K,oe){for(var pe=0;pe<K.length;pe++)if(K[pe]%oe!==0)return!1;return!0},F=function(K){for(var oe=Math.abs(K[0]),pe=1;pe<K.length;pe++)if(Math.abs(K[pe])!==oe)return!1;return!0},q=function(K){var oe=!1,pe=K.deltaY;if(pe==null&&(K.wheelDeltaY!=null?pe=K.wheelDeltaY/4:K.wheelDelta!=null&&(pe=K.wheelDelta/4)),pe!==0){if(U==null)if(V.length>=I){var de=V;if(U=Q(de,5),!U){var be=Math.abs(de[0]);U=F(de)&&be>5}if(U)for(var Le=0;Le<de.length;Le++)Y=Math.min(Math.abs(de[Le]),Y)}else V.push(pe),oe=!0;else U&&(Y=Math.min(Math.abs(pe),Y));if(!e.scrollingPage){var Ne=e.cy,Ge=Ne.zoom(),qe=Ne.pan(),Ze=e.projectIntoViewport(K.clientX,K.clientY),ut=[Ze[0]*Ge+qe.x,Ze[1]*Ge+qe.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||B()){K.preventDefault();return}if(Ne.panningEnabled()&&Ne.userPanningEnabled()&&Ne.zoomingEnabled()&&Ne.userZoomingEnabled()){K.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var ct;oe&&Math.abs(pe)>5&&(pe=Ow(pe)*5),ct=pe/-250,U&&(ct/=Y,ct*=3),ct=ct*e.wheelSensitivity;var He=K.deltaMode===1;He&&(ct*=33);var xt=Ne.zoom()*Math.pow(10,ct);K.type==="gesturechange"&&(xt=e.gestureStartZoom*K.scale),Ne.zoom({level:xt,renderedPosition:{x:ut[0],y:ut[1]}}),Ne.emit({type:K.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:K,position:{x:Ze[0],y:Ze[1]}})}}}};e.registerBinding(e.container,"wheel",q,!0),e.registerBinding(t,"scroll",function(K){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(K){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||K.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(xe){e.hasTouchStarted||q(xe)},!0),e.registerBinding(e.container,"mouseout",function(K){var oe=e.projectIntoViewport(K.clientX,K.clientY);e.cy.emit({originalEvent:K,type:"mouseout",position:{x:oe[0],y:oe[1]}})},!1),e.registerBinding(e.container,"mouseover",function(K){var oe=e.projectIntoViewport(K.clientX,K.clientY);e.cy.emit({originalEvent:K,type:"mouseover",position:{x:oe[0],y:oe[1]}})},!1);var X,z,W,re,ae,ie,ye,ue,ee,ne,se,ge,ke,Pe=function(K,oe,pe,de){return Math.sqrt((pe-K)*(pe-K)+(de-oe)*(de-oe))},lt=function(K,oe,pe,de){return(pe-K)*(pe-K)+(de-oe)*(de-oe)},Je;e.registerBinding(e.container,"touchstart",Je=function(K){if(e.hasTouchStarted=!0,!!M(K)){C(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var oe=e.cy,pe=e.touchData.now,de=e.touchData.earlier;if(K.touches[0]){var be=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);pe[0]=be[0],pe[1]=be[1]}if(K.touches[1]){var be=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);pe[2]=be[0],pe[3]=be[1]}if(K.touches[2]){var be=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);pe[4]=be[0],pe[5]=be[1]}var Le=function(En){return{originalEvent:K,type:En,position:{x:pe[0],y:pe[1]}}};if(K.touches[1]){e.touchData.singleTouchMoved=!0,w(e.dragData.touchDragEles);var Ne=e.findContainerClientCoords();ee=Ne[0],ne=Ne[1],se=Ne[2],ge=Ne[3],X=K.touches[0].clientX-ee,z=K.touches[0].clientY-ne,W=K.touches[1].clientX-ee,re=K.touches[1].clientY-ne,ke=0<=X&&X<=se&&0<=W&&W<=se&&0<=z&&z<=ge&&0<=re&&re<=ge;var Ge=oe.pan(),qe=oe.zoom();ae=Pe(X,z,W,re),ie=lt(X,z,W,re),ye=[(X+W)/2,(z+re)/2],ue=[(ye[0]-Ge.x)/qe,(ye[1]-Ge.y)/qe];var Ze=200,ut=Ze*Ze;if(ie<ut&&!K.touches[2]){var ct=e.findNearestElement(pe[0],pe[1],!0,!0),He=e.findNearestElement(pe[2],pe[3],!0,!0);ct&&ct.isNode()?(ct.activate().emit(Le("cxttapstart")),e.touchData.start=ct):He&&He.isNode()?(He.activate().emit(Le("cxttapstart")),e.touchData.start=He):oe.emit(Le("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(K.touches[2])oe.boxSelectionEnabled()&&K.preventDefault();else if(!K.touches[1]){if(K.touches[0]){var xt=e.findNearestElements(pe[0],pe[1],!0,!0),vt=xt[0];if(vt!=null&&(vt.activate(),e.touchData.start=vt,e.touchData.starts=xt,e.nodeIsGrabbable(vt))){var dn=e.dragData.touchDragEles=oe.collection(),Ut=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),vt.selected()?(Ut=oe.$(function(gn){return gn.selected()&&e.nodeIsGrabbable(gn)}),b(Ut,{addToList:dn})):S(vt,{addToList:dn}),p(vt),vt.emit(Le("grabon")),Ut?Ut.forEach(function(gn){gn.emit(Le("grab"))}):vt.emit(Le("grab"))}a(vt,["touchstart","tapstart","vmousedown"],K,{x:pe[0],y:pe[1]}),vt==null&&(e.data.bgActivePosistion={x:be[0],y:be[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&a(e.touchData.start,["taphold"],K,{x:pe[0],y:pe[1]})},e.tapholdDuration)}}if(K.touches.length>=1){for(var nr=e.touchData.startPosition=[null,null,null,null,null,null],hn=0;hn<pe.length;hn++)nr[hn]=de[hn]=pe[hn];var Sn=K.touches[0];e.touchData.startGPosition=[Sn.clientX,Sn.clientY]}}},!1);var We;e.registerBinding(t,"touchmove",We=function(K){var oe=e.touchData.capture;if(!(!oe&&!M(K))){var pe=e.selection,de=e.cy,be=e.touchData.now,Le=e.touchData.earlier,Ne=de.zoom();if(K.touches[0]){var Ge=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);be[0]=Ge[0],be[1]=Ge[1]}if(K.touches[1]){var Ge=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);be[2]=Ge[0],be[3]=Ge[1]}if(K.touches[2]){var Ge=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);be[4]=Ge[0],be[5]=Ge[1]}var qe=function(Yd){return{originalEvent:K,type:Yd,position:{x:be[0],y:be[1]}}},Ze=e.touchData.startGPosition,ut;if(oe&&K.touches[0]&&Ze){for(var ct=[],He=0;He<be.length;He++)ct[He]=be[He]-Le[He];var xt=K.touches[0].clientX-Ze[0],vt=xt*xt,dn=K.touches[0].clientY-Ze[1],Ut=dn*dn,nr=vt+Ut;ut=nr>=e.touchTapThreshold2}if(oe&&e.touchData.cxt){K.preventDefault();var hn=K.touches[0].clientX-ee,Sn=K.touches[0].clientY-ne,gn=K.touches[1].clientX-ee,En=K.touches[1].clientY-ne,fa=lt(hn,Sn,gn,En),vn=fa/ie,da=150,$n=da*da,on=1.5,Bn=on*on;if(vn>=Bn||fa>=$n){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Mr=qe("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(Mr),e.touchData.start=null):de.emit(Mr)}}if(oe&&e.touchData.cxt){var Mr=qe("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(Mr):de.emit(Mr),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Gn=e.findNearestElement(be[0],be[1],!0,!0);(!e.touchData.cxtOver||Gn!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(qe("cxtdragout")),e.touchData.cxtOver=Gn,Gn&&Gn.emit(qe("cxtdragover")))}else if(oe&&K.touches[2]&&de.boxSelectionEnabled())K.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||de.emit(qe("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,pe[4]=1,!pe||pe.length===0||pe[0]===void 0?(pe[0]=(be[0]+be[2]+be[4])/3,pe[1]=(be[1]+be[3]+be[5])/3,pe[2]=(be[0]+be[2]+be[4])/3+1,pe[3]=(be[1]+be[3]+be[5])/3+1):(pe[2]=(be[0]+be[2]+be[4])/3,pe[3]=(be[1]+be[3]+be[5])/3),e.redrawHint("select",!0),e.redraw();else if(oe&&K.touches[1]&&!e.touchData.didSelect&&de.zoomingEnabled()&&de.panningEnabled()&&de.userZoomingEnabled()&&de.userPanningEnabled()){K.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Kn=e.dragData.touchDragEles;if(Kn){e.redrawHint("drag",!0);for(var dr=0;dr<Kn.length;dr++){var ds=Kn[dr]._private;ds.grabbed=!1,ds.rscratch.inDragLayer=!1}}var Yn=e.touchData.start,hn=K.touches[0].clientX-ee,Sn=K.touches[0].clientY-ne,gn=K.touches[1].clientX-ee,En=K.touches[1].clientY-ne,Ro=Pe(hn,Sn,gn,En),hs=Ro/ae;if(ke){var vs=hn-X,Al=Sn-z,ps=gn-W,jn=En-re,$d=(vs+ps)/2,Gd=(Al+jn)/2,Yr=de.zoom(),Xa=Yr*hs,Do=de.pan(),Nc=ue[0]*Yr+Do.x,kc=ue[1]*Yr+Do.y,ym={x:-Xa/Yr*(Nc-Do.x-$d)+Nc,y:-Xa/Yr*(kc-Do.y-Gd)+kc};if(Yn&&Yn.active()){var Kn=e.dragData.touchDragEles;w(Kn),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Yn.unactivate().emit(qe("freeon")),Kn.emit(qe("free")),e.dragData.didDrag&&(Yn.emit(qe("dragfreeon")),Kn.emit(qe("dragfree")))}de.viewport({zoom:Xa,pan:ym,cancelOnFailedZoom:!0}),de.emit(qe("pinchzoom")),ae=Ro,X=hn,z=Sn,W=gn,re=En,e.pinching=!0}if(K.touches[0]){var Ge=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);be[0]=Ge[0],be[1]=Ge[1]}if(K.touches[1]){var Ge=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);be[2]=Ge[0],be[3]=Ge[1]}if(K.touches[2]){var Ge=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);be[4]=Ge[0],be[5]=Ge[1]}}else if(K.touches[0]&&!e.touchData.didSelect){var hr=e.touchData.start,ms=e.touchData.last,Gn;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Gn=e.findNearestElement(be[0],be[1],!0,!0)),oe&&hr!=null&&K.preventDefault(),oe&&hr!=null&&e.nodeIsDraggable(hr))if(ut){var Kn=e.dragData.touchDragEles,ha=!e.dragData.didDrag;ha&&b(Kn,{inDragLayer:!0}),e.dragData.didDrag=!0;var Xn={x:0,y:0};if(Ae(ct[0])&&Ae(ct[1])&&(Xn.x+=ct[0],Xn.y+=ct[1],ha)){e.redrawHint("eles",!0);var Or=e.touchData.dragDelta;Or&&Ae(Or[0])&&Ae(Or[1])&&(Xn.x+=Or[0],Xn.y+=Or[1])}e.hoverData.draggingEles=!0,Kn.silentShift(Xn).emit(qe("position")).emit(qe("drag")),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Le[0]&&e.touchData.startPosition[1]==Le[1]&&e.redrawHint("eles",!0),e.redraw()}else{var Or=e.touchData.dragDelta=e.touchData.dragDelta||[];Or.length===0?(Or.push(ct[0]),Or.push(ct[1])):(Or[0]+=ct[0],Or[1]+=ct[1])}if(a(hr||Gn,["touchmove","tapdrag","vmousemove"],K,{x:be[0],y:be[1]}),(!hr||!hr.grabbed())&&Gn!=ms&&(ms&&ms.emit(qe("tapdragout")),Gn&&Gn.emit(qe("tapdragover"))),e.touchData.last=Gn,oe)for(var dr=0;dr<be.length;dr++)be[dr]&&e.touchData.startPosition[dr]&&ut&&(e.touchData.singleTouchMoved=!0);if(oe&&(hr==null||hr.pannable())&&de.panningEnabled()&&de.userPanningEnabled()){var xm=l(hr,e.touchData.starts);xm&&(K.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=ju(e.touchData.startPosition)),e.swipePanning?(de.panBy({x:ct[0]*Ne,y:ct[1]*Ne}),de.emit(qe("dragpan"))):ut&&(e.swipePanning=!0,de.panBy({x:xt*Ne,y:dn*Ne}),de.emit(qe("dragpan")),hr&&(hr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var Ge=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);be[0]=Ge[0],be[1]=Ge[1]}}for(var He=0;He<be.length;He++)Le[He]=be[He];oe&&K.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Ve;e.registerBinding(t,"touchcancel",Ve=function(K){var oe=e.touchData.start;e.touchData.capture=!1,oe&&oe.unactivate()});var Re,Ke,Xe,st;if(e.registerBinding(t,"touchend",Re=function(K){var oe=e.touchData.start,pe=e.touchData.capture;if(pe)K.touches.length===0&&(e.touchData.capture=!1),K.preventDefault();else return;var de=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var be=e.cy,Le=be.zoom(),Ne=e.touchData.now,Ge=e.touchData.earlier;if(K.touches[0]){var qe=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);Ne[0]=qe[0],Ne[1]=qe[1]}if(K.touches[1]){var qe=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);Ne[2]=qe[0],Ne[3]=qe[1]}if(K.touches[2]){var qe=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);Ne[4]=qe[0],Ne[5]=qe[1]}var Ze=function($n){return{originalEvent:K,type:$n,position:{x:Ne[0],y:Ne[1]}}};oe&&oe.unactivate();var ut;if(e.touchData.cxt){if(ut=Ze("cxttapend"),oe?oe.emit(ut):be.emit(ut),!e.touchData.cxtDragged){var ct=Ze("cxttap");oe?oe.emit(ct):be.emit(ct)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!K.touches[2]&&be.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var He=be.collection(e.getAllInBox(de[0],de[1],de[2],de[3]));de[0]=void 0,de[1]=void 0,de[2]=void 0,de[3]=void 0,de[4]=0,e.redrawHint("select",!0),be.emit(Ze("boxend"));var xt=function($n){return $n.selectable()&&!$n.selected()};He.emit(Ze("box")).stdFilter(xt).select().emit(Ze("boxselect")),He.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(oe!=null&&oe.unactivate(),K.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!K.touches[1]){if(!K.touches[0]){if(!K.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var vt=e.dragData.touchDragEles;if(oe!=null){var dn=oe._private.grabbed;w(vt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),dn&&(oe.emit(Ze("freeon")),vt.emit(Ze("free")),e.dragData.didDrag&&(oe.emit(Ze("dragfreeon")),vt.emit(Ze("dragfree")))),a(oe,["touchend","tapend","vmouseup","tapdragout"],K,{x:Ne[0],y:Ne[1]}),oe.unactivate(),e.touchData.start=null}else{var Ut=e.findNearestElement(Ne[0],Ne[1],!0,!0);a(Ut,["touchend","tapend","vmouseup","tapdragout"],K,{x:Ne[0],y:Ne[1]})}var nr=e.touchData.startPosition[0]-Ne[0],hn=nr*nr,Sn=e.touchData.startPosition[1]-Ne[1],gn=Sn*Sn,En=hn+gn,fa=En*Le*Le;e.touchData.singleTouchMoved||(oe||be.$(":selected").unselect(["tapunselect"]),a(oe,["tap","vclick"],K,{x:Ne[0],y:Ne[1]}),Ke=!1,K.timeStamp-st<=be.multiClickDebounceTime()?(Xe&&clearTimeout(Xe),Ke=!0,st=null,a(oe,["dbltap","vdblclick"],K,{x:Ne[0],y:Ne[1]})):(Xe=setTimeout(function(){Ke||a(oe,["onetap","voneclick"],K,{x:Ne[0],y:Ne[1]})},be.multiClickDebounceTime()),st=K.timeStamp)),oe!=null&&!e.dragData.didDrag&&oe._private.selectable&&fa<e.touchTapThreshold2&&!e.pinching&&(be.selectionType()==="single"?(be.$(n).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"])):oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}}}for(var vn=0;vn<Ne.length;vn++)Ge[vn]=Ne[vn];e.dragData.didDrag=!1,K.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),K.touches.length<2&&(K.touches.length===1&&(e.touchData.startGPosition=[K.touches[0].clientX,K.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var ze=[],dt=function(K){return{clientX:K.clientX,clientY:K.clientY,force:1,identifier:K.pointerId,pageX:K.pageX,pageY:K.pageY,radiusX:K.width/2,radiusY:K.height/2,screenX:K.screenX,screenY:K.screenY,target:K.target}},he=function(K){return{event:K,touch:dt(K)}},Ce=function(K){ze.push(he(K))},De=function(K){for(var oe=0;oe<ze.length;oe++){var pe=ze[oe];if(pe.event.pointerId===K.pointerId){ze.splice(oe,1);return}}},Fe=function(K){var oe=ze.filter(function(pe){return pe.event.pointerId===K.pointerId})[0];oe.event=K,oe.touch=dt(K)},Me=function(K){K.touches=ze.map(function(oe){return oe.touch})},Oe=function(K){return K.pointerType==="mouse"||K.pointerType===4};e.registerBinding(e.container,"pointerdown",function(xe){Oe(xe)||(xe.preventDefault(),Ce(xe),Me(xe),Je(xe))}),e.registerBinding(e.container,"pointerup",function(xe){Oe(xe)||(De(xe),Me(xe),Re(xe))}),e.registerBinding(e.container,"pointercancel",function(xe){Oe(xe)||(De(xe),Me(xe),Ve(xe))}),e.registerBinding(e.container,"pointermove",function(xe){Oe(xe)||(xe.preventDefault(),Fe(xe),Me(xe),We(xe))})}};var cs={};cs.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(r,a,i,l,o,f){this.renderer.nodeShapeImpl("polygon",r,a,i,l,o,this.points)},intersectLine:function(r,a,i,l,o,f,c,d){return ad(o,f,this.points,r,a,i/2,l/2,c)},checkPoint:function(r,a,i,l,o,f,c,d){return ss(r,a,this.points,f,c,l,o,[0,-1],i)},hasMiterBounds:e!=="rectangle",miterBounds:function(r,a,i,l,o,f){return WX(this.points,r,a,i,l,o)}}};cs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){return iQ(i,l,t,n,r/2+o,a/2+o)},checkPoint:function(t,n,r,a,i,l,o,f){return to(t,n,a,i,l,o,r)}}};cs.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(r,a,i,l,o,f,c){if(f[c]!==void 0&&f[c+"-cx"]===r&&f[c+"-cy"]===a)return f[c];f[c]=new Array(t.length/2),f[c+"-cx"]=r,f[c+"-cy"]=a;var d=i/2,p=l/2;o=o==="auto"?CL(i,l):o;for(var m=new Array(t.length/2),y=0;y<t.length/2;y++)m[y]={x:r+d*t[y*2],y:a+p*t[y*2+1]};var x,b,S,w,N=m.length;for(b=m[N-1],x=0;x<N;x++)S=m[x%N],w=m[(x+1)%N],f[c][x]=Gw(b,S,w,o),b=S,S=w;return f[c]},draw:function(r,a,i,l,o,f,c){this.renderer.nodeShapeImpl("round-polygon",r,a,i,l,o,this.points,this.getOrCreateCorners(a,i,l,o,f,c,"drawCorners"))},intersectLine:function(r,a,i,l,o,f,c,d,p){return lQ(o,f,this.points,r,a,i,l,c,this.getOrCreateCorners(r,a,i,l,d,p,"corners"))},checkPoint:function(r,a,i,l,o,f,c,d,p){return aQ(r,a,this.points,f,c,l,o,this.getOrCreateCorners(f,c,l,o,d,p,"corners"))}}};cs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Nr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){return SL(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){var c=a/2,d=i/2;f=f==="auto"?gl(a,i):f,f=Math.min(c,d,f);var p=f*2;return!!(ss(t,n,this.points,l,o,a,i-p,[0,-1],r)||ss(t,n,this.points,l,o,a-p,i,[0,-1],r)||to(t,n,p,p,l-c+f,o-d+f,r)||to(t,n,p,p,l+c-f,o-d+f,r)||to(t,n,p,p,l+c-f,o+d-f,r)||to(t,n,p,p,l-c+f,o+d-f,r))}}};cs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:_w(),points:Nr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,null,l)},generateCutTrianglePts:function(t,n,r,a,i){var l=i==="auto"?this.cornerLength:i,o=n/2,f=t/2,c=r-f,d=r+f,p=a-o,m=a+o;return{topLeft:[c,p+l,c+l,p,c+l,p+l],topRight:[d-l,p,d,p+l,d-l,p+l],bottomRight:[d,m-l,d-l,m,d-l,m-l],bottomLeft:[c+l,m,c,m-l,c+l,m-l]}},intersectLine:function(t,n,r,a,i,l,o,f){var c=this.generateCutTrianglePts(r+2*o,a+2*o,t,n,f),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return ad(i,l,d,t,n)},checkPoint:function(t,n,r,a,i,l,o,f){var c=f==="auto"?this.cornerLength:f;if(ss(t,n,this.points,l,o,a,i-2*c,[0,-1],r)||ss(t,n,this.points,l,o,a-2*c,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,l,o);return Hr(t,n,d.topLeft)||Hr(t,n,d.topRight)||Hr(t,n,d.bottomRight)||Hr(t,n,d.bottomLeft)}}};cs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Nr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){var c=.15,d=.5,p=.85,m=this.generateBarrelBezierPts(r+2*o,a+2*o,t,n),y=function(S){var w=Bu({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},c),N=Bu({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},d),C=Bu({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},p);return[S[0],S[1],w.x,w.y,N.x,N.y,C.x,C.y,S[4],S[5]]},x=[].concat(y(m.topLeft),y(m.topRight),y(m.bottomRight),y(m.bottomLeft));return ad(i,l,x,t,n)},generateBarrelBezierPts:function(t,n,r,a){var i=n/2,l=t/2,o=r-l,f=r+l,c=a-i,d=a+i,p=Gb(t,n),m=p.heightOffset,y=p.widthOffset,x=p.ctrlPtOffsetPct*t,b={topLeft:[o,c+m,o+x,c,o+y,c],topRight:[f-y,c,f-x,c,f,c+m],bottomRight:[f,d-m,f-x,d,f-y,d],bottomLeft:[o+y,d,o+x,d,o,d-m]};return b.topLeft.isTop=!0,b.topRight.isTop=!0,b.bottomLeft.isBottom=!0,b.bottomRight.isBottom=!0,b},checkPoint:function(t,n,r,a,i,l,o,f){var c=Gb(a,i),d=c.heightOffset,p=c.widthOffset;if(ss(t,n,this.points,l,o,a,i-2*d,[0,-1],r)||ss(t,n,this.points,l,o,a-2*p,i,[0,-1],r))return!0;for(var m=this.generateBarrelBezierPts(a,i,l,o),y=function(L,B,M){var _=M[4],P=M[2],H=M[0],$=M[5],V=M[1],I=Math.min(_,H),U=Math.max(_,H),Y=Math.min($,V),Q=Math.max($,V);if(I<=L&&L<=U&&Y<=B&&B<=Q){var F=oQ(_,P,H),q=eQ(F[0],F[1],F[2],L),X=q.filter(function(z){return 0<=z&&z<=1});if(X.length>0)return X[0]}return null},x=Object.keys(m),b=0;b<x.length;b++){var S=x[b],w=m[S],N=y(t,n,w);if(N!=null){var C=w[5],T=w[3],R=w[1],A=Zn(C,T,R,N);if(w.isTop&&A<=n||w.isBottom&&n<=A)return!0}}return!1}}};cs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Nr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){var c=t-(r/2+o),d=n-(a/2+o),p=d,m=t+(r/2+o),y=sl(i,l,t,n,c,d,m,p,!1);return y.length>0?y:SL(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){f=f==="auto"?gl(a,i):f;var c=2*f;if(ss(t,n,this.points,l,o,a,i-c,[0,-1],r)||ss(t,n,this.points,l,o,a-c,i,[0,-1],r))return!0;var d=a/2+2*r,p=i/2+2*r,m=[l-d,o-p,l-d,o,l+d,o,l+d,o-p];return!!(Hr(t,n,m)||to(t,n,c,c,l+a/2-f,o+i/2-f,r)||to(t,n,c,c,l-a/2+f,o+i/2-f,r))}}};cs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Nr(3,0)),this.generateRoundPolygon("round-triangle",Nr(3,0)),this.generatePolygon("rectangle",Nr(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Nr(5,0)),this.generateRoundPolygon("round-pentagon",Nr(5,0)),this.generatePolygon("hexagon",Nr(6,0)),this.generateRoundPolygon("round-hexagon",Nr(6,0)),this.generatePolygon("heptagon",Nr(7,0)),this.generateRoundPolygon("round-heptagon",Nr(7,0)),this.generatePolygon("octagon",Nr(8,0)),this.generateRoundPolygon("round-octagon",Nr(8,0));var r=new Array(20);{var a=$b(5,0),i=$b(5,Math.PI/5),l=.5*(3-Math.sqrt(5));l*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=l,i[o*2+1]*=l;for(var o=0;o<20/4;o++)r[o*4]=a[o*2],r[o*4+1]=a[o*2+1],r[o*4+2]=i[o*2],r[o*4+3]=i[o*2+1]}r=EL(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var f=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",f),this.generateRoundPolygon("round-tag",f)}e.makePolygon=function(c){var d=c.join("$"),p="polygon-"+d,m;return(m=this[p])?m:t.generatePolygon(p,c)}};var Vd={};Vd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Vd.redraw=function(e){e=e||yL();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e};Vd.beforeRender=function(e,t){if(!this.destroyed){t==null&&fn("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,a){return a.priority-r.priority})}};var Wj=function(t,n,r){for(var a=t.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Vd.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){Wj(e,!0,a);var i=is();e.render(e.renderOptions);var l=e.lastDrawTime=is();e.averageRedrawTime===void 0&&(e.averageRedrawTime=l-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var o=l-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else Wj(e,!1,a);e.skipFrame=!1,mp(n)}};mp(n)}};var CJ=function(t){this.init(t)},C_=CJ,Cc=C_.prototype;Cc.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Cc.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var a=r.document,i=a.head,l="__________cytoscape_stylesheet",o="__________cytoscape_container",f=a.getElementById(l)!=null;if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!f){var c=a.createElement("style");c.id=l,c.textContent="."+o+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=r.getComputedStyle(n),p=d.getPropertyValue("position");p==="static"&&zt("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Ae(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()};Cc.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),e==="gc"&&n.redrawHint("gc",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Cc.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}};Cc.isHeadless=function(){return!1};[$w,S_,E_,Ec,cs,Vd].forEach(function(e){at(Cc,e)});var _0=1e3/60,N_={setupDequeueing:function(t){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=zd(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},t.deqRedrawThreshold),l=function(c,d){var p=is(),m=a.averageRedrawTime,y=a.lastRedrawTime,x=[],b=a.cy.extent(),S=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var w=is(),N=w-p,C=w-d;if(y<_0){var T=_0-(c?m:0);if(C>=t.deqFastCost*T)break}else if(c){if(N>=t.deqCost*y||N>=t.deqAvgCost*m)break}else if(C>=t.deqNoDrawCost*_0)break;var R=t.deq(r,S,b);if(R.length>0)for(var A=0;A<R.length;A++)x.push(R[A]);else break}x.length>0&&(t.onDeqd(r,x),!c&&t.shouldRedraw(r,x,S,b)&&i())},o=t.priority||Rw;a.beforeRender(l,o(r))}}}},NJ=(function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gp;Cl(this,e),this.idsByKey=new Wi,this.keyForId=new Wi,this.cachesByLvl=new Wi,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return Nl(e,[{key:"getIdsFor",value:function(n){n==null&&fn("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new xc,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new Wi,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])})(),Zj=25,Av=50,Wv=-4,i1=3,k_=7.99,kJ=8,TJ=1024,jJ=1024,AJ=1024,RJ=.2,DJ=.8,MJ=10,OJ=.15,LJ=.1,_J=.9,BJ=.9,PJ=100,zJ=1,Ru={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},IJ=cr({getKey:null,doesEleInvalidateKey:gp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:pL,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),If=function(t,n){var r=this;r.renderer=t,r.onDequeues=[];var a=IJ(n);at(r,a),r.lookup=new NJ(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},Hn=If.prototype;Hn.reasons=Ru;Hn.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]};Hn.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r};Hn.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new Id(function(n,r){return r.reqs-n.reqs});return t};Hn.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};Hn.getElement=function(e,t,n,r,a){var i=this,l=this.renderer,o=l.cy.zoom(),f=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(r==null&&(r=Math.ceil(Mw(o*n))),r<Wv)r=Wv;else if(o>=k_||r>i1)return null;var c=Math.pow(2,r),d=t.h*c,p=t.w*c,m=l.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,m))return null;var y=f.get(e,r);if(y&&y.invalidated&&(y.invalidated=!1,y.texture.invalidatedWidth-=y.width),y)return y;var x;if(d<=Zj?x=Zj:d<=Av?x=Av:x=Math.ceil(d/Av)*Av,d>AJ||p>jJ)return null;var b=i.getTextureQueue(x),S=b[b.length-2],w=function(){return i.recycleTexture(x,p)||i.addTexture(x,p)};S||(S=b[b.length-1]),S||(S=w()),S.width-S.usedWidth<p&&(S=w());for(var N=function(I){return I&&I.scaledLabelShown===m},C=a&&a===Ru.dequeue,T=a&&a===Ru.highQuality,R=a&&a===Ru.downscale,A,D=r+1;D<=i1;D++){var L=f.get(e,D);if(L){A=L;break}}var B=A&&A.level===r+1?A:null,M=function(){S.context.drawImage(B.texture.canvas,B.x,0,B.width,B.height,S.usedWidth,0,p,d)};if(S.context.setTransform(1,0,0,1,0,0),S.context.clearRect(S.usedWidth,0,p,x),N(B))M();else if(N(A))if(T){for(var _=A.level;_>r;_--)B=i.getElement(e,t,n,_,Ru.downscale);M()}else return i.queueElement(e,A.level-1),A;else{var P;if(!C&&!T&&!R)for(var H=r-1;H>=Wv;H--){var $=f.get(e,H);if($){P=$;break}}if(N(P))return i.queueElement(e,r),P;S.context.translate(S.usedWidth,0),S.context.scale(c,c),this.drawElement(S.context,e,t,m,!1),S.context.scale(1/c,1/c),S.context.translate(-S.usedWidth,0)}return y={x:S.usedWidth,texture:S,level:r,scale:c,width:p,height:d,scaledLabelShown:m},S.usedWidth+=Math.ceil(p+kJ),S.eleCaches.push(y),f.set(e,r,y),i.checkTextureFullness(S),y};Hn.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])};Hn.invalidateElement=function(e){var t=this,n=t.lookup,r=[],a=n.isInvalid(e);if(a){for(var i=Wv;i<=i1;i++){var l=n.getForCachedKey(e,i);l&&r.push(l)}var o=n.invalidate(e);if(o)for(var f=0;f<r.length;f++){var c=r[f],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}};Hn.checkTextureUtility=function(e){e.invalidatedWidth>=RJ*e.width&&this.retireTexture(e)};Hn.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>DJ&&e.fullnessChecks>=MJ?ml(n,e):e.fullnessChecks++};Hn.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),a=this.lookup;ml(r,e),e.retired=!0;for(var i=e.eleCaches,l=0;l<i.length;l++){var o=i[l];a.deleteCache(o.key,o.level)}Dw(i);var f=t.getRetiredTextureQueue(n);f.push(e)};Hn.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),a={};return r.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(TJ,t),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};Hn.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var l=a[i];if(l.width>=t)return l.retired=!1,l.usedWidth=0,l.invalidatedWidth=0,l.fullnessChecks=0,Dw(l.eleCaches),l.context.setTransform(1,0,0,1,0,0),l.context.clearRect(0,0,l.width,l.height),ml(a,l),r.push(l),l}};Hn.queueElement=function(e,t){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),l=a[i];if(l)l.level=Math.max(l.level,t),l.eles.merge(e),l.reqs++,r.updateItem(l);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(o),a[i]=o}};Hn.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=[],i=t.lookup,l=0;l<zJ&&n.size()>0;l++){var o=n.pop(),f=o.key,c=o.eles[0],d=i.hasCache(c,o.level);if(r[f]=null,d)continue;a.push(o);var p=t.getBoundingBox(c);t.getElement(c,p,e,o.level,Ru.dequeue)}return a};Hn.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=this.getKey(e),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Aw,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(e))};Hn.onDequeue=function(e){this.onDequeues.push(e)};Hn.offDequeue=function(e){ml(this.onDequeues,e)};Hn.setupDequeueing=N_.setupDequeueing({deqRedrawThreshold:PJ,deqCost:OJ,deqAvgCost:LJ,deqNoDrawCost:_J,deqFastCost:BJ,deq:function(t,n,r){return t.dequeue(n,r)},onDeqd:function(t,n){for(var r=0;r<t.onDequeues.length;r++){var a=t.onDequeues[r];a(n)}},shouldRedraw:function(t,n,r,a){for(var i=0;i<n.length;i++)for(var l=n[i].eles,o=0;o<l.length;o++){var f=l[o].boundingBox();if(Lw(f,a))return!0}return!1},priority:function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var FJ=1,$f=-4,Np=2,qJ=3.99,UJ=50,VJ=50,HJ=.15,$J=.1,GJ=.9,KJ=.9,YJ=1,Jj=250,XJ=4e3*4e3,eA=32767,QJ=!0,T_=function(t){var n=this,r=n.renderer=t,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=is()-2*Jj,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=zd(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},VJ),r.beforeRender(function(l,o){o-n.lastInvalidationTime<=Jj?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(o,f){return f.reqs-o.reqs};n.layersQueue=new Id(i),n.setupDequeueing()},fr=T_.prototype,tA=0,WJ=Math.pow(2,53)-1;fr.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,a),l={id:tA=++tA%WJ,bb:e,level:t,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=l.context,f=-l.bb.x1,c=-l.bb.y1;return o.scale(n,n),o.translate(f,c),l};fr.getLayers=function(e,t,n){var r=this,a=r.renderer,i=a.cy,l=i.zoom(),o=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Mw(l*t)),n<$f)n=$f;else if(l>=qJ||n>Np)return null}r.validateLayersElesOrdering(n,e);var f=r.layersByLevel,c=Math.pow(2,n),d=f[n]=f[n]||[],p,m=r.levelIsComplete(n,e),y,x=function(){var M=function(V){if(r.validateLayersElesOrdering(V,e),r.levelIsComplete(V,e))return y=f[V],!0},_=function(V){if(!y)for(var I=n+V;$f<=I&&I<=Np&&!M(I);I+=V);};_(1),_(-1);for(var P=d.length-1;P>=0;P--){var H=d[P];H.invalid&&ml(d,H)}};if(!m)x();else return d;var b=function(){if(!p){p=jr();for(var M=0;M<e.length;M++)YX(p,e[M].boundingBox())}return p},S=function(M){M=M||{};var _=M.after;b();var P=Math.ceil(p.w*c),H=Math.ceil(p.h*c);if(P>eA||H>eA)return null;var $=P*H;if($>XJ)return null;var V=r.makeLayer(p,n);if(_!=null){var I=d.indexOf(_)+1;d.splice(I,0,V)}else(M.insert===void 0||M.insert)&&d.unshift(V);return V};if(r.skipping&&!o)return null;for(var w=null,N=e.length/FJ,C=!o,T=0;T<e.length;T++){var R=e[T],A=R._private.rscratch,D=A.imgLayerCaches=A.imgLayerCaches||{},L=D[n];if(L){w=L;continue}if((!w||w.eles.length>=N||!wL(w.bb,R.boundingBox()))&&(w=S({insert:!0,after:w}),!w))return null;y||C?r.queueLayer(w,R):r.drawEleInLayer(w,R,n,t),w.eles.push(R),D[n]=w}return y||(C?null:d)};fr.getEleLevelForLayerLevel=function(e,t){return e};fr.drawEleInLayer=function(e,t,n,r){var a=this,i=this.renderer,l=e.context,o=t.boundingBox();o.w===0||o.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(l,!1),i.drawCachedElement(l,t,null,null,n,QJ),i.setImgSmoothing(l,!0))};fr.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var l=r[i];if(l.reqs>0||l.invalid)return!1;a+=l.eles.length}return a===t.length};fr.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,l=0;l<t.length;l++)if(a.eles[0]===t[l]){i=l;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,l=0;l<a.eles.length;l++)if(a.eles[l]!==t[o+l]){this.invalidateLayer(a);break}}};fr.updateElementsInLayers=function(e,t){for(var n=this,r=Ld(e[0]),a=0;a<e.length;a++)for(var i=r?null:e[a],l=r?e[a]:e[a].ele,o=l._private.rscratch,f=o.imgLayerCaches=o.imgLayerCaches||{},c=$f;c<=Np;c++){var d=f[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,l,i))}};fr.haveLayers=function(){for(var e=this,t=!1,n=$f;n<=Np;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t};fr.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=is(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(r,a,i){t.invalidateLayer(r)}))};fr.invalidateLayer=function(e){if(this.lastInvalidationTime=is(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];ml(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}};fr.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(r,a,i){var l=r.replacement;if(l||(l=r.replacement=t.makeLayer(r.bb,r.level),l.replaces=r,l.eles=r.eles),!l.reqs)for(var o=0;o<l.eles.length;o++)t.queueLayer(l,l.eles[o])})};fr.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()};fr.queueLayer=function(e,t){var n=this,r=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}};fr.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<YJ&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var l=i.elesQueue.shift();l&&(t.drawEleInLayer(i,l,i.level,e),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r};fr.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var l=e.eles[i]._private,o=l.imgLayerCaches=l.imgLayerCaches||{};o&&(o[e.level]=e)}t.requestRedraw()}};fr.requestRedraw=zd(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100);fr.setupDequeueing=N_.setupDequeueing({deqRedrawThreshold:UJ,deqCost:HJ,deqAvgCost:$J,deqNoDrawCost:GJ,deqFastCost:KJ,deq:function(t,n){return t.dequeue(n)},onDeqd:Rw,shouldRedraw:pL,priority:function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var j_={},nA;function ZJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function JJ(e,t,n){for(var r,a=0;a<t.length;a++){var i=t[a];a===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function rA(e,t,n){e.beginPath&&e.beginPath();for(var r=t,a=0;a<r.length;a++){var i=r[a];e.lineTo(i.x,i.y)}var l=n,o=n[0];e.moveTo(o.x,o.y);for(var a=1;a<l.length;a++){var i=l[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function eee(e,t,n,r,a){e.beginPath&&e.beginPath(),e.arc(n,r,a,0,Math.PI*2,!1);var i=t,l=i[0];e.moveTo(l.x,l.y);for(var o=0;o<i.length;o++){var f=i[o];e.lineTo(f.x,f.y)}e.closePath&&e.closePath()}function tee(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}j_.arrowShapeImpl=function(e){return(nA||(nA={polygon:ZJ,"triangle-backcurve":JJ,"triangle-tee":rA,"circle-triangle":eee,"triangle-cross":rA,circle:tee}))[e]};var Ei={};Ei.drawElement=function(e,t,n,r,a,i){var l=this;t.isNode()?l.drawNode(e,t,n,r,a,i):l.drawEdge(e,t,n,r,a,i)};Ei.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)};Ei.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)};Ei.drawCachedElementPortion=function(e,t,n,r,a,i,l,o){var f=this,c=n.getBoundingBox(t);if(!(c.w===0||c.h===0)){var d=n.getElement(t,c,r,a,i);if(d!=null){var p=o(f,t);if(p===0)return;var m=l(f,t),y=c.x1,x=c.y1,b=c.w,S=c.h,w,N,C,T,R;if(m!==0){var A=n.getRotationPoint(t);C=A.x,T=A.y,e.translate(C,T),e.rotate(m),R=f.getImgSmoothing(e),R||f.setImgSmoothing(e,!0);var D=n.getRotationOffset(t);w=D.x,N=D.y}else w=y,N=x;var L;p!==1&&(L=e.globalAlpha,e.globalAlpha=L*p),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,w,N,b,S),p!==1&&(e.globalAlpha=L),m!==0&&(e.rotate(-m),e.translate(-C,-T),R||f.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var nee=function(){return 0},ree=function(t,n){return t.getTextAngle(n,null)},aee=function(t,n){return t.getTextAngle(n,"source")},iee=function(t,n){return t.getTextAngle(n,"target")},see=function(t,n){return n.effectiveOpacity()},B0=function(t,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Ei.drawCachedElement=function(e,t,n,r,a,i){var l=this,o=l.data,f=o.eleTxrCache,c=o.lblTxrCache,d=o.slbTxrCache,p=o.tlbTxrCache,m=t.boundingBox(),y=i===!0?f.reasons.highQuality:null;if(!(m.w===0||m.h===0||!t.visible())&&(!r||Lw(m,r))){var x=t.isEdge(),b=t.element()._private.rscratch.badLine;l.drawElementUnderlay(e,t),l.drawCachedElementPortion(e,t,f,n,a,y,nee,see),(!x||!b)&&l.drawCachedElementPortion(e,t,c,n,a,y,ree,B0),x&&!b&&(l.drawCachedElementPortion(e,t,d,n,a,y,aee,B0),l.drawCachedElementPortion(e,t,p,n,a,y,iee,B0)),l.drawElementOverlay(e,t)}};Ei.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var a=t[r];n.drawElement(e,a)}};Ei.drawCachedElements=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];a.drawCachedElement(e,l,n,r)}};Ei.drawCachedNodes=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];l.isNode()&&a.drawCachedElement(e,l,n,r)}};Ei.drawLayeredElements=function(e,t,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var l=0;l<i.length;l++){var o=i[l],f=o.bb;f.w===0||f.h===0||e.drawImage(o.canvas,f.x1,f.y1,f.w,f.h)}else a.drawCachedElements(e,t,n,r)};var fs={};fs.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o=t._private.rscratch;if(!(i&&!t.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var f;n&&(f=n,e.translate(-f.x1,-f.y1));var c=i?t.pstyle("opacity").value:1,d=i?t.pstyle("line-opacity").value:1,p=t.pstyle("curve-style").value,m=t.pstyle("line-style").value,y=t.pstyle("width").pfValue,x=t.pstyle("line-cap").value,b=t.pstyle("line-outline-width").value,S=t.pstyle("line-outline-color").value,w=c*d,N=c*d,C=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;p==="straight-triangle"?(l.eleStrokeStyle(e,t,V),l.drawEdgeTrianglePath(t,e,o.allpts)):(e.lineWidth=y,e.lineCap=x,l.eleStrokeStyle(e,t,V),l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},T=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;if(e.lineWidth=y+b,e.lineCap=x,b>0)l.colorStrokeStyle(e,S[0],S[1],S[2],V);else{e.lineCap="butt";return}p==="straight-triangle"?l.drawEdgeTrianglePath(t,e,o.allpts):(l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},R=function(){a&&l.drawEdgeOverlay(e,t)},A=function(){a&&l.drawEdgeUnderlay(e,t)},D=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;l.drawArrowheads(e,t,V)},L=function(){l.drawElementText(e,t,null,r)};e.lineJoin="round";var B=t.pstyle("ghost").value==="yes";if(B){var M=t.pstyle("ghost-offset-x").pfValue,_=t.pstyle("ghost-offset-y").pfValue,P=t.pstyle("ghost-opacity").value,H=w*P;e.translate(M,_),C(H),D(H),e.translate(-M,-_)}else T();A(),C(),D(),R(),L(),n&&e.translate(f.x1,f.y1)}};var A_=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(t,"-opacity")).value;if(a!==0){var i=this,l=i.usePaths(),o=r._private.rscratch,f=r.pstyle("".concat(t,"-padding")).pfValue,c=2*f,d=r.pstyle("".concat(t,"-color")).value;n.lineWidth=c,o.edgeType==="self"&&!l?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,o.allpts,"solid")}}}};fs.drawEdgeOverlay=A_("overlay");fs.drawEdgeUnderlay=A_("underlay");fs.drawEdgePath=function(e,t,n,r){var a=e._private.rscratch,i=t,l,o=!1,f=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(f){var p=n.join("$"),m=a.pathCacheKey&&a.pathCacheKey===p;m?(l=t=a.pathCache,o=!0):(l=t=new Path2D,a.pathCacheKey=p,a.pathCache=l)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var y=2;y+3<n.length;y+=4)t.quadraticCurveTo(n[y],n[y+1],n[y+2],n[y+3]);break;case"straight":case"haystack":for(var x=2;x+1<n.length;x+=2)t.lineTo(n[x],n[x+1]);break;case"segments":if(a.isRound){var b=Gr(a.roundCorners),S;try{for(b.s();!(S=b.n()).done;){var w=S.value;g_(t,w)}}catch(C){b.e(C)}finally{b.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var N=2;N+1<n.length;N+=2)t.lineTo(n[N],n[N+1]);break}t=i,f?t.stroke(l):t.stroke(),t.setLineDash&&t.setLineDash([])};fs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/l,-i[0]/l],f=[o[0]*r/2,o[1]*r/2];t.beginPath(),t.moveTo(n[a]-f[0],n[a+1]-f[1]),t.lineTo(n[a]+f[0],n[a+1]+f[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}};fs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)};fs.drawArrowhead=function(e,t,n,r,a,i,l){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,f=t.pstyle(n+"-arrow-shape").value;if(f!=="none"){var c=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(n+"-arrow-fill").value,p=t.pstyle("width").pfValue,m=t.pstyle(n+"-arrow-width"),y=m.value==="match-line"?p:m.pfValue;m.units==="%"&&(y*=p);var x=t.pstyle("opacity").value;l===void 0&&(l=x);var b=e.globalCompositeOperation;(l!==1||d==="hollow")&&(e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,1),o.colorStrokeStyle(e,255,255,255,1),o.drawArrowShape(t,e,c,p,f,y,r,a,i),e.globalCompositeOperation=b);var S=t.pstyle(n+"-arrow-color").value;o.colorFillStyle(e,S[0],S[1],S[2],l),o.colorStrokeStyle(e,S[0],S[1],S[2],l),o.drawArrowShape(t,e,d,p,f,y,r,a,i)}}};fs.drawArrowShape=function(e,t,n,r,a,i,l,o,f){var c=this,d=this.usePaths()&&a!=="triangle-cross",p=!1,m,y=t,x={x:l,y:o},b=e.pstyle("arrow-scale").value,S=this.getArrowWidth(r,b),w=c.arrowShapes[a];if(d){var N=c.arrowPathCache=c.arrowPathCache||[],C=wo(a),T=N[C];T!=null?(m=t=T,p=!0):(m=t=new Path2D,N[C]=m)}p||(t.beginPath&&t.beginPath(),d?w.draw(t,1,0,{x:0,y:0},1):w.draw(t,S,f,x,r),t.closePath&&t.closePath()),t=y,d&&(t.translate(l,o),t.rotate(f),t.scale(S,S)),(n==="filled"||n==="both")&&(d?t.fill(m):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(d?S:1),t.lineJoin="miter",d?t.stroke(m):t.stroke()),d&&(t.scale(1/S,1/S),t.rotate(-f),t.translate(-l,-o))};var Yw={};Yw.safeDrawImage=function(e,t,n,r,a,i,l,o,f,c){if(!(a<=0||i<=0||f<=0||c<=0))try{e.drawImage(t,n,r,a,i,l,o,f,c)}catch(d){zt(d)}};Yw.drawInscribedImage=function(e,t,n,r,a){var i=this,l=n.position(),o=l.x,f=l.y,c=n.cy().style(),d=c.getIndexedStyle.bind(c),p=d(n,"background-fit","value",r),m=d(n,"background-repeat","value",r),y=n.width(),x=n.height(),b=n.padding()*2,S=y+(d(n,"background-width-relative-to","value",r)==="inner"?0:b),w=x+(d(n,"background-height-relative-to","value",r)==="inner"?0:b),N=n._private.rscratch,C=d(n,"background-clip","value",r),T=C==="node",R=d(n,"background-image-opacity","value",r)*a,A=d(n,"background-image-smoothing","value",r),D=n.pstyle("corner-radius").value;D!=="auto"&&(D=n.pstyle("corner-radius").pfValue);var L=t.width||t.cachedW,B=t.height||t.cachedH;(L==null||B==null)&&(document.body.appendChild(t),L=t.cachedW=t.width||t.offsetWidth,B=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var M=L,_=B;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?M=d(n,"background-width","pfValue",r)*S:M=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?_=d(n,"background-height","pfValue",r)*w:_=d(n,"background-height","pfValue",r)),!(M===0||_===0)){if(p==="contain"){var P=Math.min(S/M,w/_);M*=P,_*=P}else if(p==="cover"){var P=Math.max(S/M,w/_);M*=P,_*=P}var H=o-S/2,$=d(n,"background-position-x","units",r),V=d(n,"background-position-x","pfValue",r);$==="%"?H+=(S-M)*V:H+=V;var I=d(n,"background-offset-x","units",r),U=d(n,"background-offset-x","pfValue",r);I==="%"?H+=(S-M)*U:H+=U;var Y=f-w/2,Q=d(n,"background-position-y","units",r),F=d(n,"background-position-y","pfValue",r);Q==="%"?Y+=(w-_)*F:Y+=F;var q=d(n,"background-offset-y","units",r),X=d(n,"background-offset-y","pfValue",r);q==="%"?Y+=(w-_)*X:Y+=X,N.pathCache&&(H-=o,Y-=f,o=0,f=0);var z=e.globalAlpha;e.globalAlpha=R;var W=i.getImgSmoothing(e),re=!1;if(A==="no"&&W?(i.setImgSmoothing(e,!1),re=!0):A==="yes"&&!W&&(i.setImgSmoothing(e,!0),re=!0),m==="no-repeat")T&&(e.save(),N.pathCache?e.clip(N.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,w,D,N),e.clip())),i.safeDrawImage(e,t,0,0,L,B,H,Y,M,_),T&&e.restore();else{var ae=e.createPattern(t,m);e.fillStyle=ae,i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,w,D,N),e.translate(H,Y),e.fill(),e.translate(-H,-Y)}e.globalAlpha=z,re&&i.setImgSmoothing(e,W)}};var Ao={};Ao.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Mw(n*r));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,l=e.pstyle("min-zoomed-font-size").pfValue;return!(i<l)};Ao.drawElementText=function(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this;if(r==null){if(i&&!l.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var o=t.pstyle("label");if(!o||!o.value)return;var f=l.getLabelJustification(t);e.textAlign=f,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,d=t.pstyle("label"),p=t.pstyle("source-label"),m=t.pstyle("target-label");if(c||(!d||!d.value)&&(!p||!p.value)&&(!m||!m.value))return;e.textAlign="center",e.textBaseline="bottom"}var y=!n,x;n&&(x=n,e.translate(-x.x1,-x.y1)),a==null?(l.drawText(e,t,null,y,i),t.isEdge()&&(l.drawText(e,t,"source",y,i),l.drawText(e,t,"target",y,i))):l.drawText(e,t,a,y,i),n&&e.translate(x.x1,x.y1)};Ao.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t};Ao.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,l=t.pstyle("font-weight").strValue,o=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,f=t.pstyle("text-outline-opacity").value*o,c=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=r+" "+l+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],o),this.colorStrokeStyle(e,d[0],d[1],d[2],f)};function lee(e,t,n,r,a){var i=Math.min(r,a),l=i/2,o=t+r/2,f=n+a/2;e.beginPath(),e.arc(o,f,l,0,Math.PI*2),e.closePath()}function aA(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,l=Math.min(i,r/2,a/2);e.beginPath(),e.moveTo(t+l,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+a-l),e.quadraticCurveTo(t+r,n+a,t+r-l,n+a),e.lineTo(t+l,n+a),e.quadraticCurveTo(t,n+a,t,n+a-l),e.lineTo(t,n+l),e.quadraticCurveTo(t,n,t+l,n),e.closePath()}Ao.getTextAngle=function(e,t){var n,r=e._private,a=r.rscratch,i=t?t+"-":"",l=e.pstyle(i+"text-rotation");if(l.strValue==="autorotate"){var o=Vr(a,"labelAngle",t);n=e.isEdge()?o:0}else l.strValue==="none"?n=0:n=l.pfValue;return n};Ao.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,l=i.rscratch,o=a?t.effectiveOpacity():1;if(!(a&&(o===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var f=Vr(l,"labelX",n),c=Vr(l,"labelY",n),d,p,m=this.getLabelText(t,n);if(m!=null&&m!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(e,t,a);var y=n?n+"-":"",x=Vr(l,"labelWidth",n),b=Vr(l,"labelHeight",n),S=t.pstyle(y+"text-margin-x").pfValue,w=t.pstyle(y+"text-margin-y").pfValue,N=t.isEdge(),C=t.pstyle("text-halign").value,T=t.pstyle("text-valign").value;N&&(C="center",T="center"),f+=S,c+=w;var R;switch(r?R=this.getTextAngle(t,n):R=0,R!==0&&(d=f,p=c,e.translate(d,p),e.rotate(R),f=0,c=0),T){case"top":break;case"center":c+=b/2;break;case"bottom":c+=b;break}var A=t.pstyle("text-background-opacity").value,D=t.pstyle("text-border-opacity").value,L=t.pstyle("text-border-width").pfValue,B=t.pstyle("text-background-padding").pfValue,M=t.pstyle("text-background-shape").strValue,_=M==="round-rectangle"||M==="roundrectangle",P=M==="circle",H=2;if(A>0||L>0&&D>0){var $=e.fillStyle,V=e.strokeStyle,I=e.lineWidth,U=t.pstyle("text-background-color").value,Y=t.pstyle("text-border-color").value,Q=t.pstyle("text-border-style").value,F=A>0,q=L>0&&D>0,X=f-B;switch(C){case"left":X-=x;break;case"center":X-=x/2;break}var z=c-b-B,W=x+2*B,re=b+2*B;if(F&&(e.fillStyle="rgba(".concat(U[0],",").concat(U[1],",").concat(U[2],",").concat(A*o,")")),q&&(e.strokeStyle="rgba(".concat(Y[0],",").concat(Y[1],",").concat(Y[2],",").concat(D*o,")"),e.lineWidth=L,e.setLineDash))switch(Q){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=L/4,e.setLineDash([]);break;case"solid":default:e.setLineDash([]);break}if(_?(e.beginPath(),aA(e,X,z,W,re,H)):P?(e.beginPath(),lee(e,X,z,W,re)):(e.beginPath(),e.rect(X,z,W,re)),F&&e.fill(),q&&e.stroke(),q&&Q==="double"){var ae=L/2;e.beginPath(),_?aA(e,X+ae,z+ae,W-2*ae,re-2*ae,H):e.rect(X+ae,z+ae,W-2*ae,re-2*ae),e.stroke()}e.fillStyle=$,e.strokeStyle=V,e.lineWidth=I,e.setLineDash&&e.setLineDash([])}var ie=2*t.pstyle("text-outline-width").pfValue;if(ie>0&&(e.lineWidth=ie),t.pstyle("text-wrap").value==="wrap"){var ye=Vr(l,"labelWrapCachedLines",n),ue=Vr(l,"labelLineHeight",n),ee=x/2,ne=this.getLabelJustification(t);switch(ne==="auto"||(C==="left"?ne==="left"?f+=-x:ne==="center"&&(f+=-ee):C==="center"?ne==="left"?f+=-ee:ne==="right"&&(f+=ee):C==="right"&&(ne==="center"?f+=ee:ne==="right"&&(f+=x))),T){case"top":c-=(ye.length-1)*ue;break;case"center":case"bottom":c-=(ye.length-1)*ue;break}for(var se=0;se<ye.length;se++)ie>0&&e.strokeText(ye[se],f,c),e.fillText(ye[se],f,c),c+=ue}else ie>0&&e.strokeText(m,f,c),e.fillText(m,f,c);R!==0&&(e.rotate(-R),e.translate(-d,-p))}}};var Tl={};Tl.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o,f,c=t._private,d=c.rscratch,p=t.position();if(!(!Ae(p.x)||!Ae(p.y))&&!(i&&!t.visible())){var m=i?t.effectiveOpacity():1,y=l.usePaths(),x,b=!1,S=t.padding();o=t.width()+2*S,f=t.height()+2*S;var w;n&&(w=n,e.translate(-w.x1,-w.y1));for(var N=t.pstyle("background-image"),C=N.value,T=new Array(C.length),R=new Array(C.length),A=0,D=0;D<C.length;D++){var L=C[D],B=T[D]=L!=null&&L!=="none";if(B){var M=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",D);A++,R[D]=l.getCachedImage(L,M,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var _=t.pstyle("background-blacken").value,P=t.pstyle("border-width").pfValue,H=t.pstyle("background-opacity").value*m,$=t.pstyle("border-color").value,V=t.pstyle("border-style").value,I=t.pstyle("border-join").value,U=t.pstyle("border-cap").value,Y=t.pstyle("border-position").value,Q=t.pstyle("border-dash-pattern").pfValue,F=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*m,X=t.pstyle("outline-width").pfValue,z=t.pstyle("outline-color").value,W=t.pstyle("outline-style").value,re=t.pstyle("outline-opacity").value*m,ae=t.pstyle("outline-offset").value,ie=t.pstyle("corner-radius").value;ie!=="auto"&&(ie=t.pstyle("corner-radius").pfValue);var ye=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;l.eleFillStyle(e,t,Oe)},ue=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;l.colorStrokeStyle(e,$[0],$[1],$[2],Oe)},ee=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re;l.colorStrokeStyle(e,z[0],z[1],z[2],Oe)},ne=function(Oe,xe,K,oe){var pe=l.nodePathCache=l.nodePathCache||[],de=vL(K==="polygon"?K+","+oe.join(","):K,""+xe,""+Oe,""+ie),be=pe[de],Le,Ne=!1;return be!=null?(Le=be,Ne=!0,d.pathCache=Le):(Le=new Path2D,pe[de]=d.pathCache=Le),{path:Le,cacheHit:Ne}},se=t.pstyle("shape").strValue,ge=t.pstyle("shape-polygon-points").pfValue;if(y){e.translate(p.x,p.y);var ke=ne(o,f,se,ge);x=ke.path,b=ke.cacheHit}var Pe=function(){if(!b){var Oe=p;y&&(Oe={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(x||e,Oe.x,Oe.y,o,f,ie,d)}y?e.fill(x):e.fill()},lt=function(){for(var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=c.backgrounding,oe=0,pe=0;pe<R.length;pe++){var de=t.cy().style().getIndexedStyle(t,"background-image-containment","value",pe);if(xe&&de==="over"||!xe&&de==="inside"){oe++;continue}T[pe]&&R[pe].complete&&!R[pe].error&&(oe++,l.drawInscribedImage(e,R[pe],t,pe,Oe))}c.backgrounding=oe!==A,K!==c.backgrounding&&t.updateStyle(!1)},Je=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasPie(t)&&(l.drawPie(e,t,xe),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,ie,d)))},We=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasStripe(t)&&(e.save(),y?e.clip(d.pathCache):(l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,ie,d),e.clip()),l.drawStripe(e,t,xe),e.restore(),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,ie,d)))},Ve=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,xe=(_>0?_:-_)*Oe,K=_>0?0:255;_!==0&&(l.colorFillStyle(e,K,K,K,xe),y?e.fill(x):e.fill())},Re=function(){if(P>0){if(e.lineWidth=P,e.lineCap=U,e.lineJoin=I,e.setLineDash)switch(V){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(Q),e.lineDashOffset=F;break;case"solid":case"double":e.setLineDash([]);break}if(Y!=="center"){if(e.save(),e.lineWidth*=2,Y==="inside")y?e.clip(x):e.clip();else{var Oe=new Path2D;Oe.rect(-o/2-P,-f/2-P,o+2*P,f+2*P),Oe.addPath(x),e.clip(Oe,"evenodd")}y?e.stroke(x):e.stroke(),e.restore()}else y?e.stroke(x):e.stroke();if(V==="double"){e.lineWidth=P/3;var xe=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(x):e.stroke(),e.globalCompositeOperation=xe}e.setLineDash&&e.setLineDash([])}},Ke=function(){if(X>0){if(e.lineWidth=X,e.lineCap="butt",e.setLineDash)switch(W){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var Oe=p;y&&(Oe={x:0,y:0});var xe=l.getNodeShape(t),K=P;Y==="inside"&&(K=0),Y==="outside"&&(K*=2);var oe=(o+K+(X+ae))/o,pe=(f+K+(X+ae))/f,de=o*oe,be=f*pe,Le=l.nodeShapes[xe].points,Ne;if(y){var Ge=ne(de,be,xe,Le);Ne=Ge.path}if(xe==="ellipse")l.drawEllipsePath(Ne||e,Oe.x,Oe.y,de,be);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(xe)){var qe=0,Ze=0,ut=0;xe==="round-diamond"?qe=(K+ae+X)*1.4:xe==="round-heptagon"?(qe=(K+ae+X)*1.075,ut=-(K/2+ae+X)/35):xe==="round-hexagon"?qe=(K+ae+X)*1.12:xe==="round-pentagon"?(qe=(K+ae+X)*1.13,ut=-(K/2+ae+X)/15):xe==="round-tag"?(qe=(K+ae+X)*1.12,Ze=(K/2+X+ae)*.07):xe==="round-triangle"&&(qe=(K+ae+X)*(Math.PI/2),ut=-(K+ae/2+X)/Math.PI),qe!==0&&(oe=(o+qe)/o,de=o*oe,["round-hexagon","round-tag"].includes(xe)||(pe=(f+qe)/f,be=f*pe)),ie=ie==="auto"?CL(de,be):ie;for(var ct=de/2,He=be/2,xt=ie+(K+X+ae)/2,vt=new Array(Le.length/2),dn=new Array(Le.length/2),Ut=0;Ut<Le.length/2;Ut++)vt[Ut]={x:Oe.x+Ze+ct*Le[Ut*2],y:Oe.y+ut+He*Le[Ut*2+1]};var nr,hn,Sn,gn,En=vt.length;for(hn=vt[En-1],nr=0;nr<En;nr++)Sn=vt[nr%En],gn=vt[(nr+1)%En],dn[nr]=Gw(hn,Sn,gn,xt),hn=Sn,Sn=gn;l.drawRoundPolygonPath(Ne||e,Oe.x+Ze,Oe.y+ut,o*oe,f*pe,Le,dn)}else if(["roundrectangle","round-rectangle"].includes(xe))ie=ie==="auto"?gl(de,be):ie,l.drawRoundRectanglePath(Ne||e,Oe.x,Oe.y,de,be,ie+(K+X+ae)/2);else if(["cutrectangle","cut-rectangle"].includes(xe))ie=ie==="auto"?_w():ie,l.drawCutRectanglePath(Ne||e,Oe.x,Oe.y,de,be,null,ie+(K+X+ae)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(xe))ie=ie==="auto"?gl(de,be):ie,l.drawBottomRoundRectanglePath(Ne||e,Oe.x,Oe.y,de,be,ie+(K+X+ae)/2);else if(xe==="barrel")l.drawBarrelPath(Ne||e,Oe.x,Oe.y,de,be);else if(xe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(xe)){var fa=(K+X+ae)/o;Le=yp(xp(Le,fa)),l.drawPolygonPath(Ne||e,Oe.x,Oe.y,o,f,Le)}else{var vn=(K+X+ae)/o;Le=yp(xp(Le,-vn)),l.drawPolygonPath(Ne||e,Oe.x,Oe.y,o,f,Le)}if(y?e.stroke(Ne):e.stroke(),W==="double"){e.lineWidth=K/3;var da=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(Ne):e.stroke(),e.globalCompositeOperation=da}e.setLineDash&&e.setLineDash([])}},Xe=function(){a&&l.drawNodeOverlay(e,t,p,o,f)},st=function(){a&&l.drawNodeUnderlay(e,t,p,o,f)},ze=function(){l.drawElementText(e,t,null,r)},dt=t.pstyle("ghost").value==="yes";if(dt){var he=t.pstyle("ghost-offset-x").pfValue,Ce=t.pstyle("ghost-offset-y").pfValue,De=t.pstyle("ghost-opacity").value,Fe=De*m;e.translate(he,Ce),ee(),Ke(),ye(De*H),Pe(),lt(Fe,!0),ue(De*q),Re(),Je(_!==0||P!==0),We(_!==0||P!==0),lt(Fe,!1),Ve(Fe),e.translate(-he,-Ce)}y&&e.translate(-p.x,-p.y),st(),y&&e.translate(p.x,p.y),ee(),Ke(),ye(),Pe(),lt(m,!0),ue(),Re(),Je(_!==0||P!==0),We(_!==0||P!==0),lt(m,!1),Ve(),y&&e.translate(-p.x,-p.y),ze(),Xe(),n&&e.translate(w.x1,w.y1)}};var R_=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r,a,i,l){var o=this;if(r.visible()){var f=r.pstyle("".concat(t,"-padding")).pfValue,c=r.pstyle("".concat(t,"-opacity")).value,d=r.pstyle("".concat(t,"-color")).value,p=r.pstyle("".concat(t,"-shape")).value,m=r.pstyle("".concat(t,"-corner-radius")).value;if(c>0){if(a=a||r.position(),i==null||l==null){var y=r.padding();i=r.width()+2*y,l=r.height()+2*y}o.colorFillStyle(n,d[0],d[1],d[2],c),o.nodeShapes[p].draw(n,a.x,a.y,i+f*2,l+f*2,m),n.fill()}}}};Tl.drawNodeOverlay=R_("overlay");Tl.drawNodeUnderlay=R_("underlay");Tl.hasPie=function(e){return e=e[0],e._private.hasPie};Tl.hasStripe=function(e){return e=e[0],e._private.hasStripe};Tl.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),l=t.pstyle("pie-hole"),o=t.pstyle("pie-start-angle").pfValue,f=r.x,c=r.y,d=t.width(),p=t.height(),m=Math.min(d,p)/2,y,x=0,b=this.usePaths();if(b&&(f=0,c=0),i.units==="%"?m=m*i.pfValue:i.pfValue!==void 0&&(m=i.pfValue/2),l.units==="%"?y=m*l.pfValue:l.pfValue!==void 0&&(y=l.pfValue/2),!(y>=m))for(var S=1;S<=a.pieBackgroundN;S++){var w=t.pstyle("pie-"+S+"-background-size").value,N=t.pstyle("pie-"+S+"-background-color").value,C=t.pstyle("pie-"+S+"-background-opacity").value*n,T=w/100;T+x>1&&(T=1-x);var R=1.5*Math.PI+2*Math.PI*x;R+=o;var A=2*Math.PI*T,D=R+A;w===0||x>=1||x+T>1||(y===0?(e.beginPath(),e.moveTo(f,c),e.arc(f,c,m,R,D),e.closePath()):(e.beginPath(),e.arc(f,c,m,R,D),e.arc(f,c,y,D,R,!0),e.closePath()),this.colorFillStyle(e,N[0],N[1],N[2],C),e.fill(),x+=T)}};Tl.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=r.x,l=r.y,o=t.width(),f=t.height(),c=0,d=this.usePaths();e.save();var p=t.pstyle("stripe-direction").value,m=t.pstyle("stripe-size");switch(p){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var y=o,x=f;m.units==="%"?(y=y*m.pfValue,x=x*m.pfValue):m.pfValue!==void 0&&(y=m.pfValue,x=m.pfValue),d&&(i=0,l=0),l-=y/2,i-=x/2;for(var b=1;b<=a.stripeBackgroundN;b++){var S=t.pstyle("stripe-"+b+"-background-size").value,w=t.pstyle("stripe-"+b+"-background-color").value,N=t.pstyle("stripe-"+b+"-background-opacity").value*n,C=S/100;C+c>1&&(C=1-c),!(S===0||c>=1||c+C>1)&&(e.beginPath(),e.rect(i,l+x*c,y,x*C),e.closePath(),this.colorFillStyle(e,w[0],w[1],w[2],N),e.fill(),c+=C)}e.restore()};var Dr={},oee=100;Dr.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n};Dr.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<t.length;a++)if(r=t[a],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r};Dr.createGradientStyleFor=function(e,t,n,r,a){var i,l=this.usePaths(),o=n.pstyle(t+"-gradient-stop-colors").value,f=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),d=n.targetEndpoint(),p=n.midpoint(),m=So(c,p),y=So(d,p);i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(m,y))}else{var x=l?{x:0,y:0}:n.position(),b=n.paddedWidth(),S=n.paddedHeight();i=e.createRadialGradient(x.x,x.y,0,x.x,x.y,Math.max(b,S))}else if(n.isEdge()){var w=n.sourceEndpoint(),N=n.targetEndpoint();i=e.createLinearGradient(w.x,w.y,N.x,N.y)}else{var C=l?{x:0,y:0}:n.position(),T=n.paddedWidth(),R=n.paddedHeight(),A=T/2,D=R/2,L=n.pstyle("background-gradient-direction").value;switch(L){case"to-bottom":i=e.createLinearGradient(C.x,C.y-D,C.x,C.y+D);break;case"to-top":i=e.createLinearGradient(C.x,C.y+D,C.x,C.y-D);break;case"to-left":i=e.createLinearGradient(C.x+A,C.y,C.x-A,C.y);break;case"to-right":i=e.createLinearGradient(C.x-A,C.y,C.x+A,C.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(C.x-A,C.y-D,C.x+A,C.y+D);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(C.x-A,C.y+D,C.x+A,C.y-D);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(C.x+A,C.y-D,C.x-A,C.y+D);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(C.x+A,C.y+D,C.x-A,C.y-D);break}}if(!i)return null;for(var B=f.length===o.length,M=o.length,_=0;_<M;_++)i.addColorStop(B?f[_]:_/(M-1),"rgba("+o[_][0]+","+o[_][1]+","+o[_][2]+","+a+")");return i};Dr.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a};Dr.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"};Dr.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}};Dr.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a};Dr.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"};Dr.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}};Dr.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),a=r[2],i=r[3],l=t.getPixelRatio(),o=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(l=o);var f=a*l,c=i*l,d;if(!(f===t.canvasWidth&&c===t.canvasHeight)){t.fontCaches=null;var p=n.canvasContainer;p.style.width=a+"px",p.style.height=i+"px";for(var m=0;m<t.CANVAS_LAYERS;m++)d=n.canvases[m],d.width=f,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var m=0;m<t.BUFFER_COUNT;m++)d=n.bufferCanvases[m],d.width=f,d.height=c,d.style.width=a+"px",d.style.height=i+"px";t.textureMult=1,l<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=f*t.textureMult,d.height=c*t.textureMult),t.canvasWidth=f,t.canvasHeight=c,t.pixelRatio=l}};Dr.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};Dr.clearCanvas=function(){var e=this,t=e.data;function n(r){r.clearRect(0,0,e.canvasWidth,e.canvasHeight)}n(t.contexts[e.NODE]),n(t.contexts[e.DRAG])};Dr.render=function(e){var t=this;e=e||yL();var n=t.cy,r=e.forcedContext,a=e.drawAllLayers,i=e.drawOnlyNodeLayer,l=e.forcedZoom,o=e.forcedPan,f=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=t.data,d=c.canvasNeedsRedraw,p=t.textureOnViewport&&!r&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),m=e.motionBlur!==void 0?e.motionBlur:t.motionBlur,y=t.motionBlurPxRatio,x=n.hasCompoundNodes(),b=t.hoverData.draggingEles,S=!!(t.hoverData.selecting||t.touchData.selecting);m=m&&!r&&t.motionBlurEnabled&&!S;var w=m;r||(t.prevPxRatio!==f&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint("eles",!0),t.redrawHint("drag",!0)),t.prevPxRatio=f),!r&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),m&&(t.mbFrames==null&&(t.mbFrames=0),t.mbFrames++,t.mbFrames<3&&(w=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!p&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var N=n.style(),C=n.zoom(),T=l!==void 0?l:C,R=n.pan(),A={x:R.x,y:R.y},D={zoom:C,pan:{x:R.x,y:R.y}},L=t.prevViewport,B=L===void 0||D.zoom!==L.zoom||D.pan.x!==L.pan.x||D.pan.y!==L.pan.y;!B&&!(b&&!x)&&(t.motionBlurPxRatio=1),o&&(A=o),T*=f,A.x*=f,A.y*=f;var M=t.getCachedZSortedEles();function _(ue,ee,ne,se,ge){var ke=ue.globalCompositeOperation;ue.globalCompositeOperation="destination-out",t.colorFillStyle(ue,255,255,255,t.motionBlurTransparency),ue.fillRect(ee,ne,se,ge),ue.globalCompositeOperation=ke}function P(ue,ee){var ne,se,ge,ke;!t.clearingMotionBlur&&(ue===c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||ue===c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(ne={x:R.x*y,y:R.y*y},se=C*y,ge=t.canvasWidth*y,ke=t.canvasHeight*y):(ne=A,se=T,ge=t.canvasWidth,ke=t.canvasHeight),ue.setTransform(1,0,0,1,0,0),ee==="motionBlur"?_(ue,0,0,ge,ke):!r&&(ee===void 0||ee)&&ue.clearRect(0,0,ge,ke),a||(ue.translate(ne.x,ne.y),ue.scale(se,se)),o&&ue.translate(o.x,o.y),l&&ue.scale(l,l)}if(p||(t.textureDrawLastFrame=!1),p){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var H=t.data.bufferContexts[t.TEXTURE_BUFFER];H.setTransform(1,0,0,1,0,0),H.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:H,drawOnlyNodeLayer:!0,forcedPxRatio:f*t.textureMult});var D=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};D.mpan={x:(0-D.pan.x)/D.zoom,y:(0-D.pan.y)/D.zoom}}d[t.DRAG]=!1,d[t.NODE]=!1;var $=c.contexts[t.NODE],V=t.textureCache.texture,D=t.textureCache.viewport;$.setTransform(1,0,0,1,0,0),m?_($,0,0,D.width,D.height):$.clearRect(0,0,D.width,D.height);var I=N.core("outside-texture-bg-color").value,U=N.core("outside-texture-bg-opacity").value;t.colorFillStyle($,I[0],I[1],I[2],U),$.fillRect(0,0,D.width,D.height);var C=n.zoom();P($,!1),$.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f),$.drawImage(V,D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f)}else t.textureOnViewport&&!r&&(t.textureCache=null);var Y=n.extent(),Q=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),F=t.hideEdgesOnViewport&&Q,q=[];if(q[t.NODE]=!d[t.NODE]&&m&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,q[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),q[t.DRAG]=!d[t.DRAG]&&m&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,q[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||a||i||q[t.NODE]){var X=m&&!q[t.NODE]&&y!==1,$=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),z=m&&!X?"motionBlur":void 0;P($,z),F?t.drawCachedNodes($,M.nondrag,f,Y):t.drawLayeredElements($,M.nondrag,f,Y),t.debug&&t.drawDebugPoints($,M.nondrag),!a&&!m&&(d[t.NODE]=!1)}if(!i&&(d[t.DRAG]||a||q[t.DRAG])){var X=m&&!q[t.DRAG]&&y!==1,$=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]);P($,m&&!X?"motionBlur":void 0),F?t.drawCachedNodes($,M.drag,f,Y):t.drawCachedElements($,M.drag,f,Y),t.debug&&t.drawDebugPoints($,M.drag),!a&&!m&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,P),m&&y!==1){var W=c.contexts[t.NODE],re=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],ae=c.contexts[t.DRAG],ie=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],ye=function(ee,ne,se){ee.setTransform(1,0,0,1,0,0),se||!w?ee.clearRect(0,0,t.canvasWidth,t.canvasHeight):_(ee,0,0,t.canvasWidth,t.canvasHeight);var ge=y;ee.drawImage(ne,0,0,t.canvasWidth*ge,t.canvasHeight*ge,0,0,t.canvasWidth,t.canvasHeight)};(d[t.NODE]||q[t.NODE])&&(ye(W,re,q[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||q[t.DRAG])&&(ye(ae,ie,q[t.DRAG]),d[t.DRAG]=!1)}t.prevViewport=D,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),m&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!p,t.mbFrames=0,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},oee)),r||n.emit("render")};var Rf;Dr.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,a=n.data,i=r.style(),l=e.drawOnlyNodeLayer,o=e.drawAllLayers,f=a.canvasNeedsRedraw,c=e.forcedContext;if(n.showFps||!l&&f[n.SELECT_BOX]&&!o){var d=c||a.contexts[n.SELECT_BOX];if(t(d),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var p=n.cy.zoom(),m=i.core("selection-box-border-width").value/p;d.lineWidth=m,d.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",d.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),m>0&&(d.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",d.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(a.bgActivePosistion&&!n.hoverData.selecting){var p=n.cy.zoom(),y=a.bgActivePosistion;d.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",d.beginPath(),d.arc(y.x,y.y,i.core("active-bg-size").pfValue/p,0,2*Math.PI),d.fill()}var x=n.lastRedrawTime;if(n.showFps&&x){x=Math.round(x);var b=Math.round(1e3/x),S="1 frame = "+x+" ms = "+b+" fps";if(d.setTransform(1,0,0,1,0,0),d.fillStyle="rgba(255, 0, 0, 0.75)",d.strokeStyle="rgba(255, 0, 0, 0.75)",d.font="30px Arial",!Rf){var w=d.measureText(S);Rf=w.actualBoundingBoxAscent}d.fillText(S,0,Rf);var N=60;d.strokeRect(0,Rf+10,250,20),d.fillRect(0,Rf+10,250*Math.min(b/N,1),20)}o||(f[n.SELECT_BOX]=!1)}};function iA(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(r));return r}function uee(e,t,n){var r=iA(e,e.VERTEX_SHADER,t),a=iA(e,e.FRAGMENT_SHADER,n),i=e.createProgram();if(e.attachShader(i,r),e.attachShader(i,a),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function cee(e,t,n){n===void 0&&(n=t);var r=e.makeOffscreenCanvas(t,n),a=r.context=r.getContext("2d");return r.clear=function(){return a.clearRect(0,0,r.width,r.height)},r.clear(),r}function Xw(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function fee(e){var t=e.pixelRatio,n=e.cy.zoom();return n*t}function dee(e,t,n,r,a){var i=r*n+t.x,l=a*n+t.y;return l=Math.round(e.canvasHeight-l),[i,l]}function hee(e){return e.pstyle("background-fill").value!=="solid"||e.pstyle("background-image").strValue!=="none"?!1:e.pstyle("border-width").value===0||e.pstyle("border-opacity").value===0?!0:e.pstyle("border-style").value==="solid"}function vee(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Xl(e,t,n){var r=e[0]/255,a=e[1]/255,i=e[2]/255,l=t,o=n||new Array(4);return o[0]=r*l,o[1]=a*l,o[2]=i*l,o[3]=l,o}function Su(e,t){var n=t||new Array(4);return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function pee(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function mee(e,t){var n=e.createTexture();return n.buffer=function(r){e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},n.deleteTexture=function(){e.deleteTexture(n)},n}function D_(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function M_(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function gee(e,t,n,r,a,i){switch(t){case e.FLOAT:return new Float32Array(n.buffer,i*r,a);case e.INT:return new Int32Array(n.buffer,i*r,a)}}function yee(e,t,n,r){var a=D_(e,t),i=_n(a,2),l=i[0],o=i[1],f=M_(e,o,r),c=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW),o===e.FLOAT?e.vertexAttribPointer(n,l,o,!1,0,0):o===e.INT&&e.vertexAttribIPointer(n,l,o,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,null),c}function ti(e,t,n,r){var a=D_(e,n),i=_n(a,3),l=i[0],o=i[1],f=i[2],c=M_(e,o,t*l),d=l*f,p=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,p),e.bufferData(e.ARRAY_BUFFER,t*d,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,l,o,!1,d,0):o===e.INT&&e.vertexAttribIPointer(r,l,o,d,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var m=new Array(t),y=0;y<t;y++)m[y]=gee(e,o,c,d,l,y);return p.dataArray=c,p.stride=d,p.size=l,p.getView=function(x){return m[x]},p.setPoint=function(x,b,S){var w=m[x];w[0]=b,w[1]=S},p.bufferSubData=function(x){e.bindBuffer(e.ARRAY_BUFFER,p),x?e.bufferSubData(e.ARRAY_BUFFER,0,c,0,x*l):e.bufferSubData(e.ARRAY_BUFFER,0,c)},p}function xee(e,t,n){for(var r=9,a=new Float32Array(t*r),i=new Array(t),l=0;l<t;l++){var o=l*r*4;i[l]=new Float32Array(a.buffer,o,r)}var f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,a.byteLength,e.DYNAMIC_DRAW);for(var c=0;c<3;c++){var d=n+c;e.enableVertexAttribArray(d),e.vertexAttribPointer(d,3,e.FLOAT,!1,36,c*12),e.vertexAttribDivisor(d,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),f.getMatrixView=function(p){return i[p]},f.setData=function(p,m){i[m].set(p,0)},f.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferSubData(e.ARRAY_BUFFER,0,a)},f}function bee(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(r,a){e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r,a,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}var sA=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function P0(){var e=new sA(9);return sA!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function lA(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function wee(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],p=t[8],m=n[0],y=n[1],x=n[2],b=n[3],S=n[4],w=n[5],N=n[6],C=n[7],T=n[8];return e[0]=m*r+y*l+x*c,e[1]=m*a+y*o+x*d,e[2]=m*i+y*f+x*p,e[3]=b*r+S*l+w*c,e[4]=b*a+S*o+w*d,e[5]=b*i+S*f+w*p,e[6]=N*r+C*l+T*c,e[7]=N*a+C*o+T*d,e[8]=N*i+C*f+T*p,e}function Zv(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],p=t[8],m=n[0],y=n[1];return e[0]=r,e[1]=a,e[2]=i,e[3]=l,e[4]=o,e[5]=f,e[6]=m*r+y*l+c,e[7]=m*a+y*o+d,e[8]=m*i+y*f+p,e}function oA(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],p=t[8],m=Math.sin(n),y=Math.cos(n);return e[0]=y*r+m*l,e[1]=y*a+m*o,e[2]=y*i+m*f,e[3]=y*l-m*r,e[4]=y*o-m*a,e[5]=y*f-m*i,e[6]=c,e[7]=d,e[8]=p,e}function s1(e,t,n){var r=n[0],a=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function See(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}var Eee=(function(){function e(t,n,r,a){Cl(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(t,n,n),this.scratch=a(t,n,this.texHeight,"scratch")}return Nl(e,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(n){var r=n.w,a=n.h,i=this.texHeight,l=this.texSize,o=i/a,f=r*o,c=a*o;return f>l&&(o=l/r,f=r*o,c=a*o),{scale:o,texW:f,texH:c}}},{key:"draw",value:function(n,r,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var l=this.texSize,o=this.texRows,f=this.texHeight,c=this.getScale(r),d=c.scale,p=c.texW,m=c.texH,y=function(C,T){if(a&&T){var R=T.context,A=C.x,D=C.row,L=A,B=f*D;R.save(),R.translate(L,B),R.scale(d,d),a(R,r),R.restore()}},x=[null,null],b=function(){y(i.freePointer,i.canvas),x[0]={x:i.freePointer.x,y:i.freePointer.row*f,w:p,h:m},x[1]={x:i.freePointer.x+p,y:i.freePointer.row*f,w:0,h:m},i.freePointer.x+=p,i.freePointer.x==l&&(i.freePointer.x=0,i.freePointer.row++)},S=function(){var C=i.scratch,T=i.canvas;C.clear(),y({x:0,row:0},C);var R=l-i.freePointer.x,A=p-R,D=f;{var L=i.freePointer.x,B=i.freePointer.row*f,M=R;T.context.drawImage(C,0,0,M,D,L,B,M,D),x[0]={x:L,y:B,w:M,h:m}}{var _=R,P=(i.freePointer.row+1)*f,H=A;T&&T.context.drawImage(C,_,0,H,D,0,P,H,D),x[1]={x:0,y:P,w:H,h:m}}i.freePointer.x=A,i.freePointer.row++},w=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+p<=l)b();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===l?(w(),b()):this.enableWrapping?S():(w(),b())}return this.keyToLocation.set(n,x),this.needsBuffer=!0,x}},{key:"getOffsets",value:function(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(n){if(this.locked)return!1;var r=this.texSize,a=this.texRows,i=this.getScale(n),l=i.texW;return this.freePointer.x+l>r?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(n){this.texture||(this.texture=mee(n,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Cee=(function(){function e(t,n,r,a){Cl(this,e),this.r=t,this.texSize=n,this.texRows=r,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Nl(e,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new Eee(n,r,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas,l=Math.floor(r/a);this.scratch=i(n,r,l,"scratch")}return this.scratch}},{key:"draw",value:function(n,r,a){var i=this.styleKeyToAtlas.get(n);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(r))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(n,r,a),this.styleKeyToAtlas.set(n,i)),i}},{key:"getAtlas",value:function(n){return this.styleKeyToAtlas.get(n)}},{key:"hasAtlas",value:function(n){return this.styleKeyToAtlas.has(n)}},{key:"markKeyForGC",value:function(n){this.markedKeys.add(n)}},{key:"gc",value:function(){var n=this,r=this.markedKeys;if(r.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,l=null,o=Gr(this.atlases),f;try{var c=function(){var p=f.value,m=p.getKeys(),y=Nee(r,m);if(y.size===0)return a.push(p),m.forEach(function(R){return i.set(R,p)}),1;l||(l=n._createAtlas(),a.push(l));var x=Gr(m),b;try{for(x.s();!(b=x.n()).done;){var S=b.value;if(!y.has(S)){var w=p.getOffsets(S),N=_n(w,2),C=N[0],T=N[1];l.canFit({w:C.w+T.w,h:C.h})||(l.lock(),l=n._createAtlas(),a.push(l)),p.canvas&&(n._copyTextureToNewAtlas(S,p,l),i.set(S,l))}}}catch(R){x.e(R)}finally{x.f()}p.dispose()};for(o.s();!(f=o.n()).done;)c()}catch(d){o.e(d)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(n,r,a){var i=r.getOffsets(n),l=_n(i,2),o=l[0],f=l[1];if(f.w===0)a.draw(n,o,function(m){m.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),c.context.drawImage(r.canvas,f.x,f.y,f.w,f.h,o.w,0,f.w,f.h);var d=o.w+f.w,p=o.h;a.draw(n,{w:d,h:p},function(m){m.drawImage(c,0,0,d,p,0,0,d,p)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Nee(e,t){return e.intersection?e.intersection(t):new Set(vp(e).filter(function(n){return t.has(n)}))}var kee=(function(){function e(t,n){Cl(this,e),this.r=t,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Nl(e,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(n,r){var a=this.globalOptions,i=a.webglTexSize,l=a.createTextureCanvas,o=r.texRows,f=this._cacheScratchCanvas(l),c=new Cee(this.r,i,o,f);this.collections.set(n,c)}},{key:"addRenderType",value:function(n,r){var a=r.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),l=at({type:n,atlasCollection:i},r);this.renderTypes.set(n,l)}},{key:"getRenderTypeOpts",value:function(n){return this.renderTypes.get(n)}},{key:"getAtlasCollection",value:function(n){return this.collections.get(n)}},{key:"_cacheScratchCanvas",value:function(n){var r=-1,a=-1,i=null;return function(l,o,f,c){return c?((!i||o!=r||f!=a)&&(r=o,a=f,i=n(l,o,f)),i):n(l,o,f)}}},{key:"_key",value:function(n,r){return"".concat(n,"-").concat(r)}},{key:"invalidate",value:function(n){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,l=i===void 0?!1:i,o=a.filterEle,f=o===void 0?function(){return!0}:o,c=a.filterType,d=c===void 0?function(){return!0}:c,p=!1,m=!1,y=Gr(n),x;try{for(y.s();!(x=y.n()).done;){var b=x.value;if(f(b)){var S=Gr(this.renderTypes.values()),w;try{var N=function(){var T=w.value,R=T.type;if(d(R)){var A=r.collections.get(T.collection),D=T.getKey(b),L=Array.isArray(D)?D:[D];if(l)L.forEach(function(P){return A.markKeyForGC(P)}),m=!0;else{var B=T.getID?T.getID(b):b.id(),M=r._key(R,B),_=r.typeAndIdToKey.get(M);_!==void 0&&!vee(L,_)&&(p=!0,r.typeAndIdToKey.delete(M),_.forEach(function(P){return A.markKeyForGC(P)}))}}};for(S.s();!(w=S.n()).done;)N()}catch(C){S.e(C)}finally{S.f()}}}}catch(C){y.e(C)}finally{y.f()}return m&&(this.gc(),p=!1),p}},{key:"gc",value:function(){var n=Gr(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var a=r.value;a.gc()}}catch(i){n.e(i)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function(n,r,a,i){var l=this.renderTypes.get(r),o=this.collections.get(l.collection),f=!1,c=o.draw(i,a,function(m){l.drawClipped?(m.save(),m.beginPath(),m.rect(0,0,a.w,a.h),m.clip(),l.drawElement(m,n,a,!0,!0),m.restore()):l.drawElement(m,n,a,!0,!0),f=!0});if(f){var d=l.getID?l.getID(n):n.id(),p=this._key(r,d);this.typeAndIdToKey.has(p)?this.typeAndIdToKey.get(p).push(i):this.typeAndIdToKey.set(p,[i])}return c}},{key:"getAtlasInfo",value:function(n,r){var a=this,i=this.renderTypes.get(r),l=i.getKey(n),o=Array.isArray(l)?l:[l];return o.map(function(f){var c=i.getBoundingBox(n,f),d=a.getOrCreateAtlas(n,r,c,f),p=d.getOffsets(f),m=_n(p,2),y=m[0],x=m[1];return{atlas:d,tex:y,tex1:y,tex2:x,bb:c}})}},{key:"getDebugInfo",value:function(){var n=[],r=Gr(this.collections),a;try{for(r.s();!(a=r.n()).done;){var i=_n(a.value,2),l=i[0],o=i[1],f=o.getCounts(),c=f.keyCount,d=f.atlasCount;n.push({type:l,keyCount:c,atlasCount:d})}}catch(p){r.e(p)}finally{r.f()}return n}}])})(),Tee=(function(){function e(t){Cl(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return Nl(e,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(n,r){return r})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(n){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(n):!0}},{key:"getAtlasIndexForBatch",value:function(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(n),r=this.batchAtlases.length-1}return r}}])})(),jee=`
514
+ float circleSD(vec2 p, float r) {
515
+ return distance(vec2(0), p) - r; // signed distance
516
+ }
517
+ `,Aee=`
518
+ float rectangleSD(vec2 p, vec2 b) {
519
+ vec2 d = abs(p)-b;
520
+ return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
521
+ }
522
+ `,Ree=`
523
+ float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
524
+ cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
525
+ cr.x = (p.y > 0.0) ? cr.x : cr.y;
526
+ vec2 q = abs(p) - b + cr.x;
527
+ return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
528
+ }
529
+ `,Dee=`
530
+ float ellipseSD(vec2 p, vec2 ab) {
531
+ p = abs( p ); // symmetry
532
+
533
+ // find root with Newton solver
534
+ vec2 q = ab*(p-ab);
535
+ float w = (q.x<q.y)? 1.570796327 : 0.0;
536
+ for( int i=0; i<5; i++ ) {
537
+ vec2 cs = vec2(cos(w),sin(w));
538
+ vec2 u = ab*vec2( cs.x,cs.y);
539
+ vec2 v = ab*vec2(-cs.y,cs.x);
540
+ w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
541
+ }
542
+
543
+ // compute final point and distance
544
+ float d = length(p-ab*vec2(cos(w),sin(w)));
545
+
546
+ // return signed distance
547
+ return (dot(p/ab,p/ab)>1.0) ? d : -d;
548
+ }
549
+ `,Gf={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},kp={IGNORE:1,USE_BB:2},z0=0,uA=1,cA=2,I0=3,Eu=4,Rv=5,Df=6,Mf=7,Mee=(function(){function e(t,n,r){Cl(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=cee,this.atlasManager=new kee(t,r),this.batchManager=new Tee(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Gf.SCREEN),this.pickingProgram=this._createShaderProgram(Gf.PICKING),this.vao=this._createVAO()}return Nl(e,[{key:"addAtlasCollection",value:function(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.type,i=this.atlasManager;return a?i.invalidate(n,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(n)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(n){var r=this.gl,a=`#version 300 es
550
+ precision highp float;
551
+
552
+ uniform mat3 uPanZoomMatrix;
553
+ uniform int uAtlasSize;
554
+
555
+ // instanced
556
+ in vec2 aPosition; // a vertex from the unit square
557
+
558
+ in mat3 aTransform; // used to transform verticies, eg into a bounding box
559
+ in int aVertType; // the type of thing we are rendering
560
+
561
+ // the z-index that is output when using picking mode
562
+ in vec4 aIndex;
563
+
564
+ // For textures
565
+ in int aAtlasId; // which shader unit/atlas to use
566
+ in vec4 aTex; // x/y/w/h of texture in atlas
567
+
568
+ // for edges
569
+ in vec4 aPointAPointB;
570
+ in vec4 aPointCPointD;
571
+ in vec2 aLineWidth; // also used for node border width
572
+
573
+ // simple shapes
574
+ in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
575
+ in vec4 aColor; // also used for edges
576
+ in vec4 aBorderColor; // aLineWidth is used for border width
577
+
578
+ // output values passed to the fragment shader
579
+ out vec2 vTexCoord;
580
+ out vec4 vColor;
581
+ out vec2 vPosition;
582
+ // flat values are not interpolated
583
+ flat out int vAtlasId;
584
+ flat out int vVertType;
585
+ flat out vec2 vTopRight;
586
+ flat out vec2 vBotLeft;
587
+ flat out vec4 vCornerRadius;
588
+ flat out vec4 vBorderColor;
589
+ flat out vec2 vBorderWidth;
590
+ flat out vec4 vIndex;
591
+
592
+ void main(void) {
593
+ int vid = gl_VertexID;
594
+ vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
595
+
596
+ if(aVertType == `.concat(z0,`) {
597
+ float texX = aTex.x; // texture coordinates
598
+ float texY = aTex.y;
599
+ float texW = aTex.z;
600
+ float texH = aTex.w;
601
+
602
+ if(vid == 1 || vid == 2 || vid == 4) {
603
+ texX += texW;
604
+ }
605
+ if(vid == 2 || vid == 4 || vid == 5) {
606
+ texY += texH;
607
+ }
608
+
609
+ float d = float(uAtlasSize);
610
+ vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
611
+
612
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
613
+ }
614
+ else if(aVertType == `).concat(Eu," || aVertType == ").concat(Mf,`
615
+ || aVertType == `).concat(Rv," || aVertType == ").concat(Df,`) { // simple shapes
616
+
617
+ // the bounding box is needed by the fragment shader
618
+ vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
619
+ vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
620
+ vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
621
+
622
+ // calculations are done in the fragment shader, just pass these along
623
+ vColor = aColor;
624
+ vCornerRadius = aCornerRadius;
625
+ vBorderColor = aBorderColor;
626
+ vBorderWidth = aLineWidth;
627
+
628
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
629
+ }
630
+ else if(aVertType == `).concat(uA,`) {
631
+ vec2 source = aPointAPointB.xy;
632
+ vec2 target = aPointAPointB.zw;
633
+
634
+ // adjust the geometry so that the line is centered on the edge
635
+ position.y = position.y - 0.5;
636
+
637
+ // stretch the unit square into a long skinny rectangle
638
+ vec2 xBasis = target - source;
639
+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
640
+ vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
641
+
642
+ gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
643
+ vColor = aColor;
644
+ }
645
+ else if(aVertType == `).concat(cA,`) {
646
+ vec2 pointA = aPointAPointB.xy;
647
+ vec2 pointB = aPointAPointB.zw;
648
+ vec2 pointC = aPointCPointD.xy;
649
+ vec2 pointD = aPointCPointD.zw;
650
+
651
+ // adjust the geometry so that the line is centered on the edge
652
+ position.y = position.y - 0.5;
653
+
654
+ vec2 p0, p1, p2, pos;
655
+ if(position.x == 0.0) { // The left side of the unit square
656
+ p0 = pointA;
657
+ p1 = pointB;
658
+ p2 = pointC;
659
+ pos = position;
660
+ } else { // The right side of the unit square, use same approach but flip the geometry upside down
661
+ p0 = pointD;
662
+ p1 = pointC;
663
+ p2 = pointB;
664
+ pos = vec2(0.0, -position.y);
665
+ }
666
+
667
+ vec2 p01 = p1 - p0;
668
+ vec2 p12 = p2 - p1;
669
+ vec2 p21 = p1 - p2;
670
+
671
+ // Find the normal vector.
672
+ vec2 tangent = normalize(normalize(p12) + normalize(p01));
673
+ vec2 normal = vec2(-tangent.y, tangent.x);
674
+
675
+ // Find the vector perpendicular to p0 -> p1.
676
+ vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
677
+
678
+ // Determine the bend direction.
679
+ float sigma = sign(dot(p01 + p21, normal));
680
+ float width = aLineWidth[0];
681
+
682
+ if(sign(pos.y) == -sigma) {
683
+ // This is an intersecting vertex. Adjust the position so that there's no overlap.
684
+ vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
685
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
686
+ } else {
687
+ // This is a non-intersecting vertex. Treat it like a mitre join.
688
+ vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
689
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
690
+ }
691
+
692
+ vColor = aColor;
693
+ }
694
+ else if(aVertType == `).concat(I0,` && vid < 3) {
695
+ // massage the first triangle into an edge arrow
696
+ if(vid == 0)
697
+ position = vec2(-0.15, -0.3);
698
+ if(vid == 1)
699
+ position = vec2( 0.0, 0.0);
700
+ if(vid == 2)
701
+ position = vec2( 0.15, -0.3);
702
+
703
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
704
+ vColor = aColor;
705
+ }
706
+ else {
707
+ gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
708
+ }
709
+
710
+ vAtlasId = aAtlasId;
711
+ vVertType = aVertType;
712
+ vIndex = aIndex;
713
+ }
714
+ `),i=this.batchManager.getIndexArray(),l=`#version 300 es
715
+ precision highp float;
716
+
717
+ // declare texture unit for each texture atlas in the batch
718
+ `.concat(i.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
719
+ `),`
720
+
721
+ uniform vec4 uBGColor;
722
+ uniform float uZoom;
723
+
724
+ in vec2 vTexCoord;
725
+ in vec4 vColor;
726
+ in vec2 vPosition; // model coordinates
727
+
728
+ flat in int vAtlasId;
729
+ flat in vec4 vIndex;
730
+ flat in int vVertType;
731
+ flat in vec2 vTopRight;
732
+ flat in vec2 vBotLeft;
733
+ flat in vec4 vCornerRadius;
734
+ flat in vec4 vBorderColor;
735
+ flat in vec2 vBorderWidth;
736
+
737
+ out vec4 outColor;
738
+
739
+ `).concat(jee,`
740
+ `).concat(Aee,`
741
+ `).concat(Ree,`
742
+ `).concat(Dee,`
743
+
744
+ vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
745
+ return vec4(
746
+ top.rgb + (bot.rgb * (1.0 - top.a)),
747
+ top.a + (bot.a * (1.0 - top.a))
748
+ );
749
+ }
750
+
751
+ vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
752
+ // scale to the zoom level so that borders don't look blurry when zoomed in
753
+ // note 1.5 is an aribitrary value chosen because it looks good
754
+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
755
+ }
756
+
757
+ void main(void) {
758
+ if(vVertType == `).concat(z0,`) {
759
+ // look up the texel from the texture unit
760
+ `).concat(i.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
761
+ else `),`
762
+ }
763
+ else if(vVertType == `).concat(I0,`) {
764
+ // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
765
+ outColor = blend(vColor, uBGColor);
766
+ outColor.a = 1.0; // make opaque, masks out line under arrow
767
+ }
768
+ else if(vVertType == `).concat(Eu,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
769
+ outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
770
+ }
771
+ else if(vVertType == `).concat(Eu," || vVertType == ").concat(Mf,`
772
+ || vVertType == `).concat(Rv," || vVertType == ").concat(Df,`) { // use SDF
773
+
774
+ float outerBorder = vBorderWidth[0];
775
+ float innerBorder = vBorderWidth[1];
776
+ float borderPadding = outerBorder * 2.0;
777
+ float w = vTopRight.x - vBotLeft.x - borderPadding;
778
+ float h = vTopRight.y - vBotLeft.y - borderPadding;
779
+ vec2 b = vec2(w/2.0, h/2.0); // half width, half height
780
+ vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
781
+
782
+ float d; // signed distance
783
+ if(vVertType == `).concat(Eu,`) {
784
+ d = rectangleSD(p, b);
785
+ } else if(vVertType == `).concat(Mf,` && w == h) {
786
+ d = circleSD(p, b.x); // faster than ellipse
787
+ } else if(vVertType == `).concat(Mf,`) {
788
+ d = ellipseSD(p, b);
789
+ } else {
790
+ d = roundRectangleSD(p, b, vCornerRadius.wzyx);
791
+ }
792
+
793
+ // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
794
+ // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
795
+ if(d > 0.0) {
796
+ if(d > outerBorder) {
797
+ discard;
798
+ } else {
799
+ outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
800
+ }
801
+ } else {
802
+ if(d > innerBorder) {
803
+ vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
804
+ vec4 innerBorderColor = blend(vBorderColor, vColor);
805
+ outColor = distInterp(innerBorderColor, outerColor, d);
806
+ }
807
+ else {
808
+ vec4 outerColor;
809
+ if(innerBorder == 0.0 && outerBorder == 0.0) {
810
+ outerColor = vec4(0);
811
+ } else if(innerBorder == 0.0) {
812
+ outerColor = vBorderColor;
813
+ } else {
814
+ outerColor = blend(vBorderColor, vColor);
815
+ }
816
+ outColor = distInterp(vColor, outerColor, d - innerBorder);
817
+ }
818
+ }
819
+ }
820
+ else {
821
+ outColor = vColor;
822
+ }
823
+
824
+ `).concat(n.picking?`if(outColor.a == 0.0) discard;
825
+ else outColor = vIndex;`:"",`
826
+ }
827
+ `),o=uee(r,a,l);o.aPosition=r.getAttribLocation(o,"aPosition"),o.aIndex=r.getAttribLocation(o,"aIndex"),o.aVertType=r.getAttribLocation(o,"aVertType"),o.aTransform=r.getAttribLocation(o,"aTransform"),o.aAtlasId=r.getAttribLocation(o,"aAtlasId"),o.aTex=r.getAttribLocation(o,"aTex"),o.aPointAPointB=r.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=r.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=r.getAttribLocation(o,"aLineWidth"),o.aColor=r.getAttribLocation(o,"aColor"),o.aCornerRadius=r.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=r.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=r.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=r.getUniformLocation(o,"uAtlasSize"),o.uBGColor=r.getUniformLocation(o,"uBGColor"),o.uZoom=r.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var f=0;f<this.batchManager.getMaxAtlasesPerBatch();f++)o.uTextures.push(r.getUniformLocation(o,"uTexture".concat(f)));return o}},{key:"_createVAO",value:function(){var n=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=n.length/2;var r=this.maxInstances,a=this.gl,i=this.program,l=a.createVertexArray();return a.bindVertexArray(l),yee(a,"vec2",i.aPosition,n),this.transformBuffer=xee(a,r,i.aTransform),this.indexBuffer=ti(a,r,"vec4",i.aIndex),this.vertTypeBuffer=ti(a,r,"int",i.aVertType),this.atlasIdBuffer=ti(a,r,"int",i.aAtlasId),this.texBuffer=ti(a,r,"vec4",i.aTex),this.pointAPointBBuffer=ti(a,r,"vec4",i.aPointAPointB),this.pointCPointDBuffer=ti(a,r,"vec4",i.aPointCPointD),this.lineWidthBuffer=ti(a,r,"vec2",i.aLineWidth),this.colorBuffer=ti(a,r,"vec4",i.aColor),this.cornerRadiusBuffer=ti(a,r,"vec4",i.aCornerRadius),this.borderColorBuffer=ti(a,r,"vec4",i.aBorderColor),a.bindVertexArray(null),l}},{key:"buffers",get:function(){var n=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(r){return al(r,"Buffer")}).map(function(r){return n[r]})),this._buffers}},{key:"startFrame",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gf.SCREEN;this.panZoomMatrix=n,this.renderTarget=r,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(n,r){return n.visible()?r&&r.isVisible?r.isVisible(n):!0:!1}},{key:"drawTexture",value:function(n,r,a){var i=this.atlasManager,l=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(n,o)&&!(n.isEdge()&&!this._isValidEdge(n))){if(this.renderTarget.picking&&o.getTexPickingMode){var f=o.getTexPickingMode(n);if(f===kp.IGNORE)return;if(f==kp.USE_BB){this.drawPickingRectangle(n,r,a);return}}var c=i.getAtlasInfo(n,a),d=Gr(c),p;try{for(d.s();!(p=d.n()).done;){var m=p.value,y=m.atlas,x=m.tex1,b=m.tex2;l.canAddToCurrentBatch(y)||this.endBatch();for(var S=l.getAtlasIndexForBatch(y),w=0,N=[[x,!0],[b,!1]];w<N.length;w++){var C=_n(N[w],2),T=C[0],R=C[1];if(T.w!=0){var A=this.instanceCount;this.vertTypeBuffer.getView(A)[0]=z0;var D=this.indexBuffer.getView(A);Su(r,D);var L=this.atlasIdBuffer.getView(A);L[0]=S;var B=this.texBuffer.getView(A);B[0]=T.x,B[1]=T.y,B[2]=T.w,B[3]=T.h;var M=this.transformBuffer.getMatrixView(A);this.setTransformMatrix(n,M,o,m,R),this.instanceCount++,R||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(_){d.e(_)}finally{d.f()}}}},{key:"setTransformMatrix",value:function(n,r,a,i){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=n.pstyle(a.shapeProps.padding).pfValue),i){var f=i.bb,c=i.tex1,d=i.tex2,p=c.w/(c.w+d.w);l||(p=1-p);var m=this._getAdjustedBB(f,o,l,p);this._applyTransformMatrix(r,m,a,n)}else{var y=a.getBoundingBox(n),x=this._getAdjustedBB(y,o,!0,1);this._applyTransformMatrix(r,x,a,n)}}},{key:"_applyTransformMatrix",value:function(n,r,a,i){var l,o;lA(n);var f=a.getRotation?a.getRotation(i):0;if(f!==0){var c=a.getRotationPoint(i),d=c.x,p=c.y;Zv(n,n,[d,p]),oA(n,n,f);var m=a.getRotationOffset(i);l=m.x+(r.xOffset||0),o=m.y+(r.yOffset||0)}else l=r.x1,o=r.y1;Zv(n,n,[l,o]),s1(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function(n,r,a,i){var l=n.x1,o=n.y1,f=n.w,c=n.h,d=n.yOffset;r&&(l-=r,o-=r,f+=2*r,c+=2*r);var p=0,m=f*i;return a&&i<1?f=m:!a&&i<1&&(p=f-m,l+=p,f=m),{x1:l,y1:o,w:f,h:c,xOffset:p,yOffset:d}}},{key:"drawPickingRectangle",value:function(n,r,a){var i=this.atlasManager.getRenderTypeOpts(a),l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=Eu;var o=this.indexBuffer.getView(l);Su(r,o);var f=this.colorBuffer.getView(l);Xl([0,0,0],1,f);var c=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(n,c,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(n,r,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(n,i)){var l=i.shapeProps,o=this._getVertTypeForShape(n,l.shape);if(o===void 0||i.isSimple&&!i.isSimple(n)){this.drawTexture(n,r,a);return}var f=this.instanceCount;if(this.vertTypeBuffer.getView(f)[0]=o,o===Rv||o===Df){var c=i.getBoundingBox(n),d=this._getCornerRadius(n,l.radius,c),p=this.cornerRadiusBuffer.getView(f);p[0]=d,p[1]=d,p[2]=d,p[3]=d,o===Df&&(p[0]=0,p[2]=0)}var m=this.indexBuffer.getView(f);Su(r,m);var y=n.pstyle(l.color).value,x=n.pstyle(l.opacity).value,b=this.colorBuffer.getView(f);Xl(y,x,b);var S=this.lineWidthBuffer.getView(f);if(S[0]=0,S[1]=0,l.border){var w=n.pstyle("border-width").value;if(w>0){var N=n.pstyle("border-color").value,C=n.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(f);Xl(N,C,T);var R=n.pstyle("border-position").value;if(R==="inside")S[0]=0,S[1]=-w;else if(R==="outside")S[0]=w,S[1]=0;else{var A=w/2;S[0]=A,S[1]=-A}}}var D=this.transformBuffer.getMatrixView(f);this.setTransformMatrix(n,D,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(n,r){var a=n.pstyle(r).value;switch(a){case"rectangle":return Eu;case"ellipse":return Mf;case"roundrectangle":case"round-rectangle":return Rv;case"bottom-round-rectangle":return Df;default:return}}},{key:"_getCornerRadius",value:function(n,r,a){var i=a.w,l=a.h;if(n.pstyle(r).value==="auto")return gl(i,l);var o=n.pstyle(r).pfValue,f=i/2,c=l/2;return Math.min(o,c,f)}},{key:"drawEdgeArrow",value:function(n,r,a){if(n.visible()){var i=n._private.rscratch,l,o,f;if(a==="source"?(l=i.arrowStartX,o=i.arrowStartY,f=i.srcArrowAngle):(l=i.arrowEndX,o=i.arrowEndY,f=i.tgtArrowAngle),!(isNaN(l)||l==null||isNaN(o)||o==null||isNaN(f)||f==null)){var c=n.pstyle(a+"-arrow-shape").value;if(c!=="none"){var d=n.pstyle(a+"-arrow-color").value,p=n.pstyle("opacity").value,m=n.pstyle("line-opacity").value,y=p*m,x=n.pstyle("width").pfValue,b=n.pstyle("arrow-scale").value,S=this.r.getArrowWidth(x,b),w=this.instanceCount,N=this.transformBuffer.getMatrixView(w);lA(N),Zv(N,N,[l,o]),s1(N,N,[S,S]),oA(N,N,f),this.vertTypeBuffer.getView(w)[0]=I0;var C=this.indexBuffer.getView(w);Su(r,C);var T=this.colorBuffer.getView(w);Xl(d,y,T),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(n,r){if(n.visible()){var a=this._getEdgePoints(n);if(a){var i=n.pstyle("opacity").value,l=n.pstyle("line-opacity").value,o=n.pstyle("width").pfValue,f=n.pstyle("line-color").value,c=i*l;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=uA;var p=this.indexBuffer.getView(d);Su(r,p);var m=this.colorBuffer.getView(d);Xl(f,c,m);var y=this.lineWidthBuffer.getView(d);y[0]=o;var x=this.pointAPointBBuffer.getView(d);x[0]=a[0],x[1]=a[1],x[2]=a[2],x[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var b=0;b<a.length-2;b+=2){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=cA;var w=this.indexBuffer.getView(S);Su(r,w);var N=this.colorBuffer.getView(S);Xl(f,c,N);var C=this.lineWidthBuffer.getView(S);C[0]=o;var T=a[b-2],R=a[b-1],A=a[b],D=a[b+1],L=a[b+2],B=a[b+3],M=a[b+4],_=a[b+5];b==0&&(T=2*A-L+.001,R=2*D-B+.001),b==a.length-4&&(M=2*L-A+.001,_=2*B-D+.001);var P=this.pointAPointBBuffer.getView(S);P[0]=T,P[1]=R,P[2]=A,P[3]=D;var H=this.pointCPointDBuffer.getView(S);H[0]=L,H[1]=B,H[2]=M,H[3]=_,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(n){var r=n._private.rscratch;return!(r.badLine||r.allpts==null||isNaN(r.allpts[0]))}},{key:"_getEdgePoints",value:function(n){var r=n._private.rscratch;if(this._isValidEdge(n)){var a=r.allpts;if(a.length==4)return a;var i=this._getNumSegments(n);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(n,r){if(n.length==4)return n;for(var a=Array((r+1)*2),i=0;i<=r;i++)if(i==0)a[0]=n[0],a[1]=n[1];else if(i==r)a[i*2]=n[n.length-2],a[i*2+1]=n[n.length-1];else{var l=i/r;this._setCurvePoint(n,l,a,i*2)}return a}},{key:"_setCurvePoint",value:function(n,r,a,i){if(n.length<=2)a[i]=n[0],a[i+1]=n[1];else{for(var l=Array(n.length-2),o=0;o<l.length;o+=2){var f=(1-r)*n[o]+r*n[o+2],c=(1-r)*n[o+1]+r*n[o+3];l[o]=f,l[o+1]=c}return this._setCurvePoint(l,r,a,i)}}},{key:"endBatch",value:function(){var n=this.gl,r=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var l=this.renderTarget.picking?this.pickingProgram:this.program;n.useProgram(l),n.bindVertexArray(r);var o=Gr(this.buffers),f;try{for(o.s();!(f=o.n()).done;){var c=f.value;c.bufferSubData(i)}}catch(x){o.e(x)}finally{o.f()}for(var d=this.batchManager.getAtlases(),p=0;p<d.length;p++)d[p].bufferIfNeeded(n);for(var m=0;m<d.length;m++)n.activeTexture(n.TEXTURE0+m),n.bindTexture(n.TEXTURE_2D,d[m].texture),n.uniform1i(l.uTextures[m],m);n.uniform1f(l.uZoom,fee(this.r)),n.uniformMatrix3fv(l.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(l.uAtlasSize,this.batchManager.getAtlasSize());var y=Xl(this.bgColor,1);n.uniform4fv(l.uBGColor,y),n.drawArraysInstanced(n.TRIANGLES,0,a,i),n.bindVertexArray(null),n.bindTexture(n.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:d.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var n=this.atlasManager.getDebugInfo(),r=n.reduce(function(l,o){return l+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(l,o){return l+o.count},0);return{atlasInfo:n,totalAtlases:r,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),O_={};O_.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=Oee(n),e.webglTexSize=Math.min(e.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=e.webglDebug,n.webglDebugShowAtlases=e.webglDebugShowAtlases,n.pickingFrameBuffer=bee(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new Mee(n,r,e);var a=function(p){return function(m){return n.getTextAngle(m,p)}},i=function(p){return function(m){var y=m.pstyle(p);return y&&y.value}},l=function(p){return function(m){return m.pstyle("".concat(p,"-opacity")).value>0}},o=function(p){var m=p.pstyle("text-events").strValue==="yes";return m?kp.USE_BB:kp.IGNORE},f=function(p){var m=p.position(),y=m.x,x=m.y,b=p.outerWidth(),S=p.outerHeight();return{w:b,h:S,x1:y-b/2,y1:x-S/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:f,isSimple:hee,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:f,isVisible:l("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:f,isVisible:l("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:F0(t.getLabelKey,null),getBoundingBox:q0(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:a(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:i("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:F0(t.getSourceLabelKey,"source"),getBoundingBox:q0(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:a("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:i("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:F0(t.getTargetLabelKey,"target"),getBoundingBox:q0(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:a("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:i("target-label")});var c=zd(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(d,p){var m=!1;p&&p.length>0&&(m|=n.drawing.invalidate(p)),m&&c()}),Lee(n)};function Oee(e){var t=e.cy.container(),n=t&&t.style&&t.style.backgroundColor||"white";return lL(n)}function L_(e,t){var n=e._private.rscratch;return Vr(n,"labelWrapCachedLines",t)||[]}var F0=function(t,n){return function(r){var a=t(r),i=L_(r,n);return i.length>1?i.map(function(l,o){return"".concat(a,"_").concat(o)}):a}},q0=function(t,n){return function(r,a){var i=t(r);if(typeof a=="string"){var l=a.indexOf("_");if(l>0){var o=Number(a.substring(l+1)),f=L_(r,n),c=i.h/f.length,d=c*o,p=i.y1+d;return{x1:i.x1,w:i.w,y1:p,h:c,yOffset:d}}}return i}};function Lee(e){{var t=e.render;e.render=function(i){i=i||{};var l=e.cy;e.webgl&&(l.zoom()>k_?(_ee(e),t.call(e,i)):(Bee(e),B_(e,i,Gf.SCREEN)))}}{var n=e.matchCanvasSize;e.matchCanvasSize=function(i){n.call(e,i),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0}}e.findNearestElements=function(i,l,o,f){return Uee(e,i,l)};{var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0}}{var a=e.notify;e.notify=function(i,l){a.call(e,i,l),i==="viewport"||i==="bounds"?e.pickingFrameBuffer.needsDraw=!0:i==="background"&&e.drawing.invalidate(l,{type:"node-body"})}}}function _ee(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function Bee(e){var t=function(r){r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.canvasWidth,e.canvasHeight),r.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function Pee(e){var t=e.canvasWidth,n=e.canvasHeight,r=Xw(e),a=r.pan,i=r.zoom,l=P0();Zv(l,l,[a.x,a.y]),s1(l,l,[i,i]);var o=P0();See(o,t,n);var f=P0();return wee(f,o,l),f}function __(e,t){var n=e.canvasWidth,r=e.canvasHeight,a=Xw(e),i=a.pan,l=a.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(i.x,i.y),t.scale(l,l)}function zee(e,t){e.drawSelectionRectangle(t,function(n){return __(e,n)})}function Iee(e){var t=e.data.contexts[e.NODE];t.save(),__(e,t),t.strokeStyle="rgba(0, 0, 0, 0.3)",t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function Fee(e){var t=function(a,i,l){for(var o=a.atlasManager.getAtlasCollection(i),f=e.data.contexts[e.NODE],c=o.atlases,d=0;d<c.length;d++){var p=c[d],m=p.canvas;if(m){var y=m.width,x=m.height,b=y*d,S=m.height*l,w=.4;f.save(),f.scale(w,w),f.drawImage(m,b,S),f.strokeStyle="black",f.rect(b,S,y,x),f.stroke(),f.restore()}}},n=0;t(e.drawing,"node",n++),t(e.drawing,"label",n++)}function qee(e,t,n,r,a){var i,l,o,f,c=Xw(e),d=c.pan,p=c.zoom;{var m=dee(e,d,p,t,n),y=_n(m,2),x=y[0],b=y[1],S=6;i=x-S/2,l=b-S/2,o=S,f=S}if(o===0||f===0)return[];var w=e.data.contexts[e.WEBGL];w.bindFramebuffer(w.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(w.viewport(0,0,w.canvas.width,w.canvas.height),B_(e,null,Gf.PICKING),e.pickingFrameBuffer.needsDraw=!1);var N=o*f,C=new Uint8Array(N*4);w.readPixels(i,l,o,f,w.RGBA,w.UNSIGNED_BYTE,C),w.bindFramebuffer(w.FRAMEBUFFER,null);for(var T=new Set,R=0;R<N;R++){var A=C.slice(R*4,R*4+4),D=pee(A)-1;D>=0&&T.add(D)}return T}function Uee(e,t,n){var r=qee(e,t,n),a=e.getCachedZSortedEles(),i,l,o=Gr(r),f;try{for(o.s();!(f=o.n()).done;){var c=f.value,d=a[c];if(!i&&d.isNode()&&(i=d),!l&&d.isEdge()&&(l=d),i&&l)break}}catch(p){o.e(p)}finally{o.f()}return[i,l].filter(Boolean)}function U0(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function B_(e,t,n){var r;e.webglDebug&&(r=performance.now());var a=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&zee(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var l=e.data.contexts[e.WEBGL];n.screen?(l.clearColor(0,0,0,0),l.enable(l.BLEND),l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA)):l.disable(l.BLEND),l.clear(l.COLOR_BUFFER_BIT|l.DEPTH_BUFFER_BIT),l.viewport(0,0,l.canvas.width,l.canvas.height);var o=Pee(e),f=e.getCachedZSortedEles();if(i=f.length,a.startFrame(o,n),n.screen){for(var c=0;c<f.nondrag.length;c++)U0(e,c,f.nondrag[c]);for(var d=0;d<f.drag.length;d++)U0(e,d,f.drag[d])}else if(n.picking)for(var p=0;p<f.length;p++)U0(e,p,f[p]);a.endFrame(),n.screen&&e.webglDebugShowAtlases&&(Iee(e),Fee(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var m=performance.now(),y=!1,x=Math.ceil(m-r),b=a.getDebugInfo(),S=["".concat(i," elements"),"".concat(b.totalInstances," instances"),"".concat(b.batchCount," batches"),"".concat(b.totalAtlases," atlases"),"".concat(b.wrappedCount," wrapped textures"),"".concat(b.simpleCount," simple shapes")].join(", ");if(y)console.log("WebGL (".concat(n.name,") - time ").concat(x,"ms, ").concat(S));else{console.log("WebGL (".concat(n.name,") - frame time ").concat(x,"ms")),console.log("Totals:"),console.log(" ".concat(S)),console.log("Texture Atlases Used:");var w=b.atlasInfo,N=Gr(w),C;try{for(N.s();!(C=N.n()).done;){var T=C.value;console.log(" ".concat(T.type,": ").concat(T.keyCount," keys, ").concat(T.atlasCount," atlases"))}}catch(R){N.e(R)}finally{N.f()}console.log("")}}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,a.gc())}var jl={};jl.drawPolygonPath=function(e,t,n,r,a,i){var l=r/2,o=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+l*i[0],n+o*i[1]);for(var f=1;f<i.length/2;f++)e.lineTo(t+l*i[f*2],n+o*i[f*2+1]);e.closePath()};jl.drawRoundPolygonPath=function(e,t,n,r,a,i,l){l.forEach(function(o){return g_(e,o)}),e.closePath()};jl.drawRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?gl(r,a):Math.min(i,o,l);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+l,n-o,t+l,n,f),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.arcTo(t-l,n-o,t,n-o,f),e.lineTo(t,n-o),e.closePath()};jl.drawBottomRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?gl(r,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+l,n-o),e.lineTo(t+l,n),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.lineTo(t-l,n-o),e.lineTo(t,n-o),e.closePath()};jl.drawCutRectanglePath=function(e,t,n,r,a,i,l){var o=r/2,f=a/2,c=l==="auto"?_w():l;e.beginPath&&e.beginPath(),e.moveTo(t-o+c,n-f),e.lineTo(t+o-c,n-f),e.lineTo(t+o,n-f+c),e.lineTo(t+o,n+f-c),e.lineTo(t+o-c,n+f),e.lineTo(t-o+c,n+f),e.lineTo(t-o,n+f-c),e.lineTo(t-o,n-f+c),e.closePath()};jl.drawBarrelPath=function(e,t,n,r,a){var i=r/2,l=a/2,o=t-i,f=t+i,c=n-l,d=n+l,p=Gb(r,a),m=p.widthOffset,y=p.heightOffset,x=p.ctrlPtOffsetPct*m;e.beginPath&&e.beginPath(),e.moveTo(o,c+y),e.lineTo(o,d-y),e.quadraticCurveTo(o+x,d,o+m,d),e.lineTo(f-m,d),e.quadraticCurveTo(f-x,d,f,d-y),e.lineTo(f,c+y),e.quadraticCurveTo(f-x,c,f-m,c),e.lineTo(o+m,c),e.quadraticCurveTo(o+x,c,o,c+y),e.closePath()};var fA=Math.sin(0),dA=Math.cos(0),l1={},o1={},P_=Math.PI/40;for(var Cu=0*Math.PI;Cu<2*Math.PI;Cu+=P_)l1[Cu]=Math.sin(Cu),o1[Cu]=Math.cos(Cu);jl.drawEllipsePath=function(e,t,n,r,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,a/2,0,0,2*Math.PI);else for(var i,l,o=r/2,f=a/2,c=0*Math.PI;c<2*Math.PI;c+=P_)i=t-o*l1[c]*fA+o*o1[c]*dA,l=n+f*o1[c]*fA+f*l1[c]*dA,c===0?e.moveTo(i,l):e.lineTo(i,l);e.closePath()};var Hd={};Hd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]};Hd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):a[2],l=e.full?Math.ceil(r.h):a[3],o=Ae(e.maxWidth)||Ae(e.maxHeight),f=this.getPixelRatio(),c=1;if(e.scale!==void 0)i*=e.scale,l*=e.scale,c=e.scale;else if(o){var d=1/0,p=1/0;Ae(e.maxWidth)&&(d=c*e.maxWidth/i),Ae(e.maxHeight)&&(p=c*e.maxHeight/l),c=Math.min(d,p),i*=c,l*=c}o||(i*=f,l*=f,c*=f);var m=document.createElement("canvas");m.width=i,m.height=l,m.style.width=i+"px",m.style.height=l+"px";var y=m.getContext("2d");if(i>0&&l>0){y.clearRect(0,0,i,l),y.globalCompositeOperation="source-over";var x=this.getCachedZSortedEles();if(e.full)y.translate(-r.x1*c,-r.y1*c),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(r.x1*c,r.y1*c);else{var b=t.pan(),S={x:b.x*c,y:b.y*c};c*=t.zoom(),y.translate(S.x,S.y),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(-S.x,-S.y)}e.bg&&(y.globalCompositeOperation="destination-over",y.fillStyle=e.bg,y.rect(0,0,i,l),y.fill())}return m};function Vee(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function hA(e){var t=e.indexOf(",");return e.substr(t+1)}function z_(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new bc(function(a,i){try{t.toBlob(function(l){l!=null?a(l):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(l){i(l)}});case"blob":return Vee(hA(r()),n);case"base64":return hA(r());case"base64uri":default:return r()}}Hd.png=function(e){return z_(e,this.bufferCanvasImage(e),"image/png")};Hd.jpg=function(e){return z_(e,this.bufferCanvasImage(e),"image/jpeg")};var I_={};I_.nodeShapeImpl=function(e,t,n,r,a,i,l,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,a,i);case"polygon":return this.drawPolygonPath(t,n,r,a,i,l);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,a,i,l,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,a,i,l,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,a,i,o);case"barrel":return this.drawBarrelPath(t,n,r,a,i)}};var Hee=F_,bt=F_.prototype;bt.CANVAS_LAYERS=3;bt.SELECT_BOX=0;bt.DRAG=1;bt.NODE=2;bt.WEBGL=3;bt.CANVAS_TYPES=["2d","2d","2d","webgl2"];bt.BUFFER_COUNT=3;bt.TEXTURE_BUFFER=0;bt.MOTIONBLUR_BUFFER_NODE=1;bt.MOTIONBLUR_BUFFER_DRAG=2;function F_(e){var t=this,n=t.cy.window(),r=n.document;e.webgl&&(bt.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(bt.CANVAS_LAYERS),contexts:new Array(bt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(bt.CANVAS_LAYERS),bufferCanvases:new Array(bt.BUFFER_COUNT),bufferContexts:new Array(bt.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var l=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,l.position="relative",l.zIndex="0",l.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[a]=i;var f={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};zY()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<bt.CANVAS_LAYERS;c++){var d=t.data.canvases[c]=r.createElement("canvas"),p=bt.CANVAS_TYPES[c];t.data.contexts[c]=d.getContext(p),t.data.contexts[c]||fn("Could not create canvas of type "+p),Object.keys(f).forEach(function(ue){d.style[ue]=f[ue]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(bt.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[bt.NODE].setAttribute("data-id","layer"+bt.NODE+"-node"),t.data.canvases[bt.SELECT_BOX].setAttribute("data-id","layer"+bt.SELECT_BOX+"-selectbox"),t.data.canvases[bt.DRAG].setAttribute("data-id","layer"+bt.DRAG+"-drag"),t.data.canvases[bt.WEBGL]&&t.data.canvases[bt.WEBGL].setAttribute("data-id","layer"+bt.WEBGL+"-webgl");for(var c=0;c<bt.BUFFER_COUNT;c++)t.data.bufferCanvases[c]=r.createElement("canvas"),t.data.bufferContexts[c]=t.data.bufferCanvases[c].getContext("2d"),t.data.bufferCanvases[c].style.position="absolute",t.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),t.data.bufferCanvases[c].style.zIndex=String(-c-1),t.data.bufferCanvases[c].style.visibility="hidden";t.pathsEnabled=!0;var m=jr(),y=function(ee){return{x:(ee.x1+ee.x2)/2,y:(ee.y1+ee.y2)/2}},x=function(ee){return{x:-ee.w/2,y:-ee.h/2}},b=function(ee){var ne=ee[0]._private,se=ne.oldBackgroundTimestamp===ne.backgroundTimestamp;return!se},S=function(ee){return ee[0]._private.nodeKey},w=function(ee){return ee[0]._private.labelStyleKey},N=function(ee){return ee[0]._private.sourceLabelStyleKey},C=function(ee){return ee[0]._private.targetLabelStyleKey},T=function(ee,ne,se,ge,ke){return t.drawElement(ee,ne,se,!1,!1,ke)},R=function(ee,ne,se,ge,ke){return t.drawElementText(ee,ne,se,ge,"main",ke)},A=function(ee,ne,se,ge,ke){return t.drawElementText(ee,ne,se,ge,"source",ke)},D=function(ee,ne,se,ge,ke){return t.drawElementText(ee,ne,se,ge,"target",ke)},L=function(ee){return ee.boundingBox(),ee[0]._private.bodyBounds},B=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.main||m},M=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.source||m},_=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.target||m},P=function(ee,ne){return ne},H=function(ee){return y(L(ee))},$=function(ee,ne,se){var ge=ee?ee+"-":"";return{x:ne.x+se.pstyle(ge+"text-margin-x").pfValue,y:ne.y+se.pstyle(ge+"text-margin-y").pfValue}},V=function(ee,ne,se){var ge=ee[0]._private.rscratch;return{x:ge[ne],y:ge[se]}},I=function(ee){return $("",V(ee,"labelX","labelY"),ee)},U=function(ee){return $("source",V(ee,"sourceLabelX","sourceLabelY"),ee)},Y=function(ee){return $("target",V(ee,"targetLabelX","targetLabelY"),ee)},Q=function(ee){return x(L(ee))},F=function(ee){return x(M(ee))},q=function(ee){return x(_(ee))},X=function(ee){var ne=B(ee),se=x(B(ee));if(ee.isNode()){switch(ee.pstyle("text-halign").value){case"left":se.x=-ne.w-(ne.leftPad||0);break;case"right":se.x=-(ne.rightPad||0);break}switch(ee.pstyle("text-valign").value){case"top":se.y=-ne.h-(ne.topPad||0);break;case"bottom":se.y=-(ne.botPad||0);break}}return se},z=t.data.eleTxrCache=new If(t,{getKey:S,doesEleInvalidateKey:b,drawElement:T,getBoundingBox:L,getRotationPoint:H,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=t.data.lblTxrCache=new If(t,{getKey:w,drawElement:R,getBoundingBox:B,getRotationPoint:I,getRotationOffset:X,isVisible:P}),re=t.data.slbTxrCache=new If(t,{getKey:N,drawElement:A,getBoundingBox:M,getRotationPoint:U,getRotationOffset:F,isVisible:P}),ae=t.data.tlbTxrCache=new If(t,{getKey:C,drawElement:D,getBoundingBox:_,getRotationPoint:Y,getRotationOffset:q,isVisible:P}),ie=t.data.lyrTxrCache=new T_(t);t.onUpdateEleCalcs(function(ee,ne){z.invalidateElements(ne),W.invalidateElements(ne),re.invalidateElements(ne),ae.invalidateElements(ne),ie.invalidateElements(ne);for(var se=0;se<ne.length;se++){var ge=ne[se]._private;ge.oldBackgroundTimestamp=ge.backgroundTimestamp}});var ye=function(ee){for(var ne=0;ne<ee.length;ne++)ie.enqueueElementRefinement(ee[ne].ele)};z.onDequeue(ye),W.onDequeue(ye),re.onDequeue(ye),ae.onDequeue(ye),e.webgl&&t.initWebgl(e,{getStyleKey:S,getLabelKey:w,getSourceLabelKey:N,getTargetLabelKey:C,drawElement:T,drawLabel:R,drawSourceLabel:A,drawTargetLabel:D,getElementBox:L,getLabelBox:B,getSourceLabelBox:M,getTargetLabelBox:_,getElementRotationPoint:H,getElementRotationOffset:Q,getLabelRotationPoint:I,getSourceLabelRotationPoint:U,getTargetLabelRotationPoint:Y,getLabelRotationOffset:X,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:q})}bt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[bt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[bt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[bt.SELECT_BOX]=t;break;case"gc":n.data.gc=!0;break}};var $ee=typeof Path2D<"u";bt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e};bt.usePaths=function(){return $ee&&this.pathsEnabled};bt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)};bt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled};bt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":Un(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n};[j_,Ei,fs,Yw,Ao,Tl,Dr,O_,jl,Hd,I_].forEach(function(e){at(bt,e)});var Gee=[{name:"null",impl:v_},{name:"base",impl:C_},{name:"canvas",impl:Hee}],Kee=[{type:"layout",extensions:yJ},{type:"renderer",extensions:Gee}],q_={},U_={};function V_(e,t,n){var r=n,a=function(L){zt("Can not register `"+t+"` for `"+e+"` since `"+L+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(od.prototype[t])return a(t);od.prototype[t]=n}else if(e==="collection"){if(ur.prototype[t])return a(t);ur.prototype[t]=n}else if(e==="layout"){for(var i=function(L){this.options=L,n.call(this,L),Dt(this._private)||(this._private={}),this._private.cy=L.cy,this._private.listeners=[],this.createEmitter()},l=i.prototype=Object.create(n.prototype),o=[],f=0;f<o.length;f++){var c=o[f];l[c]=l[c]||function(){return this}}l.start&&!l.run?l.run=function(){return this.start(),this}:!l.start&&l.run&&(l.start=function(){return this.run(),this});var d=n.prototype.stop;l.stop=function(){var D=this.options;if(D&&D.animate){var L=this.animations;if(L)for(var B=0;B<L.length;B++)L[B].stop()}return d?d.call(this):this.emit("layoutstop"),this},l.destroy||(l.destroy=function(){return this}),l.cy=function(){return this._private.cy};var p=function(L){return L._private.cy},m={addEventFields:function(L,B){B.layout=L,B.cy=p(L),B.target=L},bubble:function(){return!0},parent:function(L){return p(L)}};at(l,{createEmitter:function(){return this._private.emitter=new cm(m,this),this},emitter:function(){return this._private.emitter},on:function(L,B){return this.emitter().on(L,B),this},one:function(L,B){return this.emitter().one(L,B),this},once:function(L,B){return this.emitter().one(L,B),this},removeListener:function(L,B){return this.emitter().removeListener(L,B),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(L,B){return this.emitter().emit(L,B),this}}),Pt.eventAliasesOn(l),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var y=H_("renderer","base"),x=y.prototype,b=n,S=n.prototype,w=function(){y.apply(this,arguments),b.apply(this,arguments)},N=w.prototype;for(var C in x){var T=x[C],R=S[C]!=null;if(R)return a(C);N[C]=T}for(var A in S)N[A]=S[A];x.clientFunctions.forEach(function(D){N[D]=N[D]||function(){fn("Renderer does not implement `renderer."+D+"()` on its prototype")}}),r=w}else if(e==="__proto__"||e==="constructor"||e==="prototype")return fn(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return oL({map:q_,keys:[e,t],value:r})}function H_(e,t){return uL({map:q_,keys:[e,t]})}function Yee(e,t,n,r,a){return oL({map:U_,keys:[e,t,n,r],value:a})}function Xee(e,t,n,r){return uL({map:U_,keys:[e,t,n,r]})}var u1=function(){if(arguments.length===2)return H_.apply(null,arguments);if(arguments.length===3)return V_.apply(null,arguments);if(arguments.length===4)return Xee.apply(null,arguments);if(arguments.length===5)return Yee.apply(null,arguments);fn("Invalid extension access syntax")};od.prototype.extension=u1;Kee.forEach(function(e){e.extensions.forEach(function(t){V_(e.type,t.name,t.impl)})});var Tp=function(){if(!(this instanceof Tp))return new Tp;this.length=0},No=Tp.prototype;No.instanceString=function(){return"stylesheet"};No.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this};No.css=function(e,t){var n=this.length-1;if(tt(e))this[n].properties.push({name:e,value:t});else if(Dt(e))for(var r=e,a=Object.keys(r),i=0;i<a.length;i++){var l=a[i],o=r[l];if(o!=null){var f=er.properties[l]||er.properties[em(l)];if(f!=null){var c=f.name,d=o;this[n].properties.push({name:c,value:d})}}}return this};No.style=No.css;No.generateStyle=function(e){var t=new er(e);return this.appendToStyle(t)};No.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,a=n.properties;e.selector(r);for(var i=0;i<a.length;i++){var l=a[i];e.css(l.name,l.value)}}return e};var Qee="3.33.1",ko=function(t){if(t===void 0&&(t={}),Dt(t))return new od(t);if(tt(t))return u1.apply(u1,arguments)};ko.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(ko),e.apply(null,t),this};ko.warnings=function(e){return mL(e)};ko.version=Qee;ko.stylesheet=ko.Stylesheet=Tp;const lr={sage:"#abcfb8",ochre:"#edbf7f",terracotta:"#ffb4a1",neutral:"#8b928c",dimNeutral:"#6e7370",onSurface:"#e5e2e1",surface:"#111111"},Wee={concept:lr.sage,component:lr.ochre,bug:lr.terracotta,tool:lr.neutral,file:lr.neutral,spore:lr.sage,session:lr.ochre,other:lr.dimNeutral},Zee=lr.dimNeutral,vA=24,Jee=60,ete=12,tte=10,nte=8,V0=1.5,Dv=.25,H0=.7,rte=9,ate=.7,ite=4,ste=.6,lte=1e4,ote=120,ute=.2,cte=600,$0=50,pA=20,mA={concept:"Concept",component:"Component",bug:"Bug",tool:"Tool",file:"File",spore:"Spore",session:"Session",other:"Other"};function fte(e){const t=Math.min(e/ete,1);return vA+t*(Jee-vA)}function dte(e){return e.length<=pA?e:e.slice(0,pA-1)+"…"}function gA(e){return Wee[e==null?void 0:e.toLowerCase()]??Zee}function hte({nodes:e,edges:t,onNodeSelect:n}){const r=j.useRef(null),a=j.useRef(null),i=j.useRef(n);i.current=n,j.useEffect(()=>{if(!r.current||e.length===0)return;const o=new Map(e.map(y=>[y.id,y])),f=new Map;for(const y of e)f.set(y.id,0);for(const y of t)f.set(y.source_id,(f.get(y.source_id)??0)+1),f.set(y.target_id,(f.get(y.target_id)??0)+1);const c=[...e.map(y=>{var b;const x=mA[(b=y.type)==null?void 0:b.toLowerCase()]??mA.other;return{data:{id:y.id,label:`${dte(y.name)}
828
+ ${x}`,fullLabel:y.name,type:y.type,degree:f.get(y.id)??0,nodeSize:fte(f.get(y.id)??0)}}}),...t.map((y,x)=>({data:{id:`edge-${x}`,source:y.source_id,target:y.target_id,label:y.label??"",weight:y.weight??1}}))],d=r.current.getBoundingClientRect();if(d.width===0||d.height===0)return;const p=ko({container:r.current,elements:c,style:[{selector:"node",style:{label:"data(label)","background-color":y=>gA(y.data("type")),"background-opacity":.9,color:lr.onSurface,"font-size":tte,"font-family":"Inter, system-ui, sans-serif","text-valign":"bottom","text-margin-y":nte,"text-outline-color":lr.surface,"text-outline-width":2,"text-outline-opacity":.8,"text-wrap":"wrap","text-max-width":"120px",width:"data(nodeSize)",height:"data(nodeSize)","border-width":0,"border-color":lr.sage,"border-opacity":0,"overlay-opacity":0}},{selector:"node:active",style:{"overlay-opacity":.08,"overlay-color":lr.sage}},{selector:"node:selected",style:{"border-width":ite,"border-color":y=>gA(y.data("type")),"border-opacity":ste,"background-opacity":1}},{selector:"edge",style:{width:V0,"line-color":lr.neutral,"line-opacity":Dv,"curve-style":"unbundled-bezier","control-point-distances":[40],"control-point-weights":[.5],"target-arrow-shape":"triangle","target-arrow-color":lr.neutral,"arrow-scale":ate,label:"data(label)","font-size":rte,"font-family":"Inter, system-ui, sans-serif",color:lr.neutral,"text-opacity":0,"text-rotation":"autorotate","text-margin-y":-8,"text-outline-color":lr.surface,"text-outline-width":2,"text-outline-opacity":.7}},{selector:"edge:active",style:{"text-opacity":1,"line-opacity":H0}},{selector:"node.faded",style:{opacity:.3}},{selector:"edge.faded",style:{opacity:.1}}],layout:{name:"preset"},userZoomingEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,minZoom:.3,maxZoom:3}),m=p.layout({name:"cose",animate:!0,animationDuration:cte,nodeRepulsion:()=>lte,idealEdgeLength:()=>ote,gravity:ute,nodeDimensionsIncludeLabels:!0,fit:!0,padding:$0});return m.on("layoutstop",()=>{const y=p.nodes(),{ele:x,value:b}=y.max(S=>S.degree(!1));b>2&&y.length>20?p.animate({center:{eles:x},zoom:1.2,duration:300,easing:"ease-out"}):p.fit(void 0,$0)}),m.run(),p.on("tap","node",y=>{var N;const x=y.target,b=x.data();p.elements().removeClass("faded");const S=x.closedNeighborhood();p.elements().not(S).addClass("faded"),x.connectedEdges().style({"line-opacity":H0,"text-opacity":.9,width:2});const w=o.get(b.id);(N=i.current)==null||N.call(i,w??{id:b.id,name:b.fullLabel??b.label,type:b.type})}),p.on("tap",y=>{var x;y.target===p&&(p.elements().removeClass("faded"),p.edges().style({"line-opacity":Dv,"text-opacity":0,width:V0}),(x=i.current)==null||x.call(i,null))}),p.on("mouseover","edge",y=>{y.target.style("text-opacity",1),y.target.style("line-opacity",H0)}),p.on("mouseout","edge",y=>{const x=p.$("node:selected");x.length>0&&x.connectedEdges().contains(y.target)||(y.target.style("text-opacity",0),y.target.style("line-opacity",Dv))}),a.current=p,()=>{p.destroy(),a.current=null}},[e,t]);const l=j.useCallback(()=>{const o=a.current;o&&(o.elements().removeClass("faded"),o.edges().style({"line-opacity":Dv,"text-opacity":0,width:V0}),o.fit(void 0,$0))},[]);return{containerRef:r,resetView:l}}function vte({nodes:e,edges:t,onNodeSelect:n}){const{containerRef:r,resetView:a}=hte({nodes:e,edges:t,onNodeSelect:n});return h.jsxs("div",{className:"absolute inset-0",children:[h.jsx("div",{className:"absolute inset-0 rounded-md bg-surface-container-lowest",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(139, 146, 140, 0.05) 1px, transparent 0)",backgroundSize:"40px 40px"}}),h.jsx("div",{ref:r,className:"absolute inset-0 rounded-md"}),h.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2",children:h.jsxs(_e,{variant:"ghost",size:"sm",onClick:a,className:"gap-1.5",children:[h.jsx(k1,{className:"h-3.5 w-3.5"}),"Reset"]})}),e.length>0&&h.jsxs("div",{className:"absolute bottom-3 left-3 z-10 flex items-center gap-3 font-mono text-[10px] text-on-surface-variant/60",children:[h.jsxs("span",{children:[e.length," nodes"]}),h.jsxs("span",{children:[t.length," edges"]})]}),e.length===0&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No nodes to display"})})]})}const yA=[{type:"concept",label:"Concept",dotColor:"bg-primary"},{type:"component",label:"Component",dotColor:"bg-secondary"},{type:"bug",label:"Bug",dotColor:"bg-tertiary"},{type:"tool",label:"Tool",dotColor:"bg-outline"},{type:"file",label:"File",dotColor:"bg-outline"},{type:"spore",label:"Spore",dotColor:"bg-primary"},{type:"session",label:"Session",dotColor:"bg-secondary"},{type:"other",label:"Other",dotColor:"bg-on-surface-variant"}],pte=[{type:"RELATES_TO",label:"Relates To"},{type:"DERIVES_FROM",label:"Derives From"},{type:"REFERENCES",label:"References"},{type:"DEPENDS_ON",label:"Depends On"},{type:"AFFECTS",label:"Affects"}];function mte({entityCounts:e={},enabledTypes:t,onToggleType:n,searchQuery:r,onSearchChange:a,enabledEdgeTypes:i,onToggleEdgeType:l}){const[o,f]=j.useState(!1),c=Object.values(e).reduce((p,m)=>p+m,0),d=yA.length-t.size;return h.jsxs("div",{className:"absolute top-3 left-3 z-10",children:[!o&&h.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex items-center gap-2 rounded-md bg-surface-container/90 backdrop-blur-sm px-3 py-2 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high/90 transition-colors shadow-sm","aria-label":"Open graph filters",children:[h.jsx(vz,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"font-sans text-xs font-medium",children:"Filters"}),d>0&&h.jsx("span",{className:"font-mono text-[10px] bg-primary/20 text-primary rounded-full px-1.5 py-0.5 leading-none",children:d}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/50",children:c})]}),o&&h.jsxs("div",{className:"w-52 rounded-md bg-surface-container/95 backdrop-blur-md shadow-lg border border-outline-variant/20 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-outline-variant/10",children:[h.jsx("span",{className:"font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",children:"Filters"}),h.jsx("button",{type:"button",onClick:()=>f(!1),className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface transition-colors","aria-label":"Close filters",children:h.jsx(ns,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{className:"p-3 space-y-4",children:[h.jsxs("div",{className:"relative",children:[h.jsx(lc,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-on-surface-variant/50"}),h.jsx(cn,{placeholder:"Search nodes...",value:r,onChange:p=>a(p.target.value),className:"text-xs pl-7 h-7"})]}),h.jsx("div",{className:"space-y-1",children:yA.map(p=>{const m=e[p.type]??0,y=t.has(p.type);return h.jsxs("label",{className:"flex items-center gap-2 py-1 cursor-pointer group",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:()=>n(p.type),className:"sr-only"}),h.jsx("div",{className:Te("h-3 w-3 rounded-sm flex items-center justify-center transition-colors",y?"bg-surface-container-high":"bg-surface-container-lowest"),children:y&&h.jsx("div",{className:Te("h-1.5 w-1.5 rounded-full",p.dotColor)})}),h.jsx("span",{className:Te("font-sans text-xs transition-colors",y?"text-on-surface":"text-on-surface-variant/50"),children:p.label}),h.jsx("span",{className:"ml-auto font-mono text-[10px] text-on-surface-variant/50",children:m})]},p.type)})}),i&&l&&h.jsxs("div",{className:"space-y-1 pt-1 border-t border-outline-variant/10",children:[h.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant/60 pt-1",children:"Edges"}),pte.map(p=>{const m=i.has(p.type);return h.jsxs("label",{className:"flex items-center gap-2 py-0.5 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:m,onChange:()=>l(p.type),className:"sr-only"}),h.jsx("div",{className:Te("h-2.5 w-2.5 rounded-sm flex items-center justify-center transition-colors",m?"bg-surface-container-high":"bg-surface-container-lowest"),children:m&&h.jsx("div",{className:"h-1 w-1 rounded-full bg-outline"})}),h.jsx("span",{className:Te("font-sans text-[11px] transition-colors",m?"text-on-surface-variant":"text-on-surface-variant/40"),children:p.label})]},p.type)})]})]})]})]})}const xA=400,gte={concept:"default",component:"warning",bug:"destructive",tool:"secondary",file:"secondary",spore:"default",session:"warning"},bA={concept:"bg-primary",component:"bg-secondary",bug:"bg-tertiary",tool:"bg-outline",file:"bg-outline",spore:"bg-primary",session:"bg-secondary"};function $s({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between items-baseline py-1",children:[h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:e}),h.jsx("span",{className:"font-mono text-xs text-on-surface text-right max-w-[160px] truncate",children:t})]})}function wA(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function yte({node:e,edges:t,nodes:n,metadata:r,markdownPreview:a,connectedSpores:i,onClose:l,onNodeSelect:o,onNavigateToSpore:f}){const c=Ka();if(!e)return null;const d=e.type.toLowerCase(),p=gte[d]??"secondary",m=bA[d]??"bg-outline",y=new Map((n??[]).map(N=>[N.id,N])),x=[];for(const N of t??[])if(N.source_id===e.id){const C=y.get(N.target_id);C&&x.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:N.label??"connected",direction:"outgoing"})}else if(N.target_id===e.id){const C=y.get(N.source_id);C&&x.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:N.label??"connected",direction:"incoming"})}const b=a??e.content,S=b&&b.length>xA?b.slice(0,xA)+"…":b,w=e.type==="spore"?"Observation":e.type==="session"?"Summary":"Notes";return h.jsxs(Qe,{glass:!0,className:"absolute top-0 right-0 z-20 w-[320px] max-h-full overflow-y-auto flex flex-col shadow-lg border border-outline-variant/15 rounded-md",children:[h.jsx("div",{className:"p-4 pb-3",children:h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[h.jsx("div",{className:`h-2 w-2 rounded-full ${m} shrink-0`}),h.jsx(Ct,{variant:p,className:"text-[10px] uppercase",children:e.observation_type??e.type})]}),h.jsx("h2",{className:"font-serif text-lg text-on-surface leading-tight break-words",children:e.name}),wA(e)&&h.jsxs("button",{onClick:()=>{e.type==="spore"&&f?f(e.id):c(wA(e))},className:"inline-flex items-center gap-1 mt-1.5 font-sans text-xs text-on-surface-variant hover:text-primary transition-colors group cursor-pointer",children:[h.jsxs("span",{children:["View ",e.type]}),h.jsx(Cd,{className:"h-3 w-3 group-hover:translate-x-0.5 transition-transform"})]})]}),l&&h.jsx("button",{onClick:l,className:"shrink-0 rounded-md p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors",children:h.jsx(ns,{className:"h-4 w-4"})})]})}),h.jsx("div",{className:"h-px bg-surface-container-high/50"}),h.jsxs("div",{className:"px-4 py-3 space-y-0.5",children:[h.jsx(Bt,{children:"Metadata"}),h.jsxs("div",{className:"mt-1.5",children:[h.jsx($s,{label:"Type",value:e.observation_type??e.type}),h.jsx($s,{label:"ID",value:e.id.slice(0,12)+"…"}),e.status&&h.jsx($s,{label:"Status",value:e.status}),e.created_at!=null&&h.jsx($s,{label:"Created",value:new Date(e.created_at).toLocaleDateString()}),e.mention_count!=null&&e.mention_count>0&&h.jsx($s,{label:"Mentions",value:String(e.mention_count)}),h.jsx($s,{label:"Connections",value:String(x.length)}),e.depth!==void 0&&h.jsx($s,{label:"Depth",value:String(e.depth)}),r&&Object.entries(r).map(([N,C])=>h.jsx($s,{label:N,value:C},N))]})]}),S&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-px bg-surface-container-high/50"}),h.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[h.jsx(Bt,{children:w}),h.jsx(Qe,{level:"lowest",className:"p-3 font-sans text-xs text-on-surface-variant whitespace-pre-wrap leading-relaxed",children:S})]})]}),x.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-px bg-surface-container-high/50"}),h.jsxs("div",{className:"px-4 py-3 space-y-2",children:[h.jsxs(Bt,{children:["Connections (",x.length,")"]}),h.jsx("div",{className:"space-y-1",children:x.map((N,C)=>{const T=N.nodeType.toLowerCase(),R=bA[T]??"bg-outline",A=y.get(N.nodeId);return h.jsxs("button",{className:"w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-container-high/50 transition-colors group",onClick:()=>A&&(o==null?void 0:o(A)),children:[h.jsx("div",{className:`h-2 w-2 rounded-full ${R} shrink-0`}),h.jsx("span",{className:"font-sans text-xs text-on-surface truncate flex-1 group-hover:text-primary transition-colors",children:N.nodeName}),h.jsx(hb,{className:`h-3 w-3 shrink-0 ${N.direction==="incoming"?"rotate-180":""} text-on-surface-variant/50`}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 shrink-0 max-w-[80px] truncate",children:N.edgeLabel})]},`${N.nodeId}-${N.edgeLabel}-${C}`)})})]})]}),i&&i.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-px bg-surface-container-high/50"}),h.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[h.jsx(Bt,{children:"Connected Spores"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(N=>h.jsx(Ct,{variant:"secondary",className:"cursor-pointer text-[10px] hover:bg-surface-container-highest transition-colors",children:N.name},N.id))})]})]})]})}const xte=15e3,bte=3e4,wte=3e4,Ste=6e4;function Ete(e){const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/spores?${n}`:"/spores";return tn({queryKey:["spores",e],queryFn:({signal:a})=>ot(r,{signal:a}),staleTime:xte})}function Cte(e){return tn({queryKey:["spore",e],queryFn:({signal:t})=>ot(`/spores/${e}`,{signal:t}),enabled:e!==void 0,staleTime:bte})}function Nte(){return tn({queryKey:["full-graph"],queryFn:({signal:e})=>ot("/graph",{signal:e}),staleTime:wte})}function kte(e){const t=e?`/digest?agent_id=${encodeURIComponent(e)}`:"/digest";return tn({queryKey:["digest",e],queryFn:({signal:n})=>ot(t,{signal:n}),staleTime:Ste})}function $_(e){switch(e){case"wisdom":return"bg-primary/15 text-primary";case"discovery":return"bg-primary/15 text-primary";case"decision":return"bg-secondary/15 text-secondary";case"trade_off":return"bg-secondary/15 text-secondary";case"gotcha":return"bg-tertiary/15 text-tertiary";case"bug_fix":return"bg-tertiary/15 text-tertiary";default:return"bg-surface-container text-on-surface-variant"}}function G_(e){switch(e){case"active":return"bg-primary/15 text-primary";case"consolidated":return"bg-surface-container-high text-on-surface-variant";case"superseded":return"bg-tertiary/10 text-tertiary/70";default:return"bg-surface-container text-on-surface-variant"}}function fo(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const SA=120,Tte=1e3,jte=8,Ate=[Jn,"gotcha","decision","discovery","trade_off","bug_fix"],Rte=[Jn,"active","superseded","consolidated"],Dte=[{key:"type",label:"Type",options:Ate.map(e=>({value:e,label:e===Jn?"All types":fo(e)}))},{key:"status",label:"Status",options:Rte.map(e=>({value:e,label:e===Jn?"All statuses":fo(e)}))}];function Mte(e){return new Date(e*Tte).toLocaleDateString()}function Ote({spore:e,onClick:t,isSelected:n}){return h.jsx(Qe,{level:n?"high":"low",className:Te("p-4 cursor-pointer transition-all duration-150 hover:bg-surface-container-high hover:shadow-[inset_3px_0_0_var(--primary)] rounded-lg","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",n&&"ring-1 ring-primary/30"),onClick:t,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},tabIndex:0,role:"button","aria-label":`${fo(e.observation_type)} spore: ${wb(e.content,SA)}`,"aria-pressed":n,children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:Te("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",$_(e.observation_type)),children:fo(e.observation_type)}),h.jsx("span",{className:Te("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",G_(e.status)),children:fo(e.status)}),e.importance!==null&&h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.importance.toFixed(1)})]}),h.jsx("p",{className:"font-sans text-sm text-on-surface",children:wb(e.content,SA)})]}),h.jsxs("div",{className:"shrink-0 text-right space-y-1",children:[e.session_id&&h.jsx("div",{className:"font-mono text-xs text-on-surface-variant",children:e.session_id.slice(0,jte)}),h.jsx("div",{className:"font-sans text-xs text-on-surface-variant",children:Mte(e.created_at)})]})]})})}function Lte(){return h.jsx(Qe,{level:"low",className:"p-4 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"flex-1 space-y-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("div",{className:"h-5 w-16 animate-pulse rounded bg-surface-container"}),h.jsx("div",{className:"h-5 w-14 animate-pulse rounded bg-surface-container"})]}),h.jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-surface-container"})]}),h.jsxs("div",{className:"shrink-0 space-y-1",children:[h.jsx("div",{className:"h-3 w-14 animate-pulse rounded bg-surface-container"}),h.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-surface-container"})]})]})})}function _te({onSelectSpore:e,selectedSporeId:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Ad({initialFilters:{type:Jn,status:Jn}}),d=c("type"),p=c("status"),{data:m,isLoading:y,isError:x,error:b}=Ete({type:d,status:p,search:r,limit:$r,offset:i}),S=(m==null?void 0:m.spores)??[],w=(m==null?void 0:m.total)??0;return h.jsxs("div",{className:"space-y-3",children:[h.jsx(jd,{searchPlaceholder:"Search spores...",searchValue:n,onSearchChange:o,filters:Dte,filterValues:a,onFilterChange:f}),x?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load spores"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:b instanceof Error?b.message:"Unknown error"})]}):h.jsx("div",{className:"space-y-2",children:y?[1,2,3,4,5].map(N=>h.jsx(Lte,{},N)):S.length===0?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(Mz,{className:"h-8 w-8 opacity-30"}),h.jsx("span",{className:"font-sans text-sm",children:w===0&&!r&&!d&&!p?"No spores yet":"No matching spores"}),w===0&&!r&&!d&&!p&&h.jsx("span",{className:"font-sans text-xs",children:"Spores are extracted from session activity by the agent"})]}):S.map(N=>h.jsx(Ote,{spore:N,onClick:()=>e(N),isSelected:N.id===t},N.id))}),h.jsx(mc,{total:w,offset:i,limit:$r,onPageChange:l})]})}const Bte=12,EA=8;function Pte({type:e}){return h.jsx("span",{className:Te("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",$_(e)),children:fo(e)})}function zte({status:e}){return h.jsx("span",{className:Te("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",G_(e)),children:fo(e)})}function Of({label:e,value:t,children:n}){return h.jsxs("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[h.jsx("span",{className:"shrink-0 font-sans text-xs text-on-surface-variant",children:e}),n??h.jsx("span",{className:"font-mono text-xs text-on-surface text-right break-all",children:t})]})}function Ite({id:e,onBack:t,onNavigateToSpore:n,onNavigateToGraph:r}){const a=Ka(),{data:i,isLoading:l,isError:o,error:f}=Cte(e);if(l)return h.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(qn,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{className:"font-sans",children:"Loading spore..."})]});if(o||!i)return h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Spore not found"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:f instanceof Error?f.message:"Unknown error"})]});const c=(()=>{if(!i.tags)return[];if(i.tags.startsWith("["))try{return JSON.parse(i.tags)}catch{}return i.tags.split(",").map(d=>d.trim()).filter(Boolean)})();return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Spores"]}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsx(Pte,{type:i.observation_type}),h.jsx(zte,{status:i.status}),i.importance!==null&&h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Importance: ",h.jsx("span",{className:"text-on-surface font-medium",children:i.importance.toFixed(1)})]}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant ml-auto",children:gi(i.created_at)})]}),h.jsxs(Qe,{level:"low",className:"p-5",children:[h.jsx(Bt,{className:"mb-2",children:"Observation"}),h.jsx(Ma,{content:i.content})]}),i.context&&h.jsxs(Qe,{level:"low",className:"p-5",children:[h.jsx(Bt,{className:"mb-2",children:"Context"}),h.jsx(Ma,{content:i.context})]}),c.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(d=>h.jsx("span",{className:"inline-flex items-center rounded-full bg-surface-container px-2.5 py-0.5 font-sans text-xs text-on-surface-variant",children:d},d))}),(i.predecessor_id||i.successor_id)&&h.jsxs(Qe,{level:"low",className:"p-5 space-y-2",children:[h.jsx(Bt,{children:"Resolution History"}),i.predecessor_id&&h.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[h.jsx("span",{children:"Supersedes"}),h.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.predecessor_id),children:[i.predecessor_id.slice(0,EA),h.jsx(hb,{className:"h-3 w-3"})]})]}),i.successor_id&&h.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[h.jsx("span",{children:"Superseded by"}),h.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.successor_id),children:[i.successor_id.slice(0,EA),h.jsx(hb,{className:"h-3 w-3"})]})]})]}),h.jsxs(Qe,{glass:!0,className:"p-5",children:[h.jsx(Bt,{className:"mb-2",children:"Metadata"}),h.jsxs("div",{className:"text-sm",children:[h.jsx(Of,{label:"ID",value:i.id}),h.jsx(Of,{label:"Created",value:bb(i.created_at)}),h.jsx(Of,{label:"Updated",value:bb(i.updated_at)}),i.session_id&&h.jsx(Of,{label:"Session",children:h.jsxs("button",{className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",onClick:()=>a(`/sessions/${i.session_id}`),children:[i.session_id.slice(0,Bte),h.jsx(Cd,{className:"h-3 w-3"})]})}),i.agent_id&&h.jsx(Of,{label:"Agent",value:i.agent_id})]})]})]})}const G0=200,Fte={1500:"T1500 — Compact",5e3:"T5000 — Standard",1e4:"T10000 — Full"};function qte(e){return Fte[e]??`T${e}`}function Ute({tier:e}){const[t,n]=j.useState(!1),r=e.content.length>G0,a=r&&!t?e.content.slice(0,G0)+"…":e.content;return h.jsxs(Qe,{level:"low",className:"p-5 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[h.jsx("span",{className:"font-mono text-sm text-on-surface font-medium",children:qte(e.tier)}),h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Generated ",gi(e.generated_at)]})]}),h.jsx(Ma,{content:a}),r&&h.jsx(_e,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-xs text-on-surface-variant",onClick:()=>n(!t),children:t?h.jsxs(h.Fragment,{children:[h.jsx(sz,{className:"h-3 w-3"}),"Show less"]}):h.jsxs(h.Fragment,{children:[h.jsx(Ua,{className:"h-3 w-3"}),"Show more (",e.content.length-G0," more chars)"]})})]})}function Vte(){return h.jsxs(Qe,{level:"low",className:"p-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-surface-container"}),h.jsx("div",{className:"h-3 w-20 animate-pulse rounded bg-surface-container"})]}),h.jsxs("div",{className:"space-y-2 mt-3",children:[h.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container"}),h.jsx("div",{className:"h-3 w-4/5 animate-pulse rounded bg-surface-container"}),h.jsx("div",{className:"h-3 w-3/5 animate-pulse rounded bg-surface-container"})]})]})}function Hte({agentId:e}){const{data:t,isLoading:n,isError:r,error:a}=kte(e),i=(t==null?void 0:t.tiers)??[];return n?h.jsx("div",{className:"space-y-4",children:[1,2,3].map(l=>h.jsx(Vte,{},l))}):r?h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load digest"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:a instanceof Error?a.message:"Unknown error"})]}):i.length===0?h.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(pz,{className:"h-8 w-8 opacity-30"}),h.jsx("span",{className:"font-sans text-sm",children:"No digest generated yet"}),h.jsx("span",{className:"font-sans text-xs text-center max-w-xs",children:"Run the agent with the digest-only task to synthesize your vault knowledge into context extracts."})]}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[i.length," tier",i.length!==1?"s":""," — pre-computed context extracts at different token budgets."]}),i.map(l=>h.jsx(Ute,{tier:l},l.tier))]})}const K0=new Set(["concept","component","bug","tool","file","spore","session","other"]),$te=[{id:"graph",label:"Graph"},{id:"spores",label:"Spores"},{id:"digest",label:"Digest"}],K_="tab",Y_="spore",Gte=new Set(["graph","spores","digest"]);function CA(){const e=new URLSearchParams(window.location.search),t=e.get(K_),n=e.get(Y_)??void 0;return{tab:n?"spores":t&&Gte.has(t)?t:"graph",sporeId:n}}function Kte(e,t){const n=new URLSearchParams;e!=="graph"&&n.set(K_,e),t&&n.set(Y_,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.pushState(null,"",a)}function Yte({onNavigateToSpore:e}){const[t,n]=j.useState(new Set(K0)),[r,a]=j.useState(""),[i,l]=j.useState(null),{data:o}=Nte(),f=j.useMemo(()=>(o==null?void 0:o.nodes)??[],[o==null?void 0:o.nodes]),c=j.useMemo(()=>{const x={};for(const b of f){const S=b.type.toLowerCase(),w=K0.has(S)?S:"other";x[w]=(x[w]??0)+1}return x},[f]),d=j.useMemo(()=>{const x=r.toLowerCase();return f.filter(b=>{const S=b.type.toLowerCase(),w=K0.has(S)?S:"other";return!(!t.has(w)||x&&!b.name.toLowerCase().includes(x))})},[f,t,r]),p=j.useMemo(()=>{const x=(o==null?void 0:o.edges)??[],b=new Set(d.map(S=>S.id));return x.filter(S=>b.has(S.source_id)&&b.has(S.target_id))},[o==null?void 0:o.edges,d]),m=j.useCallback(x=>{n(b=>{const S=new Set(b);return S.has(x)?S.delete(x):S.add(x),S})},[]),y=j.useCallback(x=>{l(x)},[]);return h.jsxs("div",{className:"relative h-[calc(100vh-180px)]",children:[h.jsx(vte,{nodes:d,edges:p,onNodeSelect:y,selectedNode:i}),h.jsx(mte,{entityCounts:c,enabledTypes:t,onToggleType:m,searchQuery:r,onSearchChange:a}),h.jsx(yte,{node:i,edges:p,nodes:d,onClose:()=>l(null),onNodeSelect:x=>l(x),onNavigateToSpore:e})]})}function Xte(){const e=CA(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.sporeId?{id:e.sporeId}:null),i=j.useRef(!1),l=j.useRef(!1);j.useEffect(()=>{if(!i.current){i.current=!0;return}if(l.current){l.current=!1;return}Kte(t,r==null?void 0:r.id)},[t,r==null?void 0:r.id]),j.useEffect(()=>{function p(){l.current=!0;const m=CA();n(m.tab),a(m.sporeId?{id:m.sporeId}:null)}return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[]);function o(p){a(p)}function f(){a(null)}function c(p){a({id:p})}function d(p){n(p),p!=="spores"&&a(null)}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsx(yi,{title:"Mycelium",subtitle:"Derived intelligence — spores, entity graph, and synthesized context.",tabs:$te,activeTab:t,onTabChange:p=>d(p)}),t==="graph"&&h.jsx(Yte,{onNavigateToSpore:p=>{n("spores"),a({id:p})}}),t==="spores"&&(r?h.jsx(Ite,{id:r.id,onBack:f,onNavigateToSpore:c}):h.jsx(_te,{onSelectSpore:o})),t==="digest"&&h.jsx(Hte,{})]})}const Qte=[{value:Jn,label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}];function Wte({status:e}){const t=$D(e);return h.jsx("span",{className:Te("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold",t==="default"?"bg-primary-container/20 text-primary":t==="destructive"?"bg-tertiary-container/20 text-tertiary":t==="warning"?"bg-secondary-container/20 text-secondary":"bg-surface-container-high text-on-surface-variant"),children:$1(e)})}function Zte(){return h.jsx("tr",{className:"border-b border-outline-variant/20",children:[200,80,100,80,80].map((e,t)=>h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:Te("h-4 animate-pulse rounded bg-surface-container"),style:{width:e}})},t))})}function Jte({run:e,onClick:t,taskNameMap:n}){const r=e.task?n.get(e.task)??e.task:KD;return h.jsxs("tr",{className:"border-b border-outline-variant/20 last:border-0 hover:bg-surface-container-high/50 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Agent run: ${r}, status ${e.status}`,children:[h.jsx("td",{className:"px-4 py-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),h.jsx("span",{className:"text-sm font-medium text-on-surface truncate max-w-xs",children:r})]})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx(Wte,{status:e.status})}),h.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:qp(e.started_at)}),h.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Fp(e.started_at,e.completed_at)}),h.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Q1(e.tokens_used)}),h.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:X1(e.cost_usd)})]})}function ene({onSelectRun:e,onTriggerRun:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Ad({initialFilters:{status:Jn,task:Jn}}),{data:d}=dc(),p=j.useMemo(()=>{const L=new Map;for(const B of(d==null?void 0:d.tasks)??[])L.set(B.name,B.displayName);return L},[d]),m=j.useMemo(()=>{const L=[{value:Jn,label:"All tasks"}];for(const B of(d==null?void 0:d.tasks)??[])L.push({value:B.name,label:B.displayName});return L},[d]),y=j.useMemo(()=>[{key:"status",label:"Status",options:Qte},{key:"task",label:"Task",options:m}],[m]),x=c("status"),b=c("task"),{data:S,isLoading:w,isError:N,error:C}=HD({limit:$r,offset:i,search:r,status:x,task:b}),T=(S==null?void 0:S.runs)??[],R=(S==null?void 0:S.total)??0,A=h.jsx(jd,{searchPlaceholder:"Search runs...",searchValue:n,onSearchChange:o,filters:y,filterValues:a,onFilterChange:f}),D=h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-outline-variant/20 bg-surface-container/50",children:[h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Task"}),h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Status"}),h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Started"}),h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Duration"}),h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Tokens"}),h.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Cost"})]})});return N?h.jsxs("div",{className:"space-y-4",children:[A,h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load runs"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:C instanceof Error?C.message:"Unknown error"})]})]}):h.jsxs("div",{className:"space-y-4",children:[A,w?h.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:h.jsxs("table",{className:"w-full",children:[D,h.jsx("tbody",{children:[1,2,3].map(L=>h.jsx(Zte,{},L))})]})}):T.length===0?h.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 rounded-md bg-surface-container-low text-on-surface-variant",children:[h.jsx(bd,{className:"h-10 w-10 opacity-30"}),h.jsxs("div",{className:"text-center font-sans",children:[h.jsx("p",{className:"text-sm",children:R===0&&!r&&!x&&!b?"No agent runs yet":"No matching runs"}),R===0&&!r&&!x&&!b&&h.jsx("p",{className:"text-xs mt-1",children:"Trigger the first run to see the agent at work"})]}),R===0&&!r&&!x&&!b&&h.jsxs(_e,{variant:"outline",size:"sm",className:"gap-2 mt-2",onClick:t,children:[h.jsx(Zu,{className:"h-3.5 w-3.5"}),"Run Now"]})]}):h.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:h.jsxs("table",{className:"w-full","aria-label":"Agent runs",children:[D,h.jsx("tbody",{children:T.map(L=>h.jsx(Jte,{run:L,taskNameMap:p,onClick:()=>e(L.id)},L.id))})]})}),h.jsx(mc,{total:R,offset:i,limit:$r,onPageChange:l})]})}function tne({text:e}){const[t,n]=j.useState(!1),r=e.length>200||e.includes(`
829
+ `);return h.jsxs("div",{className:"mt-1",children:[h.jsx("div",{className:!t&&r?"line-clamp-2":void 0,children:h.jsx(Ma,{content:e,className:"text-on-surface-variant [&>*]:text-on-surface-variant"})}),r&&h.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>n(!t),children:t?h.jsxs(h.Fragment,{children:[h.jsx(Ua,{className:"h-3 w-3"})," Show less"]}):h.jsxs(h.Fragment,{children:[h.jsx(ua,{className:"h-3 w-3"})," Show more"]})})]})}function nne({phases:e}){return h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Phase Execution"}),e.map((t,n)=>h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-surface-container-high font-mono text-sm font-medium text-on-surface-variant shrink-0",children:n+1}),h.jsxs(Qe,{level:"default",className:"flex-1 p-3",children:[h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:t.name}),h.jsx(Ct,{variant:$D(t.status),children:t.status})]}),h.jsxs("div",{className:"flex gap-3 font-mono text-xs text-on-surface-variant",children:[h.jsxs("span",{children:[t.turnsUsed," turns"]}),h.jsx("span",{children:Q1(t.tokensUsed)}),h.jsx("span",{children:X1(t.costUsd)})]})]}),t.summary&&h.jsx(tne,{text:t.summary})]})]},t.name))]})}const NA=80,rne=1e3;function ane(e){const t=e.toLowerCase();return t.includes("extract")||t.includes("create")||t.includes("supersed")||t.includes("update")?"default":t.includes("skip")||t.includes("no-op")?"secondary":t.includes("error")||t.includes("fail")?"destructive":"default"}function ine(e){return e===null?"—":new Date(e*rne).toLocaleTimeString()}function sne(e,t){return e&&wb(e,t)||"—"}function lne({report:e}){const[t,n]=j.useState(!1),[r,a]=j.useState(!1),i=e.details!==null&&e.details.length>0,l=e.summary.length>200||e.summary.includes(`
830
+ `);let o=null;if(i)try{o=JSON.parse(e.details)}catch{o=e.details}return h.jsxs(Qe,{level:"low",className:"p-4 space-y-2",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(Ct,{variant:ane(e.action),children:e.action}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:!r&&l?"line-clamp-3":void 0,children:h.jsx(Ma,{content:e.summary})}),l&&h.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>a(!r),children:r?h.jsxs(h.Fragment,{children:[h.jsx(Ua,{className:"h-3 w-3"})," Show less"]}):h.jsxs(h.Fragment,{children:[h.jsx(ua,{className:"h-3 w-3"})," Show more"]})})]}),h.jsx("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:ine(e.created_at)})]}),i&&h.jsxs("div",{children:[h.jsxs("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",onClick:()=>n(!t),children:[t?h.jsx(Ua,{className:"h-3.5 w-3.5"}):h.jsx(ua,{className:"h-3.5 w-3.5"}),t?"Hide details":"Show details"]}),t&&h.jsx("pre",{className:"mt-2 rounded-md bg-surface-container-lowest p-3 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof o=="string"?o:JSON.stringify(o,null,2)})]})]})}function one({turn:e}){const[t,n]=j.useState(!1);let r=null;if(e.tool_input)try{r=JSON.parse(e.tool_input)}catch{r=e.tool_input}const a=e.tool_input?sne(e.tool_input,NA):"—",i=e.tool_input!==null&&e.tool_input.length>NA;return h.jsx("div",{className:"px-4 py-2.5 hover:bg-surface-container-high/30 transition-colors border-b border-outline-variant/10 last:border-b-0",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("span",{className:"font-mono text-xs text-on-surface-variant w-5 shrink-0 pt-0.5 text-right",children:e.turn_number}),h.jsx("span",{className:"font-mono text-xs font-medium text-on-surface shrink-0 pt-0.5 min-w-[140px]",children:e.tool_name}),h.jsxs("div",{className:"flex-1 min-w-0",children:[i?h.jsxs("button",{className:"flex items-start gap-1 text-left font-mono text-xs text-on-surface-variant hover:text-on-surface transition-colors w-full",onClick:()=>n(!t),children:[t?h.jsx(Ua,{className:"h-3 w-3 mt-0.5 shrink-0"}):h.jsx(ua,{className:"h-3 w-3 mt-0.5 shrink-0"}),h.jsx("span",{className:t?void 0:"truncate",children:a})]}):h.jsx("span",{className:"font-mono text-xs text-on-surface-variant truncate block",children:a}),t&&r!==null&&h.jsx("pre",{className:"mt-1.5 ml-4 rounded-md bg-surface-container-lowest p-2.5 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})})}function une({runId:e,onBack:t}){var T;const[n,r]=j.useState(!1),{data:a,isLoading:i,isError:l}=Mq(e),o=(T=a==null?void 0:a.run)==null?void 0:T.status,{data:f,isLoading:c}=Oq(e,o),{data:d,isLoading:p}=Lq(n?e:void 0,o),{data:m}=dc(),y=j.useMemo(()=>(m==null?void 0:m.tasks)??[],[m]);if(i)return h.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[h.jsx(qn,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{className:"font-sans",children:"Loading run..."})]});if(l||!(a!=null&&a.run))return h.jsxs("div",{className:"space-y-4",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Runs"]}),h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Run not found"})]})]});const x=a.run,b=(f==null?void 0:f.reports)??[],S=d??[];let w=null,N,C;if(x.actions_taken)try{const R=JSON.parse(x.actions_taken);R!=null&&R.phases&&Array.isArray(R.phases)&&(w=R.phases),typeof(R==null?void 0:R.model)=="string"&&(N=R.model),typeof(R==null?void 0:R.provider)=="string"&&(C=R.provider)}catch{}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Runs"]}),h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[h.jsx(sn,{label:"Status",value:$1(x.status),accent:"sage"}),h.jsx(sn,{label:"Task",value:YD(x.task,y),accent:"outline"}),h.jsx(sn,{label:"Started",value:qp(x.started_at),accent:"outline"}),h.jsx(sn,{label:"Duration",value:Fp(x.started_at,x.completed_at),accent:"outline"}),h.jsx(sn,{label:"Tokens",value:Q1(x.tokens_used),accent:"ochre"}),h.jsx(sn,{label:"Cost",value:X1(x.cost_usd),accent:"ochre"})]}),(N||C)&&h.jsxs("div",{className:"flex items-center gap-4 px-1",children:[C&&h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Provider: ",h.jsx("span",{className:"font-mono text-on-surface",children:C})]}),N&&h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Model: ",h.jsx("span",{className:"font-mono text-on-surface",children:N})]})]}),x.error&&h.jsx("div",{className:"rounded-md bg-tertiary/10 px-3 py-2",children:h.jsx("p",{className:"font-mono text-xs text-tertiary",children:x.error})}),w&&w.length>0&&h.jsx(Qe,{level:"low",className:"p-4",children:h.jsx(nne,{phases:w})}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Decisions",b.length>0&&h.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[b.length," ",b.length===1?"action":"actions"]})]}),c?h.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant py-4",children:[h.jsx(qn,{className:"h-4 w-4 animate-spin"}),h.jsx("span",{className:"font-sans text-sm",children:"Loading decisions..."})]}):b.length===0?h.jsx(Qe,{level:"low",className:"flex h-24 items-center justify-center",children:h.jsx("span",{className:"font-sans text-sm text-on-surface-variant",children:"No decisions recorded for this run"})}):h.jsx("div",{className:"space-y-2",children:b.map(R=>h.jsx(lne,{report:R},R.id))})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("button",{className:"flex items-center gap-2 font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide hover:text-on-surface transition-colors",onClick:()=>r(!n),children:[n?h.jsx(Ua,{className:"h-4 w-4"}):h.jsx(ua,{className:"h-4 w-4"}),"Audit Trail",h.jsx("span",{className:"normal-case font-normal text-xs",children:"(diagnostics)"})]}),n&&h.jsxs(Qe,{level:"low",className:Te("overflow-hidden"),children:[h.jsx("div",{className:"p-4 pb-2",children:h.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Turn-by-turn trace"})}),h.jsx("div",{className:"p-0",children:p?h.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant p-4",children:[h.jsx(qn,{className:"h-4 w-4 animate-spin"}),h.jsx("span",{className:"font-sans text-sm",children:"Loading turns..."})]}):S.length===0?h.jsx("p",{className:"font-sans text-sm text-on-surface-variant p-4",children:"No turns recorded."}):h.jsx("div",{children:S.map(R=>h.jsx(one,{turn:R},R.id))})})]})]})]})}function cne(e){return e.displayName??e.name}function fne({open:e,onOpenChange:t,onTriggered:n}){var S;const[r,a]=j.useState(void 0),[i,l]=j.useState(""),{data:o,isLoading:f}=dc(),{mutate:c,isPending:d,error:p}=Y1(),m=(o==null?void 0:o.tasks)??[],y=m.find(w=>w.isDefault),x=r??(y==null?void 0:y.name)??((S=m[0])==null?void 0:S.name)??"";function b(){const w={task:x||void 0,instruction:i.trim()||void 0};c(w,{onSuccess:()=>{t(!1),a(void 0),l(""),n==null||n()}})}return h.jsx(Nd,{open:e,onOpenChange:t,children:h.jsxs(cc,{className:"sm:max-w-md",children:[h.jsxs(kd,{children:[h.jsx(fc,{children:"Trigger Agent Run"}),h.jsx(zp,{children:"Run the Myco agent now. It will process unprocessed sessions and update the vault."})]}),h.jsxs("div",{className:"space-y-4 py-2",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Task"}),f?h.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[h.jsx(qn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):h.jsxs(Zi,{value:x,onValueChange:a,children:[h.jsx(vi,{children:h.jsx(Ji,{})}),h.jsx(pi,{children:m.map(w=>h.jsxs(ia,{value:w.name,children:[cne(w),w.isDefault&&h.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant",children:"(default)"})]},w.name))})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",h.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),h.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:ring-2 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 resize-none",rows:3,placeholder:"E.g. Focus on gotchas from yesterday's sessions...",value:i,onChange:w=>l(w.target.value),disabled:d})]}),p&&h.jsx("p",{className:"font-sans text-xs text-tertiary",children:p instanceof Error?p.message:"Failed to trigger run"})]}),h.jsxs(Pp,{children:[h.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),h.jsx(_e,{size:"sm",className:"gap-2",onClick:b,disabled:d,children:d?h.jsxs(h.Fragment,{children:[h.jsx(qn,{className:"h-3.5 w-3.5 animate-spin"}),"Starting..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Zu,{className:"h-3.5 w-3.5"}),"Run Now"]})})]})]})})}function dne(e){return!e.phases||e.phases.length===0?"Single query":`${e.phases.length} phases`}function hne(e){return e===A1?"User":"Built-in"}function vne({task:e,onClick:t}){return h.jsxs(Qe,{level:"low",interactive:!0,className:Te("p-4 space-y-2 transition-all",e.isDefault&&"ring-1 ring-primary/20 shadow-[inset_0_0_12px_rgba(171,207,184,0.08)]"),onClick:t,children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.displayName}),e.isDefault&&h.jsx(Oz,{className:"h-3.5 w-3.5 text-primary shrink-0 fill-primary/30"})]}),e.description&&h.jsx("p",{className:"font-sans text-xs text-on-surface-variant mt-1 line-clamp-2",children:e.description})]}),h.jsx("div",{className:"flex items-center gap-2 shrink-0",children:h.jsx(Ct,{variant:GD(e.source),children:hne(e.source)})})]}),h.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-on-surface-variant",children:[h.jsx(yz,{className:"h-3 w-3"}),h.jsx("span",{className:"font-mono text-xs",children:dne(e)})]}),e.model&&h.jsx("span",{className:"font-mono text-xs text-on-surface-variant/70 truncate max-w-[160px]",children:e.model}),e.maxTurns!==void 0&&h.jsxs("span",{className:"font-mono text-xs text-on-surface-variant/70",children:["max ",e.maxTurns," turns"]})]})]})}function pne({onSelect:e}){const{data:t,isLoading:n}=dc(),r=(t==null?void 0:t.tasks)??[];return n?h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:3}).map((a,i)=>h.jsx("div",{className:"h-28 rounded-md animate-pulse bg-surface-container-low"},i))}):r.length===0?h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No tasks found."}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:r.map(a=>h.jsx(vne,{task:a,onClick:()=>e(a.name)},a.name))})}const mne=new Set(["instruction"]),gne={session_id:"Session ID"},yne={session_id:"e.g. 36858a44-4ef7-4448-96e8-382e992e8ba4"};function xne(e){const t=e.matchAll(/\{\{(\w+)\}\}/g),n=new Set;for(const r of t){const a=r[1];mne.has(a)||n.add(a)}return[...n]}function kA(e){return gne[e]??e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function bne({task:e,onRunTriggered:t,onDeleted:n,onCustomized:r}){const a=Y1(),i=Bq(),l=Pq(),[o,f]=j.useState(!1),[c,d]=j.useState({}),[p,m]=j.useState(""),y=j.useMemo(()=>xne(e.prompt??""),[e.prompt]),x=y.length>0;function b(){var T;const w=[];for(const R of y){const A=(T=c[R])==null?void 0:T.trim();A&&w.push(`${R}: ${A}`)}const N=p.trim();N&&w.push(N);const C=w.length>0?w.join(`
831
+ `):void 0;a.mutate({task:e.name,instruction:C},{onSuccess:R=>{f(!1),d({}),m(""),t==null||t(R.runId)}})}function S(w,N){d(C=>({...C,[w]:N}))}return h.jsxs("div",{className:"flex gap-2",children:[h.jsx(_e,{size:"sm",onClick:()=>{f(!0)},children:"Run Now"}),e.source===Kz&&h.jsx(_e,{variant:"outline",size:"sm",onClick:()=>i.mutate({taskId:e.name},{onSuccess:w=>{var C;const N=(C=w==null?void 0:w.task)==null?void 0:C.name;N&&r&&r(N)}}),children:"Customize"}),e.source===A1&&h.jsx(_e,{variant:"destructive",size:"sm",onClick:()=>{l.mutate(e.name,{onSuccess:()=>n==null?void 0:n()})},children:"Delete"}),h.jsx(Nd,{open:o,onOpenChange:f,children:h.jsxs(cc,{className:"sm:max-w-md",children:[h.jsx(kd,{children:h.jsxs(fc,{children:["Run ",e.displayName]})}),h.jsxs("div",{className:"space-y-4 py-2",children:[y.map(w=>h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:kA(w)}),h.jsx(cn,{value:c[w]??"",onChange:N=>S(w,N.target.value),placeholder:yne[w]??`Enter ${kA(w).toLowerCase()}`,className:"font-mono",autoFocus:y.indexOf(w)===0})]},w)),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",h.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),h.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:border-primary/40 resize-none",rows:2,placeholder:"Additional instructions for this run...",value:p,onChange:w=>m(w.target.value),disabled:a.isPending})]})]}),h.jsxs(Pp,{children:[h.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Cancel"}),h.jsxs(_e,{size:"sm",disabled:a.isPending,onClick:b,className:"gap-2",children:[a.isPending?h.jsx(qn,{className:"h-3.5 w-3.5 animate-spin"}):h.jsx(Zu,{className:"h-3.5 w-3.5"}),"Run"]})]})]})})]})}const wne=20;function Sne({taskId:e,onSaved:t}){const{data:n,isLoading:r,isError:a}=zq(e),i=Iq(),[l,o]=j.useState(""),[f,c]=j.useState(!1);j.useEffect(()=>{n!=null&&n.yaml&&(o(n.yaml),c(!1))},[n==null?void 0:n.yaml]);function d(x){o(x),c(!0)}function p(){i.mutate({taskId:e,yaml:l},{onSuccess:()=>{c(!1),t==null||t()}})}function m(){n!=null&&n.yaml&&(o(n.yaml),c(!1))}if(r)return h.jsx("div",{className:"h-64 animate-pulse rounded-md bg-surface-container-low"});if(a)return h.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-4 font-sans text-sm text-tertiary",children:"Failed to load task YAML."});const y=(n==null?void 0:n.source)!=="user";return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Task Definition ",y&&"(read-only)"]}),!y&&h.jsxs("div",{className:"flex gap-2",children:[h.jsx(_e,{variant:"ghost",size:"sm",onClick:m,disabled:!f,children:"Reset"}),h.jsx(_e,{size:"sm",onClick:p,disabled:!f||i.isPending,children:i.isPending?"Saving...":"Save"})]})]}),h.jsx("textarea",{value:l,onChange:x=>d(x.target.value),readOnly:y,rows:wne,spellCheck:!1,className:`w-full rounded-md bg-surface-container-lowest p-4 font-mono text-sm text-on-surface leading-relaxed resize-y focus:outline-none focus:ring-2 focus:ring-primary/40 ${y?"opacity-75 cursor-not-allowed":""}`}),i.isError&&h.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-3 font-sans text-sm text-tertiary",children:i.error.message}),i.isSuccess&&!f&&h.jsx("div",{className:"rounded-md bg-primary-container/20 p-3 font-sans text-sm text-primary",children:"Task saved successfully."})]})}function fl({checked:e,onCheckedChange:t,disabled:n}){return h.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:n,onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 shrink-0 rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 ${n?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e?"bg-primary":"bg-surface-container-high"}`,children:h.jsx("span",{className:`pointer-events-none block h-5 w-5 rounded-full bg-on-surface shadow-lg ring-0 transition-transform ${e?"translate-x-5":"translate-x-0"}`})})}const X_=3e4;function Ene(e){return tn({queryKey:["task-config",e],queryFn:({signal:t})=>ot(`/agent/tasks/${e}/config`,{signal:t}),enabled:e!==void 0,staleTime:X_})}function Cne(){return tn({queryKey:["providers"],queryFn:({signal:e})=>ot("/providers",{signal:e}),staleTime:X_})}function Nne(){return br({mutationFn:e=>kn("/providers/test",e)})}function kne(){const e=Vn();return br({mutationFn:({taskId:t,config:n})=>oc(`/agent/tasks/${t}/config`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["task-config",n.taskId]})}})}const Tne={cloud:"Anthropic Cloud",ollama:"Ollama",lmstudio:"LM Studio"},jne={cloud:uz,ollama:jz,lmstudio:N1};function Q_({providerType:e,model:t,baseUrl:n,contextLength:r,modelPlaceholder:a,providers:i,isLoadingProviders:l,onProviderChange:o,onModelChange:f,onBaseUrlChange:c,onContextLengthChange:d}){const p=i.find(x=>x.type===e),m=e==="ollama"||e==="lmstudio",y=(p==null?void 0:p.models)??[];return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"grid grid-cols-3 gap-2",children:["cloud","ollama","lmstudio"].map(x=>{const b=jne[x],S=i.find(N=>N.type===x),w=e===x;return b?h.jsxs("button",{onClick:()=>o(x),className:`
832
+ flex flex-col items-center gap-1.5 rounded-md border px-3 py-2.5 transition-colors
833
+ ${w?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
834
+ `,children:[h.jsx(b,{className:"h-4 w-4"}),h.jsx("span",{className:"font-sans text-xs font-medium",children:Tne[x]}),!l&&h.jsx(Ct,{variant:S!=null&&S.available?"secondary":"destructive",className:"text-[10px] px-1.5 py-0",children:S!=null&&S.available?"online":"offline"})]},x):null})}),m&&h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),h.jsx(cn,{value:n,onChange:x=>c(x.target.value),placeholder:(p==null?void 0:p.baseUrl)??""})]}),m&&h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Context Length"}),h.jsx(cn,{type:"number",value:r,onChange:x=>d(x.target.value),placeholder:"32768"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),y.length>0?h.jsxs(Zi,{value:t,onValueChange:f,children:[h.jsx(vi,{children:h.jsx(Ji,{placeholder:a??"Select a model"})}),h.jsx(pi,{children:y.map(x=>h.jsx(ia,{value:x,children:h.jsx("span",{className:"font-mono text-sm",children:x})},x))})]}):h.jsx(cn,{value:t,onChange:x=>f(x.target.value),placeholder:(p==null?void 0:p.available)===!1?"Provider offline":"Enter model name",disabled:(p==null?void 0:p.available)===!1})]})]})}function Ane({phase:e,override:t,taskModel:n,providers:r,isLoadingProviders:a,onChange:i}){var c,d,p,m;const[l,o]=j.useState(!1),f=t.provider!==void 0||t.model!==void 0||t.maxTurns!==void 0;return h.jsxs("div",{className:"border border-[var(--ghost-border)] rounded-md",children:[h.jsxs("button",{onClick:()=>o(!l),className:"flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-surface-container-low/50 transition-colors rounded-md",children:[l?h.jsx(Ua,{className:"h-3.5 w-3.5 text-on-surface-variant"}):h.jsx(ua,{className:"h-3.5 w-3.5 text-on-surface-variant"}),h.jsx("span",{className:"font-sans text-sm text-on-surface",children:e.name}),h.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:["max ",t.maxTurns??e.maxTurns," turns"]}),f&&h.jsx(Ct,{variant:"secondary",className:"text-[10px] ml-auto",children:"override"})]}),l&&h.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[var(--ghost-border)]",children:[h.jsx("div",{className:"pt-3",children:h.jsx(Q_,{providerType:((c=t.provider)==null?void 0:c.type)??"cloud",model:((d=t.provider)==null?void 0:d.model)??t.model??"",baseUrl:((p=t.provider)==null?void 0:p.base_url)??"",contextLength:((m=t.provider)==null?void 0:m.context_length)!=null?String(t.provider.context_length):"",modelPlaceholder:e.model??n,providers:r,isLoadingProviders:a,onProviderChange:y=>{var b;const x=(b=r.find(S=>S.type===y))==null?void 0:b.baseUrl;i({...t,provider:{type:y,base_url:x},model:void 0})},onModelChange:y=>i({...t,provider:t.provider?{...t.provider,model:y}:void 0,model:t.provider?void 0:y}),onBaseUrlChange:y=>i({...t,provider:t.provider?{...t.provider,base_url:y}:void 0}),onContextLengthChange:y=>i({...t,provider:t.provider?{...t.provider,context_length:y?Number(y):void 0}:void 0})})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),h.jsx(cn,{type:"number",value:t.maxTurns??"",onChange:y=>i({...t,maxTurns:y.target.value?Number(y.target.value):void 0}),placeholder:String(e.maxTurns)})]}),f&&h.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>i(null),className:"text-xs text-on-surface-variant",children:"Clear Phase Override"})]})]})}const Rne=["active","idle","sleep"],Dne={active:"Active",idle:"Idle",sleep:"Sleep"};function Mne({taskId:e,phases:t,defaults:n,schedule:r,params:a}){const{data:i,isPending:l}=Cne(),{data:o}=Ene(e),f=Nne(),c=kne(),d=o==null?void 0:o.config,[p,m]=j.useState("cloud"),[y,x]=j.useState(""),[b,S]=j.useState(""),[w,N]=j.useState(""),[C,T]=j.useState(""),[R,A]=j.useState(""),[D,L]=j.useState({}),[B,M]=j.useState({}),[_,P]=j.useState({}),[H,$]=j.useState(!1);j.useEffect(()=>{var z,W,re,ae;d&&(m(((z=d.provider)==null?void 0:z.type)??"cloud"),x(((W=d.provider)==null?void 0:W.model)??d.model??""),S(((re=d.provider)==null?void 0:re.base_url)??""),N(((ae=d.provider)==null?void 0:ae.context_length)!=null?String(d.provider.context_length):""),T(d.maxTurns!=null?String(d.maxTurns):""),A(d.timeoutSeconds!=null?String(d.timeoutSeconds):""),L(d.phases??{}),M(d.schedule??{}),P(d.params??{}),$(!1))},[d]);const V=B.enabled??(r==null?void 0:r.enabled)??!1,I=B.runIn??(r==null?void 0:r.runIn)??[],U=(i==null?void 0:i.providers)??[];function Y(z){var W;m(z),x(""),S(((W=U.find(re=>re.type===z))==null?void 0:W.baseUrl)??""),N(""),$(!0),f.reset()}function Q(z,W){L(re=>{const ae={...re};return W===null?delete ae[z]:ae[z]=W,ae}),$(!0)}function F(){const z=p==="ollama"||p==="lmstudio",W={type:p,...y?{model:y}:{},...z&&b?{base_url:b}:{},...z&&w?{context_length:Number(w)}:{}},re=r?Object.keys(B).length>0?{schedule:B}:{schedule:null}:{},ae=a&&Object.keys(_).length>0?{params:_}:{};c.mutate({taskId:e,config:{provider:W,...C?{maxTurns:Number(C)}:{maxTurns:null},...R?{timeoutSeconds:Number(R)}:{timeoutSeconds:null},...Object.keys(D).length>0?{phases:D}:{phases:null},...re,...ae}},{onSuccess:()=>$(!1)})}function q(){c.mutate({taskId:e,config:{provider:null,model:null,maxTurns:null,timeoutSeconds:null,phases:null,schedule:null,params:null}},{onSuccess:()=>{m("cloud"),x(""),S(""),N(""),T(""),A(""),L({}),M({}),P({}),$(!1)}})}function X(){const W={type:p,...(p==="ollama"||p==="lmstudio")&&b?{base_url:b}:{}};f.mutate(W)}return h.jsxs(Qe,{level:"low",className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Task Config"}),d&&h.jsx(_e,{variant:"ghost",size:"sm",onClick:q,className:"text-xs text-on-surface-variant",children:"Clear All Overrides"})]}),h.jsx(Q_,{providerType:p,model:y,baseUrl:b,contextLength:w,modelPlaceholder:n==null?void 0:n.model,providers:U,isLoadingProviders:l,onProviderChange:Y,onModelChange:z=>{x(z),$(!0)},onBaseUrlChange:z=>{S(z),$(!0)},onContextLengthChange:z=>{N(z),$(!0)}}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),h.jsx(cn,{type:"number",value:C,onChange:z=>{T(z.target.value),$(!0)},placeholder:(n==null?void 0:n.maxTurns)!=null?String(n.maxTurns):"—"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout (seconds)"}),h.jsx(cn,{type:"number",value:R,onChange:z=>{A(z.target.value),$(!0)},placeholder:(n==null?void 0:n.timeoutSeconds)!=null?String(n.timeoutSeconds):"—"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:X,disabled:f.isPending,className:"gap-1.5 text-on-surface-variant",children:[f.isPending?h.jsx(qn,{className:"h-3.5 w-3.5 animate-spin"}):h.jsx(Iz,{className:"h-3.5 w-3.5"}),"Test"]}),f.isSuccess&&h.jsx("span",{className:"flex items-center gap-1 text-xs",children:f.data.ok?h.jsxs(h.Fragment,{children:[h.jsx(Sd,{className:"h-3.5 w-3.5 text-green-500"}),h.jsxs("span",{className:"text-green-500 font-mono",children:[f.data.latency_ms,"ms"]})]}):h.jsxs(h.Fragment,{children:[h.jsx(Ed,{className:"h-3.5 w-3.5 text-red-400"}),h.jsx("span",{className:"text-red-400",children:f.data.error})]})}),h.jsx("div",{className:"flex-1"}),h.jsxs(_e,{size:"sm",onClick:F,disabled:!H||c.isPending,className:"gap-1.5",children:[c.isPending&&h.jsx(qn,{className:"h-3.5 w-3.5 animate-spin"}),"Save"]})]}),r&&h.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(BR,{className:"h-3.5 w-3.5 text-on-surface-variant"}),h.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Scheduling"}),h.jsx(Ct,{variant:V?"secondary":"outline",className:"text-[10px] px-1.5 py-0",children:V?"active":"off"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface",children:"Auto-run"}),h.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant",children:"Automatically run this task on a schedule"})]}),h.jsx(fl,{checked:V,onCheckedChange:z=>{M(W=>({...W,enabled:z})),$(!0)}})]}),V&&h.jsxs("div",{className:"space-y-3 pl-0.5",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run every (seconds)"}),h.jsx(cn,{type:"number",min:10,value:B.intervalSeconds??"",onChange:z=>{const W=z.target.value;M(re=>({...re,intervalSeconds:W?Number(W):void 0})),$(!0)},placeholder:r.intervalSeconds!=null?String(r.intervalSeconds):"300"})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run in states"}),h.jsx("div",{className:"flex gap-2",children:Rne.map(z=>{const W=I.includes(z);return h.jsx("button",{onClick:()=>{const re=W?I.filter(ae=>ae!==z):[...I,z];M(ae=>({...ae,runIn:re.length>0?re:void 0})),$(!0)},className:`
835
+ rounded-md border px-3 py-1.5 font-sans text-xs font-medium transition-colors
836
+ ${W?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
837
+ `,children:Dne[z]},z)})})]})]})]}),a&&Object.keys(a).length>0&&h.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[h.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Parameters"}),Object.entries(a).map(([z,W])=>{const re=_[z],ae=re??W,ie=z.replace(/_/g," ").replace(/\b\w/g,ye=>ye.toUpperCase());return typeof W=="boolean"?h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),h.jsx(fl,{checked:ae,onCheckedChange:ye=>{P(ue=>({...ue,[z]:ye})),$(!0)}})]},z):h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-sm text-on-surface",children:ie}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(cn,{type:typeof W=="number"?"number":"text",value:re!=null?String(re):"",placeholder:String(W),onChange:ye=>{const ue=typeof W=="number"?ye.target.value===""?void 0:Number(ye.target.value):ye.target.value;P(ue===void 0?ee=>{const ne={...ee};return delete ne[z],ne}:ee=>({...ee,[z]:ue})),$(!0)},className:"w-40 font-mono"}),h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["default: ",String(W)]})]})]},z)})]}),t&&t.length>0&&h.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[h.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(z=>h.jsx(Ane,{phase:z,override:D[z.name]??{},taskModel:y||"claude-sonnet-4-6",providers:U,isLoadingProviders:l,onChange:W=>Q(z.name,W)},z.name))]})]})}const One=3;function Lne(e){var t,n,r;return{model:((t=e.execution)==null?void 0:t.model)??e.model,maxTurns:((n=e.execution)==null?void 0:n.maxTurns)??e.maxTurns,timeoutSeconds:((r=e.execution)==null?void 0:r.timeoutSeconds)??e.timeoutSeconds}}function _ne(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),h.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[h.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),h.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),h.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),h.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:One}).map((e,t)=>h.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function Bne({phase:e,index:t}){return h.jsxs(Qe,{level:"low",className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-container-high font-mono text-xs font-semibold text-on-surface-variant shrink-0",children:t+1}),h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&h.jsx(Ct,{variant:"secondary",children:"optional"})]}),h.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>h.jsx("span",{className:"font-mono text-xs px-1.5 py-0.5 rounded-sm bg-surface-container-high text-on-surface-variant",children:n},n))}),h.jsx(Qe,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:h.jsx(Ma,{content:e.prompt})})]})}function Pne({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=_q(e);if(i)return h.jsx(_ne,{});if(l||!(a!=null&&a.task))return h.jsxs("div",{className:"space-y-4",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Tasks"]}),h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=Lne(o);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Tasks"]}),h.jsxs(Qe,{level:"low",className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[h.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[h.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),h.jsx(Ct,{variant:GD(o.source),className:"shrink-0",children:$1(o.source??"built-in")})]}),h.jsx(bne,{task:o,onDeleted:t,onCustomized:d=>n==null?void 0:n(d),onRunTriggered:r})]}),h.jsx(Mne,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds},schedule:o.schedule,params:o.params}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&h.jsxs(Qe,{level:"low",className:"p-4 space-y-3",children:[h.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&h.jsxs("div",{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),h.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&h.jsxs("div",{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),h.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&h.jsxs("div",{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),h.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?h.jsxs("div",{className:"space-y-3",children:[h.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",h.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((d,p)=>h.jsx(Bne,{phase:d,index:p},d.name))]}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),h.jsx(Qe,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:h.jsx(Ma,{content:o.prompt??""})})]}),h.jsx(Sne,{taskId:e})]})}function W_(e,t){var n,r,a;return{summaryBatchInterval:String(((n=e.agent)==null?void 0:n.summary_batch_interval)??pb),defaultTask:t??"",scheduledTasksEnabled:((r=e.agent)==null?void 0:r.scheduled_tasks_enabled)??!0,eventTasksEnabled:((a=e.agent)==null?void 0:a.event_tasks_enabled)??!0}}function zne(e,t,n){const r=W_(t,n);return e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask||e.scheduledTasksEnabled!==r.scheduledTasksEnabled||e.eventTasksEnabled!==r.eventTasksEnabled}function TA({label:e,value:t,max:n,color:r}){const a=n>0?Math.round(t/n*100):0,i=2*Math.PI*36,l=i-a/100*i;return h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsxs("div",{className:"relative h-20 w-20",children:[h.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[h.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),h.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-700"})]}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),h.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Vi({label:e,value:t}){return h.jsxs("div",{className:"flex items-center justify-between py-1",children:[h.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),h.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function Ine({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[h.jsx(db,{className:"h-3.5 w-3.5"}),"System Health"]}),h.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[h.jsx(TA,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),h.jsx(TA,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[h.jsx(Vi,{label:"Sessions",value:String(e.vault.session_count)}),h.jsx(Vi,{label:"Spores",value:String(e.vault.spore_count)}),h.jsx(Vi,{label:"Entities",value:String(e.vault.entity_count)}),h.jsx(Vi,{label:"Graph edges",value:String(e.vault.edge_count)}),h.jsx(Vi,{label:"Uptime",value:V1(e.daemon.uptime_seconds)}),h.jsx(Vi,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&h.jsxs(h.Fragment,{children:[h.jsx(Vi,{label:"Last run",value:gi(e.agent.last_run_at)}),h.jsx(Vi,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&h.jsx(Vi,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function Fne(){var L;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=Ip(),{data:a,isLoading:i}=Dp(),{data:l,isLoading:o}=dc(),{restart:f}=M1(),[c,d]=j.useState(null),[p,m]=j.useState(null),[y,x]=j.useState("idle"),[b,S]=j.useState(""),w=(l==null?void 0:l.tasks)??[],N=((L=w.find(B=>B.isDefault))==null?void 0:L.name)??"",C=j.useRef(!1);e&&!o&&!C.current&&(C.current=!0,c===null&&d(W_(e,N)));const T=c&&e?zne(c,e,N):!1,R=j.useCallback((B,M)=>{d(_=>_&&{..._,[B]:M}),m(null)},[]),A=async()=>{if(!(!c||!e)){m(null);try{const B={...e,agent:{...e.agent,summary_batch_interval:Sb(c.summaryBatchInterval,pb),scheduled_tasks_enabled:c.scheduledTasksEnabled,event_tasks_enabled:c.eventTasksEnabled}};await n(B),m({type:"success",text:"Agent settings saved. Restarting daemon..."});try{await f()}catch{m({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{m({type:"error",text:"Failed to save settings."})}}},D=async()=>{if(e){x("testing"),S("");try{const B=new URLSearchParams({provider:e.embedding.provider,type:"embedding"});e.embedding.base_url&&B.set("base_url",e.embedding.base_url);const _=(await ot(`/models?${B.toString()}`)).models.length;x("success"),S(`Connected -- ${_} model${_!==1?"s":""} available.`)}catch(B){x("error"),S(B instanceof Error?B.message:"Connection failed.")}}};return t||!e||!c?h.jsx("div",{className:"space-y-4",children:[1,2,3].map(B=>h.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},B))}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[h.jsx(Bt,{children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Az,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Scheduled Tasks"}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Intelligence, skill survey, and skill evolution run automatically on a schedule"})]}),h.jsx(fl,{checked:c.scheduledTasksEnabled,onCheckedChange:B=>R("scheduledTasksEnabled",B)})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Event-Driven Tasks"}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Titles and summaries generated automatically after coding sessions"})]}),h.jsx(fl,{checked:c.eventTasksEnabled,onCheckedChange:B=>R("eventTasksEnabled",B)})]})]}),h.jsx("div",{className:"border-t border-outline-variant/20"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Title & Summary Batch Interval"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(cn,{type:"number",min:0,placeholder:String(pb),value:c.summaryBatchInterval,onChange:B=>R("summaryBatchInterval",B.target.value),className:"w-32 font-mono"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Run the Title & Summary task every N batches to keep active sessions properly titled. Set to 0 to disable."})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?h.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[h.jsx(qn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):h.jsxs(Zi,{value:c.defaultTask,onValueChange:B=>R("defaultTask",B),children:[h.jsx(vi,{children:h.jsx(Ji,{placeholder:"Select default task"})}),h.jsx(pi,{children:w.map(B=>h.jsx(ia,{value:B.name,children:B.displayName},B.name))})]}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when Run Now is clicked or no task is specified."})]}),h.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[h.jsxs(_e,{onClick:A,disabled:!T||r,size:"sm",children:[r?h.jsx(qn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),p&&h.jsx("span",{className:p.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:p.text})]})]}),h.jsxs(Qe,{level:"low",className:"p-6 space-y-4 border-t-2 border-t-ochre",children:[h.jsx(Bt,{children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(N1,{className:"h-4 w-4 text-secondary"}),"Embedding Configuration"]})}),h.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Provider"}),h.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5",children:e.embedding.provider})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),h.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.model,children:e.embedding.model})]}),e.embedding.base_url&&h.jsxs("div",{className:"col-span-2",children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),h.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.base_url,children:e.embedding.base_url})]})]}),h.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[h.jsxs(_e,{type:"button",variant:"ghost",size:"sm",onClick:D,disabled:y==="testing",children:[y==="testing"?h.jsx(qn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Test Connection"]}),h.jsxs("a",{href:"/settings",className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:[h.jsx(Cd,{className:"h-3 w-3"}),"Edit in Settings"]}),y==="success"&&h.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-primary",children:[h.jsx(_R,{className:"h-3.5 w-3.5"}),b]}),y==="error"&&h.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-tertiary",children:[h.jsx(Ed,{className:"h-3.5 w-3.5"}),b]})]})]}),i?h.jsx(Qe,{level:"low",className:"p-6",children:h.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?h.jsx(Qe,{level:"low",className:"p-6",children:h.jsx(Ine,{stats:a})}):null]})}const Z_="tab",J_="run",e5="task",qne=new Set(["runs","tasks","config"]);function jA(){const e=new URLSearchParams(window.location.search),t=e.get(Z_);return{tab:t&&qne.has(t)?t:"runs",runId:e.get(J_)??void 0,taskId:e.get(e5)??void 0}}function Une(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(Z_,e),t&&r.set(J_,t),n&&r.set(e5,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.pushState(null,"",i)}const Vne=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function Hne(){const e=jA(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.runId),[i,l]=j.useState(e.taskId),[o,f]=j.useState(!1),c=j.useRef(!1),d=j.useRef(!1);j.useEffect(()=>{if(!c.current){c.current=!0;return}if(d.current){d.current=!1;return}Une(t,r,i)},[t,r,i]),j.useEffect(()=>{function m(){d.current=!0;const y=jA();n(y.tab),a(y.runId),l(y.taskId)}return window.addEventListener("popstate",m),()=>window.removeEventListener("popstate",m)},[]);const p=j.useCallback(m=>{const y=m;n(y),y!=="runs"&&a(void 0),y!=="tasks"&&l(void 0)},[]);return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsx(yi,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:Vne,activeTab:t,onTabChange:p,actions:t==="runs"?h.jsxs(_e,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>f(!0),children:[h.jsx(Zu,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),t==="runs"&&(r?h.jsx(une,{runId:r,onBack:()=>a(void 0)}):h.jsx(ene,{onSelectRun:a,onTriggerRun:()=>f(!0)})),t==="tasks"&&(i?h.jsx(Pne,{taskId:i,onBack:()=>l(void 0),onNavigate:l,onRunTriggered:m=>{l(void 0),n("runs"),m&&a(m)}}):h.jsx(pne,{onSelect:l})),t==="config"&&h.jsx(Fne,{}),h.jsx(fne,{open:o,onOpenChange:f,onTriggered:()=>a(void 0)})]})}function t5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-candidates?${n}`:"/skill-candidates";return tn({queryKey:["skill-candidates",e],queryFn:({signal:a})=>ot(r,{signal:a})})}function $ne(){const e=Vn();return br({mutationFn:({id:t,...n})=>oc(`/skill-candidates/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-candidates"]})}})}function n5(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-records?${n}`:"/skill-records";return tn({queryKey:["skill-records",e],queryFn:({signal:a})=>ot(r,{signal:a})})}function Gne(e){return tn({queryKey:["skill-record",e],queryFn:({signal:t})=>ot(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function Kne(){const e=Vn();return br({mutationFn:t=>j1(`/skill-records/${encodeURIComponent(t)}`),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-records"]}),e.invalidateQueries({queryKey:["skill-record"]})}})}const Yne=[{key:"status",label:"Status",options:[{value:Jn,label:"All statuses"},{value:"identified",label:"Identified"},{value:"approved",label:"Approved"},{value:"generated",label:"Generated"},{value:"dismissed",label:"Dismissed"}]}];function Xne(e){const t=`${(e*100).toFixed(0)}%`;return e>=.85?{text:t,variant:"default"}:e>=.7?{text:t,variant:"secondary"}:{text:t,variant:"outline"}}function Qne(e){const t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Wne(e){switch(e){case"identified":return h.jsx(Ct,{variant:"outline",children:"Identified"});case"approved":return h.jsx(Ct,{variant:"secondary",children:"Approved"});case"generated":return h.jsx(Ct,{variant:"default",children:"Generated"});case"dismissed":return h.jsx(Ct,{variant:"outline",className:"opacity-50",children:"Dismissed"});default:return h.jsx(Ct,{variant:"outline",children:e})}}function Zne({candidate:e,onApprove:t,onDismiss:n,isApproving:r,isDismissing:a}){const i=Xne(e.confidence),l=e.status==="identified"||e.status==="approved";return h.jsxs(Qe,{level:"low",className:"p-5 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("h3",{className:"font-serif text-lg text-on-surface leading-tight",children:e.topic})}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[Wne(e.status),h.jsx(Ct,{variant:i.variant,children:i.text}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:Qne(e.created_at)})]})]}),h.jsx(Ma,{content:e.rationale,className:"text-sm text-on-surface-variant"}),l&&h.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.status==="identified"&&h.jsxs(h.Fragment,{children:[h.jsxs(_e,{size:"sm",variant:"default",onClick:t,disabled:r,children:[h.jsx(wd,{className:"h-3.5 w-3.5 mr-1.5"}),r?"Approving...":"Approve"]}),h.jsxs(_e,{size:"sm",variant:"ghost",onClick:n,disabled:a,className:"text-on-surface-variant",children:[h.jsx(Ed,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Dismissing...":"Dismiss"]})]}),e.status==="approved"&&h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"Awaiting generation"})]})]})}function Jne(){return h.jsxs(Qe,{level:"low",className:"p-5 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsx("div",{className:"h-5 w-64 rounded bg-surface-container-high animate-pulse"}),h.jsx("div",{className:"h-5 w-20 rounded bg-surface-container-high animate-pulse"})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("div",{className:"h-3 w-full rounded bg-surface-container-high animate-pulse"}),h.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high animate-pulse"})]}),h.jsx("div",{className:"h-8 w-32 rounded bg-surface-container-high animate-pulse"})]})}function ere(){const e=$ne(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Ad({initialFilters:{status:"identified"}}),c=f("status"),{data:d,isLoading:p,isError:m,error:y}=t5({status:c,limit:$r,offset:a}),x=(d==null?void 0:d.candidates)??[],b=(d==null?void 0:d.total)??0,S=j.useMemo(()=>{if(!n)return x;const T=n.toLowerCase();return x.filter(R=>R.topic.toLowerCase().includes(T)||R.rationale.toLowerCase().includes(T))},[x,n]);function w(T){e.mutate({id:T.id,status:"approved"})}function N(T){e.mutate({id:T.id,status:"dismissed"})}const C=h.jsx(jd,{searchPlaceholder:"Search candidates...",searchValue:t,onSearchChange:l,filters:Yne,filterValues:r,onFilterChange:o});return m?h.jsxs("div",{className:"space-y-3",children:[C,h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load candidates"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):p?h.jsxs("div",{className:"space-y-3",children:[C,Array.from({length:3}).map((T,R)=>h.jsx(Jne,{},R))]}):h.jsxs("div",{className:"space-y-3",children:[C,S.length===0?h.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant",children:[h.jsx(bz,{className:"h-10 w-10 opacity-20"}),b===0&&!c&&!n?h.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[h.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skill candidates discovered yet"}),h.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Candidates are procedural patterns discovered from your vault knowledge. Review and approve them here, then Myco generates full skills from them."}),h.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[h.jsxs("p",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",h.jsx(Ra,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically during idle periods and discovers candidates from session history, decisions, and gotchas."]}),h.jsxs("p",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",h.jsxs(Ra,{to:"/agent?tab=tasks&task=skill-survey",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[h.jsx(Cd,{className:"h-3 w-3"}),"Skill Survey"]})," ","from the Agent page to discover candidates on demand."]})]})]}):h.jsx("span",{className:"font-sans text-sm",children:"No matching candidates"})]}):h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:n?`${S.length} of ${b} candidate${b!==1?"s":""}`:`${b} candidate${b!==1?"s":""}`}),S.map(T=>{var R,A,D,L;return h.jsx(Zne,{candidate:T,onApprove:()=>w(T),onDismiss:()=>N(T),isApproving:e.isPending&&((R=e.variables)==null?void 0:R.id)===T.id&&((A=e.variables)==null?void 0:A.status)==="approved",isDismissing:e.isPending&&((D=e.variables)==null?void 0:D.id)===T.id&&((L=e.variables)==null?void 0:L.status)==="dismissed"},T.id)})]}),h.jsx(mc,{total:n?S.length:b,offset:a,limit:$r,onPageChange:i})]})}const tre=5,nre=[{key:"status",label:"Status",options:[{value:Jn,label:"All statuses"},{value:"active",label:"Active"},{value:"stale",label:"Stale"},{value:"retired",label:"Retired"}]}];function rre(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function Lf({children:e,className:t}){return h.jsx("th",{className:Te("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function are(){return h.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-12 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-10 rounded bg-surface-container-high animate-pulse"})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function ire({record:e,onClick:t}){return h.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Skill: ${e.display_name}`,children:[h.jsxs("td",{className:"px-4 py-3",children:[h.jsx("span",{className:"font-sans text-sm font-medium text-on-surface block",children:e.display_name}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant block mt-0.5",children:e.name})]}),h.jsx("td",{className:"px-4 py-3",children:h.jsxs(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["gen ",e.generation]})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ct,{variant:rre(e.status),children:e.status})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.usage_count})}),h.jsx("td",{className:"px-4 py-3",children:h.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:qp(e.updated_at)})})]})}function sre({onSelectSkill:e}){const{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Ad({initialFilters:{status:Jn}}),c=f("status"),{data:d,isLoading:p,isError:m,error:y}=n5({status:c,limit:$r,offset:a}),x=(d==null?void 0:d.records)??[],b=(d==null?void 0:d.total)??0,S=n?x.filter(C=>C.display_name.toLowerCase().includes(n.toLowerCase())||C.name.toLowerCase().includes(n.toLowerCase())||C.description.toLowerCase().includes(n.toLowerCase())):x,w=h.jsx(jd,{searchPlaceholder:"Search skills...",searchValue:t,onSearchChange:l,filters:nre,filterValues:r,onFilterChange:o}),N=h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[h.jsx(Lf,{children:"Name"}),h.jsx(Lf,{children:"Generation"}),h.jsx(Lf,{children:"Status"}),h.jsx(Lf,{children:"Usage"}),h.jsx(Lf,{children:"Last Evolved"})]})});return m?h.jsxs("div",{children:[w,h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Failed to load skills"}),h.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):h.jsxs("div",{children:[w,p?h.jsx(Qe,{level:"low",className:"rounded-md overflow-hidden mt-4",children:h.jsxs("table",{className:"w-full",children:[N,h.jsx("tbody",{children:Array.from({length:tre}).map((C,T)=>h.jsx(are,{},T))})]})}):S.length===0?h.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant mt-4",children:[h.jsx(iz,{className:"h-10 w-10 opacity-20"}),b===0&&!n&&!c?h.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[h.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skills generated yet"}),h.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in this codebase."}),h.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[h.jsxs("p",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",h.jsx(Ra,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically and discovers candidates from your vault. Approve candidates in the"," ",h.jsx(Ra,{to:"/skills?tab=candidates",className:"text-primary hover:underline",children:"Candidates tab"}),", then enable the"," ",h.jsx(Ra,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","task to produce skills automatically."]}),h.jsxs("p",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",h.jsx(Ra,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","from the Agent page to generate a skill on demand."]})]})]}):h.jsx("span",{className:"font-sans text-sm",children:"No matching skills"})]}):h.jsx(Qe,{level:"low",className:"rounded-md overflow-hidden mt-4",children:h.jsxs("table",{className:"w-full","aria-label":"Skills",children:[N,h.jsx("tbody",{children:S.map(C=>h.jsx(ire,{record:C,onClick:()=>e(C.name)},C.id))})]})}),h.jsx(mc,{total:b,offset:a,limit:$r,onPageChange:i})]})}const lre={created:"default",updated:"secondary",split:"warning",retired:"outline"};function ore({entry:e}){const[t,n]=j.useState(!1);return h.jsxs("div",{className:"relative pl-6",children:[h.jsx("div",{className:"absolute left-0 top-2 h-2.5 w-2.5 rounded-full border-2 border-outline-variant bg-surface-container"}),h.jsxs("button",{type:"button",className:"w-full text-left group cursor-pointer",onClick:()=>n(r=>!r),"aria-expanded":t,children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsxs(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["v",e.generation]}),h.jsx(Ct,{variant:lre[e.action]??"outline",children:e.action}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant ml-auto shrink-0",children:qp(e.created_at)}),h.jsx(ua,{className:Te("h-3.5 w-3.5 text-on-surface-variant transition-transform duration-150",t&&"rotate-90")})]}),e.rationale&&h.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-1 leading-relaxed",children:e.rationale})]}),t&&e.content_snapshot&&h.jsx(Qe,{level:"lowest",className:"mt-2 p-3 overflow-auto max-h-96",children:h.jsx("pre",{className:"font-mono text-xs text-on-surface whitespace-pre-wrap break-words",children:e.content_snapshot})})]})}function ure({entries:e}){return e.length===0?h.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No evolution history."}):h.jsxs("div",{className:"relative space-y-4",children:[h.jsx("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-outline-variant/30"}),e.map(t=>h.jsx(ore,{entry:t},t.id))]})}function cre(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function fre(e){if(!e)return 0;try{const t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function dre(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),h.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[h.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),h.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),h.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-surface-container-high"})]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:Array.from({length:3}).map((e,t)=>h.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-container-high"},t))})]})}function hre({skillName:e,onBack:t}){var m,y;const{data:n,isPending:r,isError:a}=Gne(e),i=Kne(),[l,o]=j.useState(!1);if(r)return h.jsx(dre,{});if(a||!n)return h.jsxs("div",{className:"space-y-4",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Skills"]}),h.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-5 w-5"}),h.jsx("span",{className:"font-sans text-sm",children:"Skill not found"})]})]});const f=fre(n.source_ids),c=((y=(m=n.lineage)==null?void 0:m[0])==null?void 0:y.content_snapshot)??null,d=n.frontmatter??{},p=(c==null?void 0:c.replace(/^---\n[\s\S]*?\n---\n*/,""))??null;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[h.jsx(di,{className:"h-4 w-4"}),"Skills"]}),h.jsxs(_e,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>o(!0),children:[h.jsx(dl,{className:"h-4 w-4"}),"Delete"]})]}),h.jsx(Qe,{level:"low",className:"p-4 space-y-3",children:h.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[h.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[h.jsx("h1",{className:"font-serif text-lg text-on-surface",children:n.display_name}),n.description&&h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:n.description}),n.path&&h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant mt-1",children:n.path}),Object.keys(d).length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[d["user-invocable"]==="true"&&h.jsx(Ct,{variant:"secondary",children:"user-invocable"}),d["allowed-tools"]&&h.jsxs(Ct,{variant:"outline",children:["tools: ",d["allowed-tools"]]})]})]}),h.jsx(Ct,{variant:cre(n.status),className:"shrink-0",children:n.status})]})}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsx(sn,{label:"Generation",value:`v${n.generation}`,accent:"sage"}),h.jsx(sn,{label:"Usage",value:`${n.usage_total??n.usage_count??0}`,sublabel:"sessions",accent:"ochre"}),h.jsx(sn,{label:"Sources",value:`${f}`,accent:"outline"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(Bt,{children:"Evolution History"}),h.jsx(ure,{entries:n.lineage??[]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(Bt,{children:"Current Content"}),p?h.jsx(Ma,{content:p}):h.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No content snapshot available."})]}),h.jsx(W1,{open:l,onOpenChange:o,title:"Delete Skill",description:"This will permanently delete the skill record, evolution history, and the SKILL.md file from disk.",icon:h.jsx(dl,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"Name",value:n.name},{label:"Title",value:n.display_name}]:[],confirmLabel:"Delete Skill",variant:"destructive",onConfirm:()=>{i.mutate(n.name,{onSuccess:()=>{o(!1),t()}})},isPending:i.isPending})]})}const r5="tab",a5="skill",vre=new Set(["candidates","skills"]);function pre(){const e=new URLSearchParams(window.location.search),t=e.get(r5);return{tab:t&&vre.has(t)?t:"skills",skill:e.get(a5)??void 0}}function mre(e,t){const n=new URLSearchParams;e!=="skills"&&n.set(r5,e),t&&n.set(a5,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}const gre=[{id:"skills",label:"Skills"},{id:"candidates",label:"Candidates"}];function yre(){return h.jsxs(Nd,{children:[h.jsx(oF,{asChild:!0,children:h.jsx(_e,{variant:"ghost",size:"sm",className:"text-on-surface-variant",children:h.jsx(lz,{className:"h-4 w-4"})})}),h.jsxs(cc,{className:"max-w-lg",children:[h.jsxs(kd,{children:[h.jsx(fc,{children:"How Skills Work"}),h.jsx(zp,{children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in your codebase."})]}),h.jsxs("div",{className:"space-y-4 font-sans text-sm text-on-surface-variant",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("h4",{className:"font-medium text-on-surface",children:"The Pipeline"}),h.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[h.jsxs("li",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Survey"})," — discovers candidate skills from vault knowledge (sessions, decisions, gotchas)"]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Approve"})," — you review candidates and approve the ones worth generating"]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Generate"})," — produces a SKILL.md file from the approved candidate's source material"]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Evolve"})," — updates existing skills when new knowledge makes them stale"]})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("h4",{className:"font-medium text-on-surface",children:"Scheduling"}),h.jsxs("p",{children:[h.jsx("span",{className:"font-medium text-on-surface",children:"Skill Survey"})," runs automatically during idle periods. Skill Generate and Skill Evolve are off by default — enable them in the"," ",h.jsxs(Ra,{to:"/agent?tab=tasks",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Agent Tasks",h.jsx(Cd,{className:"h-3 w-3"})]})," ","page for fully automatic operation, or trigger them manually with Run Now."]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("h4",{className:"font-medium text-on-surface",children:"Quick Start"}),h.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[h.jsx("li",{children:"Wait for the survey to discover candidates (or run it manually)"}),h.jsx("li",{children:"Review candidates in the Candidates tab and approve the best ones"}),h.jsxs("li",{children:["Run"," ",h.jsx(Ra,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","to produce skills from approved candidates"]})]})]})]})]})]})}function xre(){const e=pre(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.skill),{data:i}=t5({status:"identified"}),{data:l}=n5({status:"active"}),o=(i==null?void 0:i.total)??0,f=(l==null?void 0:l.total)??0;j.useEffect(()=>{mre(t,r)},[t,r]);const c=j.useCallback(p=>{const m=p;n(m),m!=="skills"&&a(void 0)},[]),d=j.useCallback(p=>{n("skills"),a(p)},[]);return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsx(yi,{title:"Skills",subtitle:"Discovered skill candidates and promoted skill records",tabs:gre,activeTab:t,onTabChange:c,actions:h.jsxs("div",{className:"flex items-center gap-2",children:[o>0&&h.jsxs(Ct,{variant:"secondary",children:[o," pending"]}),f>0&&h.jsxs(Ct,{variant:"default",children:[f," active"]}),h.jsx(yre,{})]})}),t==="candidates"&&h.jsx(ere,{}),t==="skills"&&!r&&h.jsx(sre,{onSelectSkill:d}),t==="skills"&&r&&h.jsx(hre,{skillName:r,onBack:()=>a(void 0)})]})}function bre(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(""),[f,c]=j.useState(!1),[d,p]=j.useState(null),[m,y]=j.useState(!0);j.useEffect(()=>{ot("/config/plan-dirs").then(T=>{t(T.symbiont),r(T.custom),i(T.custom)}).catch(()=>{}).finally(()=>y(!1))},[]);const x=n.length!==a.length||n.some((T,R)=>T!==a[R]),b=j.useCallback(()=>{const T=l.trim();!T||n.includes(T)||(r(R=>[...R,T]),o(""),p(null))},[l,n]),S=j.useCallback(T=>{r(R=>R.filter(A=>A!==T)),p(null)},[]),w=j.useCallback(async()=>{c(!0),p(null);try{const T=await kn("/config/plan-dirs",{plan_dirs:n});i(T.custom),r(T.custom),p({type:"success",text:"Plan directories saved."})}catch{p({type:"error",text:"Failed to save plan directories."})}finally{c(!1)}},[n]),N=j.useCallback(T=>{T.key==="Enter"&&b()},[b]),C=Object.entries(e);return h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[h.jsx(Bt,{children:"Plan Capture"}),m?h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),C.length===0?h.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):h.jsx("div",{className:"space-y-3",children:C.map(([T,R])=>h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:T}),h.jsx("div",{className:"space-y-1",children:R.map(A=>h.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:A},A))})]},T))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),n.length>0&&h.jsx("div",{className:"space-y-1",children:n.map(T=>h.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[h.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:T}),h.jsx("button",{type:"button",onClick:()=>S(T),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${T}`,children:"x"})]},T))}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(cn,{placeholder:"/path/to/plans",value:l,onChange:T=>o(T.target.value),onKeyDown:N,className:"flex-1 font-mono text-xs"}),h.jsx(_e,{type:"button",size:"sm",onClick:b,disabled:!l.trim(),children:"Add"})]})]}),x&&h.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[h.jsx(_e,{onClick:w,disabled:f,size:"sm",children:f?"Saving...":"Save"}),d&&h.jsx("span",{className:d.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:d.text})]}),!x&&(d==null?void 0:d.type)==="success"&&h.jsx("p",{className:"font-sans text-sm text-primary",children:d.text})]})]})}function Mv({children:e,hint:t}){return h.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&h.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Y0({children:e}){return h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function wre(){var y,x,b,S;const{config:e,saveConfig:t,isSaving:n}=Ip(),{data:r}=TF(),[a,i]=j.useState(null),[l,o]=j.useState(null);j.useEffect(()=>{var w,N,C,T;e&&!a&&i({enabled:((w=e.notifications)==null?void 0:w.enabled)??!0,system_notifications:((N=e.notifications)==null?void 0:N.system_notifications)??!1,default_mode:((C=e.notifications)==null?void 0:C.default_mode)??"banner",domains:((T=e.notifications)==null?void 0:T.domains)??{}})},[e,a]);const f=j.useCallback((w,N)=>{i(C=>C&&{...C,[w]:N}),o(null)},[]),c=j.useCallback((w,N)=>{i(C=>{if(!C)return C;const T=C.domains[w]??{enabled:!0};return{...C,domains:{...C.domains,[w]:{...T,...N}}}}),o(null)},[]),d=j.useCallback(async()=>{if(!(!a||!e)){o(null);try{await t({...e,notifications:a}),o({type:"success",text:"Notification settings saved."})}catch{o({type:"error",text:"Failed to save notification settings."})}}},[a,e,t]);if(!a||!e)return null;const p=(r==null?void 0:r.domains)??[],m=e?a.enabled!==(((y=e.notifications)==null?void 0:y.enabled)??!0)||a.system_notifications!==(((x=e.notifications)==null?void 0:x.system_notifications)??!1)||a.default_mode!==(((b=e.notifications)==null?void 0:b.default_mode)??"banner")||JSON.stringify(a.domains)!==JSON.stringify(((S=e.notifications)==null?void 0:S.domains)??{}):!1;return h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[h.jsx(Bt,{children:"Notifications"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx(Mv,{children:"Enabled"}),h.jsx(Y0,{children:"Master switch for all notification types."})]}),h.jsx(fl,{checked:a.enabled,onCheckedChange:w=>f("enabled",w)})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx(Mv,{children:"System Notifications"}),h.jsx(Y0,{children:"Show browser notifications when the tab is not focused."})]}),h.jsx(fl,{checked:a.system_notifications,onCheckedChange:w=>f("system_notifications",w),disabled:!a.enabled})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(Mv,{children:"Default Mode"}),h.jsxs(Zi,{value:a.default_mode,onValueChange:w=>f("default_mode",w),disabled:!a.enabled,children:[h.jsx(vi,{className:"w-40",children:h.jsx(Ji,{})}),h.jsxs(pi,{children:[h.jsx(ia,{value:"banner",children:"Banner"}),h.jsx(ia,{value:"summary",children:"Summary"})]})]}),h.jsx(Y0,{children:"Banner shows as a pop-up overlay. Summary shows only in the notification panel."})]}),p.length>0&&h.jsxs("div",{className:"space-y-3 pt-2",children:[h.jsx(Mv,{children:"Domain Notifications"}),h.jsx("div",{className:"space-y-3",children:p.map(w=>{const N=a.domains[w.domain]??{enabled:!0},C=N.enabled;return h.jsxs("div",{className:"flex items-center justify-between gap-3 py-1",children:[h.jsxs("div",{className:"space-y-0.5 flex-1 min-w-0",children:[h.jsx("span",{className:"text-sm text-on-surface",children:w.label}),h.jsx("p",{className:"text-[11px] text-on-surface-variant",children:w.types.map(T=>T.label).join(", ")})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h.jsxs(Zi,{value:N.mode??"default",onValueChange:T=>c(w.domain,{mode:T==="default"?void 0:T}),disabled:!a.enabled||!C,children:[h.jsx(vi,{className:"w-[110px] h-8 text-xs",children:h.jsx(Ji,{})}),h.jsxs(pi,{children:[h.jsx(ia,{value:"default",children:"Default"}),h.jsx(ia,{value:"banner",children:"Banner"}),h.jsx(ia,{value:"summary",children:"Summary"})]})]}),h.jsx(fl,{checked:C,onCheckedChange:T=>c(w.domain,{enabled:T}),disabled:!a.enabled})]})]},w.domain)})})]})]}),h.jsxs("div",{className:"flex items-center gap-4 pt-2",children:[h.jsxs(_e,{onClick:d,disabled:!m||n,size:"sm",children:[n?h.jsx(qn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Notifications"]}),l&&h.jsx("span",{className:l.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:l.text})]})]})}const Sre=["debug","info","warn","error"],Ere=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],Cre=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function i5(e){var t,n,r;return{daemonPort:e.daemon.port!=null?String(e.daemon.port):"",logLevel:e.daemon.log_level,logRetentionDays:String(e.daemon.log_retention_days),embeddingProvider:e.embedding.provider,embeddingModel:e.embedding.model,embeddingBaseUrl:e.embedding.base_url??"",contextDigestTier:String(((t=e.context)==null?void 0:t.digest_tier)??HR),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??$R)}}function Nre(e,t){return{...t,daemon:{...t.daemon,port:e.daemonPort!==""?Number(e.daemonPort):null,log_level:e.logLevel,log_retention_days:Number(e.logRetentionDays)},embedding:{...t.embedding,provider:e.embeddingProvider,model:e.embeddingModel,base_url:e.embeddingBaseUrl!==""?e.embeddingBaseUrl:void 0},agent:t.agent,context:{...t.context,digest_tier:Sb(e.contextDigestTier,HR),prompt_search:e.contextPromptSearch,prompt_max_spores:Sb(e.contextMaxSpores,$R)}}}function kre(e,t){const n=i5(t);return e.daemonPort!==n.daemonPort||e.logLevel!==n.logLevel||e.logRetentionDays!==n.logRetentionDays||e.embeddingProvider!==n.embeddingProvider||e.embeddingModel!==n.embeddingModel||e.embeddingBaseUrl!==n.embeddingBaseUrl||e.contextDigestTier!==n.contextDigestTier||e.contextPromptSearch!==n.contextPromptSearch||e.contextMaxSpores!==n.contextMaxSpores}function ni({children:e,hint:t}){return h.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&h.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Ov({children:e}){return h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Tre(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=Ip(),{data:a}=Dp(),{restart:i}=M1(),l=j.useRef(!1),[o,f]=j.useState(null);e&&!l.current&&(l.current=!0,o===null&&f(i5(e)));const[c,d]=j.useState(null),[p,m]=j.useState("idle"),[y,x]=j.useState(""),b=o&&e?kre(o,e):!1,S=j.useCallback((T,R)=>{f(A=>A&&{...A,[T]:R}),d(null)},[]),w=j.useCallback(async()=>{if(!(!o||!e)){d(null);try{await n(Nre(o,e)),d({type:"success",text:"Settings saved. Restarting daemon..."});try{await i()}catch{d({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{d({type:"error",text:"Failed to save settings."})}}},[o,e,n,i]),N=j.useCallback(async()=>{if(o){m("testing"),x("");try{const T=new URLSearchParams({provider:o.embeddingProvider,type:"embedding"});o.embeddingBaseUrl&&T.set("base_url",o.embeddingBaseUrl);const A=(await ot(`/models?${T.toString()}`)).models.length;m("success"),x(`Connected -- ${A} model${A!==1?"s":""} available.`)}catch(T){m("error"),x(T instanceof Error?T.message:"Connection failed.")}}},[o]);if(t||!o||!e)return h.jsxs("div",{className:"p-6",children:[h.jsx(yi,{title:"Settings"}),h.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-2",children:"Loading..."})]});const C=(a==null?void 0:a.vault.name)??e.embedding.provider;return h.jsxs("div",{className:"p-6",children:[h.jsx(yi,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[h.jsx(Bt,{children:"Project"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Vault Name"}),h.jsx(cn,{value:C,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Daemon Port"}),h.jsx(cn,{type:"number",placeholder:"Auto",value:o.daemonPort,onChange:T=>S("daemonPort",T.target.value)}),h.jsx(Ov,{children:"Leave blank to use a random available port."})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Log Level"}),h.jsxs(Zi,{value:o.logLevel,onValueChange:T=>S("logLevel",T),children:[h.jsx(vi,{children:h.jsx(Ji,{})}),h.jsx(pi,{children:Sre.map(T=>h.jsx(ia,{value:T,children:T},T))})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Log Retention (days)"}),h.jsx(cn,{type:"number",min:1,max:365,className:"w-24",value:o.logRetentionDays,onChange:T=>S("logRetentionDays",T.target.value)})]})]})]}),h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre h-fit",children:[h.jsx(Bt,{children:"Embedding"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Provider"}),h.jsxs(Zi,{value:o.embeddingProvider,onValueChange:T=>{S("embeddingProvider",T),m("idle"),x("")},children:[h.jsx(vi,{children:h.jsx(Ji,{})}),h.jsx(pi,{children:Ere.map(T=>h.jsx(ia,{value:T.value,children:T.label},T.value))})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Model"}),h.jsx(cn,{placeholder:"bge-m3",value:o.embeddingModel,onChange:T=>S("embeddingModel",T.target.value)})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{hint:"optional",children:"Base URL"}),h.jsx(cn,{type:"url",placeholder:"http://localhost:11434",value:o.embeddingBaseUrl,onChange:T=>{S("embeddingBaseUrl",T.target.value),m("idle"),x("")}})]}),h.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[h.jsxs(_e,{type:"button",variant:"ghost",size:"sm",onClick:N,disabled:p==="testing",children:[p==="testing"?h.jsx(qn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),p==="success"&&h.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[h.jsx(_R,{className:"h-4 w-4"}),y]}),p==="error"&&h.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[h.jsx(Ed,{className:"h-4 w-4"}),y]})]})]})]})]}),h.jsxs(Qe,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[h.jsx(Bt,{children:"Context Injection"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Digest Tier"}),h.jsxs(Zi,{value:o.contextDigestTier,onValueChange:T=>S("contextDigestTier",T),children:[h.jsx(vi,{children:h.jsx(Ji,{})}),h.jsx(pi,{children:Cre.map(T=>h.jsx(ia,{value:T.value,children:T.label},T.value))})]}),h.jsx(Ov,{children:"Token budget for digest context injected at session start."})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx(ni,{children:"Prompt Search"}),h.jsx(Ov,{children:"Search vault for relevant observations on each prompt."})]}),h.jsx(fl,{checked:o.contextPromptSearch,onCheckedChange:T=>S("contextPromptSearch",T)})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(ni,{children:"Max Spores per Prompt"}),h.jsx(cn,{type:"number",min:"0",max:"10",placeholder:"3",value:o.contextMaxSpores,onChange:T=>S("contextMaxSpores",T.target.value)}),h.jsx(Ov,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]})]}),h.jsx(wre,{}),h.jsx(bre,{}),h.jsxs(Qe,{level:"low",className:"p-4 flex items-center gap-4 border-t-2 border-t-sage",children:[h.jsxs(_e,{onClick:w,disabled:!b||r,children:[r?h.jsx(qn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Settings"]}),c&&h.jsx("span",{className:c.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:c.text})]})]})]})}function jre(){return ca({queryKey:["embedding-details"],queryFn:({signal:e})=>ot("/embedding/details",{signal:e}),refetchInterval:Rr.STATS,pollCategory:"standard"})}const Lv=1024;function AA(e){if(e<Lv)return`${e} B`;const t=e/Lv;return t<Lv?`${t.toFixed(1)} KB`:`${(t/Lv).toFixed(1)} MB`}function Are(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Rre(){const[e,t]=j.useState([]),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(null),[d,p]=j.useState(""),[m,y]=j.useState(!1);j.useEffect(()=>{ot("/backup/config").then(C=>{p(C.dir??"")}).catch(()=>{})},[]);const x=j.useCallback(async()=>{y(!0);try{await oc("/backup/config",{dir:d||null}),o({type:"success",text:d?"Backup directory updated. Restart daemon to apply.":"Backup directory reset to default. Restart daemon to apply."})}catch{o({type:"error",text:"Failed to save backup directory."})}finally{y(!1)}},[d]),b=j.useCallback(async()=>{try{const C=await ot("/backups");t(C.backups),r(!0)}catch(C){o({type:"error",text:`Failed to load backups: ${C.message}`})}},[]);!n&&!a&&(i(!0),b().finally(()=>i(!1)));async function S(){o(null),c(null);try{const C=await kn("/backup");o({type:"success",text:`Backup created: ${C.machine_id} (${AA(C.size_bytes)})`}),await b()}catch(C){o({type:"error",text:`Backup failed: ${C.message}`})}}async function w(C){o(null),c(null);try{const T=await kn("/restore/preview",{machine_id:C});c(T)}catch(T){o({type:"error",text:`Preview failed: ${T.message}`})}}async function N(C){o(null),c(null);try{const T=await kn("/restore",{machine_id:C});o({type:"success",text:`Restored ${T.total_restored} records, skipped ${T.total_skipped} duplicates`})}catch(T){o({type:"error",text:`Restore failed: ${T.message}`})}}return h.jsxs(Qe,{level:"low",className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(gz,{className:"h-4 w-4 text-primary"}),h.jsx(Bt,{children:"Backup & Restore"})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:b,children:[h.jsx(vo,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),h.jsxs(_e,{variant:"default",size:"sm",onClick:S,children:[h.jsx(cz,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[h.jsx(mz,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:d,onChange:C=>p(C.target.value),placeholder:".myco/backups",className:"flex-1 bg-surface-container text-on-surface font-mono text-sm rounded px-3 py-1.5 outline-none border border-outline-variant/15 focus:border-primary/40 placeholder:text-on-surface-variant/50"}),h.jsx(_e,{variant:"ghost",size:"sm",onClick:x,disabled:m,children:m?"Saving...":"Save"})]}),h.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Override where backups are stored. Leave empty for default (.myco/backups). Supports ~ for home directory. Useful for network shares or git-tracked directories."})]}),l&&h.jsx("p",{className:Te("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?h.jsx("div",{className:"space-y-2",children:e.map(C=>h.jsxs("div",{className:Te("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:C.machine_id}),h.jsx(Ct,{variant:"secondary",children:AA(C.size_bytes)}),h.jsx("span",{className:"text-xs text-on-surface-variant",children:Are(C.modified_at)})]}),h.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[h.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>w(C.machine_id),children:"Preview"}),h.jsxs(_e,{variant:"secondary",size:"sm",onClick:()=>N(C.machine_id),children:[h.jsx(Bz,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},C.machine_id))}):n?h.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&h.jsxs(Qe,{level:"lowest",className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Bt,{children:"Restore Preview"}),h.jsx(Ct,{variant:"outline",children:f.machine_id})]}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"text-left text-on-surface-variant",children:[h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),h.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),h.jsx("tbody",{children:f.tables.map((C,T)=>h.jsxs("tr",{className:Te("transition-colors hover:bg-surface-container-high/50",T%2===1?"bg-surface-container-low/30":""),children:[h.jsx("td",{className:"py-2 pr-4",children:C.table}),h.jsx("td",{className:"py-2 pr-4 text-right",children:C.new>0?h.jsx("span",{className:"text-primary",children:C.new}):0}),h.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:C.existing})]},C.table))})]})}),h.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[h.jsxs("span",{children:["New: ",h.jsx("strong",{className:"text-primary",children:f.total_new})]}),h.jsxs("span",{children:["Existing: ",h.jsx("strong",{children:f.total_existing})]})]})]})]})}const Dre=["stable","beta"],RA=500,Mre=6e4;function Ore(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}function Lre(){const{data:e}=KR(),t=Yz(),n=Xz(),r=Qz(),[a,i]=j.useState("idle"),[l,o]=j.useState(null),f=j.useCallback(async()=>{i("applying"),o(null);try{await n.mutateAsync(),i("restarting");const b=Date.now()+Mre;await new Promise((S,w)=>{const N=async()=>{if(Date.now()>b){w(new Error("timeout"));return}try{if((await fetch("/health")).ok){S();return}}catch{}setTimeout(N,RA)};setTimeout(N,RA)}),window.location.reload()}catch(b){i("error");const S=b.message==="timeout"?"Daemon did not restart within the expected time. Check the terminal.":b.message;o(S)}},[n]),c=j.useCallback(()=>{t.mutate()},[t]),d=j.useCallback(b=>{r.mutate(b)},[r]);if(!e)return null;const p=t.isPending,m=a==="applying"||a==="restarting",y=e.update_available===!0,x=e.channel??"stable";return e.exempt?h.jsxs(Qe,{level:"low",className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Dz,{className:"h-4 w-4 text-primary"}),h.jsx(Bt,{children:"Updates"})]}),h.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Updates are disabled in development mode."," ",h.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version})]})]}):h.jsxs(Qe,{level:"low",className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(vb,{className:Te("h-4 w-4",y?"text-secondary":"text-primary")}),h.jsx(Bt,{children:"Updates"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version}),y&&e.latest_version&&h.jsx(Ct,{variant:"warning",children:e.latest_version})]})]}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[y?h.jsx(_e,{variant:"default",size:"sm",onClick:f,disabled:m,children:m?h.jsxs(h.Fragment,{children:[h.jsx(vo,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),a==="restarting"?"Restarting…":"Updating…"]}):h.jsxs(h.Fragment,{children:[h.jsx(vb,{className:"mr-1.5 h-3.5 w-3.5"}),"Update & Restart"]})}):h.jsxs("div",{className:"flex items-center gap-1.5 text-primary",children:[h.jsx(Sd,{className:"h-4 w-4"}),h.jsx("span",{className:"font-sans text-sm",children:"Up to date"})]}),h.jsxs(_e,{variant:"ghost",size:"sm",onClick:c,disabled:p||m,children:[h.jsx(vo,{className:Te("mr-1.5 h-3.5 w-3.5",p&&"animate-spin")}),"Check Now"]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-1",children:Dre.map(b=>h.jsx(_e,{variant:x===b?"default":"ghost",className:"text-xs capitalize h-6 px-2",onClick:()=>d(b),disabled:r.isPending||m,children:b},b))}),h.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Checked: ",Ore(e.last_check)]})]}),(a==="error"||e.error)&&h.jsxs("div",{className:"flex items-start gap-2 text-tertiary",children:[h.jsx(Ar,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),h.jsx("span",{className:"font-sans text-sm",children:l??e.error})]})]})}const _re=["sessions","spores","plans","artifacts"],DA="embedding",Bre=100,MA=2e3,Pre=40,OA=20,zre=[{id:"embedding",label:"Embedding"},{id:"system",label:"System"}],Ire=new Set(["embedding","system"]),s5="tab";function Fre(){const t=new URLSearchParams(window.location.search).get(s5);return t&&Ire.has(t)?t:"embedding"}function qre(e){const t=new URLSearchParams;e!=="embedding"&&t.set(s5,e);const n=t.toString(),r=n?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",r)}function Ure(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function Vre(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function Hre(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${a}`}function $re(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Pre}function Gre({data:e}){return h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"text-left text-on-surface-variant",children:[h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),h.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),h.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),h.jsx("tbody",{children:_re.map((t,n)=>{const r=e.by_namespace[t],a=(r==null?void 0:r.embedded)??0,i=(r==null?void 0:r.stale)??0,l=e.pending[t]??0,o=a+l;return h.jsxs("tr",{className:Te("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[h.jsx("td",{className:"py-2.5 pr-4",children:t}),h.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),h.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?h.jsx("span",{className:"text-secondary",children:l}):l}),h.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?h.jsx("span",{className:"text-tertiary",children:i}):i}),h.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function Kre({entry:e}){return h.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[h.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:Hre(e.timestamp)}),h.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:h.jsx("div",{className:Te("h-2 w-2 rounded-full mt-1",R1(e.level))})}),h.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:h.jsx(Ct,{variant:GR(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),h.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}function Yre({data:e}){const t=Vn(),[n,r]=j.useState(null),[a,i]=j.useState([]);j.useEffect(()=>{i(_=>{const P=[..._,e.total];return P.length>OA?P.slice(-OA):P})},[e]);const[l,o]=j.useState([]),[f,c]=j.useState(void 0),[d,p]=j.useState(!0),[m,y]=j.useState(!1),x=j.useRef(null),b=j.useRef(d);b.current=d;const S=j.useRef(f);S.current=f;const{data:w}=ca({queryKey:["embedding-logs"],queryFn:({signal:_})=>{const P=new URLSearchParams({limit:String(Bre),category:DA});return S.current&&P.set("since",S.current),ot(`/logs?${P.toString()}`,{signal:_})},refetchInterval:Rr.LOGS,pollCategory:"standard"});j.useEffect(()=>{w!=null&&w.entries.length&&(o(_=>{let P;if(w.cursor_reset){const H=new Set(_.map(V=>`${V.timestamp}|${V.message}`)),$=w.entries.filter(V=>!H.has(`${V.timestamp}|${V.message}`));P=$.length?[..._,...$]:_}else P=[..._,...w.entries];return P.length>MA?P.slice(-MA):P}),c(w.cursor),b.current||y(!0))},[w]),j.useEffect(()=>{!d||!x.current||(x.current.scrollTop=x.current.scrollHeight,y(!1))},[l,d]);const N=j.useCallback(()=>{const _=x.current;_&&($re(_)?(p(!0),y(!1)):p(!1))},[]),C=j.useCallback(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight,p(!0),y(!1))},[]),T=j.useMemo(()=>{const _=np.debug;return l.filter(P=>!(np[P.level]<_||P.category!==DA))},[l]);async function R(){r(null);try{const _=await kn("/embedding/reembed-stale");r({type:"success",text:`Re-embedded ${_.reembedded} stale vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}async function A(){if(confirm("This will re-embed all vectors. Continue?")){r(null);try{const _=await kn("/embedding/rebuild");r({type:"success",text:`Rebuild queued: ${_.queued} vectors to re-embed`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}}async function D(){r(null);try{const _=await kn("/embedding/clean-orphans");r({type:"success",text:`Cleaned ${_.orphans_cleaned} orphan vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}async function L(){r(null);try{const _=await kn("/embedding/reconcile");r({type:"success",text:`Reconcile complete: ${_.embedded} embedded, ${_.orphans_cleaned} orphans cleaned (${_.duration_ms}ms)`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}const B=Object.values(e.pending).reduce((_,P)=>_+P,0),M=Object.values(e.by_namespace).reduce((_,P)=>_+P.stale,0);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(N1,{className:"h-4 w-4 text-primary"}),h.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),h.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-on-surface-variant",children:"Model"}),h.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:Te("h-2 w-2 rounded-full",Vre(e))}),h.jsx("span",{className:"text-on-surface-variant capitalize",children:Ure(e)})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[h.jsx(sn,{label:"Total Vectors",value:String(e.total),sparklineData:a,accent:"sage"}),h.jsx(sn,{label:"Pending",value:String(B),accent:B>0?"ochre":"outline"}),h.jsx(sn,{label:"Stale",value:String(M),accent:M>0?"terracotta":"outline"})]}),h.jsxs(Qe,{level:"low",className:"p-6 space-y-4",children:[h.jsx(Bt,{children:"Namespace Breakdown"}),h.jsx(Gre,{data:e})]}),h.jsxs(Qe,{level:"low",className:"p-6 space-y-3",children:[h.jsx(Bt,{children:"Actions"}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(_e,{variant:"ghost",size:"sm",onClick:R,children:[h.jsx(vo,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),h.jsxs(_e,{variant:"ghost",size:"sm",onClick:D,children:[h.jsx(dl,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),h.jsxs(_e,{variant:"secondary",size:"sm",onClick:L,children:[h.jsx(Zu,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),h.jsxs(_e,{variant:"destructive",size:"sm",onClick:A,children:[h.jsx(k1,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),n&&h.jsx("p",{className:Te("font-sans text-sm",n.type==="success"?"text-primary":"text-tertiary"),children:n.text})]}),h.jsxs(Qe,{level:"low",className:"flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[h.jsx(Bt,{children:"Activity Log"}),h.jsxs(_e,{size:"sm",variant:d?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{d?p(!1):C()},title:d?"Pause auto-scroll":"Resume auto-scroll",children:[d?h.jsx(kz,{className:"h-3 w-3"}):h.jsx(Zu,{className:"h-3 w-3"}),d?"Pause":"Resume"]})]}),h.jsxs("div",{className:"relative flex-1 p-0",children:[h.jsx("div",{ref:x,onScroll:N,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:T.length===0?h.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):h.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:h.jsx("tbody",{children:T.map((_,P)=>h.jsx(Kre,{entry:_},`${_.timestamp}-${P}`))})})}),m&&!d&&h.jsxs("button",{type:"button",onClick:C,className:Te("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[h.jsx(az,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}function Xre(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Lre,{}),h.jsx(Rre,{})]})}const Qre={embedding:"Embedding health, maintenance actions, and activity log",system:"Software updates and backup management"};function Wre(){const{data:e,isLoading:t,isError:n,error:r}=jre(),[a,i]=j.useState(Fre),l=j.useCallback(o=>{const f=o;i(f),qre(f)},[]);return h.jsx(U1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading operations...",children:e&&h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx("div",{className:"px-6 pt-6",children:h.jsx(yi,{title:"Operations",subtitle:Qre[a],tabs:zre,activeTab:a,onTabChange:l})}),h.jsx("div",{className:"flex-1 overflow-auto",children:h.jsxs("div",{className:"px-6 pb-6",children:[a==="embedding"&&h.jsx(Yre,{data:e}),a==="system"&&h.jsx(Xre,{})]})})]})})}function Zre(){return ca({queryKey:["team-status"],queryFn:({signal:e})=>ot("/team/status",{signal:e}),refetchInterval:Rr.STATS,pollCategory:"standard"})}function X0({label:e,value:t,mono:n=!0}){const[r,a]=j.useState(!1),i=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[t]);return h.jsxs("div",{className:"space-y-1",children:[h.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),h.jsxs("div",{className:"flex items-center gap-2 group",children:[h.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),h.jsx("button",{type:"button",onClick:i,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:r?h.jsx(wd,{className:"h-3.5 w-3.5 text-primary"}):h.jsx(PR,{className:"h-3.5 w-3.5"})})]})]})}function Jre({label:e,value:t}){const[n,r]=j.useState(!1),[a,i]=j.useState(!1),l=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]),o=`${t.slice(0,8)}${"*".repeat(Math.max(0,t.length-12))}${t.slice(-4)}`;return h.jsxs("div",{className:"space-y-1",children:[h.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),h.jsxs("div",{className:"flex items-center gap-2 group",children:[h.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),h.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface transition-opacity",title:n?"Hide":"Reveal",children:n?h.jsx(fz,{className:"h-3.5 w-3.5"}):h.jsx(dz,{className:"h-3.5 w-3.5"})}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:a?h.jsx(wd,{className:"h-3.5 w-3.5 text-primary"}):h.jsx(PR,{className:"h-3.5 w-3.5"})})]})]})}function eae({onConnected:e}){const[t,n]=j.useState(""),[r,a]=j.useState(""),[i,l]=j.useState(null),[o,f]=j.useState(!1),c=async d=>{d.preventDefault(),l(null),f(!0);try{await kn("/team/connect",{url:t,api_key:r}),e()}catch(p){l(p instanceof Error?p.message:"Connection failed")}finally{f(!1)}};return h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-6",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[h.jsx(zz,{className:"h-4 w-4 text-on-surface-variant"}),h.jsx(Bt,{children:"Connect to team"})]}),h.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:"Enter the URL and API key for your team's Cloudflare Worker to enable cross-machine knowledge sharing."}),h.jsxs("form",{onSubmit:c,className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),h.jsx(cn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:d=>n(d.target.value),required:!0})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),h.jsx(cn,{type:"password",placeholder:"your-api-key",value:r,onChange:d=>a(d.target.value),required:!0})]}),i&&h.jsx("p",{className:"text-sm text-tertiary",children:i}),h.jsx(_e,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?h.jsxs(h.Fragment,{children:[h.jsx(vo,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function tae({status:e}){const t=Vn(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(!1),[d,p]=j.useState(null),[m,y]=j.useState(!1),[x,b]=j.useState(null),S=async()=>{r(!0);try{await kn("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},w=j.useCallback(async()=>{i(!0),o(null);try{const T=await kn("/team/backfill");o(T.enqueued>0?`Enqueued ${T.enqueued} records for sync. They'll push on the next flush cycle.`:"All records are already synced or enqueued."),t.invalidateQueries({queryKey:["team-status"]})}catch{o("Backfill failed.")}finally{i(!1)}},[t]),N=j.useCallback(async()=>{c(!0),p(null);try{const T=await kn("/team/upgrade-worker");T.success?(p(`Worker updated to v${T.version}`),t.invalidateQueries({queryKey:["team-status"]})):p(T.error??"Upgrade failed")}catch(T){p(T instanceof Error?T.message:"Upgrade failed")}finally{c(!1)}},[t]),C=j.useCallback(async()=>{y(!0),b(null);try{const T=await kn("/team/retry-failed");b(T.retried>0?`Re-queued ${T.retried} record${T.retried>1?"s":""} for sync.`:"No failed records to retry."),t.invalidateQueries({queryKey:["team-status"]})}catch{b("Retry failed.")}finally{y(!1)}},[t]);return h.jsxs("div",{className:"space-y-4",children:[e.worker_update_available&&h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-4 border-l-2 border-l-ochre",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(vb,{className:"h-5 w-5 text-ochre flex-shrink-0"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-on-surface",children:"Worker update available"}),h.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Deployed: v",e.deployed_worker_version??"?"," — Local: v",e.package_version]})]})]}),h.jsx(_e,{variant:"default",size:"sm",onClick:N,disabled:f,children:f?h.jsxs(h.Fragment,{children:[h.jsx(vo,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):"Update Worker"})]}),d&&h.jsx("p",{className:"text-xs text-on-surface-variant mt-2",children:d})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[h.jsx(sn,{label:"Status",value:e.healthy?"Connected":"Unhealthy",accent:e.healthy?"sage":"terracotta"}),h.jsx(sn,{label:"Pending sync",value:String(e.pending_sync_count),accent:e.dead_letter_count>0?"terracotta":"outline",sublabel:e.dead_letter_count>0?`${e.dead_letter_count} failed`:void 0,href:"/logs?component=team-sync"}),h.jsx(sn,{label:"Protocol",value:`v${e.sync_protocol_version}`,accent:"outline"}),h.jsx(sn,{label:"Schema",value:`v${e.schema_version}`,accent:"outline"})]}),h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Bt,{children:"Team Credentials"}),h.jsx(Ct,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),h.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),h.jsxs("div",{className:"space-y-3",children:[e.worker_url&&h.jsx(X0,{label:"Worker URL",value:e.worker_url}),e.api_key&&h.jsx(Jre,{label:"API Key",value:e.api_key})]})]}),h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[h.jsx(Bt,{children:"This Node"}),h.jsxs("div",{className:"grid gap-3",children:[h.jsx(X0,{label:"Machine ID",value:e.machine_id}),h.jsx(X0,{label:"Package Version",value:e.package_version})]}),e.health_error&&h.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Bt,{children:"Sync"}),h.jsx(_e,{variant:"default",size:"sm",onClick:w,disabled:a,children:a?h.jsxs(h.Fragment,{children:[h.jsx(vo,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),h.jsx("p",{className:"text-xs text-on-surface-variant",children:"Push all unsynced local knowledge to the team store. Records sync automatically on new writes, but historical data needs a one-time backfill."}),l&&h.jsx("p",{className:"text-sm text-primary",children:l}),e.dead_letter_count>0&&h.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-outline-variant/10",children:[h.jsxs("p",{className:"text-xs text-on-surface-variant",children:[h.jsxs("span",{className:"text-tertiary font-medium",children:[e.dead_letter_count," failed"]})," record",e.dead_letter_count>1?"s":""," — exceeded max retries."," ",h.jsx("a",{href:"/logs?component=team-sync&level=error",className:"underline hover:text-on-surface",children:"View logs"})]}),h.jsx(_e,{variant:"outline",size:"sm",onClick:C,disabled:m,children:m?"Retrying...":"Retry Failed"})]}),x&&h.jsx("p",{className:"text-xs text-primary",children:x})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(_e,{variant:"outline",size:"sm",onClick:S,disabled:n,children:n?"Disconnecting...":"Disconnect"})})]})}function nae(){const{data:e,isLoading:t}=Zre(),n=Vn();if(t)return h.jsx(U1,{isLoading:!0,error:null,children:h.jsx("span",{})});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return h.jsxs("div",{className:"p-6 max-w-4xl",children:[h.jsx(yi,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?h.jsx(tae,{status:e}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs(Qe,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[h.jsx(Bt,{children:"Getting Started"}),h.jsx("p",{className:"text-sm text-on-surface-variant",children:"Team sync lets multiple machines share captured knowledge through a Cloudflare Worker. One team member provisions the infrastructure, then shares the connection details."}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),h.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"npm install -g wrangler && wrangler login"})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),h.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),h.jsx("p",{className:"text-xs text-on-surface-variant mt-1",children:"Creates a D1 database, Vectorize index, and deploys the sync worker. Outputs a Worker URL and API key to share with teammates."})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),h.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",h.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),h.jsx(eae,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const rae=[{value:"15m",label:"15m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}];function aae({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:d,timeRange:p,onTimeRangeChange:m,totalResults:y}){return h.jsxs(Qe,{level:"default",className:"rounded-md p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[h.jsxs(_e,{size:"sm",variant:e==="live"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-r-none",onClick:()=>t("live"),children:[h.jsx(FR,{className:"h-3 w-3"}),"Live"]}),h.jsxs(_e,{size:"sm",variant:e==="search"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-l-none",onClick:()=>t("search"),children:[h.jsx(lc,{className:"h-3 w-3"}),"Search"]})]}),e==="search"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(BR,{className:"h-3 w-3 text-on-surface-variant/50"}),rae.map(x=>h.jsx(_e,{size:"sm",variant:p===x.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(x.value),children:x.label},x.value))]})]}),h.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:x=>{x.preventDefault(),a()},children:h.jsx(cn,{className:"h-7 w-56 text-xs",placeholder:e==="search"?"Search logs...":"Filter messages...",value:n,onChange:x=>r(x.target.value),"aria-label":"Search log messages"})}),e==="search"&&y!==void 0&&h.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center gap-1",children:Gz.map(x=>h.jsxs(_e,{size:"sm",variant:i===x?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(x),children:[h.jsx("div",{className:Te("h-1.5 w-1.5 rounded-full",R1(x))}),x]},x))}),o.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),h.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(x=>h.jsx(_e,{size:"sm",variant:f.has(x)?"default":"ghost",className:"h-5 px-1.5 text-[10px]",onClick:()=>c(x),children:x},x)),f.size>0&&h.jsx(_e,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:d,children:"clear"})]})]})]})]})}const iae={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},sae={context:"text-primary/70",hooks:"text-on-surface-variant/70",agent:"text-secondary/80",daemon:"text-on-surface-variant/60",capture:"text-primary/60",processor:"text-on-surface-variant/70",lifecycle:"text-primary/50",embedding:"text-on-surface-variant/60",power:"text-on-surface-variant/50",server:"text-on-surface-variant/60"};function lae(e,t){if(t)return H1(e);const n=new Date(e),r=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0"),i=String(n.getSeconds()).padStart(2,"0");return`${r}:${a}:${i}`}function oae({entries:e,selectedId:t,onSelect:n,autoScroll:r=!1,relativeTime:a=!1,compact:i=!0}){const l=j.useRef(null);return j.useEffect(()=>{!r||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[e,r]),h.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?h.jsx("div",{className:"flex h-full min-h-[200px] items-center justify-center text-on-surface-variant/50 font-sans text-sm",children:"No log entries"}):h.jsx("table",{className:"w-full border-collapse","aria-label":"Log entries",children:h.jsx("tbody",{children:e.map(o=>h.jsx(uae,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})})})}const uae=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5";return h.jsxs("tr",{className:Te("cursor-pointer transition-colors border-l-2",iae[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[h.jsx("td",{className:Te("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:lae(t.timestamp,a)}),h.jsx("td",{className:Te("whitespace-nowrap pr-1 align-top w-[12px]",l),children:h.jsx("div",{className:Te("h-1.5 w-1.5 rounded-full mt-1",R1(t.level))})}),h.jsx("td",{className:Te("whitespace-nowrap pr-2 align-top w-[48px]",l),children:h.jsx(Ct,{variant:GR(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),h.jsx("td",{className:Te("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,sae[t.component]??"text-on-surface-variant/60"),children:t.component}),h.jsx("td",{className:Te("pr-3 text-on-surface align-top break-words",l),children:t.message})]})});function cae({value:e}){const t=String(e),n=t.slice(0,8);return h.jsxs(Ra,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function fae({value:e}){return Array.isArray(e)?h.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>h.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):h.jsx("span",{children:String(e)})}function dae({value:e}){return Array.isArray(e)?h.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>h.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):h.jsx("span",{children:String(e)})}function hae({value:e}){return h.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function LA({value:e}){return h.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-surface-container-lowest px-2 py-1 text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:String(e)})}function vae({value:e}){const t=new Date(String(e)),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),i=Math.floor(a/60),l=Math.floor(i/24);let o;return a<1?o="just now":a<60?o=`${a}m ago`:i<24?o=`${i}h ago`:o=`${l}d ago`,h.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function pae({value:e}){return typeof e=="object"&&e!==null?h.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):h.jsx("span",{children:String(e)})}const mae={session_id:cae,spore_titles:fae,scores:dae,error:hae,preview:LA,generated_at:vae,text:LA},gae=new Set(["id","timestamp","level","kind","component","message"]);function _A(e,t){const n=mae[e]??pae;return h.jsx(n,{value:t})}function yae(e){return gae.has(e)}function xae(e){return e?Object.entries(e).filter(([t])=>!yae(t)):[]}const bae={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function wae({entry:e,resolved:t,onClose:n}){const r=xae(e.data);return h.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),h.jsx("span",{className:Te("text-xs font-medium",bae[e.level]),children:e.level.toUpperCase()})]}),h.jsx(_e,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:h.jsx(ns,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),h.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),h.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[_A("session_id",e.session_id),!!(t!=null&&t.session_title)&&h.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),h.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),h.jsx("div",{className:"text-xs",children:_A(a,i)})]},a))})]})]}),h.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:h.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const BA=5e3;function Sae(){const[e,t]=j.useState([]),n=j.useRef(0),{data:r}=tn({queryKey:["logs-stream"],queryFn:({signal:i})=>ot(`/logs/stream?since=${n.current}`,{signal:i}),refetchInterval:Rr.LOGS});j.useEffect(()=>{r!=null&&r.entries.length&&(n.current=r.cursor,t(i=>{const l=[...i,...r.entries];return l.length>BA?l.slice(-BA):l}))},[r]);const a=j.useCallback(()=>{t([])},[]);return{entries:e,clear:a}}function Eae(e,t){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.level&&n.set("level",e.level),e.component&&n.set("component",e.component),e.kind&&n.set("kind",e.kind),e.session_id&&n.set("session_id",e.session_id),e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.page&&n.set("page",String(e.page)),e.page_size&&n.set("page_size",String(e.page_size)),tn({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>ot(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function Cae(e){return tn({queryKey:["log-detail",e],queryFn:({signal:t})=>ot(`/logs/${e}`,{signal:t}),enabled:e!==null})}function Nae(e){const t=Date.now(),n={"15m":15*6e4,"1h":60*6e4,"6h":360*6e4,"24h":1440*6e4,"7d":10080*6e4,"30d":720*60*6e4};return new Date(t-(n[e]??1440*6e4)).toISOString()}function kae(){const e=j.useMemo(()=>{var F;const V=new URLSearchParams(window.location.search),I=((F=V.get("component"))==null?void 0:F.split(",").filter(Boolean))??[],U=V.get("level"),Y=V.get("q")??"",Q=I.length>0||!!U||!!Y;return{components:I,level:U,q:Y,hasFilters:Q}},[]),[t,n]=j.useState(e.hasFilters?"search":"live"),[r,a]=j.useState(e.q),[i,l]=j.useState(e.q),[o,f]=j.useState(e.level??"debug"),[c,d]=j.useState(new Set(e.components)),[p,m]=j.useState("24h"),[y,x]=j.useState(1),[b,S]=j.useState(null),{entries:w}=Sae(),N=j.useMemo(()=>({q:i||void 0,level:o!=="debug"?o:void 0,component:c.size>0?Array.from(c).join(","):void 0,from:Nae(p),page:y,page_size:$r}),[i,o,c,p,y]),{data:C}=Eae(N,t==="search"),{data:T}=Cae((b==null?void 0:b.id)??null),[R,A]=j.useState(e.components);j.useEffect(()=>{const V=t==="live"?w:(C==null?void 0:C.entries)??[];A(I=>{const U=new Set(I);let Y=!1;for(const Q of V)U.has(Q.component)||(U.add(Q.component),Y=!0);return Y?Array.from(U).sort():I})},[w,C,t]);const D=j.useMemo(()=>{const V=np[o]??0,I=r.trim().toLowerCase();return w.filter(U=>!((np[U.level]??0)<V||c.size>0&&!c.has(U.component)||I&&!U.message.toLowerCase().includes(I)))},[w,o,c,r]),L=t==="live"?D:(C==null?void 0:C.entries)??[],B=j.useCallback(V=>{n(V),S(null)},[]),M=j.useCallback(()=>{l(r),x(1)},[r]),_=j.useCallback(V=>{S(I=>(I==null?void 0:I.id)===V.id?null:V)},[]),P=j.useCallback(V=>{d(I=>{const U=new Set(I);return U.has(V)?U.delete(V):U.add(V),U}),x(1)},[]),H=j.useCallback(V=>{f(V),x(1)},[]),$=b!==null;return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx("div",{className:"px-6 pt-6",children:h.jsx(yi,{title:"Logs",subtitle:"Daemon log explorer"})}),h.jsx("div",{className:"px-6 mb-3",children:h.jsx(aae,{mode:t,onModeChange:B,searchValue:r,onSearchChange:a,onSearchSubmit:M,activeLevel:o,onLevelChange:H,components:R,activeComponents:c,onComponentToggle:P,onComponentsClear:()=>{d(new Set),x(1)},timeRange:p,onTimeRangeChange:V=>{m(V),x(1)},totalResults:t==="search"?C==null?void 0:C.total:void 0})}),h.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[h.jsxs("div",{className:Te("flex flex-col",$?"w-3/5":"w-full"),children:[h.jsx(oae,{entries:L,selectedId:(b==null?void 0:b.id)??null,onSelect:_,autoScroll:t==="live",relativeTime:t==="live",compact:!0}),t==="search"&&C&&h.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:h.jsx(mc,{total:C.total,offset:(y-1)*$r,limit:$r,onPageChange:V=>x(Math.floor(V/$r)+1)})})]}),$&&b&&h.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:h.jsx(wae,{entry:b,resolved:T==null?void 0:T.resolved,onClose:()=>S(null)})})]})]})}function Tae(){return h.jsx(lP,{children:h.jsxs(Ea,{element:h.jsx(aq,{}),children:[h.jsx(Ea,{path:"/",element:h.jsx(eU,{})}),h.jsx(Ea,{path:"/sessions",element:h.jsx(Ik,{})}),h.jsx(Ea,{path:"/sessions/:id",element:h.jsx(Ik,{})}),h.jsx(Ea,{path:"/mycelium",element:h.jsx(Xte,{})}),h.jsx(Ea,{path:"/agent",element:h.jsx(Hne,{})}),h.jsx(Ea,{path:"/skills",element:h.jsx(xre,{})}),h.jsx(Ea,{path:"/settings",element:h.jsx(Tre,{})}),h.jsx(Ea,{path:"/operations",element:h.jsx(Wre,{})}),h.jsx(Ea,{path:"/team",element:h.jsx(nae,{})}),h.jsx(Ea,{path:"/logs",element:h.jsx(kae,{})})]})})}const jae=new Y4({defaultOptions:{queries:{staleTime:$z}}});E4.createRoot(document.getElementById("root")).render(h.jsx($i.StrictMode,{children:h.jsx(VP,{children:h.jsx(XP,{children:h.jsx(JP,{children:h.jsx(X4,{client:jae,children:h.jsx(DP,{children:h.jsx(Tae,{})})})})})})}));