@kidlat-dakila/flightplan 0.1.6 → 0.1.8

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 (178) hide show
  1. package/README.md +31 -16
  2. package/backend/configurations/default-configurations/minimal/context.md +9 -54
  3. package/backend/configurations/default-configurations/minimal/traceDiagram.nodes.blockLabels.label.md +19 -0
  4. package/backend/configurations/default-configurations/minimal/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
  5. package/backend/configurations/default-configurations/minimal/walkthrough.files.waypoints.reading.md +1 -1
  6. package/backend/configurations/default-configurations/onboardee/context.md +16 -62
  7. package/backend/configurations/default-configurations/onboardee/traceDiagram.description.md +16 -0
  8. package/backend/configurations/default-configurations/onboardee/traceDiagram.nodes.blockLabels.label.md +11 -0
  9. package/backend/configurations/default-configurations/onboardee/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
  10. package/backend/configurations/default-configurations/onboardee/walkthrough.files.waypoints.reading.md +1 -1
  11. package/backend/configurations/default-configurations/standard/context.md +16 -62
  12. package/backend/configurations/default-configurations/standard/traceDiagram.description.md +16 -0
  13. package/backend/configurations/default-configurations/standard/traceDiagram.nodes.blockLabels.label.md +11 -0
  14. package/backend/configurations/default-configurations/standard/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
  15. package/backend/configurations/default-configurations/standard/walkthrough.files.waypoints.reading.md +1 -1
  16. package/backend/configurations/default-configurations/unfamiliar-territory/context.md +16 -62
  17. package/backend/configurations/default-configurations/unfamiliar-territory/traceDiagram.description.md +16 -0
  18. package/backend/configurations/default-configurations/unfamiliar-territory/traceDiagram.nodes.blockLabels.label.md +11 -0
  19. package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
  20. package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.files.waypoints.reading.md +1 -1
  21. package/backend/configurations/system-instructions/artifactFormat.md +20 -16
  22. package/backend/configurations/system-instructions/{blast.md → blastDiagram.md} +5 -5
  23. package/backend/configurations/system-instructions/context.md +18 -9
  24. package/backend/configurations/system-instructions/title.md +36 -4
  25. package/backend/configurations/system-instructions/traceDiagram.description.md +14 -0
  26. package/backend/configurations/system-instructions/{journey.md → traceDiagram.md} +8 -8
  27. package/backend/configurations/system-instructions/traceDiagram.nodes.blockLabels.label.md +6 -0
  28. package/backend/configurations/system-instructions/walkthrough.files.md +5 -11
  29. package/backend/configurations/system-instructions/walkthrough.files.waypoints.coreChange.md +7 -0
  30. package/backend/configurations/system-instructions/walkthrough.files.waypoints.md +3 -3
  31. package/backend/configurations/system-instructions/walkthrough.md +6 -8
  32. package/backend/main.js +56748 -44939
  33. package/backend/plugin/skills/live/SKILL.md +79 -0
  34. package/backend/plugin/skills/review/SKILL.md +39 -52
  35. package/frontend/assets/_branchId-Caxyy__g.js +1 -0
  36. package/frontend/assets/_branchId-IJ4VEzEl.js +1 -0
  37. package/frontend/assets/_id-3L9ONe4W.js +1 -0
  38. package/frontend/assets/_id-CvORsoNj.js +1 -0
  39. package/frontend/assets/agents-DnjhKMUc.js +1 -0
  40. package/frontend/assets/agents-bla75JmI.js +1 -0
  41. package/frontend/assets/create-B82q7ZMu.js +1 -0
  42. package/frontend/assets/create-C9yw-thL.js +1 -0
  43. package/frontend/assets/{create-DBv4ZLt7.js → create-CEpA1s8S.js} +1 -1
  44. package/frontend/assets/create-D0h6PRxn.js +1 -0
  45. package/frontend/assets/download-CwWMZwNG.js +1 -0
  46. package/frontend/assets/forges-BH3uXIQL.js +1 -0
  47. package/frontend/assets/forges-uSh1-w20.js +1 -0
  48. package/frontend/assets/index--nj01XKS.js +1 -0
  49. package/frontend/assets/index-0VAWT0gs.js +1 -0
  50. package/frontend/assets/index-B0zuYONu.js +1 -0
  51. package/frontend/assets/{index-XcYy-NBi.js → index-BQaZ5gZR.js} +1 -1
  52. package/frontend/assets/{index-CZN7BV83.js → index-BZ6iL63Z.js} +1 -1
  53. package/frontend/assets/index-Bar8NyIm.js +1 -0
  54. package/frontend/assets/{index-efpZ6EEe.js → index-BlTfCkr5.js} +1 -1
  55. package/frontend/assets/{index-Dn9qaXzX.js → index-BvuPClj3.js} +1 -1
  56. package/frontend/assets/index-C9xsdcXo.js +1 -0
  57. package/frontend/assets/index-CJDNq1TA.js +1 -0
  58. package/frontend/assets/index-CJslcuJ0.js +1 -0
  59. package/frontend/assets/index-CTKqkqZN.css +1 -0
  60. package/frontend/assets/index-CXyB0ld0.js +1 -0
  61. package/frontend/assets/{index-DyfuBbIJ.js → index-CcORd1N6.js} +1 -1
  62. package/frontend/assets/index-CrAQ5_e4.js +1 -0
  63. package/frontend/assets/index-DG0FDX8u.js +1 -0
  64. package/frontend/assets/index-DKnoo-kT.js +455 -0
  65. package/frontend/assets/{index-s14Wy6CE.js → index-DKzDkR6v.js} +1 -1
  66. package/frontend/assets/{index-CR5UGYQN.js → index-DfKNJbUM.js} +75 -62
  67. package/frontend/assets/{index-BaflOxvR.js → index-DlUHisPA.js} +1 -1
  68. package/frontend/assets/index-Dv5cF6qF.js +1 -0
  69. package/frontend/assets/index-JPWJ3IiN.js +1 -0
  70. package/frontend/assets/index-V1avMli5.js +6 -0
  71. package/frontend/assets/index-iRAoFOv3.js +1 -0
  72. package/frontend/assets/repositories-DqGU7W63.js +1 -0
  73. package/frontend/assets/repositories-DuObN8PJ.js +1 -0
  74. package/frontend/assets/review-BbbMUFsk.js +1 -0
  75. package/frontend/assets/review-C3k0h5Vl.js +1 -0
  76. package/frontend/assets/route-D8s8AylJ.js +1 -0
  77. package/frontend/favicon.ico +0 -0
  78. package/frontend/favicon.svg +5 -0
  79. package/frontend/index.html +10 -3
  80. package/frontend/logo.svg +5 -0
  81. package/frontend/not-found.svg +25 -0
  82. package/frontend/server-error.svg +32 -0
  83. package/package.json +5 -2
  84. package/published-review/app.css +1 -1
  85. package/published-review/app.js +134 -99
  86. package/backend/configurations/default-configurations/minimal/journey.nodes.blockLabels.label.md +0 -13
  87. package/backend/configurations/default-configurations/minimal/walkthrough.files.title.md +0 -7
  88. package/backend/configurations/default-configurations/minimal/walkthrough.intro.md +0 -4
  89. package/backend/configurations/default-configurations/onboardee/journey.description.md +0 -10
  90. package/backend/configurations/default-configurations/onboardee/journey.nodes.blockLabels.label.md +0 -9
  91. package/backend/configurations/default-configurations/onboardee/walkthrough.files.title.md +0 -7
  92. package/backend/configurations/default-configurations/onboardee/walkthrough.intro.md +0 -5
  93. package/backend/configurations/default-configurations/standard/journey.description.md +0 -10
  94. package/backend/configurations/default-configurations/standard/journey.nodes.blockLabels.label.md +0 -9
  95. package/backend/configurations/default-configurations/standard/walkthrough.files.title.md +0 -7
  96. package/backend/configurations/default-configurations/standard/walkthrough.intro.md +0 -5
  97. package/backend/configurations/default-configurations/unfamiliar-territory/journey.description.md +0 -10
  98. package/backend/configurations/default-configurations/unfamiliar-territory/journey.nodes.blockLabels.label.md +0 -9
  99. package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.files.title.md +0 -7
  100. package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.intro.md +0 -5
  101. package/backend/configurations/system-instructions/journey.description.md +0 -14
  102. package/backend/configurations/system-instructions/journey.nodes.blockLabels.label.md +0 -6
  103. package/backend/configurations/system-instructions/walkthrough.files.summary.md +0 -4
  104. package/backend/configurations/system-instructions/walkthrough.files.title.md +0 -2
  105. package/backend/configurations/system-instructions/walkthrough.files.waypoints.needsAttention.md +0 -8
  106. package/backend/configurations/system-instructions/walkthrough.intro.md +0 -3
  107. package/frontend/assets/_branchId-CPb8-qBw.js +0 -1
  108. package/frontend/assets/_branchId-LiwHskkW.js +0 -1
  109. package/frontend/assets/_id-BDFgPH36.js +0 -1
  110. package/frontend/assets/_id-DlHylI1F.js +0 -1
  111. package/frontend/assets/agents-BGNiGYQQ.js +0 -1
  112. package/frontend/assets/agents-DBPulyWi.js +0 -1
  113. package/frontend/assets/configuration-C8ZTSPna.js +0 -1
  114. package/frontend/assets/configuration-DBU-Fvop.js +0 -1
  115. package/frontend/assets/create-BWsYjEs5.js +0 -1
  116. package/frontend/assets/create-DBNC2wSp.js +0 -1
  117. package/frontend/assets/create-DXgFUVIW.js +0 -1
  118. package/frontend/assets/download-BnmEn_Ca.js +0 -1
  119. package/frontend/assets/forges-BOWrvfZl.js +0 -1
  120. package/frontend/assets/forges-DwSiwqas.js +0 -1
  121. package/frontend/assets/index-B1Rm0SQ5.js +0 -1
  122. package/frontend/assets/index-BKKD-dvv.js +0 -1
  123. package/frontend/assets/index-CSoB1eP_.js +0 -1
  124. package/frontend/assets/index-CUqlioqL.js +0 -1
  125. package/frontend/assets/index-CeY9TXPf.js +0 -1
  126. package/frontend/assets/index-CydhSU9g.js +0 -1
  127. package/frontend/assets/index-D-k5POv5.js +0 -1
  128. package/frontend/assets/index-DCCyA67N.js +0 -1
  129. package/frontend/assets/index-DfRj4oZV.js +0 -441
  130. package/frontend/assets/index-Dw5NpM9d.js +0 -1
  131. package/frontend/assets/index-PzkXPYSX.js +0 -1
  132. package/frontend/assets/index-QabB0_Qw.js +0 -1
  133. package/frontend/assets/index-V8tnJR9v.js +0 -1
  134. package/frontend/assets/index-ec_xLUMF.css +0 -1
  135. package/frontend/assets/index-zxLaxo8R.js +0 -1
  136. package/frontend/assets/repositories-BLLfYDjf.js +0 -1
  137. package/frontend/assets/repositories-of9BXUjW.js +0 -1
  138. package/frontend/assets/route-X94hglR1.js +0 -1
  139. package/frontend/logo-small.png +0 -0
  140. package/frontend/logo.png +0 -0
  141. /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
  142. /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
  143. /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
  144. /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
  145. /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
  146. /package/backend/configurations/default-configurations/minimal/{journey.description.md → traceDiagram.description.md} +0 -0
  147. /package/backend/configurations/default-configurations/minimal/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
  148. /package/backend/configurations/default-configurations/minimal/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
  149. /package/backend/configurations/default-configurations/minimal/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
  150. /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
  151. /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
  152. /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
  153. /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
  154. /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
  155. /package/backend/configurations/default-configurations/onboardee/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
  156. /package/backend/configurations/default-configurations/onboardee/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
  157. /package/backend/configurations/default-configurations/onboardee/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
  158. /package/backend/configurations/default-configurations/standard/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
  159. /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
  160. /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
  161. /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
  162. /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
  163. /package/backend/configurations/default-configurations/standard/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
  164. /package/backend/configurations/default-configurations/standard/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
  165. /package/backend/configurations/default-configurations/standard/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
  166. /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
  167. /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
  168. /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
  169. /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
  170. /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
  171. /package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
  172. /package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
  173. /package/backend/configurations/default-configurations/unfamiliar-territory/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
  174. /package/backend/configurations/system-instructions/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
  175. /package/backend/configurations/system-instructions/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
  176. /package/backend/configurations/system-instructions/{journey.nodes.description.md → traceDiagram.nodes.description.md} +0 -0
  177. /package/backend/configurations/system-instructions/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
  178. /package/backend/configurations/system-instructions/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
@@ -1,441 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-s14Wy6CE.js","assets/index-s0xxzhVW.js","assets/index-zxLaxo8R.js","assets/index-D-k5POv5.js","assets/index-Dn9qaXzX.js","assets/index-QabB0_Qw.js","assets/agents-BGNiGYQQ.js","assets/index-XcYy-NBi.js","assets/agents-DBPulyWi.js","assets/index-CZN7BV83.js","assets/index-Dw5NpM9d.js","assets/index-efpZ6EEe.js","assets/configuration-C8ZTSPna.js","assets/configuration-DBU-Fvop.js","assets/index-CUqlioqL.js","assets/forges-DwSiwqas.js","assets/forges-BOWrvfZl.js","assets/index-CydhSU9g.js","assets/repositories-BLLfYDjf.js","assets/repositories-of9BXUjW.js","assets/index-DyfuBbIJ.js","assets/index-CqVakH8R.js","assets/index-CSoB1eP_.js","assets/index-PzkXPYSX.js","assets/index-CR5UGYQN.js","assets/index-DCCyA67N.js","assets/index-B1Rm0SQ5.js","assets/index-V8tnJR9v.js","assets/index-BaflOxvR.js","assets/index-CeY9TXPf.js","assets/index-BKKD-dvv.js","assets/_id-DlHylI1F.js","assets/_id-BDFgPH36.js","assets/create-DXgFUVIW.js","assets/create-DBNC2wSp.js"])))=>i.map(i=>d[i]);
2
- var e$=Object.defineProperty;var qO=e=>{throw TypeError(e)};var t$=(e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _t=(e,t,n)=>t$(e,typeof t!="symbol"?t+"":t,n),iS=(e,t,n)=>t.has(e)||qO("Cannot "+n);var Q=(e,t,n)=>(iS(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?qO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(iS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pt=(e,t,n)=>(iS(e,t,"access private method"),n);var kg=(e,t,n,r)=>({set _(s){Pe(e,t,s,n)},get _(){return Q(e,t,r)}});function n$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)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(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function bE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oS={exports:{}},ah={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var GO;function r$(){if(GO)return ah;GO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:i}}return ah.Fragment=t,ah.jsx=n,ah.jsxs=n,ah}var KO;function s$(){return KO||(KO=1,oS.exports=r$()),oS.exports}var x=s$(),lS={exports:{}},lt={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var YO;function i$(){if(YO)return lt;YO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.for("react.view_transition"),y=Symbol.iterator;function b(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function T(F,X,te){this.props=F,this.context=X,this.refs=C,this.updater=te||w}T.prototype.isReactComponent={},T.prototype.setState=function(F,X){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,X,"setState")},T.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function N(){}N.prototype=T.prototype;function R(F,X,te){this.props=F,this.context=X,this.refs=C,this.updater=te||w}var M=R.prototype=new N;M.constructor=R,E(M,T.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function k(){}var I={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function P(F,X,te){var J=te.ref;return{$$typeof:e,type:F,key:X,ref:J!==void 0?J:null,props:te}}function H(F,X){return P(F.type,X,F.props)}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function U(F){var X={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(te){return X[te]})}var j=/\/+/g;function B(F,X){return typeof F=="object"&&F!==null&&F.key!=null?U(""+F.key):X.toString(36)}function L(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(k,k):(F.status="pending",F.then(function(X){F.status==="pending"&&(F.status="fulfilled",F.value=X)},function(X){F.status==="pending"&&(F.status="rejected",F.reason=X)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function $(F,X,te,J,K){var ce=typeof F;(ce==="undefined"||ce==="boolean")&&(F=null);var ye=!1;if(F===null)ye=!0;else switch(ce){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(F.$$typeof){case e:case t:ye=!0;break;case h:return ye=F._init,$(ye(F._payload),X,te,J,K)}}if(ye)return K=K(F),ye=J===""?"."+B(F,0):J,D(K)?(te="",ye!=null&&(te=ye.replace(j,"$&/")+"/"),$(K,X,te,"",function(xe){return xe})):K!=null&&(z(K)&&(K=H(K,te+(K.key==null||F&&F.key===K.key?"":(""+K.key).replace(j,"$&/")+"/")+ye)),X.push(K)),1;ye=0;var ge=J===""?".":J+":";if(D(F))for(var oe=0;oe<F.length;oe++)J=F[oe],ce=ge+B(J,oe),ye+=$(J,X,te,ce,K);else if(oe=b(F),typeof oe=="function")for(F=oe.call(F),oe=0;!(J=F.next()).done;)J=J.value,ce=ge+B(J,oe++),ye+=$(J,X,te,ce,K);else if(ce==="object"){if(typeof F.then=="function")return $(L(F),X,te,J,K);throw X=String(F),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ye}function q(F,X,te){if(F==null)return F;var J=[],K=0;return $(F,J,"","",function(ce){return X.call(te,ce,K++)}),J}function G(F){if(F._status===-1){var X=F._result,te=X();te.then(function(J){(F._status===0||F._status===-1)&&(F._status=1,F._result=J,te.status===void 0&&(te.status="fulfilled",te.value=J))},function(J){(F._status===0||F._status===-1)&&(F._status=2,F._result=J,te.status===void 0&&(te.status="rejected",te.reason=J))}),F._status===-1&&(F._status=0,F._result=te)}if(F._status===1)return F._result.default;throw F._result}var W=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)};function Z(F){var X=I.T,te={};te.types=X!==null?X.types:null,I.T=te;try{var J=F(),K=I.S;K!==null&&K(te,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(k,W)}catch(ce){W(ce)}finally{X!==null&&te.types!==null&&(X.types=te.types),I.T=X}}function re(F){var X=I.T;if(X!==null){var te=X.types;te===null?X.types=[F]:te.indexOf(F)===-1&&te.push(F)}else Z(re.bind(null,F))}var de={map:q,forEach:function(F,X,te){q(F,function(){X.apply(this,arguments)},te)},count:function(F){var X=0;return q(F,function(){X++}),X},toArray:function(F){return q(F,function(X){return X})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return lt.Activity=m,lt.Children=de,lt.Component=T,lt.Fragment=n,lt.Profiler=s,lt.PureComponent=R,lt.StrictMode=r,lt.Suspense=u,lt.ViewTransition=g,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,lt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return I.H.useMemoCache(F)}},lt.addTransitionType=re,lt.cache=function(F){return function(){return F.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(F,X,te){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var J=E({},F.props),K=F.key;if(X!=null)for(ce in X.key!==void 0&&(K=""+X.key),X)!_.call(X,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&X.ref===void 0||(J[ce]=X[ce]);var ce=arguments.length-2;if(ce===1)J.children=te;else if(1<ce){for(var ye=Array(ce),ge=0;ge<ce;ge++)ye[ge]=arguments[ge+2];J.children=ye}return P(F.type,K,J)},lt.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},lt.createElement=function(F,X,te){var J,K={},ce=null;if(X!=null)for(J in X.key!==void 0&&(ce=""+X.key),X)_.call(X,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(K[J]=X[J]);var ye=arguments.length-2;if(ye===1)K.children=te;else if(1<ye){for(var ge=Array(ye),oe=0;oe<ye;oe++)ge[oe]=arguments[oe+2];K.children=ge}if(F&&F.defaultProps)for(J in ye=F.defaultProps,ye)K[J]===void 0&&(K[J]=ye[J]);return P(F,ce,K)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(F){return{$$typeof:c,render:F}},lt.isValidElement=z,lt.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:G}},lt.memo=function(F,X){return{$$typeof:d,type:F,compare:X===void 0?null:X}},lt.startTransition=Z,lt.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},lt.use=function(F){return I.H.use(F)},lt.useActionState=function(F,X,te){return I.H.useActionState(F,X,te)},lt.useCallback=function(F,X){return I.H.useCallback(F,X)},lt.useContext=function(F){return I.H.useContext(F)},lt.useDebugValue=function(){},lt.useDeferredValue=function(F,X){return I.H.useDeferredValue(F,X)},lt.useEffect=function(F,X){return I.H.useEffect(F,X)},lt.useEffectEvent=function(F){return I.H.useEffectEvent(F)},lt.useId=function(){return I.H.useId()},lt.useImperativeHandle=function(F,X,te){return I.H.useImperativeHandle(F,X,te)},lt.useInsertionEffect=function(F,X){return I.H.useInsertionEffect(F,X)},lt.useLayoutEffect=function(F,X){return I.H.useLayoutEffect(F,X)},lt.useMemo=function(F,X){return I.H.useMemo(F,X)},lt.useOptimistic=function(F,X){return I.H.useOptimistic(F,X)},lt.useReducer=function(F,X,te){return I.H.useReducer(F,X,te)},lt.useRef=function(F){return I.H.useRef(F)},lt.useState=function(F){return I.H.useState(F)},lt.useSyncExternalStore=function(F,X,te){return I.H.useSyncExternalStore(F,X,te)},lt.useTransition=function(){return I.H.useTransition()},lt.version="19.3.0",lt}var WO;function Ip(){return WO||(WO=1,lS.exports=i$()),lS.exports}var O=Ip();const od=bE(O),o$=n$({__proto__:null,default:od},[O]),ZI=O.createContext(void 0),Ri=e=>{const t=O.useContext(ZI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},l$=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(ZI.Provider,{value:e,children:t})),a$={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Zl,xE,HI,c$=(HI=class{constructor(){Xe(this,Zl,a$);Xe(this,xE,!1)}setTimeoutProvider(e){Pe(this,Zl,e)}setTimeout(e,t){return Q(this,Zl).setTimeout(e,t)}clearTimeout(e){Q(this,Zl).clearTimeout(e)}setInterval(e,t){return Q(this,Zl).setInterval(e,t)}clearInterval(e){Q(this,Zl).clearInterval(e)}},Zl=new WeakMap,xE=new WeakMap,HI);const mc=new c$;function u$(e){setTimeout(e,0)}const f$=typeof window>"u"||"Deno"in globalThis;function Wr(){}function d$(e,t){return typeof e=="function"?e(t):e}function JI(e){return typeof e=="number"&&e>=0&&e!==1/0}function ej(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cn(e,t){return typeof e=="function"?e(t):e}function XO(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==vE(l,t.options))return!1}else if(!Bf(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function QO(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(va(t.options.mutationKey)!==va(i))return!1}else if(!Bf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function vE(e,t){return((t==null?void 0:t.queryKeyHashFn)||va)(e)}function va(e){return JSON.stringify(e,(t,n)=>T1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Bf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!Bf(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!Bf(e[r],t[r]))return!1;return!0}return!1}const h$=Object.prototype.hasOwnProperty;function tj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ZO(e)&&ZO(t);if(!r&&!(T1(e)&&T1(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,c=r?new Array(l):{};let u=0;for(let d=0;d<l;d++){const h=r?d:i[d],m=e[h],g=t[h];if(m===g){c[h]=m,(r?d<s:h$.call(e,h))&&u++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){c[h]=g;continue}const y=tj(m,g,n+1);c[h]=y,y===m&&u++}return s===l&&u===s?e:c}function p0(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 ZO(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T1(e){if(!JO(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!JO(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function JO(e){return Object.prototype.toString.call(e)==="[object Object]"}function p$(e){return new Promise(t=>{mc.setTimeout(t,e)})}function R1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?tj(e,t):t}function SE(e){return e}function m$(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function g$(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const ri=Symbol();function nj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ri?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wE(e,t){return typeof e=="function"?e(...t):!!e}function y$(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}let x$=()=>f$;const EE=()=>x$();var ld=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(){}},wc,Jl,Tf,FI,b$=(FI=class extends ld{constructor(){super();Xe(this,wc);Xe(this,Jl);Xe(this,Tf);Pe(this,Tf,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,Jl)||this.setEventListener(Q(this,Tf))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,Jl))==null||t.call(this),Pe(this,Jl,void 0))}setEventListener(t){var n;Pe(this,Tf,t),(n=Q(this,Jl))==null||n.call(this),Pe(this,Jl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Q(this,wc)!==t&&(Pe(this,wc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Q(this,wc)=="boolean"?Q(this,wc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},wc=new WeakMap,Jl=new WeakMap,Tf=new WeakMap,FI);const CE=new b$,v$=u$;function S$(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=v$;const i=c=>{t?e.push(c):s(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||l()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}const Zn=S$();var Rf,ea,Of,$I,w$=($I=class extends ld{constructor(){super();Xe(this,Rf,!0);Xe(this,ea);Xe(this,Of);Pe(this,Of,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(){Q(this,ea)||this.setEventListener(Q(this,Of))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,ea))==null||t.call(this),Pe(this,ea,void 0))}setEventListener(t){var n;Pe(this,Of,t),(n=Q(this,ea))==null||n.call(this),Pe(this,ea,t(this.setOnline.bind(this)))}setOnline(t){Q(this,Rf)!==t&&(Pe(this,Rf,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Q(this,Rf)}},Rf=new WeakMap,ea=new WeakMap,Of=new WeakMap,$I);const z0=new w$;function E$(e){return Math.min(1e3*2**e,3e4)}function rj(e){return(e??"online")==="online"?z0.isOnline():!0}var O1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sj(e){let t=!1,n=0,r,s="pending",i,l;const c=new Promise((T,N)=>{i=T,l=N});c.catch(Wr);const u=()=>s!=="pending",d=T=>{var N;if(!u()){const R=new O1(T);w(R),(N=e.onCancel)==null||N.call(e,R)}},h=()=>{t=!0},m=()=>{t=!1},g=()=>CE.isFocused()&&(e.networkMode==="always"||z0.isOnline())&&e.canRun(),y=()=>rj(e.networkMode)&&e.canRun(),b=T=>{u()||(r==null||r(),s="resolved",i(T))},w=T=>{u()||(r==null||r(),s="rejected",l(T))},E=()=>new Promise(T=>{var N;r=R=>{(u()||g())&&T(R)},(N=e.onPause)==null||N.call(e)}).then(()=>{var T;r=void 0,u()||(T=e.onContinue)==null||T.call(e)}),C=()=>{if(u())return;let T;const N=n===0?e.initialPromise:void 0;try{T=N??e.fn()}catch(R){T=Promise.reject(R)}Promise.resolve(T).then(b).catch(R=>{var _;if(u())return;const M=e.retry??(EE()?0:3),D=e.retryDelay??E$,k=typeof D=="function"?D(n,R):D,I=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,R);if(t||!I){w(R);return}n++,(_=e.onFail)==null||_.call(e,n,R),p$(k).then(()=>g()?void 0:E()).then(()=>{t?w(R):C()})})};return{promise:c,status:()=>s,cancel:d,continue:()=>(r==null||r(),c),cancelRetry:h,continueRetry:m,canStart:y,start:()=>(y()?C():E().then(C),c)}}var Ec,VI,ij=(VI=class{constructor(){Xe(this,Ec)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),JI(this.gcTime)&&Pe(this,Ec,mc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(EE()?1/0:3e5))}clearGcTimeout(){Q(this,Ec)!==void 0&&(mc.clearTimeout(Q(this,Ec)),Pe(this,Ec,void 0))}},Ec=new WeakMap,VI);function C$(e){return{onFetch:(t,n)=>{var h,m,g,y,b;const r=t.options,s=(g=(m=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:g.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const d=async()=>{let w=!1;const E=N=>{y$(N,()=>t.signal,()=>w=!0)},C=nj(t.options,t.fetchOptions),T=async(N,R,M)=>{if(w)return Promise.reject(t.signal.reason);if(R==null&&N.pages.length)return Promise.resolve(N);const k=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:R,direction:M?"backward":"forward",meta:t.options.meta};return E(H),H})(),I=await C(k),{maxPages:_}=t.options,P=M?g$:m$;return{pages:P(N.pages,I,_),pageParams:P(N.pageParams,R,_)}};if(s&&i.length){const N=s==="backward",R=N?N$:ek,M={pages:i,pageParams:l};c=await T(M,R(r,M),N)}else{const N=e??i.length;do{const R=u===0?l[0]??r.initialPageParam:ek(r,c);if(u>0&&R==null)break;c=await T(c,R),u++}while(u<N)}return c};t.options.persister?t.fetchFn=()=>{var w,E;return(E=(w=t.options).persister)==null?void 0:E.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function ek(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 N$(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 kf,Cc,Mf,Zs,Nc,Qn,kp,Tc,pi,Do,UI,T$=(UI=class extends ij{constructor(t){super();Xe(this,pi);Xe(this,kf);Xe(this,Cc);Xe(this,Mf);Xe(this,Zs);Xe(this,Nc);Xe(this,Qn);Xe(this,kp);Xe(this,Tc);Pe(this,Tc,!1),Pe(this,kp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,Nc,t.client),Pe(this,Zs,Q(this,Nc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,Cc,nk(this.options)),this.state=t.state??Q(this,Cc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Q(this,kf)}get promise(){var t;return(t=Q(this,Qn))==null?void 0:t.promise}setOptions(t){if(this.options={...Q(this,kp),...t},t!=null&&t._type&&Pe(this,kf,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=nk(this.options);n.data!==void 0&&(this.setState(tk(n.data,n.dataUpdatedAt)),Pe(this,Cc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,Zs).remove(this)}setData(t,n){const r=R1(this.state.data,t,this.options);return pt(this,pi,Do).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pt(this,pi,Do).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=Q(this,Qn))==null?void 0:r.promise;return(s=Q(this,Qn))==null||s.cancel(t),n?n.then(Wr).catch(Wr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Q(this,Cc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>cn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ri||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>cn(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:!ej(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=Q(this,Qn))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=Q(this,Qn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Q(this,Zs).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(Q(this,Qn)&&(Q(this,Tc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?Q(this,Qn).cancel({revert:!0}):Q(this,Qn).cancelRetry()),this.scheduleGc()),Q(this,Zs).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pt(this,pi,Do).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,m,g,y,b,w,E,C,T,N,R;if(this.state.fetchStatus!=="idle"&&((d=Q(this,Qn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Qn))return Q(this,Qn).continueRetry(),Q(this,Qn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,s=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Pe(this,Tc,!0),r.signal)})},i=()=>{const M=nj(this.options,n),k=(()=>{const I={client:Q(this,Nc),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return Pe(this,Tc,!1),this.options.persister?this.options.persister(M,k,this):M(k)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,Nc),state:this.state,fetchFn:i};return s(M),M})();(h=Q(this,kf)==="infinite"?C$(this.options.pages):this.options.behavior)==null||h.onFetch(c,this),Pe(this,Mf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&pt(this,pi,Do).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta});const u=Pe(this,Qn,sj({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof O1&&M.revert&&this.setState({...Q(this,Mf),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{pt(this,pi,Do).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{pt(this,pi,Do).call(this,{type:"pause"})},onContinue:()=>{pt(this,pi,Do).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await u.start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(b=(y=Q(this,Zs).config).onSuccess)==null||b.call(y,M,this),(E=(w=Q(this,Zs).config).onSettled)==null||E.call(w,M,this.state.error,this),M}catch(M){if(M instanceof O1){if(M.silent)return Q(this,Qn).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw pt(this,pi,Do).call(this,{type:"error",error:M}),(T=(C=Q(this,Zs).config).onError)==null||T.call(C,M,this),(R=(N=Q(this,Zs).config).onSettled)==null||R.call(N,this.state.data,M,this),M}finally{Q(this,Qn)===u&&Pe(this,Qn,void 0),this.scheduleGc()}}},kf=new WeakMap,Cc=new WeakMap,Mf=new WeakMap,Zs=new WeakMap,Nc=new WeakMap,Qn=new WeakMap,kp=new WeakMap,Tc=new WeakMap,pi=new WeakSet,Do=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,...oj(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...tk(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,Mf,t.manual?s:void 0),s;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),Zn.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),Q(this,Zs).notify({query:this,type:"updated",action:t})})},UI);function oj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nk(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 Kr,Rt,Mp,Yr,Rc,Af,Lo,Ap,_f,Df,Oc,kc,ta,If,Pt,Sh,k1,M1,A1,_1,D1,I1,j1,L1,qI,lj=(qI=class extends ld{constructor(t,n){super();Xe(this,Pt);Xe(this,Kr);Xe(this,Rt);Xe(this,Mp);Xe(this,Yr);Xe(this,Rc);Xe(this,Af);Xe(this,Lo);Xe(this,Ap);Xe(this,_f);Xe(this,Df);Xe(this,Oc);Xe(this,kc);Xe(this,ta);Xe(this,If,new Set);this.options=n,Pe(this,Kr,t),Pe(this,Lo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,Rt).addObserver(this),rk(Q(this,Rt),this.options)?pt(this,Pt,Sh).call(this):this.updateResult(),pt(this,Pt,D1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return P1(Q(this,Rt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return P1(Q(this,Rt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pt(this,Pt,I1).call(this),pt(this,Pt,j1).call(this),Q(this,Rt).removeObserver(this)}setOptions(t){const n=this.options,r=Q(this,Rt);if(this.options=Q(this,Kr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof cn(this.options.enabled,Q(this,Rt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pt(this,Pt,L1).call(this),Q(this,Rt).setOptions(this.options),n._defaulted&&!p0(this.options,n)&&Q(this,Kr).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,Rt),observer:this});const s=this.hasListeners();s&&sk(Q(this,Rt),r,this.options,n)&&pt(this,Pt,Sh).call(this),this.updateResult(),s&&(Q(this,Rt)!==r||cn(this.options.enabled,Q(this,Rt))!==cn(n.enabled,Q(this,Rt))||cn(this.options.staleTime,Q(this,Rt))!==cn(n.staleTime,Q(this,Rt)))&&pt(this,Pt,M1).call(this);const i=pt(this,Pt,A1).call(this);s&&(Q(this,Rt)!==r||cn(this.options.enabled,Q(this,Rt))!==cn(n.enabled,Q(this,Rt))||i!==Q(this,ta))&&pt(this,Pt,_1).call(this,i)}getOptimisticResult(t){const n=Q(this,Kr).getQueryCache().build(Q(this,Kr),t),r=this.createResult(n,t);return p0(this.getCurrentResult(),r)||(Pe(this,Yr,r),Pe(this,Af,this.options),Pe(this,Rc,Q(this,Rt).state)),r}getCurrentResult(){return Q(this,Yr)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){Q(this,If).add(t)}getCurrentQuery(){return Q(this,Rt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Q(this,Kr).defaultQueryOptions(t),r=Q(this,Kr).getQueryCache().build(Q(this,Kr),n);let s=()=>{},i;const l=new Promise(c=>{i=c,s=Q(this,Kr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),c(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const c=this.createResult(r,n);return i==null||i(c),c}).finally(()=>{s()}),l])}fetch(t){return pt(this,Pt,Sh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,Yr)))}createResult(t,n){var D;const r=Q(this,Rt),s=this.options,i=Q(this,Yr),l=Q(this,Rc),c=Q(this,Af),u=t!==r?t.state:Q(this,Mp),{state:d}=t;let h={...d},m=!1,g;if(n._optimisticResults){const k=this.hasListeners(),I=!k&&rk(t,n),_=k&&sk(t,r,n,s);(I||_)&&(h={...h,...oj(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:w}=h;g=h.data;let E=!1;if(n.placeholderData!==void 0&&g===void 0&&w==="pending"){let k;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(k=i.data,E=!0):k=typeof n.placeholderData=="function"?n.placeholderData((D=Q(this,Df))==null?void 0:D.state.data,Q(this,Df)):n.placeholderData,k!==void 0&&(w="success",g=R1(i==null?void 0:i.data,k,n),m=!0)}if(n.select&&g!==void 0&&!E)if(i&&g===(l==null?void 0:l.data)&&n.select===Q(this,Ap))g=Q(this,_f);else try{Pe(this,Ap,n.select),g=n.select(g),g=R1(i==null?void 0:i.data,g,n),Pe(this,_f,g),Pe(this,Lo,null)}catch(k){Pe(this,Lo,k)}else g===void 0&&Pe(this,Lo,null);Q(this,Lo)&&(y=Q(this,Lo),g=Q(this,_f),b=Date.now(),w="error",m=!1);const C=h.fetchStatus==="fetching",T=w==="pending",N=w==="error",R=T&&C,M=g!==void 0;return{status:w,fetchStatus:h.fetchStatus,isPending:T,isSuccess:w==="success",isError:N,isInitialLoading:R,isLoading:R,data:g,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:N&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&M,isStale:NE(t,n),refetch:this.refetch,isEnabled:cn(n.enabled,t)!==!1}}updateResult(){const t=Q(this,Yr),n=this.createResult(Q(this,Rt),this.options);if(Pe(this,Rc,Q(this,Rt).state),Pe(this,Af,this.options),Q(this,Rc).data!==void 0&&Pe(this,Df,Q(this,Rt)),p0(n,t))return;Pe(this,Yr,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!Q(this,If).size)return!0;const c=new Set(l??Q(this,If));return this.options.throwOnError&&c.add("error"),Object.keys(Q(this,Yr)).some(u=>{const d=u;return Q(this,Yr)[d]!==t[d]&&c.has(d)})})();Zn.batch(()=>{s&&this.listeners.forEach(i=>{i(Q(this,Yr))}),Q(this,Kr).getQueryCache().notify({query:Q(this,Rt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pt(this,Pt,D1).call(this)}},Kr=new WeakMap,Rt=new WeakMap,Mp=new WeakMap,Yr=new WeakMap,Rc=new WeakMap,Af=new WeakMap,Lo=new WeakMap,Ap=new WeakMap,_f=new WeakMap,Df=new WeakMap,Oc=new WeakMap,kc=new WeakMap,ta=new WeakMap,If=new WeakMap,Pt=new WeakSet,Sh=function(t){pt(this,Pt,L1).call(this);let n=Q(this,Rt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Wr)),n},k1=function(t){return!EE()&&cn(this.options.enabled,Q(this,Rt))!==!1&&JI(t)},M1=function(){pt(this,Pt,I1).call(this);const t=cn(this.options.staleTime,Q(this,Rt));if(Q(this,Yr).isStale||!pt(this,Pt,k1).call(this,t))return;const n=ej(Q(this,Yr).dataUpdatedAt,t)+1;Pe(this,Oc,mc.setTimeout(()=>{Q(this,Yr).isStale||this.updateResult()},n))},A1=function(){return cn(this.options.refetchInterval,Q(this,Rt))??!1},_1=function(t){pt(this,Pt,j1).call(this),Pe(this,ta,t),!(Q(this,ta)===0||!pt(this,Pt,k1).call(this,Q(this,ta)))&&Pe(this,kc,mc.setInterval(()=>{(this.options.refetchIntervalInBackground||CE.isFocused())&&pt(this,Pt,Sh).call(this)},Q(this,ta)))},D1=function(){pt(this,Pt,M1).call(this),pt(this,Pt,_1).call(this,pt(this,Pt,A1).call(this))},I1=function(){Q(this,Oc)!==void 0&&(mc.clearTimeout(Q(this,Oc)),Pe(this,Oc,void 0))},j1=function(){Q(this,kc)!==void 0&&(mc.clearInterval(Q(this,kc)),Pe(this,kc,void 0))},L1=function(){const t=Q(this,Kr).getQueryCache().build(Q(this,Kr),this.options);if(t===Q(this,Rt))return;const n=Q(this,Rt);Pe(this,Rt,t),Pe(this,Mp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},qI);function R$(e,t){return cn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&cn(t.retryOnMount,e)===!1)}function rk(e,t){return R$(e,t)||e.state.data!==void 0&&P1(e,t,t.refetchOnMount)}function P1(e,t,n){if(cn(t.enabled,e)!==!1&&cn(t.staleTime,e)!=="static"){const r=cn(n,e);return r==="always"||r!==!1&&NE(e,t)}return!1}function sk(e,t,n,r){return(e!==t||cn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&NE(e,n)}function NE(e,t){return cn(t.enabled,e)!==!1&&e.isStaleByTime(cn(t.staleTime,e))}var _p,Yi,Ar,Mc,Wi,Ul,GI,O$=(GI=class extends ij{constructor(t){super();Xe(this,Wi);Xe(this,_p);Xe(this,Yi);Xe(this,Ar);Xe(this,Mc);Pe(this,_p,t.client),this.mutationId=t.mutationId,Pe(this,Ar,t.mutationCache),Pe(this,Yi,[]),this.state=t.state||aj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Q(this,Yi).includes(t)||(Q(this,Yi).push(t),this.clearGcTimeout(),Q(this,Ar).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,Yi,Q(this,Yi).filter(n=>n!==t)),this.scheduleGc(),Q(this,Ar).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Q(this,Yi).length||(this.state.status==="pending"?this.scheduleGc():Q(this,Ar).remove(this))}continue(){var t;return((t=Q(this,Mc))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var c,u,d,h,m,g,y,b,w,E,C,T,N,R,M,D,k,I;const n=()=>{pt(this,Wi,Ul).call(this,{type:"continue"})},r={client:Q(this,_p),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Pe(this,Mc,sj({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,P)=>{pt(this,Wi,Ul).call(this,{type:"failed",failureCount:_,error:P})},onPause:()=>{pt(this,Wi,Ul).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,Ar).canRun(this)})),i=this.state.status==="pending",l=!s.canStart();try{if(i)n();else{pt(this,Wi,Ul).call(this,{type:"pending",variables:t,isPaused:l}),Q(this,Ar).config.onMutate&&await Q(this,Ar).config.onMutate(t,this,r);const P=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));P!==this.state.context&&pt(this,Wi,Ul).call(this,{type:"pending",context:P,variables:t,isPaused:l})}const _=await s.start();return await((h=(d=Q(this,Ar).config).onSuccess)==null?void 0:h.call(d,_,t,this.state.context,this,r)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,_,t,this.state.context,r)),await((b=(y=Q(this,Ar).config).onSettled)==null?void 0:b.call(y,_,null,this.state.variables,this.state.context,this,r)),await((E=(w=this.options).onSettled)==null?void 0:E.call(w,_,null,t,this.state.context,r)),pt(this,Wi,Ul).call(this,{type:"success",data:_}),_}catch(_){try{await((T=(C=Q(this,Ar).config).onError)==null?void 0:T.call(C,_,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((R=(N=this.options).onError)==null?void 0:R.call(N,_,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((D=(M=Q(this,Ar).config).onSettled)==null?void 0:D.call(M,void 0,_,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((I=(k=this.options).onSettled)==null?void 0:I.call(k,void 0,_,t,this.state.context,r))}catch(P){Promise.reject(P)}throw pt(this,Wi,Ul).call(this,{type:"error",error:_}),_}finally{Q(this,Mc)===s&&Pe(this,Mc,void 0),Q(this,Ar).runNext(this)}}},_p=new WeakMap,Yi=new WeakMap,Ar=new WeakMap,Mc=new WeakMap,Wi=new WeakSet,Ul=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),Zn.batch(()=>{Q(this,Yi).forEach(r=>{r.onMutationUpdate(t)}),Q(this,Ar).notify({mutation:this,type:"updated",action:t})})},GI);function aj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Po,mi,Dp,KI,k$=(KI=class extends ld{constructor(t={}){super();Xe(this,Po);Xe(this,mi);Xe(this,Dp);this.config=t,Pe(this,Po,new Set),Pe(this,mi,new Map),Pe(this,Dp,0)}build(t,n,r){const s=new O$({client:t,mutationCache:this,mutationId:++kg(this,Dp)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Q(this,Po).add(t);const n=Mg(t);if(typeof n=="string"){const r=Q(this,mi).get(n);r?r.push(t):Q(this,mi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Q(this,Po).delete(t)){const n=Mg(t);if(typeof n=="string"){const r=Q(this,mi).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Q(this,mi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=Mg(t);if(typeof n=="string"){const s=(r=Q(this,mi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=Mg(t);return typeof n=="string"?((s=(r=Q(this,mi).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Zn.batch(()=>{Q(this,Po).forEach(t=>{this.notify({type:"removed",mutation:t})}),Q(this,Po).clear(),Q(this,mi).clear()})}getAll(){return Array.from(Q(this,Po))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>QO(n,r))}findAll(t={}){return this.getAll().filter(n=>QO(t,n))}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Wr))))}},Po=new WeakMap,mi=new WeakMap,Dp=new WeakMap,KI);function Mg(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zo,na,_r,Bo,eo,wh,z1,YI,M$=(YI=class extends ld{constructor(n,r){super();Xe(this,eo);Xe(this,zo);Xe(this,na);Xe(this,_r);Xe(this,Bo);Pe(this,zo,n),this.setOptions(r),this.bindMethods(),pt(this,eo,wh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Q(this,zo).defaultMutationOptions(n),p0(this.options,r)||Q(this,zo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,_r),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&va(r.mutationKey)!==va(this.options.mutationKey)?this.reset():((s=Q(this,_r))==null?void 0:s.state.status)==="pending"&&Q(this,_r).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&Q(this,_r)&&(Q(this,_r).addObserver(this),pt(this,eo,wh).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=Q(this,_r))==null||n.removeObserver(this)}onMutationUpdate(n){pt(this,eo,wh).call(this),pt(this,eo,z1).call(this,n)}getCurrentResult(){return Q(this,na)}reset(){var n;(n=Q(this,_r))==null||n.removeObserver(this),Pe(this,_r,void 0),pt(this,eo,wh).call(this),pt(this,eo,z1).call(this)}mutate(n,r){var s;return Pe(this,Bo,r),(s=Q(this,_r))==null||s.removeObserver(this),Pe(this,_r,Q(this,zo).getMutationCache().build(Q(this,zo),this.options)),Q(this,_r).addObserver(this),Q(this,_r).execute(n)}},zo=new WeakMap,na=new WeakMap,_r=new WeakMap,Bo=new WeakMap,eo=new WeakSet,wh=function(){var r;const n=((r=Q(this,_r))==null?void 0:r.state)??aj();Pe(this,na,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},z1=function(n){Zn.batch(()=>{var r,s,i,l,c,u,d,h;if(Q(this,Bo)&&this.hasListeners()){const m=Q(this,na).variables,g=Q(this,na).context,y={client:Q(this,zo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=Q(this,Bo)).onSuccess)==null||s.call(r,n.data,m,g,y)}catch(b){Promise.reject(b)}try{(l=(i=Q(this,Bo)).onSettled)==null||l.call(i,n.data,null,m,g,y)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(c=Q(this,Bo)).onError)==null||u.call(c,n.error,m,g,y)}catch(b){Promise.reject(b)}try{(h=(d=Q(this,Bo)).onSettled)==null||h.call(d,void 0,n.error,m,g,y)}catch(b){Promise.reject(b)}}}this.listeners.forEach(m=>{m(Q(this,na))})})},YI),Xi,WI,A$=(WI=class extends ld{constructor(t={}){super();Xe(this,Xi);this.config=t,Pe(this,Xi,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??vE(s,n);let l=this.get(i);return l||(l=new T$({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){Q(this,Xi).has(t.queryHash)||(Q(this,Xi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){Q(this,Xi).get(t.queryHash)===t&&(t.destroy(),Q(this,Xi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Q(this,Xi).get(t)}getAll(){return[...Q(this,Xi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XO(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XO(t,r)):n}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xi=new WeakMap,WI),yn,ra,sa,jf,Lf,ia,Pf,zf,XI,_$=(XI=class{constructor(e={}){Xe(this,yn);Xe(this,ra);Xe(this,sa);Xe(this,jf);Xe(this,Lf);Xe(this,ia);Xe(this,Pf);Xe(this,zf);Pe(this,yn,e.queryCache||new A$),Pe(this,ra,e.mutationCache||new k$),Pe(this,sa,e.defaultOptions||{}),Pe(this,jf,new Map),Pe(this,Lf,new Map),Pe(this,ia,0)}mount(){kg(this,ia)._++,Q(this,ia)===1&&(Pe(this,Pf,CE.subscribe(async e=>{e&&(await this.resumePausedMutations(),Q(this,yn).onFocus())})),Pe(this,zf,z0.subscribe(async e=>{e&&(await this.resumePausedMutations(),Q(this,yn).onOnline())})))}unmount(){var e,t;kg(this,ia)._--,Q(this,ia)===0&&((e=Q(this,Pf))==null||e.call(this),Pe(this,Pf,void 0),(t=Q(this,zf))==null||t.call(this),Pe(this,zf,void 0))}isFetching(e){return Q(this,yn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Q(this,ra).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Q(this,yn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Q(this,yn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(cn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Q(this,yn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var l;const r=this.defaultQueryOptions({queryKey:e}),s=(l=Q(this,yn).get(r.queryHash))==null?void 0:l.state.data,i=d$(t,s);if(i!==void 0)return Q(this,yn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Zn.batch(()=>Q(this,yn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Q(this,yn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Q(this,yn);Zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Q(this,yn);return Zn.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zn.batch(()=>Q(this,yn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Wr).catch(Wr)}invalidateQueries(e,t={}){return Zn.batch(()=>(Q(this,yn).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=Zn.batch(()=>Q(this,yn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Wr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Wr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Q(this,yn).build(this,t),r=n.isStaleByTime(cn(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Q(this,yn).build(this,t);return n.isStaleByTime(cn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wr).catch(Wr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wr).catch(Wr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return z0.isOnline()?Q(this,ra).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,yn)}getMutationCache(){return Q(this,ra)}getDefaultOptions(){return Q(this,sa)}setDefaultOptions(e){Pe(this,sa,e)}setQueryDefaults(e,t){Q(this,jf).set(va(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Q(this,jf).values()],n={};return t.forEach(r=>{Bf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Q(this,Lf).set(va(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Q(this,Lf).values()],n={};return t.forEach(r=>{Bf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Q(this,sa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vE(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===ri&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Q(this,sa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Q(this,yn).clear(),Q(this,ra).clear()}},yn=new WeakMap,ra=new WeakMap,sa=new WeakMap,jf=new WeakMap,Lf=new WeakMap,ia=new WeakMap,Pf=new WeakMap,zf=new WeakMap,XI);const cj=O.createContext(!1),D$=()=>O.useContext(cj);cj.Provider;function I$(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const j$=O.createContext(I$()),L$=()=>O.useContext(j$),P$=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?wE(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},z$=e=>{O.useEffect(()=>{e.clearReset()},[e])},B$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||wE(n,[e.error,r])),H$=(e,t)=>t.state.data===void 0,F$=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$$=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,V$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uj(e,t,n){const r=D$(),s=L$(),i=Ri(),l=i.defaultQueryOptions(e),c=i.getQueryCache().get(l.queryHash),u=e.subscribed!==!1;l._optimisticResults=r?"isRestoring":u?"optimistic":void 0,F$(l),P$(l,s,c),z$(s);const[d]=O.useState(()=>new t(i,l)),h=d.getOptimisticResult(l),m=!r&&u;if(O.useSyncExternalStore(O.useCallback(g=>{const y=m?d.subscribe(Zn.batchCalls(g)):Wr;return d.updateResult(),y},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(l)},[l,d]),$$(l,h))throw V$(l,d,s);if(B$({result:h,errorResetBoundary:s,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw h.error;return l.notifyOnChangeProps?h:d.trackResult(h)}function Zc(e,t){return uj(e,lj)}function fj(e,t){return uj({...e,enabled:!0,suspense:!0,throwOnError:H$,placeholderData:void 0},lj)}function Nn(e,t){const n=Ri(),[r]=O.useState(()=>new M$(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const s=O.useSyncExternalStore(O.useCallback(l=>r.subscribe(Zn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=O.useCallback((...l)=>{r.mutate(l[0],l[1]).catch(Wr)},[r]);if(s.error&&wE(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}var aS={exports:{}},ch={},cS={exports:{}},uS={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var ik;function U$(){return ik||(ik=1,(function(e){function t(L,$){var q=L.length;L.push($);e:for(;0<q;){var G=q-1>>>1,W=L[G];if(0<s(W,$))L[G]=$,L[q]=W,q=G;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var $=L[0],q=L.pop();if(q!==$){L[0]=q;e:for(var G=0,W=L.length,Z=W>>>1;G<Z;){var re=2*(G+1)-1,de=L[re],F=re+1,X=L[F];if(0>s(de,q))F<W&&0>s(X,de)?(L[G]=X,L[F]=q,G=F):(L[G]=de,L[re]=q,G=re);else if(F<W&&0>s(X,q))L[G]=X,L[F]=q,G=F;else break e}}return $}function s(L,$){var q=L.sortIndex-$.sortIndex;return q!==0?q:L.id-$.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,c=l.now();e.unstable_now=function(){return l.now()-c}}var u=[],d=[],h=1,m=null,g=3,y=!1,b=!1,w=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(L){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=L)r(d),$.sortIndex=$.expirationTime,t(u,$);else break;$=n(d)}}function M(L){if(w=!1,R(L),!b)if(n(u)!==null)b=!0,D||(D=!0,z());else{var $=n(d);$!==null&&B(M,$.startTime-L)}}var D=!1,k=-1,I=5,_=-1;function P(){return E?!0:!(e.unstable_now()-_<I)}function H(){if(E=!1,D){var L=e.unstable_now();_=L;var $=!0;try{e:{b=!1,w&&(w=!1,T(k),k=-1),y=!0;var q=g;try{t:{for(R(L),m=n(u);m!==null&&!(m.expirationTime>L&&P());){var G=m.callback;if(typeof G=="function"){m.callback=null,g=m.priorityLevel;var W=G(m.expirationTime<=L);if(L=e.unstable_now(),typeof W=="function"){m.callback=W,R(L),$=!0;break t}m===n(u)&&r(u),R(L)}else r(u);m=n(u)}if(m!==null)$=!0;else{var Z=n(d);Z!==null&&B(M,Z.startTime-L),$=!1}}break e}finally{m=null,g=q,y=!1}$=void 0}}finally{$?z():D=!1}}}var z;if(typeof N=="function")z=function(){N(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,j=U.port2;U.port1.onmessage=H,z=function(){j.postMessage(null)}}else z=function(){C(H,0)};function B(L,$){k=C(function(){L(e.unstable_now())},$)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(L){switch(g){case 1:case 2:case 3:var $=3;break;default:$=g}var q=g;g=$;try{return L()}finally{g=q}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(L,$){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var q=g;g=L;try{return $()}finally{g=q}},e.unstable_scheduleCallback=function(L,$,q){var G=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?G+q:G):q=G,L){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=q+W,L={id:h++,callback:$,priorityLevel:L,startTime:q,expirationTime:W,sortIndex:-1},q>G?(L.sortIndex=q,t(d,L),n(u)===null&&L===n(d)&&(w?(T(k),k=-1):w=!0,B(M,q-G))):(L.sortIndex=W,t(u,L),b||y||(b=!0,D||(D=!0,z()))),L},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(L){var $=g;return function(){var q=g;g=$;try{return L.apply(this,arguments)}finally{g=q}}}})(uS)),uS}var ok;function q$(){return ok||(ok=1,cS.exports=U$()),cS.exports}var fS={exports:{}},vr={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var lk;function G$(){if(lk)return vr;lk=1;var e=Ip();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" 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},s=Symbol.for("react.portal"),i=Symbol.for("react.recoverable"),l=Symbol.for("react.optimistic_key");function c(h,m,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:y===l?l:""+y,children:h,containerInfo:m,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vr.browser=function(h){return{$$typeof:i,_reason:h}},vr.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(h,m,null,g)},vr.flushSync=function(h){var m=u.T,g=r.p;try{if(u.T=null,r.p=2,h)return h()}finally{u.T=m,r.p=g,r.d.f()}},vr.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},vr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},vr.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=d(g,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):g==="script"&&r.d.X(h,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},vr.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}}else m==null&&r.d.M(h)},vr.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=d(g,m.crossOrigin);r.d.L(h,g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},vr.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}else r.d.m(h)},vr.requestFormReset=function(h){r.d.r(h)},vr.unstable_batchedUpdates=function(h,m){return h(m)},vr.useFormState=function(h,m,g){return u.H.useFormState(h,m,g)},vr.useFormStatus=function(){return u.H.useHostTransitionStatus()},vr.version="19.3.0",vr}var ak;function dj(){if(ak)return fS.exports;ak=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(),fS.exports=G$(),fS.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var ck;function K$(){if(ck)return ch;ck=1;var e=q$(),t=Ip(),n=dj();function r(o){var a="https://react.dev/errors/"+o;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)a+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){for(var a=o,f=a;f&&!f.alternate;)a=f,(a.flags&4098)!==0&&(o=a.return),f=a.return;for(;a.return;)a=a.return;return a.tag===3?o:null}function l(o){if(o.tag===13){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function c(o){if(o.tag===31){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function u(o){if(i(o)!==o)throw Error(r(188))}function d(o){var a=o.alternate;if(!a){if(a=i(o),a===null)throw Error(r(188));return a!==o?null:o}for(var f=o,p=a;;){var v=f.return;if(v===null)break;var S=v.alternate;if(S===null){if(p=v.return,p!==null){f=p;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===f)return u(v),o;if(S===p)return u(v),a;S=S.sibling}throw Error(r(188))}if(f.return!==p.return)f=v,p=S;else{for(var A=!1,V=v.child;V;){if(V===f){A=!0,f=v,p=S;break}if(V===p){A=!0,p=v,f=S;break}V=V.sibling}if(!A){for(V=S.child;V;){if(V===f){A=!0,f=S,p=v;break}if(V===p){A=!0,p=S,f=v;break}V=V.sibling}if(!A)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:a}function h(o){var a=o.tag;if(a===5||a===26||a===27||a===6)return o;for(o=o.child;o!==null;){if(a=h(o),a!==null)return a;o=o.sibling}return null}function m(o,a,f,p,v,S){for(;o!==null;){if((o.tag===5||o.tag===27||o.tag===6)&&f(o,p,v,S)||(o.tag!==22||o.memoizedState===null)&&(a||o.tag!==5&&o.tag!==27)&&m(o.child,a,f,p,v,S))return!0;o=o.sibling}return!1}function g(o){for(o=o.return;o!==null;){if(o.tag===3||o.tag===5||o.tag===27)return o;o=o.return}return null}function y(o){var a=!1;for(o=o.return;o!==null&&(o.tag===4&&(a=!0),!(o.tag===3||o.tag===5||o.tag===27));)o=o.return;return a}function b(o){var a=[null,null],f=g(o);return f===null||w(a,o,f.child,{foundSelf:!1}),a}function w(o,a,f,p){for(;f!==null;){if(f===a)p.foundSelf=!0;else if(f.tag===5||f.tag===27||f.tag===6){if(p.foundSelf)return o[1]=f,!0;o[0]=f}else if((f.tag!==22||f.memoizedState===null)&&w(o,a,f.child,p))return!0;f=f.sibling}return!1}function E(o){switch(o.tag){case 5:case 27:case 6:return o.stateNode;case 3:return o.stateNode.containerInfo;default:throw Error(r(559))}}var C=null,T=null;function N(o,a,f){return o===f?!0:o===a?(C=o,!0):!1}function R(o,a,f){return o===f?(T=o,!1):o===a?(T!==null&&(C=o),!0):!1}function M(o){if(o===null)return null;do o=o===null?null:o.return;while(o&&o.tag!==5&&o.tag!==27&&o.tag!==3);return o||null}function D(o,a,f){for(var p=0,v=o;v;v=f(v))p++;v=0;for(var S=a;S;S=f(S))v++;for(;0<p-v;)o=f(o),p--;for(;0<v-p;)a=f(a),v--;for(;p--;){if(o===a||a!==null&&o===a.alternate)return o;o=f(o),a=f(a)}return null}var k=Object.assign,I=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),B=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),re=Symbol.for("react.legacy_hidden"),de=Symbol.for("react.memo_cache_sentinel"),F=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),te=Symbol.iterator;function J(o){return o===null||typeof o!="object"?null:(o=te&&o[te]||o["@@iterator"],typeof o=="function"?o:null)}var K=Symbol.for("react.client.reference");function ce(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===K?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case H:return"Fragment";case U:return"Profiler";case z:return"StrictMode";case $:return"Suspense";case q:return"SuspenseList";case Z:return"Activity";case F:return"ViewTransition"}if(typeof o=="object")switch(o.$$typeof){case P:return"Portal";case B:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case L:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case G:return a=o.displayName||null,a!==null?a:ce(o.type)||"Memo";case W:a=o._payload,o=o._init;try{return ce(o(a))}catch{}}return null}var ye=Array.isArray,ge=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],ke=-1;function _e(o){return{current:o}}function we(o){0>ke||(o.current=Se[ke],Se[ke]=null,ke--)}function Re(o,a){ke++,Se[ke]=o.current,o.current=a}var Ae=_e(null),Le=_e(null),Ie=_e(null),Ue=_e(null);function We(o,a){switch(Re(Ie,a),Re(Le,o),Re(Ae,null),a.nodeType){case 9:case 11:o=(o=a.documentElement)&&(o=o.namespaceURI)?eO(o):0;break;default:if(o=a.tagName,a=a.namespaceURI)a=eO(a),o=tO(a,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}we(Ae),Re(Ae,o)}function Oe(){we(Ae),we(Le),we(Ie)}function De(o){var a=o.memoizedState;a!==null&&(Wu._currentValue=a.memoizedState,Re(Ue,o)),a=Ae.current;var f=tO(a,o.type);a!==f&&(Re(Le,o),Re(Ae,f))}function ne(o){Le.current===o&&(we(Ae),we(Le)),Ue.current===o&&(we(Ue),Wu._currentValue=xe)}var he,se;function Te(o){if(he===void 0)try{throw Error()}catch(f){var a=f.stack.trim().match(/\n( *(at )?)/);he=a&&a[1]||"",se=-1<f.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+he+o+se}var Ve=!1;function jt(o,a){if(!o||Ve)return"";Ve=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(a){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(je){var ie=je}Reflect.construct(o,[],ve)}else{try{ve.call()}catch(je){ie=je}ve=!1;try{var fe=Object.getOwnPropertyDescriptor(o.prototype,"props");Object.defineProperty(o.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ve=!0,new o}finally{ve&&(fe!==void 0?Object.defineProperty(o.prototype,"props",fe):delete o.prototype.props)}}}else{try{throw Error()}catch(je){ie=je}(ve=o())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(je){if(je&&ie&&typeof je.stack=="string")return[je.stack,ie.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),A=S[0],V=S[1];if(A&&V){var Y=A.split(`
45
- `),ae=V.split(`
46
- `);for(v=p=0;p<Y.length&&!Y[p].includes("DetermineComponentFrameRoot");)p++;for(;v<ae.length&&!ae[v].includes("DetermineComponentFrameRoot");)v++;if(p===Y.length||v===ae.length)for(p=Y.length-1,v=ae.length-1;1<=p&&0<=v&&Y[p]!==ae[v];)v--;for(;1<=p&&0<=v;p--,v--)if(Y[p]!==ae[v]){if(p!==1||v!==1)do if(p--,v--,0>v||Y[p]!==ae[v]){var me=`
47
- `+Y[p].replace(" at new "," at ");return o.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",o.displayName)),me}while(1<=p&&0<=v);break}}}finally{Ve=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?Te(f):""}function hn(o,a){switch(o.tag){case 26:case 27:case 5:return Te(o.type);case 16:return Te("Lazy");case 13:return o.child!==a&&a!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return jt(o.type,!1);case 11:return jt(o.type.render,!1);case 1:return jt(o.type,!0);case 31:return Te("Activity");case 30:return Te("ViewTransition");default:return""}}function Fe(o){try{var a="",f=null;do a+=hn(o,f),f=o,o=o.return;while(o);return a}catch(p){return`
48
- Error generating stack: `+p.message+`
49
- `+p.stack}}var Tt=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,Vn=e.unstable_cancelCallback,Un=e.unstable_shouldYield,xs=e.unstable_requestPaint,on=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,zr=e.unstable_ImmediatePriority,bs=e.unstable_UserBlockingPriority,qn=e.unstable_NormalPriority,mt=e.unstable_LowPriority,ln=e.unstable_IdlePriority,Gn=e.log,Rn=e.unstable_setDisableYieldValue,On=null,Bt=null;function Wt(o){if(typeof Gn=="function"&&Rn(o),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(On,o)}catch{}}var Xt=Math.clz32?Math.clz32:_n,Br=Math.log,Kn=Math.LN2;function _n(o){return o>>>=0,o===0?32:31-(Br(o)/Kn|0)|0}var cr=256,ur=262144,fr=4194304;function ns(o){var a=o&42;if(a!==0)return a;switch(o&-o){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 o&-o;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Rr(o,a,f){var p=o.pendingLanes;if(p===0)return 0;var v=0,S=o.suspendedLanes,A=o.pingedLanes;o=o.warmLanes;var V=p&134217727;return V!==0?(p=V&~S,p!==0?v=ns(p):(A&=V,A!==0?v=ns(A):f||(f=V&~o,f!==0&&(v=ns(f))))):(V=p&~S,V!==0?v=ns(V):A!==0?v=ns(A):f||(f=p&~o,f!==0&&(v=ns(f)))),v===0?0:a!==0&&a!==v&&(a&S)===0&&(S=v&-v,f=a&-a,S>=f||S===32&&(f&4194048)!==0)?a:v}function Or(o,a){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&a)===0}function rs(o,a){(a&8)!==0&&(a|=a&32);var f=o.entangledLanes;if(f!==0)for(o=o.entanglements,f&=a;0<f;){var p=31-Xt(f),v=1<<p;a|=o[p],f&=~v}return a}function oi(o,a){switch(o){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 dr(){var o=fr;return fr<<=1,(fr&62914560)===0&&(fr=4194304),o}function Ai(o){for(var a=[],f=0;31>f;f++)a.push(o);return a}function vs(o,a){o.pendingLanes|=a,a!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function cl(o,a,f,p,v,S){var A=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var V=o.entanglements,Y=o.expirationTimes,ae=o.hiddenUpdates;for(f=A&~f;0<f;){var me=31-Xt(f),ve=1<<me;V[me]=0,Y[me]=-1;var ie=ae[me];if(ie!==null)for(ae[me]=null,me=0;me<ie.length;me++){var fe=ie[me];fe!==null&&(fe.lane&=-536870913)}f&=~ve}p!==0&&Ss(o,p,0),S!==0&&v===0&&o.tag!==0&&(o.suspendedLanes|=S&~(A&~a))}function Ss(o,a,f){o.pendingLanes|=a,o.suspendedLanes&=~a;var p=31-Xt(a);o.entangledLanes|=a,o.entanglements[p]=o.entanglements[p]|1073741824|f&261930}function ul(o,a){var f=o.entangledLanes|=a;for(o=o.entanglements;f;){var p=31-Xt(f),v=1<<p;v&a|o[p]&a&&(o[p]|=a),f&=~v}}function uo(o,a){var f=a&-a;return f=(f&42)!==0?1:li(f),(f&(o.suspendedLanes|a))!==0?0:f}function li(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function ss(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function is(){var o=oe.p;return o!==0?o:(o=window.event,o===void 0?32:zO(o.type))}function fo(o,a){var f=oe.p;try{return oe.p=o,a()}finally{oe.p=f}}var pn=Math.random().toString(36).slice(2),nn="__reactFiber$"+pn,Yn="__reactProps$"+pn,Hr="__reactContainer$"+pn,La="__reactEvents$"+pn,ho="__reactListeners$"+pn,fl="__reactHandles$"+pn,_i="__reactResources$"+pn,po="__reactMarker$"+pn,dl="__reactLoad$"+pn;function hl(o){delete o[nn],delete o[Yn],delete o[ho],delete o[fl]}function ws(o){var a;if(a=o[nn])return a;for(var f=o.parentNode;f;){if(a=f[Hr]||f[nn]){if(f=a.alternate,a.child!==null||f!==null&&f.child!==null)for(o=xO(o);o!==null;){if(f=o[nn])return f;o=xO(o)}return a}o=f,f=o.parentNode}return null}function mo(o){if(o=o[nn]||o[Hr]){var a=o.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return o}return null}function pe(o){var a=o.tag;if(a===5||a===26||a===27||a===6)return o.stateNode;throw Error(r(33))}function Ee(o){var a=o[_i];return a||(a=o[_i]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ce(o){o[po]=!0}function Ge(o){o[dl]=void 0}var ot=new Set,it={};function at(o,a){Ht(o,a),Ht(o+"Capture",a)}function Ht(o,a){for(it[o]=a,o=0;o<a.length;o++)ot.add(a[o])}var It=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]*$"),Ze={},ut={};function At(o){return Tt.call(ut,o)?!0:Tt.call(Ze,o)?!1:It.test(o)?ut[o]=!0:(Ze[o]=!0,!1)}var tt=!1;function Wn(){var o=tt;return tt=!1,o}function mn(o,a,f){if(At(a))if(f===null)o.removeAttribute(a);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(a);return;case"boolean":var p=a.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(a);return}}o.setAttribute(a,f)}}function Es(o,a,f){if(f===null)o.removeAttribute(a);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(a);return}o.setAttribute(a,f)}}function Dn(o,a,f,p){if(p===null)o.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(a,f,p)}}function In(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function hu(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function yd(o,a,f){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,a);if(!o.hasOwnProperty(a)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var v=p.get,S=p.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return v.call(this)},set:function(A){f=""+A,S.call(this,A)}}),Object.defineProperty(o,a,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(A){f=""+A},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function go(o){if(!o._valueTracker){var a=hu(o)?"checked":"value";o._valueTracker=yd(o,a,""+o[a])}}function pu(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var f=a.getValue(),p="";return o&&(p=hu(o)?o.checked?"true":"false":o.value),o=p,o!==f?(a.setValue(o),!0):!1}var fm=/[\n"\\]/g;function rn(o){return o.replace(fm,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function kr(o,a,f,p,v,S,A,V){o.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.type=A:o.removeAttribute("type"),a!=null?A==="number"?(a===0&&o.value===""||o.value!=a)&&(o.value=""+In(a)):o.value!==""+In(a)&&(o.value=""+In(a)):A!=="submit"&&A!=="reset"||o.removeAttribute("value"),a!=null?A==="number"&&o.value==a?mu(o,In(o.value)):mu(o,In(a)):f!=null?mu(o,In(f)):p!=null&&o.removeAttribute("value"),v==null&&S!=null&&(o.defaultChecked=!!S),v!=null&&(o.checked=v&&typeof v!="function"&&typeof v!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?o.name=""+In(V):o.removeAttribute("name")}function pl(o,a,f,p,v,S,A,V){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),a!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||a!=null)){go(o);return}f=f!=null?""+In(f):"",a=a!=null?""+In(a):f,V||a===o.value||(o.value=a),o.defaultValue=a}p=p??v,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=V?o.checked:!!p,o.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(o.name=A),go(o)}function mu(o,a){o.defaultValue!==""+a&&(o.defaultValue=""+a)}function ls(o,a,f,p){if(o=o.options,a){a={};for(var v=0;v<f.length;v++)a["$"+f[v]]=!0;for(f=0;f<o.length;f++)v=a.hasOwnProperty("$"+o[f].value),o[f].selected!==v&&(o[f].selected=v),v&&p&&(o[f].defaultSelected=!0)}else{for(f=""+In(f),a=null,v=0;v<o.length;v++){if(o[v].value===f){o[v].selected=!0,p&&(o[v].defaultSelected=!0);return}a!==null||o[v].disabled||(a=o[v])}a!==null&&(a.selected=!0)}}function gu(o,a,f){if(a!=null&&(a=""+In(a),a!==o.value&&(o.value=a),f==null)){o.defaultValue!==a&&(o.defaultValue=a);return}o.defaultValue=f!=null?""+In(f):""}function Cs(o,a,f,p){if(a==null){if(p!=null){if(f!=null)throw Error(r(92));if(ye(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),a=f}f=In(a),o.defaultValue=f,p=o.textContent,p===f&&p!==""&&p!==null&&(o.value=p),go(o)}function Fr(o,a){if(a){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=a;return}}o.textContent=a}var ml=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 xd(o,a,f){var p=a.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?o.setProperty(a,""):a==="float"?o.cssFloat="":o[a]="":p?o.setProperty(a,f):typeof f!="number"||f===0||ml.has(a)?a==="float"?o.cssFloat=f:o[a]=(""+f).trim():o[a]=f+"px"}function Ns(o,a,f){if(a!=null&&typeof a!="object")throw Error(r(62));if(o=o.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||a!=null&&a.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="",tt=!0);for(var v in a)p=a[v],a.hasOwnProperty(v)&&f[v]!==p&&(xd(o,v,p),tt=!0)}else for(var S in a)a.hasOwnProperty(S)&&xd(o,S,a[S])}function Pa(o){if(o.indexOf("-")===-1)return!1;switch(o){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 bd=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"],["maskType","mask-type"],["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"]]),vd=/^[\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 hr(o){return vd.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function $r(){}var za=null;function Ba(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ot=null,er=null;function Vs(o){var a=mo(o);if(a&&(o=a.stateNode)){var f=o[Yn]||null;e:switch(o=a.stateNode,a.type){case"input":if(kr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),a=f.name,f.type==="radio"&&a!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+rn(""+a)+'"][type="radio"]'),a=0;a<f.length;a++){var p=f[a];if(p!==o&&p.form===o.form){var v=p[Yn]||null;if(!v)throw Error(r(90));kr(p,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(a=0;a<f.length;a++)p=f[a],p.form===o.form&&pu(p)}break e;case"textarea":gu(o,f.value,f.defaultValue);break e;case"select":a=f.value,a!=null&&ls(o,!!f.multiple,a,!1)}}}var Ts=!1;function Ha(o,a,f){if(Ts)return o(a,f);Ts=!0;try{var p=o(a);return p}finally{if(Ts=!1,(Ot!==null||er!==null)&&(fg(),Ot&&(a=Ot,o=er,er=Ot=null,Vs(a),o)))for(a=0;a<o.length;a++)Vs(o[a])}}function yo(o,a){var f=o.stateNode;if(f===null)return null;var p=f[Yn]||null;if(p===null)return null;f=p[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,a,typeof f));return f}var pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fa=!1;if(pr)try{var Sd={};Object.defineProperty(Sd,"passive",{get:function(){Fa=!0}}),window.addEventListener("test",Sd,Sd),window.removeEventListener("test",Sd,Sd)}catch{Fa=!1}var gl=null,Vx=null,dm=null;function X2(){if(dm)return dm;var o,a=Vx,f=a.length,p,v="value"in gl?gl.value:gl.textContent,S=v.length;for(o=0;o<f&&a[o]===v[o];o++);var A=f-o;for(p=1;p<=A&&a[f-p]===v[S-p];p++);return dm=v.slice(o,1<p?1-p:void 0)}function hm(o){var a=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&a===13&&(o=13)):o=a,o===10&&(o=13),32<=o||o===13?o:0}function pm(){return!0}function Q2(){return!1}function Vr(o){function a(f,p,v,S,A){this._reactName=f,this._targetInst=v,this.type=p,this.nativeEvent=S,this.target=A,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(S):S[V]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?pm:Q2,this.isPropagationStopped=Q2,this}return k(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=pm)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=pm)},persist:function(){},isPersistent:pm}),a}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mm=Vr(yl),wd=k({},yl,{view:0,detail:0}),NH=Vr(wd),Ux,qx,Ed,gm=k({},wd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kx,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ed&&(Ed&&o.type==="mousemove"?(Ux=o.screenX-Ed.screenX,qx=o.screenY-Ed.screenY):qx=Ux=0,Ed=o),Ux)},movementY:function(o){return"movementY"in o?o.movementY:qx}}),Z2=Vr(gm),TH=k({},gm,{dataTransfer:0}),RH=Vr(TH),OH=k({},wd,{relatedTarget:0}),Gx=Vr(OH),kH=k({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),MH=Vr(kH),AH=k({},yl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),_H=Vr(AH),DH=k({},yl,{data:0}),J2=Vr(DH),IH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jH={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"},LH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PH(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=LH[o])?!!a[o]:!1}function Kx(){return PH}var zH=k({},wd,{key:function(o){if(o.key){var a=IH[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=hm(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?jH[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kx,charCode:function(o){return o.type==="keypress"?hm(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?hm(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),BH=Vr(zH),HH=k({},gm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eN=Vr(HH),FH=k({},yl,{submitter:0}),$H=Vr(FH),VH=k({},wd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kx}),UH=Vr(VH),qH=k({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),GH=Vr(qH),KH=k({},gm,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),YH=Vr(KH),WH=k({},yl,{newState:0,oldState:0,source:0}),XH=Vr(WH),QH=[9,13,27,32],Yx=pr&&"CompositionEvent"in window,Cd=null;pr&&"documentMode"in document&&(Cd=document.documentMode);var ZH=pr&&"TextEvent"in window&&!Cd,tN=pr&&(!Yx||Cd&&8<Cd&&11>=Cd),nN=" ",rN=!1;function sN(o,a){switch(o){case"keyup":return QH.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iN(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var yu=!1;function JH(o,a){switch(o){case"compositionend":return iN(a);case"keypress":return a.which!==32?null:(rN=!0,nN);case"textInput":return o=a.data,o===nN&&rN?null:o;default:return null}}function eF(o,a){if(yu)return o==="compositionend"||!Yx&&sN(o,a)?(o=X2(),dm=Vx=gl=null,yu=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return tN&&a.locale!=="ko"?null:a.data;default:return null}}var tF={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 oN(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!tF[o.type]:a==="textarea"}function lN(o,a,f,p){Ot?er?er.push(p):er=[p]:Ot=p,a=yg(a,"onChange"),0<a.length&&(f=new mm("onChange","change",null,f,p),o.push({event:f,listeners:a}))}var Nd=null,Td=null;function nF(o){YR(o,0)}function ym(o){var a=pe(o);if(pu(a))return o}function aN(o,a){if(o==="change")return a}var cN=!1;if(pr){var Wx;if(pr){var Xx="oninput"in document;if(!Xx){var uN=document.createElement("div");uN.setAttribute("oninput","return;"),Xx=typeof uN.oninput=="function"}Wx=Xx}else Wx=!1;cN=Wx&&(!document.documentMode||9<document.documentMode)}function fN(){Nd&&(Nd.detachEvent("onpropertychange",dN),Td=Nd=null)}function dN(o){if(o.propertyName==="value"&&ym(Td)){var a=[];lN(a,Td,o,Ba(o)),Ha(nF,a)}}function rF(o,a,f){o==="focusin"?(fN(),Nd=a,Td=f,Nd.attachEvent("onpropertychange",dN)):o==="focusout"&&fN()}function sF(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ym(Td)}function iF(o,a){if(o==="click")return ym(a)}function oF(o,a){if(o==="input"||o==="change")return ym(a)}function lF(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Rs=typeof Object.is=="function"?Object.is:lF;function Rd(o,a){if(Rs(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var f=Object.keys(o),p=Object.keys(a);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var v=f[p];if(!Tt.call(a,v)||!Rs(o[v],a[v]))return!1}return!0}function Qx(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function hN(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function pN(o,a){var f=hN(o);o=0;for(var p;f;){if(f.nodeType===3){if(p=o+f.textContent.length,o<=a&&p>=a)return{node:f,offset:a-o};o=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=hN(f)}}function mN(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?mN(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function gN(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var a=Qx(o.document);a instanceof o.HTMLIFrameElement;){try{var f=typeof a.contentWindow.location.href=="string"}catch{f=!1}if(f)o=a.contentWindow;else break;a=Qx(o.document)}return a}function Zx(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}var aF=pr&&"documentMode"in document&&11>=document.documentMode,xu=null,Jx=null,Od=null,eb=!1;function yN(o,a,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;eb||xu==null||xu!==Qx(p)||(p=xu,"selectionStart"in p&&Zx(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Od&&Rd(Od,p)||(Od=p,p=yg(Jx,"onSelect"),0<p.length&&(a=new mm("onSelect","select",null,a,f),o.push({event:a,listeners:p}),a.target=xu)))}function $a(o,a){var f={};return f[o.toLowerCase()]=a.toLowerCase(),f["Webkit"+o]="webkit"+a,f["Moz"+o]="moz"+a,f}var bu={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionrun:$a("Transition","TransitionRun"),transitionstart:$a("Transition","TransitionStart"),transitioncancel:$a("Transition","TransitionCancel"),transitionend:$a("Transition","TransitionEnd")},tb={},xN={};pr&&(xN=document.createElement("div").style,"AnimationEvent"in window||(delete bu.animationend.animation,delete bu.animationiteration.animation,delete bu.animationstart.animation),"TransitionEvent"in window||delete bu.transitionend.transition);function Va(o){if(tb[o])return tb[o];if(!bu[o])return o;var a=bu[o],f;for(f in a)if(a.hasOwnProperty(f)&&f in xN)return tb[o]=a[f];return o}var bN=Va("animationend"),vN=Va("animationiteration"),SN=Va("animationstart"),cF=Va("transitionrun"),uF=Va("transitionstart"),fF=Va("transitioncancel"),wN=Va("transitionend"),EN=new Map,nb="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");nb.push("scrollEnd");function ai(o,a){EN.set(o,a),at(a,[o])}var dF=0;function xo(o,a){if(o.name!=null&&o.name!=="auto")return o.name;if(a.autoName!==null)return a.autoName;o=di.identifierPrefix;var f=dF++;return o="_"+o+"t_"+f.toString(32)+"_",a.autoName=o}function CN(o){if(o==null||typeof o=="string")return o;var a=null,f=Bu;if(f!==null)for(var p=0;p<f.length;p++){var v=o[f[p]];if(v!=null){if(v==="none")return"none";a=a==null?v:a+(" "+v)}}return a??o.default}function bo(o,a){return o=CN(o),a=CN(a),a==null?o==="auto"?null:o:a==="auto"?null:a}var xm=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Us=[],vu=0,rb=0;function bm(){for(var o=vu,a=rb=vu=0;a<o;){var f=Us[a];Us[a++]=null;var p=Us[a];Us[a++]=null;var v=Us[a];Us[a++]=null;var S=Us[a];if(Us[a++]=null,p!==null&&v!==null){var A=p.pending;A===null?v.next=v:(v.next=A.next,A.next=v),p.pending=v}S!==0&&NN(f,v,S)}}function vm(o,a,f,p){Us[vu++]=o,Us[vu++]=a,Us[vu++]=f,Us[vu++]=p,rb|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function sb(o,a,f,p){return vm(o,a,f,p),Sm(o)}function Ua(o,a){return vm(o,null,null,a),Sm(o)}function NN(o,a,f){o.lanes|=f;var p=o.alternate;p!==null&&(p.lanes|=f);for(var v=!1,S=o.return;S!==null;)S.childLanes|=f,p=S.alternate,p!==null&&(p.childLanes|=f),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(v=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,v&&a!==null&&(v=31-Xt(f),o=S.hiddenUpdates,p=o[v],p===null?o[v]=[a]:p.push(a),a.lane=f|536870912),S):null}function Sm(o){if(50<Xd)throw Xd=0,ug=null,Error(r(185));for(var a=o.return;a!==null;)o=a,a=o.return;return o.tag===3?o.stateNode:null}var Su={};function hF(o,a,f,p){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function as(o,a,f,p){return new hF(o,a,f,p)}function ib(o){return o=o.prototype,!(!o||!o.isReactComponent)}function vo(o,a){var f=o.alternate;return f===null?(f=as(o.tag,a,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=a,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&1206910976,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,a=o.dependencies,f.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function TN(o,a){o.flags&=1206910978;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=a,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,a=f.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),o}function wm(o,a,f,p,v,S){var A=0;if(p=o,typeof p=="function")ib(p)&&(A=1);else if(typeof p=="string")A=F8(o,f,Ae.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(p){case Z:return o=as(31,f,a,v),o.elementType=Z,o.lanes=S,o;case H:return qa(f.children,v,S,a);case z:A=8,v|=24;break;case U:return o=as(12,f,a,v|2),o.elementType=U,o.lanes=S,o;case $:return o=as(13,f,a,v),o.elementType=$,o.lanes=S,o;case q:return o=as(19,f,a,v),o.elementType=q,o.lanes=S,o;case re:case F:return o=v|32,o=as(30,f,a,o),o.elementType=F,o.lanes=S,o.stateNode={autoName:null,paired:null,clones:null,ref:null},o;default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case B:A=10;break e;case j:A=9;break e;case L:A=11;break e;case G:A=14;break e;case W:A=16,p=null;break e}A=29,f=Error(r(130,o===null?"null":typeof o,"")),p=null}return a=as(A,f,a,v),a.elementType=o,a.type=p,a.lanes=S,a}function qa(o,a,f,p){return o=as(7,o,p,a),o.lanes=f,o}function ob(o,a,f){return o=as(6,o,null,a),o.lanes=f,o}function RN(o){var a=as(18,null,null,0);return a.stateNode=o,a}function lb(o,a,f){return a=as(4,o.children!==null?o.children:[],o.key,a),a.lanes=f,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}var ON=new WeakMap;function qs(o,a){if(typeof o=="object"&&o!==null){var f=ON.get(o);return f!==void 0?f:(a={value:o,source:a,stack:Fe(a)},ON.set(o,a),a)}return{value:o,source:a,stack:Fe(a)}}var wu=[],Eu=0,Em=null,kd=0,Gs=[],Ks=0,xl=null,Di=1,Ii="";function So(o,a){wu[Eu++]=kd,wu[Eu++]=Em,Em=o,kd=a}function kN(o,a,f){Gs[Ks++]=Di,Gs[Ks++]=Ii,Gs[Ks++]=xl,xl=o;var p=Di;o=Ii;var v=32-Xt(p)-1;p&=~(1<<v),f+=1;var S=32-Xt(a)+v;if(30<S){var A=v-v%5;S=(p&(1<<A)-1).toString(32),p>>=A,v-=A,Di=1<<32-Xt(a)+v|f<<v|p,Ii=S+o}else Di=1<<S|f<<v|p,Ii=o}function Cm(o){o.return!==null&&(So(o,1),kN(o,1,0))}function ab(o){for(;o===Em;)Em=wu[--Eu],wu[Eu]=null,kd=wu[--Eu],wu[Eu]=null;for(;o===xl;)xl=Gs[--Ks],Gs[Ks]=null,Ii=Gs[--Ks],Gs[Ks]=null,Di=Gs[--Ks],Gs[Ks]=null}function MN(o,a){Gs[Ks++]=Di,Gs[Ks++]=Ii,Gs[Ks++]=xl,Di=a.id,Ii=a.overflow,xl=o}var tr=null,en=null,yt=!1,bl=null,Ys=!1,cb=Error(r(519));function vl(o){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Md(qs(a,o)),cb}function AN(o){var a=o.stateNode,f=o.type,p=o.memoizedProps;switch(a[nn]=o,a[Yn]=p,f){case"dialog":St("cancel",a),St("close",a);break;case"iframe":case"object":case"embed":St("load",a);break;case"video":case"audio":for(f=0;f<Zd.length;f++)St(Zd[f],a);break;case"source":St("error",a);break;case"img":case"image":case"link":St("error",a),St("load",a);break;case"details":St("toggle",a);break;case"input":St("invalid",a),pl(a,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":St("invalid",a);break;case"textarea":St("invalid",a),Cs(a,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||a.textContent===""+f||p.suppressHydrationWarning===!0||ZR(a.textContent,f)?(p.popover!=null&&(St("beforetoggle",a),St("toggle",a)),p.onScroll!=null&&St("scroll",a),p.onScrollEnd!=null&&St("scrollend",a),p.onClick!=null&&(a.onclick=$r),a=!0):a=!1,a||vl(o,!0)}function Nm(o){for(tr=o.return;tr;)switch(tr.tag){case 5:case 31:case 13:Ys=!1;return;case 27:case 3:Ys=!0;return;default:tr=tr.return}}function Cu(o){if(o!==tr)return!1;if(!yt)return Nm(o),yt=!0,!1;var a=o.tag,f;if((f=a!==3&&a!==27)&&((f=a===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||Bv(o.type,o.memoizedProps)),f=!f),f&&en&&vl(o),Nm(o),a===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));en=yO(o)}else if(a===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));en=yO(o)}else a===27?(a=en,Ll(o.type)?(o=Yv,Yv=null,en=o):en=a):en=tr?Xs(o.stateNode.nextSibling):null;return!0}function Ga(){en=tr=null,yt=!1}function ub(){var o=bl;return o!==null&&(fs===null?fs=o:fs.push.apply(fs,o),bl=null),o}function Md(o){bl===null?bl=[o]:bl.push(o)}var fb=_e(null),Ka=null,wo=null;function Sl(o,a,f){Re(fb,a._currentValue),a._currentValue=f}function Eo(o){o._currentValue=fb.current,we(fb)}function Tm(o,a,f){for(;o!==null;){var p=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,p!==null&&(p.childLanes|=a)):p!==null&&(p.childLanes&a)!==a&&(p.childLanes|=a),o===f)break;o=o.return}}function db(o,a,f,p){var v=o.child;for(v!==null&&(v.return=o);v!==null;){var S=v.dependencies;if(S!==null){var A=v.child;S=S.firstContext;e:for(;S!==null;){var V=S;S=v;for(var Y=0;Y<a.length;Y++)if(V.context===a[Y]){S.lanes|=f,V=S.alternate,V!==null&&(V.lanes|=f),Tm(S.return,f,o),p||(A=null);break e}S=V.next}}else if(v.tag===18){if(A=v.return,A===null)throw Error(r(341));A.lanes|=f,S=A.alternate,S!==null&&(S.lanes|=f),Tm(A,f,o),A=null}else v.tag===13&&v.memoizedState!==null&&v.memoizedState.dehydrated===null?(v.lanes|=f,A=v.alternate,A!==null&&(A.lanes|=f),Tm(v.return,f,o),A=v.child,A=A!==null?A.sibling:null):A=v.child;if(A!==null)A.return=v;else for(A=v;A!==null;){if(A===o){A=null;break}if(v=A.sibling,v!==null){v.return=A.return,A=v;break}A=A.return}v=A}}function Ya(o,a,f,p){o=null;for(var v=a,S=!1;v!==null;){if(!S){if((v.flags&524288)!==0)S=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var A=v.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var V=v.type;Rs(v.pendingProps.value,A.value)||(o!==null?o.push(V):o=[V])}}else if(v===Ue.current){if(A=v.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(o!==null?o.push(Wu):o=[Wu])}v=v.return}return o!==null&&db(a,o,f,p),a.flags|=262144,o!==null}function Rm(o){for(o=o.firstContext;o!==null;){if(!Rs(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Wa(o){Ka=o,wo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function mr(o){return _N(Ka,o)}function Om(o,a){return Ka===null&&Wa(o),_N(o,a)}function _N(o,a){var f=a._currentValue;if(a={context:a,memoizedValue:f,next:null},wo===null){if(o===null)throw Error(r(308));wo=a,o.dependencies={lanes:0,firstContext:a},o.flags|=524288}else wo=wo.next=a;return f}var pF=typeof AbortController<"u"?AbortController:function(){var o=[],a=this.signal={aborted:!1,addEventListener:function(f,p){o.push(p)}};this.abort=function(){a.aborted=!0,o.forEach(function(f){return f()})}},mF=e.unstable_scheduleCallback,gF=e.unstable_NormalPriority,jn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hb(){return{controller:new pF,data:new Map,refCount:0}}function Ad(o){o.refCount--,o.refCount===0&&mF(gF,function(){o.controller.abort()})}function DN(o,a){if((o.pendingLanes&4194048)!==0){var f=o.transitionTypes;for(f===null&&(f=o.transitionTypes=[]),o=0;o<a.length;o++){var p=a[o];f.indexOf(p)===-1&&f.push(p)}}}var _d=null;function yF(o){var a=o.transitionTypes;return o.transitionTypes=null,a}var Dd=null,pb=0,Xa=0,Nu=null;function xF(o,a){if(Dd===null){var f=Dd=[];pb=0,Xa=Mv(),Nu={status:"pending",value:void 0,then:function(p){f.push(p)}}}return pb++,a.then(IN,IN),a}function IN(){if(--pb===0&&(_d=null,Dd!==null)){Nu!==null&&(Nu.status="fulfilled");var o=Dd;Dd=null,Xa=0,Nu=null;for(var a=0;a<o.length;a++)(0,o[a])()}}function bF(o,a){var f=[],p={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return o.then(function(){p.status="fulfilled",p.value=a;for(var v=0;v<f.length;v++)(0,f[v])(a)},function(v){for(p.status="rejected",p.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),p}var jN=ge.S;ge.S=function(o,a){if(RR=on(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&xF(o,a),_d!==null)for(var f=Vu;f!==null;)DN(f,_d),f=f.next;if(f=o.types,f!==null){for(var p=Vu;p!==null;)DN(p,f),p=p.next;if(Xa!==0){p=_d,p===null&&(p=_d=[]);for(var v=0;v<f.length;v++){var S=f[v];p.indexOf(S)===-1&&p.push(S)}}}jN!==null&&jN(o,a)};var Qa=_e(null);function mb(){var o=Qa.current;return o!==null?o:Qt.pooledCache}function km(o,a){a===null?Re(Qa,Qa.current):Re(Qa,a.pool)}function LN(){var o=mb();return o===null?null:{parent:jn._currentValue,pool:o}}var Tu=Error(r(460)),gb=Error(r(474)),Mm=Error(r(542)),Am={then:function(){}};function PN(o){return o=o.status,o==="fulfilled"||o==="rejected"}function zN(o,a,f){switch(f=o[f],f===void 0?o.push(a):f!==a&&(a.then($r,$r),a=f),a.status){case"fulfilled":return a.value;case"rejected":throw o=a.reason,HN(o),o===void 0&&!("reason"in a)?Error(r(600)):o;default:if(typeof a.status=="string")a.then($r,$r);else{if(o=Qt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=a,o.status="pending",o.then(function(p){if(a.status==="pending"){var v=a;v.status="fulfilled",v.value=p}},function(p){if(a.status==="pending"){var v=a;v.status="rejected",v.reason=p}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw o=a.reason,HN(o),o}throw Ja=a,Tu}}function Za(o){try{var a=o._init;return a(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ja=f,Tu):f}}var Ja=null;function BN(){if(Ja===null)throw Error(r(459));var o=Ja;return Ja=null,o}function HN(o){if(o===Tu||o===Mm)throw Error(r(483))}var Ru=null,Id=0;function _m(o){var a=Id;return Id+=1,Ru===null&&(Ru=[]),zN(Ru,o,a)}function wl(o,a){a=a.props.ref,o.ref=a!==void 0?a:null}function Dm(o,a){throw a.$$typeof===I?Error(r(525)):(o=Object.prototype.toString.call(a),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o)))}function FN(o){function a(le,ee){if(o){var ue=le.deletions;ue===null?(le.deletions=[ee],le.flags|=16):ue.push(ee)}}function f(le,ee){if(!o)return null;for(;ee!==null;)a(le,ee),ee=ee.sibling;return null}function p(le){for(var ee=new Map;le!==null;)le.key===null?ee.set(le.index,le):ee.set(le.key,le),le=le.sibling;return ee}function v(le,ee){return le=vo(le,ee),le.index=0,le.sibling=null,le}function S(le,ee,ue){return le.index=ue,o?(ue=le.alternate,ue!==null?(ue=ue.index,ue<ee?(le.flags|=2,ee):ue):(le.flags|=134217730,ee)):(le.flags|=1048576,ee)}function A(le){return o&&le.alternate===null&&(le.flags|=134217730),le}function V(le,ee,ue,be){return ee===null||ee.tag!==6?(ee=ob(ue,le.mode,be),ee.return=le,ee):(ee=v(ee,ue),ee.return=le,ee)}function Y(le,ee,ue,be){var Be=ue.type;return Be===H?(le=me(le,ee,ue.props.children,be,ue.key),wl(le,ue),le):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===W&&Za(Be)===ee.type)?(ee=v(ee,ue.props),wl(ee,ue),ee.return=le,ee):(ee=wm(ue.type,ue.key,ue.props,null,le.mode,be),wl(ee,ue),ee.return=le,ee)}function ae(le,ee,ue,be){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ue.containerInfo||ee.stateNode.implementation!==ue.implementation?(ee=lb(ue,le.mode,be),ee.return=le,ee):(ee=v(ee,ue.children||[]),ee.return=le,ee)}function me(le,ee,ue,be,Be){return ee===null||ee.tag!==7?(ee=qa(ue,le.mode,be,Be),ee.return=le,ee):(ee=v(ee,ue),ee.return=le,ee)}function ve(le,ee,ue){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=ob(""+ee,le.mode,ue),ee.return=le,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case _:return ue=wm(ee.type,ee.key,ee.props,null,le.mode,ue),wl(ue,ee),ue.return=le,ue;case P:return ee=lb(ee,le.mode,ue),ee.return=le,ee;case W:return ee=Za(ee),ve(le,ee,ue)}if(ye(ee)||J(ee))return ee=qa(ee,le.mode,ue,null),ee.return=le,ee;if(typeof ee.then=="function")return ve(le,_m(ee),ue);if(ee.$$typeof===B)return ve(le,Om(le,ee),ue);Dm(le,ee)}return null}function ie(le,ee,ue,be){var Be=ee!==null?ee.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Be!==null?null:V(le,ee,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case _:return ue.key===Be?Y(le,ee,ue,be):null;case P:return ue.key===Be?ae(le,ee,ue,be):null;case W:return ue=Za(ue),ie(le,ee,ue,be)}if(ye(ue)||J(ue))return Be!==null?null:me(le,ee,ue,be,null);if(typeof ue.then=="function")return ie(le,ee,_m(ue),be);if(ue.$$typeof===B)return ie(le,ee,Om(le,ue),be);Dm(le,ue)}return null}function fe(le,ee,ue,be,Be){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return le=le.get(ue)||null,V(ee,le,""+be,Be);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case _:return le=le.get(be.key===null?ue:be.key)||null,Y(ee,le,be,Be);case P:return le=le.get(be.key===null?ue:be.key)||null,ae(ee,le,be,Be);case W:return be=Za(be),fe(le,ee,ue,be,Be)}if(ye(be)||J(be))return le=le.get(ue)||null,me(ee,le,be,Be,null);if(typeof be.then=="function")return fe(le,ee,ue,_m(be),Be);if(be.$$typeof===B)return fe(le,ee,ue,Om(ee,be),Be);Dm(ee,be)}return null}function je(le,ee,ue,be){for(var Be=null,Ct=null,Ye=ee,st=ee=0,zn=null;Ye!==null&&st<ue.length;st++){Ye.index>st?(zn=Ye,Ye=null):zn=Ye.sibling;var kt=ie(le,Ye,ue[st],be);if(kt===null){Ye===null&&(Ye=zn);break}o&&Ye&&kt.alternate===null&&a(le,Ye),ee=S(kt,ee,st),Ct===null?Be=kt:Ct.sibling=kt,Ct=kt,Ye=zn}if(st===ue.length)return f(le,Ye),yt&&So(le,st),Be;if(Ye===null){for(;st<ue.length;st++)Ye=ve(le,ue[st],be),Ye!==null&&(ee=S(Ye,ee,st),Ct===null?Be=Ye:Ct.sibling=Ye,Ct=Ye);return yt&&So(le,st),Be}for(Ye=p(Ye);st<ue.length;st++)zn=fe(Ye,le,st,ue[st],be),zn!==null&&(o&&(kt=zn.alternate,kt!==null&&Ye.delete(kt.key===null?st:kt.key)),ee=S(zn,ee,st),Ct===null?Be=zn:Ct.sibling=zn,Ct=zn);return o&&Ye.forEach(function(Fl){return a(le,Fl)}),yt&&So(le,st),Be}function $e(le,ee,ue,be){if(ue==null)throw Error(r(151));for(var Be=null,Ct=null,Ye=ee,st=ee=0,zn=null,kt=ue.next();Ye!==null&&!kt.done;st++,kt=ue.next()){Ye.index>st?(zn=Ye,Ye=null):zn=Ye.sibling;var Fl=ie(le,Ye,kt.value,be);if(Fl===null){Ye===null&&(Ye=zn);break}o&&Ye&&Fl.alternate===null&&a(le,Ye),ee=S(Fl,ee,st),Ct===null?Be=Fl:Ct.sibling=Fl,Ct=Fl,Ye=zn}if(kt.done)return f(le,Ye),yt&&So(le,st),Be;if(Ye===null){for(;!kt.done;st++,kt=ue.next())kt=ve(le,kt.value,be),kt!==null&&(ee=S(kt,ee,st),Ct===null?Be=kt:Ct.sibling=kt,Ct=kt);return yt&&So(le,st),Be}for(Ye=p(Ye);!kt.done;st++,kt=ue.next())kt=fe(Ye,le,st,kt.value,be),kt!==null&&(o&&(zn=kt.alternate,zn!==null&&Ye.delete(zn.key===null?st:zn.key)),ee=S(kt,ee,st),Ct===null?Be=kt:Ct.sibling=kt,Ct=kt);return o&&Ye.forEach(function(J8){return a(le,J8)}),yt&&So(le,st),Be}function ht(le,ee,ue,be){if(typeof ue=="object"&&ue!==null&&ue.type===H&&ue.key===null&&ue.props.ref===void 0&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case _:e:{for(var Be=ue.key;ee!==null;){if(ee.key===Be){if(Be=ue.type,Be===H){if(ee.tag===7){f(le,ee.sibling),be=v(ee,ue.props.children),wl(be,ue),be.return=le,le=be;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===W&&Za(Be)===ee.type){f(le,ee.sibling),be=v(ee,ue.props),wl(be,ue),be.return=le,le=be;break e}f(le,ee);break}else a(le,ee);ee=ee.sibling}ue.type===H?(be=qa(ue.props.children,le.mode,be,ue.key),wl(be,ue),be.return=le,le=be):(be=wm(ue.type,ue.key,ue.props,null,le.mode,be),wl(be,ue),be.return=le,le=be)}return A(le);case P:e:{for(Be=ue.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){f(le,ee.sibling),be=v(ee,ue.children||[]),be.return=le,le=be;break e}else{f(le,ee);break}else a(le,ee);ee=ee.sibling}be=lb(ue,le.mode,be),be.return=le,le=be}return A(le);case W:return ue=Za(ue),ht(le,ee,ue,be)}if(ye(ue))return je(le,ee,ue,be);if(J(ue)){if(Be=J(ue),typeof Be!="function")throw Error(r(150));return ue=Be.call(ue),$e(le,ee,ue,be)}if(typeof ue.then=="function")return ht(le,ee,_m(ue),be);if(ue.$$typeof===B)return ht(le,ee,Om(le,ue),be);Dm(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ee!==null&&ee.tag===6?(f(le,ee.sibling),be=v(ee,ue),be.return=le,le=be):(f(le,ee),be=ob(ue,le.mode,be),be.return=le,le=be),A(le)):f(le,ee)}return function(le,ee,ue,be){try{Id=0;var Be=ht(le,ee,ue,be);return Ru=null,Be}catch(Ye){if(Ye===Tu||Ye===Mm)throw Ye;var Ct=as(29,Ye,null,le.mode);return Ct.lanes=be,Ct.return=le,Ct}finally{}}}var ec=FN(!0),$N=FN(!1),El=!1;function yb(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xb(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Cl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Nl(o,a,f){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(Lt&2)!==0){var v=p.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),p.pending=a,a=Sm(o),NN(o,null,f),a}return vm(o,p,a,f),Sm(o)}function jd(o,a,f){if(a=a.updateQueue,a!==null&&(a=a.shared,(f&4194048)!==0)){var p=a.lanes;p&=o.pendingLanes,f|=p,a.lanes=f,ul(o,f)}}function bb(o,a){var f=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var v=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var A={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?v=S=A:S=S.next=A,f=f.next}while(f!==null);S===null?v=S=a:S=S.next=a}else v=S=a;f={baseState:p.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=a:o.next=a,f.lastBaseUpdate=a}var vb=!1;function Ld(){if(vb){var o=Nu;if(o!==null)throw o}}function Pd(o,a,f,p){vb=!1;var v=o.updateQueue;El=!1;var S=v.firstBaseUpdate,A=v.lastBaseUpdate,V=v.shared.pending;if(V!==null){v.shared.pending=null;var Y=V,ae=Y.next;Y.next=null,A===null?S=ae:A.next=ae,A=Y;var me=o.alternate;me!==null&&(me=me.updateQueue,V=me.lastBaseUpdate,V!==A&&(V===null?me.firstBaseUpdate=ae:V.next=ae,me.lastBaseUpdate=Y))}if(S!==null){var ve=v.baseState;A=0,me=ae=Y=null,V=S;do{var ie=V.lane&-536870913,fe=ie!==V.lane;if(fe?(Et&ie)===ie:(p&ie)===ie){ie!==0&&ie===Xa&&(vb=!0),me!==null&&(me=me.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var je=o,$e=V;ie=a;var ht=f;switch($e.tag){case 1:if(je=$e.payload,typeof je=="function"){ve=je.call(ht,ve,ie);break e}ve=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=$e.payload,ie=typeof je=="function"?je.call(ht,ve,ie):je,ie==null)break e;ve=k({},ve,ie);break e;case 2:El=!0}}ie=V.callback,ie!==null&&(o.flags|=64,fe&&(o.flags|=8192),fe=v.callbacks,fe===null?v.callbacks=[ie]:fe.push(ie))}else fe={lane:ie,tag:V.tag,payload:V.payload,callback:V.callback,next:null},me===null?(ae=me=fe,Y=ve):me=me.next=fe,A|=ie;if(V=V.next,V===null){if(V=v.shared.pending,V===null)break;fe=V,V=fe.next,fe.next=null,v.lastBaseUpdate=fe,v.shared.pending=null}}while(!0);me===null&&(Y=ve),v.baseState=Y,v.firstBaseUpdate=ae,v.lastBaseUpdate=me,S===null&&(v.shared.lanes=0),_l|=A,o.lanes=A,o.memoizedState=ve}}function VN(o,a){if(typeof o!="function")throw Error(r(191,o));o.call(a)}function UN(o,a){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)VN(f[o],a)}var Tl=_e(null),Im=_e(0);function qN(o,a){o=Oo,Re(Im,o),Re(Tl,a),Oo=o|a.baseLanes}function Sb(){Re(Im,Oo),Re(Tl,Tl.current)}function wb(){Oo=Im.current,we(Tl),we(Im)}var gr=_e(null),Mr=null;function Rl(o){var a=o.alternate;Re(yr,yr.current&1),Re(gr,o),Mr===null&&(a===null||Tl.current!==null||a.memoizedState!==null)&&(Mr=o)}function Eb(o){Re(yr,yr.current),Re(gr,o),Mr===null&&(Mr=o)}function GN(o){o.tag===22?(Re(yr,yr.current),Re(gr,o),Mr===null&&(Mr=o)):Ol()}function Ol(){Re(yr,yr.current),Re(gr,gr.current)}function Os(o){we(gr),Mr===o&&(Mr=null),we(yr)}var yr=_e(0);function zd(o,a){Re(gr,gr.current),Re(yr,a)}function Cb(o){we(yr),we(gr),Mr===o&&(Mr=null)}function jm(o){for(var a=o;a!==null;){if(a.tag===13){var f=a.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Gv(f)||Kv(f)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Co=0,dt=null,Kt=null,Ln=null,Lm=!1,Ou=!1,tc=!1,Pm=0,Bd=0,ku=null,vF=0;function En(){throw Error(r(321))}function Nb(o,a){if(a===null)return!1;for(var f=0;f<a.length&&f<o.length;f++)if(!Rs(o[f],a[f]))return!1;return!0}function Tb(o,a,f,p,v,S){return Co=S,dt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,ge.H=o===null||o.memoizedState===null?kT:MT,tc=!1,S=f(p,v),tc=!1,Ou&&(S=YN(a,f,p,v)),KN(o),S}function KN(o){ge.H=Um;var a=Kt!==null&&Kt.next!==null;if(Co=0,Ln=Kt=dt=null,Lm=!1,Bd=0,ku=null,a)throw Error(r(300));o===null||Pn||(o=o.dependencies,o!==null&&Rm(o)&&(Pn=!0))}function YN(o,a,f,p){dt=o;var v=0;do{if(Ou&&(ku=null),Bd=0,Ou=!1,25<=v)throw Error(r(301));if(v+=1,Ln=Kt=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}ge.H=OF,S=a(f,p)}while(Ou);return S}function SF(){var o=ge.H,a=o.useState()[0];return a=typeof a.then=="function"?Hd(a):a,o=o.useState()[0],(Kt!==null?Kt.memoizedState:null)!==o&&(dt.flags|=1024),a}function Rb(){var o=Pm!==0;return Pm=0,o}function Ob(o,a,f){a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~f}function kb(o){if(Lm){for(o=o.memoizedState;o!==null;){var a=o.queue;a!==null&&(a.pending=null),o=o.next}Lm=!1}Co=0,Ln=Kt=dt=null,Ou=!1,Bd=Pm=0,ku=null}function Ur(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?dt.memoizedState=Ln=o:Ln=Ln.next=o,Ln}function kn(){if(Kt===null){var o=dt.alternate;o=o!==null?o.memoizedState:null}else o=Kt.next;var a=Ln===null?dt.memoizedState:Ln.next;if(a!==null)Ln=a,Kt=o;else{if(o===null)throw dt.alternate===null?Error(r(467)):Error(r(310));Kt=o,o={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},Ln===null?dt.memoizedState=Ln=o:Ln=Ln.next=o}return Ln}function zm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hd(o){var a=Bd;return Bd+=1,ku===null&&(ku=[]),o=zN(ku,o,a),a=dt,(Ln===null?a.memoizedState:Ln.next)===null&&(a=a.alternate,ge.H=a===null||a.memoizedState===null?kT:MT),o}function Bm(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Hd(o);if(o.$$typeof===X)return;if(o.$$typeof===B)return mr(o)}throw Error(r(438,String(o)))}function Mb(o){var a=null,f=dt.updateQueue;if(f!==null&&(a=f.memoCache),a==null){var p=dt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(a={data:p.data.map(function(v){return v.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),f===null&&(f=zm(),dt.updateQueue=f),f.memoCache=a,f=a.data[a.index],f===void 0)for(f=a.data[a.index]=Array(o),p=0;p<o;p++)f[p]=de;return a.index++,f}function No(o,a){return typeof a=="function"?a(o):a}function Hm(o){var a=kn();return Ab(a,Kt,o)}function Ab(o,a,f){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var v=o.baseQueue,S=p.pending;if(S!==null){if(v!==null){var A=v.next;v.next=S.next,S.next=A}a.baseQueue=v=S,p.pending=null}if(S=o.baseState,v===null)o.memoizedState=S;else{a=v.next;var V=A=null,Y=null,ae=a,me=!1;do{var ve=ae.lane&-536870913;if(ve!==ae.lane?(Et&ve)===ve:(Co&ve)===ve){var ie=ae.revertLane;if(ie===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ve===Xa&&(me=!0);else if((Co&ie)===ie){ae=ae.next,ie===Xa&&(me=!0);continue}else ve={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Y===null?(V=Y=ve,A=S):Y=Y.next=ve,dt.lanes|=ie,_l|=ie;ve=ae.action,tc&&f(S,ve),S=ae.hasEagerState?ae.eagerState:f(S,ve)}else ie={lane:ve,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Y===null?(V=Y=ie,A=S):Y=Y.next=ie,dt.lanes|=ve,_l|=ve;ae=ae.next}while(ae!==null&&ae!==a);if(Y===null?A=S:Y.next=V,!Rs(S,o.memoizedState)&&(Pn=!0,me&&(f=Nu,f!==null)))throw f;o.memoizedState=S,o.baseState=A,o.baseQueue=Y,p.lastRenderedState=S}return v===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function _b(o){var a=kn(),f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var p=f.dispatch,v=f.pending,S=a.memoizedState;if(v!==null){f.pending=null;var A=v=v.next;do S=o(S,A.action),A=A.next;while(A!==v);Rs(S,a.memoizedState)||(Pn=!0),a.memoizedState=S,a.baseQueue===null&&(a.baseState=S),f.lastRenderedState=S}return[S,p]}function WN(o,a,f){var p=dt,v=kn(),S=yt;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=a();var A=!Rs((Kt||v).memoizedState,f);if(A&&(v.memoizedState=f,Pn=!0),v=v.queue,jb(ZN.bind(null,p,v,o),[o]),o=v.getSnapshot!==a||A||Ln!==null&&(Ln.memoizedState.tag&1)!==0,Mu(o?9:8,{destroy:void 0},QN.bind(null,p,v,f,a),null),o){if(p.flags|=2048,Qt===null)throw Error(r(349));S||(Co&127)!==0||XN(p,a,f)}return f}function XN(o,a,f){o.flags|=16384,o={getSnapshot:a,value:f},a=dt.updateQueue,a===null?(a=zm(),dt.updateQueue=a,a.stores=[o]):(f=a.stores,f===null?a.stores=[o]:f.push(o))}function QN(o,a,f,p){a.value=f,a.getSnapshot=p,JN(a)&&eT(o)}function ZN(o,a,f){return f(function(){JN(a)&&eT(o)})}function JN(o){var a=o.getSnapshot;o=o.value;try{var f=a();return!Rs(o,f)}catch{return!0}}function eT(o){var a=Ua(o,2);a!==null&&ds(a,o,2)}function Db(o){var a=Ur();if(typeof o=="function"){var f=o;if(o=f(),tc){Wt(!0);try{f()}finally{Wt(!1)}}}return a.memoizedState=a.baseState=o,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:o},a}function tT(o,a,f,p){return o.baseState=f,Ab(o,Kt,typeof p=="function"?p:No)}function wF(o,a,f,p,v){if(Vm(o))throw Error(r(485));if(o=a.action,o!==null){var S={payload:v,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){S.listeners.push(A)}};ge.T!==null?f(!0):S.isTransition=!1,p(S),f=a.pending,f===null?(S.next=a.pending=S,nT(a,S)):(S.next=f.next,a.pending=f.next=S)}}function nT(o,a){var f=a.action,p=a.payload,v=o.state;if(a.isTransition){var S=ge.T,A={};A.types=S!==null?S.types:null,ge.T=A;try{var V=f(v,p),Y=ge.S;Y!==null&&Y(A,V),rT(o,a,V)}catch(ae){Ib(o,a,ae)}finally{S!==null&&A.types!==null&&(S.types=A.types),ge.T=S}}else try{S=f(v,p),rT(o,a,S)}catch(ae){Ib(o,a,ae)}}function rT(o,a,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){sT(o,a,p)},function(p){return Ib(o,a,p)}):sT(o,a,f)}function sT(o,a,f){a.status="fulfilled",a.value=f,iT(a),o.state=f,a=o.pending,a!==null&&(f=a.next,f===a?o.pending=null:(f=f.next,a.next=f,nT(o,f)))}function Ib(o,a,f){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do a.status="rejected",a.reason=f,iT(a),a=a.next;while(a!==p)}o.action=null}function iT(o){o=o.listeners;for(var a=0;a<o.length;a++)(0,o[a])()}function oT(o,a){return a}function lT(o,a){if(yt){var f=Qt.formState;if(f!==null){e:{var p=dt;if(yt){if(en){t:{for(var v=en,S=Ys;v.nodeType!==8;){if(!S){v=null;break t}if(v=Xs(v.nextSibling),v===null){v=null;break t}}S=v.data,v=S==="F!"||S==="F"?v:null}if(v){en=Xs(v.nextSibling),p=v.data==="F!";break e}}vl(p)}p=!1}p&&(a=f[0])}}return f=Ur(),f.memoizedState=f.baseState=a,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oT,lastRenderedState:a},f.queue=p,f=TT.bind(null,dt,p),p.dispatch=f,p=Db(!1),S=Hb.bind(null,dt,!1,p.queue),p=Ur(),v={state:a,dispatch:null,action:o,pending:null},p.queue=v,f=wF.bind(null,dt,v,S,f),v.dispatch=f,p.memoizedState=o,[a,f,!1]}function aT(o){var a=kn();return cT(a,Kt,o)}function cT(o,a,f){if(a=Ab(o,a,oT)[0],o=Hm(No)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var p=Hd(a)}catch(A){throw A===Tu?Mm:A}else p=a;a=kn();var v=a.queue,S=v.dispatch;return f!==a.memoizedState&&(dt.flags|=2048,Mu(9,{destroy:void 0},EF.bind(null,v,f),null)),[p,S,o]}function EF(o,a){o.action=a}function uT(o){var a=kn(),f=Kt;if(f!==null)return cT(a,f,o);kn(),a=a.memoizedState,f=kn();var p=f.queue.dispatch;return f.memoizedState=o,[a,p,!1]}function Mu(o,a,f,p){return o={tag:o,create:f,deps:p,inst:a,next:null},a=dt.updateQueue,a===null&&(a=zm(),dt.updateQueue=a),f=a.lastEffect,f===null?a.lastEffect=o.next=o:(p=f.next,f.next=o,o.next=p,a.lastEffect=o),o}function fT(){return kn().memoizedState}function Fm(o,a,f,p){var v=Ur();dt.flags|=o,v.memoizedState=Mu(1|a,{destroy:void 0},f,p===void 0?null:p)}function $m(o,a,f,p){var v=kn();p=p===void 0?null:p;var S=v.memoizedState.inst;Kt!==null&&p!==null&&Nb(p,Kt.memoizedState.deps)?v.memoizedState=Mu(a,S,f,p):(dt.flags|=o,v.memoizedState=Mu(1|a,S,f,p))}function dT(o,a){Fm(8390656,8,o,a)}function jb(o,a){$m(2048,8,o,a)}function CF(o){dt.flags|=4;var a=dt.updateQueue;if(a===null)a=zm(),dt.updateQueue=a,a.events=[o];else{var f=a.events;f===null?a.events=[o]:f.push(o)}}function hT(o){var a=kn().memoizedState;return CF({ref:a,nextImpl:o}),function(){if((Lt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function pT(o,a){return $m(4,2,o,a)}function mT(o,a){return $m(4,4,o,a)}function gT(o,a){if(typeof a=="function"){o=o();var f=a(o);return function(){typeof f=="function"?f():a(null)}}if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function yT(o,a,f){f=f!=null?f.concat([o]):null,$m(4,4,gT.bind(null,a,o),f)}function Lb(){}function xT(o,a){var f=kn();a=a===void 0?null:a;var p=f.memoizedState;return a!==null&&Nb(a,p[1])?p[0]:(f.memoizedState=[o,a],o)}function bT(o,a){var f=kn();a=a===void 0?null:a;var p=f.memoizedState;if(a!==null&&Nb(a,p[1]))return p[0];if(p=o(),tc){Wt(!0);try{o()}finally{Wt(!1)}}return f.memoizedState=[p,a],p}function Pb(o,a,f){return f===void 0||(Co&1073741824)!==0&&(Et&261930)===0?o.memoizedState=a:(o.memoizedState=f,o=kR(),dt.lanes|=o,_l|=o,f)}function vT(o,a,f,p){return Rs(f,a)?f:Tl.current!==null?(o=Pb(o,f,p),Rs(o,a)||(Pn=!0),o):(Co&106)===0||(Co&1073741824)!==0&&(Et&261930)===0?(Pn=!0,o.memoizedState=f):(o=kR(),dt.lanes|=o,_l|=o,a)}function ST(o,a,f,p,v){var S=oe.p;oe.p=S!==0&&8>S?S:8;var A=ge.T,V={};V.types=A!==null?A.types:null,ge.T=V,Hb(o,!1,a,f);try{var Y=v(),ae=ge.S;if(ae!==null&&ae(V,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var me=bF(Y,p);Fd(o,a,me,_s(o))}else Fd(o,a,p,_s(o))}catch(ve){Fd(o,a,{then:function(){},status:"rejected",reason:ve},_s())}finally{oe.p=S,A!==null&&V.types!==null&&(A.types=V.types),ge.T=A}}function NF(){}function zb(o,a,f,p){if(o.tag!==5)throw Error(r(476));var v=wT(o).queue;ST(o,v,a,xe,f===null?NF:function(){return ET(o),f(p)})}function wT(o){var a=o.memoizedState;if(a!==null)return a;a={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:xe},next:null};var f={};return a.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:f},next:null},o.memoizedState=a,o=o.alternate,o!==null&&(o.memoizedState=a),a}function ET(o){var a=wT(o);a.next===null&&(a=o.alternate.memoizedState),Fd(o,a.next.queue,{},_s())}function Bb(){return mr(Wu)}function CT(){return kn().memoizedState}function NT(){return kn().memoizedState}function TF(o){for(var a=o.return;a!==null;){switch(a.tag){case 24:case 3:var f=_s();o=Cl(f);var p=Nl(a,o,f);p!==null&&(ds(p,a,f),jd(p,a,f)),a={cache:hb()},o.payload=a;return}a=a.return}}function RF(o,a,f){var p=_s();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Vm(o)?RT(a,f):(f=sb(o,a,f,p),f!==null&&(ds(f,o,p),OT(f,a,p)))}function TT(o,a,f){var p=_s();Fd(o,a,f,p)}function Fd(o,a,f,p){var v={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Vm(o))RT(a,v);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=a.lastRenderedReducer,S!==null))try{var A=a.lastRenderedState,V=S(A,f);if(v.hasEagerState=!0,v.eagerState=V,Rs(V,A))return vm(o,a,v,0),Qt===null&&bm(),!1}catch{}finally{}if(f=sb(o,a,v,p),f!==null)return ds(f,o,p),OT(f,a,p),!0}return!1}function Hb(o,a,f,p){if(p={lane:2,revertLane:Mv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Vm(o)){if(a)throw Error(r(479))}else a=sb(o,f,p,2),a!==null&&ds(a,o,2)}function Vm(o){var a=o.alternate;return o===dt||a!==null&&a===dt}function RT(o,a){Ou=Lm=!0;var f=o.pending;f===null?a.next=a:(a.next=f.next,f.next=a),o.pending=a}function OT(o,a,f){if((f&4194048)!==0){var p=a.lanes;p&=o.pendingLanes,f|=p,a.lanes=f,ul(o,f)}}var Um={readContext:mr,use:Bm,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En,useEffectEvent:En},kT={readContext:mr,use:Bm,useCallback:function(o,a){return Ur().memoizedState=[o,a===void 0?null:a],o},useContext:mr,useEffect:dT,useImperativeHandle:function(o,a,f){f=f!=null?f.concat([o]):null,Fm(4194308,4,gT.bind(null,a,o),f)},useLayoutEffect:function(o,a){return Fm(4194308,4,o,a)},useInsertionEffect:function(o,a){Fm(4,2,o,a)},useMemo:function(o,a){var f=Ur();a=a===void 0?null:a;var p=o();if(tc){Wt(!0);try{o()}finally{Wt(!1)}}return f.memoizedState=[p,a],p},useReducer:function(o,a,f){var p=Ur();if(f!==void 0){var v=f(a);if(tc){Wt(!0);try{f(a)}finally{Wt(!1)}}}else v=a;return p.memoizedState=p.baseState=v,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:v},p.queue=o,o=o.dispatch=RF.bind(null,dt,o),[p.memoizedState,o]},useRef:function(o){var a=Ur();return o={current:o},a.memoizedState=o},useState:function(o){o=Db(o);var a=o.queue,f=TT.bind(null,dt,a);return a.dispatch=f,[o.memoizedState,f]},useDebugValue:Lb,useDeferredValue:function(o,a){var f=Ur();return Pb(f,o,a)},useTransition:function(){var o=Db(!1);return o=ST.bind(null,dt,o.queue,!0,!1),Ur().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,a,f){var p=dt,v=Ur();if(yt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=a(),Qt===null)throw Error(r(349));(Et&127)!==0||XN(p,a,f)}v.memoizedState=f;var S={value:f,getSnapshot:a};return v.queue=S,dT(ZN.bind(null,p,S,o),[o]),p.flags|=2048,Mu(9,{destroy:void 0},QN.bind(null,p,S,f,a),null),f},useId:function(){var o=Ur(),a=Qt.identifierPrefix;if(yt){var f=Ii,p=Di;f=(p&~(1<<32-Xt(p)-1)).toString(32)+f,a="_"+a+"R_"+f,f=Pm++,0<f&&(a+="H"+f.toString(32)),a+="_"}else f=vF++,a="_"+a+"r_"+f.toString(32)+"_";return o.memoizedState=a},useHostTransitionStatus:Bb,useFormState:lT,useActionState:lT,useOptimistic:function(o){var a=Ur();a.memoizedState=a.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=f,a=Hb.bind(null,dt,!0,f),f.dispatch=a,[o,a]},useMemoCache:Mb,useCacheRefresh:function(){return Ur().memoizedState=TF.bind(null,dt)},useEffectEvent:function(o){var a=Ur(),f={impl:o};return a.memoizedState=f,function(){if((Lt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},MT={readContext:mr,use:Bm,useCallback:xT,useContext:mr,useEffect:jb,useImperativeHandle:yT,useInsertionEffect:pT,useLayoutEffect:mT,useMemo:bT,useReducer:Hm,useRef:fT,useState:function(){return Hm(No)},useDebugValue:Lb,useDeferredValue:function(o,a){var f=kn();return vT(f,Kt.memoizedState,o,a)},useTransition:function(){var o=Hm(No)[0],a=kn().memoizedState;return[typeof o=="boolean"?o:Hd(o),a]},useSyncExternalStore:WN,useId:CT,useHostTransitionStatus:Bb,useFormState:aT,useActionState:aT,useOptimistic:function(o,a){var f=kn();return tT(f,Kt,o,a)},useMemoCache:Mb,useCacheRefresh:NT,useEffectEvent:hT},OF={readContext:mr,use:Bm,useCallback:xT,useContext:mr,useEffect:jb,useImperativeHandle:yT,useInsertionEffect:pT,useLayoutEffect:mT,useMemo:bT,useReducer:_b,useRef:fT,useState:function(){return _b(No)},useDebugValue:Lb,useDeferredValue:function(o,a){var f=kn();return Kt===null?Pb(f,o,a):vT(f,Kt.memoizedState,o,a)},useTransition:function(){var o=_b(No)[0],a=kn().memoizedState;return[typeof o=="boolean"?o:Hd(o),a]},useSyncExternalStore:WN,useId:CT,useHostTransitionStatus:Bb,useFormState:uT,useActionState:uT,useOptimistic:function(o,a){var f=kn();return Kt!==null?tT(f,Kt,o,a):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:Mb,useCacheRefresh:NT,useEffectEvent:hT};function Fb(o,a,f,p){a=o.memoizedState,f=f(p,a),f=f==null?a:k({},a,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var $b={enqueueSetState:function(o,a,f){o=o._reactInternals;var p=_s(),v=Cl(p);v.payload=a,f!=null&&(v.callback=f),a=Nl(o,v,p),a!==null&&(ds(a,o,p),jd(a,o,p))},enqueueReplaceState:function(o,a,f){o=o._reactInternals;var p=_s(),v=Cl(p);v.tag=1,v.payload=a,f!=null&&(v.callback=f),a=Nl(o,v,p),a!==null&&(ds(a,o,p),jd(a,o,p))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var f=_s(),p=Cl(f);p.tag=2,a!=null&&(p.callback=a),a=Nl(o,p,f),a!==null&&(ds(a,o,f),jd(a,o,f))}};function AT(o,a,f,p,v,S,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,S,A):a.prototype&&a.prototype.isPureReactComponent?!Rd(f,p)||!Rd(v,S):!0}function _T(o,a,f,p){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(f,p),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(f,p),a.state!==o&&$b.enqueueReplaceState(a,a.state,null)}function nc(o,a){var f=a;if("ref"in a){f={};for(var p in a)p!=="ref"&&(f[p]=a[p])}if(o=o.defaultProps){f===a&&(f=k({},f));for(var v in o)f[v]===void 0&&(f[v]=o[v])}return f}function DT(o){xm(o)}function IT(o){console.error(o)}function jT(o){xm(o)}function qm(o,a){try{var f=o.onUncaughtError;f(a.value,{componentStack:a.stack})}catch(p){setTimeout(function(){throw p})}}function LT(o,a,f){try{var p=o.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Vb(o,a,f){return f=Cl(f),f.tag=3,f.payload={element:null},f.callback=function(){qm(o,a)},f}function PT(o){return o=Cl(o),o.tag=3,o}function zT(o,a,f,p){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var S=p.value;o.payload=function(){return v(S)},o.callback=function(){LT(a,f,p)}}var A=f.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(o.callback=function(){LT(a,f,p),typeof v!="function"&&(Dl===null?Dl=new Set([this]):Dl.add(this));var V=p.stack;this.componentDidCatch(p.value,{componentStack:V!==null?V:""})})}function kF(o,a,f,p,v){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(a=f.alternate,a!==null&&Ya(a,f,v,!0),f=gr.current,f!==null){switch(f.tag){case 31:case 13:case 19:return Mr===null?dg():f.alternate===null&&Cn===0&&(Cn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,p===Am?f.flags|=16384:(a=f.updateQueue,a===null?f.updateQueue=new Set([p]):a.add(p),Rv(o,p,v)),!1;case 22:return f.flags|=65536,p===Am?f.flags|=16384:(a=f.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=a):(f=a.retryQueue,f===null?a.retryQueue=new Set([p]):f.add(p)),Rv(o,p,v)),!1}throw Error(r(435,f.tag))}return Rv(o,p,v),dg(),!1}if(yt)return a=gr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=v,p!==cb&&(o=Error(r(422),{cause:p}),Md(qs(o,f)))):(p!==cb&&(a=Error(r(423),{cause:p}),Md(qs(a,f))),o=o.current.alternate,o.flags|=65536,v&=-v,o.lanes|=v,p=qs(p,f),v=Vb(o.stateNode,p,v),bb(o,v),Cn!==4&&(Cn=2)),!1;var S=Error(r(520),{cause:p});if(S=qs(S,f),Wd===null?Wd=[S]:Wd.push(S),Cn!==4&&(Cn=2),a===null)return!0;p=qs(p,f),f=a;do{switch(f.tag){case 3:return f.flags|=65536,o=v&-v,f.lanes|=o,o=Vb(f.stateNode,p,o),bb(f,o),!1;case 1:if(a=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Dl===null||!Dl.has(S))))return f.flags|=65536,v&=-v,f.lanes|=v,v=PT(v),zT(v,o,f,p),bb(f,v),!1;break;case 22:if(f.memoizedState!==null)return f.flags|=65536,!1}f=f.return}while(f!==null);return!1}var Ub=Error(r(461)),Pn=!1;function Xn(o,a,f,p){a.child=o===null?$N(a,null,f,p):ec(a,o.child,f,p)}function BT(o,a,f,p,v){f=f.render;var S=a.ref;if("ref"in p){var A={};for(var V in p)V!=="ref"&&(A[V]=p[V])}else A=p;return Wa(a),p=Tb(o,a,f,A,S,v),V=Rb(),o!==null&&!Pn?(Ob(o,a,v),To(o,a,v)):(yt&&V&&Cm(a),a.flags|=1,Xn(o,a,p,v),a.child)}function HT(o,a,f,p,v){if(o===null){var S=f.type;return typeof S=="function"&&!ib(S)&&S.defaultProps===void 0&&f.compare===null?(a.tag=15,a.type=S,FT(o,a,S,p,v)):(o=wm(f.type,null,p,a,a.mode,v),o.ref=a.ref,o.return=a,a.child=o)}if(S=o.child,!Zb(o,v)){var A=S.memoizedProps;if(f=f.compare,f=f!==null?f:Rd,f(A,p)&&o.ref===a.ref)return To(o,a,v)}return a.flags|=1,o=vo(S,p),o.ref=a.ref,o.return=a,a.child=o}function FT(o,a,f,p,v){if(o!==null){var S=o.memoizedProps;if(Rd(S,p)&&o.ref===a.ref)if(Pn=!1,a.pendingProps=p=S,Zb(o,v))(o.flags&131072)!==0&&(Pn=!0);else return a.lanes=o.lanes,To(o,a,v)}return qb(o,a,f,p,v)}function $T(o,a,f,p){var v=p.children,S=o!==null?o.memoizedState:null;if(o===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((a.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,o!==null){for(p=a.child=o.child,v=0;p!==null;)v=v|p.lanes|p.childLanes,p=p.sibling;p=v&~S}else p=0,a.child=null;return VT(o,a,S,f,p)}if((f&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},o!==null&&km(a,S!==null?S.cachePool:null),S!==null?qN(a,S):Sb(),GN(a);else return p=a.lanes=536870912,VT(o,a,S!==null?S.baseLanes|f:f,f,p)}else S!==null?(km(a,S.cachePool),qN(a,S),Ol(),a.memoizedState=null):(o!==null&&km(a,null),Sb(),Ol());return Xn(o,a,v,f),a.child}function $d(o,a){return o!==null&&o.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function VT(o,a,f,p,v){var S=mb();return S=S===null?null:{parent:jn._currentValue,pool:S},a.memoizedState={baseLanes:f,cachePool:S},o!==null&&km(a,null),Sb(),GN(a),o!==null&&Ya(o,a,p,!0),a.childLanes=v,null}function Gm(o,a){return a=Km({mode:a.mode,children:a.children},o.mode),a.ref=o.ref,o.child=a,a.return=o,a}function UT(o,a,f){return ec(a,o.child,null,f),o=Gm(a,a.pendingProps),o.flags|=2,Os(a),a.memoizedState=null,o}function MF(o,a,f){var p=a.pendingProps,v=(a.flags&128)!==0;if(a.flags&=-129,o===null){if(yt){if(p.mode==="hidden")return o=Gm(a,p),a.lanes=536870912,o.memoizedState={baseLanes:0,cachePool:null},$d(null,o);if(Eb(a),(o=en)?(o=gO(o,Ys),o=o!==null&&o.data==="&"?o:null,o!==null&&(a.memoizedState={dehydrated:o,treeContext:xl!==null?{id:Di,overflow:Ii}:null,retryLane:536870912,hydrationErrors:null},f=RN(o),f.return=a,a.child=f,tr=a,en=null)):o=null,o===null)throw vl(a);return a.lanes=536870912,null}return Gm(a,p)}var S=o.memoizedState;if(S!==null){var A=S.dehydrated;if(Eb(a),v)if(a.flags&256)a.flags&=-257,a=UT(o,a,f);else if(a.memoizedState!==null)a.child=o.child,a.flags|=128,a=null;else throw Error(r(558));else if(Pn||Ya(o,a,f,!1),v=(f&o.childLanes)!==0,Pn||v){if(Tl.current===null){if(p=Qt,p!==null&&(A=uo(p,f),A!==0&&A!==S.retryLane))throw S.retryLane=A,Ua(o,A),ds(p,o,A),Ub;dg()}a=UT(o,a,f)}else o=S.treeContext,en=Xs(A.nextSibling),tr=a,yt=!0,bl=null,Ys=!1,o!==null&&MN(a,o),a=Gm(a,p),a.flags|=134221824;return a}return o=vo(o.child,{mode:p.mode,children:p.children}),o.ref=a.ref,a.child=o,o.return=a,o}function Au(o,a){var f=a.ref;if(f===null)o!==null&&o.ref!==null&&(a.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(a.flags|=4194816)}}function qb(o,a,f,p,v){return Wa(a),f=Tb(o,a,f,p,void 0,v),p=Rb(),o!==null&&!Pn?(Ob(o,a,v),To(o,a,v)):(yt&&p&&Cm(a),a.flags|=1,Xn(o,a,f,v),a.child)}function qT(o,a,f,p,v,S){return Wa(a),a.updateQueue=null,f=YN(a,p,f,v),KN(o),p=Rb(),o!==null&&!Pn?(Ob(o,a,S),To(o,a,S)):(yt&&p&&Cm(a),a.flags|=1,Xn(o,a,f,S),a.child)}function GT(o,a,f,p,v){if(Wa(a),a.stateNode===null){var S=Su,A=f.contextType;typeof A=="object"&&A!==null&&(S=mr(A)),S=new f(p,S),a.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=$b,a.stateNode=S,S._reactInternals=a,S=a.stateNode,S.props=p,S.state=a.memoizedState,S.refs={},yb(a),A=f.contextType,S.context=typeof A=="object"&&A!==null?mr(A):Su,S.state=a.memoizedState,A=f.getDerivedStateFromProps,typeof A=="function"&&(Fb(a,f,A,p),S.state=a.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(A=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),A!==S.state&&$b.enqueueReplaceState(S,S.state,null),Pd(a,p,S,v),Ld(),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308),p=!0}else if(o===null){S=a.stateNode;var V=a.memoizedProps,Y=nc(f,V);S.props=Y;var ae=S.context,me=f.contextType;A=Su,typeof me=="object"&&me!==null&&(A=mr(me));var ve=f.getDerivedStateFromProps;me=typeof ve=="function"||typeof S.getSnapshotBeforeUpdate=="function",V=a.pendingProps!==V,me||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(V||ae!==A)&&_T(a,S,p,A),El=!1;var ie=a.memoizedState;S.state=ie,Pd(a,p,S,v),Ld(),ae=a.memoizedState,V||ie!==ae||El?(typeof ve=="function"&&(Fb(a,f,ve,p),ae=a.memoizedState),(Y=El||AT(a,f,Y,p,ie,ae,A))?(me||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(a.flags|=4194308)):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=p,a.memoizedState=ae),S.props=p,S.state=ae,S.context=A,p=Y):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),p=!1)}else{S=a.stateNode,xb(o,a),A=a.memoizedProps,me=nc(f,A),S.props=me,ve=a.pendingProps,ie=S.context,ae=f.contextType,Y=Su,typeof ae=="object"&&ae!==null&&(Y=mr(ae)),V=f.getDerivedStateFromProps,(ae=typeof V=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(A!==ve||ie!==Y)&&_T(a,S,p,Y),El=!1,ie=a.memoizedState,S.state=ie,Pd(a,p,S,v),Ld();var fe=a.memoizedState;A!==ve||ie!==fe||El||o!==null&&o.dependencies!==null&&Rm(o.dependencies)?(typeof V=="function"&&(Fb(a,f,V,p),fe=a.memoizedState),(me=El||AT(a,f,me,p,ie,fe,Y)||o!==null&&o.dependencies!==null&&Rm(o.dependencies))?(ae||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,fe,Y),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,fe,Y)),typeof S.componentDidUpdate=="function"&&(a.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof S.componentDidUpdate!="function"||A===o.memoizedProps&&ie===o.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&ie===o.memoizedState||(a.flags|=1024),a.memoizedProps=p,a.memoizedState=fe),S.props=p,S.state=fe,S.context=Y,p=me):(typeof S.componentDidUpdate!="function"||A===o.memoizedProps&&ie===o.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&ie===o.memoizedState||(a.flags|=1024),p=!1)}return S=p,Au(o,a),p=(a.flags&128)!==0,S||p?(S=a.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:S.render(),a.flags|=1,o!==null&&p?(a.child=ec(a,o.child,null,v),a.child=ec(a,null,f,v)):Xn(o,a,f,v),a.memoizedState=S.state,o=a.child):o=To(o,a,v),o}function KT(o,a,f,p){return Ga(),a.flags|=256,Xn(o,a,f,p),a.child}var Gb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kb(o){return{baseLanes:o,cachePool:LN()}}function Yb(o,a,f){return o=o!==null?o.childLanes&~f:0,a&&(o|=As),o}function YT(o,a,f){var p=a.pendingProps,v=!1,S=(a.flags&128)!==0,A;if((A=S)||(A=o!==null&&o.memoizedState===null?!1:(yr.current&2)!==0),A&&(v=!0,a.flags&=-129),A=(a.flags&32)!==0,a.flags&=-33,o===null){if(yt){if(v?Rl(a):Ol(),(o=en)?(o=gO(o,Ys),o=o!==null&&o.data!=="&"?o:null,o!==null&&(a.memoizedState={dehydrated:o,treeContext:xl!==null?{id:Di,overflow:Ii}:null,retryLane:536870912,hydrationErrors:null},f=RN(o),f.return=a,a.child=f,tr=a,en=null)):o=null,o===null)throw vl(a);return Kv(o)?a.lanes=32:a.lanes=536870912,null}return S=p.children,p=p.fallback,v?(Ol(),v=a.mode,S=Km({mode:"hidden",children:S},v),p=qa(p,v,f,null),S.return=a,p.return=a,S.sibling=p,a.child=S,p=a.child,p.memoizedState=Kb(f),p.childLanes=Yb(o,A,f),a.memoizedState=Gb,$d(null,p)):(Rl(a),Wb(a,S))}var V=o.memoizedState;if(V!==null){var Y=V.dehydrated;if(Y!==null)return AF(o,a,S,A,p,Y,V,f)}return v?(Ol(),v=p.fallback,S=a.mode,V=o.child,Y=V.sibling,p=vo(V,{mode:"hidden",children:p.children}),p.subtreeFlags=V.subtreeFlags&1206910976,Y!==null?v=vo(Y,v):(v=qa(v,S,f,null),v.flags|=2),v.return=a,p.return=a,p.sibling=v,a.child=p,$d(null,p),p=a.child,v=o.child.memoizedState,v===null?v=Kb(f):(S=v.cachePool,S!==null?(V=jn._currentValue,S=S.parent!==V?{parent:V,pool:V}:S):S=LN(),v={baseLanes:v.baseLanes|f,cachePool:S}),p.memoizedState=v,p.childLanes=Yb(o,A,f),a.memoizedState=Gb,$d(o.child,p)):(Rl(a),f=o.child,o=f.sibling,f=vo(f,{mode:"visible",children:p.children}),f.return=a,f.sibling=null,o!==null&&(A=a.deletions,A===null?(a.deletions=[o],a.flags|=16):A.push(o)),a.child=f,a.memoizedState=null,f)}function Wb(o,a){return a=Km({mode:"visible",children:a},o.mode),a.return=o,o.child=a}function Km(o,a){return o=as(22,o,null,a),o.lanes=0,o}function Ym(o,a,f){return ec(a,o.child,null,f),o=Wb(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function AF(o,a,f,p,v,S,A,V){if(f)return a.flags&256?(Rl(a),a.flags&=-257,Ym(o,a,V)):a.memoizedState!==null?(Ol(),a.child=o.child,a.flags|=128,null):(Ol(),S=v.fallback,A=a.mode,v=Km({mode:"visible",children:v.children},A),S=qa(S,A,V,null),S.flags|=2,v.return=a,S.return=a,v.sibling=S,a.child=v,ec(a,o.child,null,V),v=a.child,v.memoizedState=Kb(V),v.childLanes=Yb(o,p,V),a.memoizedState=Gb,$d(null,v));if(Rl(a),Kv(S)){if(p=S.nextSibling&&S.nextSibling.dataset,p)var Y=p.dgst;return p=Y,p!==""&&(v=Error(r(419)),v.stack="",v.digest=p,Md({value:v,source:null,stack:null})),Ym(o,a,V)}if(Pn||Ya(o,a,V,!1),p=(V&o.childLanes)!==0,Pn||p){if(Tl.current!==null)return Ym(o,a,V);if(p=Qt,p!==null&&(v=uo(p,V),v!==0&&v!==A.retryLane))throw A.retryLane=v,Ua(o,v),ds(p,o,v),Ub;return Gv(S)||dg(),Ym(o,a,V)}return Gv(S)?(a.flags|=192,a.child=o.child,null):(o=A.treeContext,en=Xs(S.nextSibling),tr=a,yt=!0,bl=null,Ys=!1,o!==null&&MN(a,o),a=Wb(a,v.children),a.flags|=134221824,a)}function WT(o,a,f){o.lanes|=a;var p=o.alternate;p!==null&&(p.lanes|=a),Tm(o.return,a,f)}function XT(o){for(var a=null;o!==null;){var f=o.alternate;f!==null&&jm(f)===null&&(a=o),o=o.sibling}return a}function Wm(o,a,f,p,v,S){var A=o.memoizedState;A===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:v,treeForkCount:S}:(A.isBackwards=a,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=f,A.tailMode=v,A.treeForkCount=S)}function Xb(o){var a=o.child;for(o.child=null;a!==null;){var f=a.sibling;a.sibling=o.child,o.child=a,a=f}}function Qb(o,a,f){var p=a.pendingProps,v=p.revealOrder,S=p.tail;p=p.children;var A=yr.current;if(a.flags&128)return zd(a,A),null;var V=(A&2)!==0;if(V?(A=A&1|2,a.flags|=128):A&=1,zd(a,A),v==="backwards"&&o!==null?(Xb(o),Xn(o,a,p,f),Xb(o)):Xn(o,a,p,f),p=yt?kd:0,!V&&o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&WT(o,f,a);else if(o.tag===19)WT(o,f,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(v){case"backwards":f=XT(a.child),f===null?(v=a.child,a.child=null):(v=f.sibling,f.sibling=null,Xb(a)),Wm(a,!0,v,null,S,p);break;case"unstable_legacy-backwards":for(f=null,v=a.child,a.child=null;v!==null;){if(o=v.alternate,o!==null&&jm(o)===null){a.child=v;break}o=v.sibling,v.sibling=f,f=v,v=o}Wm(a,!0,f,null,S,p);break;case"together":Wm(a,!1,null,null,void 0,p);break;case"independent":a.memoizedState=null;break;default:f=XT(a.child),f===null?(v=a.child,a.child=null):(v=f.sibling,f.sibling=null),Wm(a,!1,v,f,S,p)}return a.child}function QT(o,a,f){var p=a.pendingProps;return Sl(a,a.type,p.value),Xn(o,a,p.children,f),a.child}function To(o,a,f){if(o!==null&&(a.dependencies=o.dependencies),_l|=a.lanes,(f&a.childLanes)===0)if(o!==null){if(Ya(o,a,f,!1),(f&a.childLanes)===0)return null}else return null;if(o!==null&&a.child!==o.child)throw Error(r(153));if(a.child!==null){for(o=a.child,f=vo(o,o.pendingProps),a.child=f,f.return=a;o.sibling!==null;)o=o.sibling,f=f.sibling=vo(o,o.pendingProps),f.return=a;f.sibling=null}return a.child}function Zb(o,a){return(o.lanes&a)!==0?!0:(o=o.dependencies,!!(o!==null&&Rm(o)))}function _F(o,a,f){switch(a.tag){case 3:We(a,a.stateNode.containerInfo),Sl(a,jn,o.memoizedState.cache),Ga();break;case 27:case 5:De(a);break;case 4:We(a,a.stateNode.containerInfo);break;case 10:Sl(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Eb(a),null;break;case 13:var p=a.memoizedState;if(p!==null){if(p.dehydrated!==null)return Rl(a),a.flags|=128,null;p=Ya(o,a,f,!1);var v=a.child.childLanes;return p||(f&v)!==0?YT(o,a,f):(Rl(a),o=To(o,a,f),o!==null?o.sibling:null)}Rl(a);break;case 19:if(a.flags&128)return Qb(o,a,f);if(v=(o.flags&128)!==0,p=(f&a.childLanes)!==0,p||(Ya(o,a,f,!1),p=(f&a.childLanes)!==0),v){if(p)return Qb(o,a,f);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),zd(a,yr.current),p)break;return null;case 22:return a.lanes=0,$T(o,a,f,a.pendingProps);case 24:Sl(a,jn,o.memoizedState.cache)}return To(o,a,f)}function ZT(o,a,f){if(o!==null)if(o.memoizedProps!==a.pendingProps)Pn=!0;else{if(!Zb(o,f)&&(a.flags&128)===0)return Pn=!1,_F(o,a,f);Pn=(o.flags&131072)!==0}else Pn=!1,yt&&(a.flags&1048576)!==0&&kN(a,kd,a.index);switch(a.lanes=0,a.tag){case 16:e:{var p=a.pendingProps;if(o=Za(a.elementType),a.type=o,typeof o=="function")ib(o)?(p=nc(o,p),a.tag=1,a=GT(null,a,o,p,f)):(a.tag=0,a=qb(null,a,o,p,f));else{if(o!=null){var v=o.$$typeof;if(v===L){a.tag=11,a=BT(null,a,o,p,f);break e}else if(v===G){a.tag=14,a=HT(null,a,o,p,f);break e}else if(v===B){a.tag=10,a.type=o,a=QT(null,a,f);break e}}throw a=ce(o)||o,Error(r(306,a,""))}}return a;case 0:return qb(o,a,a.type,a.pendingProps,f);case 1:return p=a.type,v=nc(p,a.pendingProps),GT(o,a,p,v,f);case 3:e:{if(We(a,a.stateNode.containerInfo),o===null)throw Error(r(387));p=a.pendingProps;var S=a.memoizedState;v=S.element,xb(o,a),Pd(a,p,null,f);var A=a.memoizedState;if(p=A.cache,Sl(a,jn,p),p!==S.cache&&db(a,[jn],f,!0),Ld(),p=A.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:A.cache},a.updateQueue.baseState=S,a.memoizedState=S,a.flags&256){a=KT(o,a,p,f);break e}else if(p!==v){v=qs(Error(r(424)),a),Md(v),a=KT(o,a,p,f);break e}else{switch(o=a.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(en=Xs(o.firstChild),tr=a,yt=!0,bl=null,Ys=!0,f=$N(a,null,p,f),a.child=f;f;)f.flags=f.flags&-3|134221824,f=f.sibling}else{if(Ga(),p===v){a=To(o,a,f);break e}Xn(o,a,p,f)}a=a.child}return a;case 26:return Au(o,a),o===null?(f=EO(a.type,null,a.pendingProps,null))?a.memoizedState=f:yt||(a.stateNode=nO(a.type,a.pendingProps,Ie.current,a)):a.memoizedState=EO(a.type,o.memoizedProps,a.pendingProps,o.memoizedState),null;case 27:return De(a),o===null&&yt&&(p=a.stateNode=bO(a.type,a.pendingProps,Ie.current),tr=a,Ys=!0,v=en,Ll(a.type)?(Yv=v,en=Xs(p.firstChild)):en=v),Xn(o,a,a.pendingProps.children,f),Au(o,a),o===null&&(a.flags|=4194304),a.child;case 5:return o===null&&yt&&((v=p=en)&&(p=T8(p,a.type,a.pendingProps,Ys),p!==null?(a.stateNode=p,tr=a,en=Xs(p.firstChild),Ys=!1,v=!0):v=!1),v||vl(a)),De(a),v=a.type,S=a.pendingProps,A=o!==null?o.memoizedProps:null,p=S.children,Bv(v,S)?p=null:A!==null&&Bv(v,A)&&(a.flags|=32),a.memoizedState!==null&&(v=Tb(o,a,SF,null,null,f),Wu._currentValue=v),Au(o,a),Xn(o,a,p,f),a.child;case 6:return o===null&&yt&&((o=f=en)&&(f=R8(f,a.pendingProps,Ys),f!==null?(a.stateNode=f,tr=a,en=null,o=!0):o=!1),o||vl(a)),null;case 13:return YT(o,a,f);case 4:return We(a,a.stateNode.containerInfo),p=a.pendingProps,o===null?a.child=ec(a,null,p,f):Xn(o,a,p,f),a.child;case 11:return BT(o,a,a.type,a.pendingProps,f);case 7:return p=a.pendingProps,Au(o,a),Xn(o,a,p,f),a.child;case 8:return Xn(o,a,a.pendingProps.children,f),a.child;case 12:return Xn(o,a,a.pendingProps.children,f),a.child;case 10:return QT(o,a,f);case 9:return v=a.type._context,p=a.pendingProps.children,Wa(a),v=mr(v),p=p(v),a.flags|=1,Xn(o,a,p,f),a.child;case 14:return HT(o,a,a.type,a.pendingProps,f);case 15:return FT(o,a,a.type,a.pendingProps,f);case 19:return Qb(o,a,f);case 31:return MF(o,a,f);case 22:return $T(o,a,f,a.pendingProps);case 24:return Wa(a),p=mr(jn),o===null?(v=mb(),v===null&&(v=Qt,S=hb(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=f),v=S),a.memoizedState={parent:p,cache:v},yb(a),Sl(a,jn,v)):((o.lanes&f)!==0&&(xb(o,a),Pd(a,null,null,f),Ld()),v=o.memoizedState,S=a.memoizedState,v.parent!==p?(v={parent:p,cache:p},a.memoizedState=v,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=v),Sl(a,jn,p)):(p=S.cache,Sl(a,jn,p),p!==v.cache&&db(a,[jn],f,!0))),Xn(o,a,a.pendingProps.children,f),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),p=a.pendingProps,p.name!=null&&p.name!=="auto"?a.flags|=o===null?18882560:18874368:yt&&Cm(a),o!==null&&o.memoizedProps.name!==p.name?a.flags|=4194816:Au(o,a),Xn(o,a,p.children,f),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Ro(o){o.flags|=4}function Jb(o,a,f,p,v){var S;if((S=(o.mode&32)!==0)&&(S=f===null?RO(a,p):RO(a,p)&&(p.src!==f.src||p.srcSet!==f.srcSet)),S){if(o.flags|=16777216,(v&335544128)===v)if(o.stateNode.complete)o.flags|=8192;else if(DR())o.flags|=8192;else throw Ja=Am,gb}else o.flags&=-16777217}function JT(o,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!OO(a))if(DR())o.flags|=8192;else throw Ja=Am,gb}function Xm(o,a){a!==null&&(o.flags|=4),o.flags&16384&&(a=o.tag!==22?dr():536870912,o.lanes|=a,Lu|=a)}function Vd(o,a){if(!yt)switch(o.tailMode){case"visible":break;case"collapsed":for(var f=o.tail,p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null;break;default:for(a=o.tail,f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?o.tail=null:f.sibling=null}}function tn(o){var a=o.alternate!==null&&o.alternate.child===o.child,f=0,p=0;if(a)for(var v=o.child;v!==null;)f|=v.lanes|v.childLanes,p|=v.subtreeFlags&1206910976,p|=v.flags&1206910976,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)f|=v.lanes|v.childLanes,p|=v.subtreeFlags,p|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=p,o.childLanes=f,a}function DF(o,a,f){var p=a.pendingProps;switch(ab(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(a),null;case 1:return tn(a),null;case 3:return f=a.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),a.memoizedState.cache!==p&&(a.flags|=2048),Eo(jn),Oe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(Cu(a)?Ro(a):o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,ub())),tn(a),null;case 26:var v=a.type,S=a.memoizedState;return o===null?(Ro(a),S!==null?(tn(a),JT(a,S)):(tn(a),Jb(a,v,null,p,f))):S?S!==o.memoizedState?(Ro(a),tn(a),JT(a,S)):(tn(a),a.flags&=-16777217):(o=o.memoizedProps,o!==p&&Ro(a),tn(a),Jb(a,v,o,p,f)),null;case 27:if(ne(a),f=Ie.current,v=a.type,o!==null&&a.stateNode!=null)o.memoizedProps!==p&&Ro(a);else{if(!p){if(a.stateNode===null)throw Error(r(166));return tn(a),a.subtreeFlags&=-33554433,null}o=Ae.current,Cu(a)?AN(a):(o=bO(v,p,f),a.stateNode=o,Ro(a))}return tn(a),a.subtreeFlags&=-33554433,null;case 5:if(ne(a),v=a.type,o!==null&&a.stateNode!=null)o.memoizedProps!==p&&Ro(a);else{if(!p){if(a.stateNode===null)throw Error(r(166));return tn(a),a.subtreeFlags&=-33554433,null}if(S=Ae.current,Cu(a))AN(a);else{var A=eh(Ie.current);switch(S){case 1:S=A.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=A.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=A.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=A.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=A.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?A.createElement(v,{is:p.is}):A.createElement(v)}}S[nn]=a,S[Yn]=p;e:for(A=a.child;A!==null;){if(A.tag===5||A.tag===6)S.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===a)break e;for(;A.sibling===null;){if(A.return===null||A.return===a)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}a.stateNode=S;e:switch(br(S,v,p),v){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ro(a)}}return tn(a),a.subtreeFlags&=-33554433,Jb(a,a.type,o===null?null:o.memoizedProps,a.pendingProps,f),null;case 6:if(o&&a.stateNode!=null)o.memoizedProps!==p&&Ro(a);else{if(typeof p!="string"&&a.stateNode===null)throw Error(r(166));if(o=Ie.current,Cu(a)){if(o=a.stateNode,f=a.memoizedProps,p=null,v=tr,v!==null)switch(v.tag){case 27:case 5:p=v.memoizedProps}o[nn]=a,o=!!(o.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||ZR(o.nodeValue,f)),o||vl(a,!0)}else o=eh(o).createTextNode(p),o[nn]=a,a.stateNode=o}return tn(a),null;case 31:if(f=a.memoizedState,o===null||o.memoizedState!==null){if(p=Cu(a),f!==null){if(o===null){if(!p)throw Error(r(318));if(o=a.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[nn]=a}else Ga(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;tn(a),o=!1}else f=ub(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return a.flags&256?(Os(a),a):(Os(a),null);if((a.flags&128)!==0)throw Error(r(558))}return tn(a),null;case 13:if(p=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(v=Cu(a),p!==null&&p.dehydrated!==null){if(o===null){if(!v)throw Error(r(318));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[nn]=a}else Ga(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;tn(a),v=!1}else v=ub(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=v),v=!0;if(!v)return a.flags&256?(Os(a),a):(Os(a),null)}return Os(a),(a.flags&128)!==0?(a.lanes=f,a):(f=p!==null,o=o!==null&&o.memoizedState!==null,f&&(p=a.child,v=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(v=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==v&&(p.flags|=2048)),f!==o&&f&&(a.child.flags|=8192),Xm(a,a.updateQueue),tn(a),null);case 4:return Oe(),o===null&&Iv(a.stateNode.containerInfo),a.flags|=67108864,tn(a),null;case 10:return Eo(a.type),tn(a),null;case 19:if(Cb(a),p=a.memoizedState,p===null)return tn(a),null;if(v=(a.flags&128)!==0,S=p.rendering,S===null)if(v)Vd(p,!1);else{if(Cn!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(S=jm(o),S!==null){for(a.flags|=128,Vd(p,!1),o=S.updateQueue,a.updateQueue=o,Xm(a,o),a.subtreeFlags=0,o=f,f=a.child;f!==null;)TN(f,o),f=f.sibling;return zd(a,yr.current&1|2),yt&&So(a,p.treeForkCount),a.child}o=o.sibling}p.tail!==null&&on()>ag&&(a.flags|=128,v=!0,Vd(p,!1),a.lanes=4194304)}else{if(!v)if(o=jm(S),o!==null){if(a.flags|=128,v=!0,o=o.updateQueue,a.updateQueue=o,Xm(a,o),Vd(p,!0),p.tail===null&&p.tailMode!=="collapsed"&&p.tailMode!=="visible"&&!S.alternate&&!yt)return tn(a),null}else 2*on()-p.renderingStartTime>ag&&f!==536870912&&(a.flags|=128,v=!0,Vd(p,!1),a.lanes=4194304);p.isBackwards?(S.sibling=a.child,a.child=S):(o=p.last,o!==null?o.sibling=S:a.child=S,p.last=S)}if(p.tail!==null){o=p.tail;e:{for(f=o;f!==null;){if(f.alternate!==null){f=!1;break e}f=f.sibling}f=!0}return p.rendering=o,p.tail=o.sibling,p.renderingStartTime=on(),o.sibling=null,S=yr.current,S=v?S&1|2:S&1,p.tailMode==="visible"||p.tailMode==="collapsed"||!f||yt?zd(a,S):(f=S,Re(gr,a),Re(yr,f),Mr===null&&(Mr=a)),yt&&So(a,p.treeForkCount),o}return tn(a),null;case 22:case 23:return Os(a),wb(),p=a.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(a.flags|=8192):p&&(a.flags|=8192),p?(f&536870912)!==0&&(a.flags&128)===0&&(tn(a),a.subtreeFlags&6&&(a.flags|=8192)):tn(a),f=a.updateQueue,f!==null&&Xm(a,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),p=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(p=a.memoizedState.cachePool.pool),p!==f&&(a.flags|=2048),o!==null&&we(Qa),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),Eo(jn),tn(a),null;case 25:return null;case 30:return a.flags|=33554432,tn(a),null}throw Error(r(156,a.tag))}function IF(o,a){switch(ab(a),a.tag){case 1:return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Eo(jn),Oe(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 26:case 27:case 5:return ne(a),null;case 31:if(a.memoizedState!==null){if(Os(a),a.alternate===null)throw Error(r(340));Ga()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 13:if(Os(a),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ga()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return Cb(a),o=a.flags,o&65536?(a.flags=o&-65537|128,o=a.memoizedState,o!==null&&(o.rendering=null,o.tail=null),a.flags|=4,a):null;case 4:return Oe(),null;case 10:return Eo(a.type),null;case 22:case 23:return Os(a),wb(),o!==null&&we(Qa),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 24:return Eo(jn),null;case 25:return null;default:return null}}function eR(o,a){switch(ab(a),a.tag){case 3:Eo(jn),Oe();break;case 26:case 27:case 5:ne(a);break;case 4:Oe();break;case 31:a.memoizedState!==null&&Os(a);break;case 13:Os(a);break;case 19:Cb(a);break;case 10:Eo(a.type);break;case 22:case 23:Os(a),wb(),o!==null&&we(Qa);break;case 24:Eo(jn)}}function Ud(o,a){try{var f=a.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var v=p.next;f=v;do{if((f.tag&o)===o){p=void 0;var S=f.create,A=f.inst;p=S(),A.destroy=p}f=f.next}while(f!==v)}}catch(V){Ut(a,a.return,V)}}function kl(o,a,f){try{var p=a.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var S=v.next;p=S;do{if((p.tag&o)===o){var A=p.inst,V=A.destroy;if(V!==void 0){A.destroy=void 0,v=a;var Y=f,ae=V;try{ae()}catch(me){Ut(v,Y,me)}}}p=p.next}while(p!==S)}}catch(me){Ut(a,a.return,me)}}function tR(o){var a=o.updateQueue;if(a!==null){var f=o.stateNode;try{UN(a,f)}catch(p){Ut(o,o.return,p)}}}function nR(o,a,f){f.props=nc(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(p){Ut(o,a,p)}}function ji(o,a){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:var v=o.stateNode,S=xo(o.memoizedProps,v);(v.ref===null||v.ref.name!==S)&&(v.ref=cO(S)),p=v.ref;break;case 7:if(o.stateNode===null){var A=new Ds(o);m(o.child,!1,C8,A,void 0,void 0),o.stateNode=A}p=o.stateNode;break;default:p=o.stateNode}typeof f=="function"?o.refCleanup=f(p):f.current=p}}catch(V){Ut(o,a,V)}}function xr(o,a){var f=o.ref,p=o.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(v){Ut(o,a,v)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){Ut(o,a,v)}else f.current=null}function Qm(o,a){if((o.tag===5||o.tag===27||o.tag===6)&&o.alternate===null&&a!==null)for(var f=0;f<a.length;f++)mO(o.stateNode,a[f])}function rR(o){for(var a=o.return;a!==null&&(tv(a)&&mO(o.stateNode,a.stateNode),!ev(a));)a=a.return}function qd(o){for(var a=o.return;a!==null&&(tv(a)&&N8(o.stateNode,a.stateNode),!ev(a));)a=a.return}function ev(o){return o.tag===5||o.tag===3||o.tag===27}function tv(o){return o&&o.tag===7&&o.stateNode!==null}function nv(o){var a=o.type,f=o.memoizedProps,p=o.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(v){Ut(o,o.return,v)}}function rv(o,a,f){try{var p=o.stateNode;o8(p,o.type,f,a),p[Yn]=a}catch(v){Ut(o,o.return,v)}}function sR(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ll(o.type)||o.tag===4}function sv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||sR(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ll(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function iv(o,a,f,p){var v=o.tag;if(v===5||v===6)v=o.stateNode,a?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(v,a):(a=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,a.appendChild(v),f=f._reactRootContainer,f!=null||a.onclick!==null||(a.onclick=$r)),Qm(o,p),tt=!0;else if(v!==4&&(v===27&&(Qm(o,p),p=null,Ll(o.type)&&(f=o.stateNode,a=null)),o=o.child,o!==null))for(iv(o,a,f,p),o=o.sibling;o!==null;)iv(o,a,f,p),o=o.sibling}function Zm(o,a,f,p){var v=o.tag;if(v===5||v===6)v=o.stateNode,a?f.insertBefore(v,a):f.appendChild(v),Qm(o,p),tt=!0;else if(v!==4&&(v===27&&(Qm(o,p),p=null,Ll(o.type)&&(f=o.stateNode)),o=o.child,o!==null))for(Zm(o,a,f,p),o=o.sibling;o!==null;)Zm(o,a,f,p),o=o.sibling}function iR(o){var a=o.stateNode,f=o.memoizedProps;try{for(var p=o.type,v=a.attributes;v.length;)a.removeAttributeNode(v[0]);br(a,p,f),a[nn]=o,a[Yn]=f}catch(S){Ut(o,o.return,S)}}var Jm=!1,ks=null;function oR(o){(o.tag===30||(o.subtreeFlags&33554432)!==0)&&(Jm=!0)}var Li=null;function lR(){var o=Li;return Li=null,o}var cs=0;function _u(o,a,f,p,v){return cs=0,aR(o.child,a,f,p,v)}function aR(o,a,f,p,v){for(var S=!1;o!==null;){if(o.tag===5){var A=o.stateNode;if(p!==null){var V=$v(A);p.push(V),V.view&&(S=!0)}else S||$v(A).view&&(S=!0);Jm=!0,lO(A,cs===0?a:a+"_"+cs,f),cs++}else(o.tag!==22||o.memoizedState===null)&&(o.tag===30&&v||aR(o.child,a,f,p,v)&&(S=!0));o=o.sibling}return S}function Pi(o,a){for(;o!==null;)o.tag===5?aO(o.stateNode,o.memoizedProps):(o.tag!==22||o.memoizedState===null)&&(o.tag===30&&a||Pi(o.child,a)),o=o.sibling}function eg(o){if((o.subtreeFlags&18874368)!==0)for(o=o.child;o!==null;){if((o.tag!==22||o.memoizedState===null)&&(eg(o),o.tag===30&&(o.flags&18874368)!==0&&o.stateNode.paired)){var a=o.memoizedProps;if(a.name==null||a.name==="auto")throw Error(r(544));var f=a.name;a=bo(a.default,a.share),a!=="none"&&(_u(o,f,a,null,!1)||Pi(o.child,!1))}o=o.sibling}}function ov(o,a){if(o.tag===30){var f=o.stateNode,p=o.memoizedProps,v=xo(p,f),S=bo(p.default,f.paired?p.share:p.enter);S!=="none"?_u(o,v,S,null,!1)?(eg(o),f.paired||a||Hu(o,p.onEnter)):Pi(o.child,!1):eg(o)}else if((o.subtreeFlags&33554432)!==0)for(o=o.child;o!==null;)ov(o,a),o=o.sibling;else eg(o)}function lv(o){if(ks!==null&&ks.size!==0){var a=ks;if((o.subtreeFlags&18874368)!==0)for(o=o.child;o!==null;){if(o.tag!==22||o.memoizedState===null){if(o.tag===30&&(o.flags&18874368)!==0){var f=o.memoizedProps,p=f.name;if(p!=null&&p!=="auto"){var v=a.get(p);if(v!==void 0){var S=bo(f.default,f.share);if(S!=="none"&&(_u(o,p,S,null,!1)?(S=o.stateNode,v.paired=S,S.paired=v,Hu(o,f.onShare)):Pi(o.child,!1)),a.delete(p),a.size===0)break}}}lv(o)}o=o.sibling}}}function av(o){if(o.tag===30){var a=o.memoizedProps,f=xo(a,o.stateNode),p=ks!==null?ks.get(f):void 0,v=bo(a.default,p!==void 0?a.share:a.exit);v!=="none"&&(_u(o,f,v,null,!1)?p!==void 0?(v=o.stateNode,p.paired=v,v.paired=p,ks.delete(f),Hu(o,a.onShare)):Hu(o,a.onExit):Pi(o.child,!1)),ks!==null&&lv(o)}else if((o.subtreeFlags&33554432)!==0)for(o=o.child;o!==null;)av(o),o=o.sibling;else ks!==null&&lv(o)}function cR(o){for(o=o.child;o!==null;){if(o.tag===30){var a=o.memoizedProps,f=xo(a,o.stateNode);a=bo(a.default,a.update),o.flags&=-5,a!=="none"&&_u(o,f,a,o.memoizedState=[],!1)}else(o.subtreeFlags&33554432)!==0&&cR(o);o=o.sibling}}function cv(o){if((o.subtreeFlags&18874368)!==0)for(o=o.child;o!==null;){if(o.tag!==22||o.memoizedState===null){if(o.tag===30&&(o.flags&18874368)!==0){var a=o.stateNode;a.paired!==null&&(a.paired=null,Pi(o.child,!1))}cv(o)}o=o.sibling}}function tg(o){if(o.tag===30)o.stateNode.paired=null,Pi(o.child,!1),cv(o);else if((o.subtreeFlags&33554432)!==0)for(o=o.child;o!==null;)tg(o),o=o.sibling;else cv(o)}function uR(o){for(o=o.child;o!==null;)o.tag===30?Pi(o.child,!1):(o.subtreeFlags&33554432)!==0&&uR(o),o=o.sibling}function uv(o,a,f,p,v,S,A){for(var V=!1;a!==null;){if(a.tag===5){var Y=a.stateNode;if(S!==null&&cs<S.length){var ae=S[cs],me=$v(Y);(ae.view||me.view)&&(V=!0);var ve;if(ve=(o.flags&4)===0)if(me.clip)ve=!0;else{ve=ae.rect;var ie=me.rect;ve=ve.y!==ie.y||ve.x!==ie.x||ve.height!==ie.height||ve.width!==ie.width}ve&&(o.flags|=4),me.abs?me=!ae.abs:(ae=ae.rect,me=me.rect,me=ae.height!==me.height||ae.width!==me.width),me&&(o.flags|=32)}else o.flags|=32;(o.flags&4)!==0&&lO(Y,cs===0?f:f+"_"+cs,v),V&&(o.flags&4)!==0||(Li===null&&(Li=[]),Li.push(Y,cs===0?p:p+"_"+cs,a.memoizedProps)),cs++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&A?o.flags|=a.flags&32:uv(o,a.child,f,p,v,S,A)&&(V=!0));a=a.sibling}return V}function fR(o,a){for(o=o.child;o!==null;){if(o.tag===30){var f=o.memoizedProps,p=o.stateNode,v=xo(f,p),S=bo(f.default,f.update),A;A=o.memoizedState,o.memoizedState=null,p=o;var V=o.child;cs=0,v=uv(p,V,v,v,S,A,!1),(o.flags&4)!==0&&v&&Hu(o,f.onUpdate)}else(o.subtreeFlags&33554432)!==0&&fR(o);o=o.sibling}}var nr=!1,Ft=!1,zi=!1,fv=!1,dR=typeof WeakSet=="function"?WeakSet:Set,rr=null,Bi=!1,Gd=!1,ng=!1,dv=!1;function jF(o,a,f){if(o=o.containerInfo,Pv=Xu,o=gN(o),Zx(o)){if("selectionStart"in o)var p={start:o.selectionStart,end:o.selectionEnd};else e:{p=(p=o.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var S=v.anchorOffset,A=v.focusNode;v=v.focusOffset;try{p.nodeType,A.nodeType}catch{p=null;break e}var V=0,Y=-1,ae=-1,me=0,ve=0,ie=o,fe=null;t:for(;;){for(var je;ie!==p||S!==0&&ie.nodeType!==3||(Y=V+S),ie!==A||v!==0&&ie.nodeType!==3||(ae=V+v),ie.nodeType===3&&(V+=ie.nodeValue.length),(je=ie.firstChild)!==null;)fe=ie,ie=je;for(;;){if(ie===o)break t;if(fe===p&&++me===S&&(Y=V),fe===A&&++ve===v&&(ae=V),(je=ie.nextSibling)!==null)break;ie=fe,fe=ie.parentNode}ie=je}p=Y===-1||ae===-1?null:{start:Y,end:ae}}else p=null}p=p||{start:0,end:0}}else p=null;for(zv={focusedElem:o,selectionRange:p},Xu=!1,f=(f&335544064)===f,rr=a,a=f?9270:1024;rr!==null;){if(o=rr,f&&(p=o.deletions,p!==null))for(S=0;S<p.length;S++)f&&av(p[S]);if(o.alternate===null&&(o.flags&2)!==0)f&&oR(o),rg(f);else{if(o.tag===22){if(p=o.alternate,o.memoizedState!==null){p!==null&&p.memoizedState===null&&f&&av(p),rg(f);continue}else if(p!==null&&p.memoizedState!==null){f&&oR(o),rg(f);continue}}p=o.child,(o.subtreeFlags&a)!==0&&p!==null?(p.return=o,rr=p):(f&&cR(o),rg(f))}}ks=null}function rg(o){for(;rr!==null;){var a=rr,f=o,p=a.alternate,v=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((v&1024)!==0&&p!==null){f=void 0,v=p.memoizedProps,p=p.memoizedState;var S=a.stateNode;try{var A=nc(a.type,v);f=S.getSnapshotBeforeUpdate(A,p),S.__reactInternalSnapshotBeforeUpdate=f}catch(V){Ut(a,a.return,V)}}break;case 3:if((v&1024)!==0){if(p=a.stateNode.containerInfo,f=p.nodeType,f===9)qv(p);else if(f===1)switch(p.nodeName){case"HEAD":case"HTML":case"BODY":qv(p);break;default:p.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:f&&p!==null&&(f=xo(p.memoizedProps,p.stateNode),v=a.memoizedProps,v=bo(v.default,v.update),v!=="none"&&_u(p,f,v,p.memoizedState=[],!0));break;default:if((v&1024)!==0)throw Error(r(163))}if(p=a.sibling,p!==null){p.return=a.return,rr=p;break}rr=a.return}}function hR(o,a,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:Hi(o,f),p&4&&Ud(5,f);break;case 1:if(Hi(o,f),p&4)if(o=f.stateNode,a===null)try{o.componentDidMount()}catch(A){Ut(f,f.return,A)}else{var v=nc(f.type,a.memoizedProps);a=a.memoizedState;try{o.componentDidUpdate(v,a,o.__reactInternalSnapshotBeforeUpdate)}catch(A){Ut(f,f.return,A)}}p&64&&tR(f),p&512&&ji(f,f.return);break;case 3:if(Hi(o,f),p&64&&(o=f.updateQueue,o!==null)){if(a=null,f.child!==null)switch(f.child.tag){case 27:case 5:a=f.child.stateNode;break;case 1:a=f.child.stateNode}try{UN(o,a)}catch(A){Ut(f,f.return,A)}}break;case 27:a===null&&p&4&&iR(f);case 26:case 5:Hi(o,f),a===null&&p&4&&nv(f),p&512&&ji(f,f.return);break;case 12:Hi(o,f);break;case 31:Hi(o,f),p&4&&yR(o,f);break;case 13:Hi(o,f),p&4&&xR(o,f),p&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=KF.bind(null,f),O8(o,f))));break;case 22:if(p=f.memoizedState!==null||nr,!p){var S=a!==null&&a.memoizedState!==null||Ft;a=nr,v=Ft,nr=p,(Ft=S)&&!v?(p=2,(f.subtreeFlags&8772)!==0&&(p|=1),fi(o,f,p)):Hi(o,f),nr=a,Ft=v}break;case 30:Hi(o,f),p&512&&ji(f,f.return);break;case 7:p&512&&ji(f,f.return);default:Hi(o,f)}}function hv(o,a){for(o=o.child;o!==null;)pR(o,a),o=o.sibling}function pR(o,a){switch(o.tag){case 5:case 26:try{var f=o.stateNode;if(a){var p=f.style;typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"}else{var v=o.stateNode,S=o.memoizedProps.style,A=S!=null&&S.hasOwnProperty("display")?S.display:null;v.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(Y){Ut(o,o.return,Y)}pv(o,a);break;case 6:try{o.stateNode.nodeValue=a?"":o.memoizedProps,tt=!0}catch(Y){Ut(o,o.return,Y)}break;case 18:try{var V=o.stateNode;a?oO(V,!0):oO(o.stateNode,!1)}catch(Y){Ut(o,o.return,Y)}break;case 22:case 23:o.memoizedState===null&&hv(o,a);break;default:hv(o,a)}}function pv(o,a){if(o.subtreeFlags&67108864)for(o=o.child;o!==null;){e:{var f=o,p=a;switch(f.tag){case 4:pR(f,p);break e;case 22:f.memoizedState===null&&pv(f,p);break e;default:pv(f,p)}}o=o.sibling}}function mR(o){var a=o.alternate;a!==null&&(o.alternate=null,mR(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&hl(a)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var an=null,us=!1;function ci(o,a,f){for(f=f.child;f!==null;)gR(o,a,f),f=f.sibling}function gR(o,a,f){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(On,f)}catch{}switch(f.tag){case 26:Ft||xr(f,a),ci(o,a,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&!Ft&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Ft||xr(f,a),qd(f);var p=an,v=us;Ll(f.type)&&(an=f.stateNode,us=!1),ci(o,a,f),vO(f.stateNode,f.type,f.memoizedProps),an=p,us=v;break;case 5:Ft||xr(f,a),qd(f);case 6:if(f.tag===6&&qd(f),p=an,v=us,an=null,ci(o,a,f),an=p,us=v,an!==null)if(us)try{(an.nodeType===9?an.body:an.nodeName==="HTML"?an.ownerDocument.body:an).removeChild(f.stateNode),tt=!0}catch(S){Ut(f,a,S)}else try{an.removeChild(f.stateNode),tt=!0}catch(S){Ut(f,a,S)}break;case 18:an!==null&&(us?(o=an,iO(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),Qu(o)):iO(an,f.stateNode));break;case 4:p=an,v=us,an=f.stateNode.containerInfo,us=!0,ci(o,a,f),an=p,us=v;break;case 0:case 11:case 14:case 15:kl(2,f,a),Ft||kl(4,f,a),ci(o,a,f);break;case 1:Ft||(xr(f,a),p=f.stateNode,typeof p.componentWillUnmount=="function"&&nR(f,a,p)),ci(o,a,f);break;case 21:ci(o,a,f);break;case 22:Ft=(p=Ft)||f.memoizedState!==null,ci(o,a,f),Ft=p;break;case 30:xr(f,a),ci(o,a,f);break;case 7:Ft||xr(f,a),ci(o,a,f);break;default:ci(o,a,f)}}function yR(o,a){if(a.memoizedState===null&&(o=a.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Qu(o)}catch(f){Ut(a,a.return,f)}}}function xR(o,a){if(a.memoizedState===null&&(o=a.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Qu(o)}catch(f){Ut(a,a.return,f)}}function LF(o){switch(o.tag){case 31:case 13:case 19:var a=o.stateNode;return a===null&&(a=o.stateNode=new dR),a;case 22:return o=o.stateNode,a=o._retryCache,a===null&&(a=o._retryCache=new dR),a;default:throw Error(r(435,o.tag))}}function sg(o,a){var f=LF(o);a.forEach(function(p){if(!f.has(p)){f.add(p);var v=YF.bind(null,o,p);p.then(v,v)}})}function qr(o,a,f){var p=a.deletions;if(p!==null)for(var v=0;v<p.length;v++){var S=p[v],A=o,V=a,Y=V;e:for(;Y!==null;){switch(Y.tag){case 27:if(Ll(Y.type)){an=Y.stateNode,us=!1;break e}break;case 5:an=Y.stateNode,us=!1;break e;case 3:case 4:an=Y.stateNode.containerInfo,us=!0;break e}Y=Y.return}if(an===null)throw Error(r(160));gR(A,V,S),an=null,us=!1,A=S.alternate,A!==null&&(A.return=null),S.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)bR(a,o,f),a=a.sibling}var ui=null;function bR(o,a,f){var p=o.alternate,v=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(v&4&&(p=o.updateQueue,p=p!==null?p.events:null,p!==null))for(var S=0;S<p.length;S++){var A=p[S];A.ref.impl=A.nextImpl}qr(a,o,f),Gr(o),v&4&&(kl(3,o,o.return),Ud(3,o),kl(5,o,o.return));break;case 1:qr(a,o,f),Gr(o),v&512&&(Ft||p===null||xr(p,p.return)),v&64&&nr&&(o=o.updateQueue,o!==null&&(a=o.callbacks,a!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?a:f.concat(a))));break;case 26:if(S=ui,qr(a,o,f),Gr(o),v&512&&(Ft||p===null||xr(p,p.return)),v&4)if(v=p!==null?p.memoizedState:null,f=o.memoizedState,p===null)if(f===null)if(o.stateNode===null)if(nr)o.stateNode=nO(o.type,o.memoizedProps,a.containerInfo,o);else{e:{a=o.type,f=o.memoizedProps,v=S.ownerDocument||S;t:switch(a){case"title":p=v.getElementsByTagName("title")[0],(!p||p[po]||p[nn]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=v.createElement(a),v.head.insertBefore(p,v.querySelector("head > title"))),br(p,a,f),p[nn]=o,Ce(p),a=p;break e;case"link":if(S=TO("link","href",v).get(a+(f.href||""))){for(A=0;A<S.length;A++)if(p=S[A],p.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&p.getAttribute("rel")===(f.rel==null?null:f.rel)&&p.getAttribute("title")===(f.title==null?null:f.title)&&p.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){S.splice(A,1);break t}}p=v.createElement(a),br(p,a,f),v.head.appendChild(p);break;case"meta":if(S=TO("meta","content",v).get(a+(f.content||""))){for(A=0;A<S.length;A++)if(p=S[A],p.getAttribute("content")===(f.content==null?null:""+f.content)&&p.getAttribute("name")===(f.name==null?null:f.name)&&p.getAttribute("property")===(f.property==null?null:f.property)&&p.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&p.getAttribute("charset")===(f.charSet==null?null:f.charSet)){S.splice(A,1);break t}}p=v.createElement(a),br(p,a,f),v.head.appendChild(p);break;default:throw Error(r(468,a))}p[nn]=o,Ce(p),a=p}o.stateNode=a}else nr||Zv(S,o.type,o.stateNode);else o.stateNode=NO(S,f,o.memoizedProps);else v!==f?(v===null?(a=p.stateNode,a===null||Ft||a.parentNode.removeChild(a)):v.count--,f===null?nr||Zv(S,o.type,o.stateNode):NO(S,f,o.memoizedProps)):f===null&&o.stateNode!==null&&rv(o,o.memoizedProps,p.memoizedProps);break;case 27:qr(a,o,f),Gr(o),v&512&&(Ft||p===null||xr(p,p.return)),p!==null&&v&4&&rv(o,o.memoizedProps,p.memoizedProps);break;case 5:if(S=zi,zi=!1,qr(a,o,f),zi=S,Gr(o),v&512&&(Ft||p===null||xr(p,p.return)),o.flags&32){a=o.stateNode;try{Fr(a,""),tt=!0}catch(me){Ut(o,o.return,me)}}v&4&&o.stateNode!=null&&(a=o.memoizedProps,rv(o,a,p!==null?p.memoizedProps:a)),v&1024&&(fv=!0);break;case 6:if(qr(a,o,f),Gr(o),v&4){if(o.stateNode===null)throw Error(r(162));a=o.memoizedProps,f=o.stateNode;try{f.nodeValue=a,tt=!0}catch(me){Ut(o,o.return,me)}}break;case 3:if(tt=!1,bg=null,S=ui,ui=th(a.containerInfo),qr(a,o,f),ui=S,Gr(o),v&4&&p!==null&&p.memoizedState.isDehydrated)try{Qu(a.containerInfo)}catch(me){Ut(o,o.return,me)}fv&&(fv=!1,vR(o)),tt=!1;break;case 4:v=zi,zi=nr,p=Wn(),S=ui,ui=th(o.stateNode.containerInfo),qr(a,o,f),Gr(o),ui=S,tt&&Gd&&(ng=!0),tt=p,zi=v;break;case 12:qr(a,o,f),Gr(o);break;case 31:qr(a,o,f),Gr(o),v&4&&(a=o.updateQueue,a!==null&&(o.updateQueue=null,sg(o,a)));break;case 13:qr(a,o,f),Gr(o),o.child.flags&8192&&o.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(lg=on()),v&4&&(a=o.updateQueue,a!==null&&(o.updateQueue=null,sg(o,a)));break;case 22:S=o.memoizedState!==null,A=p!==null&&p.memoizedState!==null;var V=nr,Y=Ft,ae=zi;nr=V||S,zi=ae||S,Ft=Y||A,qr(a,o,f),Ft=Y,zi=ae,nr=V,Gr(o),v&8192&&(a=o.stateNode,a._visibility=S?a._visibility&-2:a._visibility|1,!S||p===null||A||nr||Ft||(a=A||Ft,f=nr,p=Ft,nr=S||nr,Ft=a,Ml(o,2),nr=f,Ft=p),!S&&zi||hv(o,S)),v&4&&(a=o.updateQueue,a!==null&&(f=a.retryQueue,f!==null&&(a.retryQueue=null,sg(o,f))));break;case 19:qr(a,o,f),Gr(o),v&4&&(a=o.updateQueue,a!==null&&(o.updateQueue=null,sg(o,a)));break;case 30:v&512&&(Ft||p===null||xr(p,p.return)),v=Wn(),S=Gd,A=(f&335544064)===f,V=o.memoizedProps,Gd=A&&bo(V.default,V.update)!=="none",qr(a,o,f),Gr(o),A&&p!==null&&tt&&(o.flags|=4),Gd=S,tt=v;break;case 21:break;case 7:v&512&&(Ft||p===null||xr(p,p.return)),p&&p.stateNode!==null&&(p.stateNode._fragmentFiber=o);default:qr(a,o,f),Gr(o)}}function Gr(o){var a=o.flags;if(a&2){try{for(var f,p=o.return;p!==null;){if(sR(p)){f=p;break}p=p.return}p=null;for(var v=o.return;v!==null;){if(tv(v)){var S=v.stateNode;p===null?p=[S]:p.push(S)}if(ev(v))break;v=v.return}var A=p;if(f==null)throw Error(r(160));switch(f.tag){case 27:var V=f.stateNode,Y=sv(o);Zm(o,Y,V,A);break;case 5:var ae=f.stateNode;f.flags&32&&(Fr(ae,""),f.flags&=-33);var me=sv(o);Zm(o,me,ae,A);break;case 3:case 4:var ve=f.stateNode.containerInfo,ie=sv(o);iv(o,ie,ve,A);break;default:throw Error(r(161))}}catch(fe){Ut(o,o.return,fe)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function vR(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var a=o;vR(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,Xu=!0,a.reset(),Xu=!1),o=o.sibling}}function Du(o,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)SR(a,o),a=a.sibling;else fR(a)}function SR(o,a){var f=o.alternate;if(f===null)ov(o,!1);else switch(o.tag){case 3:if(dv=Bi=!1,lR(),Du(a,o),!Bi&&!ng){if(o=Li,o!==null)for(var p=0;p<o.length;p+=3){f=o[p];var v=o[p+1];aO(f,o[p+2]),f=f.ownerDocument.documentElement,f!==null&&f.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+v+")"})}o=a.containerInfo,o=o.nodeType===9?o.documentElement:o.ownerDocument.documentElement,o!==null&&o.style.viewTransitionName===""&&(o.style.viewTransitionName="none",o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),o.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),dv=!0}Li=null;break;case 5:Du(a,o);break;case 4:p=Bi,Bi=!1,Du(a,o),Bi&&(ng=!0),Bi=p;break;case 22:o.memoizedState===null&&(f.memoizedState!==null?ov(o,!1):Du(a,o));break;case 30:p=Bi,v=lR(),Bi=!1,Du(a,o),Bi&&(o.flags|=4);var S=o.memoizedProps,A=o.stateNode;a=xo(S,A),A=xo(f.memoizedProps,A);var V=bo(S.default,S.update);V==="none"?a=!1:(S=f.memoizedState,f.memoizedState=null,f=o.child,cs=0,a=uv(o,f,a,A,V,S,!0),cs!==(S===null?0:S.length)&&(o.flags|=32)),(o.flags&4)!==0&&a?(Hu(o,o.memoizedProps.onUpdate),Li=v):v!==null&&(v.push.apply(v,Li),Li=v),Bi=(o.flags&32)!==0?!0:p;break;default:Du(a,o)}}function Hi(o,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)hR(o,a.alternate,a),a=a.sibling}function Ml(o,a){for(o=o.child;o!==null;){var f=o,p=a;switch(f.tag){case 0:case 11:case 14:case 15:kl(4,f,f.return),Ml(f,p);break;case 1:xr(f,f.return);var v=f.stateNode;typeof v.componentWillUnmount=="function"&&nR(f,f.return,v),Ml(f,p);break;case 27:(p&2)!==0&&vO(f.stateNode,f.type,f.memoizedProps);case 5:xr(f,f.return),f.tag!==5&&f.tag!==27||qd(f),Ml(f,p);break;case 6:qd(f);break;case 26:xr(f,f.return),v=f.stateNode,f.memoizedState!==null||v===null||Ft||v.parentNode.removeChild(v),Ml(f,p);break;case 22:f.memoizedState===null&&Ml(f,p);break;case 30:xr(f,f.return),Ml(f,p);break;case 7:xr(f,f.return);default:Ml(f,p)}o=o.sibling}}function fi(o,a,f){for(f=(a.subtreeFlags&8772)!==0?f:f&-2,a=a.child;a!==null;){var p=a.alternate,v=o,S=a,A=S.flags,V=(f&1)!==0;switch(S.tag){case 0:case 11:case 15:fi(v,S,f),Ud(4,S);break;case 1:if(fi(v,S,f),p=S,v=p.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(me){Ut(p,p.return,me)}if(p=S,v=p.updateQueue,v!==null){var Y=p.stateNode;try{var ae=v.shared.hiddenCallbacks;if(ae!==null)for(v.shared.hiddenCallbacks=null,v=0;v<ae.length;v++)VN(ae[v],Y)}catch(me){Ut(p,p.return,me)}}V&&A&64&&tR(S),ji(S,S.return);break;case 27:(f&2)!==0&&iR(S);case 5:S.tag!==5&&S.tag!==27||rR(S),fi(v,S,f),V&&p===null&&A&4&&nv(S),ji(S,S.return);break;case 6:rR(S);break;case 26:Y=S.stateNode,S.memoizedState!==null||Y===null||nr||Zv(th(Y.ownerDocument),S.type,Y),fi(v,S,f),V&&p===null&&A&4&&nv(S),ji(S,S.return);break;case 12:fi(v,S,f);break;case 31:fi(v,S,f),V&&A&4&&yR(v,S);break;case 13:fi(v,S,f),V&&A&4&&xR(v,S);break;case 22:S.memoizedState===null&&fi(v,S,f),ji(S,S.return);break;case 30:fi(v,S,f),ji(S,S.return);break;case 7:ji(S,S.return);default:fi(v,S,f)}a=a.sibling}}function mv(o,a){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&Ad(f))}function gv(o,a){o=null,a.alternate!==null&&(o=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==o&&(a.refCount++,o!=null&&Ad(o))}function Ws(o,a,f,p){var v=(f&335544064)===f;if(a.subtreeFlags&(v?10262:10256))for(a=a.child;a!==null;)wR(o,a,f,p),a=a.sibling;else v&&uR(a)}function wR(o,a,f,p){var v=(f&335544064)===f;v&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&tg(a);var S=a.flags;switch(a.tag){case 0:case 11:case 15:Ws(o,a,f,p),S&2048&&Ud(9,a);break;case 1:Ws(o,a,f,p);break;case 3:Ws(o,a,f,p),v&&dv&&(o=o.containerInfo,o=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,o.style.viewTransitionName==="root"&&(o.style.viewTransitionName=""),o=o.ownerDocument.documentElement,o!==null&&o.style.viewTransitionName==="none"&&(o.style.viewTransitionName="")),S&2048&&(S=null,a.alternate!==null&&(S=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==S&&(a.refCount++,S!=null&&Ad(S)));break;case 12:if(S&2048){Ws(o,a,f,p),S=a.stateNode;try{var A=a.memoizedProps,V=A.id,Y=A.onPostCommit;typeof Y=="function"&&Y(V,a.alternate===null?"mount":"update",S.passiveEffectDuration,-0)}catch(ae){Ut(a,a.return,ae)}}else Ws(o,a,f,p);break;case 31:Ws(o,a,f,p);break;case 13:Ws(o,a,f,p);break;case 23:break;case 22:A=a.stateNode,V=a.alternate,a.memoizedState!==null?(v&&V!==null&&V.memoizedState===null&&tg(V),A._visibility&2?Ws(o,a,f,p):Kd(o,a)):(v&&V!==null&&V.memoizedState!==null&&tg(a),A._visibility&2?Ws(o,a,f,p):(A._visibility|=2,Iu(o,a,f,p,(a.subtreeFlags&10256)!==0||!1))),S&2048&&mv(V,a);break;case 24:Ws(o,a,f,p),S&2048&&gv(a.alternate,a);break;case 30:v&&(S=a.alternate,S!==null&&(Pi(S.child,!0),Pi(a.child,!0))),Ws(o,a,f,p);break;default:Ws(o,a,f,p)}}function Iu(o,a,f,p,v){for(v=v&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var S=o,A=a,V=f,Y=p,ae=A.flags;switch(A.tag){case 0:case 11:case 15:Iu(S,A,V,Y,v),Ud(8,A);break;case 23:break;case 22:var me=A.stateNode;A.memoizedState!==null?me._visibility&2?Iu(S,A,V,Y,v):Kd(S,A):(me._visibility|=2,Iu(S,A,V,Y,v)),v&&ae&2048&&mv(A.alternate,A);break;case 24:Iu(S,A,V,Y,v),v&&ae&2048&&gv(A.alternate,A);break;default:Iu(S,A,V,Y,v)}a=a.sibling}}function Kd(o,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var f=o,p=a,v=p.flags;switch(p.tag){case 22:Kd(f,p),v&2048&&mv(p.alternate,p);break;case 24:Kd(f,p),v&2048&&gv(p.alternate,p);break;default:Kd(f,p)}a=a.sibling}}var rc=8192;function sc(o,a,f){if(o.subtreeFlags&rc)for(o=o.child;o!==null;)ER(o,a,f),o=o.sibling}function ER(o,a,f){switch(o.tag){case 26:sc(o,a,f),o.flags&rc&&(o.memoizedState!==null?$8(f,ui,o.memoizedState,o.memoizedProps):(o=o.stateNode,(a&335544128)===a&&MO(f,o)));break;case 5:sc(o,a,f),o.flags&rc&&(o=o.stateNode,(a&335544128)===a&&MO(f,o));break;case 3:case 4:var p=ui;ui=th(o.stateNode.containerInfo),sc(o,a,f),ui=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=rc,rc=16777216,sc(o,a,f),rc=p):sc(o,a,f));break;case 30:if((o.flags&rc)!==0&&(p=o.memoizedProps.name,p!=null&&p!=="auto")){var v=o.stateNode;v.paired=null,ks===null&&(ks=new Map),ks.set(p,v)}sc(o,a,f);break;default:sc(o,a,f)}}function CR(o){var a=o.alternate;if(a!==null&&(o=a.child,o!==null)){a.child=null;do a=o.sibling,o.sibling=null,o=a;while(o!==null)}}function Yd(o){var a=o.deletions;if((o.flags&16)!==0){if(a!==null)for(var f=0;f<a.length;f++){var p=a[f];rr=p,TR(p,o)}CR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)NR(o),o=o.sibling}function NR(o){switch(o.tag){case 0:case 11:case 15:Yd(o),o.flags&2048&&kl(9,o,o.return);break;case 3:Yd(o);break;case 12:Yd(o);break;case 22:var a=o.stateNode;o.memoizedState!==null&&a._visibility&2&&(o.return===null||o.return.tag!==13)?(a._visibility&=-3,ig(o)):Yd(o);break;default:Yd(o)}}function ig(o){var a=o.deletions;if((o.flags&16)!==0){if(a!==null)for(var f=0;f<a.length;f++){var p=a[f];rr=p,TR(p,o)}CR(o)}for(o=o.child;o!==null;){switch(a=o,a.tag){case 0:case 11:case 15:kl(8,a,a.return),ig(a);break;case 22:f=a.stateNode,f._visibility&2&&(f._visibility&=-3,ig(a));break;default:ig(a)}o=o.sibling}}function TR(o,a){for(;rr!==null;){var f=rr;switch(f.tag){case 0:case 11:case 15:kl(8,f,a);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Ad(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,rr=p;else e:for(f=o;rr!==null;){p=rr;var v=p.sibling,S=p.return;if(mR(p),p===f){rr=null;break e}if(v!==null){v.return=S,rr=v;break e}rr=S}}}var PF={getCacheForType:function(o){var a=mr(jn),f=a.data.get(o);return f===void 0&&(f=o(),a.data.set(o,f)),f},cacheSignal:function(){return mr(jn).controller.signal}},zF=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Qt=null,vt=null,Et=0,Vt=0,Ms=null,Al=!1,ju=!1,yv=!1,Oo=0,Cn=0,_l=0,ic=0,og=0,As=0,Lu=0,Wd=null,fs=null,xv=!1,lg=0,RR=0,ag=1/0,cg=null,Dl=null,gn=0,di=null,oc=null,Fi=0,bv=0,vv=null,OR=null,Pu=null,zu=null,Bu=null,Xd=0,ug=null;function _s(){return(Lt&2)!==0&&Et!==0?Et&-Et:ge.T!==null?Mv():is()}function kR(){if(As===0)if((Et&536870912)===0||yt){var o=ur;ur<<=1,(ur&3932160)===0&&(ur=262144),As=o}else As=536870912;return o=gr.current,o!==null&&(o.flags|=32),As}function Hu(o,a){if(a!=null){var f=o.stateNode,p=f.ref;p===null&&(p=f.ref=cO(xo(o.memoizedProps,f))),zu===null&&(zu=[]),zu.push(a.bind(null,p))}}function ds(o,a,f){(o===Qt&&(Vt===2||Vt===9)||o.cancelPendingCommit!==null)&&(Fu(o,0),Il(o,Et,As,!1)),vs(o,f),((Lt&2)===0||o!==Qt)&&(o===Qt&&((Lt&2)===0&&(ic|=f),Cn===4&&Il(o,Et,As,!1)),$i(o))}function MR(o,a,f){if((Lt&6)!==0)throw Error(r(327));var p=!f&&(a&127)===0&&(a&o.expiredLanes)===0||Or(o,a),v=p?FF(o,a):wv(o,a,!0),S=p;do{if(v===0){ju&&!p&&Il(o,a,0,!1);break}else{if(f=o.current.alternate,S&&!BF(f)){v=wv(o,a,!1),S=!1;continue}if(v===2){if(S=a,o.errorRecoveryDisabledLanes&S)var A=0;else A=o.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){a=A;e:{var V=o;v=Wd;var Y=V.current.memoizedState.isDehydrated;if(Y&&(Fu(V,A).flags|=256),A=wv(V,A,!1),A!==2&&A!==6){if(yv&&!Y){V.errorRecoveryDisabledLanes|=S,ic|=S,v=4;break e}S=fs,fs=v,S!==null&&(fs===null?fs=S:fs.push.apply(fs,S))}v=A}if(S=!1,v!==2)continue}}if(v===1){Fu(o,0),Il(o,a,0,!0);break}e:{switch(p=o,S=v,S){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:Il(p,a,As,!Al);break e;case 2:fs=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(v=lg+300-on(),10<v)){if(Il(p,a,As,!Al),Rr(p,0,!0)!==0)break e;Fi=a,p.timeoutHandle=Fv(AR.bind(null,p,f,fs,cg,xv,a,As,ic,Lu,Al,S,"Throttled",-0,0),v);break e}AR(p,f,fs,cg,xv,a,As,ic,Lu,Al,S,null,-0,0)}}break}while(!0);$i(o)}function AR(o,a,f,p,v,S,A,V,Y,ae,me,ve,ie,fe){o.timeoutHandle=-1;var je=a.subtreeFlags,$e=(S&335544064)===S;if(ve=null,($e||je&8192||(je&16785408)===16785408)&&(ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$r},ks=null,ER(a,S,ve),$e&&(je=ve,$e=o.containerInfo,$e=($e.nodeType===9?$e:$e.ownerDocument).__reactViewTransition,$e!=null&&(je.count++,je.waitingForViewTransition=!0,je=sh.bind(je),$e.finished.then(je,je))),je=(S&62914560)===S?lg-on():(S&4194048)===S?RR-on():0,je=V8(ve,je),je!==null)){Fi=S,o.cancelPendingCommit=je(BR.bind(null,o,a,S,f,p,v,A,V,Y,ae,me,ve,null,ie,fe)),Il(o,S,A,!ae);return}BR(o,a,S,f,p,v,A,V,Y,ae,me,ve)}function BF(o){for(var a=o;;){var f=a.tag;if((f===0||f===11||f===15)&&a.flags&16384&&(f=a.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var v=f[p],S=v.getSnapshot;v=v.value;try{if(!Rs(S(),v))return!1}catch{return!1}}if(f=a.child,a.subtreeFlags&16384&&f!==null)f.return=a,a=f;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Il(o,a,f,p){a=rs(o,a),a&=~og,a&=~ic,o.suspendedLanes|=a,o.pingedLanes&=~a,p&&(o.warmLanes|=a),p=o.expirationTimes;for(var v=a;0<v;){var S=31-Xt(v),A=1<<S;p[S]=-1,v&=~A}f!==0&&Ss(o,f,a)}function fg(){return(Lt&6)===0?(Qd(0),!1):!0}function Sv(){if(vt!==null){if(Vt===0)var o=vt.return;else o=vt,wo=Ka=null,kb(o),Ru=null,Id=0,o=vt;for(;o!==null;)eR(o.alternate,o),o=o.return;vt=null}}function Fu(o,a){var f=o.timeoutHandle;return f!==-1&&(o.timeoutHandle=-1,c8(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Fi=0,Sv(),Qt=o,vt=f=vo(o.current,null),Et=a,Vt=0,Ms=null,Al=!1,ju=Or(o,a),yv=!1,Lu=As=og=ic=_l=Cn=0,fs=Wd=null,xv=!1,Oo=rs(o,a),bm(),f}function _R(o,a){dt=null,ge.H=Um,a===Tu||a===Mm?(a=BN(),Vt=3):a===gb?(a=BN(),Vt=4):Vt=a===Ub?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ms=a,vt===null&&(Cn=1,qm(o,qs(a,o.current)))}function DR(){var o=gr.current;return o===null?!0:(Et&4194048)===Et?Mr===null:(Et&62914560)===Et||(Et&536870912)!==0?o===Mr:!1}function IR(){var o=ge.H;return ge.H=Um,o===null?Um:o}function jR(){var o=ge.A;return ge.A=PF,o}function dg(){Cn=4,Al||(Et&4194048)!==Et&&gr.current!==null||(ju=!0),(_l&134217727)===0&&(ic&134217727)===0||Qt===null||Il(Qt,Et,As,!1)}function wv(o,a,f){var p=Lt;Lt|=2;var v=IR(),S=jR();(Qt!==o||Et!==a)&&(cg=null,Fu(o,a)),a=!1;var A=Cn;e:do try{if(Vt!==0&&vt!==null){var V=vt,Y=Ms;switch(Vt){case 8:Sv(),A=6;break e;case 3:case 2:case 9:case 6:gr.current===null&&(a=!0);var ae=Vt;if(Vt=0,Ms=null,$u(o,V,Y,ae),f&&ju){A=0;break e}break;default:ae=Vt,Vt=0,Ms=null,$u(o,V,Y,ae)}}HF(),A=Cn;break}catch(me){_R(o,me)}while(!0);return a&&o.shellSuspendCounter++,wo=Ka=null,Lt=p,ge.H=v,ge.A=S,vt===null&&(Qt=null,Et=0,bm()),A}function HF(){for(;vt!==null;)LR(vt)}function FF(o,a){var f=Lt;Lt|=2;var p=IR(),v=jR();Qt!==o||Et!==a?(cg=null,ag=on()+500,Fu(o,a)):ju=Or(o,a);e:do try{if(Vt!==0&&vt!==null){a=vt;var S=Ms;t:switch(Vt){case 1:Vt=0,Ms=null,$u(o,a,S,1);break;case 2:case 9:if(PN(S)){Vt=0,Ms=null,PR(a);break}a=function(){Vt!==2&&Vt!==9||Qt!==o||(Vt=7),$i(o)},S.then(a,a);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:PN(S)?(Vt=0,Ms=null,PR(a)):(Vt=0,Ms=null,$u(o,a,S,7));break;case 5:var A=null;switch(vt.tag){case 26:A=vt.memoizedState;case 5:case 27:var V=vt;if(A?OO(A):V.stateNode.complete){Vt=0,Ms=null;var Y=V.sibling;if(Y!==null)vt=Y;else{var ae=V.return;ae!==null?(vt=ae,hg(ae)):vt=null}break t}}Vt=0,Ms=null,$u(o,a,S,5);break;case 6:Vt=0,Ms=null,$u(o,a,S,6);break;case 8:Sv(),Cn=6;break e;default:throw Error(r(462))}}$F();break}catch(me){_R(o,me)}while(!0);return wo=Ka=null,ge.H=p,ge.A=v,Lt=f,vt!==null?0:(Qt=null,Et=0,bm(),Cn)}function $F(){for(;vt!==null&&!Un();)LR(vt)}function LR(o){var a=ZT(o.alternate,o,Oo);o.memoizedProps=o.pendingProps,a===null?hg(o):vt=a}function PR(o){var a=o,f=a.alternate;switch(a.tag){case 15:case 0:a=qT(f,a,a.pendingProps,a.type,void 0,Et);break;case 11:a=qT(f,a,a.pendingProps,a.type.render,a.ref,Et);break;case 5:kb(a);var p=a;p===tr&&(yt?(Nm(p),p.tag===5&&p.stateNode!=null&&(en=p.stateNode)):(Nm(p),yt=!0));default:eR(f,a),a=vt=TN(a,Oo),a=ZT(f,a,Oo)}o.memoizedProps=o.pendingProps,a===null?hg(o):vt=a}function $u(o,a,f,p){wo=Ka=null,kb(a),Ru=null,Id=0;var v=a.return;try{if(kF(o,v,a,f,Et)){Cn=1,qm(o,qs(f,o.current)),vt=null;return}}catch(S){if(v!==null)throw vt=v,S;Cn=1,qm(o,qs(f,o.current)),vt=null;return}a.flags&32768?(yt||p===1?o=!0:ju||(Et&536870912)!==0?o=!1:(Al=o=!0,(p===2||p===9||p===3||p===6)&&(p=gr.current,p!==null&&p.tag===13&&(p.flags|=16384))),zR(a,o)):hg(a)}function hg(o){var a=o;do{if((a.flags&32768)!==0){zR(a,Al);return}o=a.return;var f=DF(a.alternate,a,Oo);if(f!==null){vt=f;return}if(a=a.sibling,a!==null){vt=a;return}vt=a=o}while(a!==null);Cn===0&&(Cn=5)}function zR(o,a){do{var f=IF(o.alternate,o);if(f!==null){f.flags&=32767,vt=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!a&&(o=o.sibling,o!==null)){vt=o;return}vt=o=f}while(o!==null);Cn=6,vt=null}function BR(o,a,f,p,v,S,A,V,Y,ae,me,ve){o.cancelPendingCommit=null;do pg();while(gn!==0);if((Lt&6)!==0)throw Error(r(327));if(a!==null){if(a===o.current)throw Error(r(177));o===Qt&&(vt=Qt=null,Et=0),oc=a,di=o,Fi=f,vv=v,OR=p,VF(o,a,f,A,V,Y,ve)}}function VF(o,a,f,p,v,S,A){var V=a.lanes|a.childLanes;if(bv=V,V|=rb,cl(o,f,V,p,v,S),zu=null,(f&335544064)===f?(Bu=yF(o),p=10262):(Bu=null,p=10256),(a.subtreeFlags&p)!==0||(a.flags&p)!==0?(o.callbackNode=null,o.callbackPriority=0,WF(qn,function(){return Tv(),null})):(o.callbackNode=null,o.callbackPriority=0),Jm=!1,p=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||p){p=ge.T,ge.T=null,v=oe.p,oe.p=2,S=Lt,Lt|=4;try{jF(o,a,f)}finally{Lt=S,oe.p=v,ge.T=p}}gn=1,Jm?Pu=m8(A,o.containerInfo,Bu,Ev,Cv,qF,Nv,Tv,UF):(Ev(),Cv(),Nv())}function UF(o){if(gn!==0){var a=di.onRecoverableError;a(o,{componentStack:null})}}function qF(){gn===3&&(gn=0,SR(oc,di),gn=4)}function Ev(){if(gn===1){gn=0;var o=di,a=oc,f=Fi,p=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||p){p=ge.T,ge.T=null;var v=oe.p;oe.p=2;var S=Lt;Lt|=4;try{Gd=ng=!1,bR(a,o,f),f=zv;var A=gN(o.containerInfo),V=f.focusedElem,Y=f.selectionRange;if(A!==V&&V&&V.ownerDocument&&mN(V.ownerDocument.documentElement,V)){if(Y!==null&&Zx(V)){var ae=Y.start,me=Y.end;if(me===void 0&&(me=ae),"selectionStart"in V)V.selectionStart=ae,V.selectionEnd=Math.min(me,V.value.length);else{var ve=V.ownerDocument||document,ie=ve&&ve.defaultView||window;if(ie.getSelection){var fe=ie.getSelection(),je=V.textContent.length,$e=Math.min(Y.start,je),ht=Y.end===void 0?$e:Math.min(Y.end,je);!fe.extend&&$e>ht&&(A=ht,ht=$e,$e=A);var le=pN(V,$e),ee=pN(V,ht);if(le&&ee&&(fe.rangeCount!==1||fe.anchorNode!==le.node||fe.anchorOffset!==le.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var ue=ve.createRange();ue.setStart(le.node,le.offset),fe.removeAllRanges(),$e>ht?(fe.addRange(ue),fe.extend(ee.node,ee.offset)):(ue.setEnd(ee.node,ee.offset),fe.addRange(ue))}}}}for(ve=[],fe=V;fe=fe.parentNode;)fe.nodeType===1&&ve.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<ve.length;V++){var be=ve[V];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Xu=!!Pv,zv=Pv=null}finally{Lt=S,oe.p=v,ge.T=p}}o.current=a,gn=2}}function Cv(){if(gn===2){gn=0;var o=di,a=oc,f=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||f){f=ge.T,ge.T=null;var p=oe.p;oe.p=2;var v=Lt;Lt|=4;try{hR(o,a.alternate,a)}finally{Lt=v,oe.p=p,ge.T=f}}gn=3}}function Nv(){if(gn===4||gn===3){gn=0;var o=Pu;Pu=null,xs();var a=di,f=oc,p=Fi,v=OR,S=(p&335544064)===p?10262:10256;if((f.subtreeFlags&S)!==0||(f.flags&S)!==0?gn=5:(gn=0,oc=di=null,HR(a,a.pendingLanes)),S=a.pendingLanes,S===0&&(Dl=null),ss(p),f=f.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(On,f,void 0,(f.current.flags&128)===128)}catch{}if(v!==null){f=ge.T,S=oe.p,oe.p=2,ge.T=null;try{for(var A=a.onRecoverableError,V=0;V<v.length;V++){var Y=v[V];A(Y.value,{componentStack:Y.stack})}}finally{ge.T=f,oe.p=S}}if(v=zu,A=Bu,Bu=null,v!==null&&(zu=null,A===null&&(A=[]),o!==null))for(Y=0;Y<v.length;Y++)f=(0,v[Y])(A),f!==void 0&&o.finished.finally(f);(Fi&3)!==0&&pg(),$i(a),S=a.pendingLanes,(p&261930)!==0&&(S&42)!==0?a===ug?Xd++:(Xd=0,ug=a):(Xd=0,ug=null),Qd(0)}}function HR(o,a){(o.pooledCacheLanes&=a)===0&&(a=o.pooledCache,a!=null&&(o.pooledCache=null,Ad(a)))}function pg(){return Pu!==null&&(Pu.skipTransition(),Pu=null),Ev(),Cv(),Nv(),Tv()}function Tv(){if(gn!==5)return!1;var o=di,a=bv;bv=0;var f=ss(Fi),p=ge.T,v=oe.p;try{oe.p=32>f?32:f,ge.T=null,f=vv,vv=null;var S=di,A=Fi;if(gn=0,oc=di=null,Fi=0,(Lt&6)!==0)throw Error(r(331));var V=Lt;if(Lt|=4,NR(S.current),wR(S,S.current,A,f),Lt=V,Qd(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(On,S)}catch{}return!0}finally{oe.p=v,ge.T=p,HR(o,a)}}function FR(o,a,f){a=qs(f,a),a=Vb(o.stateNode,a,2),o=Nl(o,a,2),o!==null&&(vs(o,2),$i(o))}function Ut(o,a,f){if(o.tag===3)FR(o,o,f);else for(;a!==null;){if(a.tag===3){FR(a,o,f);break}else if(a.tag===1){var p=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Dl===null||!Dl.has(p))){o=qs(f,o),f=PT(2),p=Nl(a,f,2),p!==null&&(zT(f,p,a,o),vs(p,2),$i(p));break}}a=a.return}}function Rv(o,a,f){var p=o.pingCache;if(p===null){p=o.pingCache=new zF;var v=new Set;p.set(a,v)}else v=p.get(a),v===void 0&&(v=new Set,p.set(a,v));v.has(f)||(yv=!0,v.add(f),o=GF.bind(null,o,a,f),a.then(o,o))}function GF(o,a,f){var p=o.pingCache;p!==null&&p.delete(a),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,Qt===o&&(Et&f)===f&&((Cn===4||Cn===3&&(Et&62914560)===Et&&300>on()-lg)&&(Lt&2)===0?Fu(o,0):og|=f,Lu===Et&&(Lu=0)),$i(o)}function $R(o,a){a===0&&(a=dr()),o=Ua(o,a),o!==null&&(vs(o,a),$i(o))}function KF(o){var a=o.memoizedState,f=0;a!==null&&(f=a.retryLane),$R(o,f)}function YF(o,a){var f=0;switch(o.tag){case 31:case 13:var p=o.stateNode,v=o.memoizedState;v!==null&&(f=v.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(a),$R(o,f)}function WF(o,a){return zt(o,a)}var Vu=null,Uu=null,Ov=!1,mg=!1,kv=!1,jl=0;function $i(o){o!==Uu&&o.next===null&&(Uu===null?Vu=Uu=o:Uu=Uu.next=o),mg=!0,Ov||(Ov=!0,QF())}function Qd(o,a){if(!kv&&mg){kv=!0;do for(var f=!1,p=Vu;p!==null;){if(o!==0){var v=p.pendingLanes;if(v===0)var S=0;else{var A=p.suspendedLanes,V=p.pingedLanes;S=(1<<31-Xt(42|o)+1)-1,S&=v&~(A&~V),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,GR(p,S))}else S=Et,S=Rr(p,p===Qt?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||Or(p,S)||(f=!0,GR(p,S));p=p.next}while(f);kv=!1}}function XF(){VR()}function VR(){mg=Ov=!1;var o=0;jl!==0&&a8()&&(o=jl);for(var a=on(),f=null,p=Vu;p!==null;){var v=p.next,S=UR(p,a);S===0?(p.next=null,f===null?Vu=v:f.next=v,v===null&&(Uu=f)):(f=p,(o!==0||(S&3)!==0)&&(mg=!0)),p=v}gn!==0&&gn!==5||Qd(o),jl!==0&&(jl=0)}function UR(o,a){for(var f=o.suspendedLanes,p=o.pingedLanes,v=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var A=31-Xt(S),V=1<<A,Y=v[A];Y===-1?((V&f)===0||(V&p)!==0)&&(v[A]=oi(V,a)):Y<=a&&(o.expiredLanes|=V),S&=~V}if(a=Qt,f=Et,f=Rr(o,o===a?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,f===0||o===a&&(Vt===2||Vt===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&Vn(p),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||Or(o,f)){if(a=f&-f,a===o.callbackPriority)return a;switch(p!==null&&Vn(p),ss(f)){case 2:case 8:f=bs;break;case 32:f=qn;break;case 268435456:f=ln;break;default:f=qn}return p=qR.bind(null,o),f=zt(f,p),o.callbackPriority=a,o.callbackNode=f,a}return p!==null&&p!==null&&Vn(p),o.callbackPriority=2,o.callbackNode=null,2}function qR(o,a){if(gn!==0&&gn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(pg()&&o.callbackNode!==f)return null;var p=Et;return p=Rr(o,o===Qt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(MR(o,p,a),UR(o,on()),o.callbackNode!=null&&o.callbackNode===f?qR.bind(null,o):null)}function GR(o,a){if(pg())return null;MR(o,a,!0)}function QF(){u8(function(){(Lt&6)!==0?zt(zr,XF):VR()})}function Mv(){if(jl===0){var o=Xa;o===0&&(o=cr,cr<<=1,(cr&261888)===0&&(cr=256)),jl=o}return jl}function KR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:hr(o)}function ZF(o,a,f,p,v){if(a==="submit"&&f&&f.stateNode===v){var S=KR((v[Yn]||null).action),A=p.submitter;A&&(a=(a=A[Yn]||null)?KR(a.formAction):A.getAttribute("formAction"),a!==null&&(S=a,A=null));var V=new mm("action","action",null,p,v);o.push({event:V,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(jl!==0){var Y=new FormData(v,A);zb(f,{pending:!0,data:Y,method:v.method,action:S},null,Y)}}else typeof S=="function"&&(V.preventDefault(),Y=new FormData(v,A),zb(f,{pending:!0,data:Y,method:v.method,action:S},S,Y))},currentTarget:v}]})}}for(var Av=0;Av<nb.length;Av++){var _v=nb[Av],JF=_v.toLowerCase(),e8=_v[0].toUpperCase()+_v.slice(1);ai(JF,"on"+e8)}ai(bN,"onAnimationEnd"),ai(vN,"onAnimationIteration"),ai(SN,"onAnimationStart"),ai("dblclick","onDoubleClick"),ai("focusin","onFocus"),ai("focusout","onBlur"),ai(cF,"onTransitionRun"),ai(uF,"onTransitionStart"),ai(fF,"onTransitionCancel"),ai(wN,"onTransitionEnd"),Ht("onMouseEnter",["mouseout","mouseover"]),Ht("onMouseLeave",["mouseout","mouseover"]),Ht("onPointerEnter",["pointerout","pointerover"]),Ht("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zd="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(" "),t8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zd));function YR(o,a){a=(a&4)!==0;for(var f=0;f<o.length;f++){var p=o[f],v=p.event;p=p.listeners;e:{var S=void 0;if(a)for(var A=p.length-1;0<=A;A--){var V=p[A],Y=V.instance,ae=V.currentTarget;if(V=V.listener,Y!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=ae;try{S(v)}catch(me){xm(me)}v.currentTarget=null,S=Y}else for(A=0;A<p.length;A++){if(V=p[A],Y=V.instance,ae=V.currentTarget,V=V.listener,Y!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=ae;try{S(v)}catch(me){xm(me)}v.currentTarget=null,S=Y}}}}function St(o,a){var f=a[La];f===void 0&&(f=a[La]=new Set);var p=o+"__bubble";f.has(p)||(WR(a,o,2,!1),f.add(p))}function Dv(o,a,f){var p=0;a&&(p|=4),WR(f,o,p,a)}var gg="_reactListening"+Math.random().toString(36).slice(2);function Iv(o){if(!o[gg]){o[gg]=!0,ot.forEach(function(f){f!=="selectionchange"&&(t8.has(f)||Dv(f,!1,o),Dv(f,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[gg]||(a[gg]=!0,Dv("selectionchange",!1,a))}}function WR(o,a,f,p){switch(zO(a)){case 2:var v=K8;break;case 8:v=Y8;break;default:v=eS}f=v.bind(null,a,f,o),v=void 0,!Fa||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),p?v!==void 0?o.addEventListener(a,f,{capture:!0,passive:v}):o.addEventListener(a,f,!0):v!==void 0?o.addEventListener(a,f,{passive:v}):o.addEventListener(a,f,!1)}function jv(o,a,f,p,v){var S=p;if((a&1)===0&&(a&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var V=p.stateNode.containerInfo;if(V===v)break;if(A===4)for(A=p.return;A!==null;){var Y=A.tag;if((Y===3||Y===4)&&A.stateNode.containerInfo===v)return;A=A.return}for(;V!==null;){if(A=ws(V),A===null)return;if(Y=A.tag,Y===5||Y===6||Y===26||Y===27){p=S=A;continue e}V=V.parentNode}}p=p.return}Ha(function(){var ae=S,me=Ba(f),ve=[];e:{var ie=EN.get(o);if(ie!==void 0){var fe=mm,je=o;switch(o){case"keypress":if(hm(f)===0)break e;case"keydown":case"keyup":fe=BH;break;case"focusin":je="focus",fe=Gx;break;case"focusout":je="blur",fe=Gx;break;case"beforeblur":case"afterblur":fe=Gx;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=Z2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=RH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=UH;break;case bN:case vN:case SN:fe=MH;break;case wN:fe=GH;break;case"scroll":case"scrollend":fe=NH;break;case"wheel":fe=YH;break;case"copy":case"cut":case"paste":fe=_H;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=eN;break;case"submit":fe=$H;break;case"toggle":case"beforetoggle":fe=XH}var $e=(a&4)!==0,ht=!$e&&(o==="scroll"||o==="scrollend"),le=$e?ie!==null?ie+"Capture":null:ie;$e=[];for(var ee=ae,ue;ee!==null;){var be=ee;if(ue=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ue===null||le===null||(be=yo(ee,le),be!=null&&$e.push(Jd(ee,be,ue))),ht)break;ee=ee.return}0<$e.length&&(ie=new fe(ie,je,null,f,me),ve.push({event:ie,listeners:$e}))}}if((a&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",ie=o==="mouseout"||o==="pointerout",fe&&f!==za&&(je=f.relatedTarget||f.fromElement)&&(ws(je)||je[Hr]))break e;(ie||fe)&&(je=me.window===me?me:(fe=me.ownerDocument)?fe.defaultView||fe.parentWindow:window,ie?(fe=f.relatedTarget||f.toElement,ie=ae,fe=fe?ws(fe):null,fe!==null&&(ht=i(fe),$e=fe.tag,fe!==ht||$e!==5&&$e!==27&&$e!==6)&&(fe=null)):(ie=null,fe=ae),ie!==fe&&($e=Z2,be="onMouseLeave",le="onMouseEnter",ee="mouse",(o==="pointerout"||o==="pointerover")&&($e=eN,be="onPointerLeave",le="onPointerEnter",ee="pointer"),ht=ie==null?je:pe(ie),ue=fe==null?je:pe(fe),je=new $e(be,ee+"leave",ie,f,me),je.target=ht,je.relatedTarget=ue,be=null,ws(me)===ae&&($e=new $e(le,ee+"enter",fe,f,me),$e.target=ue,$e.relatedTarget=ht,be=$e),ht=be,$e=ie&&fe?D(ie,fe,n8):null,ie!==null&&XR(ve,je,ie,$e,!1),fe!==null&&ht!==null&&XR(ve,ht,fe,$e,!0)))}e:{if(ie=ae?pe(ae):window,fe=ie.nodeName&&ie.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ie.type==="file")var Be=aN;else if(oN(ie))if(cN)Be=oF;else{Be=sF;var Ct=rF}else fe=ie.nodeName,!fe||fe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ae&&Pa(ae.elementType)&&(Be=aN):Be=iF;if(Be&&(Be=Be(o,ae))){lN(ve,Be,f,me);break e}Ct&&Ct(o,ie,ae)}switch(Ct=ae?pe(ae):window,o){case"focusin":(oN(Ct)||Ct.contentEditable==="true")&&(xu=Ct,Jx=ae,Od=null);break;case"focusout":Od=Jx=xu=null;break;case"mousedown":eb=!0;break;case"contextmenu":case"mouseup":case"dragend":eb=!1,yN(ve,f,me);break;case"selectionchange":if(aF)break;case"keydown":case"keyup":yN(ve,f,me)}var Ye;if(Yx)e:{switch(o){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else yu?sN(o,f)&&(st="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(st="onCompositionStart");st&&(tN&&f.locale!=="ko"&&(yu||st!=="onCompositionStart"?st==="onCompositionEnd"&&yu&&(Ye=X2()):(gl=me,Vx="value"in gl?gl.value:gl.textContent,yu=!0)),Ct=yg(ae,st),0<Ct.length&&(st=new J2(st,o,null,f,me),ve.push({event:st,listeners:Ct}),Ye?st.data=Ye:(Ye=iN(f),Ye!==null&&(st.data=Ye)))),(Ye=ZH?JH(o,f):eF(o,f))&&(st=yg(ae,"onBeforeInput"),0<st.length&&(Ct=new J2("onBeforeInput","beforeinput",null,f,me),ve.push({event:Ct,listeners:st}),Ct.data=Ye)),ZF(ve,o,ae,f,me)}YR(ve,a)})}function Jd(o,a,f){return{instance:o,listener:a,currentTarget:f}}function yg(o,a){for(var f=a+"Capture",p=[];o!==null;){var v=o,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=yo(o,f),v!=null&&p.unshift(Jd(o,v,S)),v=yo(o,a),v!=null&&p.push(Jd(o,v,S))),o.tag===3)return p;o=o.return}return[]}function n8(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function XR(o,a,f,p,v){for(var S=a._reactName,A=[];f!==null&&f!==p;){var V=f,Y=V.alternate,ae=V.stateNode;if(V=V.tag,Y!==null&&Y===p)break;V!==5&&V!==26&&V!==27||ae===null||(Y=ae,v?(ae=yo(f,S),ae!=null&&A.unshift(Jd(f,ae,Y))):v||(ae=yo(f,S),ae!=null&&A.push(Jd(f,ae,Y)))),f=f.return}A.length!==0&&o.push({event:a,listeners:A})}var r8=/\r\n?/g,s8=/\u0000|\uFFFD/g;function QR(o){return(typeof o=="string"?o:""+o).replace(r8,`
50
- `).replace(s8,"")}function ZR(o,a){return a=QR(a),QR(o)===a}function qt(o,a,f,p,v,S){switch(f){case"children":if(typeof p=="string")a==="body"||a==="textarea"&&p===""||Fr(o,p);else if(typeof p=="number"||typeof p=="bigint")a!=="body"&&Fr(o,""+p);else return;break;case"className":Es(o,"class",p);break;case"tabIndex":Es(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Es(o,f,p);break;case"style":Ns(o,p,S);return;case"data":if(a!=="object"){Es(o,"data",p);break}case"src":case"href":if(p===""&&(a!=="a"||f!=="href")){o.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=hr(p),o.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(f,"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 S=="function"&&(f==="formAction"?(a!=="input"&&qt(o,a,"name",v.name,v,null),qt(o,a,"formEncType",v.formEncType,v,null),qt(o,a,"formMethod",v.formMethod,v,null),qt(o,a,"formTarget",v.formTarget,v,null)):(qt(o,a,"encType",v.encType,v,null),qt(o,a,"method",v.method,v,null),qt(o,a,"target",v.target,v,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=hr(p),o.setAttribute(f,p);break;case"onClick":p!=null&&(o.onclick=$r);return;case"onScroll":p!=null&&St("scroll",o);return;case"onScrollEnd":p!=null&&St("scrollend",o);return;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(v.children!=null)throw Error(r(60));(S!=null?S.__html:void 0)!==f&&(o.innerHTML=f)}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}f=hr(p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,p):o.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":p===!0?o.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,p):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(f,p):o.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(f):o.setAttribute(f,p);break;case"popover":St("beforetoggle",o),St("toggle",o),mn(o,"popover",p);break;case"xlinkActuate":Dn(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Dn(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Dn(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Dn(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Dn(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Dn(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Dn(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Dn(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Dn(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":mn(o,"is",p);break;case"innerText":case"textContent":return;default:if(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")f=bd.get(f)||f,mn(o,f,p);else return}tt=!0}function Lv(o,a,f,p,v,S){switch(f){case"style":Ns(o,p,S);return;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(v.children!=null)throw Error(r(60));(S!=null?S.__html:void 0)!==f&&(o.innerHTML=f)}}break;case"children":if(typeof p=="string")Fr(o,p);else if(typeof p=="number"||typeof p=="bigint")Fr(o,""+p);else return;break;case"onScroll":p!=null&&St("scroll",o);return;case"onScrollEnd":p!=null&&St("scrollend",o);return;case"onClick":p!=null&&(o.onclick=$r);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!it.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),S=f.slice(2,v?f.length-7:void 0),a=o[Yn]||null,a=a!=null?a[f]:null,typeof a=="function"&&o.removeEventListener(S,a,v),typeof p=="function")){typeof a!="function"&&a!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(S,p,v);break e}tt=!0,f in o?o[f]=p:p===!0?o.setAttribute(f,""):mn(o,f,p)}return}tt=!0}function br(o,a,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",o),St("load",o);var p=!1,v=!1,S;for(S in f)if(f.hasOwnProperty(S)){var A=f[S];if(A!=null)switch(S){case"src":p=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:qt(o,a,S,A,f,null)}}v&&qt(o,a,"srcSet",f.srcSet,f,null),p&&qt(o,a,"src",f.src,f,null);return;case"input":St("invalid",o);var V=S=A=v=null,Y=null,ae=null;for(p in f)if(f.hasOwnProperty(p)){var me=f[p];if(me!=null)switch(p){case"name":v=me;break;case"type":A=me;break;case"checked":Y=me;break;case"defaultChecked":ae=me;break;case"value":S=me;break;case"defaultValue":V=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,a));break;default:qt(o,a,p,me,f,null)}}pl(o,S,V,Y,ae,A,v,!1);return;case"select":St("invalid",o),p=A=S=null;for(v in f)if(f.hasOwnProperty(v)&&(V=f[v],V!=null))switch(v){case"value":S=V;break;case"defaultValue":A=V;break;case"multiple":p=V;default:qt(o,a,v,V,f,null)}a=S,f=A,o.multiple=!!p,a!=null?ls(o,!!p,a,!1):f!=null&&ls(o,!!p,f,!0);return;case"textarea":St("invalid",o),S=v=p=null;for(A in f)if(f.hasOwnProperty(A)&&(V=f[A],V!=null))switch(A){case"value":p=V;break;case"defaultValue":v=V;break;case"children":S=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:qt(o,a,A,V,f,null)}Cs(o,p,v,S);return;case"option":for(Y in f)if(f.hasOwnProperty(Y)&&(p=f[Y],p!=null))switch(Y){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:qt(o,a,Y,p,f,null)}return;case"dialog":St("beforetoggle",o),St("toggle",o),St("cancel",o),St("close",o);break;case"iframe":case"object":St("load",o);break;case"video":case"audio":for(p=0;p<Zd.length;p++)St(Zd[p],o);break;case"image":St("error",o),St("load",o);break;case"details":St("toggle",o);break;case"embed":case"source":case"link":St("error",o),St("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in f)if(f.hasOwnProperty(ae)&&(p=f[ae],p!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:qt(o,a,ae,p,f,null)}return;default:if(Pa(a)){for(me in f)f.hasOwnProperty(me)&&(p=f[me],p!==void 0&&Lv(o,a,me,p,f,void 0));return}}for(V in f)f.hasOwnProperty(V)&&(p=f[V],p!=null&&qt(o,a,V,p,f,null))}var i8={};function o8(o,a,f,p){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,A=null,V=null,Y=null,ae=null,me=null;for(fe in f){var ve=f[fe];if(f.hasOwnProperty(fe)&&ve!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Y=ve;default:p.hasOwnProperty(fe)||qt(o,a,fe,null,p,ve)}}for(var ie in p){var fe=p[ie];if(ve=f[ie],p.hasOwnProperty(ie)&&(fe!=null||ve!=null))switch(ie){case"type":fe!==ve&&(tt=!0),S=fe;break;case"name":fe!==ve&&(tt=!0),v=fe;break;case"checked":fe!==ve&&(tt=!0),ae=fe;break;case"defaultChecked":fe!==ve&&(tt=!0),me=fe;break;case"value":fe!==ve&&(tt=!0),A=fe;break;case"defaultValue":fe!==ve&&(tt=!0),V=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,a));break;default:fe!==ve&&qt(o,a,ie,fe,p,ve)}}kr(o,A,V,Y,ae,me,S,v);return;case"select":fe=A=V=ie=null;for(S in f)if(Y=f[S],f.hasOwnProperty(S)&&Y!=null)switch(S){case"value":break;case"multiple":fe=Y;default:p.hasOwnProperty(S)||qt(o,a,S,null,p,Y)}for(v in p)if(S=p[v],Y=f[v],p.hasOwnProperty(v)&&(S!=null||Y!=null))switch(v){case"value":S!==Y&&(tt=!0),ie=S;break;case"defaultValue":S!==Y&&(tt=!0),V=S;break;case"multiple":S!==Y&&(tt=!0),A=S;default:S!==Y&&qt(o,a,v,S,p,Y)}a=V,f=A,p=fe,ie!=null?ls(o,!!f,ie,!1):!!p!=!!f&&(a!=null?ls(o,!!f,a,!0):ls(o,!!f,f?[]:"",!1));return;case"textarea":fe=ie=null;for(V in f)if(v=f[V],f.hasOwnProperty(V)&&v!=null&&!p.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:qt(o,a,V,null,p,v)}for(A in p)if(v=p[A],S=f[A],p.hasOwnProperty(A)&&(v!=null||S!=null))switch(A){case"value":v!==S&&(tt=!0),ie=v;break;case"defaultValue":v!==S&&(tt=!0),fe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==S&&qt(o,a,A,v,p,S)}gu(o,ie,fe);return;case"option":for(var je in f)if(ie=f[je],f.hasOwnProperty(je)&&ie!=null&&!p.hasOwnProperty(je))switch(je){case"selected":o.selected=!1;break;default:qt(o,a,je,null,p,ie)}for(Y in p)if(ie=p[Y],fe=f[Y],p.hasOwnProperty(Y)&&ie!==fe&&(ie!=null||fe!=null))switch(Y){case"selected":ie!==fe&&(tt=!0),o.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:qt(o,a,Y,ie,p,fe)}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 $e in f)ie=f[$e],f.hasOwnProperty($e)&&ie!=null&&!p.hasOwnProperty($e)&&qt(o,a,$e,null,p,ie);for(ae in p)if(ie=p[ae],fe=f[ae],p.hasOwnProperty(ae)&&ie!==fe&&(ie!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:qt(o,a,ae,ie,p,fe)}return;default:if(Pa(a)){for(var ht in f)ie=f[ht],f.hasOwnProperty(ht)&&ie!==void 0&&!p.hasOwnProperty(ht)&&Lv(o,a,ht,void 0,p,ie);for(me in p)ie=p[me],fe=f[me],!p.hasOwnProperty(me)||ie===fe||ie===void 0&&fe===void 0||Lv(o,a,me,ie,p,fe);return}}for(var le in f)ie=f[le],f.hasOwnProperty(le)&&ie!=null&&!p.hasOwnProperty(le)&&qt(o,a,le,null,p,ie);for(ve in p)ie=p[ve],fe=f[ve],!p.hasOwnProperty(ve)||ie===fe||ie==null&&fe==null||qt(o,a,ve,ie,p,fe)}function JR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l8(){if(typeof performance.getEntriesByType=="function"){for(var o=0,a=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var v=f[p],S=v.transferSize,A=v.initiatorType,V=v.duration;if(S&&V&&JR(A)){for(A=0,V=v.responseEnd,p+=1;p<f.length;p++){var Y=f[p],ae=Y.startTime;if(ae>V)break;var me=Y.transferSize,ve=Y.initiatorType;me&&JR(ve)&&(Y=Y.responseEnd,A+=me*(Y<V?1:(V-ae)/(Y-ae)))}if(--p,a+=8*(S+A)/(v.duration/1e3),o++,10<o)break}}if(0<o)return a/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Pv=null,zv=null;function eh(o){return o.nodeType===9?o:o.ownerDocument}function eO(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tO(o,a){if(o===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&a==="foreignObject"?0:o}function nO(o,a,f,p){return f=eh(f).createElement(o),f[nn]=p,f[Yn]=a,br(f,o,a),Ce(f),f}function Bv(o,a){return o==="textarea"||o==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Hv=null;function a8(){var o=window.event;return o&&o.type==="popstate"?o===Hv?!1:(Hv=o,!0):(Hv=null,!1)}var Fv=typeof setTimeout=="function"?setTimeout:void 0,c8=typeof clearTimeout=="function"?clearTimeout:void 0,rO=typeof Promise=="function"?Promise:void 0,sO=typeof requestAnimationFrame=="function"?requestAnimationFrame:Fv,u8=typeof queueMicrotask=="function"?queueMicrotask:typeof rO<"u"?function(o){return rO.resolve(null).then(o).catch(f8)}:Fv;function f8(o){setTimeout(function(){throw o})}function Ll(o){return o==="head"}function iO(o,a){var f=a,p=0;do{var v=f.nextSibling;if(o.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(p===0){o.removeChild(v),Qu(a);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Wv(o.ownerDocument.documentElement);else if(f==="head"){f=o.ownerDocument.head,Wv(f);for(var S=f.firstChild;S;){var A=S.nextSibling,V=S.nodeName;S[po]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=A}}else f==="body"&&Wv(o.ownerDocument.body);f=v}while(f);Qu(a)}function oO(o,a){var f=o;o=0;do{var p=f.nextSibling;if(f.nodeType===1?a?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(a?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(o===0)break;o--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||o++;f=p}while(f)}function lO(o,a,f){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,o.style.viewTransitionName=a,f!=null&&(o.style.viewTransitionClass=f),f=getComputedStyle(o),f.display==="inline"){if(a=o.getClientRects(),a.length===1)var p=1;else for(var v=p=0;v<a.length;v++){var S=a[v];0<S.width&&0<S.height&&p++}p===1&&(o=o.style,o.display=a.length===1?"inline-block":"block",o.marginTop="-"+f.paddingTop,o.marginBottom="-"+f.paddingBottom)}}function aO(o,a){o=o.style,a=a.style;var f=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;o.viewTransitionName=f==null||typeof f=="boolean"?"":(""+f).trim(),f=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,o.viewTransitionClass=f==null||typeof f=="boolean"?"":(""+f).trim(),o.display==="inline-block"&&(a==null?o.display=o.margin="":(f=a.display,o.display=f==null||typeof f=="boolean"?"":f,f=a.margin,f!=null?o.margin=f:(f=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],o.marginTop=f==null||typeof f=="boolean"?"":f,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],o.marginBottom=a==null||typeof a=="boolean"?"":a)))}function d8(o,a,f){return f=f.ownerDocument.defaultView,{rect:o,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=o.bottom&&0<=o.right&&o.top<=f.innerHeight&&o.left<=f.innerWidth}}function $v(o){var a=o.getBoundingClientRect(),f=getComputedStyle(o);return d8(a,f,o)}function h8(o){return o.documentElement.clientHeight}function p8(o){this.addEventListener("load",o),this.addEventListener("error",o)}function m8(o,a,f,p,v,S,A,V,Y){var ae=a.nodeType===9?a:a.ownerDocument;try{var me=ae.startViewTransition({update:function(){var ie=ae.defaultView,fe=ie.navigation&&ie.navigation.transition,je=ae.fonts.status;p();var $e=[];if(je==="loaded"&&(h8(ae),ae.fonts.status==="loading"&&$e.push(ae.fonts.ready)),je=$e.length,o!==null)for(var ht=o.suspenseyImages,le=0,ee=0;ee<ht.length;ee++){var ue=ht[ee];if(!ue.complete){var be=ue.getBoundingClientRect();if(0<be.bottom&&0<be.right&&be.top<ie.innerHeight&&be.left<ie.innerWidth){if(le+=kO(ue),le>vg){$e.length=je;break}ue=new Promise(p8.bind(ue)),$e.push(ue)}}}if(0<$e.length)return ie=Promise.race([Promise.all($e),new Promise(function(Be){return setTimeout(Be,500)})]).then(v,v),(fe?Promise.allSettled([fe.finished,ie]):ie).then(S,S);if(v(),fe)return fe.finished.then(S,S);S()},types:f});ae.__reactViewTransition=me;var ve=[];return me.ready.then(function(){for(var ie=ae.documentElement.getAnimations({subtree:!0}),fe=0;fe<ie.length;fe++){var je=ie[fe],$e=je.effect,ht=$e.pseudoElement;if(ht!=null&&ht.startsWith("::view-transition")){ve.push(je),je=$e.getKeyframes();for(var le=ht=void 0,ee=!0,ue=0;ue<je.length;ue++){var be=je[ue],Be=be.width;if(ht===void 0)ht=Be;else if(ht!==Be){ee=!1;break}if(Be=be.height,le===void 0)le=Be;else if(le!==Be){ee=!1;break}delete be.width,delete be.height,be.transform==="none"&&delete be.transform}ee&&ht!==void 0&&le!==void 0&&($e.setKeyframes(je),ee=getComputedStyle($e.target,$e.pseudoElement),ee.width!==ht||ee.height!==le)&&(ee=je[0],ee.width=ht,ee.height=le,ee=je[je.length-1],ee.width=ht,ee.height=le,$e.setKeyframes(je))}}A()},function(ie){ae.__reactViewTransition===me&&(ae.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&Y(ie)}finally{p(),v(),A()}}),me.finished.finally(function(){for(var ie=0;ie<ve.length;ie++)ve[ie].cancel();ae.__reactViewTransition===me&&(ae.__reactViewTransition=null),V()}),me}catch{return p(),v(),A(),null}}function lc(o,a){this._scope=document.documentElement,this._selector="::view-transition-"+o+"("+a+")"}lc.prototype.animate=function(o,a){return a=typeof a=="number"?{duration:a}:k({},a),a.pseudoElement=this._selector,this._scope.animate(o,a)},lc.prototype.getAnimations=function(){for(var o=this._scope,a=this._selector,f=o.getAnimations({subtree:!0}),p=[],v=0;v<f.length;v++){var S=f[v].effect;S!==null&&S.target===o&&S.pseudoElement===a&&p.push(f[v])}return p},lc.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function cO(o){return{name:o,group:new lc("group",o),imagePair:new lc("image-pair",o),old:new lc("old",o),new:new lc("new",o)}}function Ds(o){this._fragmentFiber=o,this._observers=this._eventListeners=null}Ds.prototype.addEventListener=function(o,a,f){var p=null,v=null;if(!(f!=null&&typeof f!="boolean"&&(p=f.signal||null,p!==null&&p.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var S=this._eventListeners;if(fO(S,o,a,f)===-1){var A=this,V=a;f!=null&&typeof f!="boolean"&&f.once===!0&&(V=function(Y){A.removeEventListener(o,a,f),typeof a=="function"?a.call(this,Y):a.handleEvent(Y)}),p!==null&&(v=A.removeEventListener.bind(A,o,a,f),p.addEventListener("abort",v,{once:!0}),v=p.removeEventListener.bind(p,"abort",v)),p=qu(f),S.push({type:o,listener:a,optionsOrUseCapture:f,attachedListener:V,cleanup:v}),m(this._fragmentFiber.child,!1,g8,o,V,p)}this._eventListeners=S}};function g8(o,a,f,p){return E(o).addEventListener(a,f,p),!1}Ds.prototype.removeEventListener=function(o,a,f){var p=this._eventListeners;if(p!==null&&(a=fO(p,o,a,f),a!==-1)){var v=p[a];f=v.attachedListener;var S=v.cleanup;v=qu(v.optionsOrUseCapture),m(this._fragmentFiber.child,!1,y8,o,f,v),p.splice(a,1),S!==null&&S()}};function y8(o,a,f,p){return E(o).removeEventListener(a,f,p),!1}function qu(o){return o!=null&&typeof o!="boolean"&&(o.once===!0||o.signal instanceof AbortSignal)?{capture:o.capture,passive:o.passive}:o}function uO(o){return o==null?"c=0":typeof o=="boolean"?"c="+(o?"1":"0"):"c="+(o.capture?"1":"0")}function fO(o,a,f,p){if(o.length===0)return-1;p=uO(p);for(var v=0;v<o.length;v++){var S=o[v];if(S.type===a&&S.listener===f&&uO(S.optionsOrUseCapture)===p)return v}return-1}Ds.prototype.dispatchEvent=function(o){var a=g(this._fragmentFiber);if(a===null)return!0;a=E(a);var f=this._eventListeners;if(f!==null&&0<f.length||!o.bubbles){var p=a.nodeType===9?a.createComment(""):document.createTextNode("");if(f)for(var v=0;v<f.length;v++){var S=f[v];p.addEventListener(S.type,S.attachedListener,qu(S.optionsOrUseCapture))}if(a.appendChild(p),o=p.dispatchEvent(o),f)for(v=0;v<f.length;v++)S=f[v],p.removeEventListener(S.type,S.attachedListener,qu(S.optionsOrUseCapture));return a.removeChild(p),o}return a.dispatchEvent(o)},Ds.prototype.focus=function(o){m(this._fragmentFiber.child,!0,dO,o,void 0,void 0)};function dO(o,a){return o.tag===6?!1:(o=E(o),k8(o,a))}Ds.prototype.focusLast=function(o){var a=[];m(this._fragmentFiber.child,!0,Vv,a,void 0,void 0);for(var f=a.length-1;0<=f&&!dO(a[f],o);f--);};function Vv(o,a){return a.push(o),!1}Ds.prototype.blur=function(){var o=g(this._fragmentFiber);o!==null&&(o=E(o),o=eh(o).activeElement,o!==null&&m(this._fragmentFiber.child,!1,x8,o,void 0,void 0))};function x8(o,a){return o.tag===6?!1:(o=E(o),o===a||o.contains(a)?(a.blur(),!0):!1)}Ds.prototype.observeUsing=function(o){this._observers===null&&(this._observers=new Set),this._observers.add(o),m(this._fragmentFiber.child,!1,b8,o,void 0,void 0)};function b8(o,a){return o.tag===6||(o=E(o),a.observe(o)),!1}Ds.prototype.unobserveUsing=function(o){var a=this._observers;if(a!==null&&a.has(o)){a.delete(o),m(this._fragmentFiber.child,!1,v8,o,void 0,void 0);for(var f=a=0;f<hi.length;f++){var p=hi[f];p.fragmentInstance===this&&p.observer===o?o.unobserve(p.instance):hi[a++]=p}hi.length=a}};function v8(o,a){return o.tag===6||(o=E(o),a.unobserve(o)),!1}var hi=[],Uv=!1;function S8(o,a,f){hi.push({fragmentInstance:o,observer:a,instance:f}),Uv||(Uv=!0,M8(function(){Uv=!1;var p=hi;hi=[];for(var v=0;v<p.length;v++){var S=p[v];S.observer.unobserve(S.instance)}}))}Ds.prototype.getClientRects=function(){var o=[];return m(this._fragmentFiber.child,!1,w8,o,void 0,void 0),o};function w8(o,a){if(o.tag===6){o=o.stateNode;var f=o.ownerDocument.createRange();f.selectNodeContents(o),a.push.apply(a,f.getClientRects())}else o=E(o),a.push.apply(a,o.getClientRects());return!1}Ds.prototype.getRootNode=function(o){var a=g(this._fragmentFiber);return a===null?this:E(a).getRootNode(o)},Ds.prototype.compareDocumentPosition=function(o){var a=g(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var f=[];m(this._fragmentFiber.child,!1,Vv,f,void 0,void 0);var p=E(a);if(f.length===0){if(f=p,y(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(f=a)}a=this._fragmentFiber;var v=p=f.compareDocumentPosition(o);return f===o?v=Node.DOCUMENT_POSITION_CONTAINS:p&Node.DOCUMENT_POSITION_CONTAINED_BY&&(f=b(a)[1],f===null?v=Node.DOCUMENT_POSITION_PRECEDING:(o=E(f).compareDocumentPosition(o),v=o===0||o&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),v|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=E(f[0]),v=E(f[f.length-1]);var S=y(this._fragmentFiber)?a.parentElement:p;if(S==null)return Node.DOCUMENT_POSITION_DISCONNECTED;p=S.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,S=S.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY;var A=a.compareDocumentPosition(o),V=v.compareDocumentPosition(o),Y=A&Node.DOCUMENT_POSITION_CONTAINED_BY||V&Node.DOCUMENT_POSITION_CONTAINED_BY;return V=p&&S&&A&Node.DOCUMENT_POSITION_FOLLOWING&&V&Node.DOCUMENT_POSITION_PRECEDING,a=p&&a===o||S&&v===o||Y||V?Node.DOCUMENT_POSITION_CONTAINED_BY:!p&&a===o||!S&&v===o?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:A,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||E8(a,this._fragmentFiber,f[0],f[f.length-1],o)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function E8(o,a,f,p,v){var S=ws(v);if(o&Node.DOCUMENT_POSITION_CONTAINED_BY){if(f=!!S)e:{for(;S!==null;){if(S.tag===7&&(S===a||S.alternate===a)){f=!0;break e}S=S.return}f=!1}return f}if(o&Node.DOCUMENT_POSITION_CONTAINS){if(S===null)return S=v.ownerDocument,v===S||v===S.documentElement||v===S.body;e:{for(S=a,a=g(a);S!==null;){if(!(S.tag!==5&&S.tag!==3&&S.tag!==27||S!==a&&S.alternate!==a)){S=!0;break e}S=S.return}S=!1}return S}return o&Node.DOCUMENT_POSITION_PRECEDING?((a=!!S)&&!(a=S===f)&&(a=D(f,S,M),a===null?a=!1:(m(a,!0,N,S,f),S=C,C=null,a=S!==null)),a):o&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!S)&&!(a=S===p)&&(a=D(p,S,M),a===null?a=!1:(m(a,!0,R,S,p),S=C,T=C=null,a=S!==null)),a):!1}function hO(o,a){var f=o.ownerDocument.createRange();f.selectNodeContents(o),o=f.getBoundingClientRect(),window.scrollTo(window.scrollX+o.left,a?window.scrollY+o.top:window.scrollY+o.bottom-window.innerHeight)}Ds.prototype.scrollIntoView=function(o){if(typeof o=="object")throw Error(r(566));var a=[];m(this._fragmentFiber.child,!1,Vv,a,void 0,void 0);var f=o!==!1;if(a.length===0){var p=b(this._fragmentFiber);if(p=f?p[1]||p[0]||g(this._fragmentFiber):p[0]||p[1],p===null)return;if(p.tag===6){o=E(p),hO(o,f);return}if(p=E(p),p.nodeType!==9){if(p.nodeType===11){f="host"in p?p.host:null,f!==null&&f.scrollIntoView(o);return}p.scrollIntoView(o)}}for(p=f?a.length-1:0;p!==(f?-1:a.length);){var v=a[p];v.tag===6?(v=E(v),hO(v,f)):E(v).scrollIntoView(o),p+=f?-1:1}};function C8(o,a){return o=E(o),pO(o,a),!1}function pO(o,a){o.reactFragments==null&&(o.reactFragments=new Set),o.reactFragments.add(a)}function mO(o,a){var f=a._eventListeners;if(f!==null)for(var p=0;p<f.length;p++){var v=f[p];o.addEventListener(v.type,v.attachedListener,qu(v.optionsOrUseCapture))}o.nodeType!==3&&(f=a._observers,f!==null&&f.forEach(function(S){for(var A=0,V=0;V<hi.length;V++){var Y=hi[V];(Y.fragmentInstance!==a||Y.observer!==S||Y.instance!==o)&&(hi[A++]=Y)}hi.length=A,S.observe(o)}),pO(o,a))}function N8(o,a){var f=a._eventListeners;if(f!==null)for(var p=0;p<f.length;p++){var v=f[p];o.removeEventListener(v.type,v.attachedListener,qu(v.optionsOrUseCapture))}o.nodeType!==3&&(f=a._observers,f!==null&&f.forEach(function(S){typeof S.rootMargin=="string"?S8(a,S,o):S.unobserve(o)}),o.reactFragments!=null&&o.reactFragments.delete(a))}function qv(o){var a=o.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var f=a;switch(a=a.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":qv(f),hl(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function T8(o,a,f,p){for(;o.nodeType===1;){var v=f;if(o.nodeName.toLowerCase()!==a.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[po])switch(a){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==v.rel||o.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||o.getAttribute("title")!==(v.title==null?null:v.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(v.src==null?null:v.src)||o.getAttribute("type")!==(v.type==null?null:v.type)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(a==="input"&&o.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=Xs(o.nextSibling),o===null)break}return null}function R8(o,a,f){if(a==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=Xs(o.nextSibling),o===null))return null;return o}function gO(o,a){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!a||(o=Xs(o.nextSibling),o===null))return null;return o}function Gv(o){return o.data==="$?"||o.data==="$~"}function Kv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function O8(o,a){var f=o.ownerDocument;if(o.data==="$~")o._reactRetry=a;else if(o.data!=="$?"||f.readyState!=="loading")a();else{var p=function(){a(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Xs(o){for(;o!=null;o=o.nextSibling){var a=o.nodeType;if(a===1||a===3)break;if(a===8){if(a=o.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return o}var Yv=null;function yO(o){o=o.nextSibling;for(var a=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(a===0)return Xs(o.nextSibling);a--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||a++}o=o.nextSibling}return null}function xO(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(a===0)return o;a--}else f!=="/$"&&f!=="/&"||a++}o=o.previousSibling}return null}function k8(o,a){function f(){p=!0}if(o.ownerDocument.activeElement===o)return!0;var p=!1;try{o.ownerDocument.addEventListener("focus",f,!0),(o.focus||HTMLElement.prototype.focus).call(o,a)}finally{o.ownerDocument.removeEventListener("focus",f,!0)}return p}function M8(o){sO(function(){sO(function(a){return o(a)})})}function bO(o,a,f){switch(a=eh(f),o){case"html":if(o=a.documentElement,!o)throw Error(r(452));return o;case"head":if(o=a.head,!o)throw Error(r(453));return o;case"body":if(o=a.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function vO(o,a,f){for(var p in f){var v=f[p];f.hasOwnProperty(p)&&v!=null&&qt(o,a,p,null,i8,v)}f.dangerouslySetInnerHTML!=null&&(o.textContent=""),o.onclick===$r&&(o.onclick=null),hl(o)}function Wv(o){for(var a=o.attributes;a.length;)o.removeAttributeNode(a[0]);hl(o)}var Qs=new Map,SO=new Set;function th(o){if(typeof o.getRootNode=="function"){var a=o.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return o.nodeType===9?o:o.ownerDocument}var ko=oe.d;oe.d={f:A8,r:_8,D:D8,C:I8,L:j8,m:L8,X:z8,S:P8,M:B8};function A8(){var o=ko.f(),a=fg();return o||a}function _8(o){var a=mo(o);a!==null&&a.tag===5&&a.type==="form"?ET(a):ko.r(o)}var Gu=typeof document>"u"?null:document;function wO(o,a,f){var p=Gu;if(p&&typeof a=="string"&&a){var v=rn(a);v='link[rel="'+o+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),SO.has(v)||(SO.add(v),o={rel:o,crossOrigin:f,href:a},p.querySelector(v)===null&&(a=p.createElement("link"),br(a,"link",o),Ce(a),p.head.appendChild(a)))}}function D8(o){ko.D(o),wO("dns-prefetch",o,null)}function I8(o,a){ko.C(o,a),wO("preconnect",o,a)}function j8(o,a,f){ko.L(o,a,f);var p=Gu;if(p&&o&&a){var v='link[rel="preload"][as="'+rn(a)+'"]';a==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+rn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+rn(f.imageSizes)+'"]')):v+='[href="'+rn(o)+'"]';var S=v;switch(a){case"style":S=Ku(o);break;case"script":S=Yu(o)}if(!(Qs.has(S)||(o=k({rel:"preload",href:a==="image"&&f&&f.imageSrcSet?void 0:o,as:a},f),Qs.set(S,o),p.querySelector(v)!==null||a==="style"&&p.querySelector(nh(S))||a==="script"&&p.querySelector(rh(S))))){var A=p.createElement("link");br(A,"link",o),a==="style"&&(A[dl]=!0,A.onload=A.onerror=function(){Ge(A)}),Ce(A),p.head.appendChild(A)}}}function L8(o,a){ko.m(o,a);var f=Gu;if(f&&o){var p=a&&typeof a.as=="string"?a.as:"script",v='link[rel="modulepreload"][as="'+rn(p)+'"][href="'+rn(o)+'"]',S=v;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Yu(o)}if(!Qs.has(S)&&(o=k({rel:"modulepreload",href:o},a),Qs.set(S,o),f.querySelector(v)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(rh(S)))return}p=f.createElement("link"),br(p,"link",o),Ce(p),f.head.appendChild(p)}}}function P8(o,a,f){ko.S(o,a,f);var p=Gu;if(p&&o){var v=Ee(p).hoistableStyles,S=Ku(o);a=a||"default";var A=v.get(S);if(!A){var V={loading:0,preload:null};if(A=p.querySelector(nh(S)))V.loading=5;else{o=k({rel:"stylesheet",href:o,"data-precedence":a},f),(f=Qs.get(S))&&Xv(o,f);var Y=A=p.createElement("link");Ce(Y),br(Y,"link",o),Y._p=new Promise(function(ae,me){Y.onload=ae,Y.onerror=me}),Y.addEventListener("load",function(){V.loading|=1}),Y.addEventListener("error",function(){V.loading|=2}),V.loading|=4,xg(A,a,p)}A={type:"stylesheet",instance:A,count:1,state:V},v.set(S,A)}}}function z8(o,a){ko.X(o,a);var f=Gu;if(f&&o){var p=Ee(f).hoistableScripts,v=Yu(o),S=p.get(v);S||(S=f.querySelector(rh(v)),S||(o=k({src:o,async:!0},a),(a=Qs.get(v))&&Qv(o,a),S=f.createElement("script"),Ce(S),br(S,"link",o),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(v,S))}}function B8(o,a){ko.M(o,a);var f=Gu;if(f&&o){var p=Ee(f).hoistableScripts,v=Yu(o),S=p.get(v);S||(S=f.querySelector(rh(v)),S||(o=k({src:o,async:!0,type:"module"},a),(a=Qs.get(v))&&Qv(o,a),S=f.createElement("script"),Ce(S),br(S,"link",o),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(v,S))}}function EO(o,a,f,p){var v=(v=Ie.current)?th(v):null;if(!v)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(f=Ku(f.href),a=Ee(v).hoistableStyles,p=a.get(f),p||(p={type:"style",instance:null,count:0,state:null},a.set(f,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=Ku(f.href);var S=Ee(v).hoistableStyles,A=S.get(o);if(A||(v=v.ownerDocument||v,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,A),(S=v.querySelector(nh(o)))?S._p||(A.instance=S,A.state.loading=5):(S=Qs.get(o),S||(S={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Qs.set(o,S)),H8(v,o,S,A.state))),a&&p===null)throw Error(r(528,""));return A}if(a&&p!==null)throw Error(r(529,""));return null;case"script":return a=f.async,f=f.src,typeof f=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(f=Yu(f),a=Ee(v).hoistableScripts,p=a.get(f),p||(p={type:"script",instance:null,count:0,state:null},a.set(f,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Ku(o){return'href="'+rn(o)+'"'}function nh(o){return'link[rel="stylesheet"]['+o+"]"}function CO(o){return k({},o,{"data-precedence":o.precedence,precedence:null})}function H8(o,a,f,p){if(a=o.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[dl]!==!0){p.loading=1;return}}else a=o.createElement("link"),a[dl]=!0,a.onload=a.onerror=Ge.bind(null,a),br(a,"link",f),Ce(a),o.head.appendChild(a);p.preload=a,a.addEventListener("load",function(){return p.loading|=1}),a.addEventListener("error",function(){return p.loading|=2})}function Yu(o){return'[src="'+rn(o)+'"]'}function rh(o){return"script[async]"+o}function NO(o,a,f){if(a.count++,a.instance===null)switch(a.type){case"style":var p=o.querySelector('style[data-href~="'+rn(f.href)+'"]');if(p)return a.instance=p,Ce(p),p;var v=k({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Ce(p),br(p,"style",v),xg(p,f.precedence,o),a.instance=p;case"stylesheet":v=Ku(f.href);var S=o.querySelector(nh(v));if(S)return a.state.loading|=4,a.instance=S,Ce(S),S;p=CO(f),(v=Qs.get(v))&&Xv(p,v),S=(o.ownerDocument||o).createElement("link"),Ce(S);var A=S;return A._p=new Promise(function(V,Y){A.onload=V,A.onerror=Y}),br(S,"link",p),a.state.loading|=4,xg(S,f.precedence,o),a.instance=S;case"script":return S=Yu(f.src),(v=o.querySelector(rh(S)))?(a.instance=v,Ce(v),v):(p=f,(v=Qs.get(S))&&(p=k({},f),Qv(p,v)),o=o.ownerDocument||o,v=o.createElement("script"),Ce(v),br(v,"link",p),o.head.appendChild(v),a.instance=v);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(p=a.instance,a.state.loading|=4,xg(p,f.precedence,o));return a.instance}function xg(o,a,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=p.length?p[p.length-1]:null,S=v,A=0;A<p.length;A++){var V=p[A];if(V.dataset.precedence===a)S=V;else if(S!==v)break}S?S.parentNode.insertBefore(o,S.nextSibling):(a=f.nodeType===9?f.head:f,a.insertBefore(o,a.firstChild))}function Xv(o,a){o.crossOrigin==null&&(o.crossOrigin=a.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=a.referrerPolicy),o.title==null&&(o.title=a.title)}function Qv(o,a){o.crossOrigin==null&&(o.crossOrigin=a.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=a.referrerPolicy),o.integrity==null&&(o.integrity=a.integrity)}var bg=null;function TO(o,a,f){if(bg===null){var p=new Map,v=bg=new Map;v.set(f,p)}else v=bg,p=v.get(f),p||(p=new Map,v.set(f,p));if(p.has(o))return p;for(p.set(o,null),f=f.getElementsByTagName(o),v=0;v<f.length;v++){var S=f[v];if(!(S[po]||S[nn]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var A=S.getAttribute(a)||"";A=o+A;var V=p.get(A);V?V.push(S):p.set(A,[S])}}return p}function Zv(o,a,f){o=o.ownerDocument||o,o.head.insertBefore(f,a==="title"?o.querySelector("head > title"):null)}function F8(o,a,f){if(f===1||a.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return o=a.disabled,typeof a.precedence=="string"&&o==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function RO(o,a){return o==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function OO(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function kO(o){return(o.width||100)*(o.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function MO(o,a){typeof a.decode=="function"&&(o.imgCount++,a.complete||(o.imgBytes+=kO(a),o.suspenseyImages.push(a)),o=U8.bind(o),a.decode().then(o,o))}function $8(o,a,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=Ku(p.href),S=a.querySelector(nh(v));if(S){a=S._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(o.count++,o=sh.bind(o),a.then(o,o)),f.state.loading|=4,f.instance=S,Ce(S);return}S=a.ownerDocument||a,p=CO(p),(v=Qs.get(v))&&Xv(p,v),S=S.createElement("link"),Ce(S);var A=S;A._p=new Promise(function(V,Y){A.onload=V,A.onerror=Y}),br(S,"link",p),f.instance=S}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,a),(a=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=sh.bind(o),a.addEventListener("load",f),a.addEventListener("error",f))}}var vg=0;function V8(o,a){return o.stylesheets&&o.count===0&&wg(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var p=setTimeout(function(){if(o.stylesheets&&wg(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+a);0<o.imgBytes&&vg===0&&(vg=62500*l8());var v=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&wg(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>vg?50:800)+a);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(v)}}:null}function AO(o){if(o.count===0&&(o.imgCount===0||!o.waitingForImages)){if(o.stylesheets)wg(o,o.stylesheets);else if(o.unsuspend){var a=o.unsuspend;o.unsuspend=null,a()}}}function sh(){this.count--,AO(this)}function U8(){this.imgCount--,AO(this)}var Sg=null;function wg(o,a){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Sg=new Map,a.forEach(q8,o),Sg=null,sh.call(o))}function q8(o,a){if(!(a.state.loading&4)){var f=Sg.get(o);if(f)var p=f.get(null);else{f=new Map,Sg.set(o,f);for(var v=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var A=v[S];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(f.set(A.dataset.precedence,A),p=A)}p&&f.set(null,p)}v=a.instance,A=v.getAttribute("data-precedence"),S=f.get(A)||p,S===p&&f.set(null,v),f.set(A,v),this.count++,p=sh.bind(this),v.addEventListener("load",p),v.addEventListener("error",p),S?S.parentNode.insertBefore(v,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(v,o.firstChild)),a.state.loading|=4}}var Wu={$$typeof:B,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function G8(o,a,f,p,v,S,A,V,Y){this.tag=1,this.containerInfo=o,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=Ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.hiddenUpdates=Ai(null),this.identifierPrefix=p,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.transitionTypes=null,this.incompleteTransitions=new Map}function _O(o,a,f,p,v,S,A,V,Y,ae,me,ve){return o=new G8(o,a,f,A,Y,ae,me,ve,V),a=1,S===!0&&(a|=24),S=as(3,null,null,a),o.current=S,S.stateNode=o,a=hb(),a.refCount++,o.pooledCache=a,a.refCount++,S.memoizedState={element:p,isDehydrated:f,cache:a},yb(S),o}function DO(o){return o?(o=Su,o):Su}function IO(o,a,f,p,v,S){v=DO(v),p.context===null?p.context=v:p.pendingContext=v,p=Cl(a),p.payload={element:f},S=S===void 0?null:S,S!==null&&(p.callback=S),f=Nl(o,p,a),f!==null&&(ds(f,o,a),jd(f,o,a))}function jO(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<a?f:a}}function Jv(o,a){jO(o,a),(o=o.alternate)&&jO(o,a)}function LO(o){if(o.tag===13||o.tag===31){var a=Ua(o,67108864);a!==null&&ds(a,o,67108864),Jv(o,67108864)}}function PO(o){if(o.tag===13||o.tag===31){var a=_s();a=li(a);var f=Ua(o,a);f!==null&&ds(f,o,a),Jv(o,a)}}var Xu=!0;function K8(o,a,f,p){var v=ge.T;ge.T=null;var S=oe.p;try{oe.p=2,eS(o,a,f,p)}finally{oe.p=S,ge.T=v}}function Y8(o,a,f,p){var v=ge.T;ge.T=null;var S=oe.p;try{oe.p=8,eS(o,a,f,p)}finally{oe.p=S,ge.T=v}}function eS(o,a,f,p){if(Xu){var v=tS(p);if(v===null)jv(o,a,p,Eg,f),BO(o,p);else if(X8(v,o,a,f,p))p.stopPropagation();else if(BO(o,p),a&4&&-1<W8.indexOf(o)){for(;v!==null;){var S=mo(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var A=ns(S.pendingLanes);if(A!==0){var V=S;for(V.pendingLanes|=2,V.entangledLanes|=2;A;){var Y=1<<31-Xt(A);V.entanglements[1]|=Y,A&=~Y}$i(S),(Lt&6)===0&&(ag=on()+500,Qd(0))}}break;case 31:case 13:V=Ua(S,2),V!==null&&ds(V,S,2),fg(),Jv(S,2)}if(S=tS(p),S===null&&jv(o,a,p,Eg,f),S===v)break;v=S}v!==null&&p.stopPropagation()}else jv(o,a,p,null,f)}}function tS(o){return o=Ba(o),nS(o)}var Eg=null;function nS(o){if(Eg=null,o=ws(o),o!==null){var a=i(o);if(a===null)o=null;else{var f=a.tag;if(f===13){if(o=l(a),o!==null)return o;o=null}else if(f===31){if(o=c(a),o!==null)return o;o=null}else if(f===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null)}}return Eg=o,null}function zO(o){switch(o){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case zr:return 2;case bs:return 8;case qn:case mt:return 32;case ln:return 268435456;default:return 32}default:return 32}}var rS=!1,Pl=null,zl=null,Bl=null,ih=new Map,oh=new Map,Hl=[],W8="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 BO(o,a){switch(o){case"focusin":case"focusout":Pl=null;break;case"dragenter":case"dragleave":zl=null;break;case"mouseover":case"mouseout":Bl=null;break;case"pointerover":case"pointerout":ih.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":oh.delete(a.pointerId)}}function lh(o,a,f,p,v,S){return o===null||o.nativeEvent!==S?(o={blockedOn:a,domEventName:f,eventSystemFlags:p,nativeEvent:S,targetContainers:[v]},a!==null&&(a=mo(a),a!==null&&LO(a)),o):(o.eventSystemFlags|=p,a=o.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),o)}function X8(o,a,f,p,v){switch(a){case"focusin":return Pl=lh(Pl,o,a,f,p,v),!0;case"dragenter":return zl=lh(zl,o,a,f,p,v),!0;case"mouseover":return Bl=lh(Bl,o,a,f,p,v),!0;case"pointerover":var S=v.pointerId;return ih.set(S,lh(ih.get(S)||null,o,a,f,p,v)),!0;case"gotpointercapture":return S=v.pointerId,oh.set(S,lh(oh.get(S)||null,o,a,f,p,v)),!0}return!1}function HO(o){var a=ws(o.target);if(a!==null){var f=i(a);if(f!==null){if(a=f.tag,a===13){if(a=l(f),a!==null){o.blockedOn=a,fo(o.priority,function(){PO(f)});return}}else if(a===31){if(a=c(f),a!==null){o.blockedOn=a,fo(o.priority,function(){PO(f)});return}}else if(a===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Cg(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var f=tS(o.nativeEvent);if(f===null){f=o.nativeEvent;var p=new f.constructor(f.type,f);za=p,f.target.dispatchEvent(p),za=null}else return a=mo(f),a!==null&&LO(a),o.blockedOn=f,!1;a.shift()}return!0}function FO(o,a,f){Cg(o)&&f.delete(a)}function Q8(){rS=!1,Pl!==null&&Cg(Pl)&&(Pl=null),zl!==null&&Cg(zl)&&(zl=null),Bl!==null&&Cg(Bl)&&(Bl=null),ih.forEach(FO),oh.forEach(FO)}function Ng(o,a){o.blockedOn===a&&(o.blockedOn=null,rS||(rS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Q8)))}var Tg=null;function $O(o){Tg!==o&&(Tg=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tg===o&&(Tg=null);for(var a=0;a<o.length;a+=3){var f=o[a],p=o[a+1],v=o[a+2];if(typeof p!="function"){if(nS(p||f)===null)continue;break}var S=mo(f);S!==null&&(o.splice(a,3),a-=3,zb(S,{pending:!0,data:v,method:f.method,action:p},p,v))}}))}function Qu(o){function a(Y){return Ng(Y,o)}Pl!==null&&Ng(Pl,o),zl!==null&&Ng(zl,o),Bl!==null&&Ng(Bl,o),ih.forEach(a),oh.forEach(a);for(var f=0;f<Hl.length;f++){var p=Hl[f];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Hl.length&&(f=Hl[0],f.blockedOn===null);)HO(f),f.blockedOn===null&&Hl.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var v=f[p],S=f[p+1],A=v[Yn]||null;if(typeof S=="function")A||$O(f);else if(A){var V=null;if(S&&S.hasAttribute("formAction")){if(v=S,A=S[Yn]||null)V=A.formAction;else if(nS(v)!==null)continue}else V=A.action;typeof V=="function"?f[p+1]=V:(f.splice(p,3),p-=3),$O(f)}}}function VO(){function o(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(A){return v=A})},focusReset:"manual",scroll:"manual"})}function a(){v!==null&&(v(),v=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,v=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),v!==null&&(v(),v=null)}}}function sS(o){this._internalRoot=o}Rg.prototype.render=sS.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(r(409));var f=a.current,p=_s();IO(f,p,o,a,null,null)},Rg.prototype.unmount=sS.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;IO(o.current,2,null,o,null,null),fg(),a[Hr]=null}};function Rg(o){this._internalRoot=o}Rg.prototype.unstable_scheduleHydration=function(o){if(o){var a=is();o={blockedOn:null,target:o,priority:a};for(var f=0;f<Hl.length&&a!==0&&a<Hl[f].priority;f++);Hl.splice(f,0,o),f===0&&HO(o)}};var UO=t.version;if(UO!=="19.3.0")throw Error(r(527,UO,"19.3.0"));oe.findDOMNode=function(o){var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(a),o=o!==null?h(o):null,o=o===null?null:o.stateNode,o};var Z8={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Og=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Og.isDisabled&&Og.supportsFiber)try{On=Og.inject(Z8),Bt=Og}catch{}}return ch.createRoot=function(o,a){if(!s(o))throw Error(r(299));var f=!1,p="",v=DT,S=IT,A=jT;return a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(A=a.onRecoverableError)),a=_O(o,1,!1,null,null,f,p,null,v,S,A,VO),o[Hr]=a.current,Iv(o),new sS(a)},ch.hydrateRoot=function(o,a,f){if(!s(o))throw Error(r(299));var p=!1,v="",S=DT,A=IT,V=jT,Y=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(V=f.onRecoverableError),f.formState!==void 0&&(Y=f.formState)),a=_O(o,1,!0,a,f??null,p,v,Y,S,A,V,VO),a.context=DO(null),f=a.current,p=_s(),p=li(p),v=Cl(p),v.callback=null,Nl(f,v,p),f=p,a.current.lanes=f,vs(a,f),$i(a),o[Hr]=a.current,Iv(o),new Rg(a)},ch.version="19.3.0",ch}var uk;function Y$(){if(uk)return aS.exports;uk=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(),aS.exports=K$(),aS.exports}var W$=Y$();const fk=!1;var dk=O.use,TE=O.useLayoutEffect;function Sa(e){return e[e.length-1]}function hj(e,t){return typeof e=="function"?e(t):e}const RE=Object.prototype.hasOwnProperty;function pj(e){for(const t in e)if(RE.call(e,t))return!0;return!1}const m0=()=>Object.create(null),Zu=(e,t)=>fa(e,t,!0);function fa(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;const s=Array.isArray(e)&&Array.isArray(t);if(!s&&!(B0(e)&&B0(t)))return t;const i=Object.keys(e),l=i.length,c=Object.keys(t),u=c.length;if(s?l!==e.length||u!==t.length||l&&Sa(i)!==`${l-1}`||u&&Sa(c)!==`${u-1}`:l!==Object.getOwnPropertyNames(e).length||u!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let d=0,h,m,g;if(s){for(;d<u&&(g=d,m=e[g],h=t[g],h=m===h?m:typeof m=="object"?fa(m,h,n,r):h,h===m);d++);if(d===u&&l===u)return e}else{let b=l===u,w=!0;for(;d<u;d++){g=c[d],m=e[g];const E=t[g];h=m===E?m:typeof m=="object"?fa(m,E,n,r):E,b&&(b=h===m&&(i[d]===g||RE.call(e,g))),w&&(w=Object.is(h,E)),i[d]=h}if(b)return Object.getOwnPropertySymbols(e).length?t:e;if(w)return t}const y=s?c.fill(0):n?m0():{};for(let b=0;b<u;b++)g=s?b:c[b],s?(m=e[g],b>d&&(h=t[g],h=m===h?m:typeof m=="object"?fa(m,h,n,r):h),y[g]=b<d?m:h):y[g]=i[b];return y}function B0(e){var t;return!e||typeof e!="object"?!1:(((t=Object.getPrototypeOf(e))==null?void 0:t.constructor)??Object)===Object}function qo(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++){const l=e[s],c=t[s];if(l!==c&&!qo(l,c,n,r))return!1}return!0}if(B0(e)&&B0(t)){if(n){for(const i in t)if((r||t[i]!==void 0)&&!qo(e[i],t[i],n,r))return!1;return!0}let s=0;if(r)s=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&s++;for(const i in t)if((r||t[i]!==void 0)&&(s--===0||!qo(e[i],t[i],n,r)))return!1;return s===0}return!1}function X$(e){return typeof(e==null?void 0:e.message)!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}const Q$=/[\x00-\x1f\x7f"<>`{}]/g;function Z$(e){return e.replace(Q$,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function hk(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Z$(t)}const J$=["http:","https:","mailto:","tel:"];function Gh(e){var t,n;if(e[0]!=="/"&&e.includes(":"))return(n=(t=/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e))==null?void 0:t[1])==null?void 0:n.replace(/[\t\n\r]/g,"").toLowerCase()}const mj=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function gj(e,t){if(!e)return!1;if(mj.test(e))return!0;const n=Gh(e);return n?!t.has(n):!1}function uh(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){const n=/%25|%5C/gi;let r=0,s;for(t="";(s=n.exec(e))!==null;)t+=hk(e.slice(r,s.index))+s[0],r=n.lastIndex;t+=hk(r?e.slice(r):e)}return t}function eV(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function tV(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function OE(){throw new Error("Invariant failed")}function mf(e){return e.replace(/\/{2,}/g,"/")}function yj(e){return e==="/"?e:e.replace(/^\/+/,"")}function Ji(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/+$/,""):e}function xj(e){return Ji(yj(e))}function pk(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function mk(e,t,n="never",r){if(t.includes("//")&&(t=mf(t)),t.startsWith("/"))return t.length===1||n==="preserve"?t:n==="always"?t.endsWith("/")?t:`${t}/`:t.endsWith("/")?t.slice(0,-1):t;const s=t===".";let i;if(r){i=s?e:e+"\0"+t;const d=r.get(i);if(d)return d}let l;if(s)l=e.split("/");else{for(e.includes("//")&&(e=mf(e)),l=e.split("/");l.length>1&&Sa(l)==="";)l.pop();const d=t.split("/");for(let h=0,m=d.length;h<m;h++){const g=d[h];g===""?h?h===m-1&&l.push(g):l=[g]:g===".."?l.length>1?l.pop():l=[""]:g==="."||l.push(g)}}l.length>1&&(Sa(l)===""?n==="never"&&l.pop():n==="always"&&l.push(""));const c=l.join("/"),u=(s?mf(c):c)||"/";return i&&r&&r.set(i,u),u}function nV(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),n=new RegExp([...t.keys()].join("|").replace(/[.*()]/g,"\\$&"),"g");return r=>r.replace(n,s=>t.get(s)??s)}function rV(e){return e==null||e===""}function sV(e,t,n){if(typeof t!="string")return""+(t??void 0);const r=e==="_splat";if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let s=encodeURIComponent(t);return r&&(s=s.replaceAll("%2F","/")),n?n(s):s}function gk(e,t,n,r,s){const i=e.endsWith("/")?"/":"";let l="";for(const c of t){if(typeof c=="string"){l+=c;continue}const[u,d,h,m]=c,g=u===2,y=g&&m!==void 0?m+i:m;let b=n[d];if(!(u===3&&b==null)){if(s&&(s[d]=b,g&&(s["*"]=b)),g&&rV(b)){if(h==="/"&&!y)continue;b=""}l+=h+sV(d,b,r)+(y||"")}}return l+i||"/"}function Hf(e){return(e==null?void 0:e.isNotFound)===!0}function iV(){try{return sessionStorage}catch{return}}const oV="tsr-scroll-restoration-v1_3",gf=iV();function lV(){try{return JSON.parse((gf==null?void 0:gf.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function aV(){try{gf==null||gf.setItem(oV,JSON.stringify(ql))}catch{}}const ql=lV(),yk="data-scroll-restoration-id",cV=e=>e.state.__TSR_key||e.href;function uV(e){const t=e.getAttribute(yk);if(t)return`[${yk}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let i=1,l=r;for(;l=l.previousElementSibling;)i++;const c=`${r.localName}:nth-child(${i})`;n=n?`${c} > ${n}`:c,r=s}return n}let Ag=!1;const g0="window";function B1(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function xk(e){const t=new Set;for(const n of e){if(n===g0)continue;const r=B1(n);r&&t.add(r)}return t}function fV(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||cV,i=new Set,l=c=>{const u=ql[c]||(ql[c]={});for(const d of i)d===document?u[g0]={scrollX,scrollY}:d.isConnected&&(u[uV(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Ag=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{Ag||i.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(s(c.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),aV()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{var w;const u=e.options.scrollRestorationBehavior,d=e.options.scrollToTopSelectors,h=r.next,m=r.hash;let g;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const y=s(c.toLocation),b=c.fromLocation&&s(c.fromLocation);if(r.restoring&&b&&b!==y){const E=ql[b];if(E){let C=ql[y];for(const T in E){if(T===g0){if(h)continue}else{const N=B1(T);if(!N||h&&d&&(g??(g=xk(d)),g.has(N)))continue}C||(C=ql[y]={}),C[T]??(C[T]=E[T])}}}Ag=!0;try{const E=c.toLocation.hash,C=c.toLocation.state.__hashScrollIntoViewOptions??!0;let T=!1;if(h){!E&&d&&(g??(g=xk(d)));const N=E&&C&&m,R=r.restoring?ql[y]:void 0;if(R)for(const M in R){const{scrollX:D,scrollY:k}=R[M];if(M===g0){if(N)continue;scrollTo({top:k,left:D,behavior:u}),T=!0}else{const I=B1(M);I&&(I.scrollLeft=D,I.scrollTop=k,g==null||g.delete(I))}}if(!E){const M={top:0,left:0,behavior:u};if(T||scrollTo(M),g)for(const D of g)D.scrollTo(M)}}!T&&E&&C&&((w=document.getElementById(E))==null||w.scrollIntoView(C))}finally{Ag=!1}}))}function dV(e,t=String){let n;for(const r in e){const s=e[r];s!==void 0&&(n||(n=new URLSearchParams)).set(r,t(s))}return n?n.toString():""}function dS(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function hV(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=dS(s):Array.isArray(i)?i.push(dS(s)):n[r]=[i,dS(s)]}return n}const bj=/^(?:\s|["[{\d-]|fa|nu|tr)/,pV=gV(JSON.parse),mV=yV(JSON.stringify,JSON.parse);function gV(e){const t=e===JSON.parse;return n=>{n[0]==="?"&&(n=n.substring(1));const r=hV(n);for(const s in r){const i=r[s];if(typeof i=="string"){if(t&&!bj.test(i))continue;try{r[s]=e(i)}catch{}}}return r}}function yV(e,t){const n=t===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(t&&typeof s=="string"){if(n&&!bj.test(s))return s;try{return t(s),e(s)}catch{}}return s}return s=>{const i=dV(s,r);return i?`?${i}`:""}}const yf="__root__";function kE(e){e.statusCode=e.statusCode||e.code||307;const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function vj(e){return e instanceof Response&&!!e.options}function H0(e){const t=new Map;let n,r;return{get(s){const i=t.get(s);if(i)return i.visited=!0,i.value},set(s,i){const l=t.get(s);if(l){l.value=i;return}if(t.size>=e){let u=n==null?void 0:n.next().value;for(;!u||u.visited;)u?u.visited=!1:n=t.values(),u=n.next().value;u===r&&(n=void 0),t.delete(u.key)}const c={key:s,value:i,visited:!1};r=c,t.set(s,c)},clear(){t.clear(),n=void 0,r=void 0}}}const oa=4,Sj=5;function xV(e){const t=e.names;if(t)return t;const n=[];for(const r of e)typeof r!="string"&&n.push(r[1]);return e.names=n}function bV(e,t,n){const r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,"_splat","",void 0]:[1,r.substring(1),"",""];const s=r.indexOf("{");if(s>=0){const i=r.indexOf("}",s),l=r.charCodeAt(s+1)===45,c=s+(l?3:2);if(i>=0&&r.charCodeAt(c-1)===36&&(!l||c<i)){const u=r.substring(c,i);return[l?3:u?1:2,u||"_splat",r.substring(0,s),e.substring(t+i+1,u?n:e.length)]}}return r}function Kh(e,t,n,r,s,i){var C,T;let l=n;const c=t.fullPath??t.from,u=t.options,d=c.length,h=c.endsWith("/")?d-1:d,m=(u==null?void 0:u.caseSensitive)??e,g=((C=u==null?void 0:u.params)==null?void 0:C.parse)??(u==null?void 0:u.parseParams);let y,b=i?n-1:0;if(!r||c.includes("$")){y=(i==null?void 0:i.slice())??[];const N=Sa(y);N&&typeof N!="string"&&N[0]===2&&(y[y.length-1]=[N[0],N[1],N[2],N[3]===void 0?void 0:N[3]+c.substring(n-(c[n-2]==="/"?2:1),h)],b=d)}for(;l<d;){const N=l,R=c.indexOf("/",N);let M=R===-1?d:R;const D=bV(c,N,M);l=M+1;let k;if(typeof D=="string"){if(!r)continue;let I=D,_;m?_=r.static??(r.static=new Map):(I=D.toLowerCase(),_=r.staticInsensitive??(r.staticInsensitive=new Map));const P=_.get(I);if(P)k=P;else{const H=gc(r);k=H,_.set(I,H)}}else{const I=D[0];let _=D[2],P=D[3]??"";if(I===2&&(M=d,l=M+1),y&&b<M&&(b<N-1&&y.push(c.substring(b,N-1)),D[2]="/"+_,I===2&&D[3]!==void 0&&h<d&&(D[3]=P.slice(0,-1)),y.push(D),b=M),!r)continue;const H=m&&!!(_||P);m||(_=_.toLowerCase(),P=P.toLowerCase());const z=I===1?r.dynamic??(r.dynamic=[]):I===3?r.optional??(r.optional=[]):r.wildcard??(r.wildcard=[]),U=I!==2&&!g&&z.find(j=>!j.parse&&j.caseSensitive===H&&j.prefix===_&&j.suffix===P);if(U)k=U;else{const j=gc(r,I,H,_,P);k=j,z.push(j),z.length===2&&(s==null||s.push(z))}}r=k}y&&b<h&&y.push(c.substring(b,h));const w=y==null?void 0:y.slice();if(!r)return w;if(g&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const N=gc(r,Sj);(r.pathless??(r.pathless=[])).push(N),r=N}const E=(t.path||!t.children)&&!t.isRoot;if(E&&h<d){const N=gc(r,oa);r.index=N,r=N}return r.parse=g??null,r.priority=((T=u==null?void 0:u.params)==null?void 0:T.priority)??0,r.route||(r.data=w,E&&(r.route=t)),[r,l,w]}function wj(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function gc(e,t=0,n,r,s){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function vV(e,t){const n=gc(),r=[];function s(i,l,c,u){const[d,h,m]=Kh(!1,i,l,c,r,u);if(i.children)for(const g of i.children)s(g,h,d,m)}for(const i of e)s(i,1,n);for(const i of r)i.sort(wj);t.masksTree=n,t.flatCache=H0(1e3)}function SV(e,t){e||(e="/");const n=t.flatCache.get(e);if(n!==void 0)return n;const r=ME(e,t.masksTree);return t.flatCache.set(e,r),r}function wV(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let l=s.singleCache.get(i);return l||(l=gc(),Kh(t,{from:e},1,l),s.singleCache.set(i,l)),ME(r,l,n)}function EV(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=ME(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)i=null;else throw l}return i&&(i.branch=Cj(i.route)),t.matchCache.set(r,i),i}function CV(e,t=!1){const n=gc(),r=[],s={},i={};let l=0;function c(u,d,h,m){if(u.init(l),u.id in s&&OE(),s[u.id]=u,l!==0&&u.path){const w=Ji(u.fullPath);(!i[w]||u.fullPath.endsWith("/"))&&(i[w]=u)}l++;const[g,y,b]=Kh(t,u,d,h,r,m);if(u._interpolation=b,u.children)for(const w of u.children)c(w,y,g,b)}c(e,1,n);for(const u of r)u.sort(wj);return{processedTree:{segmentTree:n,singleCache:H0(1e3),matchCache:H0(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function ME(e,t,n=!1){const r=e.split("/"),s=TV(e,r,t,n);if(!s)return null;const[i]=Ej(e,r,s);return{route:s.node.route,rawParams:i}}function Ej(e,t,n){var h,m,g,y;const r=NV(n.node),s=n.node.data&&xV(n.node.data),i=Object.create(null);let l=((h=n.extract)==null?void 0:h.part)??0,c=((m=n.extract)==null?void 0:m.node)??0,u=((g=n.extract)==null?void 0:g.path)??0,d=((y=n.extract)==null?void 0:y.param)??0;for(;c<r.length;l++,c++,u++){const b=r[c];if(b.kind===oa)break;if(b.kind===Sj){l--,u--;continue}const w=t[l],E=u;if(w&&(u+=w.length),b.kind===1||b.kind===3){const C=s[d++];if(b.kind===3&&n.skipped&1<<c){l--,u=E-1;continue}const T=b.suffix||b.prefix?w.substring(b.prefix.length,w.length-b.suffix.length):w;(T||b.kind===1)&&(i[C]=decodeURIComponent(T))}else if(b.kind===2){const C=b,T=e.substring(E+C.prefix.length,e.length-C.suffix.length),N=decodeURIComponent(T);i["*"]=N,i._splat=N;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:l,node:c,path:u,param:d}]}function Cj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function NV(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function TV(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Sa(t),i=s&&e!=="/",l=t.length-(s?1:0),c=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}];let u=null,d=null;for(;c.length;){const h=c.pop(),{node:m,index:g,skipped:y,statics:b,dynamics:w,optionals:E}=h;let{extract:C,rawParams:T}=h;if(m.kind===2&&m.route&&!Dg(d,h))continue;if(m.parse){if(!bk(e,t,h))continue;T=h.rawParams,C=h.extract}r&&m.route&&m.kind!==oa&&Dg(u,h)&&(u=h);const N=g===l;if(N&&(m.route&&(!i||m.kind===oa||m.kind===2)&&Dg(d,h)&&(d=h),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const R=N?void 0:t[g];let M;if(N&&m.index){const D={node:m.index,index:g,skipped:y,statics:b,dynamics:w,optionals:E,extract:C,rawParams:T};let k=!0;if(m.index.parse&&(bk(e,t,D)||(k=!1)),k){if(!w&&!E&&!y&&RV(b,l))return D;Dg(d,D)&&(d=D)}}if(m.wildcard)for(let D=m.wildcard.length-1;D>=0;D--){const k=m.wildcard[D],{prefix:I,suffix:_}=k;if(!(I&&(N||!(k.caseSensitive?R:M??(M=R.toLowerCase())).startsWith(I)))){if(_){if(N)continue;const P=t.slice(g).join("/"),H=P.slice(-_.length);if((k.caseSensitive?H:H.toLowerCase())!==_||P.length-_.length<I.length)continue}c.push({node:k,index:l,skipped:y,statics:b,dynamics:w,optionals:E,extract:C,rawParams:T})}}if(m.optional){const D=y|1<<m.depth+1;for(let k=m.optional.length-1;k>=0;k--){const I=m.optional[k];c.push({node:I,index:g,skipped:D,statics:b,dynamics:w,optionals:E,extract:C,rawParams:T})}if(!N)for(let k=m.optional.length-1;k>=0;k--){const I=m.optional[k],{prefix:_,suffix:P}=I;if(_||P){const H=I.caseSensitive?R:M??(M=R.toLowerCase());if(_&&!H.startsWith(_)||P&&H.indexOf(P,H.length-P.length)<_.length)continue}c.push({node:I,index:g+1,skipped:y,statics:b,dynamics:w,optionals:E+_g(l,g),extract:C,rawParams:T})}}if(!N&&m.dynamic&&R)for(let D=m.dynamic.length-1;D>=0;D--){const k=m.dynamic[D],{prefix:I,suffix:_}=k;if(I||_){const P=k.caseSensitive?R:M??(M=R.toLowerCase());if(I&&!P.startsWith(I)||_&&P.indexOf(_,P.length-_.length)<I.length)continue}c.push({node:k,index:g+1,skipped:y,statics:b,dynamics:w+_g(l,g),optionals:E,extract:C,rawParams:T})}if(!N&&m.staticInsensitive){const D=m.staticInsensitive.get(M??(M=R.toLowerCase()));D&&c.push({node:D,index:g+1,skipped:y,statics:b+_g(l,g),dynamics:w,optionals:E,extract:C,rawParams:T})}if(!N&&m.static){const D=m.static.get(R);D&&c.push({node:D,index:g+1,skipped:y,statics:b+_g(l,g),dynamics:w,optionals:E,extract:C,rawParams:T})}if(m.pathless)for(let D=m.pathless.length-1;D>=0;D--){const k=m.pathless[D];c.push({node:k,index:g,skipped:y,statics:b,dynamics:w,optionals:E,extract:C,rawParams:T})}}if(d)return d;if(r&&u){let h=u.index;for(let g=0;g<u.index;g++)h+=t[g].length;const m=h===e.length?"/":e.slice(h);return u.rawParams??(u.rawParams=Object.create(null)),u.rawParams["**"]=decodeURIComponent(m),u}return null}function _g(e,t){return 2**(e-t-1)}function RV(e,t){return e===2**(t-1)-1}function bk(e,t,n){let r,s;try{[r,s]=Ej(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Dg(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===oa)>(e.node.kind===oa)||t.node.kind===oa==(e.node.kind===oa)&&t.node.depth>e.node.depth))):!0}function OV(e,t,n){const r=xj(e),s=`/${r}`,i=t?s:s.toLowerCase(),l=`${i}/`,c={input:({url:u})=>{const d=t?u.pathname:u.pathname.toLowerCase();return d===i?u.pathname="/":d.startsWith(l)&&(u.pathname=u.pathname.slice(s.length)),u},output:({url:u})=>(u.pathname=mf(`/${r}${u.pathname}`),u)};return n?{input:({url:u})=>H1(n,c.input({url:u})),output:({url:u})=>c.output({url:Nj(n,u)})}:c}function H1(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Nj(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function kV(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s}=t,i=new Map,l=n("idle"),c=n(e),u=n(void 0),d=n([]),h=r(()=>d.get().map(w=>i.get(w).get())),m=r(()=>({status:l.get(),isLoading:l.get()==="pending",matches:h.get(),location:c.get(),resolvedLocation:u.get()}));function g(w){let E=i.get(w);return E||(E=n(void 0),i.set(w,E)),E}const y={status:l,location:c,resolvedLocation:u,ids:d,matches:h,byRoute:i,__store:m,getMatchStore:g,setMatches:b};function b(w){const E=d.get(),C=w.map(T=>T.routeId);s(()=>{tV(E,C)||d.set(C);for(const T of E)C.includes(T)||i.get(T).set(()=>{});for(const T of w){const N=g(T.routeId);N.get()!==T&&N.set(T)}})}return y}var da="__TSR_index",vk="popstate",Sk="beforeunload",MV=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function y0(e){const t=MV.exec(e);return t?"/"+e.slice(t[0].length):e}function Tj(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,t=>`
51
- \r`.includes(t)?"":encodeURIComponent(t))),y0(e)}function AV(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},i=async({task:l,navigateOpts:c,...u})=>{var m,g;if((c==null?void 0:c.ignoreBlocker)??!1){l();return}const d=((m=e.getBlockers)==null?void 0:m.call(e))??[],h=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const y of d){const b=F0(u.path,u.state);if(await y.blockerFn({currentLocation:t,nextLocation:b,action:u.type})){(g=e.onBlocked)==null||g.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,u)=>{const d=t.state[da];c=wk(d+1,c),i({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:l,state:c})},replace:(l,c,u)=>{const d=t.state[da];c=wk(d,c),i({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:l,state:c})},go:(l,c)=>{i({task:()=>{e.go(l,(c==null?void 0:c.ignoreBlocker)??!1),s({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{i({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{i({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[da]!==0,createHref:l=>e.createHref(l),block:l=>{var u;if(!e.setBlockers)return()=>{};const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];return e.setBlockers([...c,l]),()=>{var h,m;const d=((h=e.getBlockers)==null?void 0:h.call(e))??[];(m=e.setBlockers)==null||m.call(e,d.filter(g=>g!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:r,_getBlockers:()=>{var l;return((l=e.getBlockers)==null?void 0:l.call(e))??[]}}}function wk(e,t){const n=AE();return{...t,key:n,__TSR_key:n,[da]:e}}function _V(e){var k,I;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,l=_=>s=_,c=_=>Tj(_),u=(()=>F0(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((k=t.history.state)!=null&&k.__TSR_key)&&!((I=t.history.state)!=null&&I.key)){const _=AE();t.history.replaceState({[da]:0,key:_,__TSR_key:_},"")}let d=u(),h,m=!1,g=!1,y=!1,b=!1;const w=()=>d;let E;const C=()=>{E&&(D._ignoreSubscribers=!0,(E[2]?t.history.pushState:t.history.replaceState)(E[1],"",E[0]),D._ignoreSubscribers=!1,E=void 0,h=void 0)},T=(_,P,H)=>{const z=!!E;z||(h=d),d=F0(P,H),E=[d.href,H,(E==null?void 0:E[2])||_],z||queueMicrotask(()=>C())},N=_=>{d=u(),D.notify({type:_})},R=async()=>{if(b=!1,g){g=!1;return}const _=u(),P=_.state[da]-d.state[da],H=P===1,z=P===-1,U=!H&&!z||m;m=!1;const j=U?"GO":z?"BACK":"FORWARD",B=U?{type:"GO",index:P}:{type:z?"BACK":"FORWARD"};if(y)y=!1;else{const L=i();if(typeof document<"u"&&L.length){for(const $ of L)if(await $.blockerFn({currentLocation:d,nextLocation:_,action:j})){g=!0,t.history.go(-P),D.notify(B);return}}}d=u(),D.notify(B)},M=_=>{if(b){b=!1;return}let P=!1;const H=i();if(typeof document<"u"&&H.length)for(const z of H){const U=z.enableBeforeUnload??!0;if(U===!0){P=!0;break}if(typeof U=="function"&&U()===!0){P=!0;break}}if(P)return _.preventDefault(),_.returnValue=""},D=AV({getLocation:w,getLength:()=>t.history.length,pushState:(_,P)=>T(!0,_,P),replaceState:(_,P)=>T(!1,_,P),back:_=>(_&&(y=!0,b=!0),t.history.back()),forward:_=>{_&&(y=!0,b=!0),t.history.forward()},go:(_,P)=>{m=!0,P&&(y=!0,b=!0),t.history.go(_)},createHref:_=>c(_),flush:C,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Sk,M,{capture:!0}),t.removeEventListener(vk,R)},onBlocked:()=>{h&&d!==h&&(d=h)},getBlockers:i,setBlockers:l,notifyOnIndexChange:!1});return D._ignoreNextBeforeUnload=_=>{b=!1;try{_=new URL(_,t.document.baseURI).href,b=/^https?:/.test(_)&&(!_.includes("#")||_.split("#")[0]!==t.location.href.split("#")[0])}catch{}},t.addEventListener(Sk,M,{capture:!0}),t.addEventListener(vk,R),t.history.pushState=function(..._){const P=n.apply(t.history,_);return D._ignoreSubscribers||N("PUSH"),P},t.history.replaceState=function(..._){const P=r.apply(t.history,_);return D._ignoreSubscribers||N("REPLACE"),P},D}function F0(e,t){const n=Tj(e),r=n.indexOf("#"),s=n.indexOf("?");if(!t){const i=AE();t={[da]:0,key:i,__TSR_key:i}}return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t}}function AE(){return(Math.random()+1).toString(36).substring(7)}function hS(e,t){return e.protocol!=="http:"&&e.protocol!=="https:"||e.origin!==t||!!e.username||!!e.password}function pS(e){return e.pathname+e.search+e.hash}function Ek(e){var t,n;return e.options.loader||e.options.beforeLoad||e.lazyFn||((t=e.options.component)==null?void 0:t.preload)||((n=e.options.pendingComponent)==null?void 0:n.preload)}function jy(e,t){return{fromLocation:t,toLocation:e,pathChanged:(t==null?void 0:t.pathname)!==e.pathname,hrefChanged:(t==null?void 0:t.href)!==e.href,hashChanged:(t==null?void 0:t.hash)!==e.hash}}function Ck({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...s}){return s}function DV(e){return e.findIndex(t=>t.status==="error"||t.status==="notFound"||t._notFound)+1}function IV(e,t,n,r,s,i){var l,c,u,d;r&&(t=t.slice(0,r)),s&&(n=n.slice(0,s));for(const h of t){if(i&&e._tx!==i)return;n.some(m=>m.routeId===h.routeId)||(c=(l=e.routesById[h.routeId].options).onLeave)==null||c.call(l,h)}for(const h of n){if(i&&e._tx!==i)return;(d=(u=e.routesById[h.routeId].options)[t.some(m=>m.routeId===h.routeId)?"onStay":"onEnter"])==null||d.call(u,h)}}var jV=class{constructor(e,t){var n;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async r=>(r(),!1),this.update=r=>{const s=this.options;this.options={...s,...r},this.isServer=this.options.isServer??fk??typeof document>"u",this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=_V()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost");const i=this.options.basepath??"/",l=this.options.rewrite,c=this.basepath!==i||(s==null?void 0:s.rewrite)!==l||(s==null?void 0:s.caseSensitive)!==this.options.caseSensitive;if(c&&(this.basepath=i,this.rewrite=i!=="/"&&xj(i)?OV(i,this.options.caseSensitive,l):l),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree||fk){this.routeTree=this.options.routeTree;let u;u=this.buildRouteTree(),this.setRoutes(u)}if(this.stores)c&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=kV(this.latestLocation,u),fV(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=CV(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&vV(this.options.routeMasks,r.processedTree),{...r,resolvePathCache:H0(1e3)}},this.subscribe=(r,s)=>{const i={eventType:r,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=r=>{for(const s of this.subscribers)if(s.eventType===r.type)try{s.fn(r)}catch(i){console.error(i)}},this.parseLocation=(r,s)=>{const i=({pathname:d,search:h,hash:m,href:g},y)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const C=this.options.parseSearch(h),T=this.options.stringifySearch(C);return{href:d+T+m,publicHref:d+T+m,pathname:uh(d),external:!1,searchStr:T,search:Zu(s==null?void 0:s.search,C),hash:uh(m.slice(1)),state:fa(s==null?void 0:s.state,y)}}const b=H1(this.rewrite,new URL(g,this.origin)),w=this.options.parseSearch(b.search),E=this.options.stringifySearch(w);return b.search=E,{href:b.href.replace(b.origin,""),publicHref:g,pathname:uh(y0(b.pathname)),external:!!this.rewrite&&hS(b,this.origin),searchStr:E,search:Zu(s==null?void 0:s.search,w),hash:uh(b.hash.slice(1)),state:fa(s==null?void 0:s.state,y)}},l=i(r,r.state),{__tempLocation:c,__tempKey:u}=l.state;if(c&&(!u||u===this.tempLocationKey)){const d=i(c,{...c.state,__tempLocation:void 0,key:l.state.key,__TSR_key:l.state.__TSR_key});return d.maskedLocation=l,d}return l},this.matchRoutes=(r,s,i)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:s},i):this.matchRoutesInternal(r,s),this.getMatchedRoutes=r=>{const s=Object.create(null),i=EV(Ji(r),this.processedTree,!0);return i&&Object.assign(s,i.rawParams),[(i==null?void 0:i.branch)||[this.routesById.__root__],s,i==null?void 0:i.route]},this.buildLocation=r=>{{const c=this.staticLocations.get(r);if(c)return c}let s=!1;const i=(c={})=>{var B;if(c.href){const L=F0(c.href,{});c={...c,to:H1(this.rewrite,new URL(L.pathname,this.origin)).pathname,search:this.options.parseSearch(L.search),hash:L.hash.slice(1)}}const u=c._fromLocation||this._pendingLocation||this.latestLocation;let d;const h=()=>(s=!0,u),m=()=>(s=!0,d??(d=this.matchRoutesLightweight(u))),g=c.to?`${c.to}`:".",y=mk(g[0]==="/"?"":c.unsafeRelative==="path"?h().pathname:c.from??m()[1],g,this.options.trailingSlash,this.resolvePathCache),b=this.routesByPath[Ji(y)],w=y.includes("$");let E;if(b)E=b._branch??(b._branch=Cj(b));else if(w)E=[];else{const[L,$,q]=this.getMatchedRoutes(y);E=L,this.options.notFoundRoute&&(!q||q.path!=="/"&&$["**"])&&(E=[...E,this.options.notFoundRoute])}const C=w?(b==null?void 0:b._interpolation)??Kh(!1,{fullPath:y},0):void 0;let T;for(const L of E){const $=((B=L.options.params)==null?void 0:B.stringify)??L.options.stringifyParams;if($){const q=m()[3];if(T??(T=mS(c.params,q)),!pj(T))break;T===q&&(T=Object.assign(m0(),T));try{Object.assign(T,$(T))}catch{}}}T??(T=mS(c.params,PV(c.params,C)?m()[3]:gS));const N=r.leaveParams?y:y0(uh(C?gk(y,C,T,this.pathParamsDecoder):y)),R=zV(E,r._includeValidateSearch),M=()=>{var $;let L=m()[2];if(r._includeValidateSearch&&(($=this.options.search)!=null&&$.strict)){const q={};E.forEach(G=>{if(G.options.validateSearch)try{Object.assign(q,x0(G.options.validateSearch,{...q,...L}))}catch{}}),L=q}return L},D=R.length?BV(R,M(),c):c.search===!0?M():typeof c.search=="function"?c.search(M()):c.search||gS,k=this.options.stringifySearch(D),I=c.hash===!0?h().hash:typeof c.hash=="function"?c.hash(h().hash):c.hash||void 0,_=I?`#${I}`:"",P=c.state?c.state===!0?h().state:typeof c.state=="function"?c.state(h().state):c.state:gS,H=`${N}${k}${_}`;let z,U,j=!1;if(this.rewrite){const L=new URL(H,this.origin),$=L.origin,q=Nj(this.rewrite,L);z=pS(L),hS(q,$)?(U=q.href,j=!0):U=y0(pS(q))}else z=eV(H),U=z;return{publicHref:U,href:z,pathname:N,search:D,searchStr:k,state:P,hash:I??"",external:j,unmaskOnReload:c.unmaskOnReload}},l=i(r);if(r.mask)l.maskedLocation=i({from:r.from,...r.mask});else if(this.options.routeMasks){const c=SV(l.pathname,this.processedTree);if(c){const u=Object.assign(m0(),c.rawParams),{from:d,params:h,...m}=c.route,g=mS(h,u);l.maskedLocation=i({from:r.from,...m,params:g})}}return!s&&r._fromLocation&&!l.maskedLocation&&this.staticLocations.set(r,l),l},this.commitLocation=async({viewTransition:r,ignoreBlocker:s,...i})=>{const l=i.maskedLocation??i;if(l.external)return Nk(this,l.publicHref,{replace:i.replace,ignoreBlocker:s});let c;const u=Ji(this.latestLocation.href)===Ji(i.href)&&qo(Ck(i.state),Ck(this.latestLocation.state)),d=this._commitPromise;let h;const m=new Promise(g=>{h=g});if(m.resolve=()=>{h(),d==null||d.resolve()},this._commitPromise=m,u)this.load();else{let{maskedLocation:g,hashScrollIntoView:y,...b}=i;g&&(b={...g,state:{...g.state,__tempKey:void 0,__tempLocation:{...b,search:b.searchStr,state:{...b.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(b.unmaskOnReload??this.options.unmaskOnReload??!1)&&(b.state.__tempKey=this.tempLocationKey)),b.state={...b.state,__hashScrollIntoViewOptions:y??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=r,c=i.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](b.publicHref,b.state,{ignoreBlocker:s}),this.history.subscribers.size||this.load({action:{type:c}})}return this._scroll.next=i.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:r,resetScroll:s,hashScrollIntoView:i,viewTransition:l,ignoreBlocker:c,...u}={})=>{const d=this.buildLocation({...u,_includeValidateSearch:!0});this._pendingLocation=d;const h=this.commitLocation({...d,viewTransition:l,replace:r,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:c});return queueMicrotask(()=>{this._pendingLocation===d&&(this._pendingLocation=void 0)}),h},this.navigate=async({to:r,reloadDocument:s,href:i,publicHref:l,...c})=>{const u=i?Gh(i):void 0;if(u||s){if(r!==void 0||!i){const h=this.buildLocation({to:r,...c}),m=h.maskedLocation??h;i??(i=m.publicHref),l??(l=m.publicHref)}return Nk(this,!u&&l?l:i,c)}return this.buildAndCommitLocation({...c,href:i,to:r,_isNavigate:!0})},this.load=async r=>{this.updateLatestLocation(),r!=null&&r.action&&(this._scroll.hash=r.action.type==="PUSH"||r.action.type==="REPLACE"),await YV(this,r)},this.startViewTransition=r=>{var i,l;const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document.startViewTransition=="function"){let c;if(typeof s=="object"&&((l=(i=window.CSS)==null?void 0:i.supports)!=null&&l.call(i,"selector(:active-view-transition-type(a))"))){const u=this.latestLocation,d=this.stores.resolvedLocation.get(),h=typeof s.types=="function"?s.types(jy(u,d)):s.types;if(h===!1)return r();c={update:r,types:h}}else c=r;return document.startViewTransition(c).updateCallbackDone}return r()},this.invalidate=r=>{var m,g;const s=this._committed,i=r==null?void 0:r.filter,l=this._preloads,c=new Set,u=y=>{(!i||i(y))&&c.add(y.id)};s.forEach(u),this._cache.forEach(u),l==null||l.forEach(y=>y.forEach(u)),(m=this._tx)==null||m[3].forEach(u);const d=[];for(const[y,b]of l??[])b.some(w=>c.has(w.id))&&(l.delete(y),d.push(y));const h=y=>{if(c.has(y.id)){const b=this.routesById[y.routeId],w={...y,invalid:!0,...(r!=null&&r.forcePending||y.status==="error"||y.status==="notFound")&&Ek(b)?{status:"pending",error:void 0}:void 0};return y._flight=void 0,w}return y};this._committed=s.map(h);for(const[y,b]of this._cache)c.has(y)&&(b.invalid=!0,r!=null&&r.forcePending&&(b.status="pending"));for(const y of c)(g=this._flights)==null||g.delete(y);for(const y of d)y.abort();return this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.resolveRedirect=r=>{const s=r.options;let i=r.headers.get("Location")||s.href;if(!i){const c=this.buildLocation(s);i=(c.maskedLocation??c).publicHref||"/"}let l;if(mj.test(i)||(l=Gh(i))&&!this.protocolAllowlist.has(l))throw new Error("Redirect blocked: unsafe protocol");if(l==="http:"||l==="https:"){const c=new URL(i);c.pathname.startsWith("//")?i=c.href:hS(c,this.origin)||(i=pS(c),l=void 0)}return l&&(s.reloadDocument=!0),s.href=i,r.headers.set("Location",i),r},this.clearCache=r=>{var h;const s=this._cache,i=this._preloads,l=r==null?void 0:r.filter,c=[],u=[];for(const[m,g]of s)(!l||l(g))&&(u.push(m),c.push(g));const d=[];for(const[m,g]of i??[])(!l||g.some(l))&&(d.push(m),c.push(...g));for(const m of u)s.delete(m);for(const m of d)i.delete(m);for(const m of c){const g=m._flight;m._flight=void 0,g&&!--g[2]&&(((h=this._flights)==null?void 0:h.get(m.id))===g&&this._flights.delete(m.id),d.push(g[1]))}for(const m of d)m.abort()},this.loadRouteChunk=xf,this.preloadRoute=r=>WV(this,r),this.matchRoute=(r,s)=>{const i={...r,to:r.to?mk(r.from||"",r.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:r.params||{},leaveParams:!0},l=this.buildLocation(i),c=this.stores.status.get()==="pending";if(s!=null&&s.pending&&!c)return!1;const u=(s==null?void 0:s.pending)??!c?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=wV(l.pathname,(s==null?void 0:s.caseSensitive)??!1,(s==null?void 0:s.fuzzy)??!1,u.pathname,this.processedTree);return!d||r.params&&!qo(d.rawParams,r.params,!0)?!1:(s==null?void 0:s.includeSearch)??!0?qo(u.search,l.search,!0)?d.rawParams:!1:d.rawParams},this.getStoreConfig=t,(n=e.pathParamsAllowedCharacters)!=null&&n.length&&(this.pathParamsDecoder=nV(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??mV,parseSearch:e.parseSearch??pV,protocolAllowlist:e.protocolAllowlist??J$}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;const t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Kh(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){var g,y;const[n,r,s]=this.getMatchedRoutes(e.pathname);let i=n,l=!1;(s?s.path!=="/"&&r["**"]:Ji(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?HV(this.options.notFoundMode,i):void 0,u=new Array(i.length),d=this._committed,h=(b,w)=>{const E=d[w];return(E==null?void 0:E.routeId)===b.id?E:b===this.options.notFoundRoute?d.find(C=>C.routeId===b.id):void 0};let m;for(let b=0;b<i.length;b++){const w=i[b],E=u[b-1];let C,T,N;{const B=(E==null?void 0:E.search)??e.search,L=(E==null?void 0:E._strictSearch)??void 0;try{const $=x0(w.options.validateSearch,{...B})??void 0;C={...B,...$},T={...L,...$}}catch($){let q=$;if($ instanceof $0||(q=new $0($.message,{cause:$})),t!=null&&t.throwOnError)throw q;C=B,T={},N=q}}let R="",M="";try{R=((y=(g=w.options).loaderDeps)==null?void 0:y.call(g,{search:C}))??"",M=R&&JSON.stringify(R)||""}catch(B){if(t!=null&&t.throwOnError)throw B;N??(N=B)}const D=m0(),k=w._interpolation?gk(w.fullPath,w._interpolation,r,this.pathParamsDecoder,D):w.fullPath,I=w.id+k+M,_=h(w,b),P=this._cache.get(I)??((_==null?void 0:_.id)===I?_:void 0);m=(P==null?void 0:P._strictParams)??Object.assign(D,m);let H;if(!P)try{Tk(w,m)}catch(B){if(Hf(B)||vj(B)?H=B:H=new LV(B.message,{cause:B}),t!=null&&t.throwOnError)throw H}const z=_?"stay":"enter";let U;if(P)U={...P,cause:z,search:Zu(_?_.search:P.search,C),_strictSearch:T,searchError:N};else{const B=Ek(w)?"pending":"success";U={id:I,ssr:w.options.ssr,index:b,routeId:w.id,params:(_==null?void 0:_.params)??m,_strictParams:m,pathname:k,updatedAt:Date.now(),search:_?Zu(_.search,C):C,_strictSearch:T,searchError:N,status:B,isFetching:!1,error:void 0,paramsError:H,context:{},abortController:(t==null?void 0:t._controller)??new AbortController,cause:z,loaderDeps:_?fa(_.loaderDeps,R):R,invalid:!1,preload:!1,staticData:w.options.staticData||{},fullPath:w.fullPath}}const j=c===w.id;U._notFound&&!j&&(U.error=void 0),U._notFound=j,u[b]=U}for(let b=0;b<u.length;b++){const w=u[b];w.params=w.cause==="stay"?Zu(w.params,m):m,t!=null&&t._controller&&(w.context={})}return u}matchRoutesLightweight(e){const t=Sa(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n==null?void 0:n.id,s=this.lightweightCache.get(e);if(s&&s[0]===r)return s[1];const[i,l]=this.getMatchedRoutes(e.pathname),c=Sa(i),u={...e.search};for(const g of i)try{Object.assign(u,x0(g.options.validateSearch,u))}catch{}const d=n&&n.routeId===c.id&&n.pathname===e.pathname;let h;if(d)h=n.params;else{const g=l;for(const y of i)try{Tk(y,g)}catch{}h=g}const m=[i,c.fullPath,u,h];return this.lightweightCache.set(e,[r,m]),m}};async function Nk(e,t,{replace:n,ignoreBlocker:r}){var s,i;if(!gj(t,e.protocolAllowlist)){if(!r){const l=e.history._getBlockers();for(const c of l)if(c!=null&&c.blockerFn&&await c.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?"REPLACE":"PUSH"}))return}(i=(s=e.history)._ignoreNextBeforeUnload)==null||i.call(s,t),n?window.location.replace(t):window.location.href=t}}var $0=class extends Error{},LV=class extends Error{};function x0(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new $0("Async validation not supported");if(n.issues)throw new $0(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function mS(e,t){if(e===void 0||e===!0)return t;const n=Object.create(null);return e===!1||e===null?n:typeof e=="function"?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function PV(e,t){return typeof e=="function"?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(n=>typeof n!="string"&&!RE.call(e,n[1]))}const gS=Object.freeze({});function zV(e,t){var r;const n=[];for(let s=0;s<e.length;s++){const i=e[s].options;if("search"in i)(r=i.search)!=null&&r.middlewares&&n.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){const c=({search:u,next:d})=>{const h=d(i.preSearchFilters?i.preSearchFilters.reduce((m,g)=>g(m),u):u);return i.postSearchFilters?i.postSearchFilters.reduce((m,g)=>g(m),h):h};n.push(c)}const l=i.validateSearch;if(t&&l){const c=({search:u,next:d,meta:h})=>{const m=d(u);try{const g=x0(l,m);if(h&&g)for(const y in g)y in m||(h.defaulted||(h.defaulted=new Map)).set(y,g[y]);return{...m,...g}}catch{}return m};n.push(c)}}return n}function BV(e,t,n){const r=(s,i,l)=>{if(s>=e.length){if(!n.search)return{};if(n.search===!0)return i;const u=hj(n.search,i);return l&&(l.explicit=u),u}const c=(u,d)=>{if(d){const h=l||{};return{search:r(s+1,u,h),meta:h}}return r(s+1,u,l)};return e[s]({search:i,next:c,meta:l})};return r(0,t)}function HV(e,t){if(e!=="root"){let n;for(let r=t.length-1;r>=0;r--){const s=t[r];if(s.options.notFoundComponent)return s.id;n||(n=s.children&&s.id)}if(n)return n}return yf}function Tk(e,t){var r;const n=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;n&&Object.assign(t,n(t))}function F1(e,t){var n,r;return(r=(n=e.options[t])==null?void 0:n.preload)==null?void 0:r.call(n)}function FV(e,t){const n=F1(e,"component");let r=F1(e,"pendingComponent");return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function xf(e,t,n){const r=()=>t===!1?void 0:t?F1(e,t):FV(e,n),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(l=>{{const{id:c,...u}=l.options;Object.assign(e.options,u),e._lazy=!0}},l=>{throw e._lazy=void 0,l});return e._lazy=i,i.then(r)}function _E(e){const t=e.findIndex(n=>n.status!=="success"||n._notFound)+1;return t&&t<e.length?e.slice(0,t):e}const to=0,Go=1,Ly=2,Qr=3,wa=[4];function Yh(e){return typeof e[0]=="number"}function Jc(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{const s=()=>r(t);t.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener("abort",s))})}function eu(e,t){return e.routesById[t.routeId]}function Wh(e,t,n){return vj(e)?[Qr,e]:Hf(e)?(e.routeId||(e.routeId=n),[Ly,e]):t?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Go,e]):[to,e]}function DE(e,t){var r,s;let n=Wh(t,!0,e.id);if(n[0]!==Go)return n;try{(s=(r=e.options).onError)==null||s.call(r,n[1])}catch(i){n=Wh(i,!0,e.id)}return n}function jh(e,t,n,r,s){return s[0].signal.aborted?wa:LE(e,t,n,DE(n,r),s)}async function $V(e,t,n,r,s,i){var h,m;const[l,c]=t,u=n[0].signal,d=!!n[3];for(let g=n[6]??0;g<r;g++){const y=c[g],b=eu(e,y);y.abortController=n[0];const w=((h=c[g-1])==null?void 0:h.context)??e.options.context??{},E={params:y.params,location:l,navigate:R=>e.navigate({...R,_fromLocation:l}),buildLocation:e.buildLocation,cause:d?"preload":y.cause,abortController:n[0],preload:d,matches:c,routeId:b.id};try{const R=y._ctx||(y._ctx=b.options.context?b.options.context({...E,deps:y.loaderDeps,context:w})||{}:void 0);y.context={...w,...R}}catch(R){return Ho(e,y),[g,jh(e,t,b,R,n)]}if(u.aborted)return[g,wa];const C=y.paramsError??y.searchError;if(C!==void 0)return Ho(e,y),[g,jh(e,t,b,C,n)];const T=b.options.beforeLoad;if(!T)continue;const N=y.status;g>=i&&(y.status="pending",(m=n[7])==null||m.call(n));try{Xh(e,y,"beforeLoad",n[0]);const R=T({...E,search:y.search,context:y.context,...e.options.additionalContext}),M=await(typeof(R==null?void 0:R.then)=="function"?Jc(R,u):R);if(u.aborted)return[g,wa];const D=LE(e,t,b,Wh(M,!1,b.id),n);if(D[0]!==to)return Ho(e,y),[g,D];y.context={...y.context,...M}}catch(R){return Ho(e,y),[g,jh(e,t,b,R,n)]}finally{y.status=N,Xh(e,y,!1,n[0])}}s()}function IE(e,t,n){var r;if(!(!n||--n[2])){if(((r=e._flights)==null?void 0:r.get(t.id))===n){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(t)&&s[3].some(i=>i.id===t.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(t.id)}return n[1]}}function Ho(e,t){var r;const n=t._flight;t._flight=void 0,(r=IE(e,t,n))==null||r.abort()}function hs(e,t,n,r){var i;const s=[];for(const l of t)if(!(n!=null&&n.includes(l))){const c=l._flight;if(l._flight=void 0,r&&(c==null?void 0:c[2])===1&&((i=e._flights)==null?void 0:i.get(l.id))===c&&(n!=null&&n.some(u=>u.id===l.id)))c[2]=0;else{const u=IE(e,l,c);u&&s.push(u)}}for(const l of s)l.abort()}function jE(e){for(const t of e){const n=t._flight;n&&n[2]++}}function Xh(e,t,n,r){var l;if(t.isFetching=n,r&&((l=e._tx)==null?void 0:l[0])!==r)return;const s=e.stores.byRoute.get(t.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===t.id&&s.set({...i,isFetching:n})}function Rj(e,t,n,r,s,i,l){const c=t[0];return{params:n.params,location:c,navigate:u=>e.navigate({...u,_fromLocation:c}),cause:l?"preload":n.cause,abortController:s,preload:l,deps:n.loaderDeps,parentMatchPromise:i,context:n.context,route:r,...e.options.additionalContext}}async function Rk(e,t,n,r,s,i,l){const c=l[0],u=c.signal;if(u.aborted)return wa;if(!s)return[to,void 0];let d=n._flight;Xh(e,n,"loader",c);try{if(!d){const h=new AbortController;d=[Promise.resolve().then(()=>s(Rj(e,t,n,r,h,i,!!l[3]))).then(m=>Wh(m,!1,r.id),m=>Wh(m,!0,r.id)).then(m=>{var g;return m[0]!==to&&((g=e._flights)==null?void 0:g.get(n.id))===d&&(e._flights.delete(n.id),d[2]||h.abort()),m[0]===Go&&d[2]?DE(r,m[1]):m}),h,1],(e._flights??(e._flights=new Map)).set(n.id,d)}return n._flight=d,n.abortController=d[1],LE(e,t,r,await Jc(d[0],u),l)}catch(h){if(h!==u||!u.aborted)throw h;return Ho(e,n),wa}finally{Xh(e,n,!1,c)}}function Ok(e,t,n){t[0]!==Qr&&(e.status="success",e.error=void 0,t[0]===to?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function VV(e,t,n){const r=e._cache.get(t.id);if(r!==n||e._committed.some(i=>i.id===t.id&&i._flight===t._flight))return;const s={...t,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(t.id,s),r&&Ho(e,r)}function kk(e,t){return t[0]===Go||t[0]===Ly?{...e,status:t[0]===Go?"error":"notFound",error:t[1],_flight:void 0}:e}function UV(e,t,n,r,s,i,l){var z,U;const c=t[1][n],u=eu(e,c),d=!!i[3],h=e._cache.get(c.id);let m,g=!1,y;try{if(c.status==="success"&&(m=u.options.shouldReload,typeof m=="function"&&(m=m(Rj(e,t,c,u,i[0],s,d))),i[0].signal.aborted&&(y=wa)),!y)if(c.status!=="success")g=!0;else{const j=d||c.preload?u.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.options.defaultStaleTime??0;g=!!(c.invalid||m||m===void 0&&Date.now()-c.updatedAt>=j&&(i[5]||c.cause==="enter"||i[2].some(B=>B.routeId===c.routeId&&B.id!==c.id)))}}catch(j){c.invalid=!0,Ho(e,c),y=jh(e,t,u,j,i)}const b=u.options.loader,w=typeof b=="function",E=w?b:b==null?void 0:b.handler,C=!d||u.options.preload!==!1;let T=C&&b?(z=e._flights)==null?void 0:z.get(c.id):void 0;T===c._flight||y?T=void 0:T&&!g&&!d&&m===void 0?g=!0:g||(T=void 0);const N=!!(b&&g&&c.status==="success"&&!d&&!i[4]&&((w?void 0:b.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),R=g&&C,M=R&&!N&&(c.status!=="success"||!!b),D=n>=l?i[7]:void 0,k=u.lazyFn&&u._lazy!==!0?D:void 0;if(R&&!b&&(c.invalid=!1,c.updatedAt=Date.now()),T&&T[2]++,M){const j=c._flight;c._flight=T,(U=IE(e,c,j))==null||U.abort(),n>=l&&(c.status="pending"),D==null||D()}R||(c.isFetching=!1);const I=!y&&M?Rk(e,t,c,u,E,s,i).then(j=>(Ok(c,j,d),j[0]===to&&(b&&!i[0].signal.aborted&&VV(e,c,h),n>=l&&(c.status="pending")),j)):Promise.resolve(y??[to,c.loaderData]),_=(async()=>{try{const B=xf(u,void 0,k);B&&await Jc(B,i[0].signal)}catch(B){if(!t[1].some((L,$)=>$<=n&&(L.status==="error"||L.status==="notFound"||L._notFound)))return[n,jh(e,t,u,B,i)]}const j=await I;M&&j[0]===to&&c.status==="pending"&&!i[0].signal.aborted&&(c.status="success",D==null||D())})();if(r.push([n,I,_]),!N)return I.then(j=>kk(c,j));const P={...c,status:"pending",preload:!1,_flight:T};c.invalid=!1,c.isFetching="loader";const H=Rk(e,t,P,u,E,s,i).then(j=>(c.isFetching=!1,Ok(P,j,!1),j));return(t[2]??(t[2]=[])).push([n,H,_,P]),H.then(j=>kk(P,j))}async function $1(e,t,n,r,s=0){const i=n==null?void 0:n[1][1];let l=i!=null&&i.routeId?t.findIndex(c=>c.routeId===i.routeId):(n==null?void 0:n[0])??t.length-1;l<0&&(l=0);for(let c=l;c>=0;c--){const u=eu(e,t[c]);try{const d=xf(u,!1);d&&await Jc(d,r)}catch(d){if(d===r&&r.aborted)throw d}if(u.options.notFoundComponent)return c}return i!=null&&i.routeId?l:s}function Ac(e,t){t[2]&&(hs(e,t[2].map(n=>n[3])),t[2]=void 0)}async function Mk(e,t,n,r){let s;try{await Promise.all(e.map(i=>i[1].then(async l=>{const c=i[0];if(!(r&&c>=await r)){if(l[0]>=Qr)throw[c,l];!s&&l[0]!==to&&(s=[c,l],await Promise.all((n??[]).map(u=>{if(!(u[0]<=c))return u[1].then(d=>{if(d[0]===Qr)throw[u[0],d]})})))}})))}catch(i){return i}return t??s}function LE(e,t,n,r,s,i){for(;r[0]===Qr;){const l=r[1],c=l.options;try{if((c.href||l.headers.has("Location"))&&(e.resolveRedirect(l),c.reloadDocument)||(c.reloadDocument?s[3]:s[1]>=20))return r;const u=e.buildLocation({...c,_fromLocation:t[0],_includeValidateSearch:!0}),d=u.maskedLocation??u;if(d.external){const h=l.clone();return h.options={...c},h.headers.set("Location",d.publicHref),e.resolveRedirect(h),s[3]?[Qr,h]:[Qr,h,d]}return[Qr,l,u]}catch(u){r=i?[Go,u]:DE(n,u),i=!0}}return r}async function Oj(e,t,n,r,s,i){const l=t[1];let c=await s,u=!1;const d=l.findIndex(y=>y._notFound),h=y=>y[1][0]===Ly?$1(e,l,y,r.signal):y[0];let m=d<0?l.length:d;if(((c==null?void 0:c[1][0])??0)>=Qr)m=0;else if(c){m=c[2]??(c[2]=await h(c));for(const y of n){if(y[0]>=m)break;const b=await y[1];if(b[0]!==to&&b[0]<Qr&&!("loaderData"in l[y[0]])){c=[y[0],b],m=c[2]=await h(c);break}}}for(const y of n){if(y[0]>=m)break;const b=await y[2];if(b){c=b;break}}if(((c==null?void 0:c[1][0])??0)>=Qr){const y=c[1];if(y[0]!==Qr||y[1].options.reloadDocument||y[2])return Ac(e,t),y;u=!0,c=[0,[Go,new Error("Too many redirects")]]}const g=c?c[2]??await h(c):d;if(g>=0){const y=c==null?void 0:c[1],b=y==null?void 0:y[0],w=l[g],E=y==null?void 0:y[1],C=()=>{y&&(w._notFound=void 0,b===Go?w.status="error":(E.routeId=w.routeId,w.routeId===e.routeTree.id?(w.status="success",w._notFound=!0):w.status="notFound"),w.error=E,w.isFetching=!1)};C(),y||i==null||i();const T=eu(e,w);try{await Jc(y?Promise.resolve().then(()=>xf(T,b===Go?"errorComponent":"notFoundComponent")):Promise.all([xf(T),xf(T,"notFoundComponent")]),r.signal)}catch(N){if(N===r.signal&&r.signal.aborted)return Ac(e,t),wa}y?u&&(r.abort(),await Promise.all([...n.map(N=>N[1]),...n.map(N=>N[2]),...(t[2]??[]).map(N=>N[1])]),Ac(e,t),hs(e,l),C()):w.status="success"}return t}async function kj(e,t,n,r=0,s=t[1].length){var l,c;const i=t[1];for(let u=r;u<s;u++){const d=i[u],h=eu(e,d).options;if(h.head||h.scripts)try{const m={ssr:e.options.ssr,matches:i,match:d,params:d.params,loaderData:d.loaderData},[g,y]=await Jc(Promise.all([(l=h.head)==null?void 0:l.call(h,m),(c=h.scripts)==null?void 0:c.call(h,m)]),n);d.meta=g==null?void 0:g.meta,d.links=g==null?void 0:g.links,d.headScripts=g==null?void 0:g.scripts,d.styles=g==null?void 0:g.styles,d.scripts=y}catch(m){if(m===n&&n.aborted)break;console.error(m)}if(d.status!=="success"||d._notFound)break}return t}async function Mj(e,t,n,r){var c;const s=[t,n],i=r[0].signal;let l;try{const u=e.stores.matches.get();let d=n.findIndex(T=>T._notFound);if(e.options.notFoundMode!=="root"&&d>=0){const T=await $1(e,n,void 0,i,d);n[d]._notFound=void 0,n[T]._notFound=!0,d=T}let h=d<0?n.length:d+1,m=0;for(;m<h&&m!==d;){const T=n[m],N=r[2][m],R=u[m];if((N==null?void 0:N.id)!==T.id||N.status!=="success"||T.preload||(R==null?void 0:R.id)!==T.id||R.status!=="success"||(m++,N._notFound||R._notFound))break}const g=[],y=r[6]??0;let b=y?Promise.resolve(n[y-1]):void 0;const w=()=>{for(let T=y;T<h&&!i.aborted;T++)b=UV(e,s,T,g,b,r,m)},E=await $V(e,s,r,h,w,m);if(E){if(r[4]=!0,h=E[0],E[1][0]===Ly){const T=await $1(e,n,E,i);E[2]=T,h=Math.min(h,T+1)}else E[1][0]>=Qr&&(h=0);w()}if(!i.aborted&&!r[3]){const T=[];for(const[N,R]of e._flights??[])R[2]||(e._flights.delete(N),T.push(R[1]));for(const N of T)N.abort()}const C=Oj(e,s,g,r[0],Mk(g,E,s[2]),r[7]);(c=s[2])!=null&&c.length&&(s[3]=Mk(s[2],void 0,void 0,C.then(T=>Yh(T)?0:_E(n).length,()=>0))),l=await C}catch(u){if(Ac(e,s),u===i&&i.aborted)return wa;throw u}return Yh(l)?l:kj(e,l,i,r[6]===n.length?r[6]:0)}function V1(e,t){var i,l;if(e._tx!==t)return;const n=t[3],r=e.stores.matches.get();let s=e._pending;for(let c=0;c<n.length;c++){const u=n[c],d=u.status==="success"&&!u._notFound,h=((i=r[c])==null?void 0:i.id)===u.id&&((l=r[c])==null?void 0:l.status)==="pending";if(d&&!h)continue;const m=eu(e,u),g=d||u.invalid?0:m.options.pendingMs??e.options.defaultPendingMs,y=m.options.pendingComponent??e.options.defaultPendingComponent;if(!y||typeof g!="number"||g===1/0){s&&(s[0]=t,s[2]=0,s[4]=!0);return}const b=m.options.pendingMinMs??e.options.defaultPendingMinMs??0;let w=!1;if((s==null?void 0:s[1])===u.id?(w=s[0]!==t,s[0]=t):(clearTimeout(s==null?void 0:s[3]),e._pending=s=void 0),s||(e._pending=s=[t,u.id,h?Date.now()+b:t[4]+g,void 0,h||void 0,y]),s[4]&&!w&&s[5]===y)return;if(s[5]=y,!s[4]){clearTimeout(s[3]);const T=s[2]-Date.now();if(T>0){s[3]=setTimeout(()=>V1(e,t),T);return}s[2]=0}const E=n.map(T=>({...T,_flight:void 0}));E[c].status="pending";const C=s[4]=e.startTransition(()=>e.stores.setMatches(E),E).then(T=>(T&&e._pending===s&&s[4]===C&&!s[2]&&(s[2]=Date.now()+b),T));return}}function fh(e,t){var r;const n=e._pending;(e._tx===t||!((r=e._tx)!=null&&r[3].some(s=>s.id===(n==null?void 0:n[1]))))&&(clearTimeout(n==null?void 0:n[3]),e._pending=void 0)}async function Ak(e,t){const n=e._pending;if(!n)return;clearTimeout(n[3]);const r=n[2]-Date.now();if(!n[4]||r<=0||!_E(t[3]).some(i=>i.id===n[1]))return;let s;try{await Jc(new Promise(i=>{s=setTimeout(i,r)}),t[0].signal)}catch{}clearTimeout(s)}function Aj(e,t){e._committed=t,e.stores.setMatches(t)}function qV(e,t,n,r){const s=e._committed,i=e._lifecycleEnd,l=e._cache;for(const h of n)h.preload=!1,r&&(h._assetEnd=void 0);const c=_E(n).length,u=new Map;{const h=Date.now(),m=new Set;for(let g=0;g<n.length;g++){const y=n[g];(g<c||y.status==="success")&&m.add(y.id)}for(const g of[...s,...l.values()]){if(g.status!=="success"||m.has(g.id))continue;const y=eu(e,g);!y.options.loader||h-g.updatedAt>=(g.preload?y.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:y.options.gcTime??e.options.defaultGcTime??3e5)||u.set(g.id,l.get(g.id)===g?g:{...g,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=u;const d=e._lifecycleEnd=DV(n);Aj(e,n),hs(e,[...l.values(),...s].filter(h=>h._flight&&u.get(h.id)!==h),n),IV(e,s,n,i,d,t)}async function Ig(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function _j(e,t,n){const r=n[1].options,s=n[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(s.maskedLocation??s).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=t[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function GV(e,t,n,r,s){const i=n.map(u=>({...u}));jE(i);for(const u of r)Ho(e,i[u[0]]),i[u[0]]=u[3];const l=[t[2],i];let c;try{c=await Oj(e,l,r,t[0],s)}catch(u){throw hs(e,i),u}if(Yh(c)){hs(e,i),c[0]===Qr&&e._tx===t&&e._committed===n&&await _j(e,t,c);return}if(await kj(e,c,t[0].signal),e._tx!==t||e._committed!==n){hs(e,i);return}for(const u of i){const d=e._cache.get(u.id);d!=null&&d._flight&&d._flight===u._flight&&(e._cache.delete(u.id),Ho(e,d))}Aj(e,i),hs(e,n,i)}async function KV(e,t,n,r,s,i){const l=await Mj(e,t[2],t[3],[t[0],t[1],e._committed,void 0,s,n,i,r]);if(Yh(l)){const m=l[0]===Qr&&e._tx===t;if((!m||l[1].options.reloadDocument)&&fh(e,t),hs(e,t[3]),t[3]=[],!m)return;if(e._tx!==t){fh(e,t);return}await _j(e,t,l);return}const c=l[1];if(e._tx===t&&await Ak(e,t),e._tx!==t){fh(e,t),hs(e,c),Ac(e,l);return}const u=t[2],d=jy(u,e.stores.resolvedLocation.get()),h=l[2];await e.startViewTransition(async()=>{var y;if(e._tx===t&&await Ak(e,t),e._tx!==t){fh(e,t),hs(e,c),Ac(e,l);return}const m=()=>{fh(e,t),qV(e,t,c,i),e._tx===t&&(e.emit({type:"onLoad",...d}),e._tx===t&&e.emit({type:"onBeforeRouteMount",...d}))},g=await e.startTransition(m,c);if(e._tx!==t){Ac(e,l);return}h!=null&&h.length&&GV(e,t,c,h,l[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(u),e.stores.status.set("idle"),e._tx===t&&e.emit({type:"onResolved",...d}),g&&e._tx===t&&e.emit({type:"onRendered",...d})}),e._tx===t&&((y=e._commitPromise)==null||y.resolve(),e._commitPromise=void 0)})}async function YV(e,t){var R;const n=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,l=e._pendingLocation,c=(l==null?void 0:l.href)===i.href?l._redirects??0:0,u=e._handoff,d=u==null?void 0:u[0](),h=new AbortController,m=e._preflight;if(e._preflight=h,d||u==null||u[1](),m==null||m.abort(),!h.signal.aborted){const M=jy(i,r);e.emit({type:"onBeforeNavigate",...M}),h.signal.aborted||e.emit({type:"onBeforeLoad",...M})}if(h.signal.aborted){await Ig(e,n);return}const g=s.href===i.href;let y=h;const b=e.matchRoutes(i,{_controller:h});jE(b);const w=d?u[1](b):void 0;if(w?y=d:d==null||d.abort(),h.signal.aborted){hs(e,b),await Ig(e,n);return}e._preflight=void 0;let E;const C=()=>KV(e,N,g,()=>V1(e,N),t==null?void 0:t.sync,w),T=t!=null&&t.sync?new Promise(M=>E=M):Promise.resolve().then(C),N=[y,c,i,b,Date.now(),T.then(()=>Ig(e,N))];if(e._tx=N,n){for(const M of e.stores.matches.get()){if(e._tx!==N)break;M.isFetching&&Xh(e,M,!1)}n[0].abort(),hs(e,n[3],N[3],!0)}if(e._tx!==N){hs(e,N[3]),N[3]=[],E==null||E(),await Ig(e,N);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(w||!e._committed.length&&((R=b[0])==null?void 0:R.status)!=="success"&&!b.some(M=>M._notFound))&&V1(e,N),E==null||E(C()),await N[5]}async function WV(e,t){let n=e.buildLocation(t);for(let r=0;;r++){const s=e._committed,i=new AbortController;let l,c,u;try{try{l=e.matchRoutes(n,{_controller:i}),jE(l),c=(e._preloads??(e._preloads=new Map)).set(i,l),u=await Mj(e,n,l,[i,r,s,!0])}finally{c&&(c=c.delete(i),hs(e,l)),i.abort()}if(!Yh(u))return u[1];if(!c||u.length<3)return;n=u[2]}catch(d){Hf(d)||console.error(d);return}}}const XV="Error preloading route! ☝️";var Dj=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var u,d;this.originalIndex=t,this._branch=void 0;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(u=this.options).getParentRoute)==null?void 0:d.call(u),r?this._path=yf:this.parentRoute||OE();let s=r?yf:n==null?void 0:n.path;s&&s!=="/"&&(s=yj(s));const i=(n==null?void 0:n.id)||s,l=r?yf:mf((this.parentRoute.id==="__root__"?"":this.parentRoute.id)+"/"+(i??""));s==="__root__"&&(s="/");const c=l==="__root__"?"/":s===void 0?this.parentRoute.fullPath:mf(this.parentRoute.fullPath+"/"+s);this._path=s,this._id=l,this._fullPath=c,this._to=Ji(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>kE({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},QV=class extends Dj{constructor(e){super(e)}},PE=class extends O.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){var n,r;(r=(n=this.props).onCatch)==null||r.call(n,e,t)}render(){const e=this.state.error;return e?O.createElement(this.props.errorComponent??ZV,{error:e[0],reset:this.reset}):this.props.children}};function ZV({error:e}){const[t,n]=O.useState(!1);return x.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[x.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),x.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),x.jsx("div",{style:{height:".25rem"}}),t?x.jsx("div",{children:x.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e!=null&&e.message?x.jsx("code",{children:e.message}):null})}):null]})}var JV=()=>!0,eU=()=>!1;function tU({children:e,fallback:t=null}){return x.jsx(od.Fragment,{children:Ij()?e:t})}function Ij(){return od.useSyncExternalStore(nU,JV,eU)}function nU(){return()=>{}}var jj=O.createContext(null);function gs(e){return O.useContext(jj)}var Py=O.createContext(void 0),rU=O.createContext(void 0);function sU({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:l,shallowPropagate:c};function r(d,h,m){const g=h.depsTail;if(g!==void 0&&g.dep===d)return;const y=g!==void 0?g.nextDep:h.deps;if(y!==void 0&&y.dep===d){y.version=m,h.depsTail=y;return}const b=d.subsTail;if(b!==void 0&&b.version===m&&b.sub===h)return;const w=h.depsTail=d.subsTail={version:m,dep:d,sub:h,prevDep:g,nextDep:y,prevSub:b,nextSub:void 0};y!==void 0&&(y.prevDep=w),g!==void 0?g.nextDep=w:h.deps=w,b!==void 0?b.nextSub=w:d.subs=w}function s(d,h=d.sub){const m=d.dep,g=d.prevDep,y=d.nextDep,b=d.nextSub,w=d.prevSub;return y!==void 0?y.prevDep=g:h.depsTail=g,g!==void 0?g.nextDep=y:h.deps=y,b!==void 0?b.prevSub=w:m.subsTail=w,w!==void 0?w.nextSub=b:(m.subs=b)===void 0&&n(m),y}function i(d){let h=d.nextSub,m;e:do{const g=d.sub;let y=g.flags;if(y&60?y&12?y&4?!(y&48)&&u(d,g)?(g.flags=y|40,y&=1):y=0:g.flags=y&-9|32:y=0:g.flags=y|32,y&2&&t(g),y&1){const b=g.subs;if(b!==void 0){const w=(d=b).nextSub;w!==void 0&&(m={value:h,prev:m},h=w);continue}}if((d=h)!==void 0){h=d.nextSub;continue}for(;m!==void 0;)if(d=m.value,m=m.prev,d!==void 0){h=d.nextSub;continue e}break}while(!0)}function l(d,h){let m,g=0,y=!1;e:do{const b=d.dep,w=b.flags;if(h.flags&16)y=!0;else if((w&17)===17){if(e(b)){const E=b.subs;E.nextSub!==void 0&&c(E),y=!0}}else if((w&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(m={value:d,prev:m}),d=b.deps,h=b,++g;continue}if(!y){const E=d.nextDep;if(E!==void 0){d=E;continue}}for(;g--;){const E=h.subs,C=E.nextSub!==void 0;if(C?(d=m.value,m=m.prev):d=E,y){if(e(h)){C&&c(E),h=d.sub;continue}y=!1}else h.flags&=-33;h=d.sub;const T=d.nextDep;if(T!==void 0){d=T;continue e}}return y}while(!0)}function c(d){do{const h=d.sub,m=h.flags;(m&48)===32&&(h.flags=m|16,(m&6)===2&&t(h))}while((d=d.nextSub)!==void 0)}function u(d,h){let m=h.depsTail;for(;m!==void 0;){if(m===d)return!0;m=m.prevDep}return!1}}function iU(e,t,n){var i,l,c;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(l=r?e.error:t)==null?void 0:l.bind(s),complete:(c=r?e.complete:n)==null?void 0:c.bind(s)}}const U1=[];let b0=0;const{link:_k,unlink:oU,propagate:lU,checkDirty:Lj,shallowPropagate:Dk}=sU({update(e){return e._update()},notify(e){U1[q1++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,V0(e))}});let jg=0,q1=0,Gi,G1=0;function aU(e){try{++G1,e()}finally{--G1||Pj()}}function V0(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=oU(n,e)}function Pj(){if(!(G1>0)){for(;jg<q1;){const e=U1[jg];U1[jg++]=void 0,e.notify()}jg=0,q1=0}}function Ik(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?0:1,get(){return Gi!==void 0&&_k(s,Gi,b0),s._snapshot},subscribe(i){const l=iU(i),c={current:!1},u=cU(()=>{var d;s.get(),c.current?(d=l.next)==null||d.call(l,s._snapshot):c.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(i){const l=Gi,c=(t==null?void 0:t.compare)??Object.is;if(n)Gi=s,++b0,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=5);try{const u=s._snapshot,d=typeof i=="function"?i(u):i===void 0&&n?r(u):i;return u===void 0||!c(u,d)?(s._snapshot=d,!0):!1}finally{Gi=l,n&&(s.flags&=-5),V0(s)}}};return n?(s.flags=17,s.get=function(){const i=s.flags;if(i&16||i&32&&Lj(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&Dk(l)}}else i&32&&(s.flags=i&-33);return Gi!==void 0&&_k(s,Gi,b0),s._snapshot}):s.set=function(i){if(s._update(i)){const l=s.subs;l!==void 0&&(lU(l),Dk(l),Pj())}},s}function cU(e){const t=()=>{const r=Gi;Gi=n,++b0,n.depsTail=void 0,n.flags=6;try{return e()}finally{Gi=r,n.flags&=-5,V0(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const r=this.flags;r&16||r&32&&Lj(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,V0(this)}};return t(),n}var yS={exports:{}},xS={},bS={exports:{}},vS={};/**
52
- * @license React
53
- * use-sync-external-store-shim.production.js
54
- *
55
- * Copyright (c) Meta Platforms, Inc. and affiliates.
56
- *
57
- * This source code is licensed under the MIT license found in the
58
- * LICENSE file in the root directory of this source tree.
59
- */var jk;function uU(){if(jk)return vS;jk=1;var e=Ip();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(m,g){var y=g(),b=r({inst:{value:y,getSnapshot:g}}),w=b[0].inst,E=b[1];return i(function(){w.value=y,w.getSnapshot=g,u(w)&&E({inst:w})},[m,y,g]),s(function(){return u(w)&&E({inst:w}),m(function(){u(w)&&E({inst:w})})},[m]),l(y),y}function u(m){var g=m.getSnapshot;m=m.value;try{var y=g();return!n(m,y)}catch{return!0}}function d(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return vS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,vS}var Lk;function zj(){return Lk||(Lk=1,bS.exports=uU()),bS.exports}/**
60
- * @license React
61
- * use-sync-external-store-shim/with-selector.production.js
62
- *
63
- * Copyright (c) Meta Platforms, Inc. and affiliates.
64
- *
65
- * This source code is licensed under the MIT license found in the
66
- * LICENSE file in the root directory of this source tree.
67
- */var Pk;function fU(){if(Pk)return xS;Pk=1;var e=Ip(),t=zj();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return xS.useSyncExternalStoreWithSelector=function(d,h,m,g,y){var b=i(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function C(D){if(!T){if(T=!0,N=D,D=g(D),y!==void 0&&w.hasValue){var k=w.value;if(y(k,D))return R=k}return R=D}if(k=R,r(N,D))return k;var I=g(D);return y!==void 0&&y(k,I)?(N=D,k):(N=D,R=I)}var T=!1,N,R,M=m===void 0?null:m;return[function(){return C(h())},M===null?void 0:function(){return C(M())}]},[h,m,g,y]);var E=s(d,b[0],b[1]);return l(function(){w.hasValue=!0,w.value=E},[E]),u(E),E},xS}var zk;function dU(){return zk||(zk=1,yS.exports=fU()),yS.exports}var zE=dU();const hU=bE(zE);function pU(e,t){return e===t}function tl(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??pU,s=O.useCallback(l=>{const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=O.useCallback(()=>e.get(),[e]);return zE.useSyncExternalStoreWithSelector(s,i,i,t,r)}var Bk={};function Bj(e,t){const n=O.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=fa(n.current,s):s}}function tu(e){const t=gs(),n=O.useContext(e.from?rU:Py),r=e.from??n,s=t.stores.getMatchStore(r),i=Bj(e,t),l=tl(s,c=>c?i(c):Bk);if(l!==Bk)return l;(e.shouldThrow??!0)&&OE()}function Hj(e){return tu({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fj(e){const{select:t,...n}=e;return tu({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function $j(e){return tu({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vj(e){return tu({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jp(e){const t=gs();return O.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function abe(e){const t=gs(),n=jp(),r=O.useRef(null);return TE(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Uj(e){return tu({...e,select:t=>e.select?e.select(t.context):t.context})}function mU(...e){const t=O.useRef(e),n=t.current;return e.forEach((r,s)=>{qo(n[s],r,!1,!0)||(n[s]=r)}),t.current}function Lg(e,t){e.preloadRoute(t).catch(n=>{console.warn(n),console.warn(XV)})}var gU={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function yU(e,t){const n=typeof e=="string"&&Gh(e);if(n)return t.has(n)?e:null}function xU(e,t,n,r,s){const i=pk(e.pathname,r),l=pk(t.pathname,r);return(n!=null&&n.exact?i!==l:!(i.startsWith(l)&&(i.length===l.length||i[l.length]==="/")))||((n==null?void 0:n.includeSearch)??!0)&&!qo(e.search,t.search,!(n!=null&&n.exact),n==null?void 0:n.explicitUndefined)?!1:n!=null&&n.includeHash?s&&e.hash===t.hash:!0}function bU(e,t,n){const r=gs(),s=O.useRef(null),i=O.useCallback(J=>{if(s.current=J,typeof t=="function")return t(J);t&&(t.current=J)},[t]),{activeOptions:l,to:c,preload:u,preloadDelay:d,hashScrollIntoView:h,replace:m,startTransition:g,resetScroll:y,viewTransition:b,ignoreBlocker:w,disabled:E,target:C,onClick:T,onBlur:N,onFocus:R,onMouseEnter:M,onMouseLeave:D,onTouchStart:k}=e,I=Ij(),[_,P,H]=mU(e.search,e.params,l),[z,U]=O.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,_,P,e.state,e.mask,e.unsafeRelative]),j=O.useCallback(J=>{const K=yU(c,r.protocolAllowlist);if(K!==void 0)return[K??void 0];z._fromLocation||(U._fromLocation=J);const ce=r.buildLocation(U),ye=CU(ce,r,E);return[ye,!E&&(!ye||Gh(ye))?void 0:xU(J,ce,H,r.basepath,I)]},[H,E,I,z,U,r,c]),[B,L]=tl(r.stores.location,j,gU),$=L===void 0?B:void 0,q=E||B===void 0,G=O.useRef(!1),W=e.reloadDocument||$||q?!1:u??r.options.defaultPreload,Z=d??r.options.defaultPreloadDelay??0,re=O.useCallback(J=>{const K=J==null?void 0:J.isIntersecting;if(!(K??W==="intent")){K===!1&&SS(s);return}if(!Z){Lg(r,z);return}Lh.has(s)||Lh.set(s,setTimeout(()=>{Lh.delete(s),Lg(r,z)},Z))},[r,z,s,W,Z]);O.useEffect(()=>{W==="render"&&!G.current&&(G.current=!0,Lg(r,z));let J;return W==="viewport"&&s.current&&typeof IntersectionObserver=="function"&&(J=new IntersectionObserver(K=>re(K.pop()),{rootMargin:"100px"}),J.observe(s.current)),()=>{J==null||J.disconnect(),SS(s)}},[r,z,W,re,s]);const de=wU(e,n);if(de.ref=t?i:s,$)return de.href=$,de;const F=J=>{const K=C??J.currentTarget.getAttribute("target");!q&&!(J.metaKey||J.altKey||J.ctrlKey||J.shiftKey)&&!J.defaultPrevented&&(!K||K==="_self")&&J.button===0&&(J.preventDefault(),r.navigate({...z,replace:m,resetScroll:y,hashScrollIntoView:h,startTransition:g,viewTransition:b,ignoreBlocker:w}))},X=()=>{W==="intent"&&Lg(r,z)},te=()=>{W==="intent"&&SS(s)};return de.onClick=Ju(T,F),de.onBlur=Ju(N,te),de.onFocus=Ju(R,re),de.onMouseEnter=Ju(M,re),de.onMouseLeave=Ju(D,te),de.onTouchStart=Ju(k,X),EU(de,e,L,B,q,n)}var vU={},SU={className:"active"},qj=new Set(["to","params","search","hash","state","mask","from","unsafeRelative","_fromLocation","reloadDocument","preload","preloadDelay","preloadIntentProximity","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","ignoreBlocker","activeProps","inactiveProps","activeOptions","_asChild"]);function wU(e,t){const n={};for(const r in e)qj.has(r)||r==="type"&&t!==void 0||r==="disabled"&&t==="a"||(n[r]=e[r]);return n}function EU(e,t,n,r,s,i){const{activeProps:l,inactiveProps:c,className:u,style:d,target:h}=t,m=hj(n?l:c,{})??(n?SU:vU);Object.assign(e,m),e.href=r,i!=="a"&&(e.disabled=s),e.target=h;const g=m.style;(d||g)&&(e.style=d&&g?{...d,...g}:d||g);const y=m.className;return(u||y)&&(e.className=u?y?`${u} ${y}`:u:y),s&&(e.role="link",e["aria-disabled"]=!0),n&&(e["data-status"]="active",e["aria-current"]="page"),e}var Lh=new WeakMap,SS=e=>{clearTimeout(Lh.get(e)),Lh.delete(e)},Ju=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function CU(e,t,n){if(n)return;const r=e.maskedLocation??e,s=r.external?r.publicHref:t.history.createHref(r.publicHref)||"/";if(!((r.external||s!==r.publicHref)&&gj(s,t.protocolAllowlist)))return s}var Ff=O.memo(O.forwardRef((e,t)=>{const n=e._asChild||"a",r=bU(e,t,n),s=typeof e.children=="function"?e.children({isActive:r["data-status"]==="active"}):e.children;return O.createElement(n,r,s)}),NU);function NU(e,t){let n=0;for(const r in t)if(n++,e[r]!==t[r]&&(!qj.has(r)||!qo(e[r],t[r],!1,!0)))return!1;for(const r in e)n--;return n===0}var TU=class extends Dj{constructor(t){super(t),this.useMatch=n=>tu({...n,from:this.id}),this.useRouteContext=n=>Uj({...n,from:this.id}),this.useSearch=n=>Vj({...n,from:this.id}),this.useParams=n=>$j({...n,from:this.id}),this.useLoaderDeps=n=>Fj({...n,from:this.id}),this.useLoaderData=n=>Hj({...n,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((n,r)=>x.jsx(Ff,{ref:r,from:this.fullPath,...n}))}};function RU(e){return new TU(e)}function OU(){return e=>MU(e)}var kU=class extends QV{constructor(e){super(e),this.useMatch=t=>tu({...t,from:this.id}),this.useRouteContext=t=>Uj({...t,from:this.id}),this.useSearch=t=>Vj({...t,from:this.id}),this.useParams=t=>$j({...t,from:this.id}),this.useLoaderDeps=t=>Fj({...t,from:this.id}),this.useLoaderData=t=>Hj({...t,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((t,n)=>x.jsx(Ff,{ref:n,from:this.fullPath,...t}))}};function MU(e){return new kU(e)}function ys(e){return t=>{const n=RU(t);return n.isRoot=!1,n}}function fn(e,t){let n,r,s;const i=()=>(n||(s=void 0,n=e().then(c=>{n=void 0,l.preload=void 0,r=c[t??"default"]}).catch(c=>{n=void 0,s=c})),n),l=function(u){if(s){if(X$(s)&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${s.message}`;if(!sessionStorage.getItem(d))throw sessionStorage.setItem(d,"1"),window.location.reload(),new Promise(()=>{})}throw s}if(!r)if(dk)dk(i());else throw i();return O.createElement(r,u)};return l.preload=i,l}function AU(e){const t=gs(),n=`not-found-${tl(t.stores.location,r=>r.pathname)}-${tl(t.stores.status)}`;return x.jsx(PE,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(Hf(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(Hf(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function _U(){return x.jsx("p",{children:"Not Found"})}function of(e){return x.jsx(x.Fragment,{children:e.children})}function Gj(e,t,n){return t.options.notFoundComponent?x.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...n}):x.jsx(_U,{})}function zy(e,t){const n=(t==null?void 0:t.options.pendingComponent)??e.options.defaultPendingComponent;return n?x.jsx(n,{}):null}var DU=(e,t)=>e[0]===t[0]&&e[1]===t[1],Kj=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n==="data-only"||!e.ssr,Yj=O.memo(function({routeId:t}){const n=gs();return x.jsx(IU,{router:n,match:tl(n.stores.getMatchStore(t))})});function IU({router:e,match:t}){var m,g;const n=e.routesById[t.routeId],r=zy(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,i=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):n.options.notFoundComponent,c=t.ssr===!1||t.ssr==="data-only",u=Kj(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(((g=n.options.errorComponent)==null?void 0:g.preload)||c))?O.Suspense:of,d=s?PE:of,h=l?AU:of;return x.jsxs(n.isRoot?n.options.shellComponent??of:of,{children:[x.jsx(Py.Provider,{value:t.routeId,children:x.jsx(u,{fallback:r,children:x.jsx(d,{getResetKey:()=>t,errorComponent:s,onCatch:(y,b)=>{if(Hf(y))throw y.routeId??(y.routeId=t.routeId),y;i==null||i(y,b)},children:x.jsx(h,{fallback:y=>{if(y.routeId??(y.routeId=t.routeId),y.routeId!==t.routeId)throw y;return O.createElement(l,y)},children:c?x.jsx(tU,{fallback:r,children:x.jsx(Hk,{match:t})}):x.jsx(Hk,{match:t})})})})}),null]})}var Hk=O.memo(function({match:t}){const n=gs(),r=t.routeId,s=n.routesById[r],i=O.useMemo(()=>{var u;const c=(u=s.options.remountDeps??n.options.defaultRemountDeps)==null?void 0:u({routeId:r,loaderDeps:t.loaderDeps,params:t._strictParams,search:t._strictSearch});return c?JSON.stringify(c):void 0},[r,t.loaderDeps,t._strictParams,t._strictSearch,s.options.remountDeps,n.options.defaultRemountDeps]),l=O.useMemo(()=>{const c=s.options.component??n.options.defaultComponent;return c?x.jsx(c,{},i):x.jsx(Wj,{})},[i,s.options.component,n.options.defaultComponent]);if(t.status==="pending"){if(n.ssr&&!Kj(n,s,t.ssr))return l;if(n._tx)throw n._tx[5];return zy(n,s)}if(t.status==="notFound")return Gj(n,s,t.error);if(t.status==="error")throw t.error;return l}),Wj=O.memo(function(){const t=gs(),n=O.useContext(Py);let r,s,i;{const c=t.stores.getMatchStore(n);[r,s]=tl(c,u=>[!!u._notFound,u.error],{compare:DU}),i=tl(t.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Gj(t,t.routesById[n],s);if(!i)return null;const l=x.jsx(Yj,{routeId:i});return n===yf?x.jsx(O.Suspense,{fallback:zy(t),children:l}):l});function Xj(e,t){const n=e[1];e.length=0,n==null||n(t)}function jU({t:e}){const t=gs(),n=t._rendered??(t._rendered=[]);return t.startTransition=(r,s)=>new Promise(i=>{Xj(n,!1),n.push(s,i),e(t),O.startTransition(r)}),TE(()=>{const r=t.history.subscribe(t.load);t.updateLatestLocation();const s=t.latestLocation,i=t.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ji(s.publicHref)!==Ji(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const l=t.stores.resolvedLocation.get();return(l==null?void 0:l.href)===s.href&&l.state.__TSR_key===s.state.__TSR_key?n.push(t.stores.matches.get(),c=>{c&&t.emit({type:"onRendered",...jy(l,l)})}):t._tx||t.load({sync:!0}).catch(console.error),r},[t,t.history]),null}function LU(){const e=gs(),t=e.routesById[yf],n=zy(e,t),r=e.ssr?of:O.Suspense,s=x.jsxs(x.Fragment,{children:[x.jsx(jU,{t:O.useState()[1]}),x.jsx(r,{fallback:n,children:x.jsx(PU,{})})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:s}):s}function PU(){const e=gs(),t=e._rendered,n=tl(e.stores.matches,l=>t[0]??l),r=n[0],s=r==null?void 0:r.routeId;TE(()=>{t[0]===n&&Xj(t,!0)},[t,n]);const i=s?x.jsx(Yj,{routeId:s}):null;return x.jsx(Py.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:x.jsx(PE,{getResetKey:()=>r,onCatch:void 0,children:i})})}function Fk(e){const t=gs();return tl(t.stores.matches,Bj(e,t))}var zU=e=>({createMutableStore:Ik,createReadonlyStore:Ik,batch:aU}),BU=e=>new HU(e),HU=class extends jV{constructor(e){super(e,zU)}};function FU({router:e,children:t,...n}){pj(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=x.jsx(jj.Provider,{value:e,children:t});return e.options.Wrap?x.jsx(e.options.Wrap,{children:r}):r}function $U({router:e,...t}){return x.jsx(FU,{router:e,...t,children:x.jsx(LU,{})})}const Qj=O.createContext(null);function By(){return typeof window<"u"}function Nr(e){return BE(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ol(e){var t;return(t=(BE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BE(e){return By()?e instanceof Node||e instanceof vn(e).Node:!1}function bt(e){return By()?e instanceof Element||e instanceof vn(e).Element:!1}function Zt(e){return By()?e instanceof HTMLElement||e instanceof vn(e).HTMLElement:!1}function $f(e){return!By()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}function Lp(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function VU(e){return/^(table|td|th)$/.test(Nr(e))}function Hy(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UU=/transform|translate|scale|rotate|perspective|filter/,qU=/paint|layout|strict|content/,ac=e=>!!e&&e!=="none";let wS;function HE(e){const t=bt(e)?zs(e):e;return ac(t.transform)||ac(t.translate)||ac(t.scale)||ac(t.rotate)||ac(t.perspective)||!FE()&&(ac(t.backdropFilter)||ac(t.filter))||UU.test(t.willChange||"")||qU.test(t.contain||"")}function GU(e){let t=nl(e);for(;Zt(t)&&!Ko(t);){if(HE(t))return t;if(Hy(t))return null;t=nl(t)}return null}function FE(){return wS==null&&(wS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wS}function Ko(e){return/^(html|body|#document)$/.test(Nr(e))}function zs(e){return vn(e).getComputedStyle(e)}function Fy(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nl(e){if(Nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$f(e)&&e.host||ol(e);return $f(t)?t.host:t}function Zj(e){const t=nl(e);return Ko(t)?(e.ownerDocument||e).body:Zt(t)&&Lp(t)?t:Zj(t)}function Qh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zj(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),l=vn(s);if(i){const c=K1(l);return t.concat(l,l.visualViewport||[],Lp(s)?s:[],c&&n?Qh(c):[])}else return t.concat(s,Qh(s,[],n))}function K1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const $E={...o$},$k={};function Tr(e,t){const n=O.useRef($k);return n.current===$k&&(n.current=e(t)),n}const ES=$E.useInsertionEffect,KU=ES&&ES!==$E.useLayoutEffect?ES:e=>e();function Qe(e){const t=Tr(YU).current;return t.next=e,KU(t.effect),t.trampoline}function YU(){const e={next:void 0,callback:WU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function WU(){}const XU=()=>{},ze=typeof document<"u"?O.useLayoutEffect:XU;function Y1(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const VE={};function Yo(e,t,n,r,s){if(!n&&!r&&!s&&!e)return U0(t);let i=U0(e);return t&&(i=Eh(i,t)),n&&(i=Eh(i,n)),r&&(i=Eh(i,r)),s&&(i=Eh(i,s)),i}function QU(e){if(e.length===0)return VE;if(e.length===1)return U0(e[0]);let t=U0(e[0]);for(let n=1;n<e.length;n+=1)t=Eh(t,e[n]);return t}function U0(e){return UE(e)?{...eL(e,VE)}:ZU(e)}function Eh(e,t){return UE(t)?eL(t,e):JU(e,t)}function ZU(e){const t={...e};for(const n in t){const r=t[n];Jj(n,r)&&(t[n]=tL(r))}return t}function JU(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Y1(e.style,r);break}case"className":{e[n]=nL(e.className,r);break}default:Jj(n,r)?e[n]=e9(e[n],r):e[n]=r}}return e}function Jj(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function UE(e){return typeof e=="function"}function eL(e,t){return UE(e)?e(t):e??VE}function e9(e,t){return t?e?(...n)=>{const r=n[0];if(rL(r)){const i=r;q0(i);const l=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),l}const s=t(...n);return e==null||e(...n),s}:tL(t):e}function tL(e){return e&&((...t)=>{const n=t[0];return rL(n)&&q0(n),e(...t)})}function q0(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nL(e,t){return t?e?t+" "+e:t:e}function rL(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function t9(e,t){return function(r,...s){const i=new URL(e);return i.searchParams.set("code",r.toString()),s.forEach(l=>i.searchParams.append("args[]",l)),`${t} error #${r}; visit ${i} for the full message.`}}const wn=t9("https://base-ui.com/production-error","Base UI"),n9=O.createContext(void 0);function qE(e=!1){const t=O.useContext(n9);if(t===void 0&&!e)throw new Error(wn(16));return t}function r9(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:i}=e,l=r&&t!==!1,c=r&&t===!1;return{props:O.useMemo(()=>{const d={onKeyDown(h){n&&t&&h.key!=="Tab"&&h.preventDefault()}};return r||(d.tabIndex=s,!i&&n&&(d.tabIndex=t?s:-1)),(i&&(t||l)||!i&&n)&&(d["aria-disabled"]=n),i&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,i,s])}}function Dt(e){return(e==null?void 0:e.ownerDocument)||document}function v0(e,t,{detail:n=0}={}){e.dispatchEvent(new(vn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Pp(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:i}=e,l=O.useRef(null),c=qE(!0),u=i??c!==void 0,{props:d}=r9({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:s}),h=O.useCallback(()=>{const y=l.current;CS(y)&&u&&t&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,d.disabled,u]);ze(h,[h]);const m=O.useCallback((y={})=>{const{onClick:b,onMouseDown:w,onKeyUp:E,onKeyDown:C,onPointerDown:T,...N}=y;return Yo({onClick(R){if(t){R.preventDefault();return}b==null||b(R)},onMouseDown(R){t||w==null||w(R)},onKeyDown(R){if(t||(q0(R),C==null||C(R),R.baseUIHandlerPrevented))return;const M=R.target===R.currentTarget,D=R.currentTarget,k=CS(D),I=!s&&s9(D),_=M&&(s?k:!I),P=R.key==="Enter",H=R.key===" ",z=D.getAttribute("role"),U=(z==null?void 0:z.startsWith("menuitem"))||z==="option"||z==="gridcell";if(M&&u&&H){if(R.defaultPrevented&&U)return;R.preventDefault(),(!s||k)&&(R.preventBaseUIHandler(),v0(D,R));return}if(!_||s||!H&&!P){M&&I&&H&&R.preventDefault();return}R.defaultPrevented||(R.preventDefault(),P&&(R.preventBaseUIHandler(),v0(D,R)))},onKeyUp(R){if(!t){if(q0(R),E==null||E(R),R.target===R.currentTarget&&s&&u&&CS(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!u&&!R.defaultPrevented&&R.key===" "&&(R.preventBaseUIHandler(),v0(R.currentTarget,R))}},onPointerDown(R){if(t){R.preventDefault();return}T==null||T(R)}},s?{type:"button"}:{role:"button"},d,N)},[t,d,u,s]),g=Qe(y=>{l.current=y,h()});return{getButtonProps:m,buttonRef:g}}function CS(e){return Zt(e)&&e.tagName==="BUTTON"}function s9(e){return Zt(e)&&e.tagName==="A"&&!!e.href}function Vf(e,t,n,r){const s=Tr(sL).current;return o9(s,e,t,n,r)&&iL(s,[e,t,n,r]),s.callback}function i9(e){const t=Tr(sL).current;return l9(t,e)&&iL(t,e),t.callback}function sL(){return{callback:null,cleanup:null,refs:[]}}function o9(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function l9(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function iL(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=i(n);typeof l=="function"&&(r[s]=l);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=r[s];typeof l=="function"?l():i(null);break}case"object":{i.current=null;break}}}}}}}const a9=parseInt(O.version,10);function GE(e){return a9>=e}function Vk(e){if(!O.isValidElement(e))return null;const t=e,n=t.props;return(GE(19)?n==null?void 0:n.ref:t.ref)??null}function Bn(){}const Zh=Object.freeze([]),Tn=Object.freeze({});function c9(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const i=t[r](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function u9(e,t){return typeof e=="function"?e(t):e}function f9(e,t){return typeof e=="function"?e(t):e}function dn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=m9(r));const s=d9(t,n,r);if(n.enabled===!1)return null;const i=n.state??Tn;return g9(e,r,s,i)}function d9(e,t,n){const{className:r,style:s}=e,{state:i=Tn,ref:l,props:c,stateAttributesMapping:u,enabled:d=!0}=t,h=d?u9(r,i):void 0,m=d?f9(s,i):void 0,g=d?c9(i,u):Tn,y=d&&c?h9(c):void 0,b=d?Y1(g,y)??{}:Tn;return typeof document<"u"&&(d?Array.isArray(l)?b.ref=i9([b.ref,Vk(n),...l]):b.ref=Vf(b.ref,Vk(n),l):Vf(null,null)),d?(h!==void 0&&(b.className=nL(b.className,h)),m!==void 0&&(b.style=Y1(b.style,m)),b):Tn}function h9(e){return Array.isArray(e)?QU(e):Yo(void 0,e)}const p9=Symbol.for("react.lazy");function m9(e){if((e==null?void 0:e.$$typeof)!==p9)return e;const t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function g9(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Yo(n,t.props);return s.ref=n.ref,O.cloneElement(t,s)}if(e&&typeof e=="string")return y9(e,n);throw new Error(wn(8))}function y9(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):O.createElement(e,t)}const x9=O.forwardRef(function(t,n){const{render:r,className:s,disabled:i=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,style:u,...d}=t,{getButtonProps:h,buttonRef:m}=Pp({disabled:i,focusableWhenDisabled:l,native:c});return dn("button",t,{state:{disabled:i},ref:[n,m],props:[d,h]})});function oL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=oL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function b9(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=oL(e))&&(r&&(r+=" "),r+=t);return r}const Uk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qk=b9,v9=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],m=i==null?void 0:i[d];if(h===null)return null;const g=Uk(h)||Uk(m);return s[d][g]}),c=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...y}=h;return Object.entries(y).every(b=>{let[w,E]=b;return Array.isArray(E)?E.includes({...i,...c}[w]):{...i,...c}[w]===E})?[...d,m,g]:d},[]);return qk(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},lL=48,oo=(e,t=0)=>{const n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-lL-t;return n},$y=e=>{const t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Ea=e=>{const t=new Int32Array(e.length);let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r)-lL;n+=s>>>1^-(s&1),t[r]=n}return t},S9=384,w9=[],fc=$y(oo("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),E9=$y(oo(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),C9="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",N9=(()=>{const e=fc.length-1,t=new Int32Array(e);for(let s=e-1;s>=0;s--){let i=1,l=s+1;for(let c=fc[s];c<fc[s+1];c++)i+=t[l],l+=t[l];t[s]=i}const n=new Int32Array(fc[e]);let r=0;for(let s=0;s<e;s++){let i=s+1;for(let l=fc[s];l<fc[s+1];l++)n[r++]=i,i+=t[i]}return n})(),T9=oo("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),R9=$y(oo("123333359346463635126536711576")),O9=oo("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),k9=oo("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),M9=Ea("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),A9=(()=>{const e=new Int32Array(319).fill(-1),t=Ea("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),n=Ea("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),_9="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const t=e.split(" "),n=t.shift();for(let r=0;r<t.length;r++)t[r]=n+t[r];return t}),Gk=Ea("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),D9=Ea("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),I9=Ea("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),aL=new Int32Array(995),cL=new Int32Array(995),uL=new Int32Array(995);let W1="";const X1=new Int32Array(1038);{const e=new Map;let t=0,n=0;for(let r=0;r<Gk.length;r++)for(const s of _9[I9[r]]){let i=e.get(s);i===void 0&&(i=t++,e.set(s,i),X1[i*2]=W1.length,X1[i*2+1]=s.length,W1+=s),aL[n]=Gk[r],cL[n]=D9[r],uL[n]=i,n++}}const j9=Ea("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),L9=$y(oo("1::24444432:442:44:44>222222:44:4421322511111311111114")),P9=Ea("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),z9=oo("ij"),B9=oo("—"),H9=oo("1"),F9="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var $9={GROUP_COUNT:S9,customValidatorNames:w9,edgeStart:fc,labelStart:E9,labelText:C9,edgeTarget:N9,nodeGroup:T9,nodeVlist:A9,vlistPat:R9,vlistOps:O9,vlistRef:k9,vlistGroup:M9,litAnchor:aL,litGroup:cL,litPool:uL,poolOffsets:X1,poolText:W1,adjGid:j9,adjStart:L9,adjTgt:P9,patGid:z9,patTgt:B9,postfixLookupGroups:H9,orderSensitiveModifiers:F9};const V9="line"in new Error,Vi=-1,cc=-1,NS=(e,t,n)=>{let r=2166136261;for(let s=t;s<n;s++)r=Math.imul(r^e.charCodeAt(s),16777619);return r},S0=(e,t,n)=>{const r=n-t;let s=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){const i=r>>2,l=r>>1;s=Math.imul(s^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+i),2246822507),s=Math.imul(s^e.charCodeAt(t+l)<<8^e.charCodeAt(t+l+i)<<16^e.charCodeAt(n-3),3266489909),s^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let c=t+3,u=n-4;c<t+8&&c<u;c++,u--)s=Math.imul(s^e.charCodeAt(c)^e.charCodeAt(u)<<8,16777619)}return s^s>>>15|0},U9=(e,t,n={})=>{const{GROUP_COUNT:r,edgeStart:s,labelStart:i,labelText:l,edgeTarget:c,nodeGroup:u,nodeVlist:d,vlistPat:h,vlistOps:m,vlistRef:g,vlistGroup:y,litAnchor:b,litGroup:w,litPool:E,poolOffsets:C,poolText:T,adjGid:N,adjStart:R,adjTgt:M,patGid:D,patTgt:k,postfixLookupGroups:I,customValidatorNames:_,orderSensitiveModifiers:P}=e,H=new Int32Array(r).fill(-1);for(let pe=0;pe<N.length;pe++)H[N[pe]]=pe;let z=0;for(let pe=0;pe+1<R.length;pe++){const Ee=R[pe+1]-R[pe];Ee>z&&(z=Ee)}let U=32;for(;U<2*(1+z+D.length);)U<<=1;const j=new Int32Array(g.length+1);for(let pe=0;pe<g.length;pe++)j[pe+1]=j[pe]+h[g[pe]+1]-h[g[pe]];const B=new Uint8Array(r);for(let pe=0;pe<I.length;pe++)B[I[pe]]=1;const L=s.length-1,$=new Uint8Array(L);let q=0,G=!0;for(let pe=0;pe<b.length;pe++){$[b[pe]]=1;const Ee=C[E[pe]*2+1];Ee>q&&(q=Ee);const Ce=T.charCodeAt(C[E[pe]*2]);(Ce===91||Ce===40)&&(G=!1)}let W=1;for(;W<b.length*2;)W<<=1;const Z=new Int32Array(W).fill(-1);for(let pe=0;pe<b.length;pe++){const Ee=C[E[pe]*2];let Ce=(NS(T,Ee,Ee+C[E[pe]*2+1])^Math.imul(b[pe],2654435761)|0)&W-1;for(;Z[Ce]!==-1;)Ce=Ce+1&W-1;Z[Ce]=pe}const re=(pe,Ee,Ce,Ge)=>{let ot=(NS(Ee,Ce,Ge)^Math.imul(pe,2654435761)|0)&W-1;const it=Ge-Ce;for(;;){const at=Z[ot];if(at===-1)return-1;if(b[at]===pe&&C[E[at]*2+1]===it){const Ht=C[E[at]*2];let It=!0;for(let Ze=0;Ze<it;Ze++)if(T.charCodeAt(Ht+Ze)!==Ee.charCodeAt(Ce+Ze)){It=!1;break}if(It)return w[at]}ot=ot+1&W-1}},de=n.cacheSize??8192,F=n.prefix??e.prefix??"",X=F===""?"":F+":",te=X.length,J=(_??[]).map(pe=>{throw new Error("cn: missing validator "+pe)}),K=/\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$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ye=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let oe=0,xe=-1,Se=-1,ke=-1,_e=-1;const we=pe=>pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===95,Re=pe=>/\s/.test(String.fromCharCode(pe)),Ae=(pe,Ee,Ce)=>{if(oe=0,xe=-1,Ce-Ee<3)return;const Ge=pe.charCodeAt(Ee),ot=pe.charCodeAt(Ce-1);if(Ge===91&&ot===93)oe=1;else if(Ge===40&&ot===41)oe=2;else return;ke=Ee+1,_e=Ce-1;let it=Ee+1;if(we(pe.charCodeAt(it))){for(it++;it<Ce-1;){const at=pe.charCodeAt(it);if(!we(at)&&at!==45)break;it++}it<Ce-2&&pe.charCodeAt(it)===58&&(xe=Ee+1,Se=it,ke=it+1)}},Le=(pe,Ee,Ce,Ge)=>{if(Ce-Ee!==Ge.length)return!1;for(let ot=0;ot<Ge.length;ot++)if(pe.charCodeAt(Ee+ot)!==Ge.charCodeAt(ot))return!1;return!0},Ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,We=pe=>!!pe&&!Number.isNaN(Number(pe)),Oe=(pe,Ee,Ce)=>{if(Ce-Ee<11||!Le(pe,Ee,Ee+10,"@container"))return!1;if(pe.charCodeAt(Ee+10)===47)return Ce-Ee>=12;const Ge=pe.charCodeAt(Ee+11);return Ge===115&&Ce-Ee>=17&&Le(pe,Ee+10,Ee+16,"-size/")||Ge===110&&Ce-Ee>=19&&Le(pe,Ee+10,Ee+18,"-normal/")},De=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ne="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(pe=>pe.split(" ")),he=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],se=(pe,Ee,Ce,Ge)=>{if(pe>=10){if(pe>=25)return J[pe-25](Ee.slice(Ce,Ge));const ot=pe-10;if(oe!==De[ot])return!1;if(xe>=0){for(const it of ne[ot])if(Le(Ee,xe,Se,it))return!0;return!1}switch(he[ot]){case 0:return!1;case 1:return!0;case 2:{const it=Ee.slice(ke,_e);return K.test(it)&&!ce.test(it)}case 3:return We(Ee.slice(ke,_e));case 4:return ge.test(Ee.slice(ke,_e));default:return ye.test(Ee.slice(ke,_e))}}switch(pe){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return Ie.test(Ee.slice(Ce,Ge));case 5:return We(Ee.slice(Ce,Ge));case 6:{const ot=Ee.slice(Ce,Ge);return!!ot&&Number.isInteger(Number(ot))}case 7:return Ge>Ce&&Ee.charCodeAt(Ge-1)===37&&We(Ee.slice(Ce,Ge-1));case 8:return Ue.test(Ee.slice(Ce,Ge));default:return Oe(Ee,Ce,Ge)}},Te=new Set(typeof P=="string"?P.split(" "):P),Ve=(pe,Ee,Ce,Ge,ot,it)=>{const at=NS(Ee,Ce,Ge)^(ot?2654435769:0)|0;let Ht=pe.get(at);if(Ht!==void 0)e:for(let ut=0;ut<Ht.length;ut++){const At=Ht[ut];if(!(At.imp!==ot||At.k.length!==Ge-Ce)){for(let tt=0;tt<At.k.length;tt++)if(At.k.charCodeAt(tt)!==Ee.charCodeAt(Ce+tt))continue e;return At.id}}else pe.set(at,Ht=[]);const It=Ee.slice(Ce,Ge),Ze=it(It);return Ht.push({k:It,imp:ot,id:Ze}),Ze};let jt=new Map,hn=new Map,Fe=2;const Tt=4096,zt=(pe,Ee)=>{const Ce=[];let Ge=0,ot=0,it=0;for(let Ze=0;Ze<pe.length;Ze++){const ut=pe.charCodeAt(Ze);Ge===0&&ot===0&&ut===58?(Ce.push(pe.slice(it,Ze)),it=Ze+1):ut===91?Ge++:ut===93?Ge--:ut===40?ot++:ut===41&&ot--}Ce.push(pe.slice(it));let at=Ce[0];if(Ce.length>1){const Ze=[];let ut=[];for(const At of Ce)At.charCodeAt(0)===91||Te.has(At)?(ut.length&&(Ze.push(...ut.sort()),ut=[]),Ze.push(At)):ut.push(At);ut.length&&Ze.push(...ut.sort()),at=Ze.join(":")}const Ht=Ee?at+" !":at;let It=hn.get(Ht);return It===void 0&&hn.set(Ht,It=Fe++),It};let Vn=new Map,Un=r;const xs=r+4096,on=()=>Un++,ar=2097152,zr=8192,bs=new Int32Array(zr),qn=new Array(zr).fill(null),mt=new Int32Array(zr),ln=new Int32Array(zr),Gn=new Uint8Array(zr);let Rn=0;const On=(pe,Ee,Ce,Ge,ot,it,at,Ht)=>{let It=pe;if(qn[pe]!==null)if(qn[pe|1]===null)It=pe|1;else if((Rn++&3)===0)It=pe|Rn>>2&1;else return;qn[It]=Ee.slice(Ce,Ge),bs[It]=ot,mt[It]=it,ln[It]=at,Gn[It]=Ht},Bt=()=>qn.fill(null);let Wt=256,Xt=[new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt)],[Br,Kn,_n,cr]=Xt,ur=new Uint8Array(Wt),fr=new Uint8Array(Wt);const ns=()=>{Wt*=2,Xt=Xt.map(Ee=>{const Ce=new Int32Array(Wt);return Ce.set(Ee),Ce}),[Br,Kn,_n,cr]=Xt;const pe=new Uint8Array(Wt);pe.set(ur),ur=pe,fr=new Uint8Array(Wt)};let Rr=64,Or=new Int32Array(Rr),rs=new Int32Array(Rr);const oi=new Int32Array(r);let dr=2048,Ai=21,vs=new Float64Array(dr),cl=new Int32Array(dr),Ss=0;const ul=(pe,Ee)=>{if(pe===0&&Ee<r)return oi[Ee]===Ss?1:(oi[Ee]=Ss,0);const Ce=pe*2097152+Ee+1;let Ge=Math.imul(Ce,2654435761)>>>Ai;for(;cl[Ge]===Ss;){if(vs[Ge]===Ce)return 1;Ge=Ge+1&dr-1}return vs[Ge]=Ce,cl[Ge]=Ss,0},uo=(pe,Ee,Ce,Ge,ot)=>{if(Ce-Ee>=2&&pe.charCodeAt(Ee)===91&&pe.charCodeAt(Ce-1)===93){let it=-1;for(let at=Ee+1;at<Ce-1;at++)if(pe.charCodeAt(at)===58){it=at;break}return it===-1||it===Ee+1?Vi:Ve(Vn,pe,Ee+1,it,0,on)}if(Ge>=0&&u[Ge]>=0)return u[Ge];for(let it=ot-1;it>=0;it--){const at=rs[it];if(at>Ce)continue;const Ht=Or[it],It=Ce-at;if($[Ht]===1&&It>0&&It<=q){const mn=pe.charCodeAt(at);if(G===!1||mn!==91&&mn!==40){const Es=re(Ht,pe,at,Ce);if(Es>=0)return Es}}const Ze=d[Ht];if(Ze<0)continue;const ut=g[Ze],At=h[ut],tt=h[ut+1];if(At===tt)continue;Ae(pe,at,Ce);const Wn=j[Ze]-At;for(let mn=At;mn<tt;mn++)if(se(m[mn],pe,at,Ce))return y[Wn+mn]}return Vi},li=pe=>{const Ee=pe.length;let Ce=0,Ge=0,ot=!1;(Fe>Tt||jt.size>Tt)&&(jt=new Map,hn=new Map,Fe=2,Bt()),Un>xs&&(Vn=new Map,Un=r,Bt());let it=0;for(;it<Ee;){let Ze=pe.charCodeAt(it);if(Ze===32||Ze>=9&&Ze<=13||Ze>=160&&Re(Ze)){Ze!==32&&(ot=!0),it++;continue}const ut=it;let At=0;for(;it<Ee;){if(Ze=pe.charCodeAt(it),Ze<=32){if(Ze===32)break;if(Ze>=9&&Ze<=13){ot=!0;break}}else if(Ze>=160&&Re(Ze)){ot=!0;break}At=Math.imul(At^Ze,16777619),it++}const tt=it,Wn=tt-ut;Ce===Wt&&ns();const mn=Ce++;Br[mn]=ut,Kn[mn]=tt,Ge+=Wn,At^=Math.imul(Wn,2654435761);const Es=At^At>>>15|0,Dn=Es&8190;{let Ot=-1;if(bs[Dn]===Es&&qn[Dn]!==null&&qn[Dn].length===Wn?Ot=Dn:bs[Dn|1]===Es&&qn[Dn|1]!==null&&qn[Dn|1].length===Wn&&(Ot=Dn|1),Ot>=0){const er=qn[Ot];let Vs=!0;for(let Ts=0;Ts<Wn;Ts++)if(er.charCodeAt(Ts)!==pe.charCodeAt(ut+Ts)){Vs=!1;break}if(Vs){_n[mn]=mt[Ot],cr[mn]=ln[Ot],ur[mn]=Gn[Ot];continue}}}let In=ut;if(te!==0){if(tt-ut<=te||!pe.startsWith(X,ut)){_n[mn]=Vi,On(Dn,pe,ut,tt,Es,Vi,0,0);continue}In=ut+te}let hu=0,yd=0,go=-1,pu=-1;for(let Ot=In;Ot<tt;Ot++){const er=pe.charCodeAt(Ot);if(hu===0&&yd===0){if(er===58){go=Ot;continue}if(er===47){pu=Ot;continue}}er===91?hu++:er===93?hu--:er===40?yd++:er===41&&yd--}const fm=go>=In?go+1:In;let rn=fm,kr=tt,pl=!1,mu=0;kr>rn&&pe.charCodeAt(kr-1)===33?(pl=!0,kr--):kr>rn&&pe.charCodeAt(rn)===33&&(pl=!0,rn++,mu=1);let ls=-1;pu>fm&&(ls=pu+mu,ls>=kr&&(ls=-1));let gu=rn;kr-rn>1&&pe.charCodeAt(rn)===45&&(gu=rn+1);let Cs=0,Fr=0,ml=0,xd=-1,Ns=0;(d[0]>=0||$[0]===1)&&(Or[0]=0,rs[0]=gu,Ns=1);let Pa=cc,bd=0;for(let Ot=gu;Ot<kr;Ot++)if(Ot===ls&&(Pa=Fr<ml?cc:Cs,bd=Ns),Cs!==cc){const er=pe.charCodeAt(Ot);let Vs=-1;if(Fr<ml)l.charCodeAt(Fr)===er?(Fr++,Fr===ml&&(Vs=Cs=xd)):Cs=cc;else{const Ts=s[Cs],Ha=s[Cs+1];let yo=cc;for(let pr=Ts;pr<Ha;pr++){const Fa=i[pr];if(l.charCodeAt(Fa)===er){i[pr+1]-Fa===1?Vs=yo=c[pr]:(Fr=Fa+1,ml=i[pr+1],xd=c[pr],yo=Cs);break}}Cs=yo}if(Vs>=0&&(d[Vs]>=0||$[Vs]===1)&&Ot+1<kr&&pe.charCodeAt(Ot+1)===45){if(Ns===Rr){Rr*=2;const Ts=new Int32Array(Rr);Ts.set(Or),Or=Ts;const Ha=new Int32Array(Rr);Ha.set(rs),rs=Ha}Or[Ns]=Vs,rs[Ns]=Ot+2,Ns++}}ls===kr&&(Pa=Fr<ml?cc:Cs,bd=Ns);const vd=Fr<ml?cc:Cs;let hr,$r=!1;if(ls>=0)if($r=!0,hr=uo(pe,rn,ls,Pa,bd),hr!==Vi&&hr<r&&B[hr]){const Ot=uo(pe,rn,kr,vd,Ns);Ot!==Vi&&Ot!==hr&&(hr=Ot,$r=!1)}else hr===Vi&&(hr=uo(pe,rn,kr,vd,Ns),$r=!1);else hr=uo(pe,rn,kr,vd,Ns);let za=0,Ba=0;hr===Vi?_n[mn]=Vi:(Ba=$r?1:0,za=In>=go?pl?1:0:Ve(jt,pe,In,go,pl?1:0,Ot=>zt(Ot,pl)),_n[mn]=hr,ur[mn]=Ba,cr[mn]=za),On(Dn,pe,ut,tt,Es,hr,za,Ba)}if(Ce===0)return"";if(Ce===1)return Br[0]===0&&Kn[0]===Ee?pe:pe.slice(Br[0],Kn[0]);if(Ce*U>dr){for(;Ce*U>dr;)dr<<=1,Ai--;vs=new Float64Array(dr),cl=new Int32Array(dr)}if(Fe>=ar||Un>=ar)throw new Error("cn: too many distinct classes in one merge");Ss=Ss+1|0,Ss===0&&(oi.fill(0),cl.fill(0),Ss=1);let at=!1;for(let Ze=Ce-1;Ze>=0;Ze--){const ut=_n[Ze];if(ut===Vi){fr[Ze]=1;continue}const At=cr[Ze];if(ul(At,ut)===1){fr[Ze]=0,at=!0;continue}if(fr[Ze]=1,ut<r){const tt=H[ut];if(tt>=0)for(let Wn=R[tt];Wn<R[tt+1];Wn++)ul(At,M[Wn]);if(ur[Ze]&1)for(let Wn=0;Wn<D.length;Wn++)D[Wn]===ut&&ul(At,k[Wn])}}if(!at&&!ot&&Ee===Ge+Ce-1)return pe;let Ht="",It=0;for(;It<Ce;){if(!fr[It]){It++;continue}const Ze=Br[It];let ut=Kn[It],At=It+1;for(;At<Ce&&fr[At]&&Br[At]===ut+1&&pe.charCodeAt(ut)===32;)ut=Kn[At],At++;Ht.length>0&&(Ht+=" "),Ht+=pe.slice(Ze,ut),It=At}return Ht},ss=16384,is=new Int32Array(ss*2);let fo=0,pn=1,nn=Object.create(null),Yn=Object.create(null),Hr=new Map,La=new Map,ho=0,fl=0;const _i=()=>{fo^=ss,pn=pn+1|0,fl=0},po=pe=>{let Ee=nn[pe];if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=Yn[pe],Ee!==void 0)?(nn[pe]=Ee,Ee):(Ee=li(pe),ot?(nn[pe]=Ee,++ho>de&&(ho=0,Yn=nn,nn=Object.create(null),_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},dl=pe=>{let Ee=Hr.get(pe);if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=La.get(pe),Ee!==void 0)?(Hr.set(pe,Ee),Ee):(Ee=li(pe),ot?(Hr.set(pe,Ee),++ho>de&&(ho=0,La=Hr,Hr=new Map,_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},hl=pe=>{const Ee=S0(pe,0,pe.length),Ce=(Ee&16383)+fo;return is[Ce]===(Ee^pn)||is[Ce^ss]===(Ee^pn-1)?!0:(is[Ce]=Ee^pn,++fl>ss&&_i(),!1)},ws=de===0?li:V9?pe=>{const Ee=Hr.get(pe);return Ee!==void 0?Ee:dl(pe)}:po;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?ws(arguments[0]):ws(G9.apply(null,arguments))},mergeString:ws,seenBefore:de===0?()=>!1:hl,mergeUncached:li}},G0=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let n="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const r=e;for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const l=typeof i=="string"?i:G0(i,t);l&&(n&&(n+=" "),n+=l)}return n}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(n&&(n+=" "),n+=r)}return n},q9=(e,t)=>{let n="";for(let r=0;r<e.length;r++){const s=e[r];if(!s)continue;const i=typeof s=="string"?s:G0(s,t);i&&(n&&(n+=" "),n+=i)}return n},G9=function(){return q9(arguments,!1)},K9=256,Kk=16,Y9=1024,TS=4096,W9=(e,t)=>{const n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached;let s=new Map,i=new Map,l=0,c=null,u=null,d=[],h=[],m=0;const g=(C,T,N)=>{u===null&&(u=new Array(TS).fill(""),d=new Array(TS).fill(""),h=new Array(TS).fill(""));const R=S0(C,0,C.length)&4094;if(u[R]===C&&d[R]===T)return h[R];if(u[R|1]===C&&d[R|1]===T)return h[R|1];const M=e(N?T+" "+C:C),D=u[R]===""?R:R|(u[R|1]===""?1:m++&1);return u[D]=C,d[D]=T,h[D]=M,M},y=(C,T,N,R)=>{let M=0;if(T){if(T!==C.a0)return!1;M=1}if(N){if(N!==(M===0?C.a0:C.a1))return!1;M++}if(R){if(R!==(M===0?C.a0:M===1?C.a1:C.a2))return!1;M++}return M===C.t},b=(C,T)=>{const N=C.a;let R=0;for(let M=0;M<T.length;M++){const D=T[M];if(D){if(D!==N[R])return!1;R++}}return R===C.t},w=(C,T)=>{const N=C.length,R=c===null?null:c.n;if(!T){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let M="",D=-1,k=0,I=!1;for(let H=0;H<N;H++){let z=C[H];if(z){if(typeof z!="string"){if(z=C[H]=G0(z,!0),!z)continue;I=!0}D<0&&(M=z,D=H),k++}}if(k===0)return"";if(k===1)return e(M);if(I){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let _=s.get(M);_===void 0&&(_=i.get(M),_!==void 0&&s.set(M,_));let P=null;if(_!==void 0){if(_.skip>0){_.skip--,c=null;let z=M;for(let U=D+1;U<N;U++){const j=C[U];j&&(z+=" "+j)}return g(z,"",!1)}const H=_.e;e:for(let z=0;z<H.length;z++){const U=H[z];if(U.t!==k)continue;const j=U.a;let B=1;for(let L=D+1;L<N;L++){const $=C[L];if($&&$!==j[B++])continue e}P=U;break}P!==null&&(_.miss=0)}if(P===null){let H=M;const z=[M];for(let j=D+1;j<N;j++){const B=C[j];B&&(H+=" "+B,z.push(B))}if(!n(H))return r(H);P={r:e(H),t:z.length,a0:z[0],a1:z[1],a2:z[2]??"",a:z,n:null},_===void 0?s.set(M,_={e:[],miss:0,skip:0,at:0}):++_.miss>Kk&&(_.miss=Kk,_.skip=Y9,_.e.length=0,_.at=0);const U=_.e;U.length<K9?U.push(P):(U[_.at]=P,_.at=_.at+1&255),++l>1e3&&(l=0,i=s,s=new Map)}return c!==null&&c!==P&&(c.n=P),c=P,P.r},E=C=>Array.isArray(C)?w(C.slice(),!1):e(G0(C,!0));return function(C,T,N){const R=arguments.length;if((R|1)===3){const k=c;if(k!==null){const I=k.n;if(I!==null&&y(I,C,T,N))return c=I,I.r;if(k!==I&&y(k,C,T,N))return k.r}if(R===2&&typeof T=="string"&&T!==""){const I=s.get(C);if(I!==void 0&&I.skip>0)return I.skip--,c=null,g(T,C,!0)}return w([C,T,N],!0)}if(R===1)return typeof C=="string"?e(C):E(C);const M=c;if(M!==null){const k=M.n;if(k!==null){const I=k.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===k.t)return c=k,k.r}if(M!==k){const I=M.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===M.t)return M.r}}const D=[];for(let k=0;k<R;k++)D.push(arguments[k]);return w(D,!0)}},Yk=U9($9),Ne=W9(Yk.mergeString,Yk),X9=v9("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-normal whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary font-bold text-primary-foreground hover:bg-[color-mix(in_oklch,var(--primary),var(--foreground)_12%)]",outline:"border-input bg-card hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-foreground underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function nt({className:e,variant:t="default",size:n="default",children:r,...s}){return x.jsx(x9,{"data-slot":"button",className:Ne(X9({variant:t,size:n,className:e})),...s,children:typeof r=="string"?x.jsx("span",{className:"text-box-cap",children:r}):r})}const Q9=({logoSrc:e,name:t})=>x.jsx("img",{src:e,alt:t,width:"32",height:"32",className:"size-8"}),Z9={column:"max-w-5xl px-4 sm:px-6",full:"px-6"},J9=({brand:e,width:t="column",children:n})=>x.jsx("header",{className:"sticky top-0 z-40 bg-sign text-sign-foreground",children:x.jsxs("div",{className:Ne("mx-auto flex h-14 w-full items-center justify-between gap-6",Z9[t]),children:[e,n]})}),e7="/logo-small.png",t7="Flight Plan",n7="Settings",r7="/setup/",s7="mx-auto max-w-5xl px-4 pt-8 pb-16 sm:px-6",i7="The backend did not say what went wrong.",o7=()=>{const[e,t]=O.useState(null),n=Fk({select:s=>s.some(i=>i.staticData.isFullWidth===!0)}),r=Fk({select:s=>s.some(i=>i.routeId===r7)});return x.jsx(Qj,{value:e,children:x.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[x.jsxs(J9,{width:n?"full":"column",brand:x.jsx(Ff,{to:"/",className:"shrink-0 rounded-sm",children:x.jsx(Q9,{logoSrc:e7,name:t7})}),children:[x.jsx("div",{ref:t,className:"flex min-w-0 flex-1 items-center border-l border-sign-foreground/20 pl-6 empty:hidden"}),r?null:x.jsx(Ff,{to:"/settings",className:"shrink-0 rounded-sm text-sm text-sign-muted hover:text-sign-foreground",children:n7})]}),x.jsx("main",{className:Ne("w-full",n?"":s7),children:x.jsx(Wj,{})})]})})},l7=()=>x.jsxs("section",{className:"max-w-prose",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"This page does not exist"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:"The address does not match any page of Flight Plan."}),x.jsx(Ff,{to:"/",className:"mt-4 inline-block underline",children:"Go to your repositories"})]}),a7=({error:e})=>{const t=gs();return x.jsxs("main",{role:"alert",className:"mx-auto min-h-screen max-w-prose bg-background px-4 pt-16 text-foreground",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"Flight Plan could not start"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:i7}),x.jsx(nt,{className:"mt-4",onClick:()=>{t.invalidate()},children:"Try again"})]})},nu=OU()({beforeLoad:async({context:{queryClient:e,trpc:t},location:n})=>{const r=await e.query({...t.setup.gate.queryOptions({path:n.pathname}),staleTime:"static"});r.redirectTo!==null&&kE({to:r.redirectTo,throw:!0})},component:o7,notFoundComponent:l7,errorComponent:a7}),c7="modulepreload",u7=function(e){return"/"+e},Wk={},$t=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(d=>{if(d=u7(d),d in Wk)return;Wk[d]=!0;const h=d.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":c7,h||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),h)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},f7=[{id:"first",stopWidths:["w-3/5","w-2/5","w-1/2"]},{id:"second",stopWidths:["w-2/5","w-3/5"]}],d7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading your repositories"}),x.jsxs("div",{"aria-hidden":"true",className:"motion-safe:animate-pulse",children:[x.jsx("div",{className:"mb-6 h-9 w-48 rounded-sm bg-muted"}),f7.map(e=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] border-t-2 border-foreground pt-5 pb-6",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-7 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex flex-col gap-4 pb-1",children:[x.jsx("span",{className:"h-6 w-40 rounded-sm bg-muted"}),e.stopWidths.map(t=>x.jsx("span",{className:`h-5 rounded-sm bg-muted ${t}`},t))]})]},e.id))]})]}),h7=()=>$t(()=>import("./index-s14Wy6CE.js"),__vite__mapDeps([0,1])),p7=()=>$t(()=>import("./index-zxLaxo8R.js"),__vite__mapDeps([2,1,3,4,5])),Xk=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,m7=ys()({validateSearch:e=>({status:Xk(e.status),author:Xk(e.author),fixtureCase:typeof e.fixtureCase=="string"?e.fixtureCase:void 0}),loaderDeps:({search:e})=>({statuses:e.status??null,authors:e.author??null,fixtureCase:e.fixtureCase}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.repository.list.queryOptions(n),staleTime:"static"})},component:fn(p7,"component"),pendingComponent:d7,errorComponent:fn(h7,"errorComponent")}),g7=()=>$t(()=>import("./route-X94hglR1.js"),[]),y7=ys()({component:fn(g7,"component")}),x7=ys()({beforeLoad:()=>{kE({to:"/settings/agents",throw:!0})}}),b7={section:"agents"},v7=["w-2/5","w-3/5","w-1/2"],ru=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the settings"}),x.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-4 motion-safe:animate-pulse",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),v7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]}),S7=()=>$t(()=>import("./agents-BGNiGYQQ.js"),__vite__mapDeps([6,7])),w7=()=>$t(()=>import("./agents-DBPulyWi.js"),__vite__mapDeps([8,9,10,4,11])),E7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(b7),staleTime:"static"})},component:fn(w7,"component"),pendingComponent:ru,errorComponent:fn(S7,"errorComponent")}),C7={section:"configuration"},N7=()=>$t(()=>import("./configuration-C8ZTSPna.js"),__vite__mapDeps([12,7])),T7=()=>$t(()=>import("./configuration-DBU-Fvop.js"),__vite__mapDeps([13,9,14,11])),R7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(C7),staleTime:"static"})},component:fn(T7,"component"),pendingComponent:ru,errorComponent:fn(N7,"errorComponent")}),O7={section:"forges"},k7=()=>$t(()=>import("./forges-DwSiwqas.js"),__vite__mapDeps([15,7])),M7=()=>$t(()=>import("./forges-BOWrvfZl.js"),__vite__mapDeps([16,9,17,11])),A7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(O7),staleTime:"static"})},component:fn(M7,"component"),pendingComponent:ru,errorComponent:fn(k7,"errorComponent")}),_7={section:"repositories"},D7=()=>$t(()=>import("./repositories-BLLfYDjf.js"),__vite__mapDeps([18,7])),I7=()=>$t(()=>import("./repositories-of9BXUjW.js"),__vite__mapDeps([19,3,4,5,11])),j7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(_7),staleTime:"static"})},component:fn(I7,"component"),pendingComponent:ru,errorComponent:fn(D7,"errorComponent")}),L7=["first","second","third","fourth"],P7=["w-2/5","w-3/5","w-1/2"],z7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the setup"}),x.jsxs("div",{"aria-hidden":"true",className:"grid gap-x-10 gap-y-8 motion-safe:animate-pulse lg:grid-cols-[17rem_minmax(0,1fr)]",children:[x.jsx("span",{className:"h-9 w-64 rounded-sm bg-muted lg:col-span-2"}),x.jsx("div",{children:L7.map(e=>x.jsxs("div",{className:"grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-5 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsx("span",{className:"h-5 w-32 rounded-sm bg-muted"})]},e))}),x.jsxs("div",{className:"flex flex-col gap-4",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),P7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]})]}),B7=()=>$t(()=>import("./index-DyfuBbIJ.js"),__vite__mapDeps([20,21])),H7=()=>$t(()=>import("./index-CSoB1eP_.js"),__vite__mapDeps([22,21,3,4,10,14,17])),F7=ys()({validateSearch:e=>({step:typeof e.step=="string"?e.step:void 0}),loaderDeps:({search:e})=>({step:e.step??null}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.setup.get.queryOptions(n),staleTime:"static"})},component:fn(H7,"component"),pendingComponent:z7,errorComponent:fn(B7,"errorComponent")}),$7=e=>({artifactUrl:e.artifact,repositoryName:e.repository,targetId:e.target}),V7=()=>$t(()=>import("./download-BnmEn_Ca.js"),[]),RS=e=>typeof e=="string"?e:"",U7=ys()({validateSearch:e=>({artifact:RS(e.artifact),repository:RS(e.repository),target:RS(e.target)}),loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},deps:n})=>{const r=$7(n),s=await e.query({...t.review.importForm.queryOptions(r),staleTime:"static"});if(!s.startsAtOnce)return{importId:s.isImporting?s.importId:null,refusal:null};const i=await e.getMutationCache().build(e,t.review.import.mutationOptions()).execute(r);return await e.invalidateQueries(t.review.importForm.pathFilter()),{importId:i.importId,refusal:i.importId===null?i.message:null}},component:fn(V7,"component")}),Ui="rounded-sm bg-muted motion-safe:animate-pulse",q7=()=>x.jsxs("div",{"aria-busy":"true","aria-label":"Opening the review",className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8 px-6 pt-4",children:[x.jsx("div",{className:"col-span-2 border-b pb-3",children:x.jsx("div",{className:`h-5 w-64 ${Ui}`})}),x.jsxs("div",{className:"flex flex-col gap-4 pt-6",children:[x.jsx("div",{className:`h-5 w-28 ${Ui}`}),x.jsx("div",{className:`h-5 w-40 ${Ui}`}),x.jsx("div",{className:`h-5 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-36 ${Ui}`})]}),x.jsxs("div",{className:"flex flex-col gap-3 pt-6",children:[x.jsx("div",{className:`h-6 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[70ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[64ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[52ch] ${Ui}`}),x.jsx("div",{className:`mt-8 h-64 w-full ${Ui}`})]})]});var Bs=dj();const ube=bE(Bs),fL=()=>"Notification"in window,Q1=()=>{fL()&&Notification.permission==="default"&&Notification.requestPermission()};function ad(e){const t={subscribe(n){let r=null,s=!1,i=!1,l=!1;function c(){if(r===null){l=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(u){var d;s||(d=n.next)===null||d===void 0||d.call(n,u)},error(u){var d;s||(s=!0,(d=n.error)===null||d===void 0||d.call(n,u),c())},complete(){var u;s||(s=!0,(u=n.complete)===null||u===void 0||u.call(n),c())}}),l&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(G7,t)}};return t}function G7(e,t){return t(e)}function K7(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function i(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const l=e.subscribe({next(c){s=!0,n(c),i()},error(c){r(c)},complete(){t.abort(),i()}})})}function Y7(e){return t=>{let n=0,r=null;const s=[];function i(){r||(r=t.subscribe({next(c){for(const d of s){var u;(u=d.next)===null||u===void 0||u.call(d,c)}},error(c){for(const d of s){var u;(u=d.error)===null||u===void 0||u.call(d,c)}},complete(){for(const u of s){var c;(c=u.complete)===null||c===void 0||c.call(u)}}}))}function l(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return ad(c=>(n++,s.push(c),i(),{unsubscribe(){n--,l();const u=s.findIndex(d=>d===c);u>-1&&s.splice(u,1)}}))}}function dL(e){let t=e;const n=[],r=l=>{t!==void 0&&l.next(t),n.push(l)},s=l=>{n.splice(n.indexOf(l),1)},i=ad(l=>(r(l),()=>{s(l)}));return i.next=l=>{if(t!==l){t=l;for(const c of n)c.next(l)}},i.get=()=>t,i}function hL(e){return ad(t=>{function n(r=0,s=e.op){const i=e.links[r];if(!i)throw new Error("No more links to execute - did you forget to add an ending link?");return i({op:s,next(l){return n(r+1,l)}})}return n().subscribe(t)})}function Qk(e){return Array.isArray(e)?e:[e]}function W7(e){return t=>{const n=Qk(e.true).map(s=>s(t)),r=Qk(e.false).map(s=>s(t));return s=>ad(i=>{const l=e.condition(s.op)?n:r;return hL({op:s.op,links:l}).subscribe(i)})}}function Jh(e){"@babel/helpers - typeof";return Jh=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},Jh(e)}function X7(e,t){if(Jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q7(e){var t=X7(e,"string");return Jh(t)=="symbol"?t:t+""}function Ir(e,t,n){return(t=Q7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){Ir(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ca(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Z7(e){return typeof e=="function"}function pL(){return Object.create(null)}const J7=typeof Symbol=="function"&&!!Symbol.asyncIterator;function eq(e){return J7&&Ca(e)&&Symbol.asyncIterator in e}const KE=e=>e(),Pg={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},tq=[Pg.BAD_GATEWAY,Pg.SERVICE_UNAVAILABLE,Pg.GATEWAY_TIMEOUT,Pg.INTERNAL_SERVER_ERROR],mL=()=>{},Jk=e=>{Object.freeze&&Object.freeze(e)};function gL(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(mL,{get(i,l){if(!(typeof l!="string"||l==="then"))return gL(e,[...t,l],n)},apply(i,l,c){const u=t[t.length-1];if(u==="valueOf"||u==="toString"||u==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let d={args:c,path:t};return u==="call"?d={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(d={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),Jk(d.args),Jk(d.path),e(d)}})),n[s]}const yL=e=>gL(e,[],pL()),nq=e=>new Proxy(mL,{get(t,n){if(n!=="then")return e(n)}});function ep(e){"@babel/helpers - typeof";return ep=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},ep(e)}function rq(e,t){if(ep(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sq(e){var t=rq(e,"string");return ep(t)=="symbol"?t:t+""}function yc(e,t,n){return(t=sq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var iq=class extends Error{constructor(e){super(oq(e)),Object.assign(this,e)}};function oq(e){if("message"in e)return String(e.message)}function lq(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(Ca(e))return new iq(e)}}var tM=class extends Error{constructor(e){var t,n,r;const s=lq(e.cause),i=(t=(n=e.message)!==null&&n!==void 0?n:s==null?void 0:s.message)!==null&&t!==void 0?t:e.code;super(i,{cause:s}),yc(this,"cause",void 0),yc(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function aq(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:zg(zg({},e),{},{error:n})}}return{ok:!0,result:zg(zg({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var OS=class extends Error{constructor(){super("Unable to transform response from server")}};function cq(e,t){let n;try{n=aq(e,t)}catch{throw new OS}if(!n.ok&&(!Ca(n.error.error)||typeof n.error.error.code!="number"))throw new OS;if(n.ok&&!Ca(n.result))throw new OS;return n}function uq(e){return typeof e=="function"}async function fq(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(i=>t===i||t.startsWith(i+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function dq(e){const{type:t,path:n}=e,r=await fq(e.router,n);if(!r||!uq(r)||r._def.type!==t&&!e.allowMethodOverride)throw new tM({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});/* istanbul ignore if -- @preserve */if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new tM({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}let xL;const kS=new WeakMap,hq=()=>{};xL=Symbol.toStringTag;var bL=class dc{constructor(t){yc(this,"promise",void 0),yc(this,"subscribers",[]),yc(this,"settlement",null),yc(this,xL,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const n=this.promise.then(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:r},s==null||s.forEach(({resolve:i})=>{i(r)})});"catch"in n&&n.catch(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"rejected",reason:r},s==null||s.forEach(({reject:i})=>{i(r)})})}subscribe(){let t,n;const{settlement:r}=this;if(r===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const s=mq();this.subscribers=gq(this.subscribers,s),t=s.promise,n=()=>{this.subscribers!==null&&(this.subscribers=xq(this.subscribers,s))}}else{const{status:s}=r;s==="fulfilled"?t=Promise.resolve(r.value):t=Promise.reject(r.reason),n=hq}return Object.assign(t,{unsubscribe:n})}then(t,n){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.then(t,n),{unsubscribe:s})}catch(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.catch(t),{unsubscribe:r})}finally(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.finally(t),{unsubscribe:r})}static proxy(t){const n=dc.getSubscribablePromise(t);return typeof n<"u"?n:dc.createSubscribablePromise(t)}static createSubscribablePromise(t){const n=new dc(t);return kS.set(t,n),kS.set(n,n),n}static getSubscribablePromise(t){return kS.get(t)}static resolve(t){const n=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return dc.proxy(n).subscribe()}static async any(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async race(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async raceReferences(t){const n=t.map(pq);try{return await Promise.race(n)}finally{for(const r of n)r.unsubscribe()}}};function pq(e){return bL.proxy(e).then(()=>[e])}function mq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function gq(e,t){return[...e,t]}function yq(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xq(e,t){const n=e.indexOf(t);return n!==-1?yq(e,n):e}var nM,rM,sM,iM;(rM=(nM=Symbol).dispose)!==null&&rM!==void 0||(nM.dispose=Symbol());(iM=(sM=Symbol).asyncDispose)!==null&&iM!==void 0||(sM.asyncDispose=Symbol());function bq(e,t){const n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r==null||r.call(n)},n}function vq(e,t){const n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await(r==null?void 0:r.call(n))},n}const vL=Symbol();function Sq(e){let t=null;return bq({start(){if(t)throw new Error("Timer already started");return new Promise(n=>{t=setTimeout(()=>n(vL),e)})}},()=>{t&&clearTimeout(t)})}function SL(){var e=typeof SuppressedError=="function"?SuppressedError:function(s,i){var l=Error();return l.name="SuppressedError",l.error=s,l.suppressed=i,l},t={},n=[];function r(s,i){if(i!=null){if(Object(i)!==i)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var l=i[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=i[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var c=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");c&&(l=function(){try{c.call(i)}catch(d){return Promise.reject(d)}}),n.push({v:i,d:l,a:s})}else s&&n.push({d:i,a:s});return i}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var i,l=this.e,c=0;function u(){for(;i=n.pop();)try{if(!i.a&&c===1)return c=0,n.push(i),Promise.resolve().then(u);if(i.d){var h=i.d.call(i.v);if(i.a)return c|=2,Promise.resolve(h).then(u,d)}else c|=1}catch(m){return d(m)}if(c===1)return l!==t?Promise.reject(l):Promise.resolve();if(l!==t)throw l}function d(h){return l=l!==t?new e(h,l):h,u()}return u()}}}function wL(e,t){this.v=e,this.k=t}function oM(e){return new wL(e,0)}function wq(e){return function(){return new Ch(e.apply(this,arguments))}}function Ch(e){var t,n;function r(i,l){try{var c=e[i](l),u=c.value,d=u instanceof wL;Promise.resolve(d?u.v:u).then(function(h){if(d){var m=i==="return"?"return":"next";if(!u.k||h.done)return r(m,h);h=e[m](h).value}s(c.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}function s(i,l){switch(i){case"return":t.resolve({value:l,done:!0});break;case"throw":t.reject(l);break;default:t.resolve({value:l,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(i,l){return new Promise(function(c,u){var d={key:i,arg:l,resolve:c,reject:u,next:null};n?n=n.next=d:(t=n=d,r(i,l))})},typeof e.return!="function"&&(this.return=void 0)}Ch.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ch.prototype.next=function(e){return this._invoke("next",e)},Ch.prototype.throw=function(e){return this._invoke("throw",e)},Ch.prototype.return=function(e){return this._invoke("return",e)};const Eq="ping",Cq="serialized-error",Nq="connected",Tq="return";async function Rq(e){try{var t=SL();const n=t.u(Sq(e.timeoutMs)),r=await bL.race([e.promise,n.start()]);return r===vL?await e.onTimeout():r}catch(n){t.e=n}finally{t.d()}}function Oq(e){const{deserialize:t=c=>c}=e;let n=pL();const r=e.signal;let s=null;const i=()=>new ReadableStream({async start(c){const[u,d]=await Promise.all([e.url(),e.init()]),h=s=new e.EventSource(u,d);c.enqueue({type:"connecting",eventSource:s,event:null}),h.addEventListener(Nq,g=>{const y=JSON.parse(g.data);n=y,c.enqueue({type:"connected",options:y,eventSource:h})}),h.addEventListener(Cq,g=>{const y=g;c.enqueue({type:"serialized-error",error:t(JSON.parse(y.data)),eventSource:h})}),h.addEventListener(Eq,()=>{c.enqueue({type:"ping",eventSource:h})}),h.addEventListener(Tq,()=>{h.close(),c.close(),s=null}),h.addEventListener("error",g=>{h.readyState===h.CLOSED?c.error(g):c.enqueue({type:"connecting",eventSource:h,event:g})}),h.addEventListener("message",g=>{const y=g,b={data:t(JSON.parse(y.data))};y.lastEventId&&(b.id=y.lastEventId),c.enqueue({type:"data",data:b,eventSource:h})});const m=()=>{try{h.close(),c.close()}catch{}};r.aborted?m():r.addEventListener("abort",m)},cancel(){s==null||s.close()}}),l=()=>{let c=i(),u=c.getReader();async function d(){await u.cancel(),s=null}return vq({read(){return u.read()},async recreate(){await d(),c=i(),u=c.getReader()}},d)};return KE(wq(function*(){try{var c=SL();const u=c.a(l());for(;;){let d=u.read();const h=n.reconnectAfterInactivityMs;h&&(d=Rq({promise:d,timeoutMs:h,onTimeout:async()=>{const g={value:{type:"timeout",ms:h,eventSource:s},done:!1};return await u.recreate(),g}}));const m=yield oM(d);if(m.done)return m.value;yield m.value}}catch(u){c.e=u}finally{yield oM(c.d())}}))}function kq(e){return e instanceof la}function Mq(e){return Ca(e)&&Ca(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Aq(e,t){return typeof e=="string"?e:Ca(e)&&typeof e.message=="string"?e.message:t}var la=class w0 extends Error{constructor(t,n){var r,s;const i=n==null?void 0:n.cause;super(t,{cause:i}),Ir(this,"cause",void 0),Ir(this,"shape",void 0),Ir(this,"data",void 0),Ir(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,w0.prototype)}static from(t,n={}){const r=t;return kq(r)?(n.meta&&(r.meta=An(An({},r.meta),n.meta)),r):Mq(r)?new w0(r.error.message,An(An({},n),{},{result:r,cause:n.cause})):new w0(Aq(r,"Unknown error"),An(An({},n),{},{cause:r}))}};function EL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const lM=e=>typeof e=="function";function _q(e){if(e)return e;if(typeof window<"u"&&lM(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&lM(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function Dq(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const i of e)i!=null&&i.aborted?s():i==null||i.addEventListener("abort",s,{once:!0});return t.signal}function CL(...e){const t=new AbortController;for(const n of e)n!=null&&n.aborted?t.abort():n==null||n.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function Iq(e){return{url:e.url.toString(),fetch:e.fetch,transformer:EL(e.transformer),methodOverride:e.methodOverride}}function jq(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Lq={query:"GET",mutation:"POST",subscription:"PATCH"};function NL(e){return"input"in e?e.transformer.input.serialize(e.input):jq(e.inputs.map(t=>e.transformer.input.serialize(t)))}const YE=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=NL(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},Pq=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=NL(e);return t!==void 0?JSON.stringify(t):void 0},zq=e=>$q(An(An({},e),{},{contentTypeHeader:"application/json",getUrl:YE,getBody:Pq}));var Bq=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Hq=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Bq};async function Fq(e){var t,n;Hq(e.signal);const r=e.getUrl(e),s=e.getBody(e),i=(t=e.methodOverride)!==null&&t!==void 0?t:Lq[e.type],l=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),c=An(An(An({},e.contentTypeHeader&&i!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),l);return _q(e.fetch)(r,{method:i,signal:e.signal,body:s,headers:c})}async function $q(e){const t={},n=await Fq(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const aM=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function cM(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const u=[[]];let d=0;for(;;){const g=c[d];if(!g)break;const y=u[u.length-1];if(g.aborted){var h;(h=g.reject)===null||h===void 0||h.call(g,new Error("Aborted")),d++;continue}if(e.validate(y.concat(g).map(b=>b.key))){y.push(g),d++;continue}if(y.length===0){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Input is too big for a single dispatch")),d++;continue}u.push([])}return u}function i(){const c=s(t);r();for(const u of c){if(!u.length)continue;const d={items:u};for(const h of u)h.batch=d;e.fetch(d.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(g,y)=>{const b=d.items[y];try{var w;const C=await Promise.resolve(g);(w=b.resolve)===null||w===void 0||w.call(b,C)}catch(C){var E;(E=b.reject)===null||E===void 0||E.call(b,C)}b.batch=null,b.reject=null,b.resolve=null}));for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Missing result")),g.batch=null}}).catch(h=>{for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,h),g.batch=null}})}}function l(c){var u;const d={aborted:!1,key:c,batch:null,resolve:aM,reject:aM},h=new Promise((m,g)=>{var y;d.reject=g,d.resolve=m,(y=t)!==null&&y!==void 0||(t=[]),t.push(d)});return(u=n)!==null&&u!==void 0||(n=setTimeout(i)),h}return{load:l}}function Vq(e){var t,n;const r=Iq(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const l=u=>({validate(d){if(s===1/0&&i===1/0)return!0;if(d.length>i)return!1;const h=d.map(g=>g.path).join(","),m=d.map(g=>g.input);return YE(An(An({},r),{},{type:u,path:h,inputs:m,signal:null})).length<=s},async fetch(d){const h=d.map(b=>b.path).join(","),m=d.map(b=>b.input),g=Dq(...d.map(b=>b.signal)),y=await zq(An(An({},r),{},{path:h,inputs:m,type:u,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:g}));return(Array.isArray(y.json)?y.json:d.map(()=>y.json)).map(b=>({meta:y.meta,json:b}))}}),c={query:cM(l("query")),mutation:cM(l("mutation"))};return({op:u})=>ad(d=>{/* istanbul ignore if -- @preserve */if(u.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=new AbortController,m=c[u.type].load(An(An({},u),{},{signal:CL(u.signal,h.signal)}));let g=!1,y;return m.then(b=>{g=!0,y=b;const w=cq(b.json,r.transformer.output);if(!w.ok){d.error(la.from(w.error,{meta:b.meta}));return}d.next({context:b.meta,result:w.result}),d.complete()}).catch(b=>{g=!0,d.error(la.from(b,{meta:y==null?void 0:y.meta}))}),()=>{g||h.abort()}})}}const tp=(e,...t)=>typeof e=="function"?e(...t):e;function Uq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function qq(e){const t=await tp(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Gq(e,t){const n={method:"connectionParams",data:await tp(e)};return t.encode(n)}function Kq(e){const{promise:t,resolve:n,reject:r}=Uq();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function Yq(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function i(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function l(){clearTimeout(r),i()}function c(){clearTimeout(s),l()}e.addEventListener("open",i),e.addEventListener("message",({data:u})=>{clearTimeout(r),i(),u==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var Wq=class Z1{constructor(t){var n;if(Ir(this,"id",++Z1.connectCount),Ir(this,"WebSocketPonyfill",void 0),Ir(this,"urlOptions",void 0),Ir(this,"keepAliveOpts",void 0),Ir(this,"encoder",void 0),Ir(this,"wsObservable",dL(null)),Ir(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Z1.connectCount;const t=qq(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Yq(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Kq(n),this.urlOptions.connectionParams&&n.send(await Gq(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};Ir(Wq,"connectCount",0);var TL=class{constructor(e){Ir(this,"links",void 0),Ir(this,"runtime",void 0),Ir(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return hL({links:this.links,op:An(An({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Y7())}async requestAsPromise(e){try{const t=this.$request(e);return(await K7(t)).result.data}catch(t){throw la.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var i;(i=n.onStarted)===null||i===void 0||i.call(n,{context:r.context});break;case"stopped":var l;(l=n.onStopped)===null||l===void 0||l.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const RL=Symbol.for("trpc_untypedClient"),Xq={query:"query",mutate:"mutation",subscribe:"subscription"},Qq=e=>Xq[e];function Zq(e){const t=yL(({path:n,args:r})=>{const s=[...n],i=Qq(s.pop()),l=s.join(".");return e[i](l,...r)});return nq(n=>n===RL?e:t[n])}function Jq(e){return Zq(new TL(e))}function eG(e){return e[RL]}function tG(e,t){return!t||e!=null&&typeof e!="object"?e:An(An({},e??{}),{},{lastEventId:t})}function nG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new E0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function E0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return E0=function(r){this.s=r,this.n=r.next},E0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new E0(e)}async function rG(e){let t=await tp(e.url);if(e.connectionParams){const n=await tp(e.connectionParams),r=t.includes("?")?"&":"?";t+=r+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return t}function sG(e){const t=EL(e.transformer);return()=>({op:n})=>ad(r=>{var s;const{type:i,path:l,input:c}=n;/* istanbul ignore if -- @preserve */if(i!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let u;const d=new AbortController,h=CL(n.signal,d.signal),m=Oq({url:async()=>YE({transformer:t,url:await rG(e),input:tG(c,u),path:l,type:i,signal:null}),init:()=>tp(e.eventSourceOptions,{op:n}),signal:h,deserialize:b=>t.output.deserialize(b),EventSource:(s=e.EventSource)!==null&&s!==void 0?s:globalThis.EventSource}),g=dL({type:"state",state:"connecting",error:null}),y=g.subscribe({next(b){r.next({result:b})}});return KE(async()=>{var b=!1,w=!1,E;try{for(var C=nG(m),T;b=!(T=await C.next()).done;b=!1){const N=T.value;switch(N.type){case"ping":break;case"data":const R=N.data;let M;R.id?(u=R.id,M={id:R.id,data:R}):M={data:R.data},r.next({result:M,context:{eventSource:N.eventSource}});break;case"connected":r.next({result:{type:"started"},context:{eventSource:N.eventSource}}),g.next({type:"state",state:"pending",error:null});break;case"serialized-error":{const D=la.from({error:N.error});if(tq.includes(N.error.code)){g.next({type:"state",state:"connecting",error:D});break}throw D}case"connecting":{const D=g.get(),k=N.event&&la.from(N.event);if(!k&&D.state==="connecting")break;g.next({type:"state",state:"connecting",error:k});break}case"timeout":g.next({type:"state",state:"connecting",error:new la(`Timeout of ${N.ms}ms reached while waiting for a response`)})}}}catch(N){w=!0,E=N}finally{try{b&&C.return!=null&&await C.return()}finally{if(w)throw E}}r.next({result:{type:"stopped"}}),g.next({type:"state",state:"idle",error:null}),r.complete()}).catch(b=>{r.error(la.from(b))}),()=>{r.complete(),d.abort(),y.unsubscribe()}})}function np(e){"@babel/helpers - typeof";return np=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},np(e)}function iG(e,t){if(np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oG(e){var t=iG(e,"string");return np(t)=="symbol"?t:t+""}function lG(e,t,n){return(t=oG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){lG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new C0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function C0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return C0=function(r){this.s=r,this.n=r.next},C0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new C0(e)}function cG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function uG(e,t){if(e==null)return{};var n,r,s=cG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const fG=["cursor","direction"];function Vy(e){return{path:e.path.join(".")}}function dG(e){return e.length>=3}function hG(e){return dG(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function WE(e,t,n){var r;const s=hG(e);let i=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var l,c;i=wt(wt(wt({},(l=(c=s.args)===null||c===void 0?void 0:c.input)!==null&&l!==void 0?l:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.path.join("."),i,t==null?void 0:t.trpc]}async function pG(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var i=!1,l=!1,c;try{for(var u=aG(e),d;i=!(d=await u.next()).done;i=!1){const h=d.value;s.push(h),r.setState({data:[...s]})}}catch(h){l=!0,c=h}finally{try{i&&u.return!=null&&await u.return()}finally{if(l)throw c}}return s}function Mo(e){const t=KE(()=>{const{input:n,type:r}=e,s=e.path.flatMap(i=>i.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&Ca(n)&&("direction"in n||"cursor"in n)){const{cursor:i,direction:l}=n;return[s,{input:uG(n,fG),type:"infinite"}]}return[s,wt(wt({},typeof n<"u"&&n!==ri&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function OL(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function XE(e){return Z7(e)?e():e}function mG(e){var t;const{input:n,query:r,path:s,queryKey:i,opts:l}=e,c=n===ri,u=async d=>{var h;const m=wt(wt({},l),{},{trpc:wt(wt({},l==null?void 0:l.trpc),!(l==null||(h=l.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})});return await r(...WE(i,m,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign(wt(wt({},l??{}),{},{queryKey:i,queryFn:c?ri:u,initialPageParam:(t=l==null?void 0:l.initialCursor)!==null&&t!==void 0?t:n==null?void 0:n.cursor}),{trpc:Vy({path:s})})}function gG(e){var t,n;const{mutate:r,path:s,prefix:i,opts:l,overrides:c}=e,u=XE(e.queryClient),d=OL({path:s,prefix:(t=l==null?void 0:l.keyPrefix)!==null&&t!==void 0?t:i}),h=u.defaultMutationOptions(u.getMutationDefaults(d)),m=(n=c==null?void 0:c.onSuccess)!==null&&n!==void 0?n:(y=>y.originalFn()),g=async y=>await r(...WE([...d,{input:y}],l));return wt(wt({},l),{},{mutationKey:d,mutationFn:g,onSuccess(...y){var b,w;return m({originalFn:()=>{var C,T,N;return(C=l==null||(T=l.onSuccess)===null||T===void 0?void 0:T.call(l,...y))!==null&&C!==void 0?C:h==null||(N=h.onSuccess)===null||N===void 0?void 0:N.call(h,...y)},queryClient:u,meta:(b=(w=l==null?void 0:l.meta)!==null&&w!==void 0?w:h==null?void 0:h.meta)!==null&&b!==void 0?b:{}})},trpc:Vy({path:s})})}function yG(e){const{input:t,query:n,path:r,queryKey:s,opts:i}=e,l=XE(e.queryClient),c=t===ri,u=async d=>{var h;const m=wt(wt({},i),{},{trpc:wt(wt({},i==null?void 0:i.trpc),!(i==null||(h=i.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})}),g=d.queryKey,y=await n(...WE(g,m));return eq(y)?pG(y,l,g):y};return Object.assign(wt(wt({},i),{},{queryKey:s,queryFn:c?ri:u}),{trpc:Vy({path:r})})}const xG=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:i={}}=e,l="enabled"in i?!!i.enabled:s!==ri,c=u=>t(n.join("."),s===ri?void 0:s,u);return wt(wt({},i),{},{enabled:l,subscribe:c,queryKey:r,trpc:Vy({path:n})})};function bG(e){const t=O.useRef(e);t.current=e;const n=O.useRef(new Set([])),r=O.useCallback(m=>{n.current.add(m)},[]),s=O.useRef(()=>{}),i=O.useCallback(()=>{var m;if((m=s.current)===null||m===void 0||m.call(s),h(l),!e.enabled)return;const g=e.subscribe({onStarted:()=>{var y,b;(y=(b=t.current).onStarted)===null||y===void 0||y.call(b),h(w=>wt(wt({},w),{},{status:"pending",error:null}))},onData:y=>{var b,w;(b=(w=t.current).onData)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"pending",data:y,error:null}))},onError:y=>{var b,w;(b=(w=t.current).onError)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"error",error:y}))},onConnectionStateChange:y=>{var b,w;(b=(w=t.current).onConnectionStateChange)===null||b===void 0||b.call(w,y),h(E=>{switch(y.state){case"connecting":return wt(wt({},E),{},{status:"connecting",error:y.error});case"pending":return E;case"idle":return wt(wt({},E),{},{status:"idle",data:void 0,error:null})}})}});s.current=()=>{g.unsubscribe()}},[va(e.queryKey),e.enabled]),l=O.useCallback(()=>e.enabled?{data:void 0,error:null,status:"connecting",reset:i}:{data:void 0,error:null,status:"idle",reset:i},[e.enabled,i]),c=O.useRef(l()),[u,d]=O.useState(fM(c,r));u.reset=i;const h=O.useCallback(m=>{const g=c.current,y=c.current=m(g);let b=!1;for(const w of n.current)if(g[w]!==y[w]){b=!0;break}b&&d(fM(c,r))},[r]);return O.useEffect(()=>{if(e.enabled)return i(),()=>{var m;(m=s.current)===null||m===void 0||m.call(s)}},[i,e.enabled]),u}function fM(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function kL(e){const t=e.keyPrefix,n=r=>(s,i,l)=>"router"in e?Promise.resolve(XE(e.ctx)).then(c=>dq({router:e.router,path:s,getRawInput:async()=>i,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof TL?e.client:eG(e.client))[r](s,i,l);return yL(({args:r,path:s})=>{const i=[...s],l=i.pop(),[c,u]=r;return{"~types":void 0,pathKey:()=>Mo({path:i,type:"any",prefix:t}),pathFilter:()=>wt(wt({},c),{},{queryKey:Mo({path:i,type:"any",prefix:t})}),queryOptions:()=>yG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>Mo({path:i,input:c,type:"query",prefix:t}),queryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>mG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>Mo({path:i,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var d;return gG({opts:c,path:i,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(d=e.overrides)===null||d===void 0?void 0:d.mutations})},mutationKey:()=>OL({path:i,prefix:t}),subscriptionOptions:()=>xG({opts:u,path:i,input:c,queryKey:Mo({path:i,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[l]()})}function vG(){const e=O.createContext(null),t=O.createContext(null),n=i=>{const l=O.useMemo(()=>kL({client:i.trpcClient,queryClient:i.queryClient,keyPrefix:i.keyPrefix}),[i.trpcClient,i.queryClient,i.keyPrefix]);return O.createElement(e.Provider,{value:i.trpcClient},O.createElement(t.Provider,{value:l},i.children))};n.displayName="TRPCProvider";function r(){const i=O.useContext(t);if(!i)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return i}function s(){const i=O.useContext(e);if(!i)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return i}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const dM="/api/trpc",{TRPCProvider:SG,useTRPC:ii}=vG(),wG=()=>[W7({condition:e=>e.type==="subscription",true:sG({url:dM}),false:Vq({url:dM})})],EG=e=>Jq({links:e}),CG=(e,t)=>kL({client:e,queryClient:t}),NG={blue:"[--line:var(--line-blue)]",green:"[--line:var(--line-green)]",magenta:"[--line:var(--line-magenta)]",violet:"[--line:var(--line-violet)]",teal:"[--line:var(--line-teal)]",lime:"[--line:var(--line-lime)]"},TG={...NG,primary:"[--line:var(--primary)]"},RG=({lineColor:e})=>x.jsx("span",{"aria-hidden":"true",className:Ne("pointer-events-none absolute inset-x-0 bottom-0 h-1 bg-(--line)",TG[e])}),ML=3,OG=1,cd=2,QE=.5,kG=.3,MG=1.5,MS={added:"var(--diff-added)",modified:"var(--line-blue)",deleted:"var(--diff-removed)"},AL=e=>(e+ML+OG)*cd,hM=e=>e==="plain",AG=e=>Math.max(MG,e*kG),_L=({centre:e,radius:t})=>{const n=t*QE;return`M${String(e-n)} ${String(e)}h${String(n*cd)}`},_G=e=>{const t=e.radius*QE;return`${_L(e)}M${String(e.centre)} ${String(e.centre-t)}v${String(t*cd)}`},DG=({centre:e,radius:t})=>{const n=t*QE,r=n*cd;return`M${String(e-n)} ${String(e-n)}l${String(r)} ${String(r)}m0 ${String(-r)}l${String(-r)} ${String(r)}`},IG=({centre:e,radius:t})=>`M${String(e)} ${String(e-t)}a${String(t)} ${String(t)} 0 0 1 0 ${String(t*cd)}z`,AS=({path:e,radius:t})=>x.jsx("path",{d:e,strokeWidth:AG(t),className:"fill-none stroke-background [stroke-linecap:round]"}),_S=({shape:{centre:e,radius:t},ink:n,children:r=null})=>x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:e,cy:e,r:t,fill:n}),x.jsx("circle",{cx:e,cy:e,r:t+ML,stroke:n,className:"fill-none [stroke-width:1.5]"}),r]}),jG=(e,t)=>{const{centre:n,radius:r}=t;switch(e){case"added":return x.jsx(_S,{shape:t,ink:MS.added,children:x.jsx(AS,{path:_G(t),radius:r})});case"modified":return x.jsx(_S,{shape:t,ink:MS.modified});case"deleted":return x.jsx(_S,{shape:t,ink:MS.deleted,children:x.jsx(AS,{path:_L(t),radius:r})});case"breaks":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-destructive"}),x.jsx(AS,{path:DG(t),radius:r})]});case"behaviour-changes":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-background stroke-foreground [stroke-width:2]"}),x.jsx("path",{d:IG(t),className:"fill-foreground"})]});case"plain":return x.jsx("circle",{cx:n,cy:n,r,className:"fill-muted-foreground"})}},DL=({mark:e,radius:t,className:n})=>{const r=AL(t);return x.jsx("svg",{"aria-hidden":"true",width:r,height:r,viewBox:`0 0 ${String(r)} ${String(r)}`,"data-mark":e,className:Ne("shrink-0",n),children:jG(e,{centre:r/cd,radius:t})})},IL=O.createContext(void 0);function su(e){const t=O.useContext(IL);if(!e&&t===void 0)throw new Error(wn(27));return t}const jL="data-starting-style",LG="data-ending-style",PG={[jL]:""},zG={[LG]:""},ZE={transitionStatus(e){return e==="starting"?PG:e==="ending"?zG:null}},BG="data-open",HG="data-closed",FG="data-anchor-hidden",LL="data-popup-open",$G="data-pressed",VG={[LL]:""},UG={[LL]:"",[$G]:""},qG={[BG]:""},GG={[HG]:""},KG={[FG]:""},JE={open(e){return e?VG:null}},J1={open(e){return e?UG:null}},Uy={open(e){return e?qG:GG},anchorHidden(e){return e?KG:null}},zp={...Uy,...ZE},YG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,forceRender:l=!1,...c}=t,u=su(),d=u.useState("open"),h=u.useState("nested"),m=u.useState("mounted"),g=u.useState("transitionStatus");return dn("div",t,{state:{open:d,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:zp,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!h})}),qy="none",rl="trigger-press",xn="trigger-hover",bf="trigger-focus",eC="outside-press",tC="item-press",PL="close-press",Bc="focus-out",Bp="escape-key",ew="list-navigation",WG="cancel-open",Nh="sibling-open",XG="disabled",Hp="imperative-action";function gt(e,t,n,r){let s=!1,i=!1;const l=r??Tn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...l}}const zL=O.forwardRef(function(t,n){const{render:r,className:s,style:i,disabled:l=!1,nativeButton:c=!0,...u}=t,d=su(),h=d.useState("open"),{getButtonProps:m,buttonRef:g}=Pp({disabled:l,native:c}),y={disabled:l};function b(w){h&&d.setOpen(!1,gt(PL,w.nativeEvent))}return dn("button",t,{state:y,ref:[n,g],props:[{onClick:b},u,m]})});let pM=0;function QG(e,t="mui"){const[n,r]=O.useState(e),s=e||n;return O.useEffect(()=>{n==null&&(pM+=1,r(`${t}-${pM}`))},[n,t]),s}const mM=$E.useId;function Uf(e,t){if(mM!==void 0){const n=mM();return e??(t?`${t}-${n}`:n)}return QG(e,t)}function lo(e){return Uf(e,"base-ui")}const ZG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("descriptionElementId",d),dn("p",t,{ref:n,props:[{id:d},c]})});function nC(e){O.useEffect(e,Zh)}const dh=0;class si{constructor(){_t(this,"currentId",dh);_t(this,"clear",()=>{this.currentId!==dh&&(clearTimeout(this.currentId),this.currentId=dh)});_t(this,"disposeEffect",()=>this.clear)}static create(){return new si}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dh,n()},t)}isStarted(){return this.currentId!==dh}}function Jr(){const e=Tr(si.create).current;return nC(e.disposeEffect),e}function JG(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:eK,platform:tK,maxTouchPoints:nK}=JG(),Gy=eK.toLowerCase(),rp=tK.toLowerCase(),Ky=/^i(os$|p)/.test(rp)||rp==="macintel"&&nK>1,gM="android",tw=rp===gM||Gy.includes(gM),rC=!Ky&&rp.startsWith("mac");rp.startsWith("win");const rK=rC||Ky;var QI;const Aa=typeof CSS<"u"&&!!((QI=CSS.supports)!=null&&QI.call(CSS,"-webkit-backdrop-filter:none"));!Aa&&Gy.includes("firefox");!Aa&&Gy.includes("chrom");const sK=rK,sC=/jsdom|happydom/.test(Gy);function Ki(e){e.preventDefault(),e.stopPropagation()}function iK(e){return"nativeEvent"in e}function iC(e){return e.pointerType===""&&e.isTrusted?!0:tw&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oC(e){return sC?!1:!tw&&e.width===0&&e.height===0||tw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ha(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function oK(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Xr(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Je(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&$f(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Zr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const nw="data-base-ui-focusable",BL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Yy="ArrowLeft",Wy="ArrowRight",HL="ArrowUp",lC="ArrowDown",rw="data-trigger-disabled";function K0(e,t){if(!bt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(rw);for(const[,r]of t.entries())if(Je(r,n))return!r.hasAttribute(rw);return!1}function DS(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function lK(e){return e.matches("html,body")}function Xy(e){return Zt(e)&&e.matches(BL)}function aK(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${BL}`))!=null}function sw(e){return e?e.getAttribute("role")==="combobox"&&Xy(e):!1}function cK(e){if(!e||sC)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function iw(e){return e?e.hasAttribute(nw)?e:e.querySelector(`[${nw}]`)||e:null}function uK(e,t){return t!=null&&!ha(t)?0:typeof e=="function"?e():e}function sp(e,t,n){const r=uK(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function yM(e){return typeof e=="function"?e():e}function FL(e,t){return t||e==="click"||e==="mousedown"}function fK(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const dK=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new si,currentIdRef:{current:null},currentContextRef:{current:null}});function hK(e,t){e.current=t.current}function pK(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),i=O.useContext(dK),{currentIdRef:l,delayRef:c,timeoutMs:u,initialDelayRef:d,currentContextRef:h,hasProvider:m,timeout:g}=i,[y,b]=O.useState(!1),w=O.useRef(n);return ze(()=>{w.current=n},[n]),ze(()=>{function E(){var C;(C=h.current)==null||C.setIsInstantPhase(!1),l.current=null,h.current=null,c.current=d.current,g.clear()}if(l.current&&!n&&l.current===s){if(b(!1),u){const C=s;return g.start(u,()=>{r.select("open")||l.current&&l.current!==C||E()}),()=>{(w.current||l.current!==C)&&g.clear()}}E()}},[n,s,l,c,u,d,h,g,r]),ze(()=>{if(!n)return;const E=h.current,C=l.current;g.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:b},l.current=s,c.current={open:0,close:sp(d.current,"close")},C!==null&&C!==s?(b(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,gt(qy))):(b(!1),E==null||E.setIsInstantPhase(!1))},[n,s,r,l,c,d,h,g]),ze(()=>()=>{if(l.current===s){if(h.current=null,!w.current)return;l.current=null,hK(c,d),g.clear()}},[h,l,c,s,d,g]),O.useMemo(()=>({activeIdRef:l,hasProvider:m,delayRef:c,isInstantPhase:y}),[l,m,c,y])}function xt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function no(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Hn(e){const t=Tr(mK,e).current;return t.next=e,ze(t.effect),t}function mK(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Bg=null;class gK{constructor(){_t(this,"callbacks",[]);_t(this,"callbacksCount",0);_t(this,"nextId",1);_t(this,"startId",1);_t(this,"isScheduled",!1);_t(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)(s=n[i])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Hg=new gK;class Qi{constructor(){_t(this,"currentId",Bg);_t(this,"cancel",()=>{this.currentId!==Bg&&(Hg.cancel(this.currentId),this.currentId=Bg)});_t(this,"disposeEffect",()=>this.cancel)}static create(){return new Qi}static request(t){return Hg.request(t)}static cancel(t){return Hg.cancel(t)}request(t){this.cancel(),this.currentId=Hg.request(()=>{this.currentId=Bg,t()})}}function ip(){const e=Tr(Qi.create).current;return nC(e.disposeEffect),e}const yK={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},xK={...yK,position:"fixed",top:0,left:0},Na=O.forwardRef(function(t,n){const[r,s]=O.useState();ze(()=>{sK&&Aa&&s("button")},[]);const i={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:xK,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),qf=Math.min,Wo=Math.max,Y0=Math.round,Fg=Math.floor,Xo=e=>({x:e,y:e}),bK={left:"right",right:"left",bottom:"top",top:"bottom"};function $L(e,t,n){return Wo(e,qf(t,n))}function Ta(e,t){return typeof e=="function"?e(t):e}function ti(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function aC(e){return e==="x"?"y":"x"}function cC(e){return e==="y"?"height":"width"}function ei(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function uC(e){return aC(ei(e))}function vK(e,t,n){n===void 0&&(n=!1);const r=sl(e),s=uC(e),i=cC(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=W0(l)),[l,W0(l)]}function SK(e){const t=W0(e);return[ow(e),t,ow(t)]}function ow(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xM=["left","right"],bM=["right","left"],wK=["top","bottom"],EK=["bottom","top"];function CK(e,t,n){switch(e){case"top":case"bottom":return n?t?bM:xM:t?xM:bM;case"left":case"right":return t?wK:EK;default:return[]}}function NK(e,t,n,r){const s=sl(e);let i=CK(ti(e),n==="start",r);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(ow)))),i}function W0(e){const t=ti(e);return bK[t]+e.slice(t.length)}function TK(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function VL(e){return typeof e!="number"?TK(e):{top:e,right:e,bottom:e,left:e}}function X0(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function vM(e,t){return t<0||t>=e.length}function IS(e,t){return ff(e.current,{disabledIndices:t})}function SM(e,t){return ff(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ff(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let i=t;do i+=n?-s:s;while(i>=0&&i<=e.length-1&&UL(e,i,r));return i}function UL(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Qy(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function RK(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Qy(e,t=e?zs(e):null){return!e||!e.isConnected||!t||RK(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const OK='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function kK(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return $f(n)?n.host:null}function lw(e){for(const t of Array.from(e.children))if(Nr(t)==="summary")return t;return null}function MK(e,t){const n=lw(t);return!!n&&(e===n||Je(n,e))}function qL(e){const t=e?Nr(e):"";return e!=null&&e.matches(OK)&&(t!=="summary"||e.parentElement!=null&&Nr(e.parentElement)==="details"&&lw(e.parentElement)===e)&&(t!=="details"||lw(e)==null)&&(t!=="input"||e.type!=="hidden")}function GL(e){if(!qL(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=kK(t)){const n=t!==e,r=Nr(t)==="slot";if(t.hasAttribute("inert")||n&&Nr(t)==="details"&&!t.open&&!MK(e,t)||t.hasAttribute("hidden")||!r&&!AK(t,n))return!1}return!0}function AK(e,t){const n=zs(e);return t?n.display!=="none":Qy(e,n)}function KL(e){const t=e.tabIndex;if(t<0){const n=Nr(e);if(n==="details"||n==="audio"||n==="video"||Zt(e)&&e.isContentEditable)return 0}return t}function jS(e){if(Nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function _K(e,t){const n=jS(e);if(!n)return!0;const r=t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form&&i.checked});return r?r===n:t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form})===n}function YL(e){if(Zt(e)&&Nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function WL(e,t){YL(e).forEach(n=>{qL(n)&&t.push(n),WL(n,t)})}function XL(e,t,n){YL(e).forEach(r=>{Zt(r)&&r.matches(t)&&n.push(r),XL(r,t,n)})}function fC(e){return GL(e)&&KL(e)>=0}function QL(e){const t=[];return WL(e,t),t.filter(GL)}function Fp(e){const t=QL(e);return t.filter(n=>KL(n)>=0&&_K(n,t))}function ZL(e,t){const n=Fp(e),r=n.length;if(r===0)return;const s=Xr(Dt(e)),i=n.indexOf(s),l=i===-1?t===1?0:r-1:i+t;return n[l]}function dC(e){return ZL(Dt(e).body,1)||e}function JL(e){return ZL(Dt(e).body,-1)||e}function eP(e,t){if(!e)return null;const n=Fp(Dt(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const i=(s+t+r)%r;return n[i]}function DK(e){return eP(e,1)}function IK(e){return eP(e,-1)}function vf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Je(n,r)}function jK(e){Fp(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wM(e){const t=[];XL(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ra(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var i;return[...!n||(i=s.context)!=null&&i.open?[s]:[],...Ra(e,s.id,n)]})}function EM(e,t){var s;let n=[],r=(s=e.find(i=>i.id===t))==null?void 0:s.parentId;for(;r;){const i=e.find(l=>l.id===r);r=i==null?void 0:i.parentId,i&&(n=n.concat(i))}return n}function op(e){return`data-base-ui-${e}`}let $g=0;function N0(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame($g);function i(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return i(),Bn;const l=requestAnimationFrame(i);return $g=l,()=>{$g===l&&(cancelAnimationFrame(l),$g=0)}}const LS={inert:new WeakMap,"aria-hidden":new WeakMap},CM="data-base-ui-inert",aw={inert:new WeakSet,"aria-hidden":new WeakSet};let hh=new WeakMap,PS=0;function LK(e){return aw[e]}function tP(e){return e?$f(e)?e.host:tP(e.parentNode):null}const NM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=tP(n);return e.contains(r)?r:null}).filter(n=>n!=null),TM=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},RM=(e,t,n)=>{const r=[],s=i=>{!i||n.has(i)||Array.from(i.children).forEach(l=>{Nr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function PK(e,t,n,r,{mark:s=!0}){let i=null;r?i="inert":n&&(i="aria-hidden");let l=null,c=null;const u=NM(t,e),d=s?RM(t,TM(u),new Set(u)):[],h=[],m=[];if(i){const g=LS[i],y=LK(i);c=y,l=g;const b=NM(t,Array.from(t.querySelectorAll("[aria-live]"))),w=u.concat(b);RM(t,TM(w),new Set(w)).forEach(C=>{const T=C.getAttribute(i),N=T!==null&&T!=="false",R=(g.get(C)||0)+1;g.set(C,R),h.push(C),R===1&&N&&y.add(C),N||C.setAttribute(i,i==="inert"?"":"true")})}return s&&d.forEach(g=>{const y=(hh.get(g)||0)+1;hh.set(g,y),m.push(g),y===1&&g.setAttribute(CM,"")}),PS+=1,()=>{l&&h.forEach(g=>{const b=(l.get(g)||0)-1;l.set(g,b),b||(!(c!=null&&c.has(g))&&i&&g.removeAttribute(i),c==null||c.delete(g))}),s&&m.forEach(g=>{const y=(hh.get(g)||0)-1;hh.set(g,y),y||g.removeAttribute(CM)}),PS-=1,PS||(LS.inert=new WeakMap,LS["aria-hidden"]=new WeakMap,aw.inert=new WeakSet,aw["aria-hidden"]=new WeakSet,hh=new WeakMap)}}function OM(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,i=Dt(e[0]).body;return PK(e,i,n,r,{mark:s})}const zK=500,nP=500,BK={style:{transition:"none"}},rP="data-base-ui-click-trigger",HK={fallbackAxisSide:"none"},Zy={fallbackAxisSide:"end"},FK={clipPath:"inset(50%)",position:"fixed",top:0,left:0},sP=O.createContext(null),iP=()=>O.useContext(sP),$K=op("portal");function oP(e={}){const{ref:t,container:n,componentProps:r=Tn,elementProps:s}=e,i=Uf(),l=iP(),c=l==null?void 0:l.portalNode,[u,d]=O.useState(null),[h,m]=O.useState(null),g=Qe(E=>{E!==null&&m(E)}),y=O.useRef(null);ze(()=>{if(n===null){y.current&&(y.current=null,m(null),d(null));return}const E=(n&&(BE(n)?n:n.current))??c??document.body;if(E==null){y.current&&(y.current=null,m(null),d(null));return}y.current!==E&&(y.current=E,m(null),d(E))},[n,c]);const b=dn("div",r,{ref:[t,g],props:[{id:i,[$K]:""},s]}),w=u&&b?Bs.createPortal(b,u):null;return{node:h,nodeId:O.isValidElement(b)?b.props.id:void 0,subtree:w}}const hC=O.forwardRef(function(t,n){const{render:r,className:s,style:i,children:l,container:c,portalOwnerRole:u,...d}=t,{node:h,nodeId:m,subtree:g}=oP({container:c,ref:n,componentProps:t,elementProps:d}),y=O.useRef(null),b=O.useRef(null),w=O.useRef(null),E=O.useRef(null),[C,T]=O.useState(null),N=O.useRef(!1),R=C==null?void 0:C.modal,M=C==null?void 0:C.open,D=!!C&&!C.modal&&C.open&&!!h;O.useEffect(()=>{if(!h||R)return;function I(_){h&&_.relatedTarget&&vf(_)&&(_.type==="focusin"?N.current&&(wM(h),N.current=!1):(jK(h),N.current=!0))}return no(xt(h,"focusin",I,!0),xt(h,"focusout",I,!0))},[h,R]),ze(()=>{!h||M!==!0||!N.current||(wM(h),N.current=!1)},[M,h]);const k=O.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:w,afterInsideRef:E,portalNode:h,setFocusManagerState:T}),[h]);return x.jsxs(O.Fragment,{children:[g,x.jsxs(sP.Provider,{value:k,children:[D&&h&&x.jsx(Na,{"data-type":"outside",ref:y,onFocus:I=>{var _;if(vf(I,h))(_=w.current)==null||_.focus();else{const P=C?C.domReference:null,H=JL(P);H==null||H.focus()}}}),D&&h&&x.jsx("span",{role:u,"aria-owns":m,style:FK}),h&&Bs.createPortal(l,h),D&&h&&x.jsx(Na,{"data-type":"outside",ref:b,onFocus:I=>{var _;if(vf(I,h))(_=E.current)==null||_.focus();else{const P=C?C.domReference:null,H=dC(P);H==null||H.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,gt(Bc,I.nativeEvent)))}}})]})]})});function lP(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class pC{constructor(){_t(this,"nodesRef",{current:[]});_t(this,"events",lP())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const aP=O.createContext(null),cP=O.createContext(null),iu=()=>{var e;return((e=O.useContext(aP))==null?void 0:e.id)||null},_a=e=>{const t=O.useContext(cP);return e??t};function Jy(e){const t=Uf(),n=_a(e),r=iu();return ze(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function mC(e){const{children:t,id:n}=e,r=iu();return x.jsx(aP.Provider,{value:O.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gC(e){const{children:t,externalTree:n}=e,r=Tr(()=>n??new pC).current;return x.jsx(cP.Provider,{value:r,children:t})}function Io(e){return e==null?e:"current"in e?e.current:e}function VK(e,t){const n=vn(Zr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const kM=20;let aa=[];function yC(){aa=aa.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function MM(e){yC(),e&&Nr(e)!=="body"&&(aa.push(new WeakRef(e)),aa.length>kM&&(aa=aa.slice(-kM)))}function AM(){var e;return yC(),(e=aa[aa.length-1])==null?void 0:e.deref()}function UK(e){return e?fC(e)?e:Fp(e)[0]||e:null}function _M(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=QL(e).filter(i=>{const l=i.getAttribute("data-tabindex")||"";return fC(i)||i.hasAttribute("data-tabindex")&&!l.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function xC(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:y,getInsideElements:b}=e,w="rootStore"in t?t.rootStore:t,E=w.useState("open"),C=w.useState("domReferenceElement"),T=w.useState("floatingElement"),{events:N,dataRef:R}=w.context,M=Qe(()=>{var oe;return(oe=R.current.floatingContext)==null?void 0:oe.nodeId}),D=s===!1,k=sw(C)&&D,I=Hn(s),_=Hn(i),P=Hn(d),H=Hn(E),z=_a(y),U=iP(),j=O.useRef(!1),B=O.useRef(!1),L=O.useRef(!1),$=O.useRef(null),q=O.useRef(""),G=O.useRef(""),W=O.useRef(null),Z=O.useRef(null),re=Vf(W,g,U==null?void 0:U.beforeInsideRef),de=Vf(Z,U==null?void 0:U.afterInsideRef),F=Jr(),X=Jr(),te=ip(),J=U!=null,K=iw(T),ce=Qe((oe=K)=>oe?Fp(oe):[]),ye=Qe(()=>(b==null?void 0:b().filter(oe=>oe!=null))??[]);O.useEffect(()=>{if(r||!c)return;function oe(Se){Se.key==="Tab"&&Je(K,Xr(Dt(K)))&&ce().length===0&&!k&&Ki(Se)}const xe=Dt(K);return xt(xe,"keydown",oe)},[r,K,c,k,ce]),O.useEffect(()=>{if(r||!E)return;const oe=Dt(K);function xe(){L.current=!1}function Se(_e){const we=Zr(_e),Re=ye(),Ae=Je(T,we)||Je(C,we)||Je(U==null?void 0:U.portalNode,we)||Re.some(Le=>Le===we||Je(Le,we));L.current=!Ae,G.current=_e.pointerType||"keyboard",we!=null&&we.closest(`[${rP}]`)&&(B.current=!0,X.start(0,()=>{B.current=!1}))}function ke(){G.current="keyboard"}return no(xt(oe,"pointerdown",Se,!0),xt(oe,"pointerup",xe,!0),xt(oe,"pointercancel",xe,!0),xt(oe,"keydown",ke,!0),xe)},[r,T,C,K,E,U,X,ye]),O.useEffect(()=>{if(r||!u)return;const oe=Dt(K);function xe(){B.current=!0,X.start(0,()=>{B.current=!1})}function Se(Re){const Ae=Zr(Re);fC(Ae)&&($.current=Ae)}function ke(Re){const Ae=Re.relatedTarget,Le=Re.currentTarget,Ie=Zr(Re);c&&Ae==null&&Ie!=null&&Je(T,Ie)&&MM(Ie),queueMicrotask(()=>{const Ue=M(),We=w.context.triggerElements,Oe=ye(),De=(Ae==null?void 0:Ae.hasAttribute(op("focus-guard")))&&[W.current,Z.current,U==null?void 0:U.beforeInsideRef.current,U==null?void 0:U.afterInsideRef.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,Io(m),Io(h)].includes(Ae),ne=!(Je(C,Ae)||Je(T,Ae)||Je(Ae,T)||Je(U==null?void 0:U.portalNode,Ae)||Oe.some(he=>he===Ae||Je(he,Ae))||We.hasMatchingElement(he=>Je(he,Ae))||De||z&&(Ra(z.nodesRef.current,Ue).find(he=>{var se,Te;return Je((se=he.context)==null?void 0:se.elements.floating,Ae)||Je((Te=he.context)==null?void 0:Te.elements.domReference,Ae)})||EM(z.nodesRef.current,Ue).find(he=>{var se,Te,Ve;return[(se=he.context)==null?void 0:se.elements.floating,iw((Te=he.context)==null?void 0:Te.elements.floating)].includes(Ae)||((Ve=he.context)==null?void 0:Ve.elements.domReference)===Ae})));if(Le===C&&K&&_M(K),l&&Le!==C&&!Qy(Ie)&&Xr(oe)===oe.body){if(Zt(K)&&(K.focus(),l==="popup")){te.request(()=>{K.focus()});return}const he=ce(),se=$.current,Te=(se&&he.includes(se)?se:null)||he[he.length-1]||K;Zt(Te)&&Te.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(k||!c)&&Ae&&ne&&!B.current&&(k||Ae!==AM())&&(j.current=!0,w.setOpen(!1,gt(Bc,Re)))})}function _e(){L.current||(R.current.insideReactTree=!0,F.start(0,()=>{R.current.insideReactTree=!1}))}const we=Zt(C)?C:null;if(!(!T&&!we))return no(we&&xt(we,"focusout",ke),we&&xt(we,"pointerdown",xe),T&&xt(T,"focusin",Se),T&&xt(T,"focusout",ke),T&&U&&xt(T,"focusout",_e,!0))},[r,C,T,K,c,z,U,w,u,l,ce,k,M,R,F,X,te,h,m,ye]),O.useEffect(()=>{var Le,Ie,Ue;if(r||!T||!E)return;const oe=Array.from(((Le=U==null?void 0:U.portalNode)==null?void 0:Le.querySelectorAll(`[${op("portal")}]`))||[]),Se=(Ue=(Ie=(z?EM(z.nodesRef.current,M()):[]).find(We=>{var Oe;return sw(((Oe=We.context)==null?void 0:Oe.elements.domReference)||null)}))==null?void 0:Ie.context)==null?void 0:Ue.elements.domReference,_e=[...[T,...oe,W.current,Z.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,...ye()],Se,Io(m),Io(h),k?C:null].filter(We=>We!=null),we=OM(_e,{ariaHidden:c||k,mark:!1}),Re=[T,...oe].filter(We=>We!=null),Ae=OM(Re);return()=>{Ae(),we()}},[E,r,C,T,c,U,k,z,M,h,m,ye]),ze(()=>{if(!E||r||!Zt(K))return;q.current="",G.current="";const oe=Dt(K),xe=Xr(oe);queueMicrotask(()=>{const Se=I.current,ke=typeof Se=="function"?Se(P.current||""):Se;if(ke===void 0||ke===!1||Je(K,xe))return;let we=null;const Re=()=>(we==null&&(we=ce(K)),we[0]||K);let Ae;ke===!0||ke===null?Ae=Re():Ae=Io(ke),Ae=Ae||Re();const Le=Je(K,Xr(oe));N0(Ae,{preventScroll:Ae===K,shouldFocus(){if(!H.current)return!1;if(Le)return!0;const Ie=Xr(oe);return!(Ie!==Ae&&Je(K,Ie))}})})},[r,E,K,ce,I,P,H]),ze(()=>{if(r||!K)return;const oe=Dt(K),xe=Xr(oe),Se=P.current==null;MM(xe);function ke(we){if(we.open||(q.current=VK(we.nativeEvent,G.current)),we.reason===xn&&we.nativeEvent.type==="mouseleave"&&(j.current=!0),we.reason===eC)if(we.nested)j.current=!1;else if(iC(we.nativeEvent)||oC(we.nativeEvent))j.current=!1;else{let Re=!1;Dt(K).createElement("div").focus({get preventScroll(){return Re=!0,!1}}),Re?j.current=!1:j.current=!0}}N.on("openchange",ke);function _e(we){const Re=_.current;let Ae=typeof Re=="function"?Re(we):Re;if(Ae===void 0||Ae===!1)return null;Ae===null&&(Ae=!0);const Le=C!=null&&C.isConnected?C:null,Ie=xe!=null&&xe.isConnected&&Nr(xe)!=="body"?xe:null;let Ue=Se?Ie||Le:Le||Ie;return Ue||(Ue=AM()||null),typeof Ae=="boolean"?Ue:Io(Ae)||Ue||null}return()=>{N.off("openchange",ke);const we=Xr(oe),Re=ye(),Ae=Je(T,we)||Re.some(We=>We===we||Je(We,we))||z&&Ra(z.nodesRef.current,M(),!1).some(We=>{var Oe;return Je((Oe=We.context)==null?void 0:Oe.elements.floating,we)}),Le=_.current,Ie=q.current,Ue=_e(Ie);queueMicrotask(()=>{const We=UK(Ue),Oe=typeof Le!="boolean";if(Le&&!j.current&&Zt(We)&&(!(!Oe&&We!==we&&we!==oe.body)||Ae)){const De={preventScroll:!0};Ie==="keyboard"&&(De.focusVisible=!0),We.focus(De)}j.current=!1})}},[r,T,K,_,P,N,z,C,M,ye]),ze(()=>{if(!Aa||E||!T)return;const oe=Xr(Dt(T));!Zt(oe)||!Xy(oe)||Je(T,oe)&&oe.blur()},[E,T]),ze(()=>{if(!(r||!U))return U.setFocusManagerState({modal:c,closeOnFocusOut:u,open:E,onOpenChange:w.setOpen,domReference:C}),()=>{U.setFocusManagerState(null)}},[r,U,c,E,w,u,C]),ze(()=>{if(!(r||!K))return _M(K),()=>{queueMicrotask(yC)}},[r,K]);const ge=!r&&(c?!k:!0)&&(J||c);return x.jsxs(O.Fragment,{children:[ge&&x.jsx(Na,{"data-type":"inside",ref:re,onFocus:oe=>{var xe;if(c){const Se=ce();N0(Se[Se.length-1])}else if(U!=null&&U.portalNode)if(j.current=!1,vf(oe,U.portalNode)){const Se=dC(C);Se==null||Se.focus()}else(xe=Io(m??U.beforeOutsideRef))==null||xe.focus()}}),n,ge&&x.jsx(Na,{"data-type":"inside",ref:de,onFocus:oe=>{var xe;if(c)N0(ce()[0]);else if(U!=null&&U.portalNode)if(u&&(j.current=!0),vf(oe,U.portalNode)){const Se=JL(C);Se==null||Se.focus()}else(xe=Io(h??U.afterOutsideRef))==null||xe.focus()}})]})}function uP(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=rl}=t,d="rootStore"in e?e.rootStore:e,h=d.context.dataRef,m=O.useRef(void 0),g=ip(),y=Jr(),b=O.useMemo(()=>{function w(C,T,N,R){const M=gt(u,T,N);C&&R==="touch"&&c>0?y.start(c,()=>{d.setOpen(!0,M)}):d.setOpen(C,M)}function E(C,T,N){const R=h.current.openEvent,M=d.select("domReferenceElement")!==T;return C&&M||!C||!s?!0:R&&l?!N(R.type):!1}return{onPointerDown(C){m.current=ha(C.pointerType,!0)&&oC(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const T=m.current,N=C.nativeEvent,R=d.select("open");if(C.button!==0||r==="click"||ha(T,!0)&&i)return;const M=E(R,C.currentTarget,I=>I==="click"||I==="mousedown"),D=Zr(N);if(Xy(D)){w(M,N,D,T);return}const k=C.currentTarget;g.request(()=>{w(M,N,k,T)})},onClick(C){if(r==="mousedown-only")return;const T=m.current;if(r==="mousedown"&&T){m.current=void 0;return}if(ha(T,!0)&&i)return;const N=d.select("open"),R=E(N,C.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");w(R,C.nativeEvent,C.currentTarget,T)},onKeyDown(){m.current=void 0}}},[h,r,i,u,d,l,s,g,y,c]);return O.useMemo(()=>n?{reference:b}:Tn,[n,b])}function qK(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var y;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(((y=t.dataRef.current.openEvent)==null?void 0:y.type)||"")&&t.pointerType!=="touch";let d=i.width,h=i.height,m=i.x,g=i.y;return n==null&&t.x&&l&&(n=i.x-t.x),r==null&&t.y&&c&&(r=i.y-t.y),m-=n||0,g-=r||0,d=0,h=0,!s||u?(d=t.axis==="y"?i.width:0,h=t.axis==="x"?i.height:0,m=l&&t.x!=null?t.x:m,g=c&&t.y!=null?t.y:g):s&&!u&&(h=t.axis==="x"?i.height:h,d=t.axis==="y"?i.width:d),s=!0,{width:d,height:h,x:m,y:g,top:g,right:m+d,bottom:g+h,left:m}}}}function DM(e){return e!=null&&e.clientX!=null}function GK(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),u=s.context.dataRef,d=O.useRef(!1),h=O.useRef(null),[m,g]=O.useState(),[y,b]=O.useState([]),w=Qe(R=>{s.set("positionReference",R)}),E=Qe((R,M,D)=>{d.current||u.current.openEvent&&!DM(u.current.openEvent)||s.set("positionReference",qK(D??c,{x:R,y:M,axis:r,dataRef:u,pointerType:m}))}),C=Qe(R=>{i?h.current||(E(R.clientX,R.clientY,R.currentTarget),b([])):E(R.clientX,R.clientY,R.currentTarget)}),T=ha(m)?l:i;O.useEffect(()=>{if(!n){w(c);return}if(!T)return;function R(){var k;(k=h.current)==null||k.call(h),h.current=null}const M=vn(l);function D(k){const I=Zr(k);Je(l,I)?R():E(k.clientX,k.clientY)}return!u.current.openEvent||DM(u.current.openEvent)?h.current=xt(M,"mousemove",D):w(c),R},[T,n,l,u,c,s,E,w,y]),O.useEffect(()=>()=>{s.set("positionReference",null)},[s]),O.useEffect(()=>{n&&!l&&(d.current=!1)},[n,l]),O.useEffect(()=>{!n&&i&&(d.current=!0)},[n,i]);const N=O.useMemo(()=>{function R(M){g(M.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:C,onMouseEnter:C}},[C]);return O.useMemo(()=>n?{reference:N,trigger:N}:{},[n,N])}function KK(){return!1}function YK(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $p(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:i="sloppy",referencePress:l=KK,bubbles:c,externalTree:u}=t,d="rootStore"in e?e.rootStore:e,h=d.useState("open"),m=d.useState("floatingElement"),{dataRef:g,events:y}=d.context,b=_a(u),w=Qe(typeof s=="function"?s:()=>!1),E=typeof s=="function"?w:s,C=E!==!1,T=Qe(()=>i),{escapeKey:N,outsidePress:R}=YK(c),M=O.useRef(!1),D=O.useRef(!1),k=O.useRef(!1),I=O.useRef(!1),_=O.useRef(!1),P=O.useRef(""),H=O.useRef(null),z=Jr(),U=Jr(),j=Qe(()=>{U.clear(),g.current.insideReactTree=!1}),B=Qe(F=>{var J;const X=(J=g.current.floatingContext)==null?void 0:J.nodeId;return(b?Ra(b.nodesRef.current,X):[]).some(K=>{var ce;return((ce=K.context)==null?void 0:ce.open)&&!K.context.dataRef.current[F]})}),L=Qe(F=>DS(F,d.select("floatingElement"))||DS(F,d.select("domReferenceElement"))),$=Qe(F=>{l()&&d.setOpen(!1,gt(rl,F.nativeEvent))}),q=Qe(F=>{if(!h||!n||!r||F.key!=="Escape"||_.current||!N&&B("__escapeKeyBubbles"))return;const X=iK(F)?F.nativeEvent:F,te=gt(Bp,X);d.setOpen(!1,te),te.isCanceled||F.preventDefault(),!N&&!te.isPropagationAllowed&&F.stopPropagation()}),G=Qe(()=>{g.current.insideReactTree=!0,U.start(0,j)}),W=Qe(F=>{if(!h||!n||F.button!==0)return;const X=Zr(F.nativeEvent);Je(d.select("floatingElement"),X)&&(M.current||(M.current=!0,D.current=!1))}),Z=Qe(F=>{!h||!n||(F.defaultPrevented||F.nativeEvent.defaultPrevented)&&M.current&&(D.current=!0)});O.useEffect(()=>{function F(X){X.open||(I.current=!1)}return y.on("openchange",F),()=>{y.off("openchange",F)}},[y]),O.useEffect(()=>{if(!h||!n)return h||(I.current=!1),j;g.current.__escapeKeyBubbles=N,g.current.__outsidePressBubbles=R;const F=new si,X=new si,te=Dt(m);function J(){F.clear(),_.current=!0}function K(){F.start(Aa?5:0,()=>{_.current=!1})}function ce(){k.current=!0,X.start(0,()=>{k.current=!1})}function ye(){M.current=!1,D.current=!1}function ge(){const ne=P.current,he=ne==="pen"||!ne?"mouse":ne,se=T(),Te=typeof se=="function"?se():se;return typeof Te=="string"?Te:Te[he]}function oe(ne){const he=ge();return he==="intentional"&&ne.type!=="click"||he==="sloppy"&&ne.type==="click"}function xe(ne){var Te;const he=(Te=g.current.floatingContext)==null?void 0:Te.nodeId,se=b&&Ra(b.nodesRef.current,he).some(Ve=>{var jt;return DS(ne,(jt=Ve.context)==null?void 0:jt.elements.floating)});return L(ne)||se}function Se(ne){if(oe(ne)){ne.type!=="click"&&!L(ne)&&(X.clear(),k.current=!1),j();return}if(g.current.insideReactTree){j();return}const he=Zr(ne),se=`[${op("inert")}]`,Te=bt(he)?he.getRootNode():null,Ve=Array.from(($f(Te)?Te:Dt(d.select("floatingElement"))).querySelectorAll(se)),jt=d.context.triggerElements;if(he&&(jt.hasElement(he)||jt.hasMatchingElement(Fe=>Je(Fe,he))))return;let hn=bt(he)?he:null;for(;hn&&!Ko(hn);){const Fe=nl(hn);if(Ko(Fe)||!bt(Fe))break;hn=Fe}if(!(Ve.length&&bt(he)&&!lK(he)&&!Je(he,d.select("floatingElement"))&&Ve.every(Fe=>!Je(hn,Fe)))){if(Zt(he)&&!("touches"in ne)){const Fe=Ko(he),Tt=zs(he),zt=/auto|scroll/,Vn=Fe||zt.test(Tt.overflowX),Un=Fe||zt.test(Tt.overflowY),xs=Vn&&he.clientWidth>0&&he.scrollWidth>he.clientWidth,on=Un&&he.clientHeight>0&&he.scrollHeight>he.clientHeight,ar=Tt.direction==="rtl",zr=on&&(ar?ne.offsetX<=he.offsetWidth-he.clientWidth:ne.offsetX>he.clientWidth),bs=xs&&ne.offsetY>he.clientHeight;if(zr||bs)return}if(!xe(ne)){if(ge()==="intentional"){if(ne.detail!==0&&!iC(ne)&&!I.current)return;if(k.current){X.clear(),k.current=!1;return}}typeof E=="function"&&!E(ne)||B("__outsidePressBubbles")||(d.setOpen(!1,gt(eC,ne)),j())}}}function ke(ne){ge()!=="sloppy"||ne.pointerType==="touch"||!d.select("open")||!n||L(ne)||Se(ne)}function _e(ne){if(ge()!=="sloppy"||!d.select("open")||!n||L(ne))return;const he=ne.touches[0];he&&(H.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function we(ne,he){const se=Zr(ne);if(!se)return;const Te=xt(se,ne.type,()=>{he(ne),Te()})}function Re(ne){P.current="touch",we(ne,_e)}function Ae(ne){z.clear(),ne.type==="pointerdown"&&(ne.button===0&&(I.current=!0),P.current=ne.pointerType),!(ne.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&we(ne,he=>{he.type==="pointerdown"?ke(he):Se(he)})}function Le(ne){if(ne.type==="pointercancel"&&(I.current=!1),!M.current)return;const he=D.current;if(ye(),ge()==="intentional"){if(ne.type==="pointercancel"){he&&ce();return}if(!xe(ne)){if(he){ce();return}typeof E=="function"&&!E(ne)||(X.clear(),k.current=!0,j())}}}function Ie(ne){if(ge()!=="sloppy"||!H.current||L(ne))return;const he=ne.touches[0];if(!he)return;const se=Math.abs(he.clientX-H.current.startX),Te=Math.abs(he.clientY-H.current.startY),Ve=Math.sqrt(se*se+Te*Te);Ve>5&&(H.current.dismissOnTouchEnd=!0),Ve>10&&(Se(ne),z.clear(),H.current=null)}function Ue(ne){we(ne,Ie)}function We(ne){ge()!=="sloppy"||!H.current||L(ne)||(H.current.dismissOnTouchEnd&&Se(ne),z.clear(),H.current=null)}function Oe(ne){we(ne,We)}const De=no(r&&no(xt(te,"keydown",q),xt(te,"compositionstart",J),xt(te,"compositionend",K)),C&&no(xt(te,"click",Ae,!0),xt(te,"pointerdown",Ae,!0),xt(te,"pointerup",Le,!0),xt(te,"pointercancel",Le,!0),xt(te,"mousedown",Ae,!0),xt(te,"mouseup",Le,!0),xt(te,"touchstart",Re,{capture:!0,passive:!0}),xt(te,"touchmove",Ue,{capture:!0,passive:!0}),xt(te,"touchend",Oe,{capture:!0,passive:!0})));return()=>{De(),F.clear(),X.clear(),ye(),k.current=!1,j()}},[g,m,r,C,E,h,n,N,R,q,j,T,B,L,b,d,z]);const re=O.useMemo(()=>({onKeyDown:q,onPointerDown:$,onClick:$}),[q,$]),de=O.useMemo(()=>({onKeyDown:q,onPointerDown:Z,onMouseDown:Z,onClickCapture:G,onMouseDownCapture(F){G(),W(F)},onPointerDownCapture(F){G(),W(F)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[q,G,W,Z]);return O.useMemo(()=>n?{reference:re,floating:de,trigger:re}:{},[n,re,de])}function IM(e,t,n){let{reference:r,floating:s}=e;const i=ei(t),l=uC(t),c=cC(l),u=ti(t),d=i==="y",h=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let y;switch(u){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}const b=sl(t);return b&&(y[l]+=g*(b==="end"?1:-1)*(n&&d?-1:1)),y}async function WK(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:y=0}=Ta(t,e),b=VL(y),E=c[g?m==="floating"?"reference":"floating":m],C=X0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),T=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(N))&&await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1},M=X0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:N,strategy:u}):T);return{top:(C.top-M.top+b.top)/R.y,bottom:(M.bottom-C.bottom+b.bottom)/R.y,left:(C.left-M.left+b.left)/R.x,right:(M.right-C.right+b.right)/R.x}}const XK=50,QK=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:WK},u=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:m}=IM(d,r,u),g=r,y=0;const b={};for(let w=0;w<i.length;w++){const E=i[w];if(!E)continue;const{name:C,fn:T}=E,{x:N,y:R,data:M,reset:D}=await T({x:h,y:m,initialPlacement:r,placement:g,strategy:s,middlewareData:b,rects:d,platform:c,elements:{reference:e,floating:t}});h=N??h,m=R??m,b[C]={...b[C],...M},D&&y<XK&&(y++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(d=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:h,y:m}=IM(d,g,u)),w=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:b}},ZK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...E}=Ta(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=ti(s),T=ei(c),N=ti(c)===c,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),M=g||(N||!w?[W0(c)]:SK(c)),D=b!=="none";!g&&D&&M.push(...NK(c,w,b,R));const k=[c,...M],I=await u.detectOverflow(t,E),_=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&_.push(I[C]),m){const j=vK(s,l,R);_.push(I[j[0]],I[j[1]])}if(P=[...P,{placement:s,overflows:_}],!_.every(j=>j<=0)){var H,z;const j=(((H=i.flip)==null?void 0:H.index)||0)+1,B=k[j];if(B&&(!(m==="alignment"?T!==ei(B):!1)||P.every(q=>ei(q.placement)===T?q.overflows[0]>0:!0)))return{data:{index:j,overflows:P},reset:{placement:B}};let L=(z=P.filter($=>$.overflows[0]<=0).sort(($,q)=>$.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!L)switch(y){case"bestFit":{var U;const $=(U=P.filter(q=>{if(D){const G=ei(q.placement);return G===T||G==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(G=>G>0).reduce((G,W)=>G+W,0)]).sort((q,G)=>q[1]-G[1])[0])==null?void 0:U[0];$&&(L=$);break}case"initialPlacement":L=c;break}if(s!==L)return{reset:{placement:L}}}return{}}}},fP=new Set(["left","top"]);async function JK(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ti(n),c=sl(n),u=ei(n)==="y",d=fP.has(l)?-1:1,h=i&&u?-1:1,m=Ta(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),u?{x:y*h,y:g*d}:{x:g*d,y:y*h}}const eY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:l,middlewareData:c}=t,u=await JK(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:l}}}}},tY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:u={fn:T=>{let{x:N,y:R}=T;return{x:N,y:R}}},...d}=Ta(e,t),h={x:n,y:r},m=await i.detectOverflow(t,d),g=ei(s),y=aC(g);let b=h[y],w=h[g];const E=(T,N)=>$L(N+m[T==="y"?"top":"left"],N,N-m[T==="y"?"bottom":"right"]);l&&(b=E(y,b)),c&&(w=E(g,w));const C=u.fn({...t,[y]:b,[g]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[g]:c}}}}}},nY=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:l,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=Ta(e,t),g={x:s,y:i},y=ei(l),b=aC(y);let w=g[b],E=g[y];const C=Ta(d,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(h){const M=b==="y"?"height":"width",D=c.reference[b]-c.floating[M]+T.mainAxis,k=c.reference[b]+c.reference[M]-T.mainAxis;w<D?w=D:w>k&&(w=k)}if(m){var N,R;const M=b==="y"?"width":"height",D=fP.has(ti(l)),k=c.reference[y]-c.floating[M]+(D&&((N=u.offset)==null?void 0:N[y])||0)+(D?0:T.crossAxis),I=c.reference[y]+c.reference[M]+(D?0:((R=u.offset)==null?void 0:R[y])||0)-(D?T.crossAxis:0);E<k?E=k:E>I&&(E=I)}return{[b]:w,[y]:E}}}},rY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Ta(e,t),u=await s.detectOverflow(t,c),d=ti(n),h=sl(n),m=ei(n)==="y",{width:g,height:y}=r.floating;let b,w;d==="top"||d==="bottom"?(b=d,w=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,b=h==="end"?"top":"bottom");const E=y-u.top-u.bottom,C=g-u.left-u.right,T=qf(y-u[b],E),N=qf(g-u[w],C),R=t.middlewareData.shift,M=!R;let D=T,k=N;R!=null&&R.enabled.x&&(k=C),R!=null&&R.enabled.y&&(D=E),M&&!h&&(m?k=g-2*Wo(u.left,u.right):D=y-2*Wo(u.top,u.bottom)),await l({...t,availableWidth:k,availableHeight:D});const I=await s.getDimensions(i.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function dP(e){const t=zs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Zt(e),i=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=Y0(n)!==i||Y0(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function bC(e){return bt(e)?e:e.contextElement}function Sf(e){const t=bC(e);if(!Zt(t))return Xo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=dP(t);let l=(i?Y0(n.width):n.width)/r,c=(i?Y0(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const sY=Xo(0);function hP(e){const t=vn(e);return!FE()||!t.visualViewport?sY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iY(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vn(e)}function Hc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=bC(e);let l=Xo(1);t&&(r?bt(r)&&(l=Sf(r)):l=Sf(e));const c=iY(i,n,r)?hP(i):Xo(0);let u=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,h=s.width/l.x,m=s.height/l.y;if(i&&r){const g=vn(i),y=bt(r)?vn(r):r;let b=g,w=K1(b);for(;w&&y!==b;){const E=Sf(w),C=w.getBoundingClientRect(),T=zs(w),N=C.left+(w.clientLeft+parseFloat(T.paddingLeft))*E.x,R=C.top+(w.clientTop+parseFloat(T.paddingTop))*E.y;u*=E.x,d*=E.y,h*=E.x,m*=E.y,u+=N,d+=R,b=vn(w),w=K1(b)}}return X0({width:h,height:m,x:u,y:d})}function ex(e,t){const n=Fy(e).scrollLeft;return t?t.left+n:Hc(ol(e)).left+n}function pP(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ex(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function oY(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",l=ol(r),c=t?Hy(t.floating):!1;if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Xo(1);const h=Xo(0),m=Zt(r);if((m||!i)&&((Nr(r)!=="body"||Lp(l))&&(u=Fy(r)),m)){const y=Hc(r);d=Sf(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=l&&!m&&!i?pP(l,u):Xo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function lY(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function aY(e){const t=Fy(e),n=e.ownerDocument.body,r=Wo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Wo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+ex(e);const l=-t.scrollTop;return zs(n).direction==="rtl"&&(i+=Wo(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:l}}const cY=25;function uY(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=vn(e),i=ol(e),l=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,d=0,h=0;if(l){const g=!FE()||t==="fixed";r?g||(d=-l.offsetLeft,h=-l.offsetTop):(c=l.width,u=l.height,g&&(d=l.offsetLeft,h=l.offsetTop))}if(ex(i)<=0){const g=i.ownerDocument,y=g.body,b=getComputedStyle(y),w=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-y.clientWidth-w),C=getComputedStyle(i).scrollbarGutter==="stable both-edges"?E/2:E;C<=cY&&(c-=C)}return{width:c,height:u,x:d,y:h}}function fY(e,t){const n=Hc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Sf(e),l=e.clientWidth*i.x,c=e.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:l,height:c,x:u,y:d}}function jM(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=uY(e,n,t);else if(t==="document")r=aY(ol(e));else if(bt(t))r=fY(t,n);else{const s=hP(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return X0(r)}function dY(e,t){const n=t.get(e);if(n)return n;let r=Qh(e,[],!1).filter(c=>bt(c)&&Nr(c)!=="body"),s=null;const i=zs(e).position==="fixed";let l=i?nl(e):e;for(;bt(l)&&!Ko(l);){const c=zs(l),u=HE(l),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(m=>m!==l):s=c,l=nl(l)}return t.set(e,r),r}function hY(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Hy(t)?[]:dY(t,this._c):[].concat(n),r],c=jM(t,l[0],s);let u=c.top,d=c.right,h=c.bottom,m=c.left;for(let g=1;g<l.length;g++){const y=jM(t,l[g],s);u=Wo(y.top,u),d=qf(y.right,d),h=qf(y.bottom,h),m=Wo(y.left,m)}return{width:d-m,height:h-u,x:m,y:u}}function pY(e){const{width:t,height:n}=dP(e);return{width:t,height:n}}function mY(e,t,n){const r=Zt(t),s=ol(t),i=n==="fixed",l=Hc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Xo(0);if((r||!i)&&((Nr(t)!=="body"||Lp(s))&&(c=Fy(t)),r)){const g=Hc(t,!0,i,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}!r&&s&&(u.x=ex(s));const d=s&&!r&&!i?pP(s,c):Xo(0),h=l.left+c.scrollLeft-u.x-d.x,m=l.top+c.scrollTop-u.y-d.y;return{x:h,y:m,width:l.width,height:l.height}}function zS(e){return zs(e).position==="static"}function LM(e,t){if(!Zt(e)||zs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ol(e)===n&&(n=n.ownerDocument.body),n}function mP(e,t){const n=vn(e);if(Hy(e))return n;if(!Zt(e)){let s=nl(e);for(;s&&!Ko(s);){if(bt(s)&&!zS(s))return s;s=nl(s)}return n}let r=LM(e,t);for(;r&&VU(r)&&zS(r);)r=LM(r,t);return r&&Ko(r)&&zS(r)&&!HE(r)?n:r||GU(e)||n}const gY=async function(e){const t=this.getOffsetParent||mP,n=this.getDimensions,r=await n(e.floating);return{reference:mY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yY(e){return zs(e).direction==="rtl"}const xY={convertOffsetParentRelativeRectToViewportRelativeRect:oY,getDocumentElement:ol,getClippingRect:hY,getOffsetParent:mP,getElementRects:gY,getClientRects:lY,getDimensions:pY,getScale:Sf,isElement:bt,isRTL:yY};function gP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bY(e,t,n){let r=null,s;const i=ol(e);function l(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),l();const g=e.getBoundingClientRect(),{left:y,top:b,width:w,height:E}=g;if(h||t(),!w||!E)return;const C=Fg(b),T=Fg(i.clientWidth-(y+w)),N=Fg(i.clientHeight-(b+E)),R=Fg(y),D={rootMargin:-C+"px "+-T+"px "+-N+"px "+-R+"px",threshold:Wo(0,qf(1,m))||1};let k=!0;function I(_){const P=_[0].intersectionRatio;if(!gP(g,e.getBoundingClientRect()))return c();if(P!==m){if(!k)return c();P?c(!1,P):s=setTimeout(()=>{c(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(I,{...D,root:i.ownerDocument})}catch{r=new IntersectionObserver(I,D)}r.observe(e)}const u=vn(e),d=()=>c(n);return u.addEventListener("resize",d),c(!0),()=>{u.removeEventListener("resize",d),l()}}function PM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=bC(e),h=s||i?[...d?Qh(d):[],...t?Qh(t):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),i&&C.addEventListener("resize",n)});const m=d&&c?bY(d,n,i):null;let g=-1,y=null;l&&(y=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),d&&!u&&y.observe(d),t&&y.observe(t));let b,w=u?Hc(e):null;u&&E();function E(){const C=Hc(e);w&&!gP(w,C)&&n(),w=C,b=requestAnimationFrame(E)}return n(),()=>{var C;h.forEach(T=>{s&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),m==null||m(),(C=y)==null||C.disconnect(),y=null,u&&cancelAnimationFrame(b)}}const vY=eY,SY=tY,wY=ZK,EY=rY,CY=nY,NY=(e,t,n)=>{const r=new Map,s=n??{},i={...xY,...s.platform,_c:r};return QK(e,t,{...s,platform:i})};var TY=typeof document<"u",RY=function(){},T0=TY?O.useLayoutEffect:RY;function Q0(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,s;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(!Q0(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zM(e,t){const n=yP(e);return Math.round(t*n)/n}function BS(e){const t=O.useRef(e);return T0(()=>{t.current=e}),t}function OY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=O.useState(r);Q0(g,r)||y(r);const[b,w]=O.useState(null),[E,C]=O.useState(null),T=O.useCallback(q=>{q!==D.current&&(D.current=q,w(q))},[]),N=O.useCallback(q=>{q!==k.current&&(k.current=q,C(q))},[]),R=i||b,M=l||E,D=O.useRef(null),k=O.useRef(null),I=O.useRef(h),_=u!=null,P=BS(u),H=BS(s),z=BS(d),U=O.useCallback(()=>{if(!D.current||!k.current)return;const q={placement:t,strategy:n,middleware:g};H.current&&(q.platform=H.current),NY(D.current,k.current,q).then(G=>{const W={...G,isPositioned:z.current!==!1};j.current&&!Q0(I.current,W)&&(I.current=W,Bs.flushSync(()=>{m(W)}))})},[g,t,n,H,z]);T0(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(q=>({...q,isPositioned:!1})))},[d]);const j=O.useRef(!1);T0(()=>(j.current=!0,()=>{j.current=!1}),[]),T0(()=>{if(R&&(D.current=R),M&&(k.current=M),R&&M){if(P.current)return P.current(R,M,U);U()}},[R,M,U,P,_]);const B=O.useMemo(()=>({reference:D,floating:k,setReference:T,setFloating:N}),[T,N]),L=O.useMemo(()=>({reference:R,floating:M}),[R,M]),$=O.useMemo(()=>{const q={position:n,left:0,top:0};if(!L.floating)return q;const G=zM(L.floating,h.x),W=zM(L.floating,h.y);return c?{...q,transform:"translate("+G+"px, "+W+"px)",...yP(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:W}},[n,c,L.floating,h.x,h.y]);return O.useMemo(()=>({...h,update:U,refs:B,elements:L,floatingStyles:$}),[h,U,B,L,$])}const kY=(e,t)=>{const n=vY(e);return{name:n.name,fn:n.fn,options:[e,t]}},MY=(e,t)=>{const n=SY(e);return{name:n.name,fn:n.fn,options:[e,t]}},AY=(e,t)=>({fn:CY(e).fn,options:[e,t]}),_Y=(e,t)=>{const n=wY(e);return{name:n.name,fn:n.fn,options:[e,t]}},DY=(e,t)=>{const n=EY(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Z0(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function IY(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function xP(e){const t=[];let n,r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(const c of Array.from(e).sort((u,d)=>u.top-d.top)){if(r=Math.min(r,c.left),s=Math.min(s,c.top),i=Math.max(i,c.right),l=Math.max(l,c.bottom),!n||c.top-n.top>n.height/2)t.push(IY(c));else{const u=t[t.length-1];u.left=Math.min(u.left,c.left),u.right=Math.max(u.right,c.right),u.bottom=Math.max(u.bottom,c.bottom),u.width=u.right-u.left,u.height=u.bottom-u.top}n=c}return{lines:t,fallback:Z0(r,s,i,l)}}function bP(e,t,n){return e.findIndex(r=>t>r.left-2&&t<r.right+2&&n>r.top-2&&n<r.bottom+2)}function BM(e){return Z0(e.left,e.top,e.right,e.bottom)}function jY(e,t,n){const{lines:r}=xP(e.getClientRects());if(r.length<2)return;const s=bP(r,t,n);return{x:t,y:n,lineIndex:s===-1?void 0:s,element:e}}function LY(e,t,n){const{lines:r,fallback:s}=xP(e.getClientRects());if(r.length<2)return null;const i=n==null?void 0:n.x,l=n==null?void 0:n.y,c=t[0];if((n==null?void 0:n.lineIndex)!=null&&r[n.lineIndex])return BM(r[n.lineIndex]);if(i!=null&&l!=null){const b=bP(r,i,l);if(b!==-1)return BM(r[b])}if(r.length===2&&r[0].left>r[1].right&&i!=null&&l!=null)return s;if(c==="t"||c==="b"){const b=r[0],w=r[r.length-1],E=c==="t"?b:w;return Z0(E.left,b.top,E.right,w.bottom)}const u=c==="l";let d=r[0].left,h=r[0].right,m=u?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,g=r[0],y=r[0];for(const b of r){d=Math.min(d,b.left),h=Math.max(h,b.right);const w=u?b.left:b.right;u&&w<m||!u&&w>m?(m=w,g=b,y=b):w===m&&(y=b)}return Z0(d,g.top,h,y.bottom)}function PY(e){return"contextElement"in e&&e.contextElement?e.contextElement:bt(e)?e:void 0}function zY(e,t){function n(s){vP(e,s.currentTarget,s.clientX,s.clientY)}function r(s){t||n(s)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function vP(e,t,n,r){const s=jY(t,n,r);return e.current=s,s}function BY(e){return{name:"inline",async fn(t){const n=t.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!="function")return{};const r=PY(n),s=e.current,i=(s==null?void 0:s.element)===n||(s==null?void 0:s.element)===r?s:void 0,l=LY(n,t.placement,i);if(!l||typeof t.platform.getElementRects!="function")return{};const c=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return l}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===c.reference.x&&t.rects.reference.y===c.reference.y&&t.rects.reference.width===c.reference.width&&t.rects.reference.height===c.reference.height?{}:{reset:{rects:c}}}}}var vC=zj();const cw=[];let uw;function HY(){return uw}function FY(e){cw.push(e)}function ud(e){const t=(n,r)=>{const s=Tr($Y).current;let i;try{uw=s;for(const l of cw)l.before(s);i=e(n,r);for(const l of cw)l.after(s);s.didInitialize=!0}finally{uw=void 0}return i};return t.displayName=e.displayName||e.name,t}function tx(e){return O.forwardRef(ud(e))}function $Y(){return{didInitialize:!1}}const VY=GE(19),UY=VY?GY:KY;function SP(e,t,n,r,s){return UY(e,t,n,r,s)}function qY(e,t,n,r,s){const i=O.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return vC.useSyncExternalStore(e.subscribe,i,i)}FY({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),vC.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function GY(e,t,n,r,s){const i=HY();if(!i)return qY(e,t,n,r,s);const l=i.syncIndex;i.syncIndex+=1;let c;return i.didInitialize?(c=i.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,s))&&(c.store!==e&&(i.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=s,c.value=t(e.getSnapshot(),n,r,s))):(c={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},i.syncHooks.push(c)),c.value}function KY(e,t,n,r,s){return zE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,r,s))}class YY{constructor(t){_t(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));_t(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return SP(this,t,n,r,s)}}class fd extends YY{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){O.useDebugValue(t);const r=this;ze(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ze(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ze(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){O.useDebugValue(t);const r=this,s=n!==void 0;ze(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const i=this.selectors[t];return i(this.state,n,r,s)}useState(t,n,r,s){return O.useDebugValue(t),SP(this,this.selectors[t],n,r,s)}useContextCallback(t,n){O.useDebugValue(t);const r=Qe(n??Bn);this.context[t]=r}useStateSetter(t){const n=O.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(i=>{const l=r(i);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}const WY={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class wP extends fd{constructor(n){const{syncOnly:r,nested:s,onOpenChange:i,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:lP(),nested:s,triggerElements:l},WY);_t(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&oK(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});_t(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});_t(this,"setOpen",(n,r)=>{var s,i,l,c;if(this.syncOnly){(i=(s=this.context).onOpenChange)==null||i.call(s,n,r);return}this.dispatchOpenChange(n,r),(c=(l=this.context).onOpenChange)==null||c.call(l,n,r)});this.syncOnly=r}}function EP(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:i,onOpenChange:l}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),d=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,m=l,g=O.useRef(null);r===void 0&&g.current===null&&(g.current=new wP({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:d,triggerElements:h,onOpenChange:m,floatingId:s,syncOnly:!0,nested:i}));const y=r??g.current;return t.useSyncedValue("floatingId",s),ze(()=>{const b={open:c,floatingId:s,referenceElement:u,floatingElement:d};bt(u)&&(b.domReferenceElement=u),y.state.positionReference===y.state.referenceElement&&(b.positionReference=u),y.update(b)},[c,s,u,d,y]),y.context.onOpenChange=m,y.context.nested=i,y}function CP(e,t=!1,n=!1,r=!1){const[s,i]=O.useState(e&&t?"idle":void 0),[l,c]=O.useState(e&&!r);return e&&!l&&(c(!0),i("starting")),!e&&l&&s!=="ending"&&!n&&i("ending"),!e&&!l&&s==="ending"&&i(void 0),ze(()=>{if(!e&&l&&s!=="ending"&&n){const u=Qi.request(()=>{i("ending")});return()=>{Qi.cancel(u)}}},[e,l,s,n]),ze(()=>{if(!e||t)return;const u=Qi.request(()=>{i(void 0)});return()=>{Qi.cancel(u)}},[t,e]),ze(()=>{if(!e||!t)return;e&&l&&s!=="idle"&&i("starting");const u=Qi.request(()=>{i("idle")});return()=>{Qi.cancel(u)}},[t,e,l,s]),{mounted:l,setMounted:c,transitionStatus:s}}let Vg=null;function XY(e){if(!Vg){const t=[];Vg=t,queueMicrotask(()=>{Vg=null,Bs.flushSync(()=>{for(const n of t)n()})})}Vg.push(e)}function nx(e,t=!1,n=!1){const r=ip();return Qe((s,i=null)=>{r.cancel();const l=Io(e);if(l==null)return;const c=l,u=()=>{if(!n){Bs.flushSync(s);return}XY(()=>{i!=null&&i.aborted||s()})};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{i!=null&&i.aborted||u()},()=>{if(i!=null&&i.aborted)return;if(c.getAnimations().some(m=>m.pending||m.playState!=="finished")){d();return}u()})}if(t){const h=jL;if(!c.hasAttribute(h)){r.request(d);return}const m=new MutationObserver(()=>{c.hasAttribute(h)||(m.disconnect(),d())});m.observe(c,{attributes:!0,attributeFilter:[h]}),i==null||i.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(d)})}function ou(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:i}=e,l=Qe(i),c=nx(r,n,s);O.useEffect(()=>{if(!t)return;const u=new AbortController;return c(l,u.signal),()=>{u.abort()}},[t,n,l,c])}const Vp={tabIndex:-1,[nw]:""};function NP(e){return t=>t==="touch"?e.current:!0}function rx(e,t=!1){const n=Uf(),r=iu()!=null,s=Tr(()=>e(n,r)).current;return EP({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Up({handle:e,store:t}){return ze(()=>e.attachStore(t),[e,t]),null}function HM(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function QY(e,t){const n=O.useRef(null);return Qe(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const i=s.store;i.context.triggerElements.getById(s.id)===s.element&&(i.context.triggerElements.delete(s.id),HM(i))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),HM(t))})}function sx(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const i=(n==null?void 0:n.id)??null;let l=e.activeTriggerId,c=e.activeTriggerElement;return(i||t)&&(l=i,c=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:l,activeTriggerElement:c}}function SC(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function TP(e,t,n,r={}){var h,m,g;const s=n.reason,i=s===xn,l=t&&s===bf,c=!t&&(s===rl||s===Bp),u=SC(n);if((m=(h=e.context).onOpenChange)==null||m.call(h,t,n),n.isCanceled)return;(g=r.onBeforeDispatch)==null||g.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const d=()=>{const y=sx(e.state,t,n.trigger,u()),b={...r.extraState,...y};l?b.instantType="focus":c?b.instantType="dismiss":i&&(b.instantType=void 0),e.update(b)};i?Bs.flushSync(d):d()}function ix(e,t,n,r){const s=n.useState("isMountedByTrigger",e),i=QY(e,n),l=Qe(u=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){const m={activeTriggerElement:u,...d?r:null};n.update(m);return}if(h==null&&d){const m={activeTriggerId:e??null,activeTriggerElement:u,...r};n.update(m)}}),c=Qe(u=>{i(u),u&&l(u)});return ze(()=>(c(t.current),()=>c(null)),[c,t,n,e]),ze(()=>{if(s){const u={activeTriggerElement:t.current,...r};n.update(u)}},[s,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:s}}function qp(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),s=e.useState("open"),i=e.useState("triggerCount"),l=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");ze(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,d={};e.state.triggerCount!==u&&(d.triggerCount=u);const h=e.select("activeTriggerId");let m=null;if(h){const g=e.context.triggerElements.getById(h);if(g)r.current=h,g!==e.state.activeTriggerElement&&(d.activeTriggerElement=g);else{for(const[y,b]of e.context.triggerElements.entries())if(b===e.state.activeTriggerElement){d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y;break}d.activeTriggerId===void 0&&(r.current===h?m=h:r.current=null)}}else r.current=null;if(!m&&!h&&u===1){const g=e.context.triggerElements.entries().next();if(!g.done){const[y,b]=g.value;d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&e.update(d),m&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){const g=gt(qy);e.setOpen(!1,g),g.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,i,l,c,n])}function Gp(e,t,n,r){const{mounted:s,setMounted:i,transitionStatus:l}=CP(e,!1,!1,r),c=t.useState("preventUnmountingOnClose"),u=e?!1:c;t.useSyncedValues({mounted:s,transitionStatus:l,preventUnmountingOnClose:u});const d=Qe(()=>{var h,m;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(m=(h=t.context).onOpenChangeComplete)==null||m.call(h,!1)});return ou({enabled:s&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:l}}function Kp(e,t){e.useSyncedValues(t),ze(()=>()=>{e.update({activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn})},[e])}function RP(e,t){ze(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ze(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yp{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Wp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wP({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn}}const Ph=e=>e.triggerIdProp??e.activeTriggerId,wC=e=>e.openProp??e.open,FM=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function OP(e,t){return t!==void 0&&wC(e)&&Ph(e)===t}function ZY(e,t){return OP(e,t)?!0:t!==void 0&&wC(e)&&Ph(e)==null&&e.triggerCount===1}const Xp={open:wC,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ph,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:FM,isTriggerActive:(e,t)=>t!==void 0&&Ph(e)===t,isOpenedByTrigger:(e,t)=>OP(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ph(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ZY(e,t)?FM(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ox(e){const t=O.useCallback(r=>e===void 0?Bn:e.subscribeStore(r),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return vC.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function JY(e){return eW(e,e.rootContext)}function eW(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),i=t.useState("floatingElement"),l=t.useState("domReferenceElement"),c=t.useState("open"),u=t.useState("floatingId"),[d,h]=O.useState(null),[m,g]=O.useState(void 0),[y,b]=O.useState(void 0),w=O.useRef(null),E=_a(r),C=O.useMemo(()=>({reference:s,floating:i,domReference:l}),[s,i,l]),T=OY({...e,elements:{...C,...d&&{reference:d}}}),N=bt(m)?m:null,R=y===void 0?t.state.floatingElement:y;t.useSyncedValue("referenceElement",m??null),t.useSyncedValue("domReferenceElement",m===void 0?l:N),t.useSyncedValue("floatingElement",R);const M=O.useCallback(H=>{const z=bt(H)?{getBoundingClientRect:()=>H.getBoundingClientRect(),getClientRects:()=>H.getClientRects(),contextElement:H}:H;h(z),T.refs.setReference(z)},[T.refs]),D=O.useCallback(H=>{(bt(H)||H===null)&&(w.current=H,g(H)),(bt(T.refs.reference.current)||T.refs.reference.current===null||H!==null&&!bt(H))&&T.refs.setReference(H)},[T.refs,g]),k=O.useCallback(H=>{b(H),T.refs.setFloating(H)},[T.refs]),I=O.useMemo(()=>({...T.refs,setReference:D,setFloating:k,setPositionReference:M,domReference:w}),[T.refs,D,k,M]),_=O.useMemo(()=>({...T.elements,domReference:l}),[T.elements,l]),P=O.useMemo(()=>({...T,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:u,refs:I,elements:_,nodeId:n,rootStore:t}),[T,I,_,n,t,c,u]);return ze(()=>{l&&(w.current=l)},[l]),ze(()=>{t.context.dataRef.current.floatingContext=P;const H=E==null?void 0:E.nodesRef.current.find(z=>z.id===n);H&&(H.context=P)}),O.useMemo(()=>({...T,context:P,refs:I,elements:_,rootStore:t}),[T,I,_,P,t])}const HS=rC&&Aa;function EC(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:i,dataRef:l}=s.context,c=O.useRef(!1),u=O.useRef(null),d=O.useRef(!0),h=Jr();O.useEffect(()=>{const g=s.select("domReferenceElement");if(!n)return;const y=vn(g);function b(){const C=s.select("domReferenceElement");!s.select("open")&&Zt(C)&&C===Xr(Dt(C))&&(c.current=!0,u.current=C)}function w(){d.current=!0}function E(){d.current=!1}return no(xt(y,"blur",b),HS&&xt(y,"keydown",w,!0),HS&&xt(y,"pointerdown",E,!0))},[s,n]),O.useEffect(()=>{if(!n)return;function g(y){if(y.reason===rl||y.reason===Bp){const b=s.select("domReferenceElement");bt(b)&&(u.current=b,c.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,n,s]);const m=O.useMemo(()=>{function g(){c.current=!1,u.current=null}return{onMouseLeave(){g()},onFocus(y){const b=y.currentTarget;if(c.current){if(u.current===b)return;g()}const w=Zr(y.nativeEvent);if(bt(w)){if(HS&&!y.relatedTarget){if(!d.current&&!Xy(w))return}else if(!cK(w))return}const E=K0(y.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:T}=y,N=typeof r=="function"?r():r;if(s.select("open")&&E||N===0||N===void 0){s.setOpen(!0,gt(bf,C,T));return}h.start(N,()=>{c.current||s.setOpen(!0,gt(bf,C,T))})},onBlur(y){g();const b=y.relatedTarget,w=y.nativeEvent,E=bt(b)&&b.hasAttribute(op("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{var R;const C=s.select("domReferenceElement"),T=Xr(Dt(C));!b&&T===C||Je((R=l.current.floatingContext)==null?void 0:R.refs.floating.current,T)||Je(C,T)||E||K0(b??T,s.context.triggerElements)||s.setOpen(!1,gt(bf,w))})}}},[l,r,s,h]);return O.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class CC{constructor(){_t(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});_t(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new si,this.restTimeout=new si,this.handleCloseOptions=void 0}static create(){return new CC}}const J0=new WeakMap;function ey(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&J0.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),J0.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kP(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,i=J0.get(n);i&&i!==e&&ey(i),ey(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,J0.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function NC(e){const t=e.context.dataRef.current,n=Tr(()=>t.hoverInteractionState??CC.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),nC(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function lx(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,i="rootStore"in e?e.rootStore:e,l=i.useState("open"),c=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,h=_a(),m=iu(),g=NC(i),y=Jr(),b=Qe(()=>{var C;return FL((C=d.current.openEvent)==null?void 0:C.type,g.interactedInside)}),w=Qe(()=>{var C;return fK((C=d.current.openEvent)==null?void 0:C.type)}),E=Qe(()=>{ey(g)});ze(()=>{l||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,E())},[l,g,E]),O.useEffect(()=>E,[E]),ze(()=>{var C,T,N,R,M;if(n&&l&&(C=g.handleCloseOptions)!=null&&C.blockPointerEvents&&w()&&bt(u)&&c){const D=u,k=c,I=Dt(c),_=(N=(T=h==null?void 0:h.nodesRef.current.find(U=>U.id===m))==null?void 0:T.context)==null?void 0:N.elements.floating;_&&(_.style.pointerEvents="");const P=g.pointerEventsScopeElement!==k?g.pointerEventsScopeElement:null,H=_!==k?_:null,z=((M=(R=g.handleCloseOptions)==null?void 0:R.getScope)==null?void 0:M.call(R))??P??H??D.closest("[data-rootownerid]")??I.body;return kP(g,{scopeElement:z,referenceElement:D,floatingElement:k}),()=>{E()}}},[n,l,u,c,g,w,h,m,E]),O.useEffect(()=>{if(!n)return;function C(){return!!(h&&m&&Ra(h.nodesRef.current,m).length>0)}function T(I){const _=sp(r,"close",g.pointerType),P=()=>{i.setOpen(!1,gt(xn,I)),h==null||h.events.emit("floating.closed",I)};_?g.openChangeTimeout.start(_,P):(g.openChangeTimeout.clear(),P())}function N(I){const _=Zr(I);if(!aK(_)){g.interactedInside=!1;return}g.interactedInside=(_==null?void 0:_.closest("[aria-haspopup]"))!=null}function R(){g.openChangeTimeout.clear(),y.clear(),h==null||h.events.off("floating.closed",D),E()}function M(I){var z;if(C()&&h){h.events.on("floating.closed",D);return}if(K0(I.relatedTarget,i.context.triggerElements))return;const _=((z=d.current.floatingContext)==null?void 0:z.nodeId)??s,P=I.relatedTarget;if(!(h&&_&&bt(P)&&Ra(h.nodesRef.current,_,!1).some(U=>{var j;return Je((j=U.context)==null?void 0:j.elements.floating,P)}))){if(g.handler){g.handler(I);return}E(),w()&&!b()&&T(I)}}function D(I){!h||!m||C()||y.start(0,()=>{h.events.off("floating.closed",D),i.setOpen(!1,gt(xn,I)),h.events.emit("floating.closed",I)})}const k=c;return no(k&&xt(k,"mouseenter",R),k&&xt(k,"mouseleave",M),k&&xt(k,"pointerdown",N,!0),()=>{h==null||h.events.off("floating.closed",D)})},[n,c,i,d,r,s,w,b,E,g,h,m,y])}const tW={current:null};function ax(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:i=!1,restMs:l=0,move:c=!0,triggerElementRef:u=tW,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g,shouldOpen:y,guardStaleOpen:b=!1}=t,w="rootStore"in e?e.rootStore:e,{dataRef:E,events:C}=w.context,T=_a(d),N=NC(w),R=O.useRef(!1),M=Hn(s),D=Hn(r),k=Hn(l),I=Hn(n),_=Hn(y),P=Hn(g),H=Qe(()=>{var L;return FL((L=E.current.openEvent)==null?void 0:L.type,N.interactedInside)}),z=Qe(()=>{var L;return((L=_.current)==null?void 0:L.call(_))!==!1}),U=Qe((L,$,q)=>{const G=w.context.triggerElements;if(G.hasElement($))return!L||!Je(L,$);if(!bt(q))return!1;const W=q;return G.hasMatchingElement(Z=>Je(Z,W))&&(!L||!Je(L,W))}),j=Qe(()=>{if(!N.handler)return;Dt(w.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),B=Qe(()=>{ey(N)});return h&&(N.handleCloseOptions=s==null?void 0:s.__options),O.useEffect(()=>j,[j]),O.useEffect(()=>{if(!n)return;function L($){$.open?R.current=!1:(R.current=$.reason===xn,j(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return C.on("openchange",L),()=>{C.off("openchange",L)}},[n,C,N,j]),O.useEffect(()=>{if(!n)return;function L(re,de=!0){const F=sp(D.current,"close",N.pointerType);F?N.openChangeTimeout.start(F,()=>{w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re)}):de&&(N.openChangeTimeout.clear(),w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re))}const $=u.current??(h?w.select("domReferenceElement"):null);if(!bt($))return;function q(re){var we;if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,i&&!ha(N.pointerType))return;const de=yM(k.current),F=sp(D.current,"open",N.pointerType),X=Zr(re),te=re.currentTarget??null,J=w.select("domReferenceElement");let K=te;if(bt(X)&&!w.context.triggerElements.hasElement(X)){for(const Re of w.context.triggerElements.elements())if(Je(Re,X)){K=Re;break}}bt(te)&&bt(J)&&!w.context.triggerElements.hasElement(te)&&Je(te,J)&&(K=J);const ce=K==null?!1:U(J,K,X),ye=w.select("open"),ge=((we=P.current)==null?void 0:we.call(P))??w.select("transitionStatus")==="ending",oe=!ye&&ge&&R.current,xe=!ce&&bt(K)&&bt(J)&&Je(J,K)&&oe,Se=de>0&&!F,ke=ce&&(ye||oe)||xe,_e=!ye||ce;if(ke){z()&&w.setOpen(!0,gt(xn,re,K));return}Se||(F?N.openChangeTimeout.start(F,()=>{_e&&z()&&w.setOpen(!0,gt(xn,re,K))}):_e&&z()&&w.setOpen(!0,gt(xn,re,K)))}function G(re){if(H()){B();return}j();const de=w.select("domReferenceElement"),F=Dt(de);N.restTimeout.clear(),N.restTimeoutPending=!1;const X=E.current.floatingContext??(m==null?void 0:m());if(K0(re.relatedTarget,w.context.triggerElements))return;if(M.current&&X){w.select("open")||N.openChangeTimeout.clear();const J=u.current;N.handler=M.current({...X,tree:T,x:re.clientX,y:re.clientY,onClose(){B(),j(),I.current&&!H()&&J===w.select("domReferenceElement")&&L(re,!0)}}),F.addEventListener("mousemove",N.handler),N.handler(re);return}(N.pointerType==="touch"?!Je(w.select("floatingElement"),re.relatedTarget):!0)&&L(re)}function W(re){Je($,re.relatedTarget)||(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1)}const Z=b?xt($,"mouseout",W):void 0;return c?no(xt($,"mousemove",q,{once:!0}),xt($,"mouseenter",q),xt($,"mouseleave",G),Z):no(xt($,"mouseenter",q),xt($,"mouseleave",G),Z)},[j,B,E,D,w,n,M,N,h,U,H,i,c,k,u,T,I,m,P,z,b]),O.useMemo(()=>{if(!n)return;function L($){N.pointerType=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){var X,te,J;const{nativeEvent:q}=$,G=$.currentTarget,W=w.select("domReferenceElement"),Z=w.select("open"),re=U(W,G,$.target);if(i&&!ha(N.pointerType))return;if(Z&&re&&((X=N.handleCloseOptions)!=null&&X.blockPointerEvents)){const K=w.select("floatingElement");if(K){const ce=((J=(te=N.handleCloseOptions)==null?void 0:te.getScope)==null?void 0:J.call(te))??G.ownerDocument.body;kP(N,{scopeElement:ce,referenceElement:G,floatingElement:K})}}const de=yM(k.current);if(Z&&!re||de===0||!re&&N.restTimeoutPending&&$.movementX**2+$.movementY**2<2)return;N.restTimeout.clear();function F(){if(N.restTimeoutPending=!1,H())return;const K=w.select("open");!N.blockMouseMove&&(!K||re)&&z()&&w.setOpen(!0,gt(xn,q,G))}N.pointerType==="touch"?Bs.flushSync(()=>{F()}):re&&Z?F():(N.restTimeoutPending=!0,N.restTimeout.start(de,F))}}},[n,N,H,U,i,w,k,z])}const nW="Escape";function $M(e){return Aa&&e.movementX===0&&e.movementY===0}function cx(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ug(e,t){return cx(t,e===HL||e===lC,e===Yy||e===Wy)}function FS(e,t,n){return cx(t,e===lC,n?e===Yy:e===Wy)||e==="Enter"||e===" "||e===""}function rW(e,t,n){return cx(t,n?e===Yy:e===Wy,e===lC)}function sW(e,t,n,r){const s=n?e===Wy:e===Yy,i=e===HL;return t==="both"||t==="horizontal"&&r?e===nW:cx(t,s,i)}function iW(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:u=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:E="vertical",parentOrientation:C,id:T,resetOnPointerLeave:N=!0,externalTree:R,grid:M}=t,D=M!=null,k="rootStore"in e?e.rootStore:e,I=k.useState("open"),_=k.useState("floatingElement"),P=k.useState("domReferenceElement"),H=k.context.dataRef,z=iw(_),U=sw(P),j=Hn(z),B=iu(),L=_a(R),$=O.useRef(g),q=O.useRef(l??-1),G=O.useRef(null),W=O.useRef(!0),Z=Qe(Oe=>{s(q.current===-1?null:q.current,Oe)}),re=O.useRef(!!_),de=O.useRef(I),F=O.useRef(!1),X=O.useRef(!1),te=O.useRef(null),J=Hn(w),K=Hn(I),ce=Hn(l),ye=Hn(N),ge=ip(),oe=ip(),xe=Qe(()=>{function Oe(se){m?L==null||L.events.emit("virtualfocus",se):te.current=N0(se,{sync:F.current,preventScroll:!0})}const De=n.current[q.current],ne=X.current;De&&Oe(De),(F.current?se=>se():se=>ge.request(se))(()=>{var Ve;const se=n.current[q.current]||De;if(!se)return;De||Oe(se),Ae&&(ne||!W.current)&&((Ve=se.scrollIntoView)==null||Ve.call(se,{block:"nearest",inline:"nearest"}))})});ze(()=>{H.current.orientation=E},[H,E]),ze(()=>{i&&(I&&_?(q.current=l??-1,$.current&&l!=null&&(X.current=!0,Z())):re.current&&(q.current=-1,Z()))},[i,I,_,l,Z]),ze(()=>{if(i){if(!I){F.current=!1;return}if(_)if(r==null){if(F.current=!1,ce.current!=null)return;if(re.current&&(q.current=-1,xe()),(!de.current||!re.current)&&$.current&&(G.current!=null||$.current===!0&&G.current==null)){let Oe=0;const De=()=>{n.current[0]==null?(Oe<2&&(Oe?he=>oe.request(he):queueMicrotask)(De),Oe+=1):(q.current=G.current==null||FS(G.current,E,h)||d?IS(n):SM(n),G.current=null,Z())};De()}}else vM(n.current,r)||(q.current=r,xe(),X.current=!1)}},[i,I,_,r,ce,d,n,E,h,Z,xe,oe]),ze(()=>{var se,Te;if(!i||_||!L||m||!re.current)return;const Oe=L.nodesRef.current,De=(Te=(se=Oe.find(Ve=>Ve.id===B))==null?void 0:se.context)==null?void 0:Te.elements.floating,ne=Xr(Dt(P??De??null)),he=Oe.some(Ve=>Ve.context&&Je(Ve.context.elements.floating,ne));De&&!he&&W.current&&De.focus({preventScroll:!0})},[i,_,P,L,B,m]),ze(()=>{de.current=I,re.current=!!_}),ze(()=>{I||(G.current=null,$.current=g)},[I,g]);const Se=r!=null,ke=Qe(Oe=>{if(!K.current)return;const De=n.current.indexOf(Oe.currentTarget);De!==-1&&(q.current!==De||r!==De)&&(q.current=De,Z(Oe))}),_e=Qe(()=>{var Oe,De,ne;return C??((ne=(De=(Oe=L==null?void 0:L.nodesRef.current.find(he=>he.id===B))==null?void 0:Oe.context)==null?void 0:De.dataRef)==null?void 0:ne.current.orientation)}),we=Qe(()=>IS(n,J.current)),Re=Qe(Oe=>{if(W.current=!1,F.current=!0,Oe.which===229||!K.current&&Oe.currentTarget===j.current)return;if(d&&sW(Oe.key,E,h,D)){Ug(Oe.key,_e())||Ki(Oe),k.setOpen(!1,gt(ew,Oe.nativeEvent)),Zt(P)&&(m?L==null||L.events.emit("virtualfocus",P):P.focus());return}const De=q.current,ne=IS(n,w),he=SM(n,w);if(U||(Oe.key==="Home"&&(Ki(Oe),q.current=ne,Z(Oe)),Oe.key==="End"&&(Ki(Oe),q.current=he,Z(Oe))),M!=null){const se=M(Oe,q.current,n,E,u,h,w,ne,he);if(se!=null&&(q.current=se,Z(Oe)),E==="both")return}if(Ug(Oe.key,E)){if(Ki(Oe),I&&!m&&Xr(Oe.currentTarget.ownerDocument)===Oe.currentTarget){q.current=FS(Oe.key,E,h)?ne:he,Z(Oe);return}FS(Oe.key,E,h)?u?De>=he?c&&De!==n.current.length?q.current=-1:(F.current=!1,q.current=ne):q.current=ff(n.current,{startingIndex:De,disabledIndices:w}):q.current=Math.min(he,ff(n.current,{startingIndex:De,disabledIndices:w})):u?De<=ne?c&&De!==-1?q.current=n.current.length:(F.current=!1,q.current=he):q.current=ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w}):q.current=Math.max(ne,ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w})),vM(n.current,q.current)&&(q.current=-1),Z(Oe)}}),Ae=O.useMemo(()=>({onFocus(De){F.current=!0,ke(De)},onClick:({currentTarget:De})=>De.focus({preventScroll:!0}),onMouseMove(De){$M(De)||(F.current=!0,X.current=!1,y&&ke(De))},onPointerLeave(De){var he;if(!K.current||!W.current||De.pointerType==="touch")return;F.current=!0;const ne=De.relatedTarget;if(!(!y||n.current.includes(ne))&&ye.current&&((he=te.current)==null||he.call(te),te.current=null,q.current=-1,Z(De),!m)){const se=j.current,Te=Xr(Dt(se));se&&Je(se,Te)&&se.focus({preventScroll:!0})}}}),[ke,K,j,y,n,Z,ye,m]),Le=O.useMemo(()=>m&&I&&Se&&{"aria-activedescendant":`${T}-${r}`},[m,I,Se,T,r]),Ie=O.useMemo(()=>({...U?{}:Le,onKeyDown(Oe){if(Oe.key==="Tab"&&Oe.shiftKey&&I&&!m){const De=Zr(Oe.nativeEvent);if(De&&!Je(j.current,De))return;Ki(Oe),k.setOpen(!1,gt(Bc,Oe.nativeEvent)),Zt(P)&&P.focus();return}Re(Oe)},onPointerMove(Oe){$M(Oe)||(W.current=!0)}}),[Le,Re,j,U,k,I,m,P]),Ue=O.useMemo(()=>{function Oe(he){k.setOpen(!0,gt(ew,he.nativeEvent,he.currentTarget))}function De(he){g==="auto"&&iC(he.nativeEvent)&&($.current=!m)}function ne(he){$.current=g,g==="auto"&&oC(he.nativeEvent)&&($.current=!0)}return{onKeyDown(he){const se=k.select("open");W.current=!1;const Te=he.key.startsWith("Arrow"),Ve=rW(he.key,_e(),h),jt=Ug(he.key,E),hn=(d?Ve:jt)||he.key==="Enter"||he.key.trim()==="";if(m&&se)return Re(he);if(!(!se&&!b&&Te)){if(hn){const Fe=Ug(he.key,_e());G.current=d&&Fe?null:he.key}if(d){Ve&&(Ki(he),se?(q.current=we(),Z(he)):Oe(he));return}jt&&(ce.current!=null&&(q.current=ce.current),Ki(he),!se&&b?Oe(he):Re(he),se&&Z(he))}},onFocus(he){k.select("open")&&!m&&(q.current=-1,Z(he))},onPointerDown:ne,onPointerEnter:ne,onMouseDown:De,onClick:De}},[Re,g,we,d,Z,k,b,E,_e,h,ce,m]),We=O.useMemo(()=>({...Le,...Ue}),[Le,Ue]);return O.useMemo(()=>i?{reference:We,floating:Ie,item:Ae,trigger:Ue}:{},[i,We,Ie,Ue,Ae])}function oW(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:i,disabledIndices:l,onTyping:c,enabled:u=!0,resetMs:d=750,selectedIndex:h=null}=t,m="rootStore"in e?e.rootStore:e,g=m.useState("open"),y=Jr(),b=O.useRef(""),w=O.useRef(h??s??-1),E=O.useRef(null),C=Qe(R=>{function M(j){return r==null?void 0:r.current[j]}function D(j){const B=M(j);return B&&!Qy(B)||B!=null&&B.matches(":disabled")?!1:l==null||!UL(Zh,j,l)}function k(j,B,L=0){if(j.length===0)return-1;const $=(L%j.length+j.length)%j.length,q=B.toLowerCase();for(let G=0;G<j.length;G+=1){const W=($+G)%j.length,Z=j[W];if(!(!(Z!=null&&Z.toLowerCase().startsWith(q))||!D(W)))return W}return-1}const I=n.current;if(b.current.length>0&&R.key===" "&&(Ki(R),c==null||c(!0)),b.current.length>0&&b.current[0]!==" "&&k(I,b.current)===-1&&R.key!==" "&&(c==null||c(!1)),I==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(Ki(R),c==null||c(!0));const _=b.current==="";_&&(w.current=h??s??-1),I.every((j,B)=>{var L,$;return j&&D(B)?((L=j[0])==null?void 0:L.toLowerCase())!==(($=j[1])==null?void 0:$.toLowerCase()):!0})&&b.current===R.key&&(b.current="",w.current=E.current),b.current+=R.key,y.start(d,()=>{b.current="",w.current=E.current,c==null||c(!1)});const z=((_?h??s??-1:w.current)??0)+1,U=k(I,b.current,z);U!==-1?(i==null||i(U),E.current=U):R.key!==" "&&(b.current="",c==null||c(!1))}),T=Qe(R=>{const M=R.relatedTarget,D=m.select("domReferenceElement"),k=m.select("floatingElement");Je(D,M)||Je(k,M)||(y.clear(),b.current="",w.current=E.current,c==null||c(!1))});ze(()=>{!g&&h!==null||(y.clear(),E.current=null,b.current!==""&&(b.current=""))},[g,h,y]);const N=O.useMemo(()=>({onKeyDown:C,onBlur:T}),[C,T]);return O.useMemo(()=>u?{reference:N,floating:N}:{},[u,N])}const VM=.1,lW=VM*VM,Yt=.5;function qg(e,t,n,r,s,i){return r>=t!=i>=t&&e<=(s-n)*(t-r)/(i-r)+n}function Gg(e,t,n,r,s,i,l,c,u,d){let h=!1;return qg(e,t,n,r,s,i)&&(h=!h),qg(e,t,s,i,l,c)&&(h=!h),qg(e,t,l,c,u,d)&&(h=!h),qg(e,t,u,d,n,r)&&(h=!h),h}function aW(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Kg(e,t,n,r,s,i){const l=Math.min(n,s),c=Math.max(n,s),u=Math.min(r,i),d=Math.max(r,i);return e>=l&&e<=c&&t>=u&&t<=d}function ux(e={}){const{blockPointerEvents:t=!1}=e,n=new si,r=({x:s,y:i,placement:l,elements:c,onClose:u,nodeId:d,tree:h})=>{const m=l==null?void 0:l.split("-")[0];let g=!1,y=null,b=null,w=typeof performance<"u"?performance.now():0;function E(T,N){const R=performance.now(),M=R-w;if(y===null||b===null||M===0)return y=T,b=N,w=R,!1;const D=T-y,k=N-b,I=D*D+k*k,_=M*M*lW;return y=T,b=N,w=R,I<_}function C(){n.clear(),u()}return function(N){n.clear();const R=c.domReference,M=c.floating;if(!R||!M||m==null||s==null||i==null)return;const{clientX:D,clientY:k}=N,I=Zr(N),_=N.type==="mouseleave",P=Je(M,I),H=Je(R,I);if(P&&(g=!0,!_))return;if(H&&(g=!1,!_)){g=!0;return}if(_&&bt(N.relatedTarget)&&Je(M,N.relatedTarget))return;function z(){return!!(h&&Ra(h.nodesRef.current,d).length>0)}function U(){z()||C()}if(z())return;const j=R.getBoundingClientRect(),B=M.getBoundingClientRect(),L=s>B.right-B.width/2,$=i>B.bottom-B.height/2,q=B.width>j.width,G=B.height>j.height,W=(q?j:B).left,Z=(q?j:B).right,re=(G?j:B).top,de=(G?j:B).bottom;if(m==="top"&&i>=j.bottom-1||m==="bottom"&&i<=j.top+1||m==="left"&&s>=j.right-1||m==="right"&&s<=j.left+1){U();return}let F=!1;switch(m){case"top":F=Kg(D,k,W,j.top+1,Z,B.bottom-1);break;case"bottom":F=Kg(D,k,W,B.top+1,Z,j.bottom-1);break;case"left":F=Kg(D,k,B.right-1,de,j.left+1,re);break;case"right":F=Kg(D,k,j.right-1,de,B.left+1,re);break}if(F)return;if(g&&!aW(D,k,j)){U();return}if(!_&&E(D,k)){U();return}let X=!1;switch(m){case"top":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i+Yt+1,ye=L||q?B.bottom-Yt:B.top,ge=L?q?B.bottom-Yt:B.top:B.bottom-Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"bottom":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i-Yt,ye=L||q?B.top+Yt:B.bottom,ge=L?q?B.top+Yt:B.bottom:B.top+Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"left":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s+Yt+1,ye=$||G?B.right-Yt:B.left,ge=$?G?B.right-Yt:B.left:B.right-Yt;X=Gg(D,k,ye,B.top,ge,B.bottom,ce,J,ce,K);break}case"right":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s-Yt,ye=$||G?B.left+Yt:B.right,ge=$?G?B.left+Yt:B.right:B.left+Yt;X=Gg(D,k,ce,J,ce,K,ye,B.top,ge,B.bottom);break}}X?g||n.start(40,U):U()}};return r.__options={...e,blockPointerEvents:t},r}const MP=O.createContext(void 0);function cW(){const e=O.useContext(MP);if(e===void 0)throw new Error(wn(26));return e}const uW="ArrowUp",fW="ArrowDown",dW="ArrowLeft",hW="ArrowRight",pW="Home",mW="End",TC=new Set([uW,fW,dW,hW,pW,mW]),gW="--nested-dialogs",yW="data-nested-dialog-open",xW={...Uy,...ZE,nestedDialogOpen(e){return e?{[yW]:""}:null}},AP=O.forwardRef(function(t,n){const{render:r,className:s,style:i,finalFocus:l,initialFocus:c,...u}=t,d=su(),h=d.useState("descriptionElementId"),m=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),y=d.useState("popupProps"),b=d.useState("modal"),w=d.useState("mounted"),E=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),T=d.useState("open"),N=d.useState("openMethod"),R=d.useState("titleElementId"),M=d.useState("transitionStatus"),D=d.useState("role"),k=g.useState("floatingId");cW(),ou({open:T,ref:d.context.popupRef,onComplete(){var U,j;T&&((j=(U=d.context).onOpenChangeComplete)==null||j.call(U,!0))}});const I=c===void 0?NP(d.context.popupRef):c,_=C>0,P=d.useStateSetter("popupElement"),z=dn("div",t,{state:{open:T,nested:E,transitionStatus:M,nestedDialogOpen:_},props:[y,{id:k,"aria-labelledby":R,"aria-describedby":h,role:D,...Vp,hidden:!w,onKeyDown(U){TC.has(U.key)&&U.stopPropagation()},style:{[gW]:C}},u],ref:[n,d.context.popupRef,P],stateAttributesMapping:xW});return x.jsx(xC,{context:g,openInteractionType:N,disabled:!w,closeOnFocusOut:!m,initialFocus:I,returnFocus:l,modal:b!==!1,restoreFocus:"popup",children:z})});function RC(e){return GE(19)?e:e?"true":void 0}const OC=O.forwardRef(function(t,n){const{cutout:r,...s}=t;let i;if(r){const l=r.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),_P=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,i=su(),l=i.useState("mounted"),c=i.useState("modal"),u=i.useState("open");return l||r?x.jsx(MP.Provider,{value:r,children:x.jsxs(hC,{ref:n,...s,children:[l&&c===!0&&x.jsx(OC,{ref:i.context.internalBackdropRef,inert:RC(!u)}),t.children]})}):null});let UM={},qM={},GM="";function fx(e,t){return Lp(e)?e:t}function KM(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fx(t,n)).overflowY)}function bW(e){if(typeof document>"u")return!1;const t=Dt(e);return vn(t).innerWidth-t.documentElement.clientWidth>0}function vW(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Dt(e),r=n.documentElement,s=n.body,i=fx(r,s),l=i.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",i.style.overflowY="scroll";const u=i.offsetWidth;i.style.overflowY="hidden";const d=i.offsetWidth;return i.style.overflowY=l,r.style.scrollbarGutter=c,u===d}function SW(e){const t=Dt(e),n=t.documentElement,r=t.body,s=fx(n,r),i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function wW(e){var y;const t=Dt(e),n=t.documentElement,r=t.body,s=vn(n);let i=0,l=0,c=!1;const u=Qi.create();if(Aa&&(((y=s.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),w=s.getComputedStyle(r),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,l=n.scrollLeft,UM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},GM=n.style.scrollBehavior,qM={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const N=n.scrollHeight>n.clientHeight,R=n.scrollWidth>n.clientWidth,M=b.overflowY==="scroll"||w.overflowY==="scroll",D=b.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),I=Math.max(0,s.innerHeight-r.clientHeight),_=parseFloat(w.marginTop)+parseFloat(w.marginBottom),P=parseFloat(w.marginLeft)+parseFloat(w.marginRight),H=fx(n,r);if(c=vW(e),c){n.style.scrollbarGutter=T,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(N||M)&&(n.style.overflowY="scroll"),(R||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:_||I?`calc(100dvh - ${_+I}px)`:"100dvh",width:P||k?`calc(100vw - ${P+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,UM),Object.assign(r.style,qM),c||(n.scrollTop=i,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=GM)}function m(){h(),u.request(d)}d();const g=xt(s,"resize",m);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class EW{constructor(){_t(this,"lockCount",0);_t(this,"restore",null);_t(this,"timeoutLock",si.create());_t(this,"timeoutUnlock",si.create());_t(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});_t(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Dt(t),r=n.documentElement,s=n.body,i=vn(r);if(KM(i,r,s)){const c=new i.MutationObserver(()=>{KM(i,r,s)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(s,u),this.restore=()=>c.disconnect();return}const l=Ky||!bW(t);this.restore=l?SW(t):wW(t)}}const CW=new EW;function DP(e=!0,t=null){ze(()=>{if(e)return CW.acquire(t)},[e,t])}function NW({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),i=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,d]=O.useState(0),[h,m]=O.useState(0),g=u===0,y=$p(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!e.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const w=Zr(b);if(g&&!s){if(i){const E=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return E||C?E===w||C===w||Je(w,l)&&!(w!=null&&w.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:g});return DP(r&&i===!0,l),e.useContextCallback("onNestedDialogOpen",(b,w)=>{d(b),m(w)}),ze(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,h+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,h,t]),Kp(e,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const TW={...Xp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class RW extends fd{constructor(n,r,s){const i=new Yp,l=OW(n,i,r,s);super(l,kW(i),TW);_t(this,"setOpen",(n,r)=>{var s,i;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(i=(s=this.context).onOpenChange)==null||i.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(sx(this.state,n,r.trigger)))})}}function OW(e,t,n,r=!1){return{...Wp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function kW(e){return{popupRef:O.createRef(),backdropRef:O.createRef(),internalBackdropRef:O.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function MW(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:d,handle:h,triggerId:m,defaultTriggerId:g=null}=t,y=e==="drawer",b=u,w=c,E="dialog",C=su(!0),T=C!=null,N={modal:b,disablePointerDismissal:w,nested:T,role:E},R=rx((P,H)=>new RW({open:s,openProp:r,activeTriggerId:g,triggerIdProp:m,...N},P,H),!0);R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",m),R.useSyncedValues(N),R.useContextCallback("onOpenChange",i),R.useContextCallback("onOpenChangeComplete",l);const M=R.useState("open"),D=R.useState("mounted"),k=R.useState("payload");RP(R,M),qp(R);const{forceUnmount:I}=Gp(M,R);O.useImperativeHandle(d,()=>({unmount:I,close:()=>R.setOpen(!1,gt(Hp))}),[I,R]);const _=M||D;return x.jsxs(IL.Provider,{value:R,children:[h&&x.jsx(Up,{handle:h,store:R}),_&&x.jsx(NW,{store:R,parentContext:C==null?void 0:C.context,isDrawer:y}),typeof n=="function"?n({payload:k}):n]})}const IP=ud(function(t){return MW("dialog",t)}),AW=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("titleElementId",d),dn("h2",t,{ref:n,props:[{id:d},c]})});function _W(e){const t=O.useRef(""),n=O.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:O.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function jP(e,t){const n=O.useRef(e),r=Qe(t);ze(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function LP(e,t){const n=Qe((i,l)=>{(typeof e=="function"?e():e)||t(l||(Ky?"touch":""))}),{onClick:r,onPointerDown:s}=_W(n);return O.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function DW(e){const[t,n]=O.useState(null),r=LP(e,n);return jP(e,s=>{s&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}/**
68
- * @license lucide-react v1.49.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const IW=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
73
- * @license lucide-react v1.49.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */function jW(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:IW(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
78
- * @license lucide-react v1.49.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const LW=e=>{let t="",n=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};/**
83
- * @license lucide-react v1.49.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const PW=e=>{const t=LW(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
88
- * @license lucide-react v1.49.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const fw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
93
- * @license lucide-react v1.49.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const uc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
98
- * @license lucide-react v1.49.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */function $S(e){return e!=null}function zW(e,t={}){var g,y;const n=t.attributeNames??{},r=b=>n[b]??b,s=e.size??e.width??uc.width,i=e.size??e.height??uc.height,l=((g=e.aliases)==null?void 0:g.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`))??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],u=((y=t.className)==null?void 0:y.split(" ").filter(Boolean))??[],d=t.includeDefaultClasses===!1?fw(...u):fw("lucide",...c,...u),h=t.absoluteStrokeWidth?Number(t.strokeWidth??uc["stroke-width"])*Number(e.size??e.width??uc.width)/Number(t.size??t.width??uc.width):t.strokeWidth??uc["stroke-width"];return["svg",{...Object.entries(uc).reduce((b,[w,E])=>(b[r(w)]=E,b),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&$S(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&$S(t.width)&&{[r("width")]:t.width},..."height"in t&&$S(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:h,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(b=>{const[w,E,C]=b,T=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...E}:E;return C?[w,T,C]:[w,T]})]}/**
103
- * @license lucide-react v1.49.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */function BW(e,t={}){return zW(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
108
- * @license lucide-react v1.49.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const HW=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},FW=O.createContext({}),$W=()=>O.useContext(FW),VW=O.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:l,className:c="",children:u,iconNode:d=[],icon:h={node:d,aliases:[],size:24},...m},g)=>{const{size:y=24,strokeWidth:b=2,absoluteStrokeWidth:w=!1,nonScalingStroke:E=!1,color:C="currentColor",className:T=""}=$W()??{},N=!!u||HW(m),[R,M,D=[]]=BW(h,{color:e??C,width:n??t??y,height:r??t??y,strokeWidth:s??b,absoluteStrokeWidth:i??w,nonScalingStroke:l??E,className:fw(T,c),hasA11yProp:N,attributes:m});return O.createElement(R,{ref:g,...M},[...D.map(([k,I])=>O.createElement(k,I)),...Array.isArray(u)?u:[u]])});/**
113
- * @license lucide-react v1.49.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */function ft(e,t=[],n=[]){const r=typeof e=="string"?jW(e,t,n):e,s=O.forwardRef(({className:i,...l},c)=>O.createElement(VW,{ref:c,icon:r,className:i,...l}));return r.name&&(s.displayName=PW(r.name)),s}/**
118
- * @license lucide-react v1.49.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const PP={name:"anchor",size:24,node:[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]};PP.node;const zP=ft(PP);/**
123
- * @license lucide-react v1.49.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const BP={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};BP.node;const UW=ft(BP);/**
128
- * @license lucide-react v1.49.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const HP={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};HP.node;const qW=ft(HP);/**
133
- * @license lucide-react v1.49.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const FP={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};FP.node;const dw=ft(FP);/**
138
- * @license lucide-react v1.49.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const $P={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};$P.node;const GW=ft($P);/**
143
- * @license lucide-react v1.49.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const VP={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};VP.node;const KW=ft(VP);/**
148
- * @license lucide-react v1.49.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const UP={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};UP.node;const dx=ft(UP);/**
153
- * @license lucide-react v1.49.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const qP={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};qP.node;const Qp=ft(qP);/**
158
- * @license lucide-react v1.49.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const GP={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};GP.node;const YW=ft(GP);/**
163
- * @license lucide-react v1.49.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const KP={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};KP.node;const WW=ft(KP);/**
168
- * @license lucide-react v1.49.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const YP={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};YP.node;const WP=ft(YP);/**
173
- * @license lucide-react v1.49.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const XP={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};XP.node;const kC=ft(XP);/**
178
- * @license lucide-react v1.49.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const QP={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};QP.node;const XW=ft(QP);/**
183
- * @license lucide-react v1.49.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const ZP={name:"circle-x",size:24,node:[["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"}]],aliases:["x-circle"]};ZP.node;const QW=ft(ZP);/**
188
- * @license lucide-react v1.49.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const JP={name:"copy",size:24,node:[["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"}]]};JP.node;const ZW=ft(JP);/**
193
- * @license lucide-react v1.49.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const e3={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};e3.node;const JW=ft(e3);/**
198
- * @license lucide-react v1.49.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const t3={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};t3.node;const lf=ft(t3);/**
203
- * @license lucide-react v1.49.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const n3={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};n3.node;const eX=ft(n3);/**
208
- * @license lucide-react v1.49.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const r3={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};r3.node;const tX=ft(r3);/**
213
- * @license lucide-react v1.49.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const s3={name:"external-link",size:24,node:[["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"}]]};s3.node;const i3=ft(s3);/**
218
- * @license lucide-react v1.49.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const o3={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};o3.node;const l3=ft(o3);/**
223
- * @license lucide-react v1.49.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const a3={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};a3.node;const YM=ft(a3);/**
228
- * @license lucide-react v1.49.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const c3={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};c3.node;const nX=ft(c3);/**
233
- * @license lucide-react v1.49.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const u3={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};u3.node;const rX=ft(u3);/**
238
- * @license lucide-react v1.49.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const f3={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};f3.node;const sX=ft(f3);/**
243
- * @license lucide-react v1.49.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const d3={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};d3.node;const iX=ft(d3);/**
248
- * @license lucide-react v1.49.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const h3={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};h3.node;const WM=ft(h3);/**
253
- * @license lucide-react v1.49.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const p3={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};p3.node;const m3=ft(p3);/**
258
- * @license lucide-react v1.49.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const g3={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};g3.node;const MC=ft(g3);/**
263
- * @license lucide-react v1.49.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const y3={name:"refresh-cw",size:24,node:[["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"}]]};y3.node;const oX=ft(y3);/**
268
- * @license lucide-react v1.49.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const x3={name:"rotate-ccw",size:24,node:[["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"}]]};x3.node;const lX=ft(x3);/**
273
- * @license lucide-react v1.49.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const b3={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};b3.node;const VS=ft(b3);/**
278
- * @license lucide-react v1.49.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const v3={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};v3.node;const aX=ft(v3);/**
283
- * @license lucide-react v1.49.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const S3={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};S3.node;const R0=ft(S3);/**
288
- * @license lucide-react v1.49.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const w3={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};w3.node;const cX=ft(w3);/**
293
- * @license lucide-react v1.49.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const E3={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};E3.node;const AC=ft(E3);/**
298
- * @license lucide-react v1.49.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const C3={name:"triangle-alert",size:24,node:[["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"}]],aliases:["alert-triangle"]};C3.node;const uX=ft(C3);/**
303
- * @license lucide-react v1.49.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const N3={name:"user-plus",size:24,node:[["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"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};N3.node;const fX=ft(N3);/**
308
- * @license lucide-react v1.49.0 - ISC
309
- *
310
- * This source code is licensed under the ISC license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const T3={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};T3.node;const _C=ft(T3);/**
313
- * @license lucide-react v1.49.0 - ISC
314
- *
315
- * This source code is licensed under the ISC license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const R3={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};R3.node;const DC=ft(R3);/**
318
- * @license lucide-react v1.49.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const O3={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};O3.node;const hw=ft(O3);/**
323
- * @license lucide-react v1.49.0 - ISC
324
- *
325
- * This source code is licensed under the ISC license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const k3={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};k3.node;const dX=ft(k3);/**
328
- * @license lucide-react v1.49.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const M3={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};M3.node;const hX=ft(M3),A3=O.createContext(void 0);function Zp(e){const t=O.useContext(A3);if(t===void 0&&!e)throw new Error(wn(72));return t}const pX={...Xp,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class mX extends fd{constructor(n,r,s){const i=new Yp;super(gX(n,i,r,s),yX(i),pX);_t(this,"setOpen",(n,r)=>{TP(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,gt(rl,n))}}function gX(e,t,n,r=!1){return{...Wp(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function yX(e){return{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const xX=ud(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:i=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:u,onOpenChangeComplete:d,handle:h,triggerId:m,defaultTriggerId:g=null,children:y}=t,b=rx((H,z)=>new mX({open:r,openProp:s,activeTriggerId:g,triggerIdProp:m},H,z));b.useControlledProp("openProp",s),b.useControlledProp("triggerIdProp",m),b.useContextCallback("onOpenChange",u),b.useContextCallback("onOpenChangeComplete",d);const w=b.useState("open"),E=!n&&w,C=b.useState("activeTriggerId"),T=b.useState("mounted"),N=b.useState("payload");b.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:i,disabled:n}),qp(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:M}=Gp(E,b),D=b.useState("isInstantPhase"),k=b.useState("instantType"),I=b.useState("lastOpenChangeReason"),_=O.useRef(null);ze(()=>{w&&n&&b.setOpen(!1,gt(XG))},[w,n,b]),ze(()=>{M==="ending"&&I===qy||M!=="ending"&&D?(k!=="delay"&&(_.current=k),b.set("instantType","delay")):_.current!==null&&(b.set("instantType",_.current),_.current=null)},[M,D,I,k,b]),ze(()=>{E&&C==null&&b.set("payload",void 0)},[b,C,E]),O.useImperativeHandle(c,()=>({unmount:R,close:()=>b.setOpen(!1,gt(Hp))}),[R,b]);const P=E||T||!n&&l!=="none";return x.jsxs(A3.Provider,{value:b,children:[h&&x.jsx(Up,{handle:h,store:b}),P&&x.jsx(bX,{store:b,disabled:n,trackCursorAxis:l}),typeof y=="function"?y({payload:N}):y]})});function bX({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=$p(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),i=GK(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=O.useMemo(()=>Yo(i.reference,s.reference),[i.reference,s.reference]);return Kp(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:s.floating??Tn}),null}const vX=O.createContext(void 0);function SX(){return O.useContext(vX)}const wX=600,_3="data-base-ui-tooltip-trigger";function XM(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(bt(s))return s}}const t=e.target;return bt(t)?t:null}function EX(e){let t=e;for(;t;){const n=t.closest(`[${_3}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&bt(r.host)?r.host:null}return null}const CX=tx(function(t,n){const{render:r,className:s,style:i,handle:l,payload:c,disabled:u,delay:d,closeOnClick:h=!0,closeDelay:m,id:g,...y}=t,b=Zp(!0),E=ox(l)??b;if(!E)throw new Error(wn(82));const C=lo(g),T=E.useState("isTriggerActive",C),N=E.useState("isOpenedByTrigger",C),R=E.useState("floatingRootContext"),M=O.useRef(null),D=m??0,{registerTrigger:k,isMountedByThisTrigger:I}=ix(C,M,E,{payload:c,closeOnClick:h,closeDelay:D}),_=SX(),{activeIdRef:P,delayRef:H,isInstantPhase:z,hasProvider:U}=pK(R,{open:N}),j=NC(R);E.useSyncedValue("isInstantPhase",z);const B=E.useState("disabled"),L=u??B,$=Hn(L),q=E.useState("trackCursorAxis"),G=E.useState("disableHoverablePopup"),W=O.useRef(!1),Z=Jr(),re=O.useRef(void 0);function de(){return U&&P.current!=null?0:d??_??wX}function F(xe){const Se=M.current;if(!Se||!xe)return!1;const ke=EX(xe);return ke!==null&&ke!==Se&&Je(Se,ke)}function X(xe){const Se=F(xe);return W.current=Se,Se&&(j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1,Z.clear()),Se}const te=ax(R,{enabled:!L,mouseOnly:!0,move:!1,handleClose:!G&&q!=="both"?ux():null,restMs:de,delay(){return m==null&&U?{close:sp(H.current,"close")}:{close:D}},triggerElementRef:M,isActiveTrigger:T,isClosing:()=>E.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),J=EC(R,{enabled:!L}).reference,K=xe=>{const Se=W.current,ke=XM(xe),_e=X(ke),we=M.current,Re=we&&ke&&Je(we,ke);if(_e&&E.select("open")&&E.select("lastOpenChangeReason")===xn){E.setOpen(!1,gt(xn,xe));return}if(Se&&!_e&&Re&&!$.current&&!E.select("open")&&we&&ha(re.current)){const Ae=()=>{!W.current&&!$.current&&!E.select("open")&&E.setOpen(!0,gt(xn,xe,we))},Le=de();Le===0?(Z.clear(),Ae()):Z.start(Le,Ae)}},ce=E.useState("triggerProps",I);return dn("button",t,{state:{open:N},ref:[n,k,M],props:[te,J,I||q!=="none"?ce:void 0,{onMouseOver(xe){K(xe.nativeEvent)},onFocus(xe){F(XM(xe.nativeEvent))&&xe.preventBaseUIHandler()},onMouseLeave(){W.current=!1,Z.clear(),re.current=void 0},onPointerEnter(xe){re.current=xe.pointerType},onPointerDown(xe){re.current=xe.pointerType,E.set("closeOnClick",h),h&&!E.select("open")&&E.cancelPendingOpen(xe.nativeEvent)},onClick(xe){h&&!E.select("open")&&E.cancelPendingOpen(xe.nativeEvent)},id:C,[rw]:L?"":void 0,[_3]:L?void 0:""},y],stateAttributesMapping:JE})}),D3=O.createContext(void 0);function NX(){const e=O.useContext(D3);if(e===void 0)throw new Error(wn(70));return e}const I3=O.forwardRef(function(t,n){const{children:r,container:s,className:i,render:l,style:c,...u}=t,{node:d,subtree:h}=oP({container:s,ref:n,componentProps:t,elementProps:u});return!h&&!d?null:x.jsxs(O.Fragment,{children:[h,d&&Bs.createPortal(r,d)]})}),TX=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Zp().useState("mounted")||r?x.jsx(D3.Provider,{value:r,children:x.jsx(I3,{ref:n,...s})}):null}),j3=O.createContext(void 0);function L3(){const e=O.useContext(j3);if(e===void 0)throw new Error(wn(71));return e}const RX=O.createContext(void 0);function P3(){const e=O.useContext(RX);return(e==null?void 0:e.direction)??"ltr"}const OX=e=>({name:"arrow",options:e,async fn(t){var G,W;const{x:n,y:r,placement:s,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:d,padding:h=0,offsetParent:m="real"}=Ta(e,t)||{};if(d==null)return{};const g=VL(h),y={x:n,y:r},b=uC(s),w=cC(b),E=await l.getDimensions(d),C=b==="y",T=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=i.reference[w]+i.reference[b]-y[b]-i.floating[w],D=y[b]-i.reference[b],k=m==="real"?await((G=l.getOffsetParent)==null?void 0:G.call(l,d)):c.floating;let I=c.floating[R]||i.floating[w];(!I||!await((W=l.isElement)==null?void 0:W.call(l,k)))&&(I=c.floating[R]||i.floating[w]);const _=M/2-D/2,P=I/2-E[w]/2-1,H=Math.min(g[T],P),z=Math.min(g[N],P),U=H,j=I-E[w]-z,B=I/2-E[w]/2+_,L=$L(U,B,j),$=!u.arrow&&sl(s)!=null&&B!==L&&i.reference[w]/2-(B<U?H:z)-E[w]/2<0,q=$?B<U?B-U:B-j:0;return{[b]:y[b]+q,data:{[b]:L,centerOffset:B-L-q,...$&&{alignmentOffset:q}},reset:$}}}),kX=(e,t)=>{const{name:n,fn:r}=OX(e);return{name:n,fn:r,options:[e,t]}},MX={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,i=t===0&&n===0&&r===0&&s===0,l=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:l.top-n>=0||l.right-t>=0||l.bottom-n>=0||l.left-t>=0||i}}}},AX={sideX:"left",sideY:"top"},_X="--available-width",DX="--available-height",IX="--anchor-width",jX="--anchor-height",LX="--transform-origin",QM=_X,ZM=DX;function z3(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function JM(e,t,n){const{rects:r,placement:s}=e;return{side:z3(t,ti(s),n),align:sl(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function hx(e){return PX(e,JY)}function PX(e,t){var bs,qn;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:m=5,disableAnchorTracking:g=!1,inline:y,keepMounted:b=!1,floatingRootContext:w,mounted:E,collisionAvoidance:C,shift:T,nodeId:N,adaptiveOrigin:R,lazyFlip:M=!1,externalTree:D}=e,[k,I]=O.useState(null);!E&&k!==null&&I(null);const _=C.side||"flip",P=C.align||"flip",H=C.fallbackAxisSide||"end",z=(T==null?void 0:T.crossAxis)??!1,U=T==null?void 0:T.rootBoundary,j=typeof n=="function"?n:void 0,B=Qe(j),L=j?B:n,$=Hn(n),q=Hn(E),W=P3()==="rtl",Z=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":W?"left":"right","inline-start":W?"right":"left"}[s],re=l==="center"?Z:`${Z}-${l}`;let de=d;typeof de=="number"?de={top:de,right:de,bottom:de,left:de}:de&&(de={top:de.top||0,right:de.right||0,bottom:de.bottom||0,left:de.left||0});const F=1,X=s==="bottom"?F:0,te=s==="top"?F:0,J=s==="right"?F:0,K=s==="left"?F:0,ce={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:de},ye=O.useRef(null),ge=Hn(i),oe=Hn(c),xe=typeof i!="function"?i:0,Se=typeof c!="function"?c:0,ke=[];y&&ke.push(y),ke.push(kY(mt=>{const ln=JM(mt,s,W),Gn=typeof ge.current=="function"?ge.current(ln):ge.current,Rn=typeof oe.current=="function"?oe.current(ln):oe.current;return{mainAxis:Gn,crossAxis:Rn,alignmentAxis:Rn}},[xe,Se,W,s]));const _e=P==="none"&&_!=="shift",we=!_e&&(h||z||_==="shift"),Re=_==="none"?null:_Y({...ce,padding:{top:de.top+F+X,right:de.right+F+K,bottom:de.bottom+F+te,left:de.left+F+J},mainAxis:!z&&_==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:H}),Ae=_e?null:MY({...ce,rootBoundary:U,mainAxis:P!=="none",crossAxis:we,limiter:h||z?void 0:AY(mt=>{if(!ye.current)return{};const{width:ln,height:Gn}=ye.current.getBoundingClientRect(),Rn=ei(ti(mt.placement)),On=Rn==="y"?ln:Gn,Bt=Rn==="y"?de.left+de.right:de.top+de.bottom;return{offset:On/2+Bt/2}})},[ce,h,z,U,de,P]);_==="shift"||P==="shift"||l==="center"?ke.push(Ae,Re):ke.push(Re,Ae),ke.push(DY({...ce,apply({elements:{floating:mt},availableWidth:ln,availableHeight:Gn,rects:Rn}){if(!q.current)return;const On=mt.style;On.setProperty(QM,`${ln}px`),On.setProperty(ZM,`${Gn}px`);const Bt=vn(mt).devicePixelRatio||1,{x:Wt,y:Xt,width:Br,height:Kn}=Rn.reference,_n=(Math.round((Wt+Br)*Bt)-Math.round(Wt*Bt))/Bt,cr=(Math.round((Xt+Kn)*Bt)-Math.round(Xt*Bt))/Bt;On.setProperty(IX,`${_n}px`),On.setProperty(jX,`${cr}px`)}}),kX(mt=>({element:ye.current||Dt(mt.elements.floating).createElement("div"),padding:ye.current?m:0,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(mt){var ns,Rr,Or,rs,oi,dr;const{elements:{floating:ln},middlewareData:Gn,placement:Rn,platform:On,rects:Bt,y:Wt}=mt,Xt=ti(Rn),Br=sl(Rn),Kn=ei(Xt)==="y",_n=ye.current,cr=typeof i=="function"?i(JM(mt,s,W)):i;let ur;if(!_n&&Br&&Math.abs(Kn?((ns=Gn.shift)==null?void 0:ns.x)||0:((Rr=Gn.shift)==null?void 0:Rr.y)||0)<=1)ur=Br==="start"===(Kn&&((Or=On.isRTL)==null?void 0:Or.call(On,ln))===!0)?"100%":"0%";else{const Ai=Kn?((rs=Gn.arrow)==null?void 0:rs.x)||0:((oi=Gn.arrow)==null?void 0:oi.y)||0,vs=Kn?(_n==null?void 0:_n.clientWidth)||0:(_n==null?void 0:_n.clientHeight)||0;ur=`${Ai+vs/2}px`}let fr=Xt==="top"||Xt==="left"?`calc(100% + ${cr}px)`:`${-cr}px`;return we&&Kn&&Math.abs(((dr=Gn.shift)==null?void 0:dr.y)||0)>cr&&(fr=`${Bt.reference.y+Bt.reference.height/2-Wt}px`),ln.style.setProperty(LX,Kn?`${ur} ${fr}`:`${fr} ${ur}`),{}}},MX,R),ze(()=>{!E&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[E,w]);const Le=O.useMemo(()=>({ancestorScroll:!g,elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Ie,elements:Ue,x:We,y:Oe,middlewareData:De,update:ne,placement:he,context:se,isPositioned:Te,floatingStyles:Ve}=t({rootContext:w,open:b?E:void 0,placement:re,middleware:ke,strategy:r,whileElementsMounted:b?void 0:(...mt)=>PM(...mt,Le),nodeId:N,externalTree:D}),{sideX:jt,sideY:hn}=De.adaptiveOrigin||AX,Fe=Te?r:"fixed",Tt=O.useMemo(()=>{let mt;return Te?R?mt={position:Fe,[jt]:We,[hn]:Oe}:mt={...Ve,position:Fe}:mt={position:Fe,top:0,left:0},mt[QM]="100vw",mt[ZM]="100vh",Te||(mt.opacity=0),mt},[R,Fe,jt,We,hn,Oe,Ve,Te]),zt=O.useRef(null);ze(()=>{if(!E)return;const mt=$.current,ln=typeof mt=="function"?mt():mt,Rn=(eA(ln)?ln.current:ln)||null||null;Rn!==zt.current&&(Ie.setPositionReference(Rn),zt.current=Rn)},[E,Ie,L,$]),O.useEffect(()=>{if(!E)return;const mt=$.current;typeof mt!="function"&&eA(mt)&&mt.current!==zt.current&&(Ie.setPositionReference(mt.current),zt.current=mt.current)},[E,Ie,L,$]),O.useEffect(()=>{if(b&&E&&Ue.reference&&Ue.floating)return PM(Ue.reference,Ue.floating,ne,Le)},[b,E,Ue,ne,Le]);const Vn=ti(he),Un=z3(s,Vn,W),xs=sl(he)||"center",on=!!((bs=De.hide)!=null&&bs.referenceHidden);ze(()=>{M&&E&&Te&&Vn!==Z&&I(Vn)},[M,E,Te,Vn,Z]);const ar=O.useMemo(()=>{var mt,ln;return{position:"absolute",top:(mt=De.arrow)==null?void 0:mt.y,left:(ln=De.arrow)==null?void 0:ln.x}},[De.arrow]),zr=((qn=De.arrow)==null?void 0:qn.centerOffset)!==0;return O.useMemo(()=>({positionerStyles:Tt,arrowStyles:ar,arrowRef:ye,arrowUncentered:zr,side:Un,align:xs,physicalSide:Vn,anchorHidden:on,refs:Ie,context:se,isPositioned:Te,update:ne}),[Tt,ar,ye,zr,Un,xs,Vn,on,Ie,se,Te,ne])}function eA(e){return e!=null&&"current"in e}function Jp(e){return e==="starting"?BK:Tn}function px(e,t,{styles:n,transitionStatus:r,props:s,refs:i,hidden:l,inert:c=!1}){const u={...n};return c&&(u.pointerEvents="none"),dn("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:l,style:u},Jp(r),s],stateAttributesMapping:Uy})}const zX=O.forwardRef(function(t,n){const{render:r,className:s,anchor:i,positionMethod:l="absolute",side:c="top",align:u="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:y=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:E=Zy,style:C,...T}=t,N=Zp(),R=NX(),M=N.useState("open"),D=N.useState("mounted"),k=N.useState("trackCursorAxis"),I=N.useState("disableHoverablePopup"),_=N.useState("floatingRootContext"),P=N.useState("instantType"),H=N.useState("transitionStatus"),z=N.useState("adaptiveOrigin"),U=hx({anchor:i,positionMethod:l,floatingRootContext:_,mounted:D,side:c,sideOffset:d,align:u,alignOffset:h,collisionBoundary:m,collisionPadding:g,sticky:b,arrowPadding:y,disableAnchorTracking:w,keepMounted:R,collisionAvoidance:E,adaptiveOrigin:z}),j=O.useMemo(()=>({open:M,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:k!=="none"?"tracking-cursor":P}),[M,U.side,U.align,U.anchorHidden,k,P]),B=px(t,j,{styles:U.positionerStyles,transitionStatus:H,props:T,refs:[n,N.useStateSetter("positionerElement")],hidden:!D,inert:!M||k==="both"||I});return x.jsx(j3.Provider,{value:U,children:B})}),BX=O.forwardRef(function(t,n){const{render:r,className:s,style:i,...l}=t,c=Zp(),{side:u,align:d}=L3(),h=c.useState("open"),m=c.useState("instantType"),g=c.useState("transitionStatus"),y=c.useState("popupProps"),b=c.useState("floatingRootContext"),w=c.useState("disabled"),E=c.useState("closeDelay");ou({open:h,ref:c.context.popupRef,onComplete(){var R,M;h&&((M=(R=c.context).onOpenChangeComplete)==null||M.call(R,!0))}}),lx(b,{enabled:!w,closeDelay:E});const C=c.useStateSetter("popupElement");return dn("div",t,{state:{open:h,side:u,align:d,instant:m,transitionStatus:g},ref:[n,c.context.popupRef,C],props:[Vp,y,Jp(g),l],stateAttributesMapping:zp})}),HX=O.forwardRef(function(t,n){const{render:r,className:s,style:i,...l}=t,c=Zp(),{arrowRef:u,side:d,align:h,arrowUncentered:m,arrowStyles:g}=L3(),y=c.useState("open"),b=c.useState("instantType");return dn("div",t,{state:{open:y,side:d,align:h,uncentered:m,instant:b},ref:[n,u],props:[{style:g,"aria-hidden":!0},l],stateAttributesMapping:Uy})});function B3({...e}){return x.jsx(xX,{"data-slot":"tooltip",...e})}function H3({...e}){return x.jsx(CX,{"data-slot":"tooltip-trigger",...e})}function F3({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:s=0,children:i,...l}){return x.jsx(TX,{children:x.jsx(zX,{align:r,alignOffset:s,side:t,sideOffset:n,className:"isolate z-50",children:x.jsxs(BX,{"data-slot":"tooltip-content",className:Ne("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l,children:[i,x.jsx(HX,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const FX={previous:WW,next:Qp,"zoom-in":dX,"zoom-out":hX,"reset-view":lX,"collapse-all":WP,"expand-all":kC,"full-screen":nX,"exit-full-screen":iX,close:DC,top:GW,settings:aX,edit:m3,delete:AC,add:MC,clear:tX,remove:QW,copy:ZW,copied:dx},un=({icon:e,label:t,isDisabled:n=!1,variant:r="ghost",labelPlace:s="tooltip",className:i,onClick:l})=>{const c=FX[e];return s==="beside"?x.jsxs(nt,{variant:r,size:"sm","aria-label":t,disabled:n,className:i,onClick:l,children:[x.jsx(c,{"data-icon":"inline-start","aria-hidden":"true"}),x.jsx("span",{className:"text-box-cap",children:t})]}):x.jsxs(B3,{children:[x.jsx(H3,{render:x.jsx(nt,{variant:r,size:"icon-sm","aria-label":t,disabled:n,className:i,onClick:l}),children:x.jsx(c,{"aria-hidden":"true"})}),x.jsx(F3,{children:t})]})},$3="escape-key",$X=e=>e instanceof HTMLElement&&e.getAttribute("aria-expanded")==="true",fbe=e=>(t,n)=>{t||(n.reason===$3&&$X(n.event.target)?n.cancel():e())},tA={x:0,y:0},VX=0,UX=4,nA=["pointerup","pointercancel"],qX=(e,t)=>({x:t.x-e.x,y:t.y-e.y}),GX=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),KX=({x:e,y:t})=>Math.hypot(e,t)>=UX,rA=({clientX:e,clientY:t})=>({x:e,y:t}),YX=()=>{const[e,t]=O.useState(tA),[n,r]=O.useState(!1),s=O.useRef(!1);return{offset:e,isDragging:n,startDrag:u=>{if(u.button!==VX)return;s.current=!1;const d=rA(u),h=e,m=y=>{const b=qX(d,rA(y));!s.current&&!KX(b)||(s.current=!0,r(!0),t(GX(h,b)))},g=()=>{window.removeEventListener("pointermove",m),nA.forEach(y=>{window.removeEventListener(y,g)}),r(!1)};window.addEventListener("pointermove",m),nA.forEach(y=>{window.addEventListener(y,g)})},swallowClickAfterDrag:u=>{s.current&&(s.current=!1,u.stopPropagation(),u.preventDefault())},panTo:t,resetPan:()=>{t(tA)}}},V3="flight-plan:layout:v1",U3="flight-plan:layout-saved",sA=[U3,"storage"],ty={diagramPanelWidthPx:null},WX=e=>{if(typeof e!="object"||e===null||!("diagramPanelWidthPx"in e))return ty;const{diagramPanelWidthPx:t}=e;return typeof t=="number"&&Number.isFinite(t)?{diagramPanelWidthPx:t}:ty},XX=e=>{try{return e===null?ty:WX(JSON.parse(e))}catch{return ty}},QX=()=>{try{return window.localStorage.getItem(V3)}catch{return null}},ZX=()=>null,JX=e=>(sA.forEach(t=>{window.addEventListener(t,e)}),()=>{sA.forEach(t=>{window.removeEventListener(t,e)})}),eQ=e=>{try{window.localStorage.setItem(V3,JSON.stringify(e))}catch{return}window.dispatchEvent(new Event(U3))},tQ=()=>{const e=O.useSyncExternalStore(JX,QX,ZX);return O.useMemo(()=>XX(e),[e])},nQ=0,IC=320,rQ=.8,iA=32,oA=["pointerup","pointercancel"],lA={ArrowLeft:iA,ArrowRight:-iA},q3=e=>Math.max(IC,Math.round(e*rQ)),aA=(e,t)=>Math.round(Math.min(q3(t),Math.max(IC,e))),sQ=e=>{const{diagramPanelWidthPx:t}=tQ(),[n,r]=O.useState(null),s=n!==null,i=d=>{eQ({diagramPanelWidthPx:d})};return{widthPx:n??t,isResizing:s,narrowestPx:IC,startResize:d=>{if(d.button!==nQ)return;d.preventDefault();const h=d.clientX,m=e(),g=w=>aA(m+h-w,window.innerWidth),y=w=>{r(g(w.clientX))},b=w=>{window.removeEventListener("pointermove",y),oA.forEach(E=>{window.removeEventListener(E,b)}),r(null),i(g(w.clientX))};r(Math.round(m)),window.addEventListener("pointermove",y),oA.forEach(w=>{window.addEventListener(w,b)})},resizeByKey:d=>{Object.hasOwn(lA,d.key)&&(d.preventDefault(),i(aA(e()+lA[d.key],window.innerWidth)))},resetWidth:()=>{i(null)}}},iQ=1.25,cA=-3,uA=2,oQ=2,lQ=160,aQ="Side panel width",cQ=669,uQ="Its own width",fQ="Drag to resize, double-click to reset",dQ=({label:e,width:t,height:n,zoom:r,offset:s,isDragging:i,isCentred:l,children:c,onDragStart:u,onClickCapture:d})=>x.jsx("div",{role:"group","aria-label":e,"data-dragging":i,className:Ne("size-full cursor-grab touch-none overflow-clip bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[dragging=true]:cursor-grabbing",l&&"flex items-center justify-center"),style:{backgroundPosition:`${String(s.x)}px ${String(s.y)}px`},onPointerDown:u,onClickCapture:d,children:x.jsx("div",{className:l?"shrink-0":"mx-auto",style:{width:t*r,height:n*r,transform:`translate(${String(s.x)}px, ${String(s.y)}px)`},children:x.jsx("div",{className:"relative origin-top-left",style:{width:t,height:n,transform:`scale(${String(r)})`},children:c})})}),G3="pointer-events-none z-10 flex justify-center",hQ=`${G3} sticky bottom-2 mb-2`,pQ=`${G3} absolute inset-x-0 bottom-2`,K3=({label:e,width:t,height:n,isFullScreen:r,isCentred:s=!1,panel:i,actions:l=null,renderCanvas:c=null,children:u=null,onFullScreenChange:d,onPanelClose:h})=>{const[m,g]=O.useState(0),{offset:y,isDragging:b,startDrag:w,swallowClickAfterDrag:E,panTo:C,resetPan:T}=YX(),N=O.useRef(null),R=()=>{var B;return((B=N.current)==null?void 0:B.getBoundingClientRect().width)??0},{widthPx:M,isResizing:D,narrowestPx:k,startResize:I,resizeByKey:_,resetWidth:P}=sQ(R),H=iQ**m,z=(B,L)=>{!B&&L.reason===$3&&i!==null?h():d(B)},U=x.jsxs("div",{className:"pointer-events-auto flex max-w-full flex-wrap items-center justify-center gap-0.5 rounded-md border border-input bg-card p-0.5",children:[l===null?null:x.jsxs(x.Fragment,{children:[l,x.jsx("span",{"aria-hidden":"true",className:"mx-0.5 h-5 w-px bg-border"})]}),x.jsx(un,{icon:"zoom-out",label:"Zoom out",labelPlace:"beside",isDisabled:m===cA,onClick:()=>{g(B=>Math.max(cA,B-1))}}),x.jsx(un,{icon:"zoom-in",label:"Zoom in",labelPlace:"beside",isDisabled:m===uA,onClick:()=>{g(B=>Math.min(uA,B+1))}}),x.jsx(un,{icon:"reset-view",label:"Reset view",labelPlace:"beside",onClick:()=>{g(0),T()}}),x.jsx(un,{icon:r?"exit-full-screen":"full-screen",label:r?"Leave full screen":"Full screen",labelPlace:"beside",onClick:()=>{d(!r)}})]}),j=c===null?x.jsx(dQ,{label:e,width:t,height:n,zoom:H,offset:y,isDragging:b,isCentred:s,onDragStart:w,onClickCapture:E,children:u}):c({zoom:H,offset:y,onPan:C});return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"relative flex flex-col justify-end rounded-md border",style:{height:Math.max(lQ,n*H+oQ)},children:r?null:x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"absolute inset-0",children:j}),x.jsx("div",{className:hQ,children:U})]})}),x.jsx(IP,{open:r,onOpenChange:z,children:x.jsx(_P,{children:x.jsxs(AP,{"aria-label":e,className:"fixed inset-0 z-50 flex bg-background text-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",children:[x.jsxs("div",{className:"relative min-w-0 flex-1",children:[x.jsx("div",{className:pQ,children:U}),j]}),i===null?null:x.jsx("div",{role:"slider",tabIndex:0,"aria-orientation":"horizontal","aria-label":aQ,"aria-valuemin":k,"aria-valuemax":q3(window.innerWidth),"aria-valuenow":M??cQ,"aria-valuetext":M===null?uQ:`${String(M)} pixels`,title:fQ,"data-resizing":D,className:"relative z-10 w-px shrink-0 cursor-col-resize touch-none bg-border transition-colors duration-[180ms] ease-out after:absolute after:inset-y-0 after:-right-1 after:-left-1 hover:bg-foreground focus-visible:bg-ring focus-visible:outline-2 focus-visible:outline-ring data-[resizing=true]:bg-foreground",onPointerDown:I,onKeyDown:_,onDoubleClick:P}),x.jsx("aside",{ref:N,style:M===null?void 0:{width:M},className:Ne("w-[min(41.8rem,52.8vw)] max-w-[80vw] min-w-80 shrink-0 overflow-y-auto bg-background duration-200 ease-out animate-in slide-in-from-right-8",i===null?"hidden":""),children:i})]})})})]})};function mQ(e){return!Y3(e)}function Y3(e){return e.hasOwnProperty("lineNumber")}function gQ(e,t,n){if(t==="children")e.children=n||e.children;else if(t==="_ref")e._ref=n||e._ref;else if(t==="data")e.data=e.data?{...e.data,...n}:n;else if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style={...e.style,...n};else if(typeof n=="function"){const r=e[t];e[t]=r?(...s)=>{r(...s),n(...s)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error(`Didn’t know how to merge prop '${t}'. Only 'className', 'style', and event handlers are supported`)}}function jC(...e){return e.length===1?e[0]:e.reduce((t,n)=>{for(const r in n)gQ(t,r,n[r]);return t},{})}const W3=({merge:e,...t})=>{const{_stack:n,...r}=jC(e,t),[s,...i]=n;if(s)return x.jsx(s,{_stack:i,...r});{const{_ref:l,data:c,children:u,...d}=r;return x.jsx("pre",{...d,ref:l,"data-ch":!0,children:x.jsx("div",{style:{minWidth:"fit-content"},children:u})})}},pw=({merge:e,...t})=>{const{_stack:n,...r}=jC(e,t),[s,...i]=n;if(s){const{Component:l,annotation:c}=s;return x.jsx(l,{_stack:i,...r,annotation:c})}else{const{lineNumber:l,totalLines:c,indentation:u,data:d,annotation:h,...m}=r;return x.jsx("div",{...m})}},yQ=({merge:e,...t})=>{const{_stack:n,...r}=jC(e,t),[s,...i]=n;if(s){const{Component:l,annotation:c}=s;return x.jsx(l,{_stack:i,...r,annotation:c})}else{const{value:l,data:c,...u}=r;return x.jsx("span",{...u,children:l})}},xQ=e=>{const t=O.useRef(null),n=e._ref||t;return x.jsx(W3,{merge:e,_ref:n})};function bQ(e,t){let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=vQ(n,s)}return n}function vQ(e,t){const{fromColumn:n,toColumn:r}=t,s=[n,r];let i=mw(e,s[0]);i=mw(i,s[1]+1);let l=[],c=[],u=[];return i.forEach(d=>{d.range[1]<s[0]?l.push(d):d.range[0]>s[1]?u.push(d):c.push(d)}),[...l,{annotation:t,content:c,range:[c[0].range[0],c[c.length-1].range[1]]},...u]}function mw(e,t){const n=e.findIndex(s=>s.range[0]<t&&t<=s.range[1]);if(n===-1)return e;const r=e[n];if(X3(r)){const s=mw(r.content,t);let i=[],l=[];for(const c of s)c.range[1]<t?i.push(c):l.push(c);return[...e.slice(0,n),{...r,content:i,range:[r.range[0],t-1]},{...r,content:l,range:[t,r.range[1]]},...e.slice(n+1)]}return[...e.slice(0,n),{...r,value:r.value.slice(0,t-r.range[0]),range:[r.range[0],t-1]},{...r,value:r.value.slice(t-r.range[0]),range:[t,r.range[1]]},...e.slice(n+1)]}function X3(e){return e.content!==void 0}function Q3({content:e,handlers:t,annotationStack:n}){return e.map((r,s)=>X3(r)?x.jsx(wQ,{annotationStack:n,handlers:t,group:r},s):r.style?x.jsx(SQ,{annotationStack:n,handlers:t,token:r},s):r.value)}function SQ({handlers:e,token:t,annotationStack:n}){const r=EQ(e,n);return x.jsx(yQ,{merge:{_stack:r,style:t.style,value:t.value}})}function wQ({group:e,handlers:t,annotationStack:n}){var r;const{annotation:s,content:i}=e,{name:l}=s,c=Q3({content:i,handlers:t,annotationStack:[...n,s]}),u=(r=t.find(d=>d.name===l))===null||r===void 0?void 0:r.Inline;return u?x.jsx(u,{annotation:s,children:c}):c}function EQ(e,t){const n=[];return e.forEach(({name:r,Token:s,AnnotatedToken:i})=>{const l=t.filter(c=>c.name===r);i&&l.forEach(c=>n.push({Component:i,annotation:c})),s&&(l.length||n.push({Component:s}),l.forEach(c=>n.push({Component:s,annotation:c})))}),n}const CQ=" ";function NQ(e){const t=[[]],n=e.slice();let r=1;for(;n.length;){const i=n.shift();if(typeof i=="string"){const[l,...c]=i.split(`
333
- `);if(l){let u=r;r+=l.length,t[t.length-1].push({value:l,range:[u,r]})}c.length&&(t[t.length-1].push({value:`
334
- `,range:[r,r+1]}),t.push([]),r=1,n.unshift(c.join(`
335
- `)))}else{const[l,c,u={}]=i;let d=r;r+=l.length,t[t.length-1].push({value:l,style:{color:c,...u},range:[d,r]})}}const s=t.length;return t.map((i,l)=>{var c,u,d;return{tokens:i,range:[l+1,l+1],lineNumber:l+1,indentation:((d=(u=(c=i[0])===null||c===void 0?void 0:c.value)===null||u===void 0?void 0:u.replace(/\t/g,CQ).match(/^\s*/))===null||d===void 0?void 0:d[0].length)||0,totalLines:s}})}function TQ(e,t){let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=RQ(n,s)}return n}function RQ(e,t){const{fromLineNumber:n,toLineNumber:r}=t,s=[n,r];let i=gw(e,s[0]);i=gw(i,s[1]+1);let l=[],c=[],u=[];return i.forEach(d=>{d.range[1]<s[0]?l.push(d):d.range[0]>s[1]?u.push(d):c.push(d)}),[...l,{annotation:t,lines:c,range:[c[0].range[0],c[c.length-1].range[1]]},...u]}function gw(e,t){const n=e.findIndex(c=>Z3(c)&&c.range[0]<t&&t<=c.range[1]);if(n===-1)return e;const r=e[n],s=gw(r.lines,t);let i=[],l=[];return s.forEach(c=>{c.range[1]<t?i.push(c):l.push(c)}),[...e.slice(0,n),{...r,lines:i,range:[r.range[0],t-1]},{...r,lines:l,range:[t,r.range[1]]},...e.slice(n+1)]}function Z3(e){return e.annotation!==void 0}function J3({linesOrGroups:e,handlers:t,inlineAnnotations:n,annotationStack:r=[]}){return e.map(s=>Z3(s)?x.jsx(kQ,{group:s,handlers:t,inlineAnnotations:n,annotationStack:r},s.range[0]):x.jsx(OQ,{line:s,handlers:t,inlineAnnotations:n,annotationStack:r},s.lineNumber))}function OQ({line:e,handlers:t,inlineAnnotations:n,annotationStack:r=[]}){const{lineNumber:s,totalLines:i,indentation:l}=e,c=n.filter(g=>g.lineNumber===s),u=bQ(e.tokens,c),d=MQ(t,r);let h=Q3({content:u,handlers:t,annotationStack:r});const m={lineNumber:s,indentation:l,totalLines:i,_stack:d};return x.jsx(pw,{merge:m,children:h},s)}function kQ({group:e,handlers:t,inlineAnnotations:n,annotationStack:r}){var s;const{annotation:i,lines:l}=e,{name:c}=i,u=(s=t.find(h=>h.name===c))===null||s===void 0?void 0:s.Block,d=J3({linesOrGroups:l,handlers:t,inlineAnnotations:n,annotationStack:[...r,i]});return u?x.jsx(u,{annotation:i,children:d}):d}function MQ(e,t){const n=[];return e.forEach(({name:r,Line:s,AnnotatedLine:i})=>{const l=t.filter(c=>c.name===r);i&&l.forEach(c=>{n.push({Component:i,annotation:c})}),s&&(l.length||n.push({Component:s}),l.forEach(c=>{n.push({Component:s,annotation:c})}))}),n}const AQ=O.forwardRef(({code:e,handlers:t=[],...n},r)=>{let{tokens:s,themeName:i,lang:l,annotations:c}=e;if(!s)throw new Error("Missing tokens in code block. Use the `highlight` function to generate the tokens.");t.filter(g=>g.transform).forEach(g=>{c=c.flatMap(y=>g.name!=y.name?y:g.transform(y)||[])});const u=new Set(c.map(g=>g.name)),d=t.filter(g=>!g.onlyIfAnnotated||u.has(g.name)),m={_stack:DQ(d),_ref:r};return x.jsx(W3,{merge:m,"data-theme":i,"data-lang":l,...n,children:x.jsx(_Q,{tokens:s,handlers:d,annotations:c})})});function _Q({tokens:e,handlers:t,annotations:n}){const r=NQ(e),s=n.filter(mQ),i=n.filter(Y3),l=TQ(r,s);return J3({linesOrGroups:l,handlers:t,inlineAnnotations:i})}function DQ(e){const t=e.map(({Pre:r})=>r).filter(Boolean),n=e.map(({PreWithRef:r})=>r).filter(Boolean);return n.length>0&&n.unshift(xQ),[...t,...n]}const e4=O.createContext(void 0);function em(e){const t=O.useContext(e4);if(t===void 0&&!e)throw new Error(wn(50));return t}const IQ=600,t4=300,jQ={...Xp,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay};class LQ extends fd{constructor(n,r,s){const i=new Yp;super(PQ(n,i,r,s),zQ(i),jQ);_t(this,"setOpen",(n,r)=>{const{inlineRectCoordsRef:s}=this.context;TP(this,n,r,{onBeforeDispatch(){var l;const i=r.event;n&&r.reason===xn&&r.trigger&&"clientX"in i&&"clientY"in i&&((l=s.current)==null?void 0:l.element)!==r.trigger&&vP(s,r.trigger,i.clientX,i.clientY)}})})}}function PQ(e,t,n,r=!1){return{...Wp(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:t4,...e}}function zQ(e){return{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function fA(e){const{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:s,actionsRef:i,handle:l,triggerId:c,defaultTriggerId:u=null,children:d}=e,h=rx((C,T)=>new LQ({open:n,openProp:t,activeTriggerId:u,triggerIdProp:c},C,T));h.useControlledProp("openProp",t),h.useControlledProp("triggerIdProp",c),h.useContextCallback("onOpenChange",r),h.useContextCallback("onOpenChangeComplete",s);const m=h.useState("open"),g=h.useState("activeTriggerId"),y=h.useState("mounted"),b=h.useState("payload");qp(h,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w}=Gp(m,h,()=>{h.context.inlineRectCoordsRef.current=void 0});ze(()=>{m&&g==null&&h.set("payload",void 0)},[h,g,m]),O.useImperativeHandle(i,()=>({unmount:w,close:()=>h.setOpen(!1,gt(Hp))}),[w,h]);const E=m||y;return x.jsxs(e4.Provider,{value:h,children:[l&&x.jsx(Up,{handle:l,store:h}),E&&x.jsx(BQ,{store:h}),typeof d=="function"?d({payload:b}):d]})}function BQ({store:e}){const t=e.useState("floatingRootContext"),n=$p(t);return Kp(e,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}const HQ=ud(function(t){return em(!0)?x.jsx(fA,{...t}):x.jsx(gC,{children:x.jsx(fA,{...t})})}),n4=O.createContext(void 0);function FQ(){const e=O.useContext(n4);if(e===void 0)throw new Error(wn(48));return e}const $Q=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return em().useState("mounted")||r?x.jsx(n4.Provider,{value:r,children:x.jsx(I3,{ref:n,...s})}):null}),VQ=tx(function(t,n){const{render:r,className:s,delay:i,closeDelay:l,id:c,payload:u,handle:d,style:h,...m}=t,g=em(!0),b=ox(d)??g;if(!b)throw new Error(wn(89));const w=lo(c),E=b.useState("isTriggerActive",w),C=b.useState("isOpenedByTrigger",w),T=b.useState("floatingRootContext"),N=b.context.inlineRectCoordsRef,R=O.useRef(null),M=i??IQ,D=l??t4,{registerTrigger:k,isMountedByThisTrigger:I}=ix(w,R,b,{payload:u,closeDelay:D}),_=ax(T,{mouseOnly:!0,move:!1,handleClose:ux(),delay:()=>({open:M,close:D}),triggerElementRef:R,isActiveTrigger:E,isClosing:()=>b.select("transitionStatus")==="ending"}),P=EC(T,{delay:M}),H={open:C},z=b.useState("triggerProps",I),U=zY(N,C);return dn("a",t,{state:H,ref:[n,k,R],props:[_,P.reference,z,U,{id:w},m],stateAttributesMapping:JE})}),r4=O.createContext(void 0);function UQ(){const e=O.useContext(r4);if(e===void 0)throw new Error(wn(49));return e}const qQ=O.forwardRef(function(t,n){const{render:r,className:s,anchor:i,positionMethod:l="absolute",side:c="bottom",align:u="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:y=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:E=Zy,style:C,...T}=t,N=em(),R=FQ(),M=Jy(),D=N.useState("open"),k=N.useState("mounted"),I=N.useState("floatingRootContext"),_=N.useState("instantType"),P=N.useState("transitionStatus"),H=N.useState("adaptiveOrigin"),z=N.context.inlineRectCoordsRef,U=hx({anchor:i,floatingRootContext:I,positionMethod:l,mounted:k,side:c,sideOffset:d,align:u,alignOffset:h,arrowPadding:y,collisionBoundary:m,collisionPadding:g,sticky:b,disableAnchorTracking:w,keepMounted:R,nodeId:M,collisionAvoidance:E,adaptiveOrigin:H,inline:BY(z)}),j=U.update;ze(()=>{D&&k&&j()},[D,k,j]);const B={open:D,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:_},L=px(t,B,{styles:U.positionerStyles,transitionStatus:P,props:T,refs:[n,N.useStateSetter("positionerElement")],hidden:!k,inert:!D});return x.jsx(r4.Provider,{value:U,children:x.jsx(mC,{id:M,children:L})})}),GQ=O.forwardRef(function(t,n){const{className:r,render:s,style:i,...l}=t,c=em(),{side:u,align:d}=UQ(),h=c.useState("open"),m=c.useState("instantType"),g=c.useState("transitionStatus"),y=c.useState("popupProps"),b=c.useState("floatingRootContext"),w=c.useState("closeDelay");return ou({open:h,ref:c.context.popupRef,onComplete(){var T,N;h&&((N=(T=c.context).onOpenChangeComplete)==null||N.call(T,!0))}}),lx(b,{closeDelay:w}),dn("div",t,{state:{open:h,side:u,align:d,instant:m,transitionStatus:g},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[Vp,y,Jp(g),l],stateAttributesMapping:zp})});function s4({...e}){return x.jsx(HQ,{"data-slot":"hover-card",...e})}function i4({...e}){return x.jsx(VQ,{"data-slot":"hover-card-trigger",...e})}function o4({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:s=0,...i}){return x.jsx($Q,{"data-slot":"hover-card-portal",children:x.jsx(qQ,{align:r,alignOffset:s,side:t,sideOffset:n,collisionPadding:8,className:"isolate z-50",children:x.jsx(GQ,{"data-slot":"hover-card-content",className:Ne("z-50 origin-(--transform-origin) rounded-lg border border-foreground bg-popover text-sm text-popover-foreground outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...i})})})}const dd=({href:e,label:t,className:n})=>x.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:Ne("inline-flex items-center gap-1 rounded-sm text-sm text-[var(--line,var(--muted-foreground))] hover:text-foreground",n),children:[x.jsx("span",{children:t}),x.jsx(i3,{"aria-hidden":"true",className:"size-3.5"})]}),KQ={plain:void 0,keyword:"var(--color-syntax-keyword)",string:"var(--color-syntax-string)",number:"var(--color-syntax-number)",comment:"var(--color-syntax-quiet)",function:"var(--color-syntax-function)",type:"var(--color-syntax-type)",property:void 0,constant:"var(--color-syntax-number)",tag:"var(--color-syntax-type)",punctuation:void 0},YQ={context:"",added:"bg-diff-added/12",removed:"bg-diff-removed/10"},WQ={context:"",added:"+",removed:"-"},XQ={context:"",added:"text-diff-added",removed:"text-diff-removed"},dA={context:"",added:"added",removed:"removed"},l4=`
336
- `,QQ="line",a4="mark",c4="definition",ZQ=150,JQ={},eZ="group-has-data-[focused=true]/code:opacity-55 data-[focused=true]:opacity-100",tZ="absolute top-0.5 left-1 flex size-4 items-center justify-center rounded-sm bg-(--line) text-line-foreground opacity-0 group-hover/line:opacity-100 focus-visible:opacity-100",nZ="rounded-sm bg-[color-mix(in_oklab,var(--line,var(--color-primary))_22%,transparent)] outline outline-1 outline-[var(--line,var(--color-primary))]",rZ="max-h-48 shrink-0 overflow-y-auto border-b px-3 py-2.5 text-foreground",sZ="rounded-sm underline decoration-muted-foreground decoration-dotted underline-offset-[0.25em] hover:bg-muted focus-visible:bg-muted",iZ="data-[selected=true]:bg-primary/20",oZ="data-[commented=true]:shadow-[inset_3px_0_0_var(--line,var(--color-primary))]",yw="pr-2 text-right text-syntax-quiet tabular-nums select-none",lZ="cursor-pointer hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring aria-pressed:font-bold aria-pressed:text-foreground",u4={},ny=new Set,aZ={lines:[],definitions:u4,isWrapped:!1,selectedLineLabels:ny,commentedLineKeys:ny},cZ=":",f4=({side:e,lineLabel:t})=>`${e}${cZ}${t}`,uZ=e=>e.mark==="removed"?e.removedNumberLabel===""?null:{side:"old",lineLabel:e.removedNumberLabel}:e.numberLabel===""?null:{side:"new",lineLabel:e.numberLabel},mx=O.createContext(aZ),fZ=({text:e,kind:t})=>[e,KQ[t]],dZ=e=>e.flatMap((t,n)=>[...t.tokens.map(fZ),...n===e.length-1?[]:[l4]]),hZ=e=>e.flatMap((t,n)=>[...t.marks.map(r=>({name:a4,query:"",lineNumber:n+1,...r})),...t.references.map(({definitionId:r,...s})=>({name:c4,query:r,lineNumber:n+1,...s}))]),pZ=e=>{const t=e.map(n=>n.tokens.map(r=>r.text).join("")).join(l4);return{value:t,code:t,annotations:hZ(e),tokens:dZ(e),lang:"",meta:"",themeName:"",style:JQ}},mZ=({numberLabel:e,isSelected:t})=>{const{selectLineLabel:n,onSelectLine:r}=O.use(mx);return r===void 0||n===void 0||e===""?x.jsx("span",{className:yw,children:e}):x.jsx("button",{type:"button","aria-label":`${n} ${e}`,"aria-pressed":t,className:Ne(yw,lZ),onClick:s=>{r(e,s.shiftKey)},children:e})},gZ={name:QQ,Line:e=>{const{lines:t,isWrapped:n,addCommentLabel:r,selectedLineLabels:s,commentedLineKeys:i,renderLineExtra:l,renderLineThreads:c,onAddComment:u}=O.use(mx),d=t.find((y,b)=>b===e.lineNumber-1);if(d===void 0)return x.jsx(pw,{merge:e});const h=s.has(d.numberLabel),m=uZ(d),g=m===null?"":`${dA[d.mark]} ${m.lineLabel}`.trim();return x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-line":d.numberLabel,"data-mark":d.mark,"data-focused":d.isFocused,"data-selected":h,"data-commented":m!==null&&i.has(f4(m)),"data-comment-side":u===void 0||m==null?void 0:m.side,"data-comment-line":u===void 0||m==null?void 0:m.lineLabel,className:Ne("group/line relative grid min-h-6 grid-cols-[3.25rem_1.25rem_1fr] pr-4",YQ[d.mark],eZ,iZ,oZ),children:[d.mark==="removed"&&d.removedNumberLabel!==""?x.jsx("span",{className:yw,children:d.removedNumberLabel}):x.jsx(mZ,{numberLabel:d.numberLabel,isSelected:h}),x.jsxs("span",{className:Ne("text-center font-bold select-none",XQ[d.mark]),children:[x.jsx("span",{"aria-hidden":"true",children:WQ[d.mark]}),x.jsx("span",{className:"sr-only",children:dA[d.mark]})]}),x.jsx(pw,{merge:e,className:n?"wrap-anywhere whitespace-pre-wrap":"whitespace-pre"}),u===void 0||r===void 0||m===null?null:x.jsx("button",{type:"button","aria-label":`${r} ${g}`,title:r,className:tZ,onClick:y=>{u(m,y.shiftKey)},children:x.jsx(MC,{"aria-hidden":"true",className:"size-3",strokeWidth:3})})]}),l===void 0||d.numberLabel===""?null:l(d.numberLabel),c===void 0||m===null?null:c(m)]})}},yZ={name:a4,Inline:({children:e})=>x.jsx("mark",{className:Ne("text-inherit",nZ),children:e})},xZ={name:c4,Inline:({annotation:e,children:t})=>{const{definitions:n,renderDefinitionDescription:r}=O.use(mx);if(!Object.hasOwn(n,e.query))return x.jsx(x.Fragment,{children:t});const s=n[e.query],i=`${s.pathLabel}, ${s.rangeLabel}`;return x.jsxs(s4,{children:[x.jsx(i4,{delay:ZQ,render:x.jsx("span",{}),tabIndex:0,"aria-label":`Defined in ${i}`,className:sZ,children:t}),x.jsxs(o4,{className:"flex max-h-[30rem] w-[min(36rem,calc(100vw-2rem))] flex-col overflow-hidden font-sans whitespace-normal",children:[x.jsxs("div",{className:"flex items-baseline justify-between gap-4 border-b px-3 py-2",children:[x.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:s.pathLabel}),x.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:s.rangeLabel})]}),s.description===null||r===void 0?null:x.jsx("div",{className:rZ,children:r(s.description)}),s.lines.length===0?null:x.jsx(lu,{lines:s.lines,label:i,className:"min-h-24 flex-1 overflow-y-auto"}),s.note===null&&s.forgeLink===null?null:x.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1 border-t px-3 py-1.5 text-xs",children:[s.note===null?null:x.jsx("span",{className:"text-muted-foreground",children:s.note}),s.forgeLink===null?null:x.jsx(dd,{href:s.forgeLink.href,label:s.forgeLink.label})]})]})]})}},bZ=[gZ,yZ,xZ];function lu({lines:e,definitions:t=u4,label:n,path:r,className:s,isWrapped:i=!1,addCommentLabel:l,selectLineLabel:c,selectedLineLabels:u=ny,commentedLineKeys:d=ny,renderLineExtra:h,renderLineThreads:m,renderDefinitionDescription:g,onAddComment:y,onSelectLine:b}){const w=O.useMemo(()=>({lines:e,definitions:t,isWrapped:i,addCommentLabel:l,selectLineLabel:c,selectedLineLabels:u,commentedLineKeys:d,renderLineExtra:h,renderLineThreads:m,renderDefinitionDescription:g,onAddComment:y,onSelectLine:b}),[e,t,i,l,c,u,d,h,m,g,y,b]),E=O.useMemo(()=>pZ(e),[e]);return x.jsx("div",{role:"group","aria-label":n,"data-path":r,className:Ne("group/code overflow-x-auto bg-code py-2 font-mono text-sm leading-6",s),children:x.jsx(mx,{value:w,children:x.jsx(AQ,{code:E,handlers:bZ,className:Ne("m-0 grid",i?"":"min-w-max")})})})}const d4=({title:e,titleKind:t="plain",kindLabel:n,target:r,codeViews:s=null,children:i,onClose:l})=>x.jsxs("section",{"aria-label":e,className:"flex min-h-full flex-col",children:[x.jsxs("div",{className:"sticky top-0 z-10 flex items-start gap-3 border-b bg-background px-4 py-3",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("p",{className:"text-xs text-muted-foreground",children:n}),x.jsx("h3",{className:Ne("text-base leading-6 font-bold wrap-anywhere",t==="code"&&"font-mono text-[0.8125rem] leading-5"),children:e})]}),x.jsx(un,{icon:"close",label:"Close the code panel",onClick:l})]}),x.jsx("div",{className:"flex flex-col gap-3 px-4 py-4 text-sm empty:hidden",children:i}),s,r===null?null:x.jsxs("div",{className:"border-t",children:[x.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[x.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:r.pathLabel}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.rangeLabel})]}),x.jsx(lu,{lines:r.lines,label:`${r.pathLabel}, ${r.rangeLabel}`,isWrapped:!0,className:"border-y"}),r.forgeLink===null?null:x.jsx(dd,{href:r.forgeLink.href,label:r.forgeLink.label,className:"mx-4 my-2 text-xs"})]})]}),vZ=150,SZ="rounded-sm underline decoration-primary-text/60 decoration-1 underline-offset-[0.3em] transition-colors duration-[180ms] ease-out hover:text-primary-text hover:decoration-primary-text",wZ="font-mono text-[0.875em]",EZ=e=>{var t;return e.anchorId===null?(t=e.forgeLink)==null?void 0:t.href:`#${e.anchorId}`},CZ=({target:e,isCode:t,children:n,onOpen:r})=>{const{anchorId:s}=e;return x.jsxs(s4,{children:[x.jsx(i4,{delay:vZ,href:EZ(e),target:s===null?"_blank":void 0,rel:s===null?"noreferrer":void 0,className:Ne(SZ,t?wZ:""),onClick:i=>{s!==null&&(i.preventDefault(),r(s))},children:n}),x.jsxs(o4,{className:"flex max-h-[26.25rem] w-[min(42.5rem,calc(100vw-2rem))] flex-col overflow-hidden",children:[x.jsxs("div",{className:"flex items-baseline justify-between gap-4 border-b px-3 py-2",children:[x.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.pathLabel}),x.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.rangeLabel})]}),x.jsx(lu,{lines:e.lines,label:`${e.pathLabel}, ${e.rangeLabel}`,className:"min-h-0 flex-1 overflow-y-auto"}),e.forgeLink===null?null:x.jsx("div",{className:"border-t px-3 py-1.5",children:x.jsx(dd,{href:e.forgeLink.href,label:e.forgeLink.label,className:"text-xs"})})]})]})},hd=e=>e.map((t,n)=>({key:String(n),item:t})),NZ="pt-4 text-[1.1875rem] leading-7 font-semibold tracking-[-0.01em] text-foreground first:pt-0",hA="flex flex-col gap-2 pl-5",pA="rounded-sm bg-muted box-decoration-clone px-1.5 py-0.5 font-mono text-[0.875em]",TZ="rounded-sm underline decoration-1 underline-offset-[0.3em] hover:text-primary-text",RZ="flex flex-col gap-4 border-l-2 border-border pl-4 text-muted-foreground",OZ="overflow-x-auto rounded-md bg-code px-4 py-3 font-mono text-sm leading-6",kZ=({inline:e,codeLinks:t,onOpenCodeLink:n})=>e.kind==="text"?e.text:e.kind==="strong"?x.jsx("strong",{className:"font-bold",children:e.text}):e.kind==="emphasis"?x.jsx("em",{children:e.text}):e.kind==="code"?x.jsx("code",{className:pA,children:e.text}):e.kind==="link"?x.jsx("a",{href:e.href,target:"_blank",rel:"noreferrer",className:TZ,children:e.text}):e.linkId===null||!Object.hasOwn(t,e.linkId)?e.isCode?x.jsx("code",{className:pA,children:e.text}):e.text:x.jsx(CZ,{target:t[e.linkId],isCode:e.isCode,onOpen:n,children:e.text}),Gf=({inlines:e,codeLinks:t,onOpenCodeLink:n})=>hd(e).map(({key:r,item:s})=>x.jsx(kZ,{inline:s,codeLinks:t,onOpenCodeLink:n},r)),LC=({blocks:e,codeLinks:t,onOpenCodeLink:n})=>hd(e).map(({key:r,item:s})=>x.jsx(AZ,{block:s,codeLinks:t,onOpenCodeLink:n},r)),MZ=({item:e,codeLinks:t,onOpenCodeLink:n})=>x.jsxs("li",{className:e.blocks.length===0?"":"flex flex-col gap-2",children:[e.inlines.length===0?null:x.jsx("span",{children:x.jsx(Gf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})}),x.jsx(LC,{blocks:e.blocks,codeLinks:t,onOpenCodeLink:n})]});function AZ({block:e,codeLinks:t,onOpenCodeLink:n}){if(e.kind==="heading")return x.jsx("h3",{className:NZ,children:x.jsx(Gf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="paragraph")return x.jsx("p",{children:x.jsx(Gf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="quote")return x.jsx("blockquote",{className:RZ,children:x.jsx(LC,{blocks:e.blocks,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="code-block")return x.jsx("pre",{"data-language":e.language??void 0,className:OZ,children:x.jsx("code",{children:e.text})});const r=hd(e.items).map(({key:s,item:i})=>x.jsx(MZ,{item:i,codeLinks:t,onOpenCodeLink:n},s));return e.isOrdered?x.jsx("ol",{className:Ne(hA,"list-decimal"),children:r}):x.jsx("ul",{className:Ne(hA,"list-disc"),children:r})}const Hs=({blocks:e,codeLinks:t,onOpenCodeLink:n,className:r})=>x.jsx("div",{className:Ne("flex max-w-[68ch] flex-col gap-4 text-base leading-[1.7] text-pretty",r),children:x.jsx(LC,{blocks:e,codeLinks:t,onOpenCodeLink:n})}),h4=({blocks:e,codeLinks:t,onOpenCodeLink:n})=>x.jsx(Hs,{blocks:e,codeLinks:t,onOpenCodeLink:n,className:"gap-2 text-sm leading-6"}),p4=O.createContext(null),_Z="block h-[0.7em] rounded-[0.225rem] bg-foreground/10 motion-safe:animate-pulse",DZ="w-3/5",so=({isPending:e,lineCount:t=1,className:n,caption:r=null,children:s})=>{const i=O.use(p4);if(!e||i===null)return x.jsx(x.Fragment,{children:s});const l=Array.from({length:t},(c,u)=>u);return x.jsxs("span",{"data-unwritten":"true",className:Ne("flex min-w-0 flex-col justify-center gap-[0.6em] py-[0.3em]",n),children:[x.jsx("span",{className:"sr-only",children:i}),l.map(c=>x.jsx("span",{"aria-hidden":"true",className:Ne(_Z,t>1&&c===t-1?DZ:"")},c)),r]})},IZ=({x:e,y:t})=>`${String(e)} ${String(t)}`,xw=e=>e.map((t,n)=>`${n===0?"M":"L"} ${IZ(t)}`).join(" "),jZ={nodeIds:new Set,edgeIds:new Set},bw=(e,t)=>{if(t===null)return jZ;const n=e.filter(r=>r.from===t||r.to===t);return{nodeIds:new Set([t,...n.flatMap(r=>[r.from,r.to])]),edgeIds:new Set(n.map(r=>r.id))}},m4=(e,t,n)=>{if(n.length===0)return t;const r=[...new Set(e.filter(s=>n.includes(s.from)).map(s=>s.to))].filter(s=>!t.has(s));return m4(e,new Set([...t,...r]),r)},ry=(e,t)=>m4(e,new Set(t),t),LZ=e=>e.map(({id:t,from:n,to:r})=>({id:t,from:r,to:n})),PZ=(e,t)=>new Set([...ry(LZ(e),[t]),...ry(e,[t])]),zZ=(e,t,n)=>{const r=e.filter(i=>!t.includes(i.from)&&!t.includes(i.to)),s=ry(r,n.filter(i=>!t.includes(i)));return new Set([...ry(e,t)].filter(i=>!s.has(i)))},BZ=2,HZ="M1 1.5 8 5 1 8.5z",FZ="group absolute flex -translate-x-1/2 flex-col items-center rounded-sm text-center transition-opacity duration-[180ms] ease-out data-[standing=far]:opacity-25",$Z="mt-0.5 rounded-sm bg-background px-1 font-mono text-[0.6875rem] leading-4 whitespace-nowrap text-muted-foreground transition-colors duration-[180ms] ease-out group-hover:text-foreground group-data-[quiet=false]:text-foreground group-data-[standing=focal]:font-bold group-data-[standing=focal]:text-foreground group-data-[standing=near]:text-foreground",VZ="fill-none stroke-current opacity-55 transition-[color,opacity] duration-[180ms] ease-out [stroke-width:1.25] data-[standing=far]:opacity-15 data-[standing=near]:text-foreground data-[standing=near]:opacity-100",UZ="block w-full rounded-sm px-2 py-1 text-left font-mono text-[0.8125rem] leading-5 wrap-anywhere hover:bg-muted",mA=(e,t,n)=>n?e?"focal":t?"near":"far":"plain",gA=({list:e,onSelect:t})=>x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("h4",{className:"text-xs font-bold text-muted-foreground tabular-nums",children:e.heading}),e.files.length===0?x.jsx("p",{className:"text-muted-foreground",children:e.emptyLabel}):x.jsx("ul",{className:"-mx-2 flex flex-col",children:e.files.map(n=>x.jsx("li",{children:x.jsx("button",{type:"button",className:UZ,onClick:()=>{t(n.id)},children:n.label})},n.id))})]}),qZ=({title:e,board:t,codeLinks:n,authoring:r,actions:s=null,onOpenCodeLink:i,onOpenFile:l})=>{const c=O.useId(),[u,d]=O.useState(null),[h,m]=O.useState(null),[g,y]=O.useState(!1),[b,w]=O.useState(null),E=t.nodes.find(_=>_.id===u)??null,C=h??u,T=t.edges.map(_=>({id:_.id,from:_.importerId,to:_.importedId})),N=bw(T,C),R=C!==null,M=r!==null&&(E==null?void 0:E.assessment)!=null,D=M&&b===u,k=()=>{w(null)},I=()=>{d(null),k()};return x.jsxs(K3,{label:e,width:t.width,height:t.height,isFullScreen:g,isCentred:!0,actions:s,onFullScreenChange:_=>{y(_),_||I()},onPanelClose:I,panel:E===null?null:x.jsxs(d4,{title:E.path,titleKind:"code",kindLabel:E.markLabel,target:null,onClose:I,children:[D?r.renderImpactEditor(E,k):null,D||E.impactNote===null?null:x.jsx(so,{isPending:E.isUnassessed,lineCount:2,children:x.jsx("p",{className:"text-muted-foreground",children:E.impactNote})}),D||E.impactReason===null?null:x.jsx(Hs,{blocks:E.impactReason,codeLinks:n,onOpenCodeLink:i}),M&&!D?x.jsx(nt,{variant:"link",size:"sm",className:"self-start px-0",onClick:()=>{w(E.id)},children:r.editLabel}):null,x.jsx(gA,{list:E.importers,onSelect:d}),x.jsx(gA,{list:E.imports,onSelect:d}),E.fileLink===null?null:x.jsx("button",{type:"button",className:"self-start rounded-md border border-input bg-card px-2.5 py-1 text-[0.8rem] hover:bg-muted",onClick:()=>{const{anchorId:_}=E.fileLink??{anchorId:null};y(!1),I(),_!==null&&l(_)},children:E.fileLink.label})]}),children:[x.jsxs("svg",{"aria-hidden":"true",width:t.width,height:t.height,viewBox:`0 0 ${String(t.width)} ${String(t.height)}`,className:"pointer-events-none absolute inset-0 text-muted-foreground",children:[x.jsx("defs",{children:x.jsx("marker",{id:c,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:x.jsx("path",{d:HZ,fill:"context-stroke"})})}),t.edges.map(_=>x.jsx("path",{d:xw(_.points),"data-standing":mA(!1,N.edgeIds.has(_.id),R),markerEnd:`url(#${c})`,className:VZ},_.id))]}),t.nodes.map(_=>x.jsxs("button",{type:"button",title:_.path,"aria-pressed":_.id===u,"data-mark":_.mark,"data-quiet":hM(_.mark),"data-standing":mA(_.id===C,N.nodeIds.has(_.id),R),className:FZ,style:{left:_.x,top:_.y-AL(_.radius)/BZ},onPointerEnter:()=>{m(_.id)},onPointerLeave:()=>{m(null)},onFocus:()=>{m(_.id)},onBlur:()=>{m(null)},onClick:()=>{d(_.id),y(!0)},children:[x.jsx(DL,{mark:_.mark,radius:_.radius}),x.jsx("span",{className:$Z,children:_.label}),hM(_.mark)?null:x.jsx("span",{className:"rounded-sm bg-background px-1 text-[0.6875rem] leading-4 text-muted-foreground",children:_.markLabel})]},_.id))]})},GZ={plain:"",code:"font-mono text-[0.94em]"},KZ="not-last:after:ml-[0.5em] not-last:after:font-sans not-last:after:content-['•']",g4=({segments:e,className:t})=>x.jsx("span",{className:Ne("flex flex-wrap gap-x-[0.5em]",t),children:e.map(n=>x.jsx("span",{className:Ne("min-w-0 wrap-anywhere",KZ,GZ[n.kind]),children:n.text},`${n.kind}:${n.text}`))}),YZ=4,WZ=2,XZ="aria-pressed:bg-foreground aria-pressed:font-bold aria-pressed:text-background aria-pressed:hover:bg-foreground aria-pressed:hover:text-background",QZ=({anchorId:e,heading:t,viewsLabel:n,defaultViewId:r,assessmentForm:s,views:i,codeLinks:l,renderImpactEditor:c,onOpenCodeLink:u,onOpenFile:d})=>{const[h,m]=O.useState(null),g=i.find(y=>y.id===(h??r))??i.at(0);return g===void 0?null:x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsx("h2",{id:`${e}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),x.jsxs("div",{className:"flex flex-col gap-y-1 pb-2 text-sm",children:[x.jsx(g4,{segments:g.summary.map(y=>({text:y,kind:"plain"})),className:"tabular-nums"}),x.jsxs("ul",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-muted-foreground",children:[g.legend.map(y=>x.jsxs("li",{className:"flex items-center gap-1.5",children:[x.jsx(DL,{mark:y.mark,radius:YZ}),y.label]},y.mark)),x.jsxs("li",{className:"flex items-center gap-1.5",children:[x.jsxs("svg",{"aria-hidden":"true",width:"22",height:"10",viewBox:"0 0 22 10",className:"shrink-0",children:[x.jsx("path",{d:"M1 5h14",className:"fill-none stroke-current [stroke-width:1.25]"}),x.jsx("path",{d:"M14 1.5 21 5 14 8.5z",className:"fill-current"})]}),g.edgeLegendLabel]})]})]}),x.jsx(qZ,{title:t,board:g.board,codeLinks:l,actions:i.length<WZ?null:x.jsx("div",{role:"group","aria-label":n,className:"flex items-center gap-0.5",children:i.map(y=>x.jsxs(B3,{children:[x.jsx(H3,{render:x.jsx(nt,{variant:"ghost",size:"sm","aria-pressed":y.id===g.id,className:XZ,onClick:()=>{m(y.id)}}),children:y.label}),x.jsx(F3,{children:y.description})]},y.id))}),authoring:c===null?null:{editLabel:s.editLabel,renderImpactEditor:(y,b)=>y.assessment===null?null:c({path:y.path,assessment:y.assessment,form:s,onClose:b})},onOpenCodeLink:u,onOpenFile:d},g.id)]})},ZZ={pickedLabels:[],text:""},JZ="No answer",eJ="mt-0.5 size-4 shrink-0 accent-(--primary)",tJ="min-h-12 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",nJ="max-h-40 overflow-auto rounded-sm bg-muted px-1.5 py-1 font-mono text-[0.6875rem] leading-4 whitespace-pre-wrap wrap-anywhere",rJ={open:"font-bold text-signal-text",answered:"text-muted-foreground",withdrawn:"text-muted-foreground italic"},sJ=(e,t,n,r)=>{if(!n.allowsMultiple)return r?[t]:[];const s=e.filter(i=>i!==t);return r?[...s,t]:s},iJ=(e,t)=>({questionId:e.id,pickedLabels:t.pickedLabels,text:t.text.trim()===""?null:t.text}),y4=({detail:e})=>e===null?null:x.jsx("pre",{className:nJ,children:e}),oJ=({question:e,draft:t,onDraftChange:n})=>{const r=O.useId(),s=O.useId();return x.jsxs("fieldset",{className:"flex flex-col gap-2",children:[x.jsx("legend",{className:"pb-1 text-sm font-bold",children:e.prompt}),x.jsx(y4,{detail:e.detail}),e.options.map(i=>x.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-sm",children:[x.jsx("input",{type:e.allowsMultiple?"checkbox":"radio",name:r,checked:t.pickedLabels.includes(i.label),className:eJ,onChange:l=>{n({...t,pickedLabels:sJ(t.pickedLabels,i.label,e,l.target.checked)})}}),x.jsxs("span",{className:"min-w-0",children:[x.jsx("span",{className:"block",children:i.label}),i.description===""?null:x.jsx("span",{className:"block text-xs text-muted-foreground",children:i.description})]})]},i.label)),x.jsx("label",{htmlFor:s,className:"text-xs text-muted-foreground",children:e.textLabel}),x.jsx("textarea",{id:s,value:t.text,className:tJ,onChange:i=>{n({...t,text:i.target.value})}})]})},lJ=({question:e})=>x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("p",{className:"text-sm font-bold",children:e.prompt}),x.jsx(y4,{detail:e.detail}),x.jsx("p",{className:"text-sm",children:e.answerLabel??JZ})]}),aJ=({batch:e,isAnswering:t,problem:n,onAnswer:r})=>{const[s,i]=O.useState({}),l=u=>s[u.id]??ZZ,c=e.status==="open";return x.jsxs("section",{"aria-label":e.heading,"data-status":e.status,className:Ne("flex flex-col gap-3 rounded-lg border px-3 py-2.5 text-sm",c?"border-signal":""),children:[x.jsxs("div",{className:"flex flex-col",children:[x.jsxs("p",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-bold",children:e.heading}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel})]}),x.jsx("p",{className:Ne("text-xs",rJ[e.status]),children:e.statusLabel})]}),c?x.jsxs("form",{className:"flex flex-col gap-4",onSubmit:u=>{u.preventDefault(),r(e.questions.map(d=>iJ(d,l(d))))},children:[e.questions.map(u=>x.jsx(oJ,{question:u,draft:l(u),onDraftChange:d=>{i(h=>({...h,[u.id]:d}))}},u.id)),n===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:n}),x.jsx(nt,{type:"submit",size:"sm",disabled:t,className:"self-end",children:e.submitLabel})]}):e.questions.map(u=>x.jsx(lJ,{question:u},u.id))]})},x4=({label:e,options:t,value:n,className:r,errorMessage:s=null,isLabelHidden:i=!1,onChange:l})=>{const c=O.useId(),u=O.useId();return x.jsxs("div",{className:Ne("grid gap-1.5",r),children:[x.jsx("label",{htmlFor:c,className:i?"sr-only":"text-sm font-bold",children:e}),x.jsxs("div",{className:"relative",children:[x.jsx("select",{id:c,value:n,"aria-invalid":s!==null,"aria-describedby":s===null?void 0:u,className:"h-8 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card pr-8 pl-2.5 text-sm transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",onChange:d=>{l(d.target.value)},children:t.map(d=>x.jsx("option",{value:d.value,children:d.label},d.value))}),x.jsx(Qp,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),s===null?null:x.jsx("p",{id:u,role:"alert",className:"text-sm text-destructive",children:s})]})},cJ="Remove the reference",uJ="min-h-16 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",b4="self-start rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.6875rem] leading-4 wrap-anywhere",fJ={"not-running":"fill-background stroke-muted-foreground [stroke-width:2]",starting:"fill-background stroke-(--line) [stroke-dasharray:3_2.5] [stroke-width:2] motion-safe:animate-pulse",working:"fill-(--line) stroke-(--line) [stroke-width:2]","waiting-for-reviewer":"fill-signal stroke-signal [stroke-width:2]",listening:"fill-background stroke-(--line) [stroke-width:2]",failed:"fill-background stroke-destructive [stroke-width:2]"},dJ=({message:e,codeLinks:t,onOpenCodeLink:n})=>x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-bold",children:e.authorLabel}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel})]}),e.reference===null?null:x.jsx("p",{className:b4,children:e.reference}),x.jsx(Hs,{blocks:e.body,codeLinks:t,onOpenCodeLink:n})]}),hJ=({conversation:e,modelChoice:t,codeLinks:n,reference:r,isSending:s,sendProblem:i,answering:l,onSend:c,onAnswer:u,onChooseModel:d,onClearReference:h,onOpenCodeLink:m,onClose:g})=>{var N;const[y,b]=O.useState(""),w=O.useRef(null),E=((N=e.entries.at(-1))==null?void 0:N.id)??null,C=t!==null;O.useEffect(()=>{const R=w.current;R==null||R.scrollTo({top:R.scrollHeight})},[E,C]);const T=()=>{c(y),b("")};return x.jsxs("aside",{"aria-label":e.heading,className:"fixed top-14 right-0 bottom-0 z-30 flex w-(--chat-width) flex-col border-l bg-background duration-200 ease-out animate-in slide-in-from-right-8",children:[x.jsxs("div",{className:"flex items-start gap-3 border-b px-4 py-3",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("h2",{className:"text-base leading-6 font-bold",children:e.heading}),x.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[x.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 12 12","data-state":e.agentState,className:"size-3",children:x.jsx("circle",{cx:"6",cy:"6",r:"4",className:Ne("transition-[fill,stroke] duration-[180ms] ease-out",fJ[e.agentState])})}),x.jsx("span",{role:"status",children:e.agentStateLabel})]})]}),x.jsx(un,{icon:"close",label:e.closeLabel,onClick:g})]}),e.problem===null?null:x.jsx("p",{role:"alert",className:"max-h-24 overflow-y-auto border-b px-4 py-2 text-xs text-destructive",children:e.problem}),t===null?null:x.jsxs("div",{className:"flex flex-col gap-1 border-b px-4 py-2",children:[x.jsx(x4,{label:t.label,options:t.options,value:t.selectedModel,onChange:d}),x.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]}),x.jsxs("ol",{ref:w,"aria-live":"polite",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4",children:[e.emptyMessage===null?null:x.jsx("li",{className:"text-sm text-muted-foreground",children:e.emptyMessage}),e.entries.map(R=>{var M;return x.jsx("li",{"data-author":R.kind==="message"?R.author:void 0,className:"flex flex-col gap-1 text-sm",children:R.kind==="message"?x.jsx(dJ,{message:R,codeLinks:n,onOpenCodeLink:m}):x.jsx(aJ,{batch:R,isAnswering:l.pendingBatchId===R.id,problem:((M=l.rejection)==null?void 0:M.batchId)===R.id?l.rejection.message:null,onAnswer:D=>{u(R.id,D)}})},R.id)})]}),x.jsxs("form",{className:"flex flex-col gap-2 border-t px-4 py-3",onSubmit:R=>{R.preventDefault(),T()},children:[r===null?null:x.jsxs("p",{className:"flex items-start gap-1",children:[x.jsx("span",{className:Ne(b4,"flex-1"),children:r}),x.jsx(un,{icon:"close",label:cJ,className:"size-5",onClick:h})]}),x.jsx("textarea",{"aria-label":e.placeholder,placeholder:e.placeholder,value:y,className:uJ,onChange:R=>{b(R.target.value)},onKeyDown:R=>{R.key!=="Enter"||R.shiftKey||y.trim()===""||(R.preventDefault(),T())}}),i===null?null:x.jsx("p",{role:"alert",className:"text-xs text-destructive",children:i}),x.jsx(nt,{type:"submit",size:"sm",disabled:s||y.trim()==="",className:"self-end",children:e.sendLabel})]})]})},v4=O.createContext(void 0);function PC(e){const t=O.useContext(v4);if(t===void 0&&!e)throw new Error(wn(33));return t}const S4=O.createContext(void 0);function au(e){const t=O.useContext(S4);if(t===void 0&&!e)throw new Error(wn(36));return t}const pJ=O.createContext(void 0);function zC(e=!0){const t=O.useContext(pJ);if(t===void 0&&!e)throw new Error(wn(25));return t}function w4({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=O.useRef(e!==void 0),[i,l]=O.useState(t),c=s&&e!==void 0?e:i,u=O.useCallback(d=>{s||l(d)},[]);return[c,u]}const E4=O.createContext(void 0);function mJ(){const e=O.useContext(E4);if(e===void 0)throw new Error(wn(30));return e}function gJ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:i,typingRef:l,itemRef:c,itemMetadata:u}=e,{events:d}=i.useState("floatingTreeRoot"),h=i.useState("open"),m=zC(!0),g=m!==void 0;return O.useMemo(()=>({id:r,role:"menuitem",tabIndex:h&&n?0:-1,onKeyDown(y){y.key===" "&&(l!=null&&l.current)&&y.preventDefault()},onMouseMove(y){s&&d.emit("itemhover",{nodeId:s,target:y.currentTarget})},onClick(y){t&&d.emit("close",{domEvent:y,reason:tC})},onMouseUp(y){if(m){const b=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,g&&b&&Math.abs(y.clientX-b.x)<=1&&Math.abs(y.clientY-b.y)<=1||g&&!rC&&y.button===2)return}c.current&&i.context.allowMouseUpTriggerRef.current&&(!g||y.button===2)&&u.type==="regular-item"&&v0(c.current,y,{detail:1})}}),[t,n,r,d,s,h,i,l,c,m,g,u])}const C4={type:"regular-item"};function N4(e){const{closeOnClick:t,disabled:n,highlighted:r,id:s,store:i,typingRef:l=i.context.typingRef,nativeButton:c,itemMetadata:u,nodeId:d}=e,h=O.useRef(null),{getButtonProps:m,buttonRef:g}=Pp({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),y=gJ({closeOnClick:t,highlighted:r,id:s,nodeId:d,store:i,typingRef:l,itemRef:h,itemMetadata:u}),b=O.useCallback(E=>Yo(y,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},E,m),[y,m,u]),w=Vf(h,g);return O.useMemo(()=>({getItemProps:b,itemRef:w}),[b,w])}const T4=O.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function yJ(){return O.useContext(T4)}function BC(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:i}=e,{register:l,unregister:c,subscribeMapChange:u,nextIndexRef:d}=yJ(),h=O.useRef(-1),[m,g]=O.useState(i==null&&t?()=>{if(h.current===-1){const E=d.current;d.current+=1,h.current=E}return h.current}:-1),y=i??m,b=O.useRef(null),w=O.useCallback(E=>{const C=b.current;C&&c(C),b.current=E,E&&l(E,{metadata:r??null,index:i??null,label:n,textRef:s})},[i,l,c,r,n,s]);return ze(()=>{if(i==null)return u(E=>{var T;const C=b.current?(T=E.get(b.current))==null?void 0:T.index:null;C!=null&&g(C)})},[i,u]),{ref:w,index:y}}const xJ="data-checked",bJ="data-unchecked",R4={checked(e){return e?{[xJ]:""}:{[bJ]:""}},...ZE},vJ=O.forwardRef(function(t,n){const{render:r,className:s,id:i,label:l,nativeButton:c=!1,disabled:u=!1,closeOnClick:d=!1,checked:h,defaultChecked:m,onCheckedChange:g,style:y,...b}=t,w=BC({guess:!0,label:l}),E=PC(!0),C=lo(i),{store:T}=au(),N=T.useState("disabled"),R=u||N,M=T.useState("isActive",w.index),D=T.useState("itemProps"),[k,I]=w4({controlled:h,default:m??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:_,itemRef:P}=N4({closeOnClick:d,disabled:R,highlighted:M,id:C,store:T,nativeButton:c,nodeId:E==null?void 0:E.context.nodeId,itemMetadata:C4}),H=O.useMemo(()=>({disabled:R,highlighted:M,checked:k}),[R,M,k]);function z(j){const B=gt(tC,j.nativeEvent,void 0,{preventUnmountOnClose:Bn});g==null||g(!k,B),!B.isCanceled&&I(L=>!L)}const U=dn("div",t,{state:H,stateAttributesMapping:R4,props:[D,{role:"menuitemcheckbox","aria-checked":k,onClick:z},b,_],ref:[P,n,w.ref]});return x.jsx(E4.Provider,{value:H,children:U})}),SJ=O.forwardRef(function(t,n){const{render:r,className:s,style:i,keepMounted:l=!1,...c}=t,u=mJ(),d=O.useRef(null),{transitionStatus:h,mounted:m,setMounted:g}=CP(u.checked);ou({batch:!0,enabled:!u.checked,open:u.checked,ref:d,onComplete(){u.checked||g(!1)}});const y={checked:u.checked,disabled:u.disabled,highlighted:u.highlighted,transitionStatus:h};return dn("span",t,{state:y,ref:[n,d],stateAttributesMapping:R4,props:{"aria-hidden":!0,...c},enabled:l||m})}),wJ=O.forwardRef(function(t,n){const{render:r,className:s,id:i,label:l,nativeButton:c=!1,disabled:u=!1,closeOnClick:d=!0,style:h,...m}=t,g=BC({guess:!0,label:l}),y=PC(!0),b=lo(i),{store:w}=au(),E=w.useState("disabled"),C=u||E,T=w.useState("isActive",g.index),N=w.useState("itemProps"),{getItemProps:R,itemRef:M}=N4({closeOnClick:d,disabled:C,highlighted:T,id:b,store:w,nativeButton:c,nodeId:y==null?void 0:y.context.nodeId,itemMetadata:C4});return dn("div",t,{state:{disabled:C,highlighted:T},props:[N,m,R],ref:[M,n,g.ref]})}),EJ=O.createContext(void 0);function O4(e){return O.useContext(EJ)}const CJ=O.forwardRef(function(t,n){const{render:r,className:s,style:i,finalFocus:l,...c}=t,{store:u}=au(),{side:d,align:h}=PC(),m=O4()!=null,g=u.useState("open"),y=u.useState("transitionStatus"),b=u.useState("popupProps"),w=u.useState("mounted"),E=u.useState("instantType"),C=u.useState("activeTriggerElement"),T=u.useState("parent"),N=u.useState("lastOpenChangeReason"),R=u.useState("rootId"),M=u.useState("floatingRootContext"),D=u.useState("floatingTreeRoot"),k=u.useState("closeDelay"),I=u.useState("hoverEnabled"),_=u.useState("disabled"),P=u.useState("openMethod"),H=T.type==="context-menu";ou({open:g,ref:u.context.popupRef,onComplete(){var L,$;g&&(($=(L=u.context).onOpenChangeComplete)==null||$.call(L,!0))}}),O.useEffect(()=>{function L($){u.setOpen(!1,gt($.reason,$.domEvent))}return D.events.on("close",L),()=>{D.events.off("close",L)}},[D.events,u]),lx(M,{enabled:I&&!_&&!H&&T.type!=="menubar",closeDelay:k});const z=u.useStateSetter("popupElement"),U={transitionStatus:y,side:d,align:h,open:g,nested:T.type==="menu",instant:E},j=dn("div",t,{state:U,ref:[n,u.context.popupRef,z],stateAttributesMapping:zp,props:[b,{onKeyDown(L){m&&TC.has(L.key)&&L.stopPropagation()}},Jp(y),c,{"data-rootownerid":R}]});let B=T.type===void 0||H;return(C||T.type==="menubar"&&N!==eC)&&(B=!0),x.jsx(xC,{context:M,openInteractionType:P,modal:H,disabled:!w,returnFocus:l===void 0?B:l,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?D:void 0,previousFocusableElement:C,nextFocusableElement:T.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:j})}),k4=O.createContext(void 0);function NJ(){const e=O.useContext(k4);if(e===void 0)throw new Error(wn(32));return e}const TJ=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:i,parent:l}=au();if(!(i.useState("mounted")||r))return null;const d=l.type==="menu"||l.type==="menubar"?"group":void 0;return x.jsx(k4.Provider,{value:r,children:x.jsx(hC,{ref:n,...s,portalOwnerRole:d})})});function RJ(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,i=Qe(s),[,l]=O.useState(!1),c=Tr(kJ).current,u=Tr(OJ).current,d=O.useRef(0),h=O.useRef(!0),m=O.useRef(null),g=O.useRef(null),y=Qe(()=>{h.current||(h.current=!0,l(M=>!M))}),b=Qe((M,D)=>{u.set(M,D),y()}),w=Qe(M=>{u.delete(M),y()}),E=Qe(M=>{const D=new Map;return n.current.length=0,r&&(r.current.length=0),M.forEach(k=>{var I,_;D.set(k.element,{...k.registration.metadata??{},index:k.index}),n.current[k.index]=k.element,r&&(r.current[k.index]=k.registration.label!==void 0?k.registration.label:((_=(I=k.registration.textRef)==null?void 0:I.current)==null?void 0:_.textContent)??k.element.textContent)}),d.current=n.current.length,D});function C(M){var I;if((I=g.current)==null||I.disconnect(),g.current=null,typeof MutationObserver!="function"||M.length<2)return;const D=new MutationObserver(_=>{if(!_J(_))return;let P=null;for(const H of M)if(H.isConnected){if(P&&M4(P,H)>0){D.disconnect(),y();return}P=H}});g.current=D;const k=new Set;for(let _=1;_<M.length;_+=1){const P=AJ(M[_-1],M[_]);P&&k.add(P)}k.forEach(_=>D.observe(_,{childList:!0}))}const T=Qe(()=>{const[M,D]=MJ(u),k=E(M),I=m.current,_=!I||I.length!==M.length||M.some((P,H)=>{const z=I[H];return P.index!==z.index||P.element!==z.element||P.registration.index!==z.registration.index||P.registration.metadata!==z.registration.metadata});C(D),m.current=M,h.current=!1,_&&(c.forEach(P=>P(k)),i(k))});ze(()=>(!h.current&&m.current&&E(m.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,E]),ze(()=>{h.current&&T()}),ze(()=>()=>{var M;(M=g.current)==null||M.disconnect(),h.current=!0},[]);const N=Qe(M=>(c.add(M),()=>{c.delete(M)})),R=O.useMemo(()=>({register:b,unregister:w,subscribeMapChange:N,nextIndexRef:d}),[b,w,N,d]);return x.jsx(T4.Provider,{value:R,children:t})}function OJ(){return new Map}function kJ(){return new Set}function MJ(e){const t=new Set,n=[],r=[];e.forEach((i,l)=>{if(!l.isConnected)return;const c=i.index,u={index:c??-1,element:l,registration:i};c===null?r.push(u):c>=0&&(t.add(c),n.push(u))});let s=0;return r.sort((i,l)=>M4(i.element,l.element)),r.forEach(i=>{for(;t.has(s);)s+=1;i.index=s,n.push(i),s+=1}),t.size>0&&n.sort((i,l)=>i.index-l.index),[n,r.map(i=>i.element)]}function AJ(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function _J(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function M4(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const DJ=20;function A4(e,t,n,r){const[s,i]=O.useState(!1);ze(()=>{if(!e||!t||n==null){i(!1);return}const l=Dt(n).documentElement.clientWidth,c=n.offsetWidth;i(l>0&&c>0&&c>=l-DJ)},[e,t,n]),DP(e&&(!t||s),r)}const IJ=O.forwardRef(function(t,n){var Le;const{anchor:r,positionMethod:s="absolute",className:i,render:l,side:c,align:u,sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:y=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:E=HK,style:C,...T}=t,{store:N}=au(),R=NJ(),M=zC(!0),D=N.useState("parent"),k=N.useState("floatingRootContext"),I=N.useState("floatingTreeRoot"),_=N.useState("mounted"),P=N.useState("open"),H=N.useState("modal"),z=N.useState("openMethod"),U=N.useState("activeTriggerElement"),j=N.useState("transitionStatus"),B=N.useState("positionerElement"),L=N.useState("instantType"),$=N.useState("adaptiveOrigin"),q=N.useState("lastOpenChangeReason"),G=N.useState("floatingNodeId"),W=N.useState("floatingParentNodeId"),Z=k.useState("domReferenceElement"),re=O.useRef(null),de=nx(B);let F=r,X=d,te=h,J=u,K=E;D.type==="context-menu"&&(F=r??((Le=D.context)==null?void 0:Le.anchor),J=J??"start",!c&&J!=="center"&&(te=t.alignOffset??2,X=t.sideOffset??-5));let ce=c,ye=J;D.type==="menu"?(ce=ce??"inline-end",ye=ye??"start",K=t.collisionAvoidance??Zy):D.type==="menubar"&&(ce=ce??(D.context.orientation==="vertical"?"inline-end":"bottom"),ye=ye??"start");const ge=D.type==="context-menu",oe=hx({anchor:F,floatingRootContext:k,positionMethod:M?"fixed":s,mounted:_,side:ce,sideOffset:X,align:ye,alignOffset:te,arrowPadding:ge?0:y,collisionBoundary:m,collisionPadding:g,sticky:b,nodeId:G,keepMounted:R,disableAnchorTracking:w,collisionAvoidance:K,shift:ge?{crossAxis:!("side"in K&&K.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:I,adaptiveOrigin:$});O.useEffect(()=>{function Ie(Ue){Ue.open&&(Ue.parentNodeId===G&&N.set("hoverEnabled",!1),Ue.nodeId!==G&&Ue.parentNodeId===N.select("floatingParentNodeId")&&N.setOpen(!1,gt(Nh)))}return I.events.on("menuopenchange",Ie),()=>{I.events.off("menuopenchange",Ie)}},[N,I.events,G]),O.useEffect(()=>{if(N.select("floatingParentNodeId")==null)return;function Ie(Ue){if(Ue.open||Ue.nodeId!==N.select("floatingParentNodeId"))return;const We=Ue.reason??Nh;N.setOpen(!1,gt(We))}return I.events.on("menuopenchange",Ie),()=>{I.events.off("menuopenchange",Ie)}},[I.events,N]);const xe=Jr();O.useEffect(()=>{P||xe.clear()},[P,xe]),O.useEffect(()=>{function Ie(Ue){if(!(!P||Ue.nodeId!==N.select("floatingParentNodeId")))if(Ue.target&&U&&U!==Ue.target){const We=N.select("closeDelay");We>0?xe.isStarted()||xe.start(We,()=>{N.setOpen(!1,gt(Nh))}):N.setOpen(!1,gt(Nh))}else xe.clear()}return I.events.on("itemhover",Ie),()=>{I.events.off("itemhover",Ie)}},[I.events,P,U,N,xe]),O.useEffect(()=>{const Ie={open:P,nodeId:G,parentNodeId:W,reason:N.select("lastOpenChangeReason")};I.events.emit("menuopenchange",Ie)},[I.events,P,N,G,W]),ze(()=>{const Ie=Z,Ue=re.current;if(Ie&&(re.current=Ie),Ue&&Ie&&Ie!==Ue){N.set("instantType",void 0);const We=new AbortController;return de(()=>{N.set("instantType","trigger-change")},We.signal),()=>{We.abort()}}},[Z,de,N]);const Se={open:P,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:D.type==="menu",instant:L},ke=D.type==="menubar"&&D.context.modal;A4(P&&(ke||H&&q!==xn),z==="touch",B,U);const we=px(t,Se,{styles:oe.positionerStyles,transitionStatus:j,props:T,refs:[n,N.useStateSetter("positionerElement")],hidden:!_,inert:!P}),Re=_&&D.type!=="menu"&&(D.type!=="menubar"&&H&&q!==xn||D.type==="menubar"&&D.context.modal);let Ae=null;return D.type==="menubar"?Ae=D.context.contentElement:D.type===void 0&&(Ae=U),x.jsxs(v4.Provider,{value:oe,children:[Re&&x.jsx(OC,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:RC(!P),cutout:Ae}),x.jsx(mC,{id:G,children:x.jsx(RJ,{elementsRef:N.context.itemDomElements,labelsRef:N.context.itemLabels,children:we})})]})}),jJ=O.createContext(null);function _4(e){return O.useContext(jJ)}const LJ={...Xp,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class PJ extends fd{constructor(n,r,s=!1){const i=new Yp,l=BJ(i,r,s,n);super(l,zJ(i),LJ);_t(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",c=>{var u;if((u=this.unsubscribeParentListener)==null||u.call(this),c.type==="menu"){let d=c.store.select("rootId"),h=c.store.select("floatingTreeRoot"),m=c.store.select("keyboardEventRelay");this.unsubscribeParentListener=c.store.subscribe(()=>{const g=c.store.select("rootId"),y=c.store.select("floatingTreeRoot"),b=c.store.select("keyboardEventRelay");d===g&&h===y&&m===b||(d=g,h=y,m=b,this.notifyAll())}),this.context.allowMouseUpTriggerRef=c.store.context.allowMouseUpTriggerRef;return}c.type!==void 0&&(this.context.allowMouseUpTriggerRef=c.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}}function zJ(e){return{positionerRef:O.createRef(),popupRef:O.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:O.createRef(),beforeContentFocusGuardRef:O.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function BJ(e,t,n=!1,r){return{...Wp(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new pC,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Tn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const HJ=O.createContext(void 0);function FJ(){return O.useContext(HJ)}const $J=ud(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:i,defaultOpen:l=!1,disabled:c=!1,modal:u,loopFocus:d=!0,orientation:h="vertical",actionsRef:m,closeParentOnEsc:g=!1,handle:y,triggerId:b,defaultTriggerId:w=null,highlightItemOnHover:E=!0}=t,C=zC(!0),T=au(!0),N=_4(!0),R=FJ(),M=O.useMemo(()=>R&&T?{type:"menu",store:T.store}:N?{type:"menubar",context:N}:C&&!T?{type:"context-menu",context:C}:{type:void 0},[C,T,N,R]),D=Uf(),k=Uf(),I=iu(),_=M.type==="menu"?M.store:void 0,P=(r??l)&&(_==null?void 0:_.state.transitionStatus)==="starting",H=Tr(()=>P?_==null?void 0:_.state.instantType:void 0).current,z=VJ({open:l,openProp:r,activeTriggerId:w,triggerIdProp:b,parent:M,disabled:c,highlightItemOnHover:E,modal:M.type===void 0?u:void 0,rootId:D,instantType:H},k,I!=null);z.useControlledProp("openProp",r),z.useControlledProp("triggerIdProp",b),z.useContextCallback("onOpenChangeComplete",i);const U=z.useState("floatingTreeRoot"),j=Jy(U),B=z.useState("open"),L=z.useState("activeTriggerElement"),$=z.useState("positionerElement"),q=z.useState("hoverEnabled"),G=z.useState("disabled"),W=z.useState("lastOpenChangeReason"),Z=z.useState("parent"),re=z.useState("activeIndex"),de=z.useState("payload"),F=z.useState("floatingParentNodeId"),X=O.useRef(null),te=O.useRef(Z.type!=="context-menu"),J=Jr(),K=O.useRef(!0),ce=Jr(),ye=F!=null,{openMethod:ge,triggerProps:oe}=DW(B);z.useSyncedValues({disabled:c,highlightItemOnHover:E,modal:Z.type===void 0?u:void 0,openMethod:ge,rootId:D}),qp(z);const{forceUnmount:xe,transitionStatus:Se}=Gp(B,z,()=>{z.set("allowMouseEnter",!1)},P),ke=nx(z.context.popupRef);O.useEffect(()=>{if(H===void 0)return;const Fe=()=>{z.state.instantType===H&&z.set("instantType",void 0)};if(!B){Fe();return}if(Se!==void 0)return;if(z.context.popupRef.current==null){Fe();return}const Tt=new AbortController;return ke(Fe,Tt.signal),()=>{Tt.abort()}},[H,B,Se,ke,z]),ze(()=>{C&&!T?z.update({parent:{type:"context-menu",context:C},floatingNodeId:j,floatingParentNodeId:I}):T&&z.update({floatingNodeId:j,floatingParentNodeId:I})},[C,T,j,I,z]),O.useEffect(()=>{if(B||(X.current=null),Z.type==="context-menu"){if(!B){J.clear(),te.current=!1;return}J.start(500,()=>{te.current=!0})}},[J,B,Z.type]),ze(()=>{!B&&!q&&z.set("hoverEnabled",!0)},[B,q,z]);const _e=Qe((Fe,Tt)=>{const zt=Tt.reason;if(!Fe&&!z.select("open")||B===Fe&&Tt.trigger===L&&W===zt)return;const Vn=SC(Tt);if(!Fe&&Tt.trigger==null&&(Tt.trigger=L??void 0),s==null||s(Fe,Tt),Tt.isCanceled)return;z.state.floatingRootContext.dispatchOpenChange(Fe,Tt);const Un=Tt.event;if(Fe===!1&&(Un==null?void 0:Un.type)==="click"&&Un.pointerType==="touch"&&!K.current)return;Fe&&zt===bf?(K.current=!1,ce.start(300,()=>{K.current=!0})):(K.current=!0,ce.clear());const xs=(zt===rl||zt===tC)&&Un.detail===0,on=!Fe&&(zt===Bp||zt==null);X.current=Tt.event;const ar=sx(z.state,Fe,Tt.trigger,Vn());ar.openChangeReason=zt,Z.type==="menubar"&&(zt===bf||zt===Bc||zt===xn||zt===ew||zt===Nh)?ar.instantType="group":xs||on?ar.instantType=xs?"click":"dismiss":ar.instantType=void 0,z.update(ar)}),we=EP({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:k,nested:I!=null,onOpenChange:_e}),Re=we.context.events;ze(()=>{const Fe=({open:Tt,eventDetails:zt})=>_e(Tt,zt);return Re.on("setOpen",Fe),()=>{Re==null||Re.off("setOpen",Fe)}},[Re,_e]);const Ae=O.useCallback(()=>{z.setOpen(!1,gt(Hp))},[z]);O.useImperativeHandle(m,()=>({unmount:xe,close:Ae}),[xe,Ae]);let Le;Z.type==="context-menu"&&(Le=Z.context),O.useImperativeHandle(Le==null?void 0:Le.positionerRef,()=>$,[$]),O.useImperativeHandle(Le==null?void 0:Le.actionsRef,()=>({setOpen:_e}),[_e]);const Ie=$p(we,{enabled:!G,bubbles:{escapeKey:g&&Z.type==="menu"},outsidePress(){var Fe;return Z.type!=="context-menu"||((Fe=X.current)==null?void 0:Fe.type)==="contextmenu"?!0:te.current},externalTree:ye?U:void 0}),Ue=P3(),We=O.useCallback(Fe=>{z.select("activeIndex")!==Fe&&z.set("activeIndex",Fe)},[z]),Oe=iW(we,{enabled:!G,listRef:z.context.itemDomElements,activeIndex:re,nested:Z.type!==void 0,loopFocus:d,orientation:h,parentOrientation:Z.type==="menubar"?Z.context.orientation:void 0,rtl:Ue==="rtl",disabledIndices:Zh,onNavigate:We,openOnArrowKeyDown:Z.type!=="context-menu",externalTree:ye?U:void 0,focusItemOnHover:E}),De=O.useCallback(Fe=>{z.context.typingRef.current=Fe},[z]),ne=oW(we,{enabled:!G,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:re,resetMs:zK,onMatch:Fe=>{B&&Fe!==re&&z.set("activeIndex",Fe)},onTyping:De}),he=O.useMemo(()=>{const Fe=Yo(ne.reference,Oe.reference,Ie.reference,{onMouseMove(){z.set("allowMouseEnter",!0)}},oe);return Fe["aria-haspopup"]="menu",Fe["aria-expanded"]=B,Fe},[z,ne.reference,Oe.reference,Ie.reference,oe,B]),se=O.useMemo(()=>{const Fe=Yo(Oe.trigger,Ie.trigger,oe);return Fe["aria-haspopup"]="menu",Fe["aria-expanded"]=!1,Fe},[Oe.trigger,Ie.trigger,oe]);Tr(()=>(z.update({inactiveTriggerProps:se}),null));const Te=O.useMemo(()=>Yo(Vp,{id:k,role:"menu","aria-orientation":h==="horizontal"?"horizontal":void 0,"aria-labelledby":L==null?void 0:L.id,onMouseMove(){z.set("allowMouseEnter",!0),Z.type==="menu"&&z.set("hoverEnabled",!1)},onClick(){z.select("hoverEnabled")&&z.set("hoverEnabled",!1)},onKeyDown(Fe){const Tt=z.select("keyboardEventRelay");Tt&&!Fe.isPropagationStopped()&&Tt(Fe)}},ne.floating,Oe.floating,Ie.floating),[L,k,h,Z.type,z,ne.floating,Oe.floating,Ie.floating]),Ve=Oe.item??Tn;Kp(z,{floatingRootContext:we,activeTriggerProps:he,inactiveTriggerProps:se,popupProps:Te,itemProps:Ve});const jt=O.useMemo(()=>({store:z,parent:M}),[z,M]),hn=x.jsxs(S4.Provider,{value:jt,children:[y&&x.jsx(Up,{handle:y,store:z}),typeof n=="function"?n({payload:de}):n]});return Z.type===void 0||Z.type==="context-menu"?x.jsx(gC,{externalTree:U,children:hn}):hn});function VJ(e,t,n){return Tr(()=>new PJ(e,t,n)).current}const Yg=5;function UJ(e,t){const n=qJ(t);return e.clientX>=n.left-Yg&&e.clientX<=n.right+Yg&&e.clientY>=n.top-Yg&&e.clientY<=n.bottom+Yg}function qJ(e){const t=e.getBoundingClientRect(),n=vn(e);if(sC)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,u=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(t.width,l,u),m=Math.max(t.height,c,d),g=h-t.width,y=m-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-y/2,bottom:t.bottom+y/2}}function GJ(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=qE(),{ref:s,index:i}=BC(e),l=n===i,c=O.useRef(null),u=Vf(s,c);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(i)},onMouseMove(){const h=c.current;if(!t||!h)return;const m=h.hasAttribute("disabled")||h.ariaDisabled==="true";!l&&!m&&h.focus()}},compositeRef:u,index:i}}function KJ(e){const{render:t,className:n,style:r,state:s=Tn,props:i=Zh,refs:l=Zh,metadata:c,stateAttributesMapping:u,tag:d="div",...h}=e,{compositeProps:m,compositeRef:g}=GJ({metadata:c});return dn(d,e,{state:s,ref:[g,...l],props:[m,...i,h],stateAttributesMapping:u})}function D4(e){if(Zt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Ko(e))return D4(nl(e))}function I4(e,t){const n=O.useRef(null);function r(i){Bs.flushSync(()=>{e.setOpen(!1,gt(Bc,i.nativeEvent,i.currentTarget))});const l=IK(n.current);l==null||l.focus()}function s(i){var c;const l=e.select("positionerElement");if(l&&vf(i,l))(c=e.context.beforeContentFocusGuardRef.current)==null||c.focus();else{Bs.flushSync(()=>{e.setOpen(!1,gt(Bc,i.nativeEvent,i.currentTarget))});let u=DK(e.context.triggerFocusTargetRef.current||t.current);for(;u!==null&&Je(l,u);){const d=u;if(u=dC(u),u===d)break}u==null||u.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function YJ(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,s=O.useRef(!1);return O.useMemo(()=>t?{onMouseDown:i=>{(n==="open"&&!r||n==="close"&&r)&&(s.current=!0,Dt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:Tn,[t,n,r])}const WJ=tx(function(t,n){const{render:r,className:s,style:i,disabled:l=!1,nativeButton:c=!0,id:u,openOnHover:d,delay:h=100,closeDelay:m=0,handle:g,payload:y,...b}=t,w=au(!0),C=ox(g)??(w==null?void 0:w.store);if(!C)throw new Error(wn(85));const T=lo(u),N=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),M=C.useState("isOpenedByTrigger",T),D=C.useState("triggerPopupId",T),k=O.useRef(null),I=QJ(),_=qE(!0),P=_a(),H=O.useMemo(()=>P??new pC,[P]),z=Jy(H),U=iu(),{registerTrigger:j,isMountedByThisTrigger:B}=ix(T,k,C,{payload:y,closeDelay:m,parent:I,floatingTreeRoot:H,floatingNodeId:z,floatingParentNodeId:U,keyboardEventRelay:_==null?void 0:_.relayKeyboardEvent}),L=I.type==="menubar",$=C.useState("disabled"),q=l||$||L&&I.context.disabled,{getButtonProps:G,buttonRef:W}=Pp({disabled:q,native:c});O.useEffect(()=>{!M&&I.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,M,I.type]);const Z=O.useRef(null),re=Jr(),de=Qe(Le=>{if(!Z.current)return;re.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Ie=Le.target;Je(Z.current,Ie)||Je(C.select("positionerElement"),Ie)||Ie===Z.current||Ie!=null&&D4(Ie)===C.select("rootId")||UJ(Le,Z.current)||H.events.emit("close",{domEvent:Le,reason:WG})});O.useEffect(()=>{M&&C.select("lastOpenChangeReason")===xn&&Dt(Z.current).addEventListener("mouseup",de,{once:!0})},[M,de,C]);const F=L&&I.context.hasSubmenuOpen,te=ax(R,{enabled:(d??F)&&!q&&(!L||F&&!B),handleClose:ux({blockPointerEvents:!L}),mouseOnly:!0,move:!1,restMs:I.type===void 0?h:void 0,delay:{close:m},triggerElementRef:k,externalTree:H,isActiveTrigger:N,isClosing:()=>C.select("transitionStatus")==="ending"}),J=XJ(M,C.select("lastOpenChangeReason")),K=uP(R,{enabled:!q,event:M&&L?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:I.type===void 0?J:!1}),ce=EC(R,{enabled:!q&&F}),ye=YJ({open:M,enabled:L,mouseDownAction:"open"}),ge=O.useMemo(()=>Yo(ce.reference,K.reference),[ce.reference,K.reference]),oe=C.useState("triggerProps",B),{preFocusGuardRef:xe,handlePreFocusGuardFocus:Se,handleFocusTargetFocus:ke}=I4(C,k),_e={disabled:q,open:M},we=[Z,n,W,j,k],Re=[ge,te??Tn,oe,{"aria-haspopup":"menu","aria-controls":D,id:T,onMouseDown:Le=>{if(C.select("open"))return;re.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Dt(Le.currentTarget).addEventListener("mouseup",de,{once:!0})}},L?{role:"menuitem"}:{},ye,b,G],Ae=dn("button",t,{enabled:!L,stateAttributesMapping:J1,state:_e,ref:we,props:Re});return L?x.jsx(KJ,{tag:"button",render:r,className:s,style:i,state:_e,refs:we,props:Re,stateAttributesMapping:J1}):M?x.jsxs(O.Fragment,{children:[x.jsx(Na,{ref:xe,onFocus:Se},`${T}-pre-focus-guard`),x.jsx(O.Fragment,{children:Ae},T),x.jsx(Na,{ref:C.context.triggerFocusTargetRef,onFocus:ke},`${T}-post-focus-guard`)]}):x.jsx(O.Fragment,{children:Ae},T)});function XJ(e,t){const n=Jr(),[r,s]=O.useState(!1);return ze(()=>{e&&t===xn?(s(!0),n.start(nP,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function QJ(){const e=_4();return O.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const ZJ=O.forwardRef(function(t,n){const{className:r,render:s,orientation:i="horizontal",style:l,...c}=t;return dn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},c]})}),j4="relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";function HC({...e}){return x.jsx($J,{"data-slot":"dropdown-menu",...e})}function FC({...e}){return x.jsx(WJ,{"data-slot":"dropdown-menu-trigger",...e})}function $C({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:s,...i}){return x.jsx(TJ,{children:x.jsx(IJ,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:x.jsx(CJ,{"data-slot":"dropdown-menu-content",className:Ne("z-50 max-h-(--available-height) min-w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",s),...i})})})}function df({className:e,...t}){return x.jsx(wJ,{"data-slot":"dropdown-menu-item",className:Ne(j4,e),...t})}function JJ({className:e,children:t,checked:n,...r}){return x.jsxs(vJ,{"data-slot":"dropdown-menu-checkbox-item",className:Ne(j4,e),checked:n,...r,children:[x.jsx("span",{className:"pointer-events-none flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card","data-slot":"dropdown-menu-checkbox-item-indicator",children:x.jsx(SJ,{children:x.jsx(dx,{className:"size-3",strokeWidth:3})})}),t]})}function L4({className:e,...t}){return x.jsx(ZJ,{"data-slot":"dropdown-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border",e),...t})}const eee=({label:e,children:t})=>x.jsxs(HC,{children:[x.jsxs(FC,{render:x.jsx(nt,{variant:"outline",size:"sm"}),children:[x.jsx("span",{className:"text-box-cap",children:e}),x.jsx(Qp,{"aria-hidden":"true"})]}),x.jsx($C,{align:"end",children:t})]}),tee=({label:e,countLabel:t,isSelected:n,marker:r,onToggle:s})=>x.jsxs(JJ,{checked:n,onCheckedChange:s,children:[r,x.jsx("span",{className:"flex-1",children:e})," ",x.jsx("span",{className:"text-muted-foreground tabular-nums",children:t})]}),nee=({label:e,onReset:t})=>x.jsxs(x.Fragment,{children:[x.jsx(L4,{}),x.jsx(df,{onClick:t,children:e})]}),P4={bug:"text-destructive",risk:"text-destructive",nit:"text-muted-foreground",question:"text-muted-foreground",attention:"text-signal-text"},yA="M7 1.5 12.5 7 7 12.5 1.5 7z",ree="M7 1.75 13 12.25H1z",z4=({kind:e,className:t})=>x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 14 14","data-kind":e,className:Ne("size-3.5 shrink-0",P4[e],t),children:[e==="bug"?x.jsx("path",{d:yA,className:"fill-current"}):null,e==="risk"?x.jsx("path",{d:yA,className:"fill-none stroke-current stroke-2"}):null,e==="nit"?x.jsx("circle",{cx:"7",cy:"7",r:"2.5",className:"fill-current"}):null,e==="question"?x.jsx("circle",{cx:"7",cy:"7",r:"4.5",className:"fill-none stroke-current stroke-2"}):null,e==="attention"?x.jsx("path",{d:ree,className:"fill-signal"}):null]}),zh=({kind:e,label:t,className:n})=>x.jsxs("span",{className:Ne("inline-flex shrink-0 items-center gap-1 text-xs font-bold",P4[e],n),children:[x.jsx(z4,{kind:e}),x.jsx("span",{className:"text-box-cap",children:t})]}),see=({positionLabel:e,previousLabel:t,nextLabel:n,canStepBack:r,canStepForward:s,onPrevious:i,onNext:l})=>x.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 rounded-md border border-input bg-card p-0.5",children:[x.jsx(un,{icon:"previous",label:t,isDisabled:!r,className:"size-6",onClick:i}),x.jsx("span",{"aria-live":"polite",className:"min-w-24 px-1.5 text-center text-[0.8rem] whitespace-nowrap tabular-nums",children:e}),x.jsx(un,{icon:"next",label:n,isDisabled:!s,className:"size-6",onClick:l})]}),iee="Arrange files",oee=({anchorId:e,heading:t,intro:n,coverageLabel:r,controls:{filter:s,reviewedToggle:i,stepping:l},positionLabel:c,canStepBack:u,canStepForward:d,emptyMessage:h,codeLinks:m,children:g,onArrangeFiles:y,onOpenCodeLink:b,onPrevious:w,onNext:E,onFilterChange:C,onShowReviewedChange:T})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pb-10",children:[x.jsxs("div",{className:"sticky top-(--band-height) z-20 flex h-(--walkthrough-heading-height) items-center gap-3 border-b bg-background",children:[x.jsx("h2",{id:`${e}-heading`,className:"shrink-0 text-2xl leading-9 font-semibold tracking-[-0.02em] whitespace-nowrap text-foreground",children:t}),x.jsx("p",{className:"min-w-0 truncate text-sm text-muted-foreground tabular-nums",children:r}),x.jsx("span",{className:"flex-1"}),x.jsx(see,{positionLabel:c,previousLabel:l.previousLabel,nextLabel:l.nextLabel,canStepBack:u,canStepForward:d,onPrevious:w,onNext:E}),y===null?null:x.jsx(nt,{variant:"link",size:"sm",onClick:y,children:iee}),T===null?null:x.jsx(nt,{variant:"outline",size:"sm","aria-pressed":i.isShown,disabled:!i.isAvailable&&!i.isShown,className:"aria-pressed:bg-foreground aria-pressed:font-bold aria-pressed:text-background",onClick:()=>{T(!i.isShown)},children:i.label}),C===null?null:x.jsxs(eee,{label:s.buttonLabel,children:[s.options.map(N=>x.jsx(tee,{label:N.label,countLabel:N.countLabel,isSelected:N.isSelected,marker:x.jsx(z4,{kind:N.key}),onToggle:()=>{C(N.toggledKeys)}},N.key)),s.isDefault?null:x.jsx(nee,{label:s.resetLabel,onReset:()=>{C(null)}})]})]}),n===null?null:x.jsx(Hs,{blocks:n,codeLinks:m,onOpenCodeLink:b,className:"pt-4"}),h===null?null:x.jsx("p",{className:"pt-6 text-muted-foreground",children:h}),g]}),gx=({imageUrl:e,monogram:t,className:n})=>{const[r,s]=O.useState(!1),i=Ne("size-5 shrink-0 rounded-full border border-input bg-card",n);return e===null||r?x.jsx("span",{"aria-hidden":"true",className:Ne(i,"inline-flex items-center justify-center text-[0.625rem] leading-none font-bold"),children:x.jsx("span",{className:"text-box-cap",children:t})}):x.jsx("img",{src:e,alt:"",className:Ne(i,"object-cover"),onError:()=>{s(!0)}})},lee={},aee="Show",cee="Hide",uee="my-1.5 mr-4 ml-18 flex max-w-[52rem] flex-col gap-3 rounded-md border border-input bg-card p-3 font-sans whitespace-normal",B4="text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",fee=()=>{},VC=({label:e,submitLabel:t,postNowLabel:n=null,cancelLabel:r,hint:s=null,isSubmitting:i,shouldFocus:l=!1,className:c,renderEditor:u,onSubmit:d,onPostNow:h,onCancel:m})=>{const[g,y]=O.useState(""),[b,w]=O.useState(0),E=i||g.trim()==="",C=T=>{T(g.trim()),y(""),w(N=>N+1)};return x.jsxs("form",{className:Ne("flex flex-col gap-2",c),onSubmit:T=>{T.preventDefault(),C(d)},children:[x.jsx("div",{children:u({label:e,shouldFocus:l,onChange:y})},b),x.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s===null?null:x.jsx("p",{className:"mr-auto text-xs text-muted-foreground",children:s}),r===null||m===void 0?null:x.jsx(nt,{type:"button",variant:"ghost",size:"sm",onClick:m,children:r}),n===null||h===void 0?null:x.jsx(nt,{type:"button",variant:"outline",size:"sm",disabled:E,onClick:()=>{C(h)},children:n}),x.jsx(nt,{type:"submit",size:"sm",disabled:E,children:t})]})]})},H4=({comment:e,verdictLabel:t=null,locationLabel:n=null,isActionPending:r=!1,className:s,onDiscard:i})=>x.jsxs("article",{className:Ne("grid grid-cols-[1.75rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-sm",s),children:[x.jsx(gx,{imageUrl:e.author.avatarUrl,monogram:e.author.monogram,className:"mt-0.5 size-6"}),x.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[x.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2",children:[x.jsx("span",{className:"font-bold",children:e.author.name}),t===null?null:x.jsx("span",{children:t}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel}),e.pendingLabel===null?null:x.jsx("span",{className:"text-xs font-bold text-signal-text",children:e.pendingLabel}),e.discardLabel===null||i===void 0?null:x.jsx("button",{type:"button",disabled:r,className:B4,onClick:()=>{i(e.id)},children:e.discardLabel})]}),n===null?null:x.jsx("p",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:n}),x.jsx(Hs,{blocks:e.body,codeLinks:lee,onOpenCodeLink:fee})]})]}),dee=({comments:e,label:t,rangeLabel:n,statusLabel:r,resolution:s,canReply:i,replyPlaceholder:l,submitLabel:c,cancelLabel:u,isSubmitting:d,renderEditor:h,onReply:m,onResolve:g,onDiscard:y})=>{const[b,w]=O.useState(!1),[E,C]=O.useState(!1),T=r!==null&&!E;return x.jsxs("section",{"aria-label":t,className:uee,children:[n===null&&r===null?null:x.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-3 text-xs text-muted-foreground",children:[n===null?null:x.jsx("span",{className:"tabular-nums",children:n}),r===null?null:x.jsx("span",{className:"font-bold text-foreground",children:r}),r===null?null:x.jsx("button",{type:"button","aria-expanded":!T,className:B4,onClick:()=>{C(N=>!N)},children:T?aee:cee})]}),T?null:e.map(N=>x.jsx(H4,{comment:N,isActionPending:d,onDiscard:y},N.id)),T||!b?null:x.jsx(VC,{label:`${l}, ${t}`,submitLabel:c,cancelLabel:u,isSubmitting:d,shouldFocus:!0,className:"pl-9",renderEditor:h,onSubmit:N=>{m(N),w(!1)},onCancel:()=>{w(!1)}}),T||b||!i&&s===null?null:x.jsxs("div",{className:"ml-9 flex flex-wrap items-center gap-3",children:[i?x.jsx("button",{type:"button",className:"h-8 min-w-48 flex-1 rounded-lg border border-input bg-background px-2.5 text-left text-sm text-muted-foreground hover:bg-muted",onClick:()=>{w(!0)},children:l}):null,s===null?null:x.jsx(nt,{type:"button",variant:"outline",size:"sm",disabled:d,onClick:()=>{g(s.isResolving)},children:s.label})]})]})},F4=({label:e,isReviewed:t,isDisabled:n=!1,className:r,onChange:s})=>x.jsxs("button",{type:"button","aria-pressed":t,disabled:n,className:Ne("group/review inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[0.8rem] hover:bg-muted disabled:opacity-50",r),onClick:()=>{s(!t)},children:[x.jsx("span",{"aria-hidden":"true",className:"inline-flex size-4 items-center justify-center rounded-full border-[1.5px] border-muted-foreground text-line-foreground transition-colors duration-[180ms] ease-out group-aria-pressed/review:border-(--line) group-aria-pressed/review:bg-(--line)",children:x.jsx(dx,{className:"size-3 opacity-0 transition-opacity duration-[180ms] ease-out group-aria-pressed/review:opacity-100",strokeWidth:3})}),x.jsx("span",{className:"text-box-cap",children:e})]}),hee=({finding:e,codeLinks:t,onOpenCodeLink:n})=>{const[r,s]=O.useState(!1),{solution:i,trace:l}=e;return x.jsxs("article",{className:"flex flex-col gap-2 border-t pt-3 text-base leading-[1.7]",children:[x.jsxs("h4",{className:"flex items-baseline gap-2",children:[x.jsx(zh,{kind:e.kind,label:e.kindLabel,className:"translate-y-px"}),x.jsx("span",{className:"font-semibold",children:x.jsx(Gf,{inlines:e.title,codeLinks:t,onOpenCodeLink:n})})]}),x.jsx(Hs,{blocks:e.reading,codeLinks:t,onOpenCodeLink:n}),l===null?null:x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:e.traceLabel}),x.jsx("ol",{className:"flex max-w-[66ch] list-decimal flex-col gap-1.5 pl-5 text-base leading-[1.7]",children:hd(l).map(({key:c,item:u})=>x.jsx("li",{children:x.jsx(Gf,{inlines:u,codeLinks:t,onOpenCodeLink:n})},c))})]}),i===null?null:x.jsxs("div",{className:"flex flex-col items-start gap-2",children:[x.jsx(nt,{variant:"outline",size:"sm","aria-expanded":r,onClick:()=>{s(c=>!c)},children:r?i.hideLabel:i.showLabel}),r?x.jsx(lu,{lines:i.lines,label:i.showLabel,className:"w-full rounded-md border"}):null]})]})},pee=["ml-18","ml-24","ml-30"],mee="ml-36",UC=({waypoint:e,isOpen:t,isCurrent:n,isReviewPending:r,codeLinks:s,actions:i,onOpenCodeLink:l,onToggle:c,onReviewedChange:u})=>x.jsxs("section",{id:e.anchorId,"aria-label":e.title,"data-current":n,"data-reviewed":e.isReviewed,className:Ne("my-1.5 mr-4 scroll-mt-(--waypoint-scroll-margin) rounded-md border border-input bg-background font-sans whitespace-normal transition-[border-color,outline-color,opacity] duration-[180ms] ease-out data-[current=true]:border-(--line) data-[current=true]:outline-1 data-[current=true]:outline-(--line) data-[reviewed=true]:opacity-60",pee.find((d,h)=>h===e.depth)??mee),children:[x.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[x.jsxs("button",{type:"button","aria-expanded":t,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-2 text-left",onClick:c,children:[x.jsx(YW,{"aria-hidden":"true",className:Ne("size-4 shrink-0 text-muted-foreground transition-transform duration-[180ms] ease-out",t?"rotate-90":"")}),e.chip===null?null:x.jsx(zh,{kind:e.chip.kind,label:e.chip.label}),e.attentionLabel===null?null:x.jsx(zh,{kind:"attention",label:e.attentionLabel}),x.jsx(so,{isPending:e.isDraft,className:"w-56 text-[0.9375rem]",children:x.jsx("span",{className:Ne("min-w-0 truncate text-[0.9375rem]",e.isDraft?"font-mono text-sm text-muted-foreground":"font-semibold"),children:e.title})}),x.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:e.positionLabel})]}),i,u===null?null:x.jsx(F4,{label:e.reviewLabel,isReviewed:e.isReviewed,isDisabled:r,onChange:u})]}),t?x.jsxs("div",{className:"flex flex-col gap-3 border-t px-4 pt-3.5 pb-4 text-base leading-[1.7]",children:[e.reading===null?x.jsx(so,{isPending:!0,lineCount:3,children:x.jsx("p",{className:"text-muted-foreground",children:e.unwrittenLabel})}):x.jsx(Hs,{blocks:e.reading,codeLinks:s,onOpenCodeLink:l}),e.needsAttention===null||e.attentionLabel===null?null:x.jsxs("div",{className:"flex flex-col gap-2 border-t pt-3",children:[x.jsx(zh,{kind:"attention",label:e.attentionLabel}),x.jsx(Hs,{blocks:e.needsAttention,codeLinks:s,onOpenCodeLink:l})]}),e.findings.map(d=>x.jsx(hee,{finding:d,codeLinks:s,onOpenCodeLink:l},d.id))]}):null]}),xA=10,gee=e=>{const t=Number.parseInt(e.startLineLabel,xA),n=Number.parseInt(e.lineLabel,xA);return Array.from({length:Math.max(n-t,0)+1},(r,s)=>f4({side:e.side,lineLabel:String(t+s)}))},bA=(e,t)=>e.side===t.side&&e.lineLabel===t.lineLabel,vA=e=>e.startLineLabel===e.lineLabel?e.lineLabel:`${e.startLineLabel} to ${e.lineLabel}`,yee=({file:e,openWaypointIds:t,currentWaypointId:n,isReviewPending:r,composer:s,composingRange:i,isCommentPending:l,renderCommentEditor:c,codeLinks:u,codeDefinitions:d,onOpenCodeLink:h,onToggleWaypoint:m,onWaypointReviewedChange:g,onFileReviewedChange:y,onStartComment:b,onAddComment:w,onPostComment:E,onReply:C,onResolveThread:T,onDiscardComment:N})=>{const R=new Set([...e.threads,...i===null?[]:[i]].flatMap(gee)),M=k=>x.jsx(h4,{blocks:k,codeLinks:u,onOpenCodeLink:h}),D=k=>s===null?null:x.jsxs(x.Fragment,{children:[e.threads.filter(I=>bA(I,k)).map(I=>x.jsx(dee,{comments:I.comments,label:`${e.path} ${vA(I)}`,rangeLabel:I.rangeLabel,statusLabel:I.statusLabel,resolution:I.resolution,canReply:I.canReply,replyPlaceholder:s.replyPlaceholder,submitLabel:s.replyLabel,cancelLabel:s.cancelLabel,isSubmitting:l,renderEditor:c,onReply:_=>{C(I.id,_)},onResolve:_=>{T(I.id,_)},onDiscard:N},I.id)),i!==null&&bA(i,k)?x.jsx(VC,{label:`${s.placeholder}, ${e.path} ${vA(i)}`,submitLabel:s.submitLabel,postNowLabel:s.postNowLabel,cancelLabel:s.cancelLabel,hint:s.rangeHint,isSubmitting:l,shouldFocus:!0,className:"my-1.5 mr-4 ml-18 max-w-[52rem] rounded-md border border-input bg-card p-3 font-sans whitespace-normal",renderEditor:c,onSubmit:I=>{w(e.path,i,I)},onPostNow:I=>{E(e.path,i,I)},onCancel:()=>{b(e.path,null,!1)}}):null]});return x.jsxs("article",{id:e.anchorId,"aria-label":e.title,"data-reviewed":e.isReviewed,className:"scroll-mt-(--waypoint-scroll-margin) pt-6 [contain-intrinsic-size:auto_32rem] [content-visibility:auto]",children:[e.summary.length===0?null:x.jsx("ul",{className:"flex list-disc flex-col gap-2 pb-4 pl-5",children:hd(e.summary).map(({key:k,item:I})=>x.jsx("li",{children:x.jsx(Hs,{blocks:I,codeLinks:u,onOpenCodeLink:h})},k))}),x.jsxs("div",{className:"overflow-clip rounded-md border",children:[x.jsxs("div",{className:"sticky top-(--file-header-top) z-10 flex h-11 items-center gap-3 border-b bg-muted pr-1 pl-3",children:[x.jsxs("div",{className:"flex min-w-0 flex-col justify-center",children:[x.jsx("h3",{className:"truncate text-[0.9375rem] leading-5 font-semibold",children:x.jsx(so,{isPending:e.isDraft,className:"h-5 w-64 py-0",children:e.title})}),x.jsx("p",{className:"truncate font-mono text-xs leading-4 text-muted-foreground",title:e.path,children:e.path})]}),x.jsx("p",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.waypointCountLabel}),x.jsx("span",{className:"flex-1"}),e.forgeLink===null?null:x.jsx(dd,{href:e.forgeLink.href,label:e.forgeLink.label,className:"shrink-0 text-xs"}),y===null?null:x.jsx(F4,{label:e.reviewLabel,isReviewed:e.isReviewed,isDisabled:r,onChange:k=>{y(e.path,k)}})]}),e.rows.map(k=>k.kind==="lines"?x.jsx(lu,{lines:k.lines,definitions:d,renderDefinitionDescription:M,path:e.path,label:e.path,className:"py-0",commentedLineKeys:R,renderLineThreads:D,...s===null?{}:{addCommentLabel:s.addLabel,onAddComment:(I,_)=>{b(e.path,I,_)}}},k.id):k.kind==="gap"?x.jsx("p",{className:"border-y bg-muted/60 py-0.5 pl-18 font-mono text-xs text-muted-foreground first-of-type:border-t-0 last:border-b-0",children:k.label},k.id):x.jsx("div",{className:"bg-code",children:x.jsx(UC,{waypoint:k.waypoint,isOpen:t.has(k.waypoint.id),isCurrent:k.waypoint.id===n,isReviewPending:r,codeLinks:u,onOpenCodeLink:h,onToggle:()=>{m(k.waypoint.id)},onReviewedChange:g===null?null:I=>{g(k.waypoint.id,I)}})},k.id))]})]})},SA=({message:e,generateLabel:t,generatingLabel:n,isGenerating:r,errorMessage:s,onGenerate:i})=>x.jsxs("div",{className:"flex max-w-[30rem] flex-col items-start gap-3 rounded-md border border-foreground bg-popover p-4 text-popover-foreground",children:[x.jsx("p",{className:"text-sm",children:e}),x.jsx(nt,{size:"sm",disabled:r,onClick:i,children:r?n:t}),s===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}),US=({kind:e,anchorId:t,heading:n,...r})=>e==="board"?x.jsxs("section",{id:t,"aria-labelledby":`${t}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsx("h2",{id:`${t}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:n}),x.jsx("div",{className:"flex min-h-56 items-center justify-center rounded-md border bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] p-4",children:x.jsx(SA,{...r})})]}):x.jsxs("section",{id:t,"aria-labelledby":`${t}-heading`,className:"scroll-mt-(--section-scroll-margin) pb-6",children:[x.jsx("h3",{id:`${t}-heading`,className:"pb-2 text-base font-bold text-foreground",children:n}),x.jsx(SA,{...r})]});function $n(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=$n(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var xee={value:()=>{}};function yx(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new O0(n)}function O0(e){this._=e}function bee(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}O0.prototype=yx.prototype={constructor:O0,on:function(e,t){var n=this._,r=bee(e+"",n),s,i=-1,l=r.length;if(arguments.length<2){for(;++i<l;)if((s=(e=r[i]).type)&&(s=vee(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(s=(e=r[i]).type)n[s]=wA(n[s],e.name,t);else if(t==null)for(s in n)n[s]=wA(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new O0(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,i;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,i=r.length;s<i;++s)r[s].value.apply(t,n)}};function vee(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function wA(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=xee,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var vw="http://www.w3.org/1999/xhtml";const EA={svg:"http://www.w3.org/2000/svg",xhtml:vw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xx(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),EA.hasOwnProperty(t)?{space:EA[t],local:e}:e}function See(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vw&&t.documentElement.namespaceURI===vw?t.createElement(e):t.createElementNS(n,e)}}function wee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $4(e){var t=xx(e);return(t.local?wee:See)(t)}function Eee(){}function qC(e){return e==null?Eee:function(){return this.querySelector(e)}}function Cee(e){typeof e!="function"&&(e=qC(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],l=i.length,c=r[s]=new Array(l),u,d,h=0;h<l;++h)(u=i[h])&&(d=e.call(u,u.__data__,h,i))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d);return new Fs(r,this._parents)}function Nee(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tee(){return[]}function V4(e){return e==null?Tee:function(){return this.querySelectorAll(e)}}function Ree(e){return function(){return Nee(e.apply(this,arguments))}}function Oee(e){typeof e=="function"?e=Ree(e):e=V4(e);for(var t=this._groups,n=t.length,r=[],s=[],i=0;i<n;++i)for(var l=t[i],c=l.length,u,d=0;d<c;++d)(u=l[d])&&(r.push(e.call(u,u.__data__,d,l)),s.push(u));return new Fs(r,s)}function U4(e){return function(){return this.matches(e)}}function q4(e){return function(t){return t.matches(e)}}var kee=Array.prototype.find;function Mee(e){return function(){return kee.call(this.children,e)}}function Aee(){return this.firstElementChild}function _ee(e){return this.select(e==null?Aee:Mee(typeof e=="function"?e:q4(e)))}var Dee=Array.prototype.filter;function Iee(){return Array.from(this.children)}function jee(e){return function(){return Dee.call(this.children,e)}}function Lee(e){return this.selectAll(e==null?Iee:jee(typeof e=="function"?e:q4(e)))}function Pee(e){typeof e!="function"&&(e=U4(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],l=i.length,c=r[s]=[],u,d=0;d<l;++d)(u=i[d])&&e.call(u,u.__data__,d,i)&&c.push(u);return new Fs(r,this._parents)}function G4(e){return new Array(e.length)}function zee(){return new Fs(this._enter||this._groups.map(G4),this._parents)}function sy(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}sy.prototype={constructor:sy,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Bee(e){return function(){return e}}function Hee(e,t,n,r,s,i){for(var l=0,c,u=t.length,d=i.length;l<d;++l)(c=t[l])?(c.__data__=i[l],r[l]=c):n[l]=new sy(e,i[l]);for(;l<u;++l)(c=t[l])&&(s[l]=c)}function Fee(e,t,n,r,s,i,l){var c,u,d=new Map,h=t.length,m=i.length,g=new Array(h),y;for(c=0;c<h;++c)(u=t[c])&&(g[c]=y=l.call(u,u.__data__,c,t)+"",d.has(y)?s[c]=u:d.set(y,u));for(c=0;c<m;++c)y=l.call(e,i[c],c,i)+"",(u=d.get(y))?(r[c]=u,u.__data__=i[c],d.delete(y)):n[c]=new sy(e,i[c]);for(c=0;c<h;++c)(u=t[c])&&d.get(g[c])===u&&(s[c]=u)}function $ee(e){return e.__data__}function Vee(e,t){if(!arguments.length)return Array.from(this,$ee);var n=t?Fee:Hee,r=this._parents,s=this._groups;typeof e!="function"&&(e=Bee(e));for(var i=s.length,l=new Array(i),c=new Array(i),u=new Array(i),d=0;d<i;++d){var h=r[d],m=s[d],g=m.length,y=Uee(e.call(h,h&&h.__data__,d,r)),b=y.length,w=c[d]=new Array(b),E=l[d]=new Array(b),C=u[d]=new Array(g);n(h,m,w,E,C,y,t);for(var T=0,N=0,R,M;T<b;++T)if(R=w[T]){for(T>=N&&(N=T+1);!(M=E[N])&&++N<b;);R._next=M||null}}return l=new Fs(l,r),l._enter=c,l._exit=u,l}function Uee(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qee(){return new Fs(this._exit||this._groups.map(G4),this._parents)}function Gee(e,t,n){var r=this.enter(),s=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?i.remove():n(i),r&&s?r.merge(s).order():s}function Kee(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,i=r.length,l=Math.min(s,i),c=new Array(s),u=0;u<l;++u)for(var d=n[u],h=r[u],m=d.length,g=c[u]=new Array(m),y,b=0;b<m;++b)(y=d[b]||h[b])&&(g[b]=y);for(;u<s;++u)c[u]=n[u];return new Fs(c,this._parents)}function Yee(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,i=r[s],l;--s>=0;)(l=r[s])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Wee(e){e||(e=Xee);function t(m,g){return m&&g?e(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;i<r;++i){for(var l=n[i],c=l.length,u=s[i]=new Array(c),d,h=0;h<c;++h)(d=l[h])&&(u[h]=d);u.sort(t)}return new Fs(s,this._parents).order()}function Xee(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Qee(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zee(){return Array.from(this)}function Jee(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length;s<i;++s){var l=r[s];if(l)return l}return null}function ete(){let e=0;for(const t of this)++e;return e}function tte(){return!this.node()}function nte(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],i=0,l=s.length,c;i<l;++i)(c=s[i])&&e.call(c,c.__data__,i,s);return this}function rte(e){return function(){this.removeAttribute(e)}}function ste(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ite(e,t){return function(){this.setAttribute(e,t)}}function ote(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function lte(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ate(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function cte(e,t){var n=xx(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ste:rte:typeof t=="function"?n.local?ate:lte:n.local?ote:ite)(n,t))}function K4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ute(e){return function(){this.style.removeProperty(e)}}function fte(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dte(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function hte(e,t,n){return arguments.length>1?this.each((t==null?ute:typeof t=="function"?dte:fte)(e,t,n??"")):Kf(this.node(),e)}function Kf(e,t){return e.style.getPropertyValue(t)||K4(e).getComputedStyle(e,null).getPropertyValue(t)}function pte(e){return function(){delete this[e]}}function mte(e,t){return function(){this[e]=t}}function gte(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yte(e,t){return arguments.length>1?this.each((t==null?pte:typeof t=="function"?gte:mte)(e,t)):this.node()[e]}function Y4(e){return e.trim().split(/^|\s+/)}function GC(e){return e.classList||new W4(e)}function W4(e){this._node=e,this._names=Y4(e.getAttribute("class")||"")}W4.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function X4(e,t){for(var n=GC(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Q4(e,t){for(var n=GC(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function xte(e){return function(){X4(this,e)}}function bte(e){return function(){Q4(this,e)}}function vte(e,t){return function(){(t.apply(this,arguments)?X4:Q4)(this,e)}}function Ste(e,t){var n=Y4(e+"");if(arguments.length<2){for(var r=GC(this.node()),s=-1,i=n.length;++s<i;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?vte:t?xte:bte)(n,t))}function wte(){this.textContent=""}function Ete(e){return function(){this.textContent=e}}function Cte(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Nte(e){return arguments.length?this.each(e==null?wte:(typeof e=="function"?Cte:Ete)(e)):this.node().textContent}function Tte(){this.innerHTML=""}function Rte(e){return function(){this.innerHTML=e}}function Ote(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function kte(e){return arguments.length?this.each(e==null?Tte:(typeof e=="function"?Ote:Rte)(e)):this.node().innerHTML}function Mte(){this.nextSibling&&this.parentNode.appendChild(this)}function Ate(){return this.each(Mte)}function _te(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dte(){return this.each(_te)}function Ite(e){var t=typeof e=="function"?e:$4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function jte(){return null}function Lte(e,t){var n=typeof e=="function"?e:$4(e),r=t==null?jte:typeof t=="function"?t:qC(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Pte(){var e=this.parentNode;e&&e.removeChild(this)}function zte(){return this.each(Pte)}function Bte(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hte(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Fte(e){return this.select(e?Hte:Bte)}function $te(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Vte(e){return function(t){e.call(this,t,this.__data__)}}function Ute(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function qte(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n<s;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function Gte(e,t,n){return function(){var r=this.__on,s,i=Vte(t);if(r){for(var l=0,c=r.length;l<c;++l)if((s=r[l]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=n),s.value=t;return}}this.addEventListener(e.type,i,n),s={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(s):this.__on=[s]}}function Kte(e,t,n){var r=Ute(e+""),s,i=r.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,d=c.length,h;u<d;++u)for(s=0,h=c[u];s<i;++s)if((l=r[s]).type===h.type&&l.name===h.name)return h.value}return}for(c=t?Gte:qte,s=0;s<i;++s)this.each(c(r[s],t,n));return this}function Z4(e,t,n){var r=K4(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function Yte(e,t){return function(){return Z4(this,e,t)}}function Wte(e,t){return function(){return Z4(this,e,t.apply(this,arguments))}}function Xte(e,t){return this.each((typeof t=="function"?Wte:Yte)(e,t))}function*Qte(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length,l;s<i;++s)(l=r[s])&&(yield l)}var J4=[null];function Fs(e,t){this._groups=e,this._parents=t}function tm(){return new Fs([[document.documentElement]],J4)}function Zte(){return this}Fs.prototype=tm.prototype={constructor:Fs,select:Cee,selectAll:Oee,selectChild:_ee,selectChildren:Lee,filter:Pee,data:Vee,enter:zee,exit:qee,join:Gee,merge:Kee,selection:Zte,order:Yee,sort:Wee,call:Qee,nodes:Zee,node:Jee,size:ete,empty:tte,each:nte,attr:cte,style:hte,property:yte,classed:Ste,text:Nte,html:kte,raise:Ate,lower:Dte,append:Ite,insert:Lte,remove:zte,clone:Fte,datum:$te,on:Kte,dispatch:Xte,[Symbol.iterator]:Qte};function Is(e){return typeof e=="string"?new Fs([[document.querySelector(e)]],[document.documentElement]):new Fs([[e]],J4)}function Jte(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gi(e,t){if(e=Jte(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const ene={passive:!1},lp={capture:!0,passive:!1};function qS(e){e.stopImmediatePropagation()}function wf(e){e.preventDefault(),e.stopImmediatePropagation()}function ez(e){var t=e.document.documentElement,n=Is(e).on("dragstart.drag",wf,lp);"onselectstart"in t?n.on("selectstart.drag",wf,lp):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function tz(e,t){var n=e.document.documentElement,r=Is(e).on("dragstart.drag",null);t&&(r.on("click.drag",wf,lp),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Wg=e=>()=>e;function Sw(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:l,y:c,dx:u,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}Sw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function tne(e){return!e.ctrlKey&&!e.button}function nne(){return this.parentNode}function rne(e,t){return t??{x:e.x,y:e.y}}function sne(){return navigator.maxTouchPoints||"ontouchstart"in this}function nz(){var e=tne,t=nne,n=rne,r=sne,s={},i=yx("start","drag","end"),l=0,c,u,d,h,m=0;function g(R){R.on("mousedown.drag",y).filter(r).on("touchstart.drag",E).on("touchmove.drag",C,ene).on("touchend.drag touchcancel.drag",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(R,M){if(!(h||!e.call(this,R,M))){var D=N(this,t.call(this,R,M),R,M,"mouse");D&&(Is(R.view).on("mousemove.drag",b,lp).on("mouseup.drag",w,lp),ez(R.view),qS(R),d=!1,c=R.clientX,u=R.clientY,D("start",R))}}function b(R){if(wf(R),!d){var M=R.clientX-c,D=R.clientY-u;d=M*M+D*D>m}s.mouse("drag",R)}function w(R){Is(R.view).on("mousemove.drag mouseup.drag",null),tz(R.view,d),wf(R),s.mouse("end",R)}function E(R,M){if(e.call(this,R,M)){var D=R.changedTouches,k=t.call(this,R,M),I=D.length,_,P;for(_=0;_<I;++_)(P=N(this,k,R,M,D[_].identifier,D[_]))&&(qS(R),P("start",R,D[_]))}}function C(R){var M=R.changedTouches,D=M.length,k,I;for(k=0;k<D;++k)(I=s[M[k].identifier])&&(wf(R),I("drag",R,M[k]))}function T(R){var M=R.changedTouches,D=M.length,k,I;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<D;++k)(I=s[M[k].identifier])&&(qS(R),I("end",R,M[k]))}function N(R,M,D,k,I,_){var P=i.copy(),H=gi(_||D,M),z,U,j;if((j=n.call(R,new Sw("beforestart",{sourceEvent:D,target:g,identifier:I,active:l,x:H[0],y:H[1],dx:0,dy:0,dispatch:P}),k))!=null)return z=j.x-H[0]||0,U=j.y-H[1]||0,function B(L,$,q){var G=H,W;switch(L){case"start":s[I]=B,W=l++;break;case"end":delete s[I],--l;case"drag":H=gi(q||$,M),W=l;break}P.call(L,R,new Sw(L,{sourceEvent:$,subject:j,target:g,identifier:I,active:W,x:H[0]+z,y:H[1]+U,dx:H[0]-G[0],dy:H[1]-G[1],dispatch:P}),k)}}return g.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Wg(!!R),g):e},g.container=function(R){return arguments.length?(t=typeof R=="function"?R:Wg(R),g):t},g.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Wg(R),g):n},g.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:Wg(!!R),g):r},g.on=function(){var R=i.on.apply(i,arguments);return R===i?g:R},g.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,g):Math.sqrt(m)},g}function KC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function rz(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function nm(){}var ap=.7,iy=1/ap,Ef="\\s*([+-]?\\d+)\\s*",cp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ro="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ine=/^#([0-9a-f]{3,8})$/,one=new RegExp(`^rgb\\(${Ef},${Ef},${Ef}\\)$`),lne=new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`),ane=new RegExp(`^rgba\\(${Ef},${Ef},${Ef},${cp}\\)$`),cne=new RegExp(`^rgba\\(${ro},${ro},${ro},${cp}\\)$`),une=new RegExp(`^hsl\\(${cp},${ro},${ro}\\)$`),fne=new RegExp(`^hsla\\(${cp},${ro},${ro},${cp}\\)$`),CA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};KC(nm,Fc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:NA,formatHex:NA,formatHex8:dne,formatHsl:hne,formatRgb:TA,toString:TA});function NA(){return this.rgb().formatHex()}function dne(){return this.rgb().formatHex8()}function hne(){return sz(this).formatHsl()}function TA(){return this.rgb().formatRgb()}function Fc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ine.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RA(t):n===3?new ps(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=one.exec(e))?new ps(t[1],t[2],t[3],1):(t=lne.exec(e))?new ps(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ane.exec(e))?Xg(t[1],t[2],t[3],t[4]):(t=cne.exec(e))?Xg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=une.exec(e))?MA(t[1],t[2]/100,t[3]/100,1):(t=fne.exec(e))?MA(t[1],t[2]/100,t[3]/100,t[4]):CA.hasOwnProperty(e)?RA(CA[e]):e==="transparent"?new ps(NaN,NaN,NaN,0):null}function RA(e){return new ps(e>>16&255,e>>8&255,e&255,1)}function Xg(e,t,n,r){return r<=0&&(e=t=n=NaN),new ps(e,t,n,r)}function pne(e){return e instanceof nm||(e=Fc(e)),e?(e=e.rgb(),new ps(e.r,e.g,e.b,e.opacity)):new ps}function ww(e,t,n,r){return arguments.length===1?pne(e):new ps(e,t,n,r??1)}function ps(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}KC(ps,ww,rz(nm,{brighter(e){return e=e==null?iy:Math.pow(iy,e),new ps(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ap:Math.pow(ap,e),new ps(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ps(_c(this.r),_c(this.g),_c(this.b),oy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OA,formatHex:OA,formatHex8:mne,formatRgb:kA,toString:kA}));function OA(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}`}function mne(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}${xc((isNaN(this.opacity)?1:this.opacity)*255)}`}function kA(){const e=oy(this.opacity);return`${e===1?"rgb(":"rgba("}${_c(this.r)}, ${_c(this.g)}, ${_c(this.b)}${e===1?")":`, ${e})`}`}function oy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xc(e){return e=_c(e),(e<16?"0":"")+e.toString(16)}function MA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yi(e,t,n,r)}function sz(e){if(e instanceof yi)return new yi(e.h,e.s,e.l,e.opacity);if(e instanceof nm||(e=Fc(e)),!e)return new yi;if(e instanceof yi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,c=i-s,u=(i+s)/2;return c?(t===i?l=(n-r)/c+(n<r)*6:n===i?l=(r-t)/c+2:l=(t-n)/c+4,c/=u<.5?i+s:2-i-s,l*=60):c=u>0&&u<1?0:l,new yi(l,c,u,e.opacity)}function gne(e,t,n,r){return arguments.length===1?sz(e):new yi(e,t,n,r??1)}function yi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}KC(yi,gne,rz(nm,{brighter(e){return e=e==null?iy:Math.pow(iy,e),new yi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ap:Math.pow(ap,e),new yi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new ps(GS(e>=240?e-240:e+120,s,r),GS(e,s,r),GS(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new yi(AA(this.h),Qg(this.s),Qg(this.l),oy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=oy(this.opacity);return`${e===1?"hsl(":"hsla("}${AA(this.h)}, ${Qg(this.s)*100}%, ${Qg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function AA(e){return e=(e||0)%360,e<0?e+360:e}function Qg(e){return Math.max(0,Math.min(1,e||0))}function GS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const YC=e=>()=>e;function yne(e,t){return function(n){return e+n*t}}function xne(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function bne(e){return(e=+e)==1?iz:function(t,n){return n-t?xne(t,n,e):YC(isNaN(t)?n:t)}}function iz(e,t){var n=t-e;return n?yne(e,n):YC(isNaN(e)?t:e)}const ly=(function e(t){var n=bne(t);function r(s,i){var l=n((s=ww(s)).r,(i=ww(i)).r),c=n(s.g,i.g),u=n(s.b,i.b),d=iz(s.opacity,i.opacity);return function(h){return s.r=l(h),s.g=c(h),s.b=u(h),s.opacity=d(h),s+""}}return r.gamma=e,r})(1);function vne(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;s<n;++s)r[s]=e[s]*(1-i)+t[s]*i;return r}}function Sne(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wne(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),i=new Array(n),l;for(l=0;l<r;++l)s[l]=Bh(e[l],t[l]);for(;l<n;++l)i[l]=t[l];return function(c){for(l=0;l<r;++l)i[l]=s[l](c);return i}}function Ene(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Zi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Cne(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Bh(e[s],t[s]):r[s]=t[s];return function(i){for(s in n)r[s]=n[s](i);return r}}var Ew=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,KS=new RegExp(Ew.source,"g");function Nne(e){return function(){return e}}function Tne(e){return function(t){return e(t)+""}}function oz(e,t){var n=Ew.lastIndex=KS.lastIndex=0,r,s,i,l=-1,c=[],u=[];for(e=e+"",t=t+"";(r=Ew.exec(e))&&(s=KS.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),c[l]?c[l]+=i:c[++l]=i),(r=r[0])===(s=s[0])?c[l]?c[l]+=s:c[++l]=s:(c[++l]=null,u.push({i:l,x:Zi(r,s)})),n=KS.lastIndex;return n<t.length&&(i=t.slice(n),c[l]?c[l]+=i:c[++l]=i),c.length<2?u[0]?Tne(u[0].x):Nne(t):(t=u.length,function(d){for(var h=0,m;h<t;++h)c[(m=u[h]).i]=m.x(d);return c.join("")})}function Bh(e,t){var n=typeof t,r;return t==null||n==="boolean"?YC(t):(n==="number"?Zi:n==="string"?(r=Fc(t))?(t=r,ly):oz:t instanceof Fc?ly:t instanceof Date?Ene:Sne(t)?vne:Array.isArray(t)?wne:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Cne:Zi)(e,t)}var _A=180/Math.PI,Cw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lz(e,t,n,r,s,i){var l,c,u;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,l=-l),{translateX:s,translateY:i,rotate:Math.atan2(t,e)*_A,skewX:Math.atan(u)*_A,scaleX:l,scaleY:c}}var Zg;function Rne(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cw:lz(t.a,t.b,t.c,t.d,t.e,t.f)}function One(e){return e==null||(Zg||(Zg=document.createElementNS("http://www.w3.org/2000/svg","g")),Zg.setAttribute("transform",e),!(e=Zg.transform.baseVal.consolidate()))?Cw:(e=e.matrix,lz(e.a,e.b,e.c,e.d,e.e,e.f))}function az(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function i(d,h,m,g,y,b){if(d!==m||h!==g){var w=y.push("translate(",null,t,null,n);b.push({i:w-4,x:Zi(d,m)},{i:w-2,x:Zi(h,g)})}else(m||g)&&y.push("translate("+m+t+g+n)}function l(d,h,m,g){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),g.push({i:m.push(s(m)+"rotate(",null,r)-2,x:Zi(d,h)})):h&&m.push(s(m)+"rotate("+h+r)}function c(d,h,m,g){d!==h?g.push({i:m.push(s(m)+"skewX(",null,r)-2,x:Zi(d,h)}):h&&m.push(s(m)+"skewX("+h+r)}function u(d,h,m,g,y,b){if(d!==m||h!==g){var w=y.push(s(y)+"scale(",null,",",null,")");b.push({i:w-4,x:Zi(d,m)},{i:w-2,x:Zi(h,g)})}else(m!==1||g!==1)&&y.push(s(y)+"scale("+m+","+g+")")}return function(d,h){var m=[],g=[];return d=e(d),h=e(h),i(d.translateX,d.translateY,h.translateX,h.translateY,m,g),l(d.rotate,h.rotate,m,g),c(d.skewX,h.skewX,m,g),u(d.scaleX,d.scaleY,h.scaleX,h.scaleY,m,g),d=h=null,function(y){for(var b=-1,w=g.length,E;++b<w;)m[(E=g[b]).i]=E.x(y);return m.join("")}}}var kne=az(Rne,"px, ","px)","deg)"),Mne=az(One,", ",")",")"),Ane=1e-12;function DA(e){return((e=Math.exp(e))+1/e)/2}function _ne(e){return((e=Math.exp(e))-1/e)/2}function Dne(e){return((e=Math.exp(2*e))-1)/(e+1)}const k0=(function e(t,n,r){function s(i,l){var c=i[0],u=i[1],d=i[2],h=l[0],m=l[1],g=l[2],y=h-c,b=m-u,w=y*y+b*b,E,C;if(w<Ane)C=Math.log(g/d)/t,E=function(k){return[c+k*y,u+k*b,d*Math.exp(t*k*C)]};else{var T=Math.sqrt(w),N=(g*g-d*d+r*w)/(2*d*n*T),R=(g*g-d*d-r*w)/(2*g*n*T),M=Math.log(Math.sqrt(N*N+1)-N),D=Math.log(Math.sqrt(R*R+1)-R);C=(D-M)/t,E=function(k){var I=k*C,_=DA(M),P=d/(n*T)*(_*Dne(t*I+M)-_ne(M));return[c+P*y,u+P*b,d*_/DA(t*I+M)]}}return E.duration=C*1e3*t/Math.SQRT2,E}return s.rho=function(i){var l=Math.max(.001,+i),c=l*l,u=c*c;return e(l,c,u)},s})(Math.SQRT2,2,4);var Yf=0,Th=0,ph=0,cz=1e3,ay,Rh,cy=0,$c=0,bx=0,up=typeof performance=="object"&&performance.now?performance:Date,uz=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function WC(){return $c||(uz(Ine),$c=up.now()+bx)}function Ine(){$c=0}function uy(){this._call=this._time=this._next=null}uy.prototype=fz.prototype={constructor:uy,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?WC():+n)+(t==null?0:+t),!this._next&&Rh!==this&&(Rh?Rh._next=this:ay=this,Rh=this),this._call=e,this._time=n,Nw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nw())}};function fz(e,t,n){var r=new uy;return r.restart(e,t,n),r}function jne(){WC(),++Yf;for(var e=ay,t;e;)(t=$c-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yf}function IA(){$c=(cy=up.now())+bx,Yf=Th=0;try{jne()}finally{Yf=0,Pne(),$c=0}}function Lne(){var e=up.now(),t=e-cy;t>cz&&(bx-=t,cy=e)}function Pne(){for(var e,t=ay,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ay=n);Rh=e,Nw(r)}function Nw(e){if(!Yf){Th&&(Th=clearTimeout(Th));var t=e-$c;t>24?(e<1/0&&(Th=setTimeout(IA,e-up.now()-bx)),ph&&(ph=clearInterval(ph))):(ph||(cy=up.now(),ph=setInterval(Lne,cz)),Yf=1,uz(IA))}}function jA(e,t,n){var r=new uy;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var zne=yx("start","end","cancel","interrupt"),Bne=[],dz=0,LA=1,Tw=2,M0=3,PA=4,Rw=5,A0=6;function vx(e,t,n,r,s,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;Hne(e,n,{name:t,index:r,group:s,on:zne,tween:Bne,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:dz})}function XC(e,t){var n=Oi(e,t);if(n.state>dz)throw new Error("too late; already scheduled");return n}function ao(e,t){var n=Oi(e,t);if(n.state>M0)throw new Error("too late; already running");return n}function Oi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hne(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=fz(i,0,n.time);function i(d){n.state=LA,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var h,m,g,y;if(n.state!==LA)return u();for(h in r)if(y=r[h],y.name===n.name){if(y.state===M0)return jA(l);y.state===PA?(y.state=A0,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[h]):+h<t&&(y.state=A0,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[h])}if(jA(function(){n.state===M0&&(n.state=PA,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Tw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Tw){for(n.state=M0,s=new Array(g=n.tween.length),h=0,m=-1;h<g;++h)(y=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++m]=y);s.length=m+1}}function c(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=Rw,1),m=-1,g=s.length;++m<g;)s[m].call(e,h);n.state===Rw&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=A0,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function _0(e,t){var n=e.__transition,r,s,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){i=!1;continue}s=r.state>Tw&&r.state<Rw,r.state=A0,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}i&&delete e.__transition}}function Fne(e){return this.each(function(){_0(this,e)})}function $ne(e,t){var n,r;return function(){var s=ao(this,e),i=s.tween;if(i!==n){r=n=i;for(var l=0,c=r.length;l<c;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}s.tween=r}}function Vne(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var i=ao(this,e),l=i.tween;if(l!==r){s=(r=l).slice();for(var c={name:t,value:n},u=0,d=s.length;u<d;++u)if(s[u].name===t){s[u]=c;break}u===d&&s.push(c)}i.tween=s}}function Une(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Oi(this.node(),n).tween,s=0,i=r.length,l;s<i;++s)if((l=r[s]).name===e)return l.value;return null}return this.each((t==null?$ne:Vne)(n,e,t))}function QC(e,t,n){var r=e._id;return e.each(function(){var s=ao(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Oi(s,r).value[t]}}function hz(e,t){var n;return(typeof t=="number"?Zi:t instanceof Fc?ly:(n=Fc(t))?(t=n,ly):oz)(e,t)}function qne(e){return function(){this.removeAttribute(e)}}function Gne(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kne(e,t,n){var r,s=n+"",i;return function(){var l=this.getAttribute(e);return l===s?null:l===r?i:i=t(r=l,n)}}function Yne(e,t,n){var r,s=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===s?null:l===r?i:i=t(r=l,n)}}function Wne(e,t,n){var r,s,i;return function(){var l,c=n(this),u;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),u=c+"",l===u?null:l===r&&u===s?i:(s=u,i=t(r=l,c)))}}function Xne(e,t,n){var r,s,i;return function(){var l,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),u=c+"",l===u?null:l===r&&u===s?i:(s=u,i=t(r=l,c)))}}function Qne(e,t){var n=xx(e),r=n==="transform"?Mne:hz;return this.attrTween(e,typeof t=="function"?(n.local?Xne:Wne)(n,r,QC(this,"attr."+e,t)):t==null?(n.local?Gne:qne)(n):(n.local?Yne:Kne)(n,r,t))}function Zne(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Jne(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ere(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Jne(e,i)),n}return s._value=t,s}function tre(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Zne(e,i)),n}return s._value=t,s}function nre(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=xx(e);return this.tween(n,(r.local?ere:tre)(r,t))}function rre(e,t){return function(){XC(this,e).delay=+t.apply(this,arguments)}}function sre(e,t){return t=+t,function(){XC(this,e).delay=t}}function ire(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rre:sre)(t,e)):Oi(this.node(),t).delay}function ore(e,t){return function(){ao(this,e).duration=+t.apply(this,arguments)}}function lre(e,t){return t=+t,function(){ao(this,e).duration=t}}function are(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ore:lre)(t,e)):Oi(this.node(),t).duration}function cre(e,t){if(typeof t!="function")throw new Error;return function(){ao(this,e).ease=t}}function ure(e){var t=this._id;return arguments.length?this.each(cre(t,e)):Oi(this.node(),t).ease}function fre(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ao(this,e).ease=n}}function dre(e){if(typeof e!="function")throw new Error;return this.each(fre(this._id,e))}function hre(e){typeof e!="function"&&(e=U4(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],l=i.length,c=r[s]=[],u,d=0;d<l;++d)(u=i[d])&&e.call(u,u.__data__,d,i)&&c.push(u);return new il(r,this._parents,this._name,this._id)}function pre(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,i=Math.min(r,s),l=new Array(r),c=0;c<i;++c)for(var u=t[c],d=n[c],h=u.length,m=l[c]=new Array(h),g,y=0;y<h;++y)(g=u[y]||d[y])&&(m[y]=g);for(;c<r;++c)l[c]=t[c];return new il(l,this._parents,this._name,this._id)}function mre(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function gre(e,t,n){var r,s,i=mre(t)?XC:ao;return function(){var l=i(this,e),c=l.on;c!==r&&(s=(r=c).copy()).on(t,n),l.on=s}}function yre(e,t){var n=this._id;return arguments.length<2?Oi(this.node(),n).on.on(e):this.each(gre(n,e,t))}function xre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bre(){return this.on("end.remove",xre(this._id))}function vre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qC(e));for(var r=this._groups,s=r.length,i=new Array(s),l=0;l<s;++l)for(var c=r[l],u=c.length,d=i[l]=new Array(u),h,m,g=0;g<u;++g)(h=c[g])&&(m=e.call(h,h.__data__,g,c))&&("__data__"in h&&(m.__data__=h.__data__),d[g]=m,vx(d[g],t,n,g,d,Oi(h,n)));return new il(i,this._parents,t,n)}function Sre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=V4(e));for(var r=this._groups,s=r.length,i=[],l=[],c=0;c<s;++c)for(var u=r[c],d=u.length,h,m=0;m<d;++m)if(h=u[m]){for(var g=e.call(h,h.__data__,m,u),y,b=Oi(h,n),w=0,E=g.length;w<E;++w)(y=g[w])&&vx(y,t,n,w,g,b);i.push(g),l.push(h)}return new il(i,l,t,n)}var wre=tm.prototype.constructor;function Ere(){return new wre(this._groups,this._parents)}function Cre(e,t){var n,r,s;return function(){var i=Kf(this,e),l=(this.style.removeProperty(e),Kf(this,e));return i===l?null:i===n&&l===r?s:s=t(n=i,r=l)}}function pz(e){return function(){this.style.removeProperty(e)}}function Nre(e,t,n){var r,s=n+"",i;return function(){var l=Kf(this,e);return l===s?null:l===r?i:i=t(r=l,n)}}function Tre(e,t,n){var r,s,i;return function(){var l=Kf(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),Kf(this,e))),l===u?null:l===r&&u===s?i:(s=u,i=t(r=l,c))}}function Rre(e,t){var n,r,s,i="style."+t,l="end."+i,c;return function(){var u=ao(this,e),d=u.on,h=u.value[i]==null?c||(c=pz(t)):void 0;(d!==n||s!==h)&&(r=(n=d).copy()).on(l,s=h),u.on=r}}function Ore(e,t,n){var r=(e+="")=="transform"?kne:hz;return t==null?this.styleTween(e,Cre(e,r)).on("end.style."+e,pz(e)):typeof t=="function"?this.styleTween(e,Tre(e,r,QC(this,"style."+e,t))).each(Rre(this._id,e)):this.styleTween(e,Nre(e,r,t),n).on("end.style."+e,null)}function kre(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Mre(e,t,n){var r,s;function i(){var l=t.apply(this,arguments);return l!==s&&(r=(s=l)&&kre(e,l,n)),r}return i._value=t,i}function Are(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Mre(e,t,n??""))}function _re(e){return function(){this.textContent=e}}function Dre(e){return function(){var t=e(this);this.textContent=t??""}}function Ire(e){return this.tween("text",typeof e=="function"?Dre(QC(this,"text",e)):_re(e==null?"":e+""))}function jre(e){return function(t){this.textContent=e.call(this,t)}}function Lre(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&jre(s)),t}return r._value=e,r}function Pre(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Lre(e))}function zre(){for(var e=this._name,t=this._id,n=mz(),r=this._groups,s=r.length,i=0;i<s;++i)for(var l=r[i],c=l.length,u,d=0;d<c;++d)if(u=l[d]){var h=Oi(u,t);vx(u,e,n,d,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new il(r,this._parents,e,n)}function Bre(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(i,l){var c={value:l},u={value:function(){--s===0&&i()}};n.each(function(){var d=ao(this,r),h=d.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),d.on=t}),s===0&&i()})}var Hre=0;function il(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function mz(){return++Hre}var Ao=tm.prototype;il.prototype={constructor:il,select:vre,selectAll:Sre,selectChild:Ao.selectChild,selectChildren:Ao.selectChildren,filter:hre,merge:pre,selection:Ere,transition:zre,call:Ao.call,nodes:Ao.nodes,node:Ao.node,size:Ao.size,empty:Ao.empty,each:Ao.each,on:yre,attr:Qne,attrTween:nre,style:Ore,styleTween:Are,text:Ire,textTween:Pre,remove:bre,tween:Une,delay:ire,duration:are,ease:ure,easeVarying:dre,end:Bre,[Symbol.iterator]:Ao[Symbol.iterator]};function Fre(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $re={time:null,delay:0,duration:250,ease:Fre};function Vre(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ure(e){var t,n;e instanceof il?(t=e._id,e=e._name):(t=mz(),(n=$re).time=WC(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var l=r[i],c=l.length,u,d=0;d<c;++d)(u=l[d])&&vx(u,e,t,d,l,n||Vre(u,t));return new il(r,this._parents,e,t)}tm.prototype.interrupt=Fne;tm.prototype.transition=Ure;const Jg=e=>()=>e;function qre(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Fo(e,t,n){this.k=e,this.x=t,this.y=n}Fo.prototype={constructor:Fo,scale:function(e){return e===1?this:new Fo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Sx=new Fo(1,0,0);gz.prototype=Fo.prototype;function gz(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sx;return e.__zoom}function YS(e){e.stopImmediatePropagation()}function mh(e){e.preventDefault(),e.stopImmediatePropagation()}function Gre(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Kre(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function zA(){return this.__zoom||Sx}function Yre(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Wre(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xre(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function yz(){var e=Gre,t=Kre,n=Xre,r=Yre,s=Wre,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,u=k0,d=yx("start","zoom","end"),h,m,g,y=500,b=150,w=0,E=10;function C(j){j.property("__zoom",zA).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",P).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(j,B,L,$){var q=j.selection?j.selection():j;q.property("__zoom",zA),j!==q?M(j,B,L,$):q.interrupt().each(function(){D(this,arguments).event($).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},C.scaleBy=function(j,B,L,$){C.scaleTo(j,function(){var q=this.__zoom.k,G=typeof B=="function"?B.apply(this,arguments):B;return q*G},L,$)},C.scaleTo=function(j,B,L,$){C.transform(j,function(){var q=t.apply(this,arguments),G=this.__zoom,W=L==null?R(q):typeof L=="function"?L.apply(this,arguments):L,Z=G.invert(W),re=typeof B=="function"?B.apply(this,arguments):B;return n(N(T(G,re),W,Z),q,l)},L,$)},C.translateBy=function(j,B,L,$){C.transform(j,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),l)},null,$)},C.translateTo=function(j,B,L,$,q){C.transform(j,function(){var G=t.apply(this,arguments),W=this.__zoom,Z=$==null?R(G):typeof $=="function"?$.apply(this,arguments):$;return n(Sx.translate(Z[0],Z[1]).scale(W.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof L=="function"?-L.apply(this,arguments):-L),G,l)},$,q)};function T(j,B){return B=Math.max(i[0],Math.min(i[1],B)),B===j.k?j:new Fo(B,j.x,j.y)}function N(j,B,L){var $=B[0]-L[0]*j.k,q=B[1]-L[1]*j.k;return $===j.x&&q===j.y?j:new Fo(j.k,$,q)}function R(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function M(j,B,L,$){j.on("start.zoom",function(){D(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event($).end()}).tween("zoom",function(){var q=this,G=arguments,W=D(q,G).event($),Z=t.apply(q,G),re=L==null?R(Z):typeof L=="function"?L.apply(q,G):L,de=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),F=q.__zoom,X=typeof B=="function"?B.apply(q,G):B,te=u(F.invert(re).concat(de/F.k),X.invert(re).concat(de/X.k));return function(J){if(J===1)J=X;else{var K=te(J),ce=de/K[2];J=new Fo(ce,re[0]-K[0]*ce,re[1]-K[1]*ce)}W.zoom(null,J)}})}function D(j,B,L){return!L&&j.__zooming||new k(j,B)}function k(j,B){this.that=j,this.args=B,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,B),this.taps=0}k.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,B){return this.mouse&&j!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var B=Is(this.that).datum();d.call(j,this.that,new qre(j,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:d}),B)}};function I(j,...B){if(!e.apply(this,arguments))return;var L=D(this,B).event(j),$=this.__zoom,q=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),G=gi(j);if(L.wheel)(L.mouse[0][0]!==G[0]||L.mouse[0][1]!==G[1])&&(L.mouse[1]=$.invert(L.mouse[0]=G)),clearTimeout(L.wheel);else{if($.k===q)return;L.mouse=[G,$.invert(G)],_0(this),L.start()}mh(j),L.wheel=setTimeout(W,b),L.zoom("mouse",n(N(T($,q),L.mouse[0],L.mouse[1]),L.extent,l));function W(){L.wheel=null,L.end()}}function _(j,...B){if(g||!e.apply(this,arguments))return;var L=j.currentTarget,$=D(this,B,!0).event(j),q=Is(j.view).on("mousemove.zoom",re,!0).on("mouseup.zoom",de,!0),G=gi(j,L),W=j.clientX,Z=j.clientY;ez(j.view),YS(j),$.mouse=[G,this.__zoom.invert(G)],_0(this),$.start();function re(F){if(mh(F),!$.moved){var X=F.clientX-W,te=F.clientY-Z;$.moved=X*X+te*te>w}$.event(F).zoom("mouse",n(N($.that.__zoom,$.mouse[0]=gi(F,L),$.mouse[1]),$.extent,l))}function de(F){q.on("mousemove.zoom mouseup.zoom",null),tz(F.view,$.moved),mh(F),$.event(F).end()}}function P(j,...B){if(e.apply(this,arguments)){var L=this.__zoom,$=gi(j.changedTouches?j.changedTouches[0]:j,this),q=L.invert($),G=L.k*(j.shiftKey?.5:2),W=n(N(T(L,G),$,q),t.apply(this,B),l);mh(j),c>0?Is(this).transition().duration(c).call(M,W,$,j):Is(this).call(C.transform,W,$,j)}}function H(j,...B){if(e.apply(this,arguments)){var L=j.touches,$=L.length,q=D(this,B,j.changedTouches.length===$).event(j),G,W,Z,re;for(YS(j),W=0;W<$;++W)Z=L[W],re=gi(Z,this),re=[re,this.__zoom.invert(re),Z.identifier],q.touch0?!q.touch1&&q.touch0[2]!==re[2]&&(q.touch1=re,q.taps=0):(q.touch0=re,G=!0,q.taps=1+!!h);h&&(h=clearTimeout(h)),G&&(q.taps<2&&(m=re[0],h=setTimeout(function(){h=null},y)),_0(this),q.start())}}function z(j,...B){if(this.__zooming){var L=D(this,B).event(j),$=j.changedTouches,q=$.length,G,W,Z,re;for(mh(j),G=0;G<q;++G)W=$[G],Z=gi(W,this),L.touch0&&L.touch0[2]===W.identifier?L.touch0[0]=Z:L.touch1&&L.touch1[2]===W.identifier&&(L.touch1[0]=Z);if(W=L.that.__zoom,L.touch1){var de=L.touch0[0],F=L.touch0[1],X=L.touch1[0],te=L.touch1[1],J=(J=X[0]-de[0])*J+(J=X[1]-de[1])*J,K=(K=te[0]-F[0])*K+(K=te[1]-F[1])*K;W=T(W,Math.sqrt(J/K)),Z=[(de[0]+X[0])/2,(de[1]+X[1])/2],re=[(F[0]+te[0])/2,(F[1]+te[1])/2]}else if(L.touch0)Z=L.touch0[0],re=L.touch0[1];else return;L.zoom("touch",n(N(W,Z,re),L.extent,l))}}function U(j,...B){if(this.__zooming){var L=D(this,B).event(j),$=j.changedTouches,q=$.length,G,W;for(YS(j),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),G=0;G<q;++G)W=$[G],L.touch0&&L.touch0[2]===W.identifier?delete L.touch0:L.touch1&&L.touch1[2]===W.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(W=gi(W,this),Math.hypot(m[0]-W[0],m[1]-W[1])<E)){var Z=Is(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return C.wheelDelta=function(j){return arguments.length?(r=typeof j=="function"?j:Jg(+j),C):r},C.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Jg(!!j),C):e},C.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:Jg(!!j),C):s},C.extent=function(j){return arguments.length?(t=typeof j=="function"?j:Jg([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),C):t},C.scaleExtent=function(j){return arguments.length?(i[0]=+j[0],i[1]=+j[1],C):[i[0],i[1]]},C.translateExtent=function(j){return arguments.length?(l[0][0]=+j[0][0],l[1][0]=+j[1][0],l[0][1]=+j[0][1],l[1][1]=+j[1][1],C):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},C.constrain=function(j){return arguments.length?(n=j,C):n},C.duration=function(j){return arguments.length?(c=+j,C):c},C.interpolate=function(j){return arguments.length?(u=j,C):u},C.on=function(){var j=d.on.apply(d,arguments);return j===d?C:j},C.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,C):Math.sqrt(w)},C.tapDistance=function(j){return arguments.length?(E=+j,C):E},C}const Ti={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},fp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],xz=["Enter"," ","Escape"],bz={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Wf;(function(e){e.Strict="strict",e.Loose="loose"})(Wf||(Wf={}));var Dc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Dc||(Dc={}));var dp;(function(e){e.Partial="partial",e.Full="full"})(dp||(dp={}));const vz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Xl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Xl||(Xl={}));var fy;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(fy||(fy={}));var qe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(qe||(qe={}));const BA={[qe.Left]:qe.Right,[qe.Right]:qe.Left,[qe.Top]:qe.Bottom,[qe.Bottom]:qe.Top},Sz=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Qre=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZC=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rm=(e,t=[0,0])=>{const{width:n,height:r}=ki(e),s=e.origin??t,i=n*s[0],l=r*s[1];return{x:e.position.x-i,y:e.position.y-l}},Zre=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((s,i)=>{const l=typeof i=="string";let c=!t.nodeLookup&&!l?i:void 0;return t.nodeLookup&&(c=l?t.nodeLookup.get(i):ZC(i)?i:t.nodeLookup.get(i.id)),c?(n=!0,wx(s,dy(c,t.nodeOrigin))):s},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Ex(r):{x:0,y:0,width:0,height:0}},sm=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=wx(n,dy(s)),r=!0)}),r?Ex(n):{x:0,y:0,width:0,height:0}},JC=(e,t,[n,r,s]=[0,0,1],i=!1,l=!1)=>{const c=(t.x-n)/s,u=(t.y-r)/s,d=t.width/s,h=t.height/s,m=[];for(const g of e.values()){const{measured:y,selectable:b=!0,hidden:w=!1}=g;if(l&&!b||w)continue;const E=y.width??g.width??g.initialWidth??0,C=y.height??g.height??g.initialHeight??0,{x:T,y:N}=g.internals.positionAbsolute,R=Nz(c,u,d,h,T,N,E,C),M=E*C,D=i&&R>0;(!g.internals.handleBounds||D||R>=M||g.dragging)&&m.push(g)}return m},Jre=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function ese(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:l,height:c}=ki(s);i=l>0&&c>0}else i=!!(s.measured.width&&s.measured.height&&!s.hidden);i&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function tse({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},l){if(e.size===0)return!0;const c=ese(e,l),u=sm(c),d=t2(u,t,n,(l==null?void 0:l.minZoom)??s,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await r.setViewport(d,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function wz({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:u,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},h=l.origin??r;let m=l.extent||s;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Ti.error005());else{const{width:y,height:b}=ki(c);y&&b&&(m=[[u,d],[u+y,d+b]])}else c&&Uc(l.extent)&&(m=[[l.extent[0][0]+u,l.extent[0][1]+d],[l.extent[1][0]+u,l.extent[1][1]+d]]);const g=Uc(m)?Vc(t,m,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(i==null||i("015",Ti.error015())),{position:{x:g.x-u+(l.measured.width??0)*h[0],y:g.y-d+(l.measured.height??0)*h[1]},positionAbsolute:g}}async function nse({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(g=>g.id)),l=[];for(const g of n){if(g.deletable===!1)continue;const y=i.has(g.id),b=!y&&g.parentId&&l.find(w=>w.id===g.parentId);(y||b)&&l.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),h=Jre(l,u);for(const g of u)c.has(g.id)&&!h.find(b=>b.id===g.id)&&h.push(g);if(!s)return{edges:h,nodes:l};const m=await s({nodes:l,edges:h});return typeof m=="boolean"?m?{edges:h,nodes:l}:{edges:[],nodes:[]}:m}const Xf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vc=(e={x:0,y:0},t,n)=>({x:Xf(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Xf(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ez(e,t,n){const{width:r,height:s}=ki(n),{x:i,y:l}=n.internals.positionAbsolute;return Vc(e,[[i,l],[i+r,l+s]],t)}const HA=(e,t,n)=>e<t?Xf(Math.abs(e-t),1,t)/t:e>n?-Xf(Math.abs(e-n),1,t)/t:0,e2=(e,t,n=15,r=40)=>{const s=HA(e.x,r,t.width-r)*n,i=HA(e.y,r,t.height-r)*n;return[s,i]},wx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ow=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ex=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),hp=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=ZC(e)?e.internals.positionAbsolute:rm(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},dy=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=ZC(e)?e.internals.positionAbsolute:rm(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Cz=(e,t)=>Ex(wx(Ow(e),Ow(t))),Nz=(e,t,n,r,s,i,l,c)=>{const u=Math.max(0,Math.min(e+n,s+l)-Math.max(e,s)),d=Math.max(0,Math.min(t+r,i+c)-Math.max(t,i));return Math.ceil(u*d)},hy=(e,t)=>Nz(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),FA=e=>bi(e.width)&&bi(e.height)&&bi(e.x)&&bi(e.y),bi=e=>!isNaN(e)&&isFinite(e),Tz=(e,t)=>(n,r)=>{},im=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),om=({x:e,y:t},[n,r,s],i=!1,l=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return i?im(c,l):c},Qf=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function ef(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function rse(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ef(e,n),s=ef(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=ef(e.top??e.y??0,n),s=ef(e.bottom??e.y??0,n),i=ef(e.left??e.x??0,t),l=ef(e.right??e.x??0,t);return{top:r,right:l,bottom:s,left:i,x:i+l,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function sse(e,t,n,r,s,i){const{x:l,y:c}=Qf(e,[t,n,r]),{x:u,y:d}=Qf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,m=i-d;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(m)}}const t2=(e,t,n,r,s,i)=>{const l=rse(i,t,n),c=(t-l.x)/e.width,u=(n-l.y)/e.height,d=Math.min(c,u),h=Xf(d,r,s),m=e.x+e.width/2,g=e.y+e.height/2,y=t/2-m*h,b=n/2-g*h,w=sse(e,y,b,h,t,n),E={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:y-E.left+E.right,y:b-E.top+E.bottom,zoom:h}},pp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Uc(e){return e!=null&&e!=="parent"}function ki(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Rz(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Oz(e,t={width:0,height:0},n,r,s){const i={...e},l=r.get(n);if(l){const c=l.origin||s;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function $A(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ise(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function ose(e){return{...bz,...e||{}}}function kz(e){return e===null?null:e?"valid":"invalid"}function Hh(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:l}=vi(e),c=om({x:i-((s==null?void 0:s.left)??0),y:l-((s==null?void 0:s.top)??0)},r),{x:u,y:d}=n?im(c,t):c;return{xSnapped:u,ySnapped:d,...c}}const n2=e=>({width:e.offsetWidth,height:e.offsetHeight}),Mz=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},lse=["INPUT","SELECT","TEXTAREA"];function Az(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:lse.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _z=e=>"clientX"in e,vi=(e,t)=>{var i,l;const n=_z(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},VA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:s,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...n2(l)}})};function Dz({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:l,targetControlY:c}){const u=e*.125+s*.375+l*.375+n*.125,d=t*.125+i*.375+c*.375+r*.125,h=Math.abs(u-e),m=Math.abs(d-t);return[u,d,h,m]}function e0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function UA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case qe.Left:return[t-e0(t-r,i),n];case qe.Right:return[t+e0(r-t,i),n];case qe.Top:return[t,n-e0(n-s,i)];case qe.Bottom:return[t,n+e0(s-n,i)]}}function Iz({sourceX:e,sourceY:t,sourcePosition:n=qe.Bottom,targetX:r,targetY:s,targetPosition:i=qe.Top,curvature:l=.25}){const[c,u]=UA({pos:n,x1:e,y1:t,x2:r,y2:s,c:l}),[d,h]=UA({pos:i,x1:r,y1:s,x2:e,y2:t,c:l}),[m,g,y,b]=Dz({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${e},${t} C${c},${u} ${d},${h} ${r},${s}`,m,g,y,b]}function jz({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n<e?n+s:n-s,l=Math.abs(r-t)/2,c=r<t?r+l:r-l;return[i,c,s,l]}function ase({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const l=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return l+c}function cse({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const i=wx(dy(e),dy(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return hy(l,Ex(i))>0}const use=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,fse=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),dse=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Ti.error006()),t;const r=n.getEdgeId||use;let s;return Sz(e)?s={...e}:s={...e,id:r(e)},fse(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Lz({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,l,c]=jz({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,l,c]}const qA={[qe.Left]:{x:-1,y:0},[qe.Right]:{x:1,y:0},[qe.Top]:{x:0,y:-1},[qe.Bottom]:{x:0,y:1}},hse=({source:e,sourcePosition:t=qe.Bottom,target:n})=>t===qe.Left||t===qe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},GA=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function pse({source:e,sourcePosition:t=qe.Bottom,target:n,targetPosition:r=qe.Top,center:s,offset:i,stepPosition:l}){const c=qA[t],u=qA[r],d={x:e.x+c.x*i,y:e.y+c.y*i},h={x:n.x+u.x*i,y:n.y+u.y*i},m=hse({source:d,sourcePosition:t,target:h}),g=m.x!==0?"x":"y",y=m[g];let b=[],w,E;const C={x:0,y:0},T={x:0,y:0},[,,N,R]=jz({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(w=s.x??d.x+(h.x-d.x)*l,E=s.y??(d.y+h.y)/2):(w=s.x??(d.x+h.x)/2,E=s.y??d.y+(h.y-d.y)*l);const I=[{x:w,y:d.y},{x:w,y:h.y}],_=[{x:d.x,y:E},{x:h.x,y:E}];c[g]===y?b=g==="x"?I:_:b=g==="x"?_:I}else{const I=[{x:d.x,y:h.y}],_=[{x:h.x,y:d.y}];if(g==="x"?b=c.x===y?_:I:b=c.y===y?I:_,t===r){const j=Math.abs(e[g]-n[g]);if(j<=i){const B=Math.min(i-1,i-j);c[g]===y?C[g]=(d[g]>e[g]?-1:1)*B:T[g]=(h[g]>n[g]?-1:1)*B}}if(t!==r){const j=g==="x"?"y":"x",B=c[g]===u[j],L=d[j]>h[j],$=d[j]<h[j];(c[g]===1&&(!B&&L||B&&$)||c[g]!==1&&(!B&&$||B&&L))&&(b=g==="x"?I:_)}const P={x:d.x+C.x,y:d.y+C.y},H={x:h.x+T.x,y:h.y+T.y},z=Math.max(Math.abs(P.x-b[0].x),Math.abs(H.x-b[0].x)),U=Math.max(Math.abs(P.y-b[0].y),Math.abs(H.y-b[0].y));z>=U?(w=(P.x+H.x)/2,E=b[0].y):(w=b[0].x,E=(P.y+H.y)/2)}const M={x:d.x+C.x,y:d.y+C.y},D={x:h.x+T.x,y:h.y+T.y};return[[e,...M.x!==b[0].x||M.y!==b[0].y?[M]:[],...b,...D.x!==b[b.length-1].x||D.y!==b[b.length-1].y?[D]:[],n],w,E,N,R]}function mse(e,t,n,r){const s=Math.min(GA(e,t)/2,GA(t,n)/2,r),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+s*d},${l}Q ${i},${l} ${i},${l+s*h}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${l+s*u}Q ${i},${l} ${i+s*c},${l}`}function kw({sourceX:e,sourceY:t,sourcePosition:n=qe.Bottom,targetX:r,targetY:s,targetPosition:i=qe.Top,borderRadius:l=5,centerX:c,centerY:u,offset:d=20,stepPosition:h=.5}){const[m,g,y,b,w]=pse({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:i,center:{x:c,y:u},offset:d,stepPosition:h});let E=`M${m[0].x} ${m[0].y}`;for(let C=1;C<m.length-1;C++)E+=mse(m[C-1],m[C],m[C+1],l);return E+=`L${m[m.length-1].x} ${m[m.length-1].y}`,[E,g,y,b,w]}function KA(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function gse(e){var m;const{sourceNode:t,targetNode:n}=e;if(!KA(t)||!KA(n))return null;const r=t.internals.handleBounds||YA(t.handles),s=n.internals.handleBounds||YA(n.handles),i=WA((r==null?void 0:r.source)??[],e.sourceHandle),l=WA(e.connectionMode===Wf.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!i||!l)return(m=e.onError)==null||m.call(e,"008",Ti.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||qe.Bottom,u=(l==null?void 0:l.position)||qe.Top,d=qc(t,i,c),h=qc(n,l,u);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:u}}function YA(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function qc(e,t,n=qe.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??ki(e);if(r)return{x:s+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case qe.Top:return{x:s+l/2,y:i};case qe.Right:return{x:s+l,y:i+c/2};case qe.Bottom:return{x:s+l/2,y:i+c};case qe.Left:return{x:s,y:i+c/2}}}function WA(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Mw(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function yse(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||r,c.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const d=Mw(u,t);i.has(d)||(l.push({id:d,color:u.color||n,...u}),i.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Pz=1e3,xse=10,r2={nodeOrigin:[0,0],nodeExtent:fp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},bse={...r2,checkEquality:!0};function s2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function vse(e,t,n){const r=s2(r2,n);for(const s of e.values())if(s.parentId)o2(s,e,t,r);else{const i=rm(s,r.nodeOrigin),l=Uc(s.extent)?s.extent:r.nodeExtent,c=Vc(i,l,ki(s));s.internals.positionAbsolute=c}}function Sse(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function i2(e){return e==="manual"}function Aw(e,t,n,r={}){var h,m;const s=s2(bse,r),i={i:0},l=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!i2(s.zIndexMode)?Pz:0;let u=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let y=l.get(g.id);if(s.checkEquality&&g===(y==null?void 0:y.internals.userNode))t.set(g.id,y);else{const b=rm(g,s.nodeOrigin),w=Uc(g.extent)?g.extent:s.nodeExtent,E=Vc(b,w,ki(g));y={...s.defaults,...g,measured:{width:(h=g.measured)==null?void 0:h.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:E,handleBounds:Sse(g,y),z:zz(g,c,s.zIndexMode),userNode:g}},t.set(g.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(u=!1),g.parentId&&o2(y,t,n,r,i),d||(d=g.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:d}}function wse(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function o2(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:c,zIndexMode:u}=s2(r2,r),d=e.parentId,h=t.get(d);if(!h){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wse(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*xse),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const m=i&&!i2(u)?Pz:0,{x:g,y,z:b}=Ese(e,h,l,c,m,u),{positionAbsolute:w}=e.internals,E=g!==w.x||y!==w.y;(E||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:E?{x:g,y}:w,z:b}})}function zz(e,t,n){const r=bi(e.zIndex)?e.zIndex:0;return i2(n)?r:r+(e.selected?t:0)}function Ese(e,t,n,r,s,i){const{x:l,y:c}=t.internals.positionAbsolute,u=ki(e),d=rm(e,n),h=Uc(e.extent)?Vc(d,e.extent,u):d;let m=Vc({x:l+h.x,y:c+h.y},r,u);e.extent==="parent"&&(m=Ez(m,u,t));const g=zz(e,s,i),y=t.internals.z??0;return{x:m.x,y:m.y,z:y>=g?y+1:g}}function l2(e,t,n,r=[0,0]){var l;const s=[],i=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const d=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??hp(u),h=Cz(d,c.rect);i.set(c.parentId,{expandedRect:h,parent:u})}return i.size>0&&i.forEach(({expandedRect:c,parent:u},d)=>{var N;const h=u.internals.positionAbsolute,m=ki(u),g=u.origin??r,y=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,w=Math.max(m.width,Math.round(c.width)),E=Math.max(m.height,Math.round(c.height)),C=(w-m.width)*g[0],T=(E-m.height)*g[1];(y>0||b>0||C||T)&&(s.push({id:d,type:"position",position:{x:u.position.x-y+C,y:u.position.y-b+T}}),(N=n.get(d))==null||N.forEach(R=>{e.some(M=>M.id===R.id)||s.push({id:R.id,type:"position",position:{x:R.position.x+y,y:R.position.y+b}})})),(m.width<c.width||m.height<c.height||y||b)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-C:0),height:E+(b?g[1]*b-T:0)}})}),s}function Cse(e,t,n,r,s,i,l){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const d=[],h=window.getComputedStyle(c),{m22:m}=new window.DOMMatrixReadOnly(h.transform),g=[];for(const y of e.values()){const b=t.get(y.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const w=n2(y.nodeElement),E=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(E||!b.internals.handleBounds||y.force))){const T=y.nodeElement.getBoundingClientRect(),N=Uc(b.extent)?b.extent:i;let{positionAbsolute:R}=b.internals;if(b.parentId&&b.extent==="parent"){const D=t.get(b.parentId);D&&(R=Ez(R,w,D))}else N&&(R=Vc(R,N,w));const M={...b,measured:w,internals:{...b.internals,positionAbsolute:R,handleBounds:{source:VA("source",y.nodeElement,T,m,b.id),target:VA("target",y.nodeElement,T,m,b.id)}}};t.set(b.id,M),b.parentId&&o2(M,t,n,{nodeOrigin:s,zIndexMode:l}),u=!0,E&&(d.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:hp(M,s)}))}}if(g.length>0){const y=l2(g,t,n,s);d.push(...y)}return{changes:d,updatedInternals:u}}async function Nse({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,i]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function XA(e,t,n,r,s,i){let l=s;const c=r.get(l)||new Map;r.set(l,c.set(n,t)),l=`${s}-${e}`;const u=r.get(l)||new Map;if(r.set(l,u.set(n,t)),i){l=`${s}-${e}-${i}`;const d=r.get(l)||new Map;r.set(l,d.set(n,t))}}function Bz(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:l=null,targetHandle:c=null}=r,u={edgeId:r.id,source:s,target:i,sourceHandle:l,targetHandle:c},d=`${s}-${l}--${i}-${c}`,h=`${i}-${c}--${s}-${l}`;XA("source",u,h,e,s,l),XA("target",u,d,e,i,c),t.set(r.id,r)}}function Hz(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Hz(n,t):!1}function QA(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Tse(e,t,n,r){const s=new Map;for(const[i,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!Hz(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&s.set(i,{id:i,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function WS({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,c,u;const s=[];for(const[d,h]of t){const m=(l=n.get(d))==null?void 0:l.internals.userNode;m&&s.push({...m,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:s[0],s]}function Rse({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},l=im(i,t);return{x:l.x-i.x,y:l.y-i.y}}function Ose({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},l=0,c=new Map,u=!1,d={x:0,y:0},h=null,m=!1,g=null,y=!1,b=!1,w=null;function E({noDragClassName:T,handleSelector:N,domNode:R,isSelectable:M,nodeId:D,nodeClickDistance:k=0}){g=Is(R);function I({x:z,y:U}){const{nodeLookup:j,nodeExtent:B,snapGrid:L,snapToGrid:$,nodeOrigin:q,onNodeDrag:G,onSelectionDrag:W,onError:Z,updateNodePositions:re}=t();i={x:z,y:U};let de=!1;const F=c.size>1,X=F&&B?Ow(sm(c)):null,te=F&&$?Rse({dragItems:c,snapGrid:L,x:z,y:U}):null;for(const[J,K]of c){if(!j.has(J))continue;let ce={x:z-K.distance.x,y:U-K.distance.y};$&&(ce=te?{x:Math.round(ce.x+te.x),y:Math.round(ce.y+te.y)}:im(ce,L));let ye=null;if(F&&B&&!K.extent&&X){const{positionAbsolute:xe}=K.internals,Se=xe.x-X.x+B[0][0],ke=xe.x+K.measured.width-X.x2+B[1][0],_e=xe.y-X.y+B[0][1],we=xe.y+K.measured.height-X.y2+B[1][1];ye=[[Se,_e],[ke,we]]}const{position:ge,positionAbsolute:oe}=wz({nodeId:J,nextPosition:ce,nodeLookup:j,nodeExtent:ye||B,nodeOrigin:q,onError:Z});de=de||K.position.x!==ge.x||K.position.y!==ge.y,K.position=ge,K.internals.positionAbsolute=oe}if(b=b||de,!!de&&(re(c,!0),w&&(r||G||!D&&W))){const[J,K]=WS({nodeId:D,dragItems:c,nodeLookup:j});r==null||r(w,c,J,K),G==null||G(w,J,K),D||W==null||W(w,K)}}async function _(){if(!h)return;const{transform:z,panBy:U,autoPanSpeed:j,autoPanOnNodeDrag:B}=t();if(!B){u=!1,cancelAnimationFrame(l);return}const[L,$]=e2(d,h,j);(L!==0||$!==0)&&(i.x=(i.x??0)-L/z[2],i.y=(i.y??0)-$/z[2],await U({x:L,y:$})&&I(i)),l=requestAnimationFrame(_)}function P(z){var F;const{nodeLookup:U,multiSelectionActive:j,nodesDraggable:B,transform:L,snapGrid:$,snapToGrid:q,selectNodesOnDrag:G,onNodeDragStart:W,onSelectionDragStart:Z,unselectNodesAndEdges:re}=t();m=!0,(!G||!M)&&!j&&D&&((F=U.get(D))!=null&&F.selected||re()),M&&G&&D&&(e==null||e(D));const de=Hh(z.sourceEvent,{transform:L,snapGrid:$,snapToGrid:q,containerBounds:h});if(i=de,c=Tse(U,B,de,D),c.size>0&&(n||W||!D&&Z)){const[X,te]=WS({nodeId:D,dragItems:c,nodeLookup:U});n==null||n(z.sourceEvent,c,X,te),W==null||W(z.sourceEvent,X,te),D||Z==null||Z(z.sourceEvent,te)}}const H=nz().clickDistance(k).on("start",z=>{const{domNode:U,nodeDragThreshold:j,transform:B,snapGrid:L,snapToGrid:$}=t();h=(U==null?void 0:U.getBoundingClientRect())||null,y=!1,b=!1,w=z.sourceEvent,j===0&&P(z),i=Hh(z.sourceEvent,{transform:B,snapGrid:L,snapToGrid:$,containerBounds:h}),d=vi(z.sourceEvent,h)}).on("drag",z=>{const{autoPanOnNodeDrag:U,transform:j,snapGrid:B,snapToGrid:L,nodeDragThreshold:$,nodeLookup:q}=t(),G=Hh(z.sourceEvent,{transform:j,snapGrid:B,snapToGrid:L,containerBounds:h});if(w=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||D&&!q.has(D))&&(y=!0),!y){if(!u&&U&&m&&(u=!0,_()),!m){const W=vi(z.sourceEvent,h),Z=W.x-d.x,re=W.y-d.y;Math.sqrt(Z*Z+re*re)>$&&P(z)}(i.x!==G.xSnapped||i.y!==G.ySnapped)&&c&&m&&(d=vi(z.sourceEvent,h),I(G))}}).on("end",z=>{if(!m||y){y&&c.size>0&&t().updateNodePositions(c,!1);return}if(u=!1,m=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:U,updateNodePositions:j,onNodeDragStop:B,onSelectionDragStop:L}=t();if(b&&(j(c,!1),b=!1),s||B||!D&&L){const[$,q]=WS({nodeId:D,dragItems:c,nodeLookup:U,dragging:!1});s==null||s(z.sourceEvent,c,$,q),B==null||B(z.sourceEvent,$,q),D||L==null||L(z.sourceEvent,q)}}}).filter(z=>{const U=z.target;return!z.button&&(!T||!QA(U,`.${T}`,R))&&(!N||QA(U,N,R))});g.call(H)}function C(){g==null||g.on(".drag",null)}return{update:E,destroy:C}}function kse(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())hy(s,hp(i))>0&&r.push(i);return r}const Mse=250;function Ase(e,t,n,r){var c,u;let s=[],i=1/0;const l=kse(e,n,t+Mse);for(const d of l){const h=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const m of h){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:g,y}=qc(d,m,m.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));b>t||(b<i?(s=[{...m,x:g,y}],i=b):b===i&&s.push({...m,x:g,y}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(h=>h.type===d)??s[0]}return s[0]}function Fz(e,t,n,r,s,i=!1){var d,h,m;const l=r.get(e);if(!l)return null;const c=s==="strict"?(d=l.internals.handleBounds)==null?void 0:d[t]:[...((h=l.internals.handleBounds)==null?void 0:h.source)??[],...((m=l.internals.handleBounds)==null?void 0:m.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&i?{...u,...qc(l,u,u.position,!0)}:u}function $z(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function _se(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Vz=()=>!0;function Dse(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:u,lib:d,autoPanOnConnect:h,flowId:m,panBy:g,cancelConnection:y,onConnectStart:b,onConnect:w,onConnectEnd:E,isValidConnection:C=Vz,onReconnectEnd:T,updateConnection:N,getTransform:R,getFromHandle:M,autoPanSpeed:D,dragThreshold:k=1,handleDomNode:I}){const _=Mz(e.target);let P=0,H;const{x:z,y:U}=vi(e),j=$z(i,I),B=c==null?void 0:c.getBoundingClientRect();let L=!1;if(!B||!j)return;const $=Fz(s,j,r,u,t);if(!$)return;let q=vi(e,B),G=!1,W=null,Z=!1,re=null;function de(){if(!h||!B)return;const[ge,oe]=e2(q,B,D);g({x:ge,y:oe}),P=requestAnimationFrame(de)}const F={...$,nodeId:s,type:j,position:$.position},X=u.get(s);let J={inProgress:!0,isValid:null,from:qc(X,F,qe.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:X,to:q,toHandle:null,toPosition:BA[F.position],toNode:null,pointer:q};function K(){L=!0,N(J),b==null||b(e,{nodeId:s,handleId:r,handleType:j})}k===0&&K();function ce(ge){if(!L){const{x:we,y:Re}=vi(ge),Ae=we-z,Le=Re-U;if(!(Ae*Ae+Le*Le>k*k))return;K()}if(!M()||!F){ye(ge);return}const oe=R();q=vi(ge,B),H=Ase(om(q,oe,!1,[1,1]),n,u,F),G||(de(),G=!0);const xe=Uz(ge,{handle:H,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:l?"target":"source",isValidConnection:C,doc:_,lib:d,flowId:m,nodeLookup:u});re=xe.handleDomNode,W=xe.connection,Z=_se(!!H,xe.isValid);const Se=u.get(s),ke=Se?qc(Se,F,qe.Left,!0):J.from,_e={...J,from:ke,isValid:Z,to:xe.toHandle&&Z?Qf({x:xe.toHandle.x,y:xe.toHandle.y},oe):q,toHandle:xe.toHandle,toPosition:Z&&xe.toHandle?xe.toHandle.position:BA[F.position],toNode:xe.toHandle?u.get(xe.toHandle.nodeId):null,pointer:q};N(_e),J=_e}function ye(ge){if(!("touches"in ge&&ge.touches.length>0)){if(L){(H||re)&&W&&Z&&(w==null||w(W));const{inProgress:oe,...xe}=J,Se={...xe,toPosition:J.toHandle?J.toPosition:null};E==null||E(ge,Se),i&&(T==null||T(ge,Se))}y(),cancelAnimationFrame(P),G=!1,Z=!1,W=null,re=null,_.removeEventListener("mousemove",ce),_.removeEventListener("mouseup",ye),_.removeEventListener("touchmove",ce),_.removeEventListener("touchend",ye)}}_.addEventListener("mousemove",ce),_.addEventListener("mouseup",ye),_.addEventListener("touchmove",ce),_.addEventListener("touchend",ye)}function Uz(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:l,lib:c,flowId:u,isValidConnection:d=Vz,nodeLookup:h}){const m=i==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:b}=vi(e),w=l.elementFromPoint(y,b),E=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,C={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const T=$z(void 0,E),N=E.getAttribute("data-nodeid"),R=E.getAttribute("data-handleid"),M=E.classList.contains("connectable"),D=E.classList.contains("connectableend");if(!N||!T)return C;const k={source:m?N:r,sourceHandle:m?R:s,target:m?r:N,targetHandle:m?s:R};C.connection=k;const _=M&&D&&(n===Wf.Strict?m&&T==="source"||!m&&T==="target":N!==r||R!==s);C.isValid=_&&d(k),C.toHandle=Fz(N,T,R,h,n,!0)}return C}const _w={onPointerDown:Dse,isValid:Uz};function Ise({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Is(e);function i({translateExtent:c,width:u,height:d,zoomStep:h=1,pannable:m=!0,zoomable:g=!0,inversePan:y=!1}){const b=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const R=n(),M=N.sourceEvent.ctrlKey&&pp()?10:1,D=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*h,k=R[2]*Math.pow(2,D*M);t.scaleTo(k)};let w=[0,0];const E=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(w=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},C=N=>{const R=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const M=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],D=[M[0]-w[0],M[1]-w[1]];w=M;const k=r()*Math.max(R[2],Math.log(R[2]))*(y?-1:1),I={x:R[0]-D[0]*k,y:R[1]-D[1]*k},_=[[0,0],[u,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:R[2]},_,c)},T=yz().on("start",E).on("zoom",m?C:null).on("zoom.wheel",g?b:null);s.call(T,{})}function l(){s.on("zoom",null)}return{update:i,destroy:l,pointer:gi}}const Cx=e=>({x:e.x,y:e.y,zoom:e.k}),XS=({x:e,y:t,zoom:n})=>Sx.translate(e,t).scale(n),Kl=(e,t)=>e.target.closest(`.${t}`),qz=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jse=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,QS=(e,t=0,n=jse,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},Gz=e=>{const t=e.ctrlKey&&pp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Lse({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}){return h=>{if(Kl(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(h.ctrlKey&&l){const E=gi(h),C=Gz(h),T=m*Math.pow(2,C);r.scaleTo(n,T,E,h);return}const g=h.deltaMode===1?20:1;let y=s===Dc.Vertical?0:h.deltaX*g,b=s===Dc.Horizontal?0:h.deltaY*g;!pp()&&h.shiftKey&&s!==Dc.Vertical&&(y=h.deltaY*g,b=0),r.translateBy(n,-(y/m)*i,-(b/m)*i,{internal:!0});const w=Cx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?u==null||u(h,w):(e.isPanScrolling=!0,c==null||c(h,w)),e.panScrollTimeout=setTimeout(()=>{d==null||d(h,w),e.isPanScrolling=!1},150)}}function Pse({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",l=!t&&i&&!r.ctrlKey,c=Kl(r,e);if(r.ctrlKey&&i&&c&&r.preventDefault(),l||c)return null;r.preventDefault(),n.call(this,r,s)}}function zse({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,l,c;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Cx(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Bse({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&qz(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((c=i.sourceEvent)!=null&&c.internal)&&(s==null||s(i.sourceEvent,Cx(i.transform)))}}function Hse({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&qz(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Cx(l.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(l.sourceEvent,u)},n?150:0)}}}function Fse({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:i,zoomOnDoubleClick:l,userSelectionActive:c,noWheelClassName:u,noPanClassName:d,lib:h,connectionInProgress:m}){return g=>{var C;const y=t||n,b=r&&g.ctrlKey,w=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Kl(g,`${h}-flow__node`)||Kl(g,`${h}-flow__edge`)||Kl(g,`${h}-flow__selection`)||Kl(g,`${h}-flow__nodesselection`)))return!0;if(!s&&!y&&!i&&!l&&!r||c||m&&!w||Kl(g,u)&&w||Kl(g,d)&&(!w||i&&w&&!t)||!r&&g.ctrlKey&&w)return!1;if(!r&&g.type==="touchstart"&&((C=g.touches)==null?void 0:C.length)>1)return g.preventDefault(),!1;if(!y&&!i&&!b&&w||!s&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(s)&&!s.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(s)&&s.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||w||e)&&E}}function $se({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect();let m=[[0,0],[h.width,h.height]];const g=typeof ResizeObserver<"u"?new ResizeObserver(U=>{const j=U[0];j&&(m=[[0,0],[j.contentRect.width,j.contentRect.height]])}):null;g==null||g.observe(e);const y=yz().extent(()=>m).scaleExtent([t,n]).translateExtent(r),b=Is(e).call(y);R({x:s.x,y:s.y,zoom:Xf(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const w=b.on("wheel.zoom"),E=b.on("dblclick.zoom");y.wheelDelta(Gz);async function C(U,j){return b?new Promise(B=>{y==null||y.interpolate((j==null?void 0:j.interpolate)==="linear"?Bh:k0).transform(QS(b,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),U)}):!1}function T({noWheelClassName:U,noPanClassName:j,onPaneContextMenu:B,userSelectionActive:L,panOnScroll:$,panOnDrag:q,panOnScrollMode:G,panOnScrollSpeed:W,preventScrolling:Z,zoomOnPinch:re,zoomOnScroll:de,zoomOnDoubleClick:F,panActivationKeyPressed:X=!1,zoomActivationKeyPressed:te,lib:J,onTransformChange:K,connectionInProgress:ce,paneClickDistance:ye,selectionOnDrag:ge}){L&&!d.isZoomingOrPanning&&N();const oe=$&&!te&&!L;y.clickDistance(ge?1/0:!bi(ye)||ye<0?0:ye);const xe=oe?Lse({zoomPanValues:d,noWheelClassName:U,d3Selection:b,d3Zoom:y,panOnScrollMode:G,panOnScrollSpeed:W,zoomOnPinch:re,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:c}):Pse({noWheelClassName:U,preventScrolling:Z,d3ZoomHandler:w});b.on("wheel.zoom",xe,{passive:!1});const Se=zse({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:l});y.on("start",Se);const ke=Bse({zoomPanValues:d,panOnDrag:q,onPaneContextMenu:!!B,onPanZoom:i,onTransformChange:K});y.on("zoom",ke);const _e=Hse({zoomPanValues:d,panOnDrag:q,panOnScroll:$,onPaneContextMenu:B,onPanZoomEnd:c,onDraggingChange:u});y.on("end",_e);const we=Fse({panActivationKeyPressed:X,zoomActivationKeyPressed:te,panOnDrag:q,zoomOnScroll:de,panOnScroll:$,zoomOnDoubleClick:F,zoomOnPinch:re,userSelectionActive:L,noPanClassName:j,noWheelClassName:U,lib:J,connectionInProgress:ce});y.filter(we),F?b.on("dblclick.zoom",E):b.on("dblclick.zoom",null)}function N(){y.on("zoom",null)}async function R(U,j,B){const L=XS(U),$=y==null?void 0:y.constrain()(L,j,B);return $&&await C($),$}async function M(U,j){const B=XS(U);return await C(B,j),B}function D(U){if(b){const j=XS(U),B=b.property("__zoom");(B.k!==U.zoom||B.x!==U.x||B.y!==U.y)&&(y==null||y.transform(b,j,null,{sync:!0}))}}function k(){const U=b?gz(b.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}async function I(U,j){return b?new Promise(B=>{y==null||y.interpolate((j==null?void 0:j.interpolate)==="linear"?Bh:k0).scaleTo(QS(b,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),U)}):!1}async function _(U,j){return b?new Promise(B=>{y==null||y.interpolate((j==null?void 0:j.interpolate)==="linear"?Bh:k0).scaleBy(QS(b,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),U)}):!1}function P(U){y==null||y.scaleExtent(U)}function H(U){y==null||y.translateExtent(U)}function z(U){const j=!bi(U)||U<0?0:U;y==null||y.clickDistance(j)}return{update:T,destroy:N,setViewport:M,setViewportConstrained:R,getViewport:k,scaleTo:I,scaleBy:_,setScaleExtent:P,setTranslateExtent:H,syncViewport:D,setClickDistance:z}}var Zf;(function(e){e.Line="line",e.Handle="handle"})(Zf||(Zf={}));function Vse({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const l=e-t,c=n-r,u=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&s&&(u[0]=u[0]*-1),c&&i&&(u[1]=u[1]*-1),u}function ZA(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function $l(e,t){return Math.max(0,t-e)}function Vl(e,t){return Math.max(0,e-t)}function t0(e,t,n){return Math.max(0,t-e,e-n)}function JA(e,t){return e?!t:t}function Use(e,t,n,r,s,i,l,c){let{affectsX:u,affectsY:d}=t;const{isHorizontal:h,isVertical:m}=t,g=h&&m,{xSnapped:y,ySnapped:b}=n,{minWidth:w,maxWidth:E,minHeight:C,maxHeight:T}=r,{x:N,y:R,width:M,height:D,aspectRatio:k}=e;let I=Math.floor(h?y-e.pointerX:0),_=Math.floor(m?b-e.pointerY:0);const P=M+(u?-I:I),H=D+(d?-_:_),z=-i[0]*M,U=-i[1]*D;let j=t0(P,w,E),B=t0(H,C,T);if(l){let q=0,G=0;u&&I<0?q=$l(N+I+z,l[0][0]):!u&&I>0&&(q=Vl(N+P+z,l[1][0])),d&&_<0?G=$l(R+_+U,l[0][1]):!d&&_>0&&(G=Vl(R+H+U,l[1][1])),j=Math.max(j,q),B=Math.max(B,G)}if(c){let q=0,G=0;u&&I>0?q=Vl(N+I,c[0][0]):!u&&I<0&&(q=$l(N+P,c[1][0])),d&&_>0?G=Vl(R+_,c[0][1]):!d&&_<0&&(G=$l(R+H,c[1][1])),j=Math.max(j,q),B=Math.max(B,G)}if(s){if(h){const q=t0(P/k,C,T)*k;if(j=Math.max(j,q),l){let G=0;!u&&!d||u&&!d&&g?G=Vl(R+U+P/k,l[1][1])*k:G=$l(R+U+(u?I:-I)/k,l[0][1])*k,j=Math.max(j,G)}if(c){let G=0;!u&&!d||u&&!d&&g?G=$l(R+P/k,c[1][1])*k:G=Vl(R+(u?I:-I)/k,c[0][1])*k,j=Math.max(j,G)}}if(m){const q=t0(H*k,w,E)/k;if(B=Math.max(B,q),l){let G=0;!u&&!d||d&&!u&&g?G=Vl(N+H*k+z,l[1][0])/k:G=$l(N+(d?_:-_)*k+z,l[0][0])/k,B=Math.max(B,G)}if(c){let G=0;!u&&!d||d&&!u&&g?G=$l(N+H*k,c[1][0])/k:G=Vl(N+(d?_:-_)*k,c[0][0])/k,B=Math.max(B,G)}}}_=_+(_<0?B:-B),I=I+(I<0?j:-j),s&&(g?P>H*k?_=(JA(u,d)?-I:I)/k:I=(JA(u,d)?-_:_)*k:h?(_=I/k,d=u):(I=_*k,u=d));const L=u?N+I:N,$=d?R+_:R;return{width:M+(u?-I:I),height:D+(d?-_:_),x:i[0]*I*(u?-1:1)+L,y:i[1]*_*(d?-1:1)+$}}const Kz={width:0,height:0,x:0,y:0},qse={...Kz,pointerX:0,pointerY:0,aspectRatio:1};function Gse(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,u=n[1]*l;return[[r-c,s-u],[r+i-c,s+l-u]]}function Kse({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=Is(e);let l={controlDirection:ZA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:h,keepAspectRatio:m,resizeDirection:g,onResizeStart:y,onResize:b,onResizeEnd:w,shouldResize:E}){let C={...Kz},T={...qse};l={boundaries:h,resizeDirection:g,keepAspectRatio:m,controlDirection:ZA(d)};let N,R=null,M=[],D,k,I,_=!1;const P=nz().on("start",H=>{const{nodeLookup:z,transform:U,snapGrid:j,snapToGrid:B,nodeOrigin:L,paneDomNode:$}=n();if(N=z.get(t),!N)return;R=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:G}=Hh(H.sourceEvent,{transform:U,snapGrid:j,snapToGrid:B,containerBounds:R});C={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},T={...C,pointerX:q,pointerY:G,aspectRatio:C.width/C.height},D=void 0,k=Uc(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(D=z.get(N.parentId)),D&&N.extent==="parent"&&(k=[[0,0],[D.measured.width,D.measured.height]]),M=[],I=void 0;for(const[W,Z]of z)if(Z.parentId===t&&(M.push({id:W,position:{...Z.position},extent:Z.extent}),Z.extent==="parent"||Z.expandParent)){const re=Gse(Z,N,Z.origin??L);I?I=[[Math.min(re[0][0],I[0][0]),Math.min(re[0][1],I[0][1])],[Math.max(re[1][0],I[1][0]),Math.max(re[1][1],I[1][1])]]:I=re}y==null||y(H,{...C})}).on("drag",H=>{const{transform:z,snapGrid:U,snapToGrid:j,nodeOrigin:B}=n(),L=Hh(H.sourceEvent,{transform:z,snapGrid:U,snapToGrid:j,containerBounds:R}),$=[];if(!N)return;const{x:q,y:G,width:W,height:Z}=C,re={},de=N.origin??B,{width:F,height:X,x:te,y:J}=Use(T,l.controlDirection,L,l.boundaries,l.keepAspectRatio,de,k,I),K=F!==W,ce=X!==Z,ye=te!==q&&K,ge=J!==G&&ce;if(!ye&&!ge&&!K&&!ce)return;if((ye||ge||de[0]===1||de[1]===1)&&(re.x=ye?te:C.x,re.y=ge?J:C.y,C.x=re.x,C.y=re.y,M.length>0)){const ke=te-q,_e=J-G;for(const we of M)we.position={x:we.position.x-ke+de[0]*(F-W),y:we.position.y-_e+de[1]*(X-Z)},$.push(we)}if((K||ce)&&(re.width=K&&(!l.resizeDirection||l.resizeDirection==="horizontal")?F:C.width,re.height=ce&&(!l.resizeDirection||l.resizeDirection==="vertical")?X:C.height,C.width=re.width,C.height=re.height),D&&N.expandParent){const ke=de[0]*(re.width??0);re.x&&re.x<ke&&(C.x=ke,T.x=T.x-(re.x-ke));const _e=de[1]*(re.height??0);re.y&&re.y<_e&&(C.y=_e,T.y=T.y-(re.y-_e))}const oe=Vse({width:C.width,prevWidth:W,height:C.height,prevHeight:Z,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),xe={...C,direction:oe};(E==null?void 0:E(H,xe))!==!1&&(_=!0,b==null||b(H,xe),r(re,$))}).on("end",H=>{_&&(w==null||w(H,{...C}),s==null||s({...C}),_=!1)});i.call(P)}function u(){i.on(".drag",null)}return{update:c,destroy:u}}const Yse={},e_=e=>{let t;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(Yse?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,s,u);return u},Wse=e=>e?e_(e):e_,{useDebugValue:Xse}=od,{useSyncExternalStoreWithSelector:Qse}=hU,Zse=e=>e;function Yz(e,t=Zse,n){const r=Qse(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Xse(r),r}const t_=(e,t)=>{const n=Wse(e),r=(s,i=t)=>Yz(n,s,i);return Object.assign(r,n),r},Jse=(e,t)=>e?t_(e,t):t_;function Sn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Nx=O.createContext(null),eie=Nx.Provider,Wz=Ti.error001("react");function Mt(e,t){const n=O.useContext(Nx);if(n===null)throw new Error(Wz);return Yz(n,e,t)}function sn(){const e=O.useContext(Nx);if(e===null)throw new Error(Wz);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const n_={display:"none"},tie={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Xz="react-flow__node-desc",Qz="react-flow__edge-desc",nie="react-flow__aria-live",rie=e=>e.ariaLiveMessage,sie=e=>e.ariaLabelConfig;function iie({rfId:e}){const t=Mt(rie);return x.jsx("div",{id:`${nie}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:tie,children:t})}function oie({rfId:e,disableKeyboardA11y:t}){const n=Mt(sie);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${Xz}-${e}`,style:n_,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${Qz}-${e}`,style:n_,children:n["edge.a11yDescription.default"]}),!t&&x.jsx(iie,{rfId:e})]})}const Tx=O.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const l=`${e}`.split("-");return x.jsx("div",{className:$n(["react-flow__panel",n,...l]),style:r,ref:i,...s,children:t})});Tx.displayName="Panel";const r_="https://reactflow.dev?utm_source=attribution";function lie({proOptions:e,position:t="bottom-right"}){return O.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:x.jsx(Tx,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${r_}`,children:x.jsx("a",{href:r_,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aie=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},n0=e=>e.id;function cie(e,t){return Sn(e.selectedNodes.map(n0),t.selectedNodes.map(n0))&&Sn(e.selectedEdges.map(n0),t.selectedEdges.map(n0))}function uie({onSelectionChange:e}){const t=sn(),{selectedNodes:n,selectedEdges:r}=Mt(aie,cie);return O.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const fie=e=>!!e.onSelectionChangeHandlers;function die({onSelectionChange:e}){const t=Mt(fie);return e||t?x.jsx(uie,{onSelectionChange:e}):null}const Zz=[0,0],hie={x:0,y:0,zoom:1},pie=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],s_=[...pie,"rfId"],mie=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),i_={translateExtent:fp,nodeOrigin:Zz,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function gie(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:u}=Mt(mie,Sn),d=sn();O.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=i_,c()}),[]);const h=O.useRef(i_);return O.useEffect(()=>{for(const m of s_){const g=e[m],y=h.current[m];g!==y&&(typeof e[m]>"u"||(m==="nodes"?t(g):m==="edges"?n(g):m==="minZoom"?r(g):m==="maxZoom"?s(g):m==="translateExtent"?i(g):m==="nodeExtent"?l(g):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:ose(g)}):m==="fitView"?d.setState({fitViewQueued:g}):m==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[m]:g})))}h.current=e},s_.map(m=>e[m])),null}function o_(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function yie(e){var r;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const s=o_(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=o_())!=null&&r.matches?"dark":"light"}const l_=typeof document<"u"?document:null;function mp(e=null,t={target:l_,actInsideInputWithModifier:!0}){const[n,r]=O.useState(!1),s=O.useRef(!1),i=O.useRef(new Set([])),[l,c]=O.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace(/\+/g,`
337
- `).replace(`
338
-
339
- `,`
340
- +`).split(`
341
- `)),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[e]);return O.useEffect(()=>{const u=(t==null?void 0:t.target)??l_,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=y=>{var E,C;if(s.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!s.current||s.current&&!d)&&Az(y))return!1;const w=c_(y.code,c);if(i.current.add(y[w]),a_(l,i.current,!1)){const T=((C=(E=y.composedPath)==null?void 0:E.call(y))==null?void 0:C[0])||y.target,N=(T==null?void 0:T.nodeName)==="BUTTON"||(T==null?void 0:T.nodeName)==="A";t.preventDefault!==!1&&(s.current||!N)&&y.preventDefault(),r(!0)}},m=y=>{const b=c_(y.code,c);a_(l,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(y[b]),y.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",m),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",m),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function a_(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function c_(e,t){return t.includes(e)?"code":"key"}const xie=()=>{const e=sn();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),u=t2(t,r,s,i,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:c,y:u}=l.getBoundingClientRect(),d={x:t.x-c,y:t.y-u},h=n.snapGrid??s,m=n.snapToGrid??i;return om(d,r,m,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),l=Qf(t,n);return{x:l.x+s,y:l.y+i}}}),[])};function Jz(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const l=r.get(i.id);l?l.push(i):r.set(i.id,[i])}for(const i of t){const l=r.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const u of l)bie(u,c);n.push(c)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function bie(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function vie(e,t){return Jz(e,t)}function Sie(e,t){return Jz(e,t)}function hc(e,t){return{id:e,type:"select",selected:t}}function hf(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const l=t.has(s);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),r.push(hc(i.id,l)))}return r}function u_({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==l&&n.push({id:l.id,item:l,type:"replace"}),u===void 0&&n.push({item:l,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function f_(e){return{id:e.id,type:"remove"}}const wie=Tz();function Eie(e,t,n={}){return dse(e,t,{...n,onError:n.onError??wie})}const d_=e=>Qre(e),Cie=e=>Sz(e);function e5(e){return O.forwardRef(e)}const t5=typeof window<"u"?O.useLayoutEffect:O.useEffect;function h_(e){const[t,n]=O.useState(BigInt(0)),[r]=O.useState(()=>Nie(()=>n(s=>s+BigInt(1))));return t5(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Nie(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const n5=O.createContext(null);function Tie({children:e}){const t=sn(),n=O.useCallback(c=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:h,onNodesChange:m,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:b}=t.getState();let w=u;for(const C of c)w=typeof C=="function"?C(w):C;let E=u_({items:w,lookup:g});for(const C of b.values())E=C(E);h&&d(w),E.length>0?m==null||m(E):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:T,setNodes:N}=t.getState();C&&N(T)})},[]),r=h_(n),s=O.useCallback(c=>{const{edges:u=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:m,edgeLookup:g}=t.getState();let y=u;for(const b of c)y=typeof b=="function"?b(y):b;h?d(y):m&&m(u_({items:y,lookup:g}))},[]),i=h_(s),l=O.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return x.jsx(n5.Provider,{value:l,children:e})}function Rie(){const e=O.useContext(n5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Oie=e=>!!e.panZoom;function Rx(){const e=xie(),t=sn(),n=Rie(),r=Mt(Oie),s=O.useMemo(()=>{const i=m=>t.getState().nodeLookup.get(m),l=m=>{n.nodeQueue.push(m)},c=m=>{n.edgeQueue.push(m)},u=m=>{var C,T;const{nodeLookup:g,nodeOrigin:y}=t.getState(),b=d_(m)?m:g.get(m.id),w=b.parentId?Oz(b.position,b.measured,b.parentId,g,y):b.position,E={...b,position:w,width:((C=b.measured)==null?void 0:C.width)??b.width,height:((T=b.measured)==null?void 0:T.height)??b.height};return hp(E)},d=(m,g,y={replace:!1})=>{l(b=>b.map(w=>{if(w.id===m){const E=typeof g=="function"?g(w):g;return y.replace&&d_(E)?E:{...w,...E}}return w}))},h=(m,g,y={replace:!1})=>{c(b=>b.map(w=>{if(w.id===m){const E=typeof g=="function"?g(w):g;return y.replace&&Cie(E)?E:{...w,...E}}return w}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>{var g;return(g=i(m))==null?void 0:g.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(g=>({...g}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:l,setEdges:c,addNodes:m=>{const g=Array.isArray(m)?m:[m];n.nodeQueue.push(y=>[...y,...g])},addEdges:m=>{const g=Array.isArray(m)?m:[m];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:m=[],edges:g=[],transform:y}=t.getState(),[b,w,E]=y;return{nodes:m.map(C=>({...C})),edges:g.map(C=>({...C})),viewport:{x:b,y:w,zoom:E}}},deleteElements:async({nodes:m=[],edges:g=[]})=>{const{nodes:y,edges:b,onNodesDelete:w,onEdgesDelete:E,triggerNodeChanges:C,triggerEdgeChanges:T,onDelete:N,onBeforeDelete:R}=t.getState(),{nodes:M,edges:D}=await nse({nodesToRemove:m,edgesToRemove:g,nodes:y,edges:b,onBeforeDelete:R}),k=D.length>0,I=M.length>0;if(k){const _=D.map(f_);E==null||E(D),T(_)}if(I){const _=M.map(f_);w==null||w(M),C(_)}return(I||k)&&(N==null||N({nodes:M,edges:D})),{deletedNodes:M,deletedEdges:D}},getIntersectingNodes:(m,g=!0,y)=>{const b=FA(m),w=b?m:u(m),E=y!==void 0;return w?(y||t.getState().nodes).filter(C=>{const T=t.getState().nodeLookup.get(C.id);if(T&&!b&&(C.id===m.id||!T.internals.positionAbsolute))return!1;const N=hp(E?C:T),R=hy(N,w);return g&&R>0||R>=N.width*N.height||R>=w.width*w.height}):[]},isNodeIntersecting:(m,g,y=!0)=>{const w=FA(m)?m:u(m);if(!w)return!1;const E=hy(w,g);return y&&E>0||E>=g.width*g.height||E>=w.width*w.height},updateNode:d,updateNodeData:(m,g,y={replace:!1})=>{d(m,b=>{const w=typeof g=="function"?g(b):g;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},updateEdge:h,updateEdgeData:(m,g,y={replace:!1})=>{h(m,b=>{const w=typeof g=="function"?g(b):g;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},getNodesBounds:m=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return Zre(m,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:m,id:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}-${m}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:m,handleId:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}${m?g?`-${m}-${g}`:`-${m}`:""}`))==null?void 0:b.values())??[])},fitView:async m=>{const g=t.getState().fitViewResolver??ise();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return O.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const p_=e=>e.selected,kie=typeof window<"u"?window:void 0;function Mie({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=sn(),{deleteElements:r}=Rx(),s=mp(e,{actInsideInputWithModifier:!1}),i=mp(t,{target:kie});O.useEffect(()=>{if(s){const{edges:l,nodes:c}=n.getState();r({nodes:c.filter(p_),edges:l.filter(p_)}),n.setState({nodesSelectionActive:!1})}},[s]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Aie(e){const t=sn();O.useEffect(()=>{const n=()=>{var s,i,l,c;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=n2(e.current);(r.height===0||r.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",Ti.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Ox={position:"absolute",width:"100%",height:"100%",top:0,left:0},_ie=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Die({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:s,panOnScrollSpeed:i=.5,panOnScrollMode:l=Dc.Free,zoomOnDoubleClick:c=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:C,onViewportChange:T,isControlledViewport:N,paneClickDistance:R,selectionOnDrag:M}){const D=sn(),k=O.useRef(null),{userSelectionActive:I,lib:_,connectionInProgress:P}=Mt(_ie,Sn),H=mp(y),z=O.useRef();Aie(k);const U=O.useCallback(j=>{T==null||T({x:j[0],y:j[1],zoom:j[2]}),N||D.setState({transform:j})},[T,N]);return O.useEffect(()=>{if(k.current){z.current=$se({domNode:k.current,minZoom:m,maxZoom:g,translateExtent:h,viewport:d,onDraggingChange:$=>D.setState(q=>q.paneDragging===$?q:{paneDragging:$}),onPanZoomStart:($,q)=>{const{onViewportChangeStart:G,onMoveStart:W}=D.getState();W==null||W($,q),G==null||G(q)},onPanZoom:($,q)=>{const{onViewportChange:G,onMove:W}=D.getState();W==null||W($,q),G==null||G(q)},onPanZoomEnd:($,q)=>{const{onViewportChangeEnd:G,onMoveEnd:W}=D.getState();W==null||W($,q),G==null||G(q)}});const{x:j,y:B,zoom:L}=z.current.getViewport();return D.setState({panZoom:z.current,transform:[j,B,L],domNode:k.current.closest(".react-flow")}),()=>{var $;($=z.current)==null||$.destroy()}}},[]),O.useEffect(()=>{var j;(j=z.current)==null||j.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:s,panOnScrollSpeed:i,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:u,zoomActivationKeyPressed:H,preventScrolling:b,noPanClassName:C,userSelectionActive:I,noWheelClassName:E,lib:_,onTransformChange:U,connectionInProgress:P,selectionOnDrag:M,paneClickDistance:R})},[e,t,n,r,s,i,l,c,u,H,b,C,I,E,_,U,P,M,R]),x.jsx("div",{className:"react-flow__renderer",ref:k,style:Ox,children:w})}const Iie=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function jie(){const{userSelectionActive:e,userSelectionRect:t}=Mt(Iie,Sn);return e&&t?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ZS=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Lie=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Pie({isSelecting:e,selectionKeyPressed:t,selectionMode:n=dp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:h,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:b,children:w}){const E=O.useRef(0),C=sn(),{userSelectionActive:T,elementsSelectable:N,dragging:R,panBy:M,autoPanSpeed:D}=Mt(Lie,Sn),k=N&&(e||T),I=O.useRef(null),_=O.useRef(),P=O.useRef(new Set),H=O.useRef(new Set),z=O.useRef(!1),U=O.useRef(!1),j=O.useRef({x:0,y:0}),B=O.useRef(!1),L=K=>{if(U.current||z.current||C.getState().connection.inProgress){U.current=!1,z.current=!1;return}d==null||d(K),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},$=K=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){K.preventDefault();return}h==null||h(K)},q=m?K=>m(K):void 0,G=K=>{U.current&&(K.stopPropagation(),U.current=!1)},W=K=>{var we,Re;if(K.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:ce,transform:ye}=C.getState();if(_.current=ce==null?void 0:ce.getBoundingClientRect(),!_.current)return;const ge=K.target===I.current;if(!ge&&!!K.target.closest(".nokey")||!e||!(l&&ge||t)||K.button!==0||!K.isPrimary)return;(Re=(we=K.target)==null?void 0:we.setPointerCapture)==null||Re.call(we,K.pointerId),U.current=!1;const{x:Se,y:ke}=vi(K.nativeEvent,_.current),_e=om({x:Se,y:ke},ye);C.setState({userSelectionRect:{width:0,height:0,startX:_e.x,startY:_e.y,x:Se,y:ke}}),ge||(K.stopPropagation(),K.preventDefault())};function Z(K,ce){const{userSelectionRect:ye}=C.getState();if(!ye)return;const{transform:ge,nodeLookup:oe,edgeLookup:xe,connectionLookup:Se,triggerNodeChanges:ke,triggerEdgeChanges:_e,defaultEdgeOptions:we}=C.getState(),Re={x:ye.startX,y:ye.startY},{x:Ae,y:Le}=Qf(Re,ge),Ie={startX:Re.x,startY:Re.y,x:K<Ae?K:Ae,y:ce<Le?ce:Le,width:Math.abs(K-Ae),height:Math.abs(ce-Le)},Ue=P.current,We=H.current;P.current=new Set(JC(oe,Ie,ge,n===dp.Partial,!0).map(De=>De.id)),H.current=new Set;const Oe=(we==null?void 0:we.selectable)??!0;for(const De of P.current){const ne=Se.get(De);if(ne)for(const{edgeId:he}of ne.values()){const se=xe.get(he);se&&(se.selectable??Oe)&&H.current.add(he)}}if(!$A(Ue,P.current)){const De=hf(oe,P.current,!0);ke(De)}if(!$A(We,H.current)){const De=hf(xe,H.current);_e(De)}C.setState({userSelectionRect:Ie,userSelectionActive:!0,nodesSelectionActive:!1})}function re(){if(!s||!_.current)return;const[K,ce]=e2(j.current,_.current,D);M({x:K,y:ce}).then(ye=>{if(!U.current||!ye){E.current=requestAnimationFrame(re);return}const{x:ge,y:oe}=j.current;Z(ge,oe),E.current=requestAnimationFrame(re)})}const de=()=>{cancelAnimationFrame(E.current),E.current=0,B.current=!1};O.useEffect(()=>()=>de(),[]);const F=K=>{const{userSelectionRect:ce,transform:ye,resetSelectedElements:ge}=C.getState();if(!_.current||!ce)return;const{x:oe,y:xe}=vi(K.nativeEvent,_.current);j.current={x:oe,y:xe};const Se=Qf({x:ce.startX,y:ce.startY},ye);if(!U.current){const ke=t?0:i;if(Math.hypot(oe-Se.x,xe-Se.y)<=ke)return;ge(),c==null||c(K)}U.current=!0,B.current||(re(),B.current=!0),Z(oe,xe)},X=K=>{var ce,ye;if(!k){K.target===I.current&&C.getState().connection.inProgress&&(z.current=!0);return}K.button===0&&((ye=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||ye.call(ce,K.pointerId),!T&&K.target===I.current&&C.getState().userSelectionRect&&(L==null||L(K)),C.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(u==null||u(K),C.setState({nodesSelectionActive:P.current.size>0})),de())},te=K=>{var ce,ye;(ye=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||ye.call(ce,K.pointerId),de()},J=r===!0||Array.isArray(r)&&r.includes(0);return x.jsxs("div",{className:$n(["react-flow__pane",{draggable:J,dragging:R,selection:e}]),onClick:k?void 0:ZS(L,I),onContextMenu:ZS($,I),onWheel:ZS(q,I),onPointerEnter:k?void 0:g,onPointerMove:k?F:y,onPointerUp:X,onPointerCancel:k?te:void 0,onPointerDownCapture:k?W:void 0,onClickCapture:k?G:void 0,onPointerLeave:b,ref:I,style:Ox,children:[w,x.jsx(jie,{})]})}function Dw({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:u}=t.getState(),d=c.get(e);if(!d){u==null||u("012",Ti.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function r5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:l}){const c=sn(),[u,d]=O.useState(!1),h=O.useRef();return O.useEffect(()=>{if(!t)return h.current=Ose({getStoreItems:()=>c.getState(),onNodeMouseDown:m=>{Dw({id:m,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}}),()=>{var m;(m=h.current)==null||m.destroy(),h.current=void 0}},[t,c,e]),O.useEffect(()=>{t||!e.current||!h.current||h.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:l})},[n,r,t,i,e,s,l]),u}const zie=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function s5(){const e=sn();return O.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:u,nodeLookup:d,nodeOrigin:h}=e.getState(),m=new Map,g=zie(l),y=s?i[0]:5,b=s?i[1]:5,w=n.direction.x*y*n.factor,E=n.direction.y*b*n.factor;for(const[,C]of d){if(!g(C))continue;let T={x:C.internals.positionAbsolute.x+w,y:C.internals.positionAbsolute.y+E};s&&(T=im(T,i));const{position:N,positionAbsolute:R}=wz({nodeId:C.id,nextPosition:T,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:c});C.position=N,C.internals.positionAbsolute=R,m.set(C.id,C)}u(m)},[])}const a2=O.createContext(null),Bie=a2.Provider;a2.Consumer;const i5=()=>O.useContext(a2),Hie=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),o5=O.createContext(null);function Fie({children:e}){const t=Mt(Hie,Sn);return x.jsx(o5.Provider,{value:t,children:e})}function $ie(){const e=O.useContext(o5);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Vie={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Uie=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:l}=r,{fromHandle:c,toHandle:u,isValid:d}=l;if(!c&&!s)return Vie;const h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===Wf.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:h&&d}};function qie({type:e="source",position:t=qe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:u,className:d,onMouseDown:h,onTouchStart:m,...g},y){var B,L;const b=l||null,w=e==="target",E=sn(),C=i5(),{connectOnClick:T,noPanClassName:N,rfId:R}=$ie(),{connectingFrom:M,connectingTo:D,clickConnecting:k,isPossibleEndHandle:I,connectionInProcess:_,clickConnectionInProcess:P,valid:H}=Mt(Uie(C,b,e),Sn);C||(L=(B=E.getState()).onError)==null||L.call(B,"010",Ti.error010());const z=$=>{const{defaultEdgeOptions:q,onConnect:G,hasDefaultEdges:W}=E.getState(),Z={...q,...$};if(W){const{edges:re,setEdges:de,onError:F}=E.getState();de(Eie(Z,re,{onError:F}))}G==null||G(Z),c==null||c(Z)},U=$=>{if(!C)return;const q=_z($.nativeEvent);if(s&&(q&&$.button===0||!q)){const G=E.getState();_w.onPointerDown($.nativeEvent,{handleDomNode:$.currentTarget,autoPanOnConnect:G.autoPanOnConnect,connectionMode:G.connectionMode,connectionRadius:G.connectionRadius,domNode:G.domNode,nodeLookup:G.nodeLookup,lib:G.lib,isTarget:w,handleId:b,nodeId:C,flowId:G.rfId,panBy:G.panBy,cancelConnection:G.cancelConnection,onConnectStart:G.onConnectStart,onConnectEnd:(...W)=>{var Z,re;return(re=(Z=E.getState()).onConnectEnd)==null?void 0:re.call(Z,...W)},updateConnection:G.updateConnection,onConnect:z,isValidConnection:n||((...W)=>{var Z,re;return((re=(Z=E.getState()).isValidConnection)==null?void 0:re.call(Z,...W))??!0}),getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}q?h==null||h($):m==null||m($)},j=$=>{const{onClickConnectStart:q,onClickConnectEnd:G,connectionClickStartHandle:W,connectionMode:Z,isValidConnection:re,lib:de,rfId:F,nodeLookup:X,connection:te}=E.getState();if(!C||!W&&!s)return;if(!W){q==null||q($.nativeEvent,{nodeId:C,handleId:b,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:C,type:e,id:b}});return}const J=Mz($.target),K=n||re,{connection:ce,isValid:ye}=_w.isValid($.nativeEvent,{handle:{nodeId:C,id:b,type:e},connectionMode:Z,fromNodeId:W.nodeId,fromHandleId:W.id||null,fromType:W.type,isValidConnection:K,flowId:F,doc:J,lib:de,nodeLookup:X});ye&&ce&&z(ce);const ge=structuredClone(te);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,G==null||G($,ge),E.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":b,"data-nodeid":C,"data-handlepos":t,"data-id":`${R}-${C}-${b}-${e}`,className:$n(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,clickconnecting:k,connectingfrom:M,connectingto:D,valid:H,connectionindicator:r&&(!_||I)&&(_||P?i:s)}]),onMouseDown:U,onTouchStart:U,onClick:T?j:void 0,ref:y,...g,children:u})}const Gc=O.memo(e5(qie));function Gie({data:e,isConnectable:t,sourcePosition:n=qe.Bottom}){return x.jsxs(x.Fragment,{children:[e==null?void 0:e.label,x.jsx(Gc,{type:"source",position:n,isConnectable:t})]})}function Kie({data:e,isConnectable:t,targetPosition:n=qe.Top,sourcePosition:r=qe.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(Gc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,x.jsx(Gc,{type:"source",position:r,isConnectable:t})]})}function Yie(){return null}function Wie({data:e,isConnectable:t,targetPosition:n=qe.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(Gc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const py={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},m_={input:Gie,default:Kie,output:Wie,group:Yie};function Xie(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const Qie=e=>{const{width:t,height:n,x:r,y:s}=sm(e.nodeLookup,{filter:i=>!!i.selected});return{width:bi(t)?t:null,height:bi(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function Zie({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=sn(),{width:s,height:i,transformString:l,userSelectionActive:c}=Mt(Qie,Sn),u=s5(),d=O.useRef(null);O.useEffect(()=>{var y;n||(y=d.current)==null||y.focus({preventScroll:!0})},[n]);const h=!c&&s!==null&&i!==null;if(r5({nodeRef:d,disabled:!h}),!h)return null;const m=e?y=>{const b=r.getState().nodes.filter(w=>w.selected);e(y,b)}:void 0,g=y=>{Object.prototype.hasOwnProperty.call(py,y.key)&&(y.preventDefault(),u({direction:py[y.key],factor:y.shiftKey?4:1}))};return x.jsx("div",{className:$n(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:x.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:i}})})}const g_=typeof window<"u"?window:void 0,Jie=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function l5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:N,panOnScroll:R,panOnScrollSpeed:M,panOnScrollMode:D,zoomOnDoubleClick:k,panOnDrag:I,autoPanOnSelection:_,defaultViewport:P,translateExtent:H,minZoom:z,maxZoom:U,preventScrolling:j,onSelectionContextMenu:B,noWheelClassName:L,noPanClassName:$,disableKeyboardA11y:q,onViewportChange:G,isControlledViewport:W}){const{nodesSelectionActive:Z,userSelectionActive:re}=Mt(Jie,Sn),de=mp(d,{target:g_}),F=mp(w,{target:g_}),X=F||I,te=F||R,J=h&&X!==!0,K=de||re||J;return Mie({deleteKeyCode:u,multiSelectionKeyCode:b}),x.jsx(Die,{onPaneContextMenu:i,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:N,panOnScroll:te,panActivationKeyPressed:F,panOnScrollSpeed:M,panOnScrollMode:D,zoomOnDoubleClick:k,panOnDrag:!de&&X,defaultViewport:P,translateExtent:H,minZoom:z,maxZoom:U,zoomActivationKeyCode:E,preventScrolling:j,noWheelClassName:L,noPanClassName:$,onViewportChange:G,isControlledViewport:W,paneClickDistance:c,selectionOnDrag:J,children:x.jsxs(Pie,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:X,autoPanOnSelection:_,isSelecting:!!K,selectionMode:m,selectionKeyPressed:de,paneClickDistance:c,selectionOnDrag:J,children:[e,Z&&x.jsx(Zie,{onSelectionContextMenu:B,noPanClassName:$,disableKeyboardA11y:q})]})})}l5.displayName="FlowRenderer";const eoe=O.memo(l5),toe=e=>t=>e?JC(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function noe(e){return Mt(O.useCallback(toe(e),[e]),Sn)}const roe=e=>e.updateNodeInternals;function soe(){const e=Mt(roe),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function ioe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=sn(),i=O.useRef(null),l=O.useRef(null),c=O.useRef(e.sourcePosition),u=O.useRef(e.targetPosition),d=O.useRef(t),h=n&&!!e.internals.handleBounds;return O.useEffect(()=>{i.current&&!e.hidden&&(!h||l.current!==i.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(i.current),l.current=i.current)},[h,e.hidden]),O.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),O.useEffect(()=>{if(i.current){const m=d.current!==t,g=c.current!==e.sourcePosition,y=u.current!==e.targetPosition;(m||g||y)&&(d.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function ooe({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:h,resizeObserver:m,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:b,rfId:w,nodeTypes:E,nodeClickDistance:C,onError:T}){const{node:N,internals:R,isParent:M}=Mt(K=>{const ce=K.nodeLookup.get(e),ye=K.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:ye}},Sn);let D=N.type||"default",k=(E==null?void 0:E[D])||m_[D];k===void 0&&(T==null||T("003",Ti.error003(D)),D="default",k=(E==null?void 0:E.default)||m_.default);const I=!!(N.draggable||c&&typeof N.draggable>"u"),_=!!(N.selectable||u&&typeof N.selectable>"u"),P=!!(N.connectable||d&&typeof N.connectable>"u"),H=!!(N.focusable||h&&typeof N.focusable>"u"),z=sn(),U=Rz(N),j=ioe({node:N,nodeType:D,hasDimensions:U,resizeObserver:m}),B=r5({nodeRef:j,disabled:N.hidden||!I,noDragClassName:g,handleSelector:N.dragHandle,nodeId:e,isSelectable:_,nodeClickDistance:C}),L=s5();if(N.hidden)return null;const $=ki(N),q=Xie(N),G=_||I||t||n||r||s,W=n?K=>n(K,{...R.userNode}):void 0,Z=r?K=>r(K,{...R.userNode}):void 0,re=s?K=>s(K,{...R.userNode}):void 0,de=i?K=>i(K,{...R.userNode}):void 0,F=l?K=>l(K,{...R.userNode}):void 0,X=K=>{const{selectNodesOnDrag:ce,nodeDragThreshold:ye}=z.getState();_&&(!ce||!I||ye>0)&&Dw({id:e,store:z,nodeRef:j}),t&&t(K,{...R.userNode})},te=K=>{if(!(Az(K.nativeEvent)||b)){if(xz.includes(K.key)&&_){const ce=K.key==="Escape";Dw({id:e,store:z,unselect:ce,nodeRef:j})}else if(I&&N.selected&&Object.prototype.hasOwnProperty.call(py,K.key)){K.preventDefault();const{ariaLabelConfig:ce}=z.getState();z.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),L({direction:py[K.key],factor:K.shiftKey?4:1})}}},J=()=>{var Se;if(b||!((Se=j.current)!=null&&Se.matches(":focus-visible")))return;const{transform:K,width:ce,height:ye,autoPanOnNodeFocus:ge,setCenter:oe}=z.getState();if(!ge)return;JC(new Map([[e,N]]),{x:0,y:0,width:ce,height:ye},K,!0).length>0||oe(N.position.x+$.width/2,N.position.y+$.height/2,{zoom:K[2]})};return x.jsx("div",{className:$n(["react-flow__node",`react-flow__node-${D}`,{[y]:I},N.className,{selected:N.selected,selectable:_,parent:M,draggable:I,dragging:B}]),ref:j,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:U?"visible":"hidden",...N.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:W,onMouseMove:Z,onMouseLeave:re,onContextMenu:de,onClick:X,onDoubleClick:F,onKeyDown:H?te:void 0,tabIndex:H?0:void 0,onFocus:H?J:void 0,role:N.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${Xz}-${w}`,"aria-label":N.ariaLabel,...N.domAttributes,children:x.jsx(Bie,{value:e,children:x.jsx(k,{id:e,data:N.data,type:D,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:N.selected??!1,selectable:_,draggable:I,deletable:N.deletable??!0,isConnectable:P,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:B,dragHandle:N.dragHandle,zIndex:R.z,parentId:N.parentId,...$})})})}var loe=O.memo(ooe);const aoe=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function a5(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:s}=Mt(aoe,Sn),i=noe(e.onlyRenderVisibleElements),l=soe();return x.jsx("div",{className:"react-flow__nodes",style:Ox,children:i.map(c=>x.jsx(loe,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}a5.displayName="NodeRenderer";const coe=O.memo(a5);function uoe(e){return Mt(O.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const i=n.nodeLookup.get(s.source),l=n.nodeLookup.get(s.target);i&&l&&cse({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Sn)}const foe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return x.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},doe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return x.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},y_={[fy.Arrow]:foe,[fy.ArrowClosed]:doe};function hoe(e){const t=sn();return O.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(y_,e)?y_[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Ti.error009(e)),null)},[e])}const poe=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=hoe(t);return u?x.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:x.jsx(u,{color:n,strokeWidth:l})}):null},c5=({defaultColor:e,rfId:t})=>{const n=Mt(i=>i.edges),r=Mt(i=>i.defaultEdgeOptions),s=O.useMemo(()=>yse(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:s.map(i=>x.jsx(poe,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};c5.displayName="MarkerDefinitions";var moe=O.memo(c5);function u5({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...h}){const[m,g]=O.useState({x:1,y:0,width:0,height:0}),y=$n(["react-flow__edge-textwrapper",d]),b=O.useRef(null);return O.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?x.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:y,visibility:m.width?"visible":"hidden",...h,children:[s&&x.jsx("rect",{width:m.width+2*l[0],x:-l[0],y:-l[1],height:m.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),x.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}u5.displayName="EdgeText";const goe=O.memo(u5);function kx({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...h}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...h,d:e,fill:"none",className:$n(["react-flow__edge-path",h.className])}),d?x.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&bi(t)&&bi(n)?x.jsx(goe,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function x_({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===qe.Left||e===qe.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function f5({sourceX:e,sourceY:t,sourcePosition:n=qe.Bottom,targetX:r,targetY:s,targetPosition:i=qe.Top}){const[l,c]=x_({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,d]=x_({pos:i,x1:r,y1:s,x2:e,y2:t}),[h,m,g,y]=Dz({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,h,m,g,y]}function d5(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:l,targetPosition:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:E,interactionWidth:C})=>{const[T,N,R]=f5({sourceX:n,sourceY:r,sourcePosition:l,targetX:s,targetY:i,targetPosition:c}),M=e.isInternal?void 0:t;return x.jsx(kx,{id:M,path:T,labelX:N,labelY:R,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:E,interactionWidth:C})})}const yoe=d5({isInternal:!1}),h5=d5({isInternal:!0});yoe.displayName="SimpleBezierEdge";h5.displayName="SimpleBezierEdgeInternal";function p5(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,sourcePosition:y=qe.Bottom,targetPosition:b=qe.Top,markerEnd:w,markerStart:E,pathOptions:C,interactionWidth:T})=>{const[N,R,M]=kw({sourceX:n,sourceY:r,sourcePosition:y,targetX:s,targetY:i,targetPosition:b,borderRadius:C==null?void 0:C.borderRadius,offset:C==null?void 0:C.offset,stepPosition:C==null?void 0:C.stepPosition}),D=e.isInternal?void 0:t;return x.jsx(kx,{id:D,path:N,labelX:R,labelY:M,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:w,markerStart:E,interactionWidth:T})})}const m5=p5({isInternal:!1}),g5=p5({isInternal:!0});m5.displayName="SmoothStepEdge";g5.displayName="SmoothStepEdgeInternal";function y5(e){return O.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return x.jsx(m5,{...n,id:r,pathOptions:O.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const xoe=y5({isInternal:!1}),x5=y5({isInternal:!0});xoe.displayName="StepEdge";x5.displayName="StepEdgeInternal";function b5(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:y,markerStart:b,interactionWidth:w})=>{const[E,C,T]=Lz({sourceX:n,sourceY:r,targetX:s,targetY:i}),N=e.isInternal?void 0:t;return x.jsx(kx,{id:N,path:E,labelX:C,labelY:T,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:y,markerStart:b,interactionWidth:w})})}const boe=b5({isInternal:!1}),v5=b5({isInternal:!0});boe.displayName="StraightEdge";v5.displayName="StraightEdgeInternal";function S5(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:l=qe.Bottom,targetPosition:c=qe.Top,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:E,pathOptions:C,interactionWidth:T})=>{const[N,R,M]=Iz({sourceX:n,sourceY:r,sourcePosition:l,targetX:s,targetY:i,targetPosition:c,curvature:C==null?void 0:C.curvature}),D=e.isInternal?void 0:t;return x.jsx(kx,{id:D,path:N,labelX:R,labelY:M,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:E,interactionWidth:T})})}const voe=S5({isInternal:!1}),w5=S5({isInternal:!0});voe.displayName="BezierEdge";w5.displayName="BezierEdgeInternal";const b_={default:w5,straight:v5,step:x5,smoothstep:g5,simplebezier:h5},v_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Soe=(e,t,n)=>n===qe.Left?e-t:n===qe.Right?e+t:e,woe=(e,t,n)=>n===qe.Top?e-t:n===qe.Bottom?e+t:e,S_="react-flow__edgeupdater";function w_({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:l,type:c}){return x.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:l,className:$n([S_,`${S_}-${c}`]),cx:Soe(t,r,e),cy:woe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Eoe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:l,sourcePosition:c,targetPosition:u,onReconnect:d,onReconnectStart:h,onReconnectEnd:m,setReconnecting:g,setUpdateHover:y}){const b=sn(),w=(R,M)=>{if(R.button!==0)return;const{autoPanOnConnect:D,domNode:k,connectionMode:I,connectionRadius:_,lib:P,onConnectStart:H,cancelConnection:z,nodeLookup:U,rfId:j,panBy:B,updateConnection:L}=b.getState(),$=M.type==="target",q=(Z,re)=>{g(!1),m==null||m(Z,n,M.type,re)},G=Z=>d==null?void 0:d(n,Z),W=(Z,re)=>{g(!0),h==null||h(R,n,M.type),H==null||H(Z,re)};_w.onPointerDown(R.nativeEvent,{autoPanOnConnect:D,connectionMode:I,connectionRadius:_,domNode:k,handleId:M.id,nodeId:M.nodeId,nodeLookup:U,isTarget:$,edgeUpdaterType:M.type,lib:P,flowId:j,cancelConnection:z,panBy:B,isValidConnection:(...Z)=>{var re,de;return((de=(re=b.getState()).isValidConnection)==null?void 0:de.call(re,...Z))??!0},onConnect:G,onConnectStart:W,onConnectEnd:(...Z)=>{var re,de;return(de=(re=b.getState()).onConnectEnd)==null?void 0:de.call(re,...Z)},onReconnectEnd:q,updateConnection:L,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},E=R=>w(R,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),C=R=>w(R,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),T=()=>y(!0),N=()=>y(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(w_,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:E,onMouseEnter:T,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&x.jsx(w_,{position:u,centerX:i,centerY:l,radius:t,onMouseDown:C,onMouseEnter:T,onMouseOut:N,type:"target"})]})}function Coe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:h,onReconnect:m,onReconnectStart:g,onReconnectEnd:y,rfId:b,edgeTypes:w,noPanClassName:E,onError:C,disableKeyboardA11y:T}){let N=Mt(oe=>oe.edgeLookup.get(e));const R=Mt(oe=>oe.defaultEdgeOptions);N=R?{...R,...N}:N;let M=N.type||"default",D=(w==null?void 0:w[M])||b_[M];D===void 0&&(C==null||C("011",Ti.error011(M)),M="default",D=(w==null?void 0:w.default)||b_.default);const k=!!(N.focusable||t&&typeof N.focusable>"u"),I=typeof m<"u"&&(N.reconnectable||n&&typeof N.reconnectable>"u"),_=!!(N.selectable||r&&typeof N.selectable>"u"),P=O.useRef(null),[H,z]=O.useState(!1),[U,j]=O.useState(!1),B=sn(),{zIndex:L=N.zIndex,sourceX:$,sourceY:q,targetX:G,targetY:W,sourcePosition:Z,targetPosition:re}=Mt(O.useCallback(oe=>{const xe=oe.nodeLookup.get(N.source),Se=oe.nodeLookup.get(N.target);if(!xe||!Se)return v_;const ke=gse({id:e,sourceNode:xe,targetNode:Se,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:oe.connectionMode,onError:C}),_e=ase({selected:N.selected,zIndex:N.zIndex,sourceNode:xe,targetNode:Se,elevateOnSelect:oe.elevateEdgesOnSelect,zIndexMode:oe.zIndexMode});return{...ke||v_,zIndex:_e}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex,C]),Sn),de=O.useMemo(()=>N.markerStart?`url('#${Mw(N.markerStart,b)}')`:void 0,[N.markerStart,b]),F=O.useMemo(()=>N.markerEnd?`url('#${Mw(N.markerEnd,b)}')`:void 0,[N.markerEnd,b]);if(N.hidden||$===null||q===null||G===null||W===null)return null;const X=oe=>{var _e;const{addSelectedEdges:xe,unselectNodesAndEdges:Se,multiSelectionActive:ke}=B.getState();_&&(B.setState({nodesSelectionActive:!1}),N.selected&&ke?(Se({nodes:[],edges:[N]}),(_e=P.current)==null||_e.blur()):xe([e])),s&&s(oe,N)},te=i?oe=>{i(oe,{...N})}:void 0,J=l?oe=>{l(oe,{...N})}:void 0,K=c?oe=>{c(oe,{...N})}:void 0,ce=u?oe=>{u(oe,{...N})}:void 0,ye=d?oe=>{d(oe,{...N})}:void 0,ge=oe=>{var xe;if(!T&&xz.includes(oe.key)&&_){const{unselectNodesAndEdges:Se,addSelectedEdges:ke}=B.getState();oe.key==="Escape"?((xe=P.current)==null||xe.blur(),Se({edges:[N]})):ke([e])}};return x.jsx("svg",{style:{zIndex:L},children:x.jsxs("g",{className:$n(["react-flow__edge",`react-flow__edge-${M}`,N.className,E,{selected:N.selected,animated:N.animated,inactive:!_&&!s,updating:H,selectable:_}]),onClick:X,onDoubleClick:te,onContextMenu:J,onMouseEnter:K,onMouseMove:ce,onMouseLeave:ye,onKeyDown:k?ge:void 0,tabIndex:k?0:void 0,role:N.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":k?`${Qz}-${b}`:void 0,ref:P,...N.domAttributes,children:[!U&&x.jsx(D,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:_,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:$,sourceY:q,targetX:G,targetY:W,sourcePosition:Z,targetPosition:re,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:de,markerEnd:F,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),I&&x.jsx(Eoe,{edge:N,isReconnectable:I,reconnectRadius:h,onReconnect:m,onReconnectStart:g,onReconnectEnd:y,sourceX:$,sourceY:q,targetX:G,targetY:W,sourcePosition:Z,targetPosition:re,setUpdateHover:z,setReconnecting:j})]})})}var Noe=O.memo(Coe);const Toe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function E5({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:m,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:E,edgesReconnectable:C,elementsSelectable:T,onError:N}=Mt(Toe,Sn),R=uoe(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(moe,{defaultColor:e,rfId:n}),R.map(M=>x.jsx(Noe,{id:M,edgesFocusable:E,edgesReconnectable:C,elementsSelectable:T,noPanClassName:s,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:h,reconnectRadius:m,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,rfId:n,onError:N,edgeTypes:r,disableKeyboardA11y:w},M))]})}E5.displayName="EdgeRenderer";const Roe=O.memo(E5),E_=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Ooe({children:e}){const t=sn(),n=O.useRef(null),[r]=O.useState(()=>t.getState().transform);return t5(()=>{let s=null;const i=()=>{const l=t.getState().transform;s&&l[0]===s[0]&&l[1]===s[1]&&l[2]===s[2]||(s=l,n.current&&(n.current.style.transform=E_(l)))};return i(),t.subscribe(i)},[t]),x.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:E_(r)},children:e})}function koe(e){const t=Rx(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Moe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Aoe(e){const t=Mt(Moe),n=sn();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function _oe(e){return e.connection.inProgress?{...e.connection,to:om(e.connection.to,e.transform)}:{...e.connection}}function Doe(e){return _oe}function Ioe(e){const t=Doe();return Mt(t,Sn)}const joe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Loe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:l,isValid:c,inProgress:u}=Mt(joe,Sn);return!(i&&s&&u)?null:x.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:$n(["react-flow__connection",kz(c)]),children:x.jsx(C5,{style:t,type:n,CustomComponent:r,isValid:c})})})}const C5=({style:e,type:t=Xl.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:l,fromHandle:c,fromPosition:u,to:d,toNode:h,toHandle:m,toPosition:g,pointer:y}=Ioe();if(!s)return;if(n)return x.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:kz(r),toNode:h,toHandle:m,pointer:y});let b="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Xl.Bezier:[b]=Iz(w);break;case Xl.SimpleBezier:[b]=f5(w);break;case Xl.Step:[b]=kw({...w,borderRadius:0});break;case Xl.SmoothStep:[b]=kw(w);break;default:[b]=Lz(w)}return x.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};C5.displayName="ConnectionLine";const Poe={};function C_(e=Poe){O.useRef(e),sn(),O.useEffect(()=>{},[e])}function zoe(){sn(),O.useRef(!1),O.useEffect(()=>{},[])}function N5({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:T,selectionOnDrag:N,selectionMode:R,multiSelectionKeyCode:M,panActivationKeyCode:D,zoomActivationKeyCode:k,deleteKeyCode:I,onlyRenderVisibleElements:_,elementsSelectable:P,defaultViewport:H,translateExtent:z,minZoom:U,maxZoom:j,preventScrolling:B,defaultMarkerColor:L,zoomOnScroll:$,zoomOnPinch:q,panOnScroll:G,panOnScrollSpeed:W,panOnScrollMode:Z,zoomOnDoubleClick:re,panOnDrag:de,autoPanOnSelection:F,onPaneClick:X,onPaneMouseEnter:te,onPaneMouseMove:J,onPaneMouseLeave:K,onPaneScroll:ce,onPaneContextMenu:ye,paneClickDistance:ge,nodeClickDistance:oe,onEdgeContextMenu:xe,onEdgeMouseEnter:Se,onEdgeMouseMove:ke,onEdgeMouseLeave:_e,reconnectRadius:we,onReconnect:Re,onReconnectStart:Ae,onReconnectEnd:Le,noDragClassName:Ie,noWheelClassName:Ue,noPanClassName:We,disableKeyboardA11y:Oe,nodeExtent:De,rfId:ne,viewport:he,onViewportChange:se,nodesDraggable:Te}){return C_(e),C_(t),zoe(),koe(n),Aoe(he),x.jsx(eoe,{onPaneClick:X,onPaneMouseEnter:te,onPaneMouseMove:J,onPaneMouseLeave:K,onPaneContextMenu:ye,onPaneScroll:ce,paneClickDistance:ge,deleteKeyCode:I,selectionKeyCode:T,selectionOnDrag:N,selectionMode:R,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:M,panActivationKeyCode:D,zoomActivationKeyCode:k,elementsSelectable:P,zoomOnScroll:$,zoomOnPinch:q,zoomOnDoubleClick:re,panOnScroll:G,panOnScrollSpeed:W,panOnScrollMode:Z,panOnDrag:de,autoPanOnSelection:F,defaultViewport:H,translateExtent:z,minZoom:U,maxZoom:j,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Ie,noWheelClassName:Ue,noPanClassName:We,disableKeyboardA11y:Oe,onViewportChange:se,isControlledViewport:!!he,children:x.jsxs(Ooe,{children:[x.jsx(Roe,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:l,onReconnect:Re,onReconnectStart:Ae,onReconnectEnd:Le,onlyRenderVisibleElements:_,onEdgeContextMenu:xe,onEdgeMouseEnter:Se,onEdgeMouseMove:ke,onEdgeMouseLeave:_e,reconnectRadius:we,defaultMarkerColor:L,noPanClassName:We,disableKeyboardA11y:Oe,rfId:ne}),x.jsx(Loe,{style:w,type:b,component:E,containerStyle:C}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(coe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:oe,onlyRenderVisibleElements:_,noPanClassName:We,noDragClassName:Ie,disableKeyboardA11y:Oe,nodeExtent:De,rfId:ne,nodesDraggable:Te}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}N5.displayName="GraphView";const Boe=O.memo(N5),Hoe=Tz(),N_=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:l,fitViewOptions:c,minZoom:u=.5,maxZoom:d=2,nodeOrigin:h,nodeExtent:m,zIndexMode:g="basic"}={})=>{const y=new Map,b=new Map,w=new Map,E=new Map,C=r??t??[],T=n??e??[],N=h??[0,0],R=m??fp;Bz(w,E,C);const{nodesInitialized:M}=Aw(T,y,b,{nodeOrigin:N,nodeExtent:R,zIndexMode:g});let D=[0,0,1];if(l&&s&&i){const k=sm(y,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:I,y:_,zoom:P}=t2(k,s,i,u,d,(c==null?void 0:c.padding)??.1);D=[I,_,P]}return{rfId:"1",width:s??0,height:i??0,transform:D,nodes:T,nodesInitialized:M,nodeLookup:y,parentLookup:b,edges:C,edgeLookup:E,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:fp,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Wf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...vz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Hoe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:bz,zIndexMode:g,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},Foe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g})=>Jse((y,b)=>{async function w(){const{nodeLookup:E,panZoom:C,fitViewOptions:T,fitViewResolver:N,width:R,height:M,minZoom:D,maxZoom:k}=b();C&&(await tse({nodes:E,width:R,height:M,panZoom:C,minZoom:D,maxZoom:k},T),N==null||N.resolve(!0),y({fitViewResolver:null}))}return{...N_({nodes:e,edges:t,width:s,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:E=>{const{nodeLookup:C,parentLookup:T,nodeOrigin:N,nodeExtent:R,elevateNodesOnSelect:M,fitViewQueued:D,zIndexMode:k,nodesSelectionActive:I}=b(),{nodesInitialized:_,hasSelectedNodes:P}=Aw(E,C,T,{nodeOrigin:N,nodeExtent:R,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:k}),H=I&&P;D&&_?(w(),y({nodes:E,nodesInitialized:_,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:H})):y({nodes:E,nodesInitialized:_,nodesSelectionActive:H})},setEdges:E=>{const{connectionLookup:C,edgeLookup:T}=b();Bz(C,T,E),y({edges:E})},setDefaultNodesAndEdges:(E,C)=>{if(E){const{setNodes:T}=b();T(E),y({hasDefaultNodes:!0})}if(C){const{setEdges:T}=b();T(C),y({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:C,nodeLookup:T,parentLookup:N,domNode:R,nodeOrigin:M,nodeExtent:D,debug:k,fitViewQueued:I,zIndexMode:_}=b(),{changes:P,updatedInternals:H}=Cse(E,T,N,R,M,D,_);H&&(vse(T,N,{nodeOrigin:M,nodeExtent:D,zIndexMode:_}),I?(w(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(P==null?void 0:P.length)>0&&(k&&console.log("React Flow: trigger node changes",P),C==null||C(P)))},updateNodePositions:(E,C=!1)=>{const T=[];let N=[];const{nodeLookup:R,triggerNodeChanges:M,connection:D,updateConnection:k,onNodesChangeMiddlewareMap:I}=b();for(const[_,P]of E){const H=R.get(_),z=!!(H!=null&&H.expandParent&&(H!=null&&H.parentId)&&(P!=null&&P.position)),U={id:_,type:"position",position:z?{x:Math.max(0,P.position.x),y:Math.max(0,P.position.y)}:P.position,dragging:C};if(H&&D.inProgress&&D.fromNode.id===H.id){const j=qc(H,D.fromHandle,qe.Left,!0);k({...D,from:j})}z&&H.parentId&&T.push({id:_,parentId:H.parentId,rect:{...P.internals.positionAbsolute,width:P.measured.width??0,height:P.measured.height??0}}),N.push(U)}if(T.length>0){const{parentLookup:_,nodeOrigin:P}=b(),H=l2(T,R,_,P);N.push(...H)}for(const _ of I.values())N=_(N);M(N)},triggerNodeChanges:E=>{const{onNodesChange:C,setNodes:T,nodes:N,hasDefaultNodes:R,debug:M}=b();if(E!=null&&E.length){if(R){const D=vie(E,N);T(D)}M&&console.log("React Flow: trigger node changes",E),C==null||C(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:C,setEdges:T,edges:N,hasDefaultEdges:R,debug:M}=b();if(E!=null&&E.length){if(R){const D=Sie(E,N);T(D)}M&&console.log("React Flow: trigger edge changes",E),C==null||C(E)}},addSelectedNodes:E=>{const{multiSelectionActive:C,edgeLookup:T,nodeLookup:N,triggerNodeChanges:R,triggerEdgeChanges:M}=b();if(C){const D=E.map(k=>hc(k,!0));R(D);return}R(hf(N,new Set([...E]),!0)),M(hf(T))},addSelectedEdges:E=>{const{multiSelectionActive:C,edgeLookup:T,nodeLookup:N,triggerNodeChanges:R,triggerEdgeChanges:M}=b();if(C){const D=E.map(k=>hc(k,!0));M(D);return}M(hf(T,new Set([...E]))),R(hf(N,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:C}={})=>{const{edges:T,nodes:N,nodeLookup:R,triggerNodeChanges:M,triggerEdgeChanges:D}=b(),k=E||N,I=C||T,_=[];for(const H of k){if(!H.selected)continue;const z=R.get(H.id);z&&(z.selected=!1),_.push(hc(H.id,!1))}const P=[];for(const H of I)H.selected&&P.push(hc(H.id,!1));M(_),D(P)},setMinZoom:E=>{const{panZoom:C,maxZoom:T}=b();C==null||C.setScaleExtent([E,T]),y({minZoom:E})},setMaxZoom:E=>{const{panZoom:C,minZoom:T}=b();C==null||C.setScaleExtent([T,E]),y({maxZoom:E})},setTranslateExtent:E=>{var C;(C=b().panZoom)==null||C.setTranslateExtent(E),y({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:C,triggerNodeChanges:T,triggerEdgeChanges:N,elementsSelectable:R}=b();if(!R)return;const M=C.reduce((k,I)=>I.selected?[...k,hc(I.id,!1)]:k,[]),D=E.reduce((k,I)=>I.selected?[...k,hc(I.id,!1)]:k,[]);T(M),N(D)},setNodeExtent:E=>{const{nodes:C,nodeLookup:T,parentLookup:N,nodeOrigin:R,elevateNodesOnSelect:M,nodeExtent:D,zIndexMode:k}=b();E[0][0]===D[0][0]&&E[0][1]===D[0][1]&&E[1][0]===D[1][0]&&E[1][1]===D[1][1]||(Aw(C,T,N,{nodeOrigin:R,nodeExtent:E,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:k}),y({nodeExtent:E}))},panBy:E=>{const{transform:C,width:T,height:N,panZoom:R,translateExtent:M}=b();return Nse({delta:E,panZoom:R,transform:C,translateExtent:M,width:T,height:N})},setCenter:async(E,C,T)=>{const{width:N,height:R,maxZoom:M,panZoom:D}=b();if(!D)return!1;const k=typeof(T==null?void 0:T.zoom)<"u"?T.zoom:M;return await D.setViewport({x:N/2-E*k,y:R/2-C*k,zoom:k},{duration:T==null?void 0:T.duration,ease:T==null?void 0:T.ease,interpolate:T==null?void 0:T.interpolate}),!0},cancelConnection:()=>{y({connection:{...vz}})},updateConnection:E=>{y({connection:E})},reset:()=>y({...N_()})}},Object.is);function T5({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g,children:y}){const[b]=O.useState(()=>Foe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:m,zIndexMode:g}));return x.jsx(eie,{value:b,children:x.jsx(Tie,{children:x.jsx(Fie,{children:y})})})}function $oe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:l,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:y}){return O.useContext(Nx)?x.jsx(x.Fragment,{children:e}):x.jsx(T5,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:y,children:e})}const Voe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Uoe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:y,onConnectStart:b,onConnectEnd:w,onClickConnectStart:E,onClickConnectEnd:C,onNodeMouseEnter:T,onNodeMouseMove:N,onNodeMouseLeave:R,onNodeContextMenu:M,onNodeDoubleClick:D,onNodeDragStart:k,onNodeDrag:I,onNodeDragStop:_,onNodesDelete:P,onEdgesDelete:H,onDelete:z,onSelectionChange:U,onSelectionDragStart:j,onSelectionDrag:B,onSelectionDragStop:L,onSelectionContextMenu:$,onSelectionStart:q,onSelectionEnd:G,onBeforeDelete:W,connectionMode:Z,connectionLineType:re=Xl.Bezier,connectionLineStyle:de,connectionLineComponent:F,connectionLineContainerStyle:X,deleteKeyCode:te="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:K=!1,selectionMode:ce=dp.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:ge=pp()?"Meta":"Control",zoomActivationKeyCode:oe=pp()?"Meta":"Control",snapToGrid:xe,snapGrid:Se,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:_e,nodesDraggable:we,autoPanOnNodeFocus:Re,nodesConnectable:Ae,nodesFocusable:Le,nodeOrigin:Ie=Zz,edgesFocusable:Ue,edgesReconnectable:We,elementsSelectable:Oe=!0,defaultViewport:De=hie,minZoom:ne=.5,maxZoom:he=2,translateExtent:se=fp,preventScrolling:Te=!0,nodeExtent:Ve,defaultMarkerColor:jt="#b1b1b7",zoomOnScroll:hn=!0,zoomOnPinch:Fe=!0,panOnScroll:Tt=!1,panOnScrollSpeed:zt=.5,panOnScrollMode:Vn=Dc.Free,zoomOnDoubleClick:Un=!0,panOnDrag:xs=!0,onPaneClick:on,onPaneMouseEnter:ar,onPaneMouseMove:zr,onPaneMouseLeave:bs,onPaneScroll:qn,onPaneContextMenu:mt,paneClickDistance:ln=1,nodeClickDistance:Gn=0,children:Rn,onReconnect:On,onReconnectStart:Bt,onReconnectEnd:Wt,onEdgeContextMenu:Xt,onEdgeDoubleClick:Br,onEdgeMouseEnter:Kn,onEdgeMouseMove:_n,onEdgeMouseLeave:cr,reconnectRadius:ur=10,onNodesChange:fr,onEdgesChange:ns,noDragClassName:Rr="nodrag",noWheelClassName:Or="nowheel",noPanClassName:rs="nopan",fitView:oi,fitViewOptions:dr,connectOnClick:Ai,attributionPosition:vs,proOptions:cl,defaultEdgeOptions:Ss,elevateNodesOnSelect:ul=!0,elevateEdgesOnSelect:uo=!1,disableKeyboardA11y:li=!1,autoPanOnConnect:ss,autoPanOnNodeDrag:is,autoPanOnSelection:fo=!0,autoPanSpeed:pn,connectionRadius:nn,isValidConnection:Yn,onError:Hr,style:La,id:ho,nodeDragThreshold:fl,connectionDragThreshold:_i,viewport:po,onViewportChange:dl,width:hl,height:ws,colorMode:mo="light",debug:pe,onScroll:Ee,ariaLabelConfig:Ce,zIndexMode:Ge="basic",...ot},it){const at=ho||"1",Ht=yie(mo),It=O.useCallback(Ze=>{Ze.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ee==null||Ee(Ze)},[Ee]);return x.jsx("div",{"data-testid":"rf__wrapper",...ot,onScroll:It,style:{...La,...Voe},ref:it,className:$n(["react-flow",s,Ht]),id:ho,role:"application",children:x.jsxs($oe,{nodes:e,edges:t,width:hl,height:ws,fitView:oi,fitViewOptions:dr,minZoom:ne,maxZoom:he,nodeOrigin:Ie,nodeExtent:Ve,zIndexMode:Ge,children:[x.jsx(gie,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:b,onConnectEnd:w,onClickConnectStart:E,onClickConnectEnd:C,nodesDraggable:we,autoPanOnNodeFocus:Re,nodesConnectable:Ae,nodesFocusable:Le,edgesFocusable:Ue,edgesReconnectable:We,elementsSelectable:Oe,elevateNodesOnSelect:ul,elevateEdgesOnSelect:uo,minZoom:ne,maxZoom:he,nodeExtent:Ve,onNodesChange:fr,onEdgesChange:ns,snapToGrid:xe,snapGrid:Se,connectionMode:Z,translateExtent:se,connectOnClick:Ai,defaultEdgeOptions:Ss,fitView:oi,fitViewOptions:dr,onNodesDelete:P,onEdgesDelete:H,onDelete:z,onNodeDragStart:k,onNodeDrag:I,onNodeDragStop:_,onSelectionDrag:B,onSelectionDragStart:j,onSelectionDragStop:L,onMove:h,onMoveStart:m,onMoveEnd:g,noPanClassName:rs,nodeOrigin:Ie,rfId:at,autoPanOnConnect:ss,autoPanOnNodeDrag:is,autoPanSpeed:pn,onError:Hr,connectionRadius:nn,isValidConnection:Yn,selectNodesOnDrag:_e,nodeDragThreshold:fl,connectionDragThreshold:_i,onBeforeDelete:W,debug:pe,ariaLabelConfig:Ce,zIndexMode:Ge}),x.jsx(Boe,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:T,onNodeMouseMove:N,onNodeMouseLeave:R,onNodeContextMenu:M,onNodeDoubleClick:D,nodeTypes:i,edgeTypes:l,connectionLineType:re,connectionLineStyle:de,connectionLineComponent:F,connectionLineContainerStyle:X,selectionKeyCode:J,selectionOnDrag:K,selectionMode:ce,deleteKeyCode:te,multiSelectionKeyCode:ge,panActivationKeyCode:ye,zoomActivationKeyCode:oe,onlyRenderVisibleElements:ke,defaultViewport:De,translateExtent:se,minZoom:ne,maxZoom:he,preventScrolling:Te,zoomOnScroll:hn,zoomOnPinch:Fe,zoomOnDoubleClick:Un,panOnScroll:Tt,panOnScrollSpeed:zt,panOnScrollMode:Vn,panOnDrag:xs,autoPanOnSelection:fo,onPaneClick:on,onPaneMouseEnter:ar,onPaneMouseMove:zr,onPaneMouseLeave:bs,onPaneScroll:qn,onPaneContextMenu:mt,paneClickDistance:ln,nodeClickDistance:Gn,onSelectionContextMenu:$,onSelectionStart:q,onSelectionEnd:G,onReconnect:On,onReconnectStart:Bt,onReconnectEnd:Wt,onEdgeContextMenu:Xt,onEdgeDoubleClick:Br,onEdgeMouseEnter:Kn,onEdgeMouseMove:_n,onEdgeMouseLeave:cr,reconnectRadius:ur,defaultMarkerColor:jt,noDragClassName:Rr,noWheelClassName:Or,noPanClassName:rs,rfId:at,disableKeyboardA11y:li,nodeExtent:Ve,viewport:po,onViewportChange:dl,nodesDraggable:we}),x.jsx(die,{onSelectionChange:U}),Rn,x.jsx(lie,{proOptions:cl,position:vs}),x.jsx(oie,{rfId:at,disableKeyboardA11y:li})]})})}var qoe=e5(Uoe);function Goe({dimensions:e,lineWidth:t,variant:n,className:r}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:$n(["react-flow__background-pattern",n,r])})}function Koe({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:$n(["react-flow__background-pattern","dots",t])})}var pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pa||(pa={}));const Yoe={[pa.Dots]:1,[pa.Lines]:1,[pa.Cross]:6},Woe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function R5({id:e,variant:t=pa.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:l,bgColor:c,style:u,className:d,patternClassName:h}){const m=O.useRef(null),{transform:g,patternId:y}=Mt(Woe,Sn),b=r||Yoe[t],w=t===pa.Dots,E=t===pa.Cross,C=Array.isArray(n)?n:[n,n],T=[C[0]*g[2]||1,C[1]*g[2]||1],N=b*g[2],R=Array.isArray(i)?i:[i,i],M=E?[N,N]:T,D=[R[0]*g[2]+M[0]/2,R[1]*g[2]+M[1]/2],k=`${y}${e||""}`;return x.jsxs("svg",{className:$n(["react-flow__background",d]),style:{...u,...Ox,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:m,"data-testid":"rf__background",children:[x.jsx("pattern",{id:k,x:g[0]%T[0],y:g[1]%T[1],width:T[0],height:T[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:w?x.jsx(Koe,{radius:N/2,className:h}):x.jsx(Goe,{dimensions:M,lineWidth:s,variant:t,className:h})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}R5.displayName="Background";O.memo(R5);function Xoe(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Qoe(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Zoe(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Joe(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ele(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function r0({children:e,className:t,...n}){return x.jsx("button",{type:"button",className:$n(["react-flow__controls-button",t]),...n,children:e})}const tle=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function O5({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:u,className:d,children:h,position:m="bottom-left",orientation:g="vertical","aria-label":y}){const b=sn(),{isInteractive:w,minZoomReached:E,maxZoomReached:C,ariaLabelConfig:T}=Mt(tle,Sn),{zoomIn:N,zoomOut:R,fitView:M}=Rx(),D=()=>{N(),i==null||i()},k=()=>{R(),l==null||l()},I=()=>{M(s),c==null||c()},_=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},P=g==="horizontal"?"horizontal":"vertical";return x.jsxs(Tx,{className:$n(["react-flow__controls",P,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":y??T["controls.ariaLabel"],children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(r0,{onClick:D,className:"react-flow__controls-zoomin",title:T["controls.zoomIn.ariaLabel"],"aria-label":T["controls.zoomIn.ariaLabel"],disabled:C,children:x.jsx(Xoe,{})}),x.jsx(r0,{onClick:k,className:"react-flow__controls-zoomout",title:T["controls.zoomOut.ariaLabel"],"aria-label":T["controls.zoomOut.ariaLabel"],disabled:E,children:x.jsx(Qoe,{})})]}),n&&x.jsx(r0,{className:"react-flow__controls-fitview",onClick:I,title:T["controls.fitView.ariaLabel"],"aria-label":T["controls.fitView.ariaLabel"],children:x.jsx(Zoe,{})}),r&&x.jsx(r0,{className:"react-flow__controls-interactive",onClick:_,title:T["controls.interactive.ariaLabel"],"aria-label":T["controls.interactive.ariaLabel"],children:w?x.jsx(ele,{}):x.jsx(Joe,{})}),h]})}O5.displayName="Controls";O.memo(O5);function nle({id:e,x:t,y:n,width:r,height:s,style:i,color:l,strokeColor:c,strokeWidth:u,className:d,borderRadius:h,shapeRendering:m,selected:g,onClick:y}){const{background:b,backgroundColor:w}=i||{},E=l||b||w;return x.jsx("rect",{className:$n(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:E,stroke:c,strokeWidth:u},shapeRendering:m,onClick:y?C=>y(C,e):void 0})}const rle=O.memo(nle),sle=e=>e.nodes.map(t=>t.id),JS=e=>e instanceof Function?e:()=>e;function ile({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=rle,onClick:l}){const c=Mt(sle,Sn),u=JS(t),d=JS(e),h=JS(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:c.map(g=>x.jsx(lle,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:l,shapeRendering:m},g))})}function ole({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:u}){const{node:d,x:h,y:m,width:g,height:y}=Mt(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const E=w.internals.userNode,{x:C,y:T}=w.internals.positionAbsolute,{width:N,height:R}=ki(E);return{node:E,x:C,y:T,width:N,height:R}},Sn);return!d||d.hidden||!Rz(d)?null:x.jsx(c,{x:h,y:m,width:g,height:y,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:u,id:d.id})}const lle=O.memo(ole);var ale=O.memo(ile);const cle=200,ule=150,fle=e=>!e.hidden,dle=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Cz(sm(e.nodeLookup,{filter:fle}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},T_=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,hle=(e,t)=>T_(e.viewBB,t.viewBB)&&T_(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,ple="react-flow__minimap-desc";function k5({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:h,maskStrokeWidth:m,position:g="bottom-right",onClick:y,onNodeClick:b,pannable:w=!1,zoomable:E=!1,ariaLabel:C,inversePan:T,zoomStep:N=1,offsetScale:R=5}){const M=sn(),D=O.useRef(null),{boundingRect:k,panZoom:I,viewBB:_,rfId:P,translateExtent:H,flowWidth:z,flowHeight:U,ariaLabelConfig:j}=Mt(dle,hle),B=(e==null?void 0:e.width)??cle,L=(e==null?void 0:e.height)??ule,$=k.width/B,q=k.height/L,G=Math.max($,q),W=G*B,Z=G*L,re=R*G,de=k.x-(W-k.width)/2-re,F=k.y-(Z-k.height)/2-re,X=W+re*2,te=Z+re*2,J=`${ple}-${P}`,K=O.useRef(0),ce=O.useRef();K.current=G,O.useEffect(()=>{const Se=M.getState().panZoom;if(D.current&&Se)return ce.current=Ise({domNode:D.current,panZoom:Se,getTransform:()=>M.getState().transform,getViewScale:()=>K.current}),()=>{var ke;(ke=ce.current)==null||ke.destroy()}},[I]),O.useEffect(()=>{var Se;(Se=ce.current)==null||Se.update({translateExtent:H,width:z,height:U,inversePan:T,pannable:w,zoomStep:N,zoomable:E})},[w,E,T,N,H,z,U]);const ye=y?Se=>{var we;const[ke,_e]=((we=ce.current)==null?void 0:we.pointer(Se))||[0,0];y(Se,{x:ke,y:_e})}:void 0,ge=O.useCallback((Se,ke)=>{const _e=M.getState().nodeLookup.get(ke).internals.userNode;b==null||b(Se,_e)},[b]),oe=b?ge:void 0,xe=C??j["minimap.ariaLabel"];return x.jsx(Tx,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*G:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:$n(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:B,height:L,viewBox:`${de} ${F} ${X} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:D,onClick:ye,children:[xe&&x.jsx("title",{id:J,children:xe}),x.jsx(ale,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:c}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${de-re},${F-re}h${X+re*2}v${te+re*2}h${-X-re*2}z
342
- M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}k5.displayName="MiniMap";O.memo(k5);const mle=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,gle={[Zf.Line]:"right",[Zf.Handle]:"bottom-right"};function yle({nodeId:e,position:t,variant:n=Zf.Handle,className:r,style:s=void 0,children:i,color:l,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:g,autoScale:y=!0,shouldResize:b,onResizeStart:w,onResize:E,onResizeEnd:C}){const T=i5(),N=typeof e=="string"?e:T,R=sn(),M=O.useRef(null),D=n===Zf.Handle,k=Mt(O.useCallback(mle(D&&y),[D,y]),Sn),I=O.useRef(null),_=t??gle[n];O.useEffect(()=>{if(!(!M.current||!N))return I.current||(I.current=Kse({domNode:M.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:H,transform:z,snapGrid:U,snapToGrid:j,nodeOrigin:B,domNode:L}=R.getState();return{nodeLookup:H,transform:z,snapGrid:U,snapToGrid:j,nodeOrigin:B,paneDomNode:L}},onChange:(H,z)=>{const{triggerNodeChanges:U,nodeLookup:j,parentLookup:B,nodeOrigin:L}=R.getState(),$=[],q={x:H.x,y:H.y},G=j.get(N);if(G&&G.expandParent&&G.parentId){const W=G.origin??L,Z=H.width??G.measured.width??0,re=H.height??G.measured.height??0,de={id:G.id,parentId:G.parentId,rect:{width:Z,height:re,...Oz({x:H.x??G.position.x,y:H.y??G.position.y},{width:Z,height:re},G.parentId,j,W)}},F=l2([de],j,B,L);$.push(...F),q.x=H.x?Math.max(W[0]*Z,H.x):void 0,q.y=H.y?Math.max(W[1]*re,H.y):void 0}if(q.x!==void 0&&q.y!==void 0){const W={id:N,type:"position",position:{...q}};$.push(W)}if(H.width!==void 0&&H.height!==void 0){const Z={id:N,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};$.push(Z)}for(const W of z){const Z={...W,type:"position"};$.push(Z)}U($)},onEnd:({width:H,height:z})=>{const U={id:N,type:"dimensions",resizing:!1,dimensions:{width:H,height:z}};R.getState().triggerNodeChanges([U])}})),I.current.update({controlPosition:_,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:h},keepAspectRatio:m,resizeDirection:g,onResizeStart:w,onResize:E,onResizeEnd:C,shouldResize:b}),()=>{var H;(H=I.current)==null||H.destroy()}},[_,c,u,d,h,m,w,E,C,b]);const P=_.split("-");return x.jsx("div",{className:$n(["react-flow__resize-control","nodrag",...P,n,r]),ref:M,style:{...s,scale:k,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:i})}O.memo(yle);const xle={trigger:"",call:"",value:"[stroke-dasharray:7_5]",data:"[stroke-dasharray:1_6] [stroke-linecap:round]"},ble="M1 1 9 5 1 9z",vle="fill-current stroke-current [stroke-linejoin:round] [stroke-width:1.5]",Sle="fill-background stroke-current [stroke-linejoin:round] [stroke-width:1.5]",wle=["selected","hovered"],M5={selected:"text-primary",hovered:"text-primary/60"},A5=(e,t)=>t===null?e:`${e}-${t}`,R_=({baseId:e,isAssumed:t,emphasis:n})=>x.jsx("marker",{id:A5(e,n),viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",className:n===null?void 0:M5[n],children:x.jsx("path",{d:ble,className:t?Sle:vle})}),Ele="fill-none stroke-current [stroke-linejoin:round] [stroke-width:2]",Cle=()=>{const e=O.useId();return{proven:`${e}-proven`,assumed:`${e}-assumed`}},Nle=({markers:e})=>x.jsx("defs",{children:[null,...wle].map(t=>x.jsxs(O.Fragment,{children:[x.jsx(R_,{baseId:e.proven,isAssumed:!1,emphasis:t}),x.jsx(R_,{baseId:e.assumed,isAssumed:!0,emphasis:t})]},t??"plain"))}),Tle=({path:e,kind:t,isAssumed:n,emphasis:r=null,hasArrow:s=!0,markers:i})=>x.jsx("path",{d:e,"data-kind":t,"data-assumed":n,"data-emphasis":r??void 0,markerEnd:s?`url(#${A5(n?i.assumed:i.proven,r)})`:void 0,className:Ne(Ele,xle[t],"transition-colors duration-[180ms] ease-out",r!==null&&M5[r])}),Rle=new Set,Ole=(e,t)=>new Set(e.has(t)?[...e].filter(n=>n!==t):[...e,t]),kle='[data-focused="true"]',Mle=(e,t)=>{const n=Number.parseInt(e,10);return t.some(([r,s])=>r<=n&&n<=s)},Ale=(e,t)=>t===null?e:e.map(n=>({...n,isFocused:Mle(n.numberLabel,t)})),_le=({view:e,focusedLines:t=null,isReviewPending:n,codeLinks:r,codeDefinitions:s,onOpenCodeLink:i,onWaypointReviewedChange:l})=>{const[c,u]=O.useState(Rle),d=`${e.pathLabel}, ${e.rangeLabel}`,h=O.useRef(null),m=g=>x.jsx(h4,{blocks:g,codeLinks:r,onOpenCodeLink:i});return O.useEffect(()=>{var g,y;t!==null&&((y=(g=h.current)==null?void 0:g.querySelector(kle))==null||y.scrollIntoView({block:"center"}))},[t]),x.jsxs("section",{ref:h,"aria-label":`${e.heading}, ${d}`,className:"border-t",children:[x.jsxs("h4",{className:"px-4 pt-3 text-xs text-muted-foreground",children:[x.jsx("span",{className:"font-bold",children:e.heading}),e.countLabel===null?null:x.jsx("span",{className:"tabular-nums",children:` • ${e.countLabel}`})]}),x.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[x.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.pathLabel}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.rangeLabel})]}),x.jsx("div",{className:"border-y bg-code",children:e.rows.map(g=>g.kind==="lines"?x.jsx(lu,{lines:Ale(g.lines,t),definitions:s,label:d,path:e.pathLabel,isWrapped:!0,className:"py-0",renderDefinitionDescription:m},g.id):g.kind==="gap"?x.jsx("p",{className:"border-y bg-muted/60 py-0.5 pl-18 font-mono text-xs text-muted-foreground",children:g.label},g.id):x.jsx(UC,{waypoint:{...g.waypoint,anchorId:`${e.id}-${g.waypoint.anchorId}`},isOpen:c.has(g.waypoint.id),isCurrent:!1,isReviewPending:n,codeLinks:r,onOpenCodeLink:i,onToggle:()=>{u(y=>Ole(y,g.waypoint.id))},onReviewedChange:l===null?null:y=>{l(g.waypoint.id,y)}},g.id))}),e.note===null&&e.forgeLink===null?null:x.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1 px-4 py-2 text-xs",children:[e.note===null?null:x.jsx("span",{className:"text-muted-foreground",children:e.note}),e.forgeLink===null?null:x.jsx(dd,{href:e.forgeLink.href,label:e.forgeLink.label})]})]})},_5=264,Da=96,Dle=36,Ile=48,jle=16,Jf=24,gp=18,Lle=6,c2=6,Iw=10,Ple=8,u2=96,f2=32,Si=24,Ci=2,d2={nodes:[],rows:[],lanes:[]},h2=e=>e.reduce((t,n)=>t+n,0),zle={heading:jle,row:Dle,"two-line-row":Ile},D5=({kind:e})=>zle[e],jw=e=>h2(e.map(t=>D5(t)+c2)),yp=e=>{const t=e.children.map(yp),n=jw(e.rows)+h2(t.map(r=>r.height+c2));return{width:Math.max(_5,...t.map(r=>r.width+Iw*Ci)),height:Da+n+Ple}},I5=(e,t,n,r)=>{const{height:s}=yp(e),i={x:t.x+Iw,width:t.width-Iw*Ci},l=t.y+Da,c=e.rows.map((h,m)=>({...h,nodeId:e.id,...i,y:l+jw(e.rows.slice(0,m)),height:D5(h)})),u=l+jw(e.rows),d=e.children.reduce(({top:h,placed:m},g)=>({top:h+yp(g).height+c2,placed:[...m,I5(g,{...i,y:h},n+1,r)]}),{top:u,placed:[]});return{nodes:[{id:e.id,topId:r,depth:n,...t,height:s},...d.placed.flatMap(h=>h.nodes)],rows:[...c,...d.placed.flatMap(h=>h.rows)],lanes:[]}},j5=e=>[e.id,...e.children.flatMap(j5)],L5=e=>({nodes:e.flatMap(t=>t.nodes),rows:e.flatMap(t=>t.rows),lanes:e.flatMap(t=>t.lanes)}),Ble=(e,t)=>{const n=new Map(e.flatMap(r=>j5(r).map(s=>[s,r.id])));return t.flatMap(r=>{const s=n.get(r.from),i=n.get(r.to);return s===void 0||i===void 0||s===i?[]:[{edge:r,from:s,to:i}]})},Hle={visitedIds:new Set,closingLinks:[]},P5=(e,t,n,r)=>{if(r.visitedIds.has(e))return r;const s=[...t,e];return n.filter(i=>i.from===e).reduce((i,l)=>s.includes(l.to)?{...i,closingLinks:[...i.closingLinks,l]}:P5(l.to,s,n,i),{...r,visitedIds:new Set([...r.visitedIds,e])})},Fle=(e,t)=>{const n=new Set(t.map(i=>i.to)),r=[...e.filter(i=>!n.has(i.id)),...e.filter(i=>n.has(i.id))].map(i=>i.id),{closingLinks:s}=r.reduce((i,l)=>P5(l,[],t,i),Hle);return t.filter(i=>!s.includes(i))},$le=(e,t,n)=>new Map([...e].map(([r,s])=>{const i=t.filter(l=>l.to===r).map(l=>(e.get(l.from)??0)+1);return[r,Math.min(n,Math.max(s,...i))]})),Vle=e=>{const t=[...new Set(e.values())].sort((n,r)=>n-r);return new Map([...e].map(([n,r])=>[n,t.indexOf(r)]))},Ule=(e,t)=>{const n=Fle(e,t);return Vle(e.reduce(r=>$le(r,n,e.length-1),new Map(e.map(r=>[r.id,0]))))},my=(e,t)=>e.get(t)??0,qle=({from:e,to:t},n,r)=>my(r,e)<n&&n<my(r,t),Lw=e=>e.y+Da/Ci,Pw=e=>e.y+e.height/Ci,Gle=({from:e,fromRowId:t},{nodes:n,rows:r})=>{const s=t===null?void 0:r.find(l=>l.id===t);if(s!==void 0)return Pw(s);const i=n.find(l=>l.id===e);return i===void 0?null:Lw(i)},zw=({y:e,edgeIds:t},n)=>e+t.indexOf(n)*gp,gy=e=>(e.length-1)*gp,z5=(e,t,n)=>{const r=n.lanes.find(s=>s.toId===e.to&&s.column===t-1&&s.edgeIds.includes(e.edge.id));return r===void 0?Gle(e.edge,n):zw(r,e.edge.id)},Kle=(e,t,n,r,s)=>n.filter(i=>i.to===e&&my(r,i.from)<t).flatMap(i=>z5(i,t,s)??[]),Yle=(e,t,n,r)=>{const s=t.filter(i=>i.to===e).map((i,l)=>({link:i,index:l,comingFrom:z5(i,n,r)??0})).sort((i,l)=>i.comingFrom-l.comingFrom||i.index-l.index).map(({link:i})=>i.edge.id);return{node:null,toId:e,height:gy(s),anchorHeight:gy(s),edgeIds:s}},Wle=(e,t,n,r,s)=>{const i=n.filter(c=>qle(c,t,r)),l=[...new Set(i.map(c=>c.to))];return[...e.filter(c=>my(r,c.id)===t).map(c=>({node:c,toId:c.id,height:yp(c).height,anchorHeight:Da,edgeIds:[]})),...l.map(c=>Yle(c,i,t,s))]},Xle=({toId:e,anchorHeight:t},n)=>{const r=n(e);return r.length===0?Si:h2(r)/r.length-t/Ci},Qle=({node:e,toId:t,edgeIds:n},r,s)=>e===null?{...d2,lanes:[{toId:t,column:r,x:s.x,width:s.width,y:s.y,edgeIds:n}]}:I5(e,s,0,e.id),Zle=(e,t,n,r)=>{const s=e.map((l,c)=>({item:l,index:c,top:Xle(l,r)})).sort((l,c)=>l.top-c.top||l.index-c.index),i=Math.max(_5,...e.flatMap(({node:l})=>l===null?[]:[yp(l).width]));return s.reduce(({bottom:l,placement:c},{item:u,top:d})=>{const h=Math.round(Math.max(d,l,Si));return{bottom:h+u.height+f2,placement:L5([c,Qle(u,t,{x:n,y:h,width:i})])}},{bottom:Si,placement:d2}).placement},B5=({nodes:e,lanes:t})=>Math.max(Si-u2,...e.map(n=>n.x+n.width),...t.map(n=>n.x+n.width)),Jle=(e,t,n)=>[...new Set(n.values())].sort((s,i)=>s-i).reduce((s,i)=>{const l=Wle(e,i,t,n,s),c=Zle(l,i,B5(s)+u2,u=>Kle(u,i,t,n,s));return L5([s,c])},d2),eae=({edge:e},t)=>t.filter(n=>n.edgeIds.includes(e.id)).sort((n,r)=>n.column-r.column).flatMap(n=>[{x:n.x,y:zw(n,e.id)},{x:n.x+n.width,y:zw(n,e.id)}]),tae=(e,{nodes:t,rows:n,lanes:r})=>{const s=new Map(t.map(l=>[l.id,l])),i=new Map(n.map(l=>[l.id,l]));return e.flatMap(l=>{const{edge:c}=l,u=s.get(c.from),d=s.get(c.to),h=s.get(l.from),m=s.get(l.to);if(u===void 0||d===void 0||h===void 0||m===void 0)return[];const g=c.fromRowId===null?void 0:i.get(c.fromRowId),y=c.toRowId===null?void 0:i.get(c.toRowId);return[{link:l,start:{x:h.x+h.width,y:g===void 0?Lw(u):Pw(g)},lanePoints:eae(l,r),end:{x:m.x,y:y===void 0?Lw(d):Pw(y)},fromRow:g,toRow:y}]})},O_=({link:e,toRow:t})=>(t==null?void 0:t.id)??e.edge.to,k_=({start:e,lanePoints:t})=>t.length===0?e.y:t[t.length-1].y,nae=(e,t)=>{const n=t.filter(l=>O_(l)===O_(e)).map((l,c)=>({other:l,index:c})).sort((l,c)=>k_(l.other)-k_(c.other)||l.index-c.index),r=(e.toRow===void 0?Da:e.toRow.height)-Lle*Ci,s=n.length<Ci?0:Math.min(gp,r/(n.length-1)),i=n.findIndex(({other:l})=>l===e);return Math.round((i-(n.length-1)/Ci)*s)},H5=({start:e,end:t})=>e.x>=t.x,rae=(e,t,{nodes:n,lanes:r})=>Math.max(...n.filter(s=>s.x<t&&s.x+s.width>e).map(s=>s.y+s.height),...r.filter(s=>s.x<t&&s.x+s.width>e).map(s=>s.y+gy(s.edgeIds))),sae=(e,t,n,r)=>{const s=n.filter(H5),i=e.start.x+Jf+s.indexOf(e)*gp,l=t.x-Jf,c=Math.max(...s.map(u=>rae(u.end.x,u.start.x,r)))+f2/Ci+s.indexOf(e)*gp;return[{x:i,y:e.start.y},{x:i,y:c},{x:l,y:c},{x:l,y:t.y}]},iae=(e,t,n)=>{const{link:r,start:s,lanePoints:i,fromRow:l,toRow:c}=e,u={x:e.end.x,y:e.end.y+nae(e,t)},d=H5(e)?sae(e,u,t,n):[...i,{x:u.x-Jf,y:u.y}];return{...r.edge,points:[s,...d,u],fromRowPoints:l===void 0?null:[{x:l.x+l.width,y:s.y},s],toRowPoints:c===void 0?null:[u,{x:c.x,y:u.y}]}},oae=(e,t)=>{const n=tae(e,t);return n.map(r=>iae(r,n,t))},lae=(e,t)=>{if(e.length===0)return{width:Si*Ci,height:Si*Ci,nodes:[],rows:[],edges:[]};const n=Ble(e,t),r=Ule(e,n),s=Jle(e,n,r),i=oae(n,s),l=i.flatMap(c=>c.points);return{width:Math.max(B5(s),...l.map(c=>c.x))+Si,height:Math.max(...s.nodes.map(c=>c.y+c.height),...s.lanes.map(c=>c.y+gy(c.edgeIds)),...l.map(c=>c.y))+Si,nodes:s.nodes,rows:s.rows,edges:i}},F5=2,M_={x:0,y:0},Bw="left",A_=({x:e,y:t})=>e===0&&t===0,pf=(e,t)=>({...e,x:e.x+t.x,y:e.y+t.y}),aae=(e,t,n)=>{const r=t.map(c=>{var u;return(((u=n.get(c.id))==null?void 0:u.x)??c.x)+c.width}),s=Math.max(...r)+u2,i=t.map(c=>{var u;return((u=n.get(c.id))==null?void 0:u.y)??c.y}),l=e.reduce(({bottom:c,positions:u},d)=>({bottom:c+d.height+f2,positions:[...u,[d.id,{x:s,y:c}]]}),{bottom:Math.max(Si,Math.min(...i)),positions:[]});return new Map(l.positions)},cae=(e,{x:t,y:n,width:r,height:s})=>{const i=[["left",Math.abs(e.x-t)],["top",Math.abs(e.y-n)],["bottom",Math.abs(e.y-(n+s))]],l=e.x>t+r/F5,[c]=[...i].filter(([u])=>u!=="left"||!l).sort(([,u],[,d])=>u-d);return c[0]},uae=(e,t)=>{const n=e.nodes.filter(i=>i.depth===0),r=n.filter(i=>t.has(i.id)),s=n.filter(i=>!t.has(i.id));return r.length===0||s.length===0?t:new Map([...t,...aae(s,r,t)])},fae=(e,t)=>{const n=e.x+e.width/F5;return t==="top"?[{x:n,y:e.y-Jf},{x:n,y:e.y}]:[{x:n,y:e.y+e.height+Jf},{x:n,y:e.y+e.height}]},dae=(e,t,n,r,s)=>{const i=pf(e.points[0],t),l=e.fromRowPoints===null?null:e.fromRowPoints.map(u=>pf(u,t));if(r!==Bw&&s!==void 0)return{...e,points:[i,...fae(s,r)],fromRowPoints:l,toRowPoints:null};const c=pf(e.points[e.points.length-1],n);return{...e,points:[i,{x:c.x-Jf,y:c.y},c],fromRowPoints:l,toRowPoints:e.toRowPoints===null?null:e.toRowPoints.map(u=>pf(u,n))}},hae=(e,t,n)=>{const r=e.nodes.filter(h=>h.depth===0),s=new Map(r.map(h=>{const m=t.get(h.id);return[h.id,m===void 0?M_:{x:m.x-h.x,y:m.y-h.y}]})),i=h=>s.get(h)??M_,l=e.nodes.map(h=>pf(h,i(h.topId))),c=new Map(l.map(h=>[h.id,h])),u=h=>{var m;return i(((m=c.get(h))==null?void 0:m.topId)??h)},d=e.edges.map(h=>{const m=u(h.from),g=u(h.to),y=n.get(h.id)??Bw;return A_(m)&&A_(g)&&y===Bw?h:dae(h,m,g,y,c.get(h.to))});return{width:Math.max(e.width,...l.map(h=>h.x+h.width+Si)),height:Math.max(e.height,...l.map(h=>h.y+h.height+Si)),nodes:l,rows:e.rows.map(h=>pf(h,u(h.nodeId))),edges:d}},pae={x:0,y:0},$5=e=>e.flatMap(t=>[...t.children.map(n=>[n.id,t.id]),...$5(t.children)]),yy=(e,t)=>({...e,x:e.x-t.x,y:e.y-t.y}),xy=(e,t)=>`${e}:${t}`,mae=({id:e,from:t,to:n,points:r,fromRowPoints:s,toRowPoints:i})=>[{id:e,edgeId:e,source:t,target:n,points:r,hasArrow:i===null,isAboveNodes:!1},...s===null?[]:[{id:`${e}:from-row`,edgeId:e,source:t,target:t,points:s,hasArrow:!1,isAboveNodes:!0}],...i===null?[]:[{id:`${e}:to-row`,edgeId:e,source:n,target:n,points:i,hasArrow:!0,isAboveNodes:!0}]],gae=e=>{const t=e.flatMap(mae);return[...t.filter(n=>!n.isAboveNodes),...t.filter(n=>n.isAboveNodes)]},yae=(e,t)=>t.flatMap(({id:n,source:r,target:s,points:i})=>[...r===e.id?[{id:xy(n,"source"),type:"source",...yy(i[0],e)}]:[],...s===e.id?[{id:xy(n,"target"),type:"target",...yy(i[i.length-1],e)}]:[]]),xae=({id:e,edgeId:t,source:n,target:r,points:s,hasArrow:i,isAboveNodes:l})=>({id:e,edgeId:t,source:n,target:r,sourceHandleId:xy(e,"source"),targetHandleId:xy(e,"target"),bends:s.slice(1,-1),hasArrow:i,isAboveNodes:l}),bae=(e,t)=>{const n=new Map($5(e)),r=new Map(t.nodes.map(i=>[i.id,i])),s=gae(t.edges);return{frames:t.nodes.map(i=>{const l=n.get(i.id)??null,c=l===null?void 0:r.get(l);return{id:i.id,parentId:c===void 0?null:c.id,depth:i.depth,position:yy({x:i.x,y:i.y},c??pae),width:i.width,height:i.height,rows:t.rows.filter(u=>u.nodeId===i.id).map(u=>yy(u,i)),handles:yae(i,s)}}),lines:s.map(xae)}},by={"root-argument-value":R0,call:dw,request:dw,component:UW,hook:zP,class:KW,"root-variable":R0,config:R0,state:lf,derived:lf,data:lf,"data-fetch":lf,cache:lf,"render-event":WM,"code-event":WM,effect:hw,"component-effect":hw,route:VS,resolver:VS,middleware:VS},p2={added:"border-diff-added",modified:"border-line-blue"},vae={added:"text-diff-added",modified:"text-line-blue"},Sae={selected:"border-primary outline outline-primary",hovered:"border-primary/60 outline outline-primary/60"},V5={selected:"bg-accent outline outline-primary",hovered:"outline outline-primary/60"},__={collapsedNodeIds:[],focusedNodeId:null},wae="call",Qo=2,U5="journey-node",q5="journey-new-card",Hw="journey-new-card",Fw="new-card:line-end",D_="journey-new-card-line",Oh=32,I_="Create Card",Eae="nodrag nopan flex size-full items-center justify-center rounded-full border border-dashed border-primary bg-card text-primary transition-colors duration-[180ms] ease-out hover:bg-accent disabled:opacity-60",$w="journey-line",e1=1e3,Cae=4,G5={source:qe.Right,target:qe.Left},K5="right-auto bottom-auto size-0 min-h-0 min-w-0 transform-none border-0 bg-transparent",Nae="size-full bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[measured=false]:invisible",Tae={hideAttribution:!0},Vw="text-muted-foreground",j_={pointerEvents:"all"},Rae="absolute inset-0 rounded-md transition-colors duration-[180ms] ease-out",Oae="flex w-full flex-col rounded-md text-left",kae="flex h-7 shrink-0 items-center gap-2 rounded-t-md border-b border-input bg-foreground/5 px-2.5",Mae="flex min-h-0 flex-1 flex-col justify-center gap-1 px-3",L_={argument:R0,state:lf,hook:zP,effect:hw,call:dw},Y5="absolute flex items-center gap-2 rounded border border-input bg-card px-2 text-left transition-colors duration-[180ms] ease-out hover:bg-accent",Aae="absolute top-1 right-1 z-10 hidden gap-0.5 rounded-md border border-input bg-card p-0.5 group-focus-within:flex group-hover:flex data-[pinned=true]:flex",s0="flex size-6 items-center justify-center rounded text-foreground transition-colors duration-[180ms] ease-out hover:bg-accent aria-pressed:text-primary-text",_ae="absolute flex items-end px-0.5 text-[0.625rem] leading-3 font-bold tracking-wide text-muted-foreground uppercase",P_="Show only the paths through this node",Dae="Hide the nodes this node leads to",Iae="Show the nodes this node leads to again",z_="Modify this card",B_="Delete this card and the cards it points to",jae="Remove the selected line",Lae="Add a card",Pae="Clear the diagram",zae="Remove the diagram",Bae="Draw a line from this row",W5=["left","top","bottom"],Hae={left:qe.Left,top:qe.Top,bottom:qe.Bottom},Fae={left:"End a line on the left of this card",top:"End a line on the top of this card",bottom:"End a line on the bottom of this card"},xp="row:",$ae="side:",H_=5,F_=10,Vae="nodrag right-auto bottom-auto z-10 size-2.5 min-h-0 min-w-0 transform-none rounded-full border border-primary bg-card opacity-60 transition-opacity duration-[180ms] ease-out hover:opacity-100",Uae="cursor-pointer fill-none stroke-transparent [stroke-width:14]",qae=new Map,Gae=".react-flow__node",Kae=28,Yae={stroke:"var(--primary)",strokeWidth:2},Wae="Collapse all",Xae="Expand all",m2=e=>e.flatMap(t=>[t,...m2(t.children)]),Qae=":heading:",X5=(e,t)=>[e.id,String(t)].join(Qae),Q5=e=>e.blockLists.flatMap(({kind:t,label:n,blocks:r})=>r.map(s=>({kind:t,kindLabel:n,block:s}))),Zae=e=>e.rowGroups.flatMap(({label:t},n)=>t===null?[]:[{id:X5(e,n),label:t}]),Jae=({isDraft:e})=>e?"row":"two-line-row",ece=e=>{const t=new Map([...e.blockLists.flatMap(({blocks:n})=>n),...e.triggerLabels].map(n=>[n.id,n]));return e.rowGroups.flatMap(({label:n,rowIds:r},s)=>[...n===null?[]:[{id:X5(e,s),kind:"heading"}],...r.flatMap(i=>{const l=t.get(i);return l===void 0?[]:[{id:i,kind:Jae(l)}]})])},Z5=e=>({id:e.id,rows:ece(e),children:e.children.map(Z5)}),tce=e=>new Map(e.flatMap(t=>m2([t]).map(n=>[n.id,t.id]))),nce=(e,t)=>e.flatMap(n=>{const r=t.get(n.from),s=t.get(n.to);return r===void 0||s===void 0||r===s?[]:[{id:n.id,from:r,to:s}]}),$_=(e,t,{collapsedNodeIds:n,focusedNodeId:r})=>{const s=e.filter(u=>t.every(d=>d.to!==u.id)).map(u=>u.id),i=[...zZ(t,n,s)].filter(u=>!n.includes(u)),l=r===null?null:PZ(t,r),c=l===null?[]:e.filter(u=>!l.has(u.id)).map(u=>u.id);return new Set([...i,...c])},rce=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],V_=(e,t,n)=>t.has(e)?"selected":n.has(e)?"hovered":null,sce=(e,t)=>{const n=e===null?"border":"border-2";return t!==null?Ne(n,Sae[t]):Ne(n,e===null?"border-input":p2[e])},g2=({x:e,y:t,width:n,height:r})=>({left:e,top:t,width:n,height:r}),ice=({node:e,cardActions:t,depth:n,emphasis:r,isSelected:s,isCollapsed:i,isFocusedOn:l,onSelect:c,onHoverChange:u,onFocusToggle:d,onCollapseToggle:h})=>{const m=Object.hasOwn(by,e.type)?by[e.type]:_C,g=i?kC:WP,y=i?Iae:Dae;return x.jsxs("div",{"data-node-id":e.id,"data-type":e.type,"data-change":e.change??void 0,"data-emphasis":r??void 0,className:Ne("group",Rae,n%Qo===1?"bg-muted":"bg-card",sce(e.change,r)),children:[x.jsxs("button",{type:"button","aria-pressed":s,className:Oae,style:{height:Da},onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},onFocus:()=>{u(!0)},onBlur:()=>{u(!1)},onClick:c,children:[x.jsxs("span",{"data-node-header":e.id,className:kae,children:[x.jsx(m,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"max-w-[60%] shrink-0 truncate font-mono text-[0.75rem] leading-4 font-bold",children:e.name}),x.jsx("span",{title:e.shortPath,className:"ml-auto min-w-0 truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:e.shortPath})]}),x.jsxs("span",{className:Mae,children:[x.jsxs("span",{className:"flex items-center text-[0.6875rem] leading-4 text-muted-foreground",children:[x.jsx("span",{children:e.typeLabel}),e.change===null||e.changedLabel===null?null:x.jsx("span",{className:Ne("ml-auto font-bold",vae[e.change]),children:e.changedLabel})]}),x.jsx(so,{isPending:e.isDraft,lineCount:2,className:"w-full gap-1 py-0 text-[0.8125rem] [&>[aria-hidden]]:my-[0.2em]",children:e.isDraft?null:x.jsx("span",{className:"line-clamp-2 text-[0.8125rem] leading-4 font-bold",children:e.label})})]})]}),n>0&&t===null?null:x.jsxs("div",{role:"toolbar","aria-label":e.label,"data-pinned":l||i,className:Ne("nodrag",Aae),children:[t===null?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button","aria-label":`${z_}: ${e.label}`,title:z_,className:s0,onClick:t.onEdit,children:x.jsx(m3,{"aria-hidden":"true",className:"size-3.5"})}),x.jsx("button",{type:"button",disabled:t.isPending,"aria-label":`${B_}: ${e.label}`,title:B_,className:s0,onClick:t.onRemove,children:x.jsx(AC,{"aria-hidden":"true",className:"size-3.5"})})]}),n>0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button","aria-pressed":l,"aria-label":`${P_}: ${e.label}`,title:P_,className:s0,onClick:d,children:x.jsx(JW,{"aria-hidden":"true",className:"size-3.5"})}),x.jsx("button",{type:"button","aria-pressed":i,"aria-label":`${y}: ${e.label}`,title:y,className:s0,onClick:h,children:x.jsx(g,{"aria-hidden":"true",className:"size-3.5"})})]})]})]})},oce=({trigger:e,placed:t,emphasis:n,onSelect:r,onHoverChange:s})=>{const i=Object.hasOwn(by,e.type)?by[e.type]:_C;return x.jsxs("button",{type:"button","data-trigger-id":e.id,"data-change":e.change??void 0,"aria-label":`${e.typeLabel}: ${e.label}`,className:Ne(Y5,e.change!==null&&p2[e.change],n!==null&&V5[n]),style:g2(t),onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},onFocus:()=>{s(!0)},onBlur:()=>{s(!1)},onClick:r,children:[x.jsx(i,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsxs("span",{className:"flex min-w-0 flex-col",children:[x.jsx(so,{isPending:e.isDraft,className:"h-4 w-24 py-0 text-[0.75rem]",children:x.jsx("span",{className:Ne("truncate text-[0.75rem] leading-4",e.isDraft?"font-mono text-muted-foreground":"font-bold"),children:e.label})}),e.isDraft?null:x.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:e.name})]})]})},lce=({row:{kind:e,kindLabel:t,block:n},placed:r,emphasis:s,onSelect:i,onHoverChange:l})=>{const c=Object.hasOwn(L_,e)?L_[e]:_C;return x.jsxs("button",{type:"button","data-block-id":n.id,"data-block-kind":e,"data-change":n.change??void 0,"aria-label":`${t}: ${n.label}`,className:Ne(Y5,n.change!==null&&p2[n.change],s!==null&&V5[s]),style:g2(r),onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},onFocus:()=>{l(!0)},onBlur:()=>{l(!1)},onClick:i,children:[x.jsx(c,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsxs("span",{className:"flex min-w-0 flex-col",children:[x.jsx(so,{isPending:n.isDraft,className:"h-4 w-24 py-0 text-[0.75rem]",children:x.jsx("span",{className:Ne("truncate text-[0.75rem] leading-4",n.isDraft?"font-mono text-muted-foreground":"font-bold"),children:n.label})}),n.isDraft?null:x.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:n.name})]})]})},J5=e=>`${xp}${e}`,y2=e=>`${$ae}${e}`,ace=(e,{width:t,height:n})=>e==="left"?{x:0,y:Da/Qo}:{x:t/Qo,y:e==="top"?0:n},U_=({x:e,y:t})=>({x:e-H_,y:t-H_}),eB=e=>[...e.rows.filter(t=>t.kind!=="heading").map(t=>({id:J5(t.id),type:"source",position:qe.Right,title:Bae,...U_({x:e.width,y:t.y+t.height/Qo})})),...W5.map(t=>({id:y2(t),type:"target",position:Hae[t],title:Fae[t],...U_(ace(t,e))}))],cce=({data:{node:e,frame:t,cardActions:n,emphasis:r,isSelected:s,isCollapsed:i,isFocusedOn:l,onSelect:c,onHoverChange:u,onFocusToggle:d,onCollapseToggle:h}})=>{const m=new Map(Zae(e).map(b=>[b.id,b])),g=new Map(Q5(e).map(b=>[b.block.id,b])),y=new Map(e.triggerLabels.map(b=>[b.id,b]));return x.jsxs(x.Fragment,{children:[x.jsx(ice,{node:e,cardActions:n,depth:t.depth,emphasis:r,isSelected:s,isCollapsed:i,isFocusedOn:l,onSelect:()=>{c(null)},onHoverChange:u,onFocusToggle:d,onCollapseToggle:h}),t.rows.flatMap(b=>{const w=m.get(b.id),E=g.get(b.id),C=y.get(b.id);if(w!==void 0)return[x.jsx("span",{"data-row-heading":e.id,className:_ae,style:g2(b),children:w.label},b.id)];const T=()=>{c(b.id)};return E!==void 0?[x.jsx(lce,{row:E,placed:b,emphasis:r,onSelect:T,onHoverChange:u},b.id)]:C===void 0?[]:[x.jsx(oce,{trigger:C,placed:b,emphasis:r,onSelect:T,onHoverChange:u},b.id)]}),t.handles.map(b=>x.jsx(Gc,{id:b.id,type:b.type,position:G5[b.type],isConnectable:!1,className:K5,style:{left:b.x,top:b.y}},b.id)),n===null?null:eB(t).map(b=>x.jsx(Gc,{id:b.id,type:b.type,position:b.position,title:b.title,className:Vae,style:{left:b.x,top:b.y}},b.id))]})},q_=({x:e,y:t})=>({x:Math.round(e),y:Math.round(t)}),uce=({sourceX:e,sourceY:t,targetX:n,targetY:r,data:s})=>s===void 0?null:x.jsxs(x.Fragment,{children:[x.jsx(Tle,{path:xw([{x:e,y:t},...s.bends,{x:n,y:r}].map(q_)),kind:wae,isAssumed:!1,emphasis:s.emphasis,hasArrow:s.hasArrow,markers:s.markers}),s.isSelectable?x.jsx("path",{d:xw([{x:e,y:t},...s.bends,{x:n,y:r}].map(q_)),className:Uae}):null]}),fce=({data:{isPending:e,onCreate:t}})=>x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:e,"aria-label":I_,title:I_,className:Eae,onClick:t,children:x.jsx(MC,{"aria-hidden":"true",className:"size-4"})}),x.jsx(Gc,{id:Fw,type:"target",position:qe.Left,isConnectable:!1,className:K5,style:{left:0,top:Oh/Qo}})]}),dce={[U5]:cce,[q5]:fce},hce={[$w]:uce},pce=e=>e.width,G_=({source:e,target:t})=>e!==t,mce=e=>{const t="changedTouches"in e?e.changedTouches.item(0):e;return t===null?null:{x:t.clientX,y:t.clientY}},gce=(e,{isValid:t,fromNode:n,fromHandle:r})=>{var d;const s=mce(e);if(t===!0||s===null||n===null)return null;const i=r.id??null;if((i==null?void 0:i.startsWith(xp))!==!0)return null;const l=((d=document.elementFromPoint(s.x,s.y))==null?void 0:d.closest(Gae))??null,c=(l==null?void 0:l.dataset.id)??null;if(l===null||c===null||c===Hw)return{kind:"board",line:{from:n.id,fromRowId:i.slice(xp.length)},point:s};const u=y2(cae(s,l.getBoundingClientRect()));return{kind:"card",connection:{source:n.id,sourceHandle:i,target:c,targetHandle:u}}},yce=({label:e,authoring:t,width:n,view:{zoom:r,offset:s,onPan:i},nodes:l,edges:c,markers:u})=>{const d=Mt(pce),{screenToFlowPosition:h}=Rx(),m=Math.max(0,(d-n*r)/Qo),g=(b,w)=>{const E=gce(b,w);(E==null?void 0:E.kind)==="card"&&G_(E.connection)&&(t==null||t.onConnect(E.connection)),(E==null?void 0:E.kind)==="board"&&(t==null||t.onLineDropOnBoard(E.line,E.point,h))},y=b=>{b.forEach(w=>{w.type==="position"&&w.position!==void 0&&(t==null||t.onCardDrag(w.id,w.position))})};return x.jsx("div",{role:"group","aria-label":e,"data-measured":d>0,className:Nae,style:{backgroundPosition:`${String(s.x)}px ${String(s.y)}px`},children:x.jsx(qoe,{nodes:l,edges:c,nodeTypes:dce,edgeTypes:hce,viewport:{x:m+s.x,y:s.y,zoom:r},onViewportChange:({x:b,y:w})=>{i({x:b-m,y:w})},zIndexMode:"manual",paneClickDistance:Cae,nodesDraggable:t!==null,nodesConnectable:t!==null,isValidConnection:G_,onNodesChange:t===null?void 0:y,onNodeDragStop:t===null?void 0:(b,w)=>{t.onCardDrop(w.id,w.position)},onConnect:t===null?void 0:t.onConnect,onConnectEnd:t===null?void 0:g,connectionRadius:Kae,connectionLineStyle:Yae,onEdgeClick:t===null?void 0:(b,w)=>{w.data!==void 0&&t.onLineSelect(w.data.edgeId)},onPaneClick:t===null?void 0:t.onBoardClick,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,deleteKeyCode:null,disableKeyboardA11y:!0,proOptions:Tae,children:x.jsx("svg",{"aria-hidden":"true",className:Ne("absolute size-0",Vw),children:x.jsx(Nle,{markers:u})})})})},xce=({source:e,sourceHandle:t,target:n,targetHandle:r})=>{const s=W5.find(i=>y2(i)===r);return(t==null?void 0:t.startsWith(xp))!==!0||s===void 0?null:{from:e,fromRowId:t.slice(xp.length),to:n,toSide:s}},bce=({title:e,nodes:t,edges:n,codeLinks:r,codeDefinitions:s,isReviewPending:i,authoring:l=null,onOpenCodeLink:c,onWaypointReviewedChange:u})=>{var Oe,De;const[d,h]=O.useState(qae),[m,g]=O.useState(null),[y,b]=O.useState(null),[w,E]=O.useState(null),[C,T]=O.useState(null),[N,R]=O.useState(null),[M,D]=O.useState(__),[k,I]=O.useState(!1),_=Cle(),{collapsedNodeIds:P,focusedNodeId:H}=M,z=tce(t),U=nce(n,z),j=$_(t,U,M),B=t.filter(ne=>!j.has(ne.id)),L=m2(B),$=new Set(L.map(ne=>ne.id)),q=n.filter(ne=>$.has(ne.from)&&$.has(ne.to)),G=B.map(Z5),W=lae(G,q),Z=new Map(t.flatMap(ne=>ne.position===null?[]:[[ne.id,ne.position]])),re=new Map([...uae(W,Z),...d]),de=hae(W,re,new Map(q.map(ne=>[ne.id,ne.toSide]))),F=q.find(ne=>ne.id===m)??null,X=de.nodes.filter(ne=>ne.depth===0).map(ne=>({nodeId:ne.id,x:ne.x,y:ne.y})),te=l===null?null:{onCardDrag:(ne,he)=>{h(se=>new Map([...se,[ne,he]]))},onCardDrop:(ne,he)=>{l.onMoveCards(X.map(se=>se.nodeId===ne?{nodeId:ne,x:he.x,y:he.y}:se))},onLineDropOnBoard:(ne,he,se)=>{b({...ne,end:se(he),cardCount:t.length})},onConnect:ne=>{const he=xce(ne);he!==null&&l.onDrawLine(he)},onLineSelect:g,onBoardClick:()=>{g(null),b(null)}},J=l!==null&&y!==null&&y.cardCount===t.length&&$.has(y.from)?y:null,K=bae(G,de),ce=new Map(L.map(ne=>[ne.id,ne])),ye=new Map(L.flatMap(ne=>Q5(ne).map(he=>[he.block.id,he]))),ge=new Map(L.flatMap(ne=>ne.triggerLabels.map(he=>[he.id,he]))),oe=bw(q,w),xe=bw(q,N),Se=w===null?null:ce.get(w)??null,ke=(Se==null?void 0:Se.codeLinkId)==null||!Object.hasOwn(r,Se.codeLinkId)?null:r[Se.codeLinkId],_e=C===null?null:((Oe=ye.get(C))==null?void 0:Oe.block.lines)??((De=ge.get(C))==null?void 0:De.lines)??null,we=(ne,he)=>{E(ne),T(he),I(!0)},Re=ne=>{D(ne),R(null);const he=w===null?void 0:z.get(w);he!==void 0&&$_(t,U,ne).has(he)&&E(null)},Ae=t.filter(ne=>U.some(he=>he.from===ne.id)).map(ne=>ne.id),Le=K.frames.flatMap(ne=>{const he=ce.get(ne.id);return he===void 0?[]:[{id:ne.id,type:U5,...ne.parentId===null?{}:{parentId:ne.parentId},position:ne.position,width:ne.width,height:ne.height,zIndex:ne.depth,draggable:l!==null&&ne.depth===0,style:j_,handles:[...ne.handles.map(({id:se,type:Te,x:Ve,y:jt})=>({id:se,type:Te,position:G5[Te],x:Ve,y:jt,width:0,height:0})),...l===null?[]:eB(ne).map(({id:se,type:Te,position:Ve,x:jt,y:hn})=>({id:se,type:Te,position:Ve,x:jt,y:hn,width:F_,height:F_}))],data:{node:he,frame:ne,cardActions:l===null?null:{isPending:l.isPending,onEdit:()=>{l.onEditCard(ne.id)},onRemove:()=>{l.onRemoveCard(ne.id)}},emphasis:V_(ne.id,oe.nodeIds,xe.nodeIds),isSelected:ne.id===w,isCollapsed:P.includes(ne.id),isFocusedOn:ne.id===H,onSelect:se=>{we(ne.id,se)},onHoverChange:se=>{R(se?ne.id:null)},onFocusToggle:()=>{Re({...M,focusedNodeId:ne.id===H?null:ne.id})},onCollapseToggle:()=>{Re({...M,collapsedNodeIds:rce(P,ne.id)})}}}]}),Ie=K.lines.map(ne=>({id:ne.id,type:$w,source:ne.source,target:ne.target,sourceHandle:ne.sourceHandleId,targetHandle:ne.targetHandleId,zIndex:ne.isAboveNodes?e1:0,className:Ne(Vw,l!==null&&ne.isAboveNodes&&"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:ne.edgeId,isSelectable:l!==null&&!ne.isAboveNodes,bends:ne.bends,emphasis:ne.edgeId===m?"selected":V_(ne.edgeId,oe.edgeIds,xe.edgeIds),hasArrow:ne.hasArrow,markers:_}})),Ue=l===null||J===null?[]:[{id:Hw,type:q5,position:{x:J.end.x,y:J.end.y-Oh/Qo},width:Oh,height:Oh,zIndex:e1,draggable:!1,style:j_,handles:[{id:Fw,type:"target",position:qe.Left,x:0,y:Oh/Qo,width:0,height:0}],data:{isPending:l.isPending,onCreate:()=>{const{from:ne,fromRowId:he,end:se}=J;l.onAddCardAtLineEnd({from:ne,fromRowId:he,position:{x:se.x,y:se.y-Da/Qo},places:X})}}}],We=J===null?[]:[{id:D_,type:$w,source:J.from,target:Hw,sourceHandle:J5(J.fromRowId),targetHandle:Fw,zIndex:e1,className:Ne(Vw,"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:D_,isSelectable:!1,bends:[],emphasis:null,hasArrow:!0,markers:_}}];return x.jsx(K3,{label:e,width:de.width,height:de.height,isFullScreen:k,onFullScreenChange:ne=>{I(ne),ne||E(null)},onPanelClose:()=>{E(null)},actions:x.jsxs(x.Fragment,{children:[l===null||F===null?null:x.jsx(un,{icon:"delete",label:jae,labelPlace:"beside",isDisabled:l.isPending,onClick:()=>{l.onRemoveLine({edgeId:F.id,from:F.from,to:F.to}),g(null)}}),l===null?null:x.jsxs(x.Fragment,{children:[x.jsx(un,{icon:"add",label:Lae,labelPlace:"beside",onClick:l.onAddCard}),x.jsx(un,{icon:"clear",label:Pae,labelPlace:"beside",isDisabled:l.isPending||t.length===0,onClick:l.onClearDiagram}),x.jsx(un,{icon:"remove",label:zae,labelPlace:"beside",isDisabled:l.isPending,onClick:l.onRemoveDiagram}),x.jsx("span",{"aria-hidden":"true",className:"mx-0.5 h-5 w-px bg-border"})]}),x.jsx(un,{icon:"collapse-all",label:Wae,labelPlace:"beside",onClick:()=>{Re({collapsedNodeIds:Ae,focusedNodeId:null})}}),x.jsx(un,{icon:"expand-all",label:Xae,labelPlace:"beside",onClick:()=>{Re(__)}})]}),panel:Se===null?null:x.jsx(d4,{title:Se.label,kindLabel:Se.typeLabel,target:Se.codeViews.length===0?ke:null,codeViews:Se.codeViews.map(ne=>x.jsx(_le,{view:ne,focusedLines:_e,isReviewPending:i,codeLinks:r,codeDefinitions:s,onOpenCodeLink:c,onWaypointReviewedChange:u},ne.id)),onClose:()=>{E(null)},children:Se.description===null?null:x.jsx(Hs,{blocks:Se.description,codeLinks:r,onOpenCodeLink:c})}),renderCanvas:ne=>x.jsx(T5,{children:x.jsx(yce,{label:e,authoring:te,width:de.width,view:ne,nodes:[...Le,...Ue],edges:[...Ie,...We],markers:_})})})},vce="Add a diagram",Sce="Edit",wce="This segment has no Journey Flow Diagram.",Ece=3,t1="max-w-[44rem] pb-4",Cce=({heading:e,diagram:t,codeLinks:n,editing:r,renderEditor:s,onOpenCodeLink:i})=>(r==null?void 0:r.isWriting)===!0&&s!==null?x.jsx("div",{className:"pb-4",children:s({label:`${e} description`,markdown:t.descriptionMarkdown,isSaving:r.isSaving,errorMessage:r.errorMessage,onSave:r.onSave,onCancel:r.onCancel})}):t.description===null?x.jsx(so,{isPending:!0,lineCount:Ece,className:Ne(t1,"text-base"),children:x.jsx("p",{className:Ne(t1,"text-muted-foreground"),children:t.unwrittenLabel})}):x.jsx(Hs,{blocks:t.description,codeLinks:n,className:t1,onOpenCodeLink:i}),Nce=({anchorId:e,heading:t,diagram:n,codeLinks:r,codeDefinitions:s,isReviewPending:i,authoring:l=null,renderDescriptionEditor:c=null,onOpenCodeLink:u,onWaypointReviewedChange:d})=>{const h=l!==null&&n!==null&&c!==null&&!l.description.isWriting;return x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[x.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),l!==null&&n===null?x.jsx(nt,{variant:"link",size:"sm",disabled:l.board.isPending,onClick:l.onAddDiagram,children:vce}):null,h?x.jsx(nt,{variant:"link",size:"sm",onClick:l.description.onEdit,children:Sce}):null]}),l!==null&&n===null?x.jsx("p",{className:"text-muted-foreground",children:wce}):null,n===null?null:x.jsxs("section",{id:n.anchorId,"aria-label":n.title,className:"scroll-mt-(--section-scroll-margin)",children:[x.jsx(Cce,{heading:t,diagram:n,codeLinks:r,editing:(l==null?void 0:l.description)??null,renderEditor:c,onOpenCodeLink:u}),x.jsx(bce,{title:n.title,nodes:n.nodes,edges:n.edges,codeLinks:r,codeDefinitions:s,isReviewPending:i,authoring:(l==null?void 0:l.board)??null,onOpenCodeLink:u,onWaypointReviewedChange:d})]})]})},Tce=140,Rce=e=>e.reduce((t,n)=>{const r=document.getElementById(n);return r!==null&&r.getBoundingClientRect().top<=Tce?n:t},e.find((t,n)=>n===0)??null),Oce=e=>{const[t,n]=O.useState(null),r=e.join(`
343
- `);return O.useEffect(()=>{const s=()=>{n(Rce(r===""?[]:r.split(`
344
- `)))};return s(),window.addEventListener("scroll",s,{passive:!0}),()=>{window.removeEventListener("scroll",s)}},[r]),t},tB=O.createContext(void 0);function pd(e){const t=O.useContext(tB);if(t===void 0&&!e)throw new Error(wn(47));return t}const kce={...Xp,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class Mce extends fd{constructor(n,r,s){const i=new Yp;super(Ace(n,i,r,s),_ce(i),kce);_t(this,"setOpen",(n,r)=>{var m,g;const s=r.reason===xn,i=r.reason===rl&&r.event.detail===0,l=!n&&(r.reason===Bp||r.reason==null),c=SC(r),u=this.select("activeTriggerId");if(!n&&r.reason===PL&&r.trigger==null&&u!=null&&(r.trigger=this.context.triggerElements.getById(u)??this.select("activeTriggerElement")??void 0),(g=(m=this.context).onOpenChange)==null||g.call(m,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const d=()=>{const y=sx(this.state,n,r.trigger,c());y.openChangeReason=r.reason,this.update(y)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(nP,()=>{this.set("stickIfOpen",!1)}),Bs.flushSync(d)):d();let h;i?h="click":l?h="dismiss":r.reason===Bc&&(h="focus"),this.set("instantType",h)})}}function Ace(e,t,n,r=!1){const s={...Wp(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&(e==null?void 0:e.mounted)===void 0&&(s.mounted=!0),s}function _ce(e){return{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:O.createRef(),beforeContentFocusGuardRef:O.createRef(),stickIfOpenTimeout:new si,triggerElements:e}}const K_=ud(function({props:t}){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:l,modal:c=!1,handle:u,triggerId:d,defaultTriggerId:h=null}=t,m=Ice(u,{modal:c,open:s,openProp:r,activeTriggerId:h,triggerIdProp:d});m.useControlledProp("openProp",r),m.useControlledProp("triggerIdProp",d);const g=m.useState("open"),y=m.useState("mounted"),b=m.useState("payload");m.useContextCallback("onOpenChange",i),m.useContextCallback("onOpenChangeComplete",l),RP(m,g),qp(m);const{forceUnmount:w}=Gp(g,m,()=>{m.update({stickIfOpen:!0,openChangeReason:null})});m.useSyncedValues({modal:c}),O.useEffect(()=>{g||m.context.stickIfOpenTimeout.clear()},[m,g]),O.useImperativeHandle(t.actionsRef,()=>({unmount:w,close:()=>m.setOpen(!1,gt(Hp))}),[w,m]);const E=g||y;return x.jsxs(tB.Provider,{value:m,children:[u&&x.jsx(Up,{handle:u,store:m}),E&&x.jsx(jce,{store:m,modal:c}),typeof n=="function"?n({payload:b}):n]})});function Dce(e){return pd(!0)?x.jsx(K_,{props:e}):x.jsx(gC,{children:x.jsx(K_,{props:e})})}function Ice(e,t){const n=rx((r,s)=>new Mce(t,r,s));return O.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function jce({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=$p(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,i=r.floating;return Kp(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:i}),null}const Lce=300,x2=tx(function(t,n){const{render:r,className:s,style:i,disabled:l=!1,nativeButton:c=!0,handle:u,payload:d,openOnHover:h=!1,delay:m=Lce,closeDelay:g=0,id:y,...b}=t,w=pd(!0),C=ox(u)??w;if(!C)throw new Error(wn(74));const T=lo(y),N=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),M=C.useState("isOpenedByTrigger",T),D=C.useState("triggerPopupId",T),k=O.useRef(null),{registerTrigger:I,isMountedByThisTrigger:_}=ix(T,k,C,{payload:d,disabled:l,openOnHover:h,closeDelay:g}),P=C.useState("openChangeReason"),H=C.useState("stickIfOpen"),z=C.useState("openMethod"),U=C.useState("focusManagerModal"),j=ax(R,{enabled:!l&&h&&(z!=="touch"||P!==rl),mouseOnly:!0,move:!1,handleClose:ux(),restMs:m,delay:{close:g},triggerElementRef:k,isActiveTrigger:N,isClosing:()=>C.select("transitionStatus")==="ending"}),B=uP(R,{stickIfOpen:H}),L=LP(()=>C.select("open"),J=>{C.set("openMethod",J)}),$=C.useState("triggerProps",_),{getButtonProps:q,buttonRef:G}=Pp({disabled:l,native:c}),W={open(J){return J&&P===rl?J1.open(J):JE.open(J)}},{preFocusGuardRef:Z,handlePreFocusGuardFocus:re,handleFocusTargetFocus:de}=I4(C,k),X=dn("button",t,{state:{disabled:l,open:M},ref:[G,n,I,k],props:[B.reference,j,$,L,{[rP]:"",id:T,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":D},b,q],stateAttributesMapping:W}),te=x.jsx(O.Fragment,{children:X},T);return _&&!U?x.jsxs(O.Fragment,{children:[x.jsx(Na,{ref:Z,onFocus:re}),te,x.jsx(Na,{ref:C.context.triggerFocusTargetRef,onFocus:de})]}):te}),nB=O.createContext(void 0);function Pce(){const e=O.useContext(nB);if(e===void 0)throw new Error(wn(45));return e}const zce=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return pd().useState("mounted")||r?x.jsx(nB.Provider,{value:r,children:x.jsx(hC,{ref:n,...s})}):null}),rB=O.createContext(void 0);function Bce(){const e=O.useContext(rB);if(!e)throw new Error(wn(46));return e}const Hce=O.forwardRef(function(t,n){const{render:r,className:s,style:i,anchor:l,positionMethod:c,side:u,align:d,sideOffset:h,alignOffset:m,collisionBoundary:g="clipping-ancestors",collisionPadding:y,arrowPadding:b,sticky:w,disableAnchorTracking:E=!1,collisionAvoidance:C=Zy,...T}=t,N=pd(),R=Pce(),M=Jy(),D=N.useState("floatingRootContext"),k=N.useState("mounted"),I=N.useState("open"),_=N.useState("openChangeReason"),P=N.useState("activeTriggerElement"),H=N.useState("modal"),z=N.useState("openMethod"),U=N.useState("positionerElement"),j=N.useState("instantType"),B=N.useState("transitionStatus"),L=N.useState("adaptiveOrigin"),$=O.useRef(null),q=nx(U),G=hx({anchor:l,floatingRootContext:D,positionMethod:c,mounted:k,side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:b,collisionBoundary:g,collisionPadding:y,sticky:w,disableAnchorTracking:E,keepMounted:R,nodeId:M,collisionAvoidance:C,adaptiveOrigin:L}),W=D.useState("domReferenceElement");ze(()=>{const X=W,te=$.current;if(X&&($.current=X),te&&X&&X!==te){N.set("instantType",void 0);const J=new AbortController;return q(()=>{N.set("instantType","trigger-change")},J.signal),()=>{J.abort()}}},[W,q,N]);const Z=H===!0&&_!==xn;A4(I&&Z,z==="touch",U,P);const re=N.useStateSetter("positionerElement"),de={open:I,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:j},F=px(t,de,{styles:G.positionerStyles,transitionStatus:B,props:T,refs:[n,re],hidden:!k,inert:!I});return x.jsxs(rB.Provider,{value:G,children:[k&&Z&&x.jsx(OC,{inert:RC(!I),cutout:P}),x.jsx(mC,{id:M,children:F})]})}),Fce=O.createContext(void 0);function $ce(){const[e,t]=O.useState(0),n=Qe(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:O.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const Vce=O.forwardRef(function(t,n){const{render:r,className:s,style:i,initialFocus:l,finalFocus:c,...u}=t,d=pd(),h=Bce(),m=O4()!=null,{context:g,hasClosePart:y}=$ce(),b=d.useState("open"),w=d.useState("openMethod"),E=d.useState("instantType"),C=d.useState("transitionStatus"),T=d.useState("popupProps"),N=d.useState("titleElementId"),R=d.useState("descriptionElementId"),M=d.useState("modal"),D=d.useState("mounted"),k=d.useState("openChangeReason"),I=d.useState("activeTriggerElement"),_=d.useState("floatingRootContext"),P=_.useState("floatingId"),H=d.useState("disabled"),z=d.useState("openOnHover"),U=d.useState("closeDelay");ou({open:b,ref:d.context.popupRef,onComplete(){var G,W;b&&((W=(G=d.context).onOpenChangeComplete)==null||W.call(G,!0))}}),lx(_,{enabled:z&&!H,closeDelay:U});const j=l===void 0?NP(d.context.popupRef):l,B=M!==!1&&y;d.useSyncedValue("focusManagerModal",B);const L=d.useStateSetter("popupElement"),$={open:b,side:h.side,align:h.align,instant:E,transitionStatus:C},q=dn("div",t,{state:$,ref:[n,d.context.popupRef,L],props:[T,{id:P,role:"dialog",...Vp,"aria-labelledby":N,"aria-describedby":R,onKeyDown(G){m&&TC.has(G.key)&&G.stopPropagation()}},Jp(C),u],stateAttributesMapping:zp});return x.jsx(xC,{context:_,openInteractionType:w,modal:B,disabled:!D||k===xn,initialFocus:j,returnFocus:c,restoreFocus:"popup",previousFocusableElement:Zt(I)?I:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:x.jsx(Fce.Provider,{value:g,children:q})})}),sB=O.forwardRef(function(t,n){const{render:r,className:s,style:i,...l}=t,c=pd(),u=lo(l.id);return c.useSyncedValueWithCleanup("titleElementId",u),dn("h2",t,{ref:n,props:[{id:u},l]})}),Kc="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10 aria-expanded:bg-sign-foreground/15 aria-pressed:bg-sign-foreground aria-pressed:text-sign disabled:opacity-50",Uce="border-primary bg-primary font-bold text-primary-foreground hover:bg-primary/85 aria-expanded:bg-primary/85",qce="z-50 flex w-96 origin-(--transform-origin) flex-col gap-3 rounded-lg border border-foreground bg-popover p-4 text-sm text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",Gce="max-h-[min(44rem,calc(100vh-5rem))] w-[34rem] overflow-y-auto",Kce="shrink-0 text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",b2=({trigger:e,children:t,className:n,onOpen:r})=>x.jsxs(Dce,{onOpenChange:s=>{s&&(r==null||r())},children:[e,x.jsx(zce,{children:x.jsx(Hce,{align:"end",sideOffset:10,className:"isolate z-50",children:x.jsx(Vce,{className:Ne(qce,n),children:t})})})]}),Yce=({label:e,isPressed:t,onClick:n})=>x.jsxs("button",{type:"button","aria-pressed":t,className:Kc,onClick:n,children:[x.jsx(sX,{"aria-hidden":"true",className:"size-3.5"}),x.jsx("span",{className:"text-box-cap",children:e})]}),Wce=({label:e,isPending:t,onClick:n})=>x.jsxs("button",{type:"button",disabled:t,className:Kc,onClick:n,children:[x.jsx(XW,{"aria-hidden":"true",className:"size-3.5"}),x.jsx("span",{className:"text-box-cap",children:e})]}),Xce=({label:e,onClick:t})=>x.jsxs("button",{type:"button",className:Ne(Kc,"font-bold text-signal"),onClick:t,children:[x.jsx(uX,{"aria-hidden":"true",className:"size-3.5"}),x.jsx("span",{className:"text-box-cap",children:e})]}),Qce=({forgeLink:e,rebuild:t,onDelete:n})=>x.jsxs(HC,{children:[x.jsx(FC,{"aria-label":"More actions",className:Ne(Kc,"px-1.5"),children:x.jsx(eX,{"aria-hidden":"true",className:"size-3.5"})}),x.jsxs($C,{align:"start",children:[e===null?null:x.jsxs(df,{render:x.jsx("a",{href:e.href,target:"_blank",rel:"noreferrer","aria-label":e.label}),children:[x.jsx(i3,{"aria-hidden":"true",className:"size-3.5"}),e.label]}),t===null?null:x.jsxs(x.Fragment,{children:[x.jsxs(df,{onClick:t.onUpdate,children:[x.jsx(oX,{"aria-hidden":"true",className:"size-3.5"}),"Update the Flight Plan"]}),x.jsxs(df,{onClick:t.onRegenerate,children:[x.jsx(cX,{"aria-hidden":"true",className:"size-3.5"}),"Regenerate from scratch"]})]}),e===null&&t===null?null:x.jsx(L4,{}),x.jsxs(df,{className:"text-destructive focus:bg-destructive/10",onClick:n,children:[x.jsx(AC,{"aria-hidden":"true",className:"size-3.5"}),"Delete"]})]})]}),Zce=({draft:e,isSubmitting:t,isDiscarding:n,errorMessage:r,submissionCount:s,renderEditor:i,onSubmit:l,onDiscard:c})=>{const u=O.useId(),[d,h]=O.useState(""),[m,g]=O.useState(null),y=e.verdicts.map(w=>w.key),b=y.find(w=>w===m)??y.at(0)??null;return!e.isAvailable||b===null?x.jsx("button",{type:"button",disabled:!0,title:e.unavailableReason??void 0,className:Kc,children:x.jsx("span",{className:"text-box-cap",children:e.buttonLabel})}):x.jsx(b2,{className:Gce,trigger:x.jsxs(x2,{className:Ne(Kc,Uce),children:[x.jsx("span",{className:"text-box-cap",children:e.buttonLabel}),x.jsx(Qp,{"aria-hidden":"true",className:"size-3.5"})]}),children:x.jsxs("form",{className:"flex flex-col gap-3",onSubmit:w=>{w.preventDefault(),l(b,d.trim())},children:[x.jsx(sB,{className:"text-base leading-6 font-bold",children:e.heading}),x.jsx("div",{children:i({label:e.bodyPlaceholder,shouldFocus:!1,onChange:h})},s),x.jsx("fieldset",{className:"flex flex-col gap-2",children:e.verdicts.map(w=>x.jsxs("label",{className:"grid cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] gap-x-2",children:[x.jsx("input",{type:"radio",name:u,checked:b===w.key,className:"mt-1 size-3.5 accent-(--primary)",onChange:()=>{g(w.key)}}),x.jsx("span",{className:"font-bold",children:w.label}),x.jsx("span",{className:"col-start-2 text-muted-foreground",children:w.description})]},w.key))}),x.jsx("p",{className:"text-muted-foreground tabular-nums",children:e.pendingLabel}),e.pendingComments.length===0?null:x.jsx("ul",{className:"flex flex-col",children:e.pendingComments.map(w=>x.jsxs("li",{className:"flex items-start justify-between gap-3 border-t py-2 first:border-t-0 first:pt-0",children:[x.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[x.jsx("span",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:w.locationLabel}),x.jsx("span",{className:"truncate",children:w.excerpt}),w.staleLabel===null?null:x.jsx("span",{className:"text-destructive",children:w.staleLabel})]}),x.jsx("button",{type:"button","aria-label":`${w.discardLabel}: ${w.locationLabel}`,disabled:n,className:Kce,onClick:()=>{c(w.id)},children:w.discardLabel})]},w.id))}),r===null?null:x.jsx("p",{role:"alert",className:"text-destructive",children:r}),x.jsx(nt,{type:"submit",disabled:t,className:"self-end",children:e.submitLabel})]})})},Y_="size-3.5 motion-safe:animate-spin",Jce=({sharing:e,publishingKey:t,onPublish:n})=>{const r=i=>i.isPending||i.key===t,s=e.options.some(r);return x.jsx(b2,{trigger:x.jsxs(x2,{"aria-busy":s,className:Kc,children:[x.jsx("span",{className:"text-box-cap",children:e.buttonLabel}),s?x.jsx(YM,{"aria-hidden":"true",className:Y_}):x.jsx(Qp,{"aria-hidden":"true",className:"size-3.5"})]}),children:x.jsx("ul",{className:"flex flex-col",children:e.options.map(i=>x.jsxs("li",{className:"flex flex-col gap-1.5 border-t py-3 first:border-t-0 first:pt-0 last:pb-0",children:[x.jsxs("div",{className:"flex items-start justify-between gap-3",children:[x.jsx("p",{className:"font-bold",children:i.label}),x.jsxs(nt,{variant:"outline",size:"sm","aria-busy":r(i),disabled:!i.isAvailable||s,onClick:()=>{n(i.key)},children:[r(i)?x.jsx(YM,{"aria-hidden":"true",className:Y_}):null,r(i)?i.pendingLabel:i.actionLabel]})]}),x.jsx("p",{className:"text-muted-foreground",children:i.description}),i.statusLabel===null||i.link===null?null:x.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 tabular-nums",children:[i.statusLabel,x.jsx(dd,{href:i.link.href,label:i.link.label})]})]},i.key))})})},eue="data-valid",tue="data-invalid",nue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},rue={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},sue={disabled:!1,...rue},iue={valid(e){return e===null?null:e?{[eue]:""}:{[tue]:""}}},oue={invalid:void 0,name:void 0,validityData:{state:nue,errors:[],error:"",value:"",initialValue:null},setValidityData:Bn,disabled:void 0,setTouched:Bn,setDirty:Bn,setFilled:Bn,setFocused:Bn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:sue,registerFieldControl:Bn,validation:{getValidationProps:(e,t=Tn)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Bn,getInputControl:()=>null,commit:async()=>{},change:Bn}},lue=O.createContext(oue);function iB(e=!0){const t=O.useContext(lue);if(t.setValidityData===Bn&&!e)throw new Error(wn(28));return t}const aue=O.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Bn,validationMode:"onSubmit",submitCountRef:{current:0}});function cue(){return O.useContext(aue)}const uue=O.createContext({controlId:void 0,registerControlId:Bn,resetControlId:Bn,labelId:void 0,setLabelId:Bn,messageIds:[],setMessageIds:Bn,getDescriptionProps:e=>e});function oB(){return O.useContext(uue)}function fue(e={}){const{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:s,resetControlId:i}=oB(),l=lo(),c=Tr(()=>Symbol()),u=O.useRef(!1),d=O.useRef(!1),h=Qe(()=>{!u.current||s===Bn||(u.current=!1,s(c.current,void 0))});return ze(()=>{if(!n||s===Bn){h();return}let m;if(t!==void 0)d.current=!0,m=t;else if(d.current)m=l;else{i();return}if(m===void 0){h();return}u.current=!0,s(c.current,m)},[t,n,s,i,l,c,h]),ze(()=>h,[h]),(n?r:void 0)??t??l}function due(e,t,n,r,s=!0,i){const{registerFieldControl:l}=iB(),c=Tr(()=>Symbol());ze(()=>{const u=c.current;if(!s){l(u,void 0);return}l(u,{controlRef:e,getValue:r,id:t,name:i,value:n})},[e,s,r,t,i,l,c,n]),ze(()=>{const u=c.current;return()=>{l(u,void 0)}},[l,c])}const hue=O.forwardRef(function(t,n){const{render:r,className:s,id:i,name:l,value:c,disabled:u=!1,onValueChange:d,defaultValue:h,autoFocus:m=!1,style:g,...y}=t,{state:b,name:w,disabled:E,setTouched:C,setDirty:T,validityData:N,setFocused:R,setFilled:M,validationMode:D,validation:k}=iB(),{clearErrors:I,elementRef:_,submitCountRef:P}=cue(),H=E||u,z=w??l,U={...b,disabled:H},{labelId:j}=oB(),B=fue({id:i}),[L]=w4({controlled:c,default:h,name:"FieldControl",state:"value"}),$=c!==void 0,q=$?L:void 0,G=q==null?void 0:String(q),W=Qe(()=>{var F;return(F=k.inputRef.current)==null?void 0:F.value});due(k.inputRef,B,G,W,!H,l),ze(()=>{var X;const F=G??((X=k.inputRef.current)==null?void 0:X.value);F!==void 0&&M(F!=="")},[G,k.inputRef,M]),jP(G,()=>{G!==void 0&&(I(z),T(G!==(N.initialValue??"")),k.change(G))});const Z=O.useRef(null),re=Jr();return ze(()=>{m&&Z.current===Xr(Dt(Z.current))&&R(!0)},[m,R]),dn("input",t,{ref:[n,Z],state:U,props:[{id:B,disabled:H,name:z,ref:k.inputRef,"aria-labelledby":j,autoFocus:m,...$?{value:q}:{defaultValue:h},onChange(F){const X=F.currentTarget.value,te=gt(qy,F.nativeEvent);d==null||d(X,te),!$&&(T(X!==(N.initialValue??"")),M(X!==""),!F.nativeEvent.defaultPrevented&&!te.isCanceled&&(I(z),k.change(X)))},onFocus(){R(!0)},onBlur(F){if(C(!0),R(!1),D==="onBlur"){const X=F.currentTarget.value;k.commit(X),$&&queueMicrotask(()=>{var J;const te=(J=k.inputRef.current)==null?void 0:J.value;te!==void 0&&te!==X&&te!==(N.initialValue??"")&&k.commit(te)})}},onKeyDown(F){if(F.currentTarget.tagName==="INPUT"&&F.key==="Enter"){C(!0);const X=F.currentTarget.value,te=F.currentTarget.form;if(te&&te===_.current&&!F.defaultPrevented){const J=F.currentTarget,K=P.current;re.start(0,()=>{P.current===K&&k.commit(J.value)})}else k.commit(X)}}},y,F=>k.getValidationProps(H,F)],stateAttributesMapping:iue})}),pue=O.forwardRef(function(t,n){return x.jsx(hue,{ref:n,...t})});function Mx({className:e,type:t,...n}){return x.jsx(pue,{type:t,"data-slot":"input",className:Ne("h-8 w-full min-w-0 rounded-lg border border-input bg-card px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm",e),...n})}const i0="transition-[fill,stroke,stroke-dasharray,stroke-width,opacity] duration-[180ms] ease-out",gh="[stroke-dasharray:44_0] [stroke-width:3]",mue="[stroke-dasharray:4_3.33] [stroke-width:3]",gue="[stroke-dasharray:44_0] [stroke-width:1.5]",yue={"no-review":Ne("fill-background stroke-muted-foreground",gh),"awaiting-review":Ne("fill-background stroke-signal",gh),"awaiting-reply":Ne("fill-background stroke-signal",gh),stale:Ne("fill-background stroke-muted-foreground",mue),draft:Ne("fill-background stroke-muted-foreground",gue),closed:Ne("fill-muted-foreground stroke-muted-foreground",gh),merged:Ne("fill-(--line) stroke-(--line)",gh)},v2="opacity-100",sr="opacity-0",xue={"no-review":sr,"awaiting-review":v2,"awaiting-reply":sr,stale:sr,draft:sr,closed:sr,merged:sr},bue={"no-review":sr,"awaiting-review":sr,"awaiting-reply":v2,stale:sr,draft:sr,closed:sr,merged:sr},vue={"no-review":sr,"awaiting-review":sr,"awaiting-reply":sr,stale:sr,draft:sr,closed:v2,merged:sr},Sue="stroke-signal",W_="font-bold text-signal-text",o0="text-muted-foreground",dbe={"no-review":"text-foreground","awaiting-review":W_,"awaiting-reply":W_,stale:o0,draft:o0,closed:o0,merged:o0},D0=({status:e,tone:t="status",className:n})=>x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20","data-status":e,className:Ne("size-5 shrink-0",n),children:[x.jsx("circle",{cx:"10",cy:"10",r:"7",className:Ne(i0,yue[e],t==="signal"?Sue:"")}),x.jsx("path",{d:"M10 4.5a5.5 5.5 0 0 1 0 11z",className:Ne("fill-signal",i0,xue[e])}),x.jsx("circle",{cx:"10",cy:"10",r:"2.75",className:Ne("fill-signal",i0,bue[e])}),x.jsx("rect",{x:"5",y:"8.5",width:"10",height:"3",rx:"1",className:Ne("fill-background",i0,vue[e])})]}),wue={pending:null,commented:rX,approved:dx,"changes-requested":DC},Eue={pending:"border-sign-muted bg-sign",commented:"border-sign bg-sign-muted text-sign",approved:"border-sign bg-sign-foreground text-sign","changes-requested":"border-sign bg-destructive text-sign-foreground"},lB="border-sign-foreground bg-sign-foreground text-sign",aB="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10",Uw="font-bold text-signal",kh="text-sign-muted",Cue={"no-review":"text-sign-foreground","awaiting-review":Uw,"awaiting-reply":Uw,stale:kh,draft:kh,closed:kh,merged:kh},X_=({freshness:e})=>x.jsx("span",{className:Ne("shrink-0 text-sm",e.isOutOfDate?Uw:kh),children:e.label}),Nue="relative block rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sign-foreground",Q_=({reviewer:e})=>{const t=wue[e.state];return x.jsxs(x.Fragment,{children:[x.jsx(gx,{imageUrl:e.avatarUrl,monogram:e.monogram,className:Ne("size-6",lB)}),x.jsx("span",{"aria-hidden":"true","data-state":e.state,className:Ne("absolute -right-1 -bottom-1 flex size-3.5 items-center justify-center rounded-full border",Eue[e.state]),children:t===null?null:x.jsx(t,{className:"size-2.5",strokeWidth:3})}),x.jsx("span",{className:"sr-only",children:e.stateLabel})]})},Tue=({reviewer:e,requesting:t})=>{const{request:n}=e;return n===null||t===null?x.jsx("li",{className:"relative",title:e.stateLabel,children:x.jsx(Q_,{reviewer:e})}):x.jsx("li",{title:e.stateLabel,children:x.jsxs(HC,{children:[x.jsx(FC,{className:Nue,children:x.jsx(Q_,{reviewer:e})}),x.jsx($C,{align:"end",children:x.jsx(df,{disabled:t.isPending,onClick:()=>{n.isRemoving?t.onRemove(n.login):t.onRequest(n.login)},children:n.label})})]})})},Rue=({labels:e,requesting:t})=>{var n;return x.jsxs(b2,{onOpen:t.onOpen,trigger:x.jsx(x2,{"aria-label":e.buttonLabel,title:e.buttonLabel,className:Ne(aB,"px-1.5"),children:x.jsx(fX,{"aria-hidden":"true",className:"size-3.5"})}),children:[x.jsx(sB,{className:"text-base leading-6 font-bold",children:e.heading}),x.jsx(Mx,{type:"search",value:t.query,placeholder:e.searchPlaceholder,"aria-label":e.searchPlaceholder,onChange:r=>{t.onSearch(r.target.value)}}),((n=t.options)==null?void 0:n.length)===0?x.jsx("p",{className:"text-muted-foreground",children:e.emptyLabel}):null,x.jsx("ul",{className:"flex max-h-72 flex-col overflow-y-auto",children:(t.options??[]).map(r=>x.jsxs("li",{className:"flex items-center gap-2 border-t py-2 first:border-t-0 first:pt-0 last:pb-0",children:[x.jsx(gx,{imageUrl:r.avatarUrl,monogram:r.monogram,className:"size-6"}),x.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[x.jsx("span",{className:"truncate font-bold",children:r.name}),x.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.detail})]}),x.jsx(nt,{type:"button",variant:"outline",size:"sm","aria-label":`${e.requestLabel} ${r.name}`,disabled:t.isPending,onClick:()=>{t.onRequest(r.login)},children:e.requestLabel})]},r.login))})]})},qw=({segments:e})=>e===null?null:x.jsx(g4,{segments:e,className:"shrink-0 flex-nowrap text-sm text-sign-muted tabular-nums"}),Oue="shrink-0 rounded-sm border border-sign-foreground/35 px-1.5 py-0.5 text-xs font-bold text-sign-foreground",kue=({title:e,isBranch:t,label:n,changedFiles:r=null,actions:s})=>x.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t?x.jsxs(x.Fragment,{children:[x.jsx(l3,{"aria-hidden":"true",className:"size-4 shrink-0 text-sign-muted"}),x.jsx("h1",{className:"min-w-0 truncate font-mono text-[0.94rem] font-bold",children:e})]}):x.jsx("h1",{className:"min-w-0 truncate text-base font-bold",title:e,children:e}),x.jsx("span",{className:Oue,children:n}),x.jsx(qw,{segments:r}),x.jsx("span",{className:"flex-1"}),s]}),Mue=({header:e,changedFiles:t,requesting:n,actions:r})=>e.kind==="branch"?x.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[x.jsx(l3,{"aria-hidden":"true",className:"size-4 shrink-0 text-sign-muted"}),x.jsx("h1",{className:"min-w-0 truncate font-mono text-[0.94rem] font-bold",children:e.branch}),e.artifactFreshness===null?null:x.jsx(X_,{freshness:e.artifactFreshness}),x.jsx(qw,{segments:t}),x.jsx("span",{className:"flex-1"}),x.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:e.forgeMessage}),x.jsx("a",{href:e.action.href,className:aB,children:x.jsx("span",{className:"text-box-cap",children:e.action.label})}),r]}):x.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[x.jsxs("span",{className:"shrink-0",title:e.author.name,children:[x.jsx(gx,{imageUrl:e.author.avatarUrl,monogram:e.author.monogram,className:Ne("size-7 text-xs",lB)}),x.jsx("span",{className:"sr-only",children:e.author.name})]}),x.jsx("h1",{className:"min-w-0 truncate text-base font-bold",title:e.title,children:e.title}),x.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[x.jsx(D0,{status:e.status}),x.jsx("span",{className:Ne("text-sm",Cue[e.status]),children:e.statusLabel})]}),e.artifactFreshness===null?null:x.jsx(X_,{freshness:e.artifactFreshness}),x.jsx(qw,{segments:t}),x.jsx("span",{className:"flex-1"}),e.reviewersEmptyLabel===null?x.jsx("ul",{"aria-label":"Reviewers",className:"flex shrink-0 gap-2.5",children:e.reviewers.map(s=>x.jsx(Tue,{reviewer:s,requesting:n},s.name))}):x.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:e.reviewersEmptyLabel}),e.reviewerRequest===null||n===null?null:x.jsx(Rue,{labels:e.reviewerRequest,requesting:n}),r]}),Aue=({header:e,changedFiles:t=null,authorLabel:n=null,reviewerRequesting:r=null,actions:s})=>n===null?x.jsx(Mue,{header:e,changedFiles:t,requesting:r,actions:s}):x.jsx(kue,{title:e.kind==="branch"?e.branch:e.title,isBranch:e.kind==="branch",label:n,changedFiles:t,actions:s}),Gw="grid grid-cols-[2.5rem_1fr] items-center rounded-sm py-1.5 pr-2 text-sm hover:bg-muted",Z_="transition-[fill,stroke] duration-[180ms] ease-out",_ue="relative flex flex-col before:absolute before:top-4 before:bottom-4 before:left-[calc(1.25rem-2px)] before:w-1 before:bg-(--line)",J_=({sections:e,currentAnchorId:t})=>x.jsx("ol",{className:_ue,children:e.map(n=>x.jsxs("li",{className:"relative flex flex-col",children:[x.jsxs("a",{href:`#${n.anchorId}`,"aria-current":n.anchorId===t?"location":void 0,className:Ne(Gw,"group/stop text-muted-foreground aria-[current]:font-semibold aria-[current]:text-primary-text"),children:[x.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:x.jsx("circle",{cx:"10",cy:"10",r:"7",className:Ne(Z_,"fill-background stroke-muted-foreground [stroke-width:3] group-aria-[current]/stop:fill-(--line) group-aria-[current]/stop:stroke-(--line)")})}),x.jsx("span",{className:"leading-5",children:n.label})]}),n.children.map(r=>x.jsxs("a",{href:`#${r.anchorId}`,"aria-current":r.anchorId===t?"location":void 0,className:Ne(Gw,"group/stop py-1 text-[0.8125rem] text-muted-foreground aria-[current]:text-primary-text"),children:[x.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:x.jsx("circle",{cx:"10",cy:"10",r:"3.5",className:Ne(Z_,"fill-background stroke-(--line) [stroke-width:2] group-aria-[current]/stop:fill-(--line)")})}),x.jsx("span",{className:"leading-4",children:r.label})]},r.anchorId))]},n.anchorId))}),Due="Arrange",Iue=({label:e,groups:t,sections:n,currentAnchorId:r,onEditGroup:s=null,onArrangeGroups:i=null})=>x.jsxs("nav",{"aria-label":e,className:"flex flex-col gap-2",children:[i===null?null:x.jsxs(nt,{variant:"ghost",size:"sm",className:"self-end",onClick:i,children:[x.jsx(qW,{"aria-hidden":"true"}),Due]}),t.map(l=>x.jsxs("div",{className:"flex flex-col",children:[l.label===null?null:x.jsxs("div",{className:"flex items-start",children:[x.jsxs("a",{href:`#${l.anchorId}`,className:Ne(Gw,"min-w-0 flex-1 items-start"),children:[x.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"mt-0.5 size-5 justify-self-center",children:x.jsx("rect",{x:"3.5",y:"3.5",width:"13",height:"13",rx:"2.5",className:"fill-(--line)"})}),x.jsxs("span",{className:"flex min-w-0 flex-col",children:[x.jsx("span",{className:"leading-5 font-semibold text-foreground",children:l.label}),x.jsx("span",{className:"text-xs leading-4 text-muted-foreground tabular-nums",children:l.detailLabel})]})]}),s===null?null:x.jsx(un,{icon:"edit",label:`Edit ${l.label}`,className:"shrink-0 text-muted-foreground",onClick:()=>{s(l.anchorId)}})]}),x.jsx(J_,{sections:l.sections,currentAnchorId:r})]},l.anchorId)),x.jsx("div",{className:"border-t pt-2",children:x.jsx(J_,{sections:n,currentAnchorId:r})})]}),jue=({message:e})=>x.jsx("div",{role:"status",className:"pointer-events-none fixed bottom-4 left-1/2 z-[60] -translate-x-1/2",children:e===null?null:x.jsx("p",{className:"rounded-lg border border-foreground bg-popover px-3 py-2 text-sm text-popover-foreground duration-150 animate-in fade-in-0",children:e})}),Lue=[],Pue="Reading the code blocks…",zue=(e,t)=>{var s,i,l;const n=ii(),r=Zc(n.review.cardBlocks.queryOptions(t===null?ri:{...e,path:t}));return{blocks:((s=r.data)==null?void 0:s.blocks)??Lue,message:((i=r.error)==null?void 0:i.message)??((l=r.data)==null?void 0:l.message)??(r.isPending&&t!==null?Pue:null)}},Bue="Loading the file…",S2=(e,t)=>{var s,i;const n=ii(),r=Zc(n.review.fileCode.queryOptions(t===null?ri:{...e,path:t}));return{lines:((s=r.data)==null?void 0:s.lines)??null,statusMessage:((i=r.error)==null?void 0:i.message)??(r.isPending&&t!==null?Bue:null)}},Hue=[],w2=(e,t)=>{var c,u,d;const n=ii(),[r,s]=O.useState(""),i=O.useDeferredValue(r),l=Zc({...n.review.searchFiles.queryOptions({...e,query:i,scope:t}),placeholderData:SE});return{query:r,files:((c=l.data)==null?void 0:c.options)??Hue,message:((u=l.data)==null?void 0:u.message)??null,errorMessage:((d=l.error)==null?void 0:d.message)??null,onQueryChange:s}};function cu({...e}){return x.jsx(IP,{"data-slot":"dialog",...e})}function Fue({...e}){return x.jsx(_P,{"data-slot":"dialog-portal",...e})}function $ue({className:e,...t}){return x.jsx(YG,{"data-slot":"dialog-overlay",className:Ne("fixed inset-0 isolate z-50 bg-sign/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function uu({className:e,children:t,showCloseButton:n=!0,...r}){return x.jsxs(Fue,{children:[x.jsx($ue,{}),x.jsxs(AP,{"data-slot":"dialog-content",className:Ne("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-foreground bg-popover p-5 text-sm text-popover-foreground duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r,children:[t,n&&x.jsxs(zL,{"data-slot":"dialog-close",render:x.jsx(nt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[x.jsx(DC,{}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Oa({className:e,...t}){return x.jsx("div",{"data-slot":"dialog-header",className:Ne("flex flex-col gap-2",e),...t})}function md({className:e,showCloseButton:t=!1,children:n,...r}){return x.jsxs("div",{"data-slot":"dialog-footer",className:Ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&x.jsx(zL,{render:x.jsx(nt,{variant:"outline"}),children:"Close"})]})}function ka({className:e,...t}){return x.jsx(AW,{"data-slot":"dialog-title",className:Ne("font-heading text-lg leading-7 font-bold",e),...t})}function fu({className:e,...t}){return x.jsx(ZG,{"data-slot":"dialog-description",className:Ne("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const Vue=(e,t,n)=>e!==null&&n?{anchorLine:e.anchorLine,headLine:t}:{anchorLine:t,headLine:t},Uue=({anchorLine:e,headLine:t})=>({lineStart:Math.min(e,t),lineEnd:Math.max(e,t)}),que=(e,t)=>e!==null&&t>=e.lineStart&&t<=e.lineEnd,Gue=e=>new Set(e===null?[]:Array.from({length:e.lineEnd-e.lineStart+1},(t,n)=>String(e.lineStart+n))),bp=({lineStart:e,lineEnd:t})=>e===t?`Line ${String(e)}`:`Lines ${String(e)} to ${String(t)}`,Kue={"toggle-off":{isShownAtFirst:!1,canToggle:!0},"toggle-on":{isShownAtFirst:!0,canToggle:!0},"always-on":{isShownAtFirst:!0,canToggle:!1},"always-off":{isShownAtFirst:!1,canToggle:!1}},Yue="Show waypoints",Wue="Hide waypoints",Xue="Select line",Que="Clear",Zue="[data-line]",vy=10,cB="my-1.5 mr-4 ml-18 rounded-md border border-input bg-background font-sans whitespace-normal",eD=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(Zue))??null},tD=e=>Number.parseInt((e==null?void 0:e.dataset.line)??"",vy),Jue=e=>{const t=window.getSelection();if(e===null||t===null||t.isCollapsed)return null;const n=eD(t.anchorNode),r=eD(t.focusNode);if(n===null||r===null||!e.contains(n)||!e.contains(r))return null;const s=tD(n),i=tD(r);return Number.isNaN(s)||Number.isNaN(i)?null:{anchorLine:s,headLine:i}},efe=(e,t)=>{var n;(n=e==null?void 0:e.querySelector(`[data-line="${String(t)}"]`))==null||n.scrollIntoView({block:"center"})},tfe=(e,t)=>t===null?e:e.map(n=>({...n,isFocused:que(t,Number.parseInt(n.numberLabel,vy))})),nfe=({waypoint:e})=>x.jsxs("section",{"aria-label":e.title,className:Ne(cB,"flex items-center gap-2 px-2.5 py-2"),children:[e.attentionLabel===null?null:x.jsx(zh,{kind:"attention",label:e.attentionLabel}),x.jsx("span",{className:"min-w-0 truncate text-[0.9375rem] font-semibold",children:e.title}),x.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:bp(e)})]}),E2=({path:e,lines:t,statusMessage:n,waypoints:r,waypointOptions:s,highlightButtonLabel:i,focusOn:l,className:c,renderWaypoint:u,onHighlightCode:d})=>{const h=O.useRef(null),{isShownAtFirst:m,canToggle:g}=Kue[s],[y,b]=O.useState(m),[w,E]=O.useState(null),C=g?y:m,T=O.useMemo(()=>w===null?null:Uue(w),[w]),N=O.useMemo(()=>Gue(T),[T]),R=O.useMemo(()=>t===null?null:tfe(t,l),[t,l]),M=(l==null?void 0:l.lineStart)??null,D=t!==null;O.useEffect(()=>{M!==null&&D&&efe(h.current,M)},[M,D]);const k=(H,z)=>{E(U=>Vue(U,Number.parseInt(H,vy),z))},I=()=>{const H=d===null?null:Jue(h.current);H!==null&&E(H)},_=H=>{d==null||d(H),E(null)},P=H=>{const z=Number.parseInt(H,vy);return x.jsxs(x.Fragment,{children:[(T==null?void 0:T.lineEnd)===z?x.jsxs("div",{role:"toolbar","aria-label":bp(T),className:Ne(cB,"flex items-center gap-2 px-2.5 py-1.5"),children:[x.jsx("span",{className:"text-sm text-muted-foreground tabular-nums",children:bp(T)}),x.jsx("span",{className:"flex-1"}),x.jsx(nt,{type:"button",variant:"ghost",size:"sm",onClick:()=>{E(null)},children:Que}),x.jsx(nt,{type:"button",size:"sm",onClick:()=>{_(T)},children:i})]}):null,C?r.filter(U=>U.lineEnd===z).map(U=>u===void 0?x.jsx(nfe,{waypoint:U},U.id):x.jsx("div",{children:u(U)},U.id)):null]})};return x.jsxs("div",{className:Ne("flex min-h-0 flex-col overflow-hidden rounded-md border",c),children:[x.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-3 border-b bg-muted pr-1 pl-3",children:[x.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:e,children:e}),g?x.jsx(nt,{type:"button",variant:"ghost",size:"sm","aria-pressed":y,onClick:()=>{b(H=>!H)},children:y?Wue:Yue}):null]}),R===null?x.jsx("p",{role:"status",className:"px-3 py-2.5 text-sm text-muted-foreground",children:n}):x.jsx("div",{ref:h,role:"presentation",className:"min-h-0 flex-1 overflow-y-auto bg-code",onMouseUp:I,children:x.jsx(lu,{lines:R,label:e,path:e,className:"py-0",renderLineExtra:P,...d===null?{}:{selectLineLabel:Xue,selectedLineLabels:N,onSelectLine:k}})})]})},rfe="flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none aria-disabled:text-muted-foreground aria-selected:bg-muted",sfe=(e,t,n)=>t===0?null:e===null?n===1?0:t-1:(e+n+t)%t,uB=({label:e,hint:t,placeholder:n,value:r,suggestions:s,message:i,errorMessage:l,isLiteral:c=!1,className:u,onValueChange:d,onSelect:h,onOpen:m,onEnter:g})=>{const y=O.useId(),b=O.useId(),w=O.useId(),E=O.useId(),[C,T]=O.useState(!1),[N,R]=O.useState(null),M=N===null?void 0:s[N],D=C&&(s.length>0||i!==null),k=l!==null,I=()=>{T(!1),R(null)},_=z=>{z.isDisabled||(h(z.id),I())},P=z=>{T(!0),R(U=>sfe(U,s.length,z))},H=z=>{z.key==="ArrowDown"?(z.preventDefault(),P(1)):z.key==="ArrowUp"?(z.preventDefault(),P(-1)):z.key==="Enter"?(z.preventDefault(),C&&M!==void 0?_(M):g==null||g()):z.key==="Escape"&&I()};return x.jsxs("div",{className:Ne("grid gap-1.5",u),children:[x.jsx("label",{htmlFor:y,className:"text-sm font-bold",children:e}),t===null?null:x.jsx("p",{id:w,className:"text-sm text-muted-foreground",children:t}),x.jsxs("div",{className:"relative",children:[x.jsx(Mx,{id:y,role:"combobox",value:r,placeholder:n,autoComplete:"off",spellCheck:!1,"aria-expanded":D,"aria-controls":b,"aria-autocomplete":"list","aria-activedescendant":M===void 0?void 0:`${b}-${M.id}`,"aria-invalid":k,"aria-describedby":Ne(t===null?"":w,k?E:"")||void 0,className:c?"font-mono placeholder:font-sans":"",onChange:z=>{d(z.target.value),T(!0),R(null)},onFocus:()=>{T(!0),m==null||m()},onBlur:I,onKeyDown:H}),x.jsxs("div",{id:b,role:"listbox","aria-label":e,hidden:!D,className:"absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground",children:[s.map(z=>x.jsxs("div",{id:`${b}-${z.id}`,role:"option",tabIndex:-1,"aria-selected":z.id===(M==null?void 0:M.id),"aria-disabled":z.isDisabled,className:rfe,onMouseDown:U=>{U.preventDefault()},onClick:()=>{_(z)},onKeyDown:U=>{U.key==="Enter"&&_(z)},children:[z.marker,x.jsx("span",{className:Ne("min-w-0 wrap-anywhere",c?"font-mono text-[0.94em]":""),children:z.label}),z.detail===null?null:x.jsx("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",children:z.detail}),z.stateLabel===null?null:x.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:z.stateLabel})]},z.id)),s.length===0&&i!==null?x.jsx("div",{role:"presentation",className:"px-2 py-1.5 text-sm text-muted-foreground",children:i}):null]})]}),k?x.jsx("p",{id:E,role:"alert",className:"text-sm text-destructive",children:l}):null]})},ife="/",ofe=({path:e,stateLabel:t})=>{const n=e.lastIndexOf(ife);return{id:e,label:e.slice(n+1),detail:n<0?null:e.slice(0,n),stateLabel:t,isDisabled:!1}},C2=({label:e,hint:t,placeholder:n,query:r,files:s,message:i,errorMessage:l,className:c,onQueryChange:u,onSelect:d})=>x.jsx(uB,{label:e,hint:t,placeholder:n,value:r,suggestions:s.map(ofe),message:i,errorMessage:l,isLiteral:!0,className:c,onValueChange:u,onSelect:d}),lfe="Add a card",nD="Pick a file, then the code the card stands for: one of its code blocks, or the lines you select in the code.",afe="File",cfe="Search the files of the repository",rD="Code blocks",ufe="Use these lines",ffe="Pick a code block on the left, or select lines in the code: click a line number, then another with Shift.",dfe="Prefill the rows of the card from the code",hfe="Add card",pfe="Adding…",sD="size-4 accent-(--primary)",mfe="flex w-full flex-col rounded-md border border-input px-2.5 py-1.5 text-left transition-colors duration-[180ms] ease-out hover:bg-accent disabled:cursor-not-allowed disabled:opacity-60 aria-pressed:border-primary aria-pressed:bg-accent",gfe=({reviewKey:e,addition:{segmentId:t,note:n,isSaving:r,errorMessage:s,onSubmit:i,onClose:l}})=>{const c=w2(e,"repository"),[u,d]=O.useState(null),[h,m]=O.useState(null),[g,y]=O.useState(!0),[b,w]=O.useState(!1),E=S2(e,u),{blocks:C,message:T}=zue({...e,segmentId:t},u),N=(h==null?void 0:h.kind)==="block"?C.find(k=>k.id===h.blockId)??null:null,R=(h==null?void 0:h.kind)==="lines"?h:N,M=k=>{d(k),m(null),w(!1),c.onQueryChange(k)},D=()=>{u===null||h===null||i({path:u,source:h,isPrefilled:g,hasChildComponents:b&&(N==null?void 0:N.childComponentsLabel)!=null})};return x.jsx(cu,{open:!0,onOpenChange:k=>{k||l()},children:x.jsxs(uu,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:lfe}),x.jsx(fu,{children:n===null?nD:`${nD} ${n}`})]}),x.jsx(C2,{label:afe,hint:null,placeholder:cfe,query:c.query,files:c.files,message:c.message,errorMessage:c.errorMessage,onQueryChange:c.onQueryChange,onSelect:M}),u===null?x.jsx("span",{}):x.jsxs("div",{className:"grid min-h-0 grid-cols-[16rem_minmax(0,1fr)] gap-3",children:[x.jsxs("section",{"aria-label":rD,className:"flex min-h-0 flex-col gap-2",children:[x.jsx("h3",{className:"text-sm font-bold",children:rD}),T===null?null:x.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:T}),x.jsx("ul",{className:"grid min-h-0 content-start gap-1 overflow-y-auto",children:C.map(k=>x.jsx("li",{children:x.jsxs("button",{type:"button","aria-pressed":(N==null?void 0:N.id)===k.id,disabled:k.heldLabel!==null,className:mfe,onClick:()=>{m({kind:"block",blockId:k.id})},children:[x.jsx("span",{className:"truncate font-mono text-[0.8125rem] font-bold",title:k.name,children:k.name}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:k.heldLabel??k.detail})]})},k.id))})]}),x.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[x.jsx(E2,{path:u,lines:E.lines,statusMessage:E.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:ufe,focusOn:R,className:"flex-1",onHighlightCode:k=>{m({kind:"lines",...k})}}),x.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:R===null?ffe:[(N==null?void 0:N.name)??null,bp(R)].filter(k=>k!==null).join(", ")})]})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:g,className:sD,onChange:k=>{y(k.target.checked)}}),dfe]}),(N==null?void 0:N.childComponentsLabel)==null?null:x.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:b,className:sD,onChange:k=>{w(k.target.checked)}}),N.childComponentsLabel]}),s===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),x.jsx(nt,{type:"button",disabled:u===null||h===null||r,onClick:D,children:r?pfe:hfe})]})]})})},yfe="Done",iD=({title:e,description:t,entries:n,isPending:r,onMove:s,onClose:i})=>x.jsx(cu,{open:!0,onOpenChange:l=>{l||i()},children:x.jsxs(uu,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e}),x.jsx(fu,{children:t})]}),x.jsx("ol",{"aria-label":e,className:"grid max-h-96 gap-1 overflow-y-auto",children:n.map(l=>x.jsxs("li",{className:"flex items-center gap-2 rounded-md border px-2.5 py-1.5",children:[x.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[x.jsx("span",{className:"truncate font-semibold",title:l.heading,children:l.heading}),x.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.detailLabel})]}),x.jsx(un,{icon:"previous",label:`Move ${l.heading} up`,isDisabled:!l.canMoveUp||r,onClick:()=>{s(l.id,"up")}}),x.jsx(un,{icon:"next",label:`Move ${l.heading} down`,isDisabled:!l.canMoveDown||r,onClick:()=>{s(l.id,"down")}})]},l.id))}),x.jsx(md,{children:x.jsx(nt,{type:"button",onClick:i,children:yfe})})]})});var oD=Object.defineProperty,xfe=(e,t)=>{let n={};for(var r in e)oD(n,r,{get:e[r],enumerable:!0});return oD(n,Symbol.toStringTag,{value:"Module"}),n};function Sr(e){this.content=e}Sr.prototype={constructor:Sr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,s=r.find(e),i=r.content.slice();return s==-1?i.push(n||e,t):(i[s+1]=t,n&&(i[s]=n)),new Sr(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Sr(n)},addToStart:function(e,t){return new Sr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Sr(n)},addBefore:function(e,t,n){var r=this.remove(t),s=r.content.slice(),i=r.find(e);return s.splice(i==-1?s.length:i,0,t,n),new Sr(s)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Sr.from(e),e.size?new Sr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Sr.from(e),e.size?new Sr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Sr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Sr.from=function(e){if(e instanceof Sr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Sr(t)};function fB(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let s=e.child(r),i=t.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){let l=s.text,c=i.text,u=0;for(;l[u]==c[u];u++)n++;return u&&u<l.length&&u<c.length&&pB(l.charCodeAt(u-1))&&hB(l.charCodeAt(u))&&n--,n}if(s.content.size||i.content.size){let l=fB(s.content,i.content,n+1);if(l!=null)return l}n+=s.nodeSize}}function dB(e,t,n,r){for(let s=e.childCount,i=t.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let l=e.child(--s),c=t.child(--i),u=l.nodeSize;if(l==c){n-=u,r-=u;continue}if(!l.sameMarkup(c))return{a:n,b:r};if(l.isText&&l.text!=c.text){let d=l.text,h=c.text,m=d.length,g=h.length;for(;m>0&&g>0&&d[m-1]==h[g-1];)m--,g--,n--,r--;return m&&g&&m<d.length&&pB(d.charCodeAt(m-1))&&hB(d.charCodeAt(m))&&(n++,r++),{a:n,b:r}}if(l.content.size||c.content.size){let d=dB(l.content,c.content,n-1,r-1);if(d)return d}n-=u,r-=u}}function hB(e){return e>=56320&&e<57344}function pB(e){return e>=55296&&e<56320}class Me{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,s=0,i){for(let l=0,c=0;c<n;l++){let u=this.content[l],d=c+u.nodeSize;if(d>t&&r(u,s+c,i||null,l)!==!1&&u.content.size){let h=c+1;u.nodesBetween(Math.max(0,t-h),Math.min(u.content.size,n-h),r,s+h)}c=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,s){let i="",l=!0;return this.nodesBetween(t,n,(c,u)=>{let d=c.isText?c.text.slice(Math.max(t,u)-u,n-u):c.isLeaf?s?typeof s=="function"?s(c):s:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&d||c.isTextblock)&&r&&(l?l=!1:i+=r),i+=d},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)s.push(t.content[i]);return new Me(s,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],s=0;if(n>t)for(let i=0,l=0;l<n;i++){let c=this.content[i],u=l+c.nodeSize;u>t&&((l<t||u>n)&&(c.isText?c=c.cut(Math.max(0,t-l),Math.min(c.text.length,n-l)):c=c.cut(Math.max(0,t-l-1),Math.min(c.content.size,n-l-1))),r.push(c),s+=c.nodeSize),l=u}return new Me(r,s)}cutByIndex(t,n){return t==n?Me.empty:t==0&&n==this.content.length?this:new Me(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[t]=n,new Me(s,i)}addToStart(t){return new Me([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Me(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];t(s,r,n),r+=s.nodeSize}}findDiffStart(t,n=0){return fB(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return dB(this,t,n,r)}findIndex(t){if(t==0)return l0(0,t);if(t==this.size)return l0(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=t)return i==t?l0(n+1,i):l0(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Me.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Me.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Me.empty;let n,r=0;for(let s=0;s<t.length;s++){let i=t[s];r+=i.nodeSize,s&&i.isText&&t[s-1].sameMarkup(i)?(n||(n=t.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Me(n||t,r)}static from(t){if(!t)return Me.empty;if(t instanceof Me)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Me([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Me.empty=new Me([],0);const n1={index:0,offset:0};function l0(e,t){return n1.index=e,n1.offset=t,n1}function Sy(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Sy(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Sy(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Jt=class Kw{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let s=0;s<t.length;s++){let i=t[s];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,s));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Sy(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Kw.none;if(t instanceof Kw)return[t];let n=t.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};Jt.none=[];class vp extends Error{}class He{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=gB(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new He(r,this.openStart,this.openEnd)}removeBetween(t,n){return new He(mB(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return He.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new He(Me.fromJSON(t,n.content),r,s)}static maxOpen(t,n=!0){let r=0,s=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new He(t,r,s)}}He.empty=new He(Me.empty,0,0);function mB(e,t,n){let{index:r,offset:s}=e.findIndex(t),i=e.maybeChild(r),{index:l,offset:c}=e.findIndex(n);if(s==t||i.isText){if(c!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(mB(i.content,t-s-1,n-s-1)))}function gB(e,t,n,r,s,i){let{index:l,offset:c}=e.findIndex(t),u=e.maybeChild(l);if(c==t||u.isText)return i&&r<=0&&s<=0&&!i.canReplace(l,l,n)?null:e.cut(0,t).append(n).append(e.cut(t));let d=gB(u.content,t-c-1,n,l==0?r-1:0,l==e.childCount-1?s-1:0,u);return d&&e.replaceChild(l,u.copy(d))}function bfe(e,t,n){if(n.openStart>e.depth)throw new vp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new vp("Inconsistent open depths");return yB(e,t,n,0)}function yB(e,t,n,r){let s=e.index(r),i=e.node(r);if(s==t.index(r)&&r<e.depth-n.openStart){let l=yB(e,t,n,r+1);return i.copy(i.content.replaceChild(s,l))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let l=e.parent,c=l.content;return jc(l,c.cut(0,e.parentOffset).append(n.content).append(c.cut(t.parentOffset)))}else{let{start:l,end:c}=vfe(n,e);return jc(i,bB(e,l,c,t,r))}else return jc(i,wy(e,t,r))}function xB(e,t){if(!t.type.compatibleContent(e.type))throw new vp("Cannot join "+t.type.name+" onto "+e.type.name)}function Yw(e,t,n){let r=e.node(n);return xB(r,t.node(n)),r}function Ic(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fh(e,t,n,r){let s=(t||e).node(n),i=0,l=t?t.index(n):s.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ic(e.nodeAfter,r),i++));for(let c=i;c<l;c++)Ic(s.child(c),r);t&&t.depth==n&&t.textOffset&&Ic(t.nodeBefore,r)}function jc(e,t){if(!e.type.validContent(t))throw new vp("Invalid content for node "+e.type.name);return e.copy(t)}function bB(e,t,n,r,s){let i=e.depth>s&&Yw(e,t,s+1),l=r.depth>s&&Yw(n,r,s+1),c=[];return Fh(null,e,s,c),i&&l&&t.index(s)==n.index(s)?(xB(i,l),Ic(jc(i,bB(e,t,n,r,s+1)),c)):(i&&Ic(jc(i,wy(e,t,s+1)),c),Fh(t,n,s,c),l&&Ic(jc(l,wy(n,r,s+1)),c)),Fh(r,null,s,c),new Me(c)}function wy(e,t,n){let r=[];if(Fh(null,e,n,r),e.depth>n){let s=Yw(e,t,n+1);Ic(jc(s,wy(e,t,n+1)),r)}return Fh(t,null,n,r),new Me(r)}function vfe(e,t){let n=t.depth-e.openStart,s=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)s=t.node(i).copy(Me.from(s));return{start:s.resolveNoCache(e.openStart+n),end:s.resolveNoCache(s.content.size-e.openEnd-n)}}class Sp{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=t.child(n);return r?t.child(n).cut(r):s}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)s+=r.child(i).nodeSize;return s}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Jt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),s=t.maybeChild(n);if(!r){let c=r;r=s,s=c}let i=r.marks;for(var l=0;l<i.length;l++)i[l].type.spec.inclusive===!1&&(!s||!i[l].isInSet(s.marks))&&(i=i[l--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ey(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let l=t;;){let{index:c,offset:u}=l.content.findIndex(i),d=i-u;if(r.push(l,c,s+u),!d||(l=l.child(c),l.isText))break;i=d-1,s+=u+1}return new Sp(n,r,i)}static resolveCached(t,n){let r=lD.get(t);if(r)for(let i=0;i<r.elts.length;i++){let l=r.elts[i];if(l.pos==n)return l}else lD.set(t,r=new Sfe);let s=r.elts[r.i]=Sp.resolve(t,n);return r.i=(r.i+1)%wfe,s}}class Sfe{constructor(){this.elts=[],this.i=0}}const wfe=12,lD=new WeakMap;class Ey{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Efe=Object.create(null);let Lc=class Ww{constructor(t,n,r,s=Jt.none){this.type=t,this.attrs=n,this.marks=s,this.content=r||Me.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,s=0){this.content.nodesBetween(t,n,r,s,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,s){return this.content.textBetween(t,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Sy(this.attrs,n||t.defaultAttrs||Efe)&&Jt.sameSet(this.marks,r||Jt.none)}copy(t=null){return t==this.content?this:new Ww(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Ww(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return He.empty;let s=this.resolve(t),i=this.resolve(n),l=r?0:s.sharedDepth(n),c=s.start(l),d=s.node(l).content.cut(s.pos-c,i.pos-c);return new He(d,s.depth-l,i.depth-l)}replace(t,n,r){return bfe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(s==t||n.isText)return n;t-=s+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(t){return Sp.resolveCached(this,t)}resolveNoCache(t){return Sp.resolve(this,t)}rangeHasMark(t,n,r){let s=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),vB(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Me.empty,s=0,i=r.childCount){let l=this.contentMatchAt(t).matchFragment(r,s,i),c=l&&l.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let u=s;u<i;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(t).matchType(r),l=i&&i.matchFragment(this.content,n);return l?l.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),aD(this.type.attrs,this.attrs,"node",this.type.name);let t=Jt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];aD(r.type.attrs,r.attrs,"mark",r.type.name),t=r.addToSet(t)}if(!Jt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let s=Me.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,s,r)}};Lc.prototype.text=void 0;class Cy extends Lc{constructor(t,n,r,s){if(super(t,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vB(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Cy(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Cy(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function vB(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function aD(e,t,n,r){for(let s in t)if(!(s in e))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${r}`);for(let s in e)e[s].validate&&e[s].validate(t[s])}class Yc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Cfe(t,n);if(r.next==null)return Yc.empty;let s=SB(r);r.next&&r.err("Unexpected trailing text");let i=Afe(Mfe(s));return _fe(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(t.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let s=[this];function i(l,c){let u=l.matchFragment(t,r);if(u&&(!n||u.validEnd))return Me.from(c.map(d=>d.createAndFill()));for(let d=0;d<l.next.length;d++){let{type:h,next:m}=l.next[d];if(!(h.isText||h.hasRequiredAttrs())&&s.indexOf(m)==-1){s.push(m);let g=i(m,c.concat(h));if(g)return g}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(t)){let l=[];for(let c=s;c.type;c=c.via)l.push(c.type);return l.reverse()}for(let l=0;l<i.next.length;l++){let{type:c,next:u}=i.next[l];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!s.type||u.validEnd)&&(r.push({match:c.contentMatch,type:c,via:s}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let s=0;s<r.next.length;s++)t.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),t.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let l=0;l<r.next.length;l++)i+=(l?", ":"")+r.next[l].type.name+"->"+t.indexOf(r.next[l].next);return i}).join(`
345
- `)}}Yc.empty=new Yc(!0);class Cfe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function SB(e){let t=[];do t.push(Nfe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Nfe(e){let t=[];do t.push(Tfe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Tfe(e){let t=kfe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=Rfe(e,t);else break;return t}function cD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Rfe(e,t){let n=cD(e),r=n;return e.eat(",")&&(e.next!="}"?r=cD(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ofe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let s=[];for(let i in n){let l=n[i];l.isInGroup(t)&&s.push(l)}return s.length==0&&e.err("No node type or group '"+t+"' found"),s}function kfe(e){if(e.eat("(")){let t=SB(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Ofe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mfe(e){let t=[[]];return s(i(e,0),n()),t;function n(){return t.push([])-1}function r(l,c,u){let d={term:u,to:c};return t[l].push(d),d}function s(l,c){l.forEach(u=>u.to=c)}function i(l,c){if(l.type=="choice")return l.exprs.reduce((u,d)=>u.concat(i(d,c)),[]);if(l.type=="seq")for(let u=0;;u++){let d=i(l.exprs[u],c);if(u==l.exprs.length-1)return d;s(d,c=n())}else if(l.type=="star"){let u=n();return r(c,u),s(i(l.expr,u),u),[r(u)]}else if(l.type=="plus"){let u=n();return s(i(l.expr,c),u),s(i(l.expr,u),u),[r(u)]}else{if(l.type=="opt")return[r(c)].concat(i(l.expr,c));if(l.type=="range"){let u=c;for(let d=0;d<l.min;d++){let h=n();s(i(l.expr,u),h),u=h}if(l.max==-1)s(i(l.expr,u),u);else for(let d=l.min;d<l.max;d++){let h=n();r(u,h),s(i(l.expr,u),h),u=h}return[r(u)]}else{if(l.type=="name")return[r(c,void 0,l.value)];throw new Error("Unknown expr type")}}}}function wB(e,t){return t-e}function uD(e,t){let n=[];return r(t),n.sort(wB);function r(s){let i=e[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let l=0;l<i.length;l++){let{term:c,to:u}=i[l];!c&&n.indexOf(u)==-1&&r(u)}}}function Afe(e){let t=Object.create(null);return n(uD(e,0));function n(r){let s=[];r.forEach(l=>{e[l].forEach(({term:c,to:u})=>{if(!c)return;let d;for(let h=0;h<s.length;h++)s[h][0]==c&&(d=s[h][1]);uD(e,u).forEach(h=>{d||s.push([c,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let i=t[r.join(",")]=new Yc(r.indexOf(e.length-1)>-1);for(let l=0;l<s.length;l++){let c=s[l][1].sort(wB);i.next.push({type:s[l][0],next:t[c.join(",")]||n(c)})}return i}}function _fe(e,t){for(let n=0,r=[e];n<r.length;n++){let s=r[n],i=!s.validEnd,l=[];for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];l.push(u.name),i&&!(u.isText||u.hasRequiredAttrs())&&(i=!1),r.indexOf(d)==-1&&r.push(d)}i&&t.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function EB(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function CB(e,t){let n=Object.create(null);for(let r in e){let s=e[r],i=t&&t[r];if(i===void 0)if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r);else s.validate&&s.validate(i);n[r]=i}return n}function NB(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Ife(e,r,t[r]);return n}let fD=class TB{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=NB(t,r.attrs),this.defaultAttrs=EB(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:CB(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Lc(this,this.computeAttrs(t),Me.from(n),Jt.setFrom(r))}createChecked(t=null,n,r){return n=Me.from(n),this.checkContent(n),new Lc(this,this.computeAttrs(t),n,Jt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=Me.from(n),n.size){let l=this.contentMatch.fillBefore(n);if(!l)return null;n=l.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(Me.empty,!0);return i?new Lc(this,t,n.append(i),Jt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Jt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,l)=>r[i]=new TB(i,n,l));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Dfe(e,t,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}class Ife{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Dfe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ax{constructor(t,n,r,s){this.name=t,this.rank=n,this.schema=r,this.spec=s,this.attrs=NB(t,s.attrs),this.excluded=null;let i=EB(this.attrs);this.instance=i?new Jt(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Jt(this,CB(this.attrs,t))}static compile(t,n){let r=Object.create(null),s=0;return t.forEach((i,l)=>r[i]=new Ax(i,s++,n,l)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class RB{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in t)n[s]=t[s];n.nodes=Sr.from(t.nodes),n.marks=Sr.from(t.marks||{}),this.nodes=fD.compile(this.spec.nodes,this),this.marks=Ax.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],l=i.spec.content||"",c=i.spec.marks;if(i.contentMatch=r[l]||(r[l]=Yc.parse(l,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=c=="_"?null:c?dD(this,c.split(" ")):c==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],l=i.spec.excludes;i.excluded=l==null?[i]:l==""?[]:dD(this,l.split(" "))}this.nodeFromJSON=s=>Lc.fromJSON(this,s),this.markFromJSON=s=>Jt.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,s){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof fD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,s)}text(t,n){let r=this.nodes.text;return new Cy(r,r.defaultAttrs,t,Jt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function dD(e,t){let n=[];for(let r=0;r<t.length;r++){let s=t[r],i=e.marks[s],l=i;if(i)n.push(i);else for(let c in e.marks){let u=e.marks[c];(s=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(s)>-1)&&n.push(l=u)}if(!l)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function jfe(e){return e.tag!=null}function Lfe(e){return e.style!=null}class Zo{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(jfe(s))this.tags.push(s);else if(Lfe(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=t.nodes[s.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new pD(this,n,!1);return r.addAll(t,Jt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new pD(this,n,!0);return r.addAll(t,Jt.none,n.from,n.to),He.maxOpen(r.finish())}matchTag(t,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Bfe(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let l=i.getAttrs(t);if(l===!1)continue;i.attrs=l||void 0}return i}}}matchStyle(t,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let l=this.styles[i],c=l.style;if(!(c.indexOf(t)!=0||l.context&&!r.matchesContext(l.context)||c.length>t.length&&(c.charCodeAt(t.length)!=61||c.slice(t.length+1)!=n))){if(l.getAttrs){let u=l.getAttrs(n);if(u===!1)continue;l.attrs=u||void 0}return l}}}static schemaRules(t){let n=[];function r(s){let i=s.priority==null?50:s.priority,l=0;for(;l<n.length;l++){let c=n[l];if((c.priority==null?50:c.priority)<i)break}n.splice(l,0,s)}for(let s in t.marks){let i=t.marks[s].spec.parseDOM;i&&i.forEach(l=>{r(l=mD(l)),l.mark||l.ignore||l.clearMark||(l.mark=s)})}for(let s in t.nodes){let i=t.nodes[s].spec.parseDOM;i&&i.forEach(l=>{r(l=mD(l)),l.node||l.ignore||l.mark||(l.node=s)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Zo(t,Zo.schemaRules(t)))}}const OB={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Pfe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},kB={ol:!0,ul:!0},wp=1,Xw=2,$h=4;function hD(e,t,n){return t!=null?(t?wp:0)|(t==="full"?Xw:0):e&&e.whitespace=="pre"?wp|Xw:n&~$h}class a0{constructor(t,n,r,s,i,l){this.type=t,this.attrs=n,this.marks=r,this.solid=s,this.options=l,this.content=[],this.activeMarks=Jt.none,this.match=i||(l&$h?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Me.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(t.type))?(this.match=r,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&wp)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=Me.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Me.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!OB.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class pD{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,l=hD(null,n.preserveWhitespace,0)|(r?$h:0);s?i=new a0(s.type,s.attrs,Jt.none,!0,n.topMatch||s.type.contentMatch,l):r?i=new a0(null,null,Jt.none,!0,null,l):i=new a0(t.schema.topNodeType,null,Jt.none,!0,null,l),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,s=this.top,i=s.options&Xw?"full":this.localPreserveWS||(s.options&wp)>0,{schema:l}=this.parser;if(i==="full"||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
346
- `);else if(l.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(l.linebreakReplacement.create())){let c=r.split(/\r?\n|\r/);for(let u=0;u<c.length;u++)u&&this.insertNode(l.linebreakReplacement.create(),n,!0),c[u]&&this.insertNode(l.text(c[u]),n,!/\S/.test(c[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let c=s.content[s.content.length-1],u=t.previousSibling;(!c||u&&u.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.text))&&(r=r.slice(1))}r&&this.insertNode(l.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let s=this.localPreserveWS,i=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let l=t.nodeName.toLowerCase(),c;kB.hasOwnProperty(l)&&this.parser.normalizeLists&&zfe(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(c=this.parser.matchTag(t,this,r));e:if(u?u.ignore:Pfe.hasOwnProperty(l))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let d,h=this.needsBlock;if(OB.hasOwnProperty(l))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),d=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let m=u&&u.skip?n:this.readStyles(t,n);m&&this.addAll(t,m),d&&this.sync(i),this.needsBlock=h}else{let d=this.readStyles(t,n);d&&this.addElementByRule(t,u,d,u.consuming===!1?c:void 0)}this.localPreserveWS=s}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
347
- `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],l=r.getPropertyValue(i);if(l)for(let c=void 0;;){let u=this.parser.matchStyle(i,l,this,c);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)c=u;else break}}return n}addElementByRule(t,n,r,s){let i,l;if(n.node)if(l=this.parser.schema.nodes[n.node],l.isLeaf)this.insertNode(l.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let u=this.enter(l,n.attrs||null,r,n.preserveWhitespace);u&&(i=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let c=this.top;if(l&&l.isLeaf)this.findInside(t);else if(s)this.addElement(t,r,s);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!1)}i&&this.sync(c)&&this.open--}addAll(t,n,r,s){let i=r||0;for(let l=r?t.childNodes[r]:t.firstChild,c=s==null?null:t.childNodes[s];l!=c;l=l.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(l,n);this.findAtPoint(t,i)}findPlace(t,n,r){let s,i;for(let l=this.open,c=0;l>=0;l--){let u=this.nodes[l],d=u.findWrapping(t);if(d&&(!s||s.length>d.length+c)&&(s=d,i=u,!d.length))break;if(u.solid){if(r)break;c+=2}}if(!s)return null;this.sync(i);for(let l=0;l<s.length;l++)n=this.enterInner(s[l],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(t,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let l=Jt.none;for(let c of s.concat(t.marks))(i.type?i.type.allowsMarkType(c.type):gD(c.type,t.type))&&(l=c.addToSet(l));return i.content.push(t.mark(l)),!0}return!1}enter(t,n,r,s){let i=this.findPlace(t.create(n),r,!1);return i&&(i=this.enterInner(t,n,r,!0,s)),i}enterInner(t,n,r,s=!1,i){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(t);let c=hD(t,i,l.options);l.options&$h&&l.content.length==0&&(c|=$h);let u=Jt.none;return r=r.filter(d=>(l.type?l.type.allowsMarkType(d.type):gD(d.type,t))?(u=d.addToSet(u),!1):!0),this.nodes.push(new a0(t,n,u,s,null,c)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=wp)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)t+=r[s].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&t.nodeType==1&&t.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),l=(c,u)=>{for(;c>=0;c--){let d=n[c];if(d==""){if(c==n.length-1||c==0)continue;for(;u>=i;u--)if(l(c-1,u))return!0;return!1}else{let h=u>0||u==0&&s?this.nodes[u].type:r&&u>=i?r.node(u-i).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;u--}}return!0};return l(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function zfe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&kB.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function Bfe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function mD(e){let t={};for(let n in e)t[n]=e[n];return t}function gD(e,t){let n=t.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(e))continue;let i=[],l=c=>{i.push(c);for(let u=0;u<c.edgeCount;u++){let{type:d,next:h}=c.edge(u);if(d==t||i.indexOf(h)<0&&l(h))return!0}};if(l(s.contentMatch))return!0}}class du{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=c0(n).createDocumentFragment());let s=r,i=[];return t.forEach(l=>{if(i.length||l.marks.length){let c=0,u=0;for(;c<i.length&&u<l.marks.length;){let d=l.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(i[c][0])||d.type.spec.spanning===!1)break;c++,u++}for(;c<i.length;)s=i.pop()[1];for(;u<l.marks.length;){let d=l.marks[u++],h=this.serializeMark(d,l.isInline,n);h&&(i.push([d,s]),s.appendChild(h.dom),s=h.contentDOM||h.dom)}}s.appendChild(this.serializeNodeInner(l,n))}),r}serializeNodeInner(t,n){if(t.isText)return c0(n).createTextNode(t.text);let{dom:r,contentDOM:s}=I0(c0(n),this.nodes[t.type.name](t),null,t.attrs);if(s){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,s)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let s=t.marks.length-1;s>=0;s--){let i=this.serializeMark(t.marks[s],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let s=this.marks[t.type.name];return s&&I0(c0(r),s(t,n),null,t.attrs)}static renderSpec(t,n,r=null,s){return typeof n=="string"?{dom:t.createTextNode(n)}:I0(t,n,r,s)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new du(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=yD(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return yD(t.marks)}}function yD(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function c0(e){return e.document||window.document}const xD=new WeakMap;function Hfe(e){let t=xD.get(e);return t===void 0&&xD.set(e,t=Ffe(e)),t}function Ffe(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(e),t}function I0(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let s=t[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Hfe(r))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let c,u=n?e.createElementNS(n,s):e.createElement(s),d=t[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let m in d)if(d[m]!=null){let g=m.indexOf(" ");g>0?u.setAttributeNS(m.slice(0,g),m.slice(g+1),d[m]):m=="style"&&u.style?u.style.cssText=d[m]:u.setAttribute(m,d[m])}}for(let m=h;m<t.length;m++){let g=t[m];if(g===0){if(m<t.length-1||m>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else if(typeof g=="string")u.appendChild(e.createTextNode(g));else{let{dom:y,contentDOM:b}=I0(e,g,n,r);if(u.appendChild(y),b){if(c)throw new RangeError("Multiple content holes");c=b}}}return{dom:u,contentDOM:c}}const MB=65535,AB=Math.pow(2,16);function $fe(e,t){return e+t*AB}function bD(e){return e&MB}function Vfe(e){return(e-(e&MB))/AB}const _B=1,DB=2,j0=4,IB=8;class Qw{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&IB)>0}get deletedBefore(){return(this.delInfo&(_B|j0))>0}get deletedAfter(){return(this.delInfo&(DB|j0))>0}get deletedAcross(){return(this.delInfo&j0)>0}}class js{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&js.empty)return js.empty}recover(t){let n=0,r=bD(t);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+Vfe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let s=0,i=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?s:0);if(u>t)break;let d=this.ranges[c+i],h=this.ranges[c+l],m=u+d;if(t<=m){let g=d?t==u?-1:t==m?1:n:n,y=u+s+(g<0?0:h);if(r)return y;let b=t==(n<0?u:m)?null:$fe(c/3,t-u),w=0;return d&&(w|=t==u?DB:t==m?_B:j0,(n<0?t!=u:t!=m)&&(w|=IB)),new Qw(y,w,b)}s+=h-d}return r?t+s:new Qw(t+s,0,null)}touches(t,n){let r=0,s=bD(n),i=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?r:0);if(u>t)break;let d=this.ranges[c+i],h=u+d;if(t<=h&&c==s*3)return!0;r+=this.ranges[c+l]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let l=this.ranges[s],c=l-(this.inverted?i:0),u=l+(this.inverted?0:i),d=this.ranges[s+n],h=this.ranges[s+r];t(c,c+d,u,u+h),i+=h-d}}invert(){return new js(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?js.empty:new js(t<0?[0,-t,0]:[0,0,t])}}js.empty=new js([]);class Ep{constructor(t,n,r=0,s=t?t.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ep(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let s=t.getMirror(n);this.appendMap(t._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let s=t.getMirror(n);this.appendMap(t._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let t=new Ep;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let s=0;for(let i=this.from;i<this.to;i++){let l=this._maps[i],c=l.mapResult(t,n);if(c.recover!=null){let u=this.getMirror(i);if(u!=null&&u>i&&u<this.to){i=u,t=this._maps[u].recover(c.recover);continue}}s|=c.delInfo,t=c.pos}return r?t:new Qw(t,s,null)}}const r1=Object.create(null);class Pr{getMap(){return js.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=r1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in r1)throw new RangeError("Duplicate use of step JSON ID "+t);return r1[t]=n,n.prototype.jsonID=t,n}}class Fn{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Fn(t,null)}static fail(t){return new Fn(null,t)}static fromReplace(t,n,r,s){try{return Fn.ok(t.replace(n,r,s))}catch(i){if(i instanceof vp)return Fn.fail(i.message);throw i}}}function N2(e,t,n){let r=[];for(let s=0;s<e.childCount;s++){let i=e.child(s);i.content.size&&(i=i.copy(N2(i.content,t,i))),i.isInline&&(i=t(i,n,s)),r.push(i)}return Me.fromArray(r)}class ca extends Pr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new He(N2(n.content,(l,c)=>!l.isAtom||!c.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),s),n.openStart,n.openEnd);return Fn.fromReplace(t,this.from,this.to,i)}invert(){return new wi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ca(n.pos,r.pos,this.mark)}merge(t){return t instanceof ca&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ca(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ca(n.from,n.to,t.markFromJSON(n.mark))}}Pr.jsonID("addMark",ca);class wi extends Pr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new He(N2(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),t),n.openStart,n.openEnd);return Fn.fromReplace(t,this.from,this.to,r)}invert(){return new ca(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new wi(n.pos,r.pos,this.mark)}merge(t){return t instanceof wi&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new wi(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wi(n.from,n.to,t.markFromJSON(n.mark))}}Pr.jsonID("removeMark",wi);class ua extends Pr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Fn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fn.fromReplace(t,this.pos,this.pos+1,new He(Me.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new ua(this.pos,n.marks[s]);return new ua(this.pos,this.mark)}}return new Wc(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ua(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ua(n.pos,t.markFromJSON(n.mark))}}Pr.jsonID("addNodeMark",ua);class Wc extends Pr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Fn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fn.fromReplace(t,this.pos,this.pos+1,new He(Me.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ua(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Wc(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wc(n.pos,t.markFromJSON(n.mark))}}Pr.jsonID("removeNodeMark",Wc);class Mn extends Pr{constructor(t,n,r,s=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=s}apply(t){return this.structure&&Zw(t,this.from,this.to)?Fn.fail("Structure replace would overwrite content"):Fn.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new js([this.from,this.to-this.from,this.slice.size])}invert(t){return new Mn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&Mn.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Mn(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Mn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?He.empty:new He(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Mn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?He.empty:new He(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Mn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Mn(n.from,n.to,He.fromJSON(t,n.slice),!!n.structure)}}Mn.MAP_BIAS=1;Pr.jsonID("replace",Mn);class ir extends Pr{constructor(t,n,r,s,i,l,c=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=l,this.structure=c}apply(t){if(this.structure&&(Zw(t,this.from,this.gapFrom)||Zw(t,this.gapTo,this.to)))return Fn.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fn.fromReplace(t,this.from,this.to,r):Fn.fail("Content does not fit in gap")}getMap(){return new js([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new ir(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new ir(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ir(n.from,n.to,n.gapFrom,n.gapTo,He.fromJSON(t,n.slice),n.insert,!!n.structure)}}Pr.jsonID("replaceAround",ir);function Zw(e,t,n){let r=e.resolve(t),s=n-t,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let l=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,s--}}return!1}function Ufe(e,t,n,r){let s=[],i=[],l,c;e.doc.nodesBetween(t,n,(u,d,h)=>{if(!u.isInline)return;let m=u.marks;if(!r.isInSet(m)&&h.type.allowsMarkType(r.type)){let g=Math.max(d,t),y=Math.min(d+u.nodeSize,n),b=r.addToSet(m);for(let w=0;w<m.length;w++)m[w].isInSet(b)||(l&&l.to==g&&l.mark.eq(m[w])?l.to=y:s.push(l=new wi(g,y,m[w])));c&&c.to==g?c.to=y:i.push(c=new ca(g,y,r))}}),s.forEach(u=>e.step(u)),i.forEach(u=>e.step(u))}function qfe(e,t,n,r){let s=[],i=0;e.doc.nodesBetween(t,n,(l,c)=>{if(!l.isInline)return;i++;let u=null;if(r instanceof Ax){let d=l.marks,h;for(;h=r.isInSet(d);)(u||(u=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(l.marks)&&(u=[r]):u=l.marks;if(u&&u.length){let d=Math.min(c+l.nodeSize,n);for(let h=0;h<u.length;h++){let m=u[h],g;for(let y=0;y<s.length;y++){let b=s[y];b.step==i-1&&m.eq(s[y].style)&&(g=b)}g?(g.to=d,g.step=i):s.push({style:m,from:Math.max(c,t),to:d,step:i})}}}),s.forEach(l=>e.step(new wi(l.from,l.to,l.style)))}function T2(e,t,n,r=n.contentMatch,s=!0){let i=e.doc.nodeAt(t),l=[],c=t+1;for(let u=0;u<i.childCount;u++){let d=i.child(u),h=c+d.nodeSize,m=r.matchType(d.type);if(!m)l.push(new Mn(c,h,He.empty));else{r=m;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||e.step(new wi(c,h,d.marks[g]));if(s&&d.isText&&n.whitespace!="pre"){let g,y=/\r?\n|\r/g,b;for(;g=y.exec(d.text);)b||(b=new He(Me.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),l.push(new Mn(c+g.index,c+g.index+g[0].length,b))}}c=h}if(!r.validEnd){let u=r.fillBefore(Me.empty,!0);e.replace(c,c,new He(u,0,0))}for(let u=l.length-1;u>=0;u--)e.step(l[u])}function Gfe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function gd(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,s=0,i=0;;--r){let l=e.$from.node(r),c=e.$from.index(r)+s,u=e.$to.indexAfter(r)-i;if(r<e.depth&&l.canReplace(c,u,n))return r;if(r==0||l.type.spec.isolating||!Gfe(l,c,u))break;c&&(s=1),u<l.childCount&&(i=1)}return null}function Kfe(e,t,n){let{$from:r,$to:s,depth:i}=t,l=r.before(i+1),c=s.after(i+1),u=l,d=c,h=Me.empty,m=0;for(let b=i,w=!1;b>n;b--)w||r.index(b)>0?(w=!0,h=Me.from(r.node(b).copy(h)),m++):u--;let g=Me.empty,y=0;for(let b=i,w=!1;b>n;b--)w||s.after(b+1)<s.end(b)?(w=!0,g=Me.from(s.node(b).copy(g)),y++):d++;e.step(new ir(u,d,l,c,new He(h.append(g),m,y),h.size-m,!0))}function R2(e,t,n=null,r=e){let s=Yfe(e,t),i=s&&Wfe(r,t);return i?s.map(vD).concat({type:t,attrs:n}).concat(i.map(vD)):null}function vD(e){return{type:e,attrs:null}}function Yfe(e,t){let{parent:n,startIndex:r,endIndex:s}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let l=i.length?i[0]:t;return n.canReplaceWith(r,s,l)?i:null}function Wfe(e,t){let{parent:n,startIndex:r,endIndex:s}=e,i=n.child(r),l=t.contentMatch.findWrapping(i.type);if(!l)return null;let u=(l.length?l[l.length-1]:t).contentMatch;for(let d=r;u&&d<s;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:l}function Xfe(e,t,n){let r=Me.empty;for(let l=n.length-1;l>=0;l--){if(r.size){let c=n[l].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Me.from(n[l].type.create(n[l].attrs,r))}let s=t.start,i=t.end;e.step(new ir(s,i,s,i,new He(r,0,0),n.length,!0))}function Qfe(e,t,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(l,c)=>{let u=typeof s=="function"?s(l):s;if(l.isTextblock&&!l.hasMarkup(r,u)&&Zfe(e.doc,e.mapping.slice(i).map(c),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!b?d=!1:!y&&b&&(d=!0)}d===!1&&LB(e,l,c,i),T2(e,e.mapping.slice(i).map(c,1),r,void 0,d===null);let h=e.mapping.slice(i),m=h.map(c,1),g=h.map(c+l.nodeSize,1);return e.step(new ir(m,g,m+1,g-1,new He(Me.from(r.create(u,null,l.marks)),0,0),1,!0)),d===!0&&jB(e,l,c,i),!1}})}function jB(e,t,n,r){t.forEach((s,i)=>{if(s.isText){let l,c=/\r?\n|\r/g;for(;l=c.exec(s.text);){let u=e.mapping.slice(r).map(n+1+i+l.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function LB(e,t,n,r){t.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let l=e.mapping.slice(r).map(n+1+i);e.replaceWith(l,l+1,t.type.schema.text(`
348
- `))}})}function Zfe(e,t,n){let r=e.resolve(t),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function Jfe(e,t,n,r,s){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let l=n.create(r,null,s||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,l);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ir(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new He(Me.from(l),0,0),1,!0))}function Jo(e,t,n=1,r){let s=e.resolve(t),i=s.depth-n,l=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!l.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let d=s.depth-1,h=n-2;d>i;d--,h--){let m=s.node(d),g=s.index(d);if(m.type.spec.isolating)return!1;let y=m.content.cutByIndex(g,m.childCount),b=r&&r[h+1];b&&(y=y.replaceChild(0,b.type.create(b.attrs)));let w=r&&r[h]||m;if(!m.canReplace(g+1,m.childCount)||!w.type.validContent(y))return!1}let c=s.indexAfter(i),u=r&&r[0];return s.node(i).canReplaceWith(c,c,u?u.type:s.node(i+1).type)}function ede(e,t,n=1,r){let s=e.doc.resolve(t),i=Me.empty,l=Me.empty;for(let c=s.depth,u=s.depth-n,d=n-1;c>u;c--,d--){i=Me.from(s.node(c).copy(i));let h=r&&r[d];l=Me.from(h?h.type.create(h.attrs,l):s.node(c).copy(l))}e.step(new Mn(t,t,new He(i.append(l),n,n),!0))}function Ia(e,t){let n=e.resolve(t),r=n.index();return PB(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function tde(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let s=0;s<t.childCount;s++){let i=t.child(s),l=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(l),!n||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}function PB(e,t){return!!(e&&t&&!e.isLeaf&&tde(e,t))}function _x(e,t,n=-1){let r=e.resolve(t);for(let s=r.depth;;s--){let i,l,c=r.index(s);if(s==r.depth?(i=r.nodeBefore,l=r.nodeAfter):n>0?(i=r.node(s+1),c++,l=r.node(s).maybeChild(c)):(i=r.node(s).maybeChild(c-1),l=r.node(s+1)),i&&!i.isTextblock&&PB(i,l)&&r.node(s).canReplace(c,c+1))return t;if(s==0)break;t=n<0?r.before(s):r.after(s)}}function nde(e,t,n){let r=null,{linebreakReplacement:s}=e.doc.type.schema,i=e.doc.resolve(t-n),l=i.node().type;if(s&&l.inlineContent){let h=l.whitespace=="pre",m=!!l.contentMatch.matchType(s);h&&!m?r=!1:!h&&m&&(r=!0)}let c=e.steps.length;if(r===!1){let h=e.doc.resolve(t+n);LB(e,h.node(),h.before(),c)}l.inlineContent&&T2(e,t+n-1,l,i.node().contentMatchAt(i.index()),r==null);let u=e.mapping.slice(c),d=u.map(t-n);if(e.step(new Mn(d,u.map(t+n,-1),He.empty,!0)),r===!0){let h=e.doc.resolve(d);jB(e,h.node(),h.before(),e.steps.length)}return e}function rde(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function sde(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let l=r.depth;l>=0;l--){let c=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,u=r.index(l)+(c>0?1:0),d=r.node(l),h=!1;if(i==1)h=d.canReplace(u,u,s);else{let m=d.contentMatchAt(u).findWrapping(s.firstChild.type);h=m&&d.canReplaceWith(u,u,m[0])}if(h)return c==0?r.pos:c<0?r.before(l+1):r.after(l+1)}return null}function Dx(e,t,n=t,r=He.empty){if(t==n&&!r.size)return null;let s=e.resolve(t),i=e.resolve(n);return zB(s,i,r)?new Mn(t,n,r):new ide(s,i,r).fit()}function zB(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ide{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Me.empty;for(let s=0;s<=t.depth;s++){let i=t.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(s))})}for(let s=t.depth;s>0;s--)this.placed=Me.from(t.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(t<0?this.$to:r.doc.resolve(t));if(!s)return null;let i=this.placed,l=r.depth,c=s.depth;for(;l&&c&&i.childCount==1;)i=i.firstChild.content,l--,c--;let u=new He(i,l,c);return t>-1?new ir(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Mn(r.pos,s.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=SD(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let l=s.firstChild;for(let c=this.depth;c>=0;c--){let{type:u,match:d}=this.frontier[c],h,m=null;if(n==1&&(l?d.matchType(l.type)||(m=d.fillBefore(Me.from(l),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:c,parent:i,inject:m};if(n==2&&l&&(h=d.findWrapping(l.type)))return{sliceDepth:r,frontierDepth:c,parent:i,wrap:h};if(i&&d.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced;return wD(t,-1)<=n?!1:(this.unplaced.size>1&&wD(t,1)>r&&r++,this.unplaced=new He(t,n+1,r),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,s=SD(t,n);if(s.childCount<=1&&n>0){let i=t.size-n<=n+s.size;this.unplaced=new He(Mh(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new He(Mh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let w=0;w<i.length;w++)this.openFrontierNode(i[w]);let l=this.unplaced,c=r?r.content:l.content,u=l.openStart-t,d=0,h=[],{match:m,type:g}=this.frontier[n];if(s){for(let w=0;w<s.childCount;w++)h.push(s.child(w));m=m.matchFragment(s)}let y=c.size+t-(l.content.size-l.openEnd);for(;d<c.childCount;){let w=c.child(d),E=m.matchType(w.type);if(!E)break;d++,(d>1||u==0||w.content.size)&&(m=E,h.push(BB(w.mark(g.allowedMarks(w.marks)),d==1?u:0,d==c.childCount?y:-1)))}let b=d==c.childCount;b||(y=-1),this.placed=Ah(this.placed,n,Me.from(h)),this.frontier[n].match=m,b&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,E=c;w<y;w++){let C=E.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),E=C.content}this.unplaced=b?t==0?He.empty:new He(Mh(l.content,t-1,1),t-1,y<0?l.openEnd:t-1):new He(Mh(l.content,t,d),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!s1(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),l=s1(t,n,s,r,i);if(l){for(let c=n-1;c>=0;c--){let{match:u,type:d}=this.frontier[c],h=s1(t,c,d,u,!0);if(!h||h.childCount)continue e}return{depth:n,fit:l,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ah(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let s=t.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,t.index(r));this.openFrontierNode(s.type,s.attrs,i)}return t}openFrontierNode(t,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(t),this.placed=Ah(this.placed,this.depth,Me.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Me.empty,!0);n.childCount&&(this.placed=Ah(this.placed,this.frontier.length,n))}}function Mh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Mh(e.firstChild.content,t-1,n)))}function Ah(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ah(e.lastChild.content,t-1,n)))}function SD(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function BB(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,BB(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Me.empty,!0)))),e.copy(r)}function s1(e,t,n,r,s){let i=e.node(t),l=s?e.indexAfter(t):e.index(t);if(l==i.childCount&&!n.compatibleContent(i.type))return null;let c=r.fillBefore(i.content,!0,l);return c&&!ode(n,i.content,l)?c:null}function ode(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function lde(e){return e.spec.defining||e.spec.definingForContent}function wD(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function ade(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let s=e.doc.resolve(t),i=e.doc.resolve(n);if(zB(s,i,r))return e.step(new Mn(t,n,r));let l=FB(s,i);l[l.length-1]==0&&l.pop();let c=-(s.depth+1);l.unshift(c);for(let g=s.depth,y=s.pos-1;g>0;g--,y--){let b=s.node(g).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;l.indexOf(g)>-1?c=g:s.before(g)==y&&l.splice(1,0,-g)}let u=l.indexOf(c),d=[],h=r.openStart;for(let g=r.content,y=0;;y++){let b=g.firstChild;if(d.push(b),y==r.openStart)break;g=b.content}for(let g=h-1;g>=0;g--){let y=d[g],b=lde(y.type);if(b&&!y.sameMarkup(s.node(Math.abs(c)-1)))h=g;else if(b||!y.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let y=(g+h+1)%(r.openStart+1),b=d[y];if(b)for(let w=0;w<l.length;w++){let E=l[(w+u)%l.length],C=!0;E<0&&(C=!1,E=-E);let T=s.node(E-1),N=s.index(E-1);if(T.canReplaceWith(N,N,b.type,b.marks))return e.replace(s.before(E),C?i.after(E):n,new He(HB(r.content,0,r.openStart,y),y,r.openEnd))}}let m=e.steps.length;for(let g=l.length-1;g>=0&&(e.replace(t,n,r),!(e.steps.length>m));g--){let y=l[g];y<0||(t=s.before(y),n=i.after(y))}}function HB(e,t,n,r,s){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(HB(i.content,t+1,n,r,i)))}if(t>r){let i=s.contentMatchAt(0),l=i.fillBefore(e).append(e);e=l.append(i.matchFragment(l).fillBefore(Me.empty,!0))}return e}function cde(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let s=rde(e.doc,t,r.type);s!=null&&(t=n=s)}e.replaceRange(t,n,new He(Me.from(r),0,0))}function ude(e,t,n){let r=e.doc.resolve(t),s=e.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let l=r.sharedDepth(n),c=!1;for(let u=r.depth;u>l;u--)r.node(u).type.spec.isolating&&(c=!0);for(let u=s.depth;u>l;u--)s.node(u).type.spec.isolating&&(c=!0);if(!c){for(let u=r.depth;u>0&&t==r.start(u);u--)t=r.before(u);for(let u=s.depth;u>0&&n==s.start(u);u--)n=s.before(u);r=e.doc.resolve(t),s=e.doc.resolve(n)}}let i=FB(r,s);for(let l=0;l<i.length;l++){let c=i[l],u=l==i.length-1;if(u&&c==0||r.node(c).type.contentMatch.validEnd)return e.delete(r.start(c),s.end(c));if(c>0&&(u||r.node(c-1).canReplace(r.index(c-1),s.indexAfter(c-1))))return e.delete(r.before(c),s.after(c))}for(let l=1;l<=r.depth&&l<=s.depth;l++)if(t-r.start(l)==r.depth-l&&n>r.end(l)&&s.end(l)-n!=s.depth-l&&r.start(l-1)==s.start(l-1)&&r.node(l-1).canReplace(r.index(l-1),s.index(l-1)))return e.delete(r.before(l),n);e.delete(t,n)}function FB(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let s=r;s>=0;s--){let i=e.start(s);if(i<e.pos-(e.depth-s)||t.end(s)>t.pos+(t.depth-s)||e.node(s).type.spec.isolating||t.node(s).type.spec.isolating)break;(i==t.start(s)||s==e.depth&&s==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&s&&t.start(s-1)==i-1)&&n.push(s)}return n}class Cf extends Pr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Fn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return Fn.fromReplace(t,this.pos,this.pos+1,new He(Me.from(s),0,n.isLeaf?0:1))}getMap(){return js.empty}invert(t){return new Cf(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cf(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Cf(n.pos,n.attr,n.value)}}Pr.jsonID("attr",Cf);class Cp extends Pr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Fn.ok(r)}getMap(){return js.empty}invert(t){return new Cp(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cp(n.attr,n.value)}}Pr.jsonID("docAttr",Cp);let ed=class extends Error{};ed=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};ed.prototype=Object.create(Error.prototype);ed.prototype.constructor=ed;ed.prototype.name="TransformError";class $B{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ep}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new ed(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(t=s.map(t,1),n=s.map(n,-1)),s.forEach((i,l,c,u)=>{t=Math.min(t,c),n=Math.max(n,u)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=He.empty){let s=Dx(this.doc,t,n,r);return s&&this.step(s),this}replaceWith(t,n,r){return this.replace(t,n,new He(Me.from(r),0,0))}delete(t,n){return this.replace(t,n,He.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return ade(this,t,n,r),this}replaceRangeWith(t,n,r){return cde(this,t,n,r),this}deleteRange(t,n){return ude(this,t,n),this}lift(t,n){return Kfe(this,t,n),this}join(t,n=1){return nde(this,t,n),this}wrap(t,n){return Xfe(this,t,n),this}setBlockType(t,n=t,r,s=null){return Qfe(this,t,n,r,s),this}setNodeMarkup(t,n,r=null,s){return Jfe(this,t,n,r,s),this}setNodeAttribute(t,n,r){return this.step(new Cf(t,n,r)),this}setDocAttribute(t,n){return this.step(new Cp(t,n)),this}addNodeMark(t,n){return this.step(new ua(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof Jt)n.isInSet(r.marks)&&this.step(new Wc(t,n));else{let s=r.marks,i,l=[];for(;i=n.isInSet(s);)l.push(new Wc(t,i)),s=i.removeFromSet(s);for(let c=l.length-1;c>=0;c--)this.step(l[c])}return this}split(t,n=1,r){return ede(this,t,n,r),this}addMark(t,n,r){return Ufe(this,t,n,r),this}removeMark(t,n,r){return qfe(this,t,n,r),this}clearIncompatible(t,n,r){return T2(this,t,n,r),this}}const i1=Object.create(null);class Nt{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new fde(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=He.empty){let r=n.content.lastChild,s=null;for(let c=0;c<n.openEnd;c++)s=r,r=r.lastChild;let i=t.steps.length,l=this.ranges;for(let c=0;c<l.length;c++){let{$from:u,$to:d}=l[c],h=t.mapping.slice(i);t.replaceRange(h.map(u.pos),h.map(d.pos),c?He.empty:n),c==0&&ND(t,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:l,$to:c}=s[i],u=t.mapping.slice(r),d=u.map(l.pos),h=u.map(c.pos);i?t.deleteRange(d,h):(t.replaceRangeWith(d,h,n),ND(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let s=t.parent.inlineContent?new ct(t):af(t.node(0),t.parent,t.pos,t.index(),n,r);if(s)return s;for(let i=t.depth-1;i>=0;i--){let l=n<0?af(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):af(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(l)return l}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ls(t.node(0))}static atStart(t){return af(t,t,0,0,1)||new Ls(t)}static atEnd(t){return af(t,t,t.content.size,t.childCount,-1)||new Ls(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=i1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in i1)throw new RangeError("Duplicate use of selection JSON ID "+t);return i1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ct.between(this.$anchor,this.$head).getBookmark()}}Nt.prototype.visible=!0;class fde{constructor(t,n){this.$from=t,this.$to=n}}let ED=!1;function CD(e){!ED&&!e.parent.inlineContent&&(ED=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ct extends Nt{constructor(t,n=t){CD(t),CD(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Nt.near(r);let s=t.resolve(n.map(this.anchor));return new ct(s.parent.inlineContent?s:r,r)}replace(t,n=He.empty){if(super.replace(t,n),n==He.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ct&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ix(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ct(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let s=t.resolve(n);return new this(s,r==n?s:t.resolve(r))}static between(t,n,r){let s=t.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=Nt.findFrom(n,r,!0)||Nt.findFrom(n,-r,!0);if(i)n=i.$head;else return Nt.near(n,r)}return t.parent.inlineContent||(s==0?t=n:(t=(Nt.findFrom(t,-r,!0)||Nt.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=s<0&&(t=n))),new ct(t,n)}}Nt.jsonID("text",ct);class Ix{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ix(t.map(this.anchor),t.map(this.head))}resolve(t){return ct.between(t.resolve(this.anchor),t.resolve(this.head))}}class rt extends Nt{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=t.resolve(s);return r?Nt.near(i):new rt(i)}content(){return new He(Me.from(this.node),0,0)}eq(t){return t instanceof rt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new O2(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new rt(t.resolve(n.anchor))}static create(t,n){return new rt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}rt.prototype.visible=!1;Nt.jsonID("node",rt);class O2{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ix(r,r):new O2(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&rt.isSelectable(r)?new rt(n):Nt.near(n)}}class Ls extends Nt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=He.empty){if(n==He.empty){t.delete(0,t.doc.content.size);let r=Nt.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ls(t)}map(t){return new Ls(t)}eq(t){return t instanceof Ls}getBookmark(){return dde}}Nt.jsonID("all",Ls);const dde={map(){return this},resolve(e){return new Ls(e)}};function af(e,t,n,r,s,i=!1){if(t.inlineContent)return ct.create(e,n);for(let l=r-(s>0?0:1);s>0?l<t.childCount:l>=0;l+=s){let c=t.child(l);if(c.isAtom){if(!i&&rt.isSelectable(c))return rt.create(e,n-(s<0?c.nodeSize:0))}else{let u=af(e,c,n+s,s<0?c.childCount:0,s,i);if(u)return u}n+=c.nodeSize*s}return null}function ND(e,t,n){let r=e.steps.length-1;if(r<t)return;let s=e.steps[r];if(!(s instanceof Mn||s instanceof ir))return;let i=e.mapping.maps[r],l;i.forEach((c,u,d,h)=>{l==null&&(l=h)}),e.setSelection(Nt.near(e.doc.resolve(l),n))}const TD=1,u0=2,RD=4;class hde extends $B{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|TD)&~u0,this.storedMarks=null,this}get selectionSet(){return(this.updated&TD)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=u0,this}ensureMarks(t){return Jt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&u0)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~u0,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Jt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let s=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(s.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let l=this.doc.resolve(n);i=r==n?l.marks():l.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(t,i)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Nt.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=RD,this}get scrolledIntoView(){return(this.updated&RD)>0}}function OD(e,t){return!t||!e?e:e.bind(t)}class _h{constructor(t,n,r){this.name=t,this.init=OD(n.init,r),this.apply=OD(n.apply,r)}}const pde=[new _h("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new _h("selection",{init(e,t){return e.selection||Nt.atStart(t.doc)},apply(e){return e.selection}}),new _h("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new _h("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class o1{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pde.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new _h(r.key,r.spec.state,r))})}}class $o{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),s=null;for(;;){let i=!1;for(let l=0;l<this.config.plugins.length;l++){let c=this.config.plugins[l];if(c.spec.appendTransaction){let u=s?s[l].n:0,d=s?s[l].state:this,h=u<n.length&&c.spec.appendTransaction.call(c,u?n.slice(u):n,d,r);if(h&&r.filterTransaction(h,l)){if(h.setMeta("appendedTransaction",t),!s){s=[];for(let m=0;m<this.config.plugins.length;m++)s.push(m<l?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),i=!0}s&&(s[l]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $o(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new hde(this)}static create(t){let n=new o1(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new $o(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(t,r);return r}reconfigure(t){let n=new o1(this.schema,t.plugins),r=n.fields,s=new $o(n);for(let i=0;i<r.length;i++){let l=r[i].name;s[l]=this.hasOwnProperty(l)?this[l]:r[i].init(t,s)}return s}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=t[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let s=new o1(t.schema,t.plugins),i=new $o(s);return s.fields.forEach(l=>{if(l.name=="doc")i.doc=Lc.fromJSON(t.schema,n.doc);else if(l.name=="selection")i.selection=Nt.fromJSON(i.doc,n.selection);else if(l.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let c in r){let u=r[c],d=u.spec.state;if(u.key==l.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,c)){i[l.name]=d.fromJSON.call(u,t,n[c],i);return}}i[l.name]=l.init(t,i)}}),i}}function VB(e,t,n){for(let r in e){let s=e[r];s instanceof Function?s=s.bind(t):r=="handleDOMEvents"&&(s=VB(s,t,{})),n[r]=s}return n}class $s{constructor(t){this.spec=t,this.props={},t.props&&VB(t.props,this,this.props),this.key=t.key?t.key.key:UB("plugin")}getState(t){return t[this.key]}}const l1=Object.create(null);function UB(e){return e in l1?e+"$"+ ++l1[e]:(l1[e]=0,e+"$")}class Mi{constructor(t="key"){this.key=UB(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const qB=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function GB(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const KB=(e,t,n)=>{let r=GB(e,n);if(!r)return!1;let s=k2(r);if(!s){let l=r.blockRange(),c=l&&gd(l);return c==null?!1:(t&&t(e.tr.lift(l,c).scrollIntoView()),!0)}let i=s.nodeBefore;if(n6(e,s,t,-1))return!0;if(r.parent.content.size==0&&(td(i,"end")||rt.isSelectable(i)))for(let l=r.depth;;l--){let c=Dx(e.doc,r.before(l),r.after(l),He.empty);if(c&&c.slice.size<c.to-c.from){if(t){let u=e.tr.step(c);u.setSelection(td(i,"end")?Nt.findFrom(u.doc.resolve(u.mapping.map(s.pos,-1)),-1):rt.create(u.doc,s.pos-i.nodeSize)),t(u.scrollIntoView())}return!0}if(l==1||r.node(l-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(t&&t(e.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},mde=(e,t,n)=>{let r=GB(e,n);if(!r)return!1;let s=k2(r);return s?YB(e,s,t):!1},gde=(e,t,n)=>{let r=XB(e,n);if(!r)return!1;let s=M2(r);return s?YB(e,s,t):!1};function YB(e,t,n){let r=t.nodeBefore,s=r,i=t.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let h=s.lastChild;if(!h)return!1;s=h}let l=t.nodeAfter,c=l,u=t.pos+1;for(;!c.isTextblock;u++){if(c.type.spec.isolating)return!1;let h=c.firstChild;if(!h)return!1;c=h}let d=Dx(e.doc,i,u,He.empty);if(!d||d.from!=i||d instanceof Mn&&d.slice.size>=u-i)return!1;if(n){let h=e.tr.step(d);h.setSelection(ct.create(h.doc,i)),n(h.scrollIntoView())}return!0}function td(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const WB=(e,t,n)=>{let{$head:r,empty:s}=e.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=k2(r)}let l=i&&i.nodeBefore;return!l||!rt.isSelectable(l)?!1:(t&&t(e.tr.setSelection(rt.create(e.doc,i.pos-l.nodeSize)).scrollIntoView()),!0)};function k2(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function XB(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const QB=(e,t,n)=>{let r=XB(e,n);if(!r)return!1;let s=M2(r);if(!s)return!1;let i=s.nodeAfter;if(n6(e,s,t,1))return!0;if(r.parent.content.size==0&&(td(i,"start")||rt.isSelectable(i))){let l=Dx(e.doc,r.before(),r.after(),He.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(td(i,"start")?Nt.findFrom(c.doc.resolve(c.mapping.map(s.pos)),1):rt.create(c.doc,c.mapping.map(s.pos))),t(c.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(t&&t(e.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},ZB=(e,t,n)=>{let{$head:r,empty:s}=e.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=M2(r)}let l=i&&i.nodeAfter;return!l||!rt.isSelectable(l)?!1:(t&&t(e.tr.setSelection(rt.create(e.doc,i.pos)).scrollIntoView()),!0)};function M2(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const yde=(e,t)=>{let n=e.selection,r=n instanceof rt,s;if(r){if(n.node.isTextblock||!Ia(e.doc,n.from))return!1;s=n.from}else if(s=_x(e.doc,n.from,-1),s==null)return!1;if(t){let i=e.tr.join(s);r&&i.setSelection(rt.create(i.doc,s-e.doc.resolve(s).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},xde=(e,t)=>{let n=e.selection,r;if(n instanceof rt){if(n.node.isTextblock||!Ia(e.doc,n.to))return!1;r=n.to}else if(r=_x(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},bde=(e,t)=>{let{$from:n,$to:r}=e.selection,s=n.blockRange(r),i=s&&gd(s);return i==null?!1:(t&&t(e.tr.lift(s,i).scrollIntoView()),!0)},JB=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
349
- `).scrollIntoView()),!0)};function A2(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const vde=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),l=A2(s.contentMatchAt(i));if(!l||!s.canReplaceWith(i,i,l))return!1;if(t){let c=n.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(Nt.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0},e6=(e,t)=>{let n=e.selection,{$from:r,$to:s}=n;if(n instanceof Ls||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=A2(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let l=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,c=e.tr.insert(l,i.createAndFill());c.setSelection(ct.create(c.doc,l+1)),t(c.scrollIntoView())}return!0},t6=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Jo(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&gd(r);return s==null?!1:(t&&t(e.tr.lift(r,s).scrollIntoView()),!0)};function Sde(e){return(t,n)=>{if(t.selection instanceof rt&&t.selection.node.isBlock){let{$from:y}=t.selection;return!y.parentOffset||!Jo(t.doc,y.pos)?!1:(n&&n(t.tr.split(y.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof ct||t.selection instanceof Ls)&&r.deleteSelection();let{$from:s}=r.selection,i=r.steps.length,l=[],c,u,d=!1,h=!1;for(let y=s.depth;;y--)if(s.node(y).isBlock){d=s.end(y)==s.pos+(s.depth-y),h=s.start(y)==s.pos-(s.depth-y),u=A2(s.node(y-1).contentMatchAt(s.indexAfter(y-1))),l.unshift(d&&u?{type:u}:null),c=y;break}else{if(y==1)return!1;l.unshift(null)}let m=s.pos,g=Jo(r.doc,m,l.length,l);if(g||(l[0]=u?{type:u}:null,g=Jo(r.doc,m,l.length,l)),!g)return!1;if(r.split(m,l.length,l),!d&&h&&s.node(c).type!=u){let y=r.mapping.slice(i),b=y.map(s.before(c)),w=r.doc.resolve(b);u&&s.node(c-1).canReplaceWith(w.index(),w.index()+1,u)&&r.setNodeMarkup(y.map(s.before(c)),u)}return n&&n(r.scrollIntoView()),!0}}const wde=Sde(),Ede=(e,t)=>{let{$from:n,to:r}=e.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),t&&t(e.tr.setSelection(rt.create(e.doc,s))),!0)};function Cde(e,t,n){let r=t.nodeBefore,s=t.nodeAfter,i=t.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(s.isTextblock||Ia(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function n6(e,t,n,r){let s=t.nodeBefore,i=t.nodeAfter,l,c,u=s.type.spec.isolating||i.type.spec.isolating;if(!u&&Cde(e,t,n))return!0;let d=!u&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(l=(c=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&c.matchType(l[0]||i.type).validEnd){if(n){let y=t.pos+i.nodeSize,b=Me.empty;for(let C=l.length-1;C>=0;C--)b=Me.from(l[C].create(null,b));b=Me.from(s.copy(b));let w=e.tr.step(new ir(t.pos-1,y,t.pos,y,new He(b,1,0),l.length,!0)),E=w.doc.resolve(y+2*l.length);E.nodeAfter&&E.nodeAfter.type==s.type&&Ia(w.doc,E.pos)&&w.join(E.pos),n(w.scrollIntoView())}return!0}let h=i.type.spec.isolating||r>0&&u?null:Nt.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),g=m&&gd(m);if(g!=null&&g>=t.depth)return n&&n(e.tr.lift(m,g).scrollIntoView()),!0;if(d&&td(i,"start",!0)&&td(s,"end")){let y=s,b=[];for(;b.push(y),!y.isTextblock;)y=y.lastChild;let w=i,E=1;for(;!w.isTextblock;w=w.firstChild)E++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){let C=Me.empty;for(let N=b.length-1;N>=0;N--)C=Me.from(b[N].copy(C));let T=e.tr.step(new ir(t.pos-b.length,t.pos+i.nodeSize,t.pos+E,t.pos+i.nodeSize-E,new He(C,b.length,0),0,!0));n(T.scrollIntoView())}return!0}}return!1}function r6(e){return function(t,n){let r=t.selection,s=e<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(t.tr.setSelection(ct.create(t.doc,e<0?s.start(i):s.end(i)))),!0):!1}}const Nde=r6(-1),Tde=r6(1);function Rde(e,t=null){return function(n,r){let{$from:s,$to:i}=n.selection,l=s.blockRange(i),c=l&&R2(l,e,t);return c?(r&&r(n.tr.wrap(l,c).scrollIntoView()),!0):!1}}function kD(e,t=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[i];n.doc.nodesBetween(l,c,(u,d)=>{if(s)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)s=!0;else{let h=n.doc.resolve(d),m=h.index();s=h.parent.canReplaceWith(m,m+1,e)}})}if(!s)return!1;if(r){let i=n.tr;for(let l=0;l<n.selection.ranges.length;l++){let{$from:{pos:c},$to:{pos:u}}=n.selection.ranges[l];i.setBlockType(c,u,e,t)}r(i.scrollIntoView())}return!0}}function _2(...e){return function(t,n,r){for(let s=0;s<e.length;s++)if(e[s](t,n,r))return!0;return!1}}_2(qB,KB,WB);_2(qB,QB,ZB);_2(JB,e6,t6,wde);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Ode(e,t=null){return function(n,r){let{$from:s,$to:i}=n.selection,l=s.blockRange(i);if(!l)return!1;let c=r?n.tr:null;return kde(c,l,e,t)?(r&&r(c.scrollIntoView()),!0):!1}}function kde(e,t,n,r=null){let s=!1,i=t,l=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=l.resolve(t.start-2);i=new Ey(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new Ey(t.$from,l.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let c=R2(i,n,r,t);return c?(e&&Mde(e,t,c,s,n),!0):!1}function Mde(e,t,n,r,s){let i=Me.empty;for(let h=n.length-1;h>=0;h--)i=Me.from(n[h].type.create(n[h].attrs,i));e.step(new ir(t.start-(r?2:0),t.end,t.start,t.end,new He(i,0,0),n.length,!0));let l=0;for(let h=0;h<n.length;h++)n[h].type==s&&(l=h+1);let c=n.length-l,u=t.start+n.length-(r?2:0),d=t.parent;for(let h=t.startIndex,m=t.endIndex,g=!0;h<m;h++,g=!1)!g&&Jo(e.doc,u,c)&&(e.split(u,c),u+=2*c),u+=d.child(h).nodeSize;return e}function Ade(e){return function(t,n){let{$from:r,$to:s}=t.selection,i=r.blockRange(s,l=>l.childCount>0&&l.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?_de(t,n,e,i):Dde(t,n,i):!0:!1}}function _de(e,t,n,r){let s=e.tr,i=r.end,l=r.$to.end(r.depth);i<l&&(s.step(new ir(i-1,l,i,l,new He(Me.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ey(s.doc.resolve(r.$from.pos),s.doc.resolve(l),r.depth));const c=gd(r);if(c==null)return!1;s.lift(r,c);let u=s.doc.resolve(s.mapping.map(i,-1)-1);return Ia(s.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&s.join(u.pos),t(s.scrollIntoView()),!0}function Dde(e,t,n){let r=e.tr,s=n.parent;for(let y=n.end,b=n.endIndex-1,w=n.startIndex;b>w;b--)y-=s.child(b).nodeSize,r.delete(y-1,y+1);let i=r.doc.resolve(n.start),l=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let c=n.startIndex==0,u=n.endIndex==s.childCount,d=i.node(-1),h=i.index(-1);if(!d.canReplace(h+(c?0:1),h+1,l.content.append(u?Me.empty:Me.from(s))))return!1;let m=i.pos,g=m+l.nodeSize;return r.step(new ir(m-(c?1:0),g+(u?1:0),m+1,g-1,new He((c?Me.empty:Me.from(s.copy(Me.empty))).append(u?Me.empty:Me.from(s.copy(Me.empty))),c?0:1,u?0:1),c?0:1)),t(r.scrollIntoView()),!0}function Ide(e){return function(t,n){let{$from:r,$to:s}=t.selection,i=r.blockRange(s,d=>d.childCount>0&&d.firstChild.type==e);if(!i)return!1;let l=i.startIndex;if(l==0)return!1;let c=i.parent,u=c.child(l-1);if(u.type!=e)return!1;if(n){let d=u.lastChild&&u.lastChild.type==c.type,h=Me.from(d?e.create():null),m=new He(Me.from(e.create(null,Me.from(c.type.create(null,h)))),d?3:1,0),g=i.start,y=i.end;n(t.tr.step(new ir(g-(d?3:1),y,g,y,m,1,!0)).scrollIntoView())}return!0}}const wr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},nd=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Jw=null;const jo=function(e,t,n){let r=Jw||(Jw=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},jde=function(){Jw=null},Xc=function(e,t,n,r){return n&&(MD(e,t,n,r,-1)||MD(e,t,n,r,1))},Lde=/^(img|br|input|textarea|hr)$/i;function MD(e,t,n,r,s){for(var i;;){if(e==n&&t==r)return!0;if(t==(s<0?0:jr(e))){let l=e.parentNode;if(!l||!et(l)||lm(e)||Lde.test(e.nodeName)||e.contentEditable=="false")return!1;t=wr(e)+(s<0?0:1),e=l}else if(et(e)){let l=e.childNodes[t+(s<0?-1:0)];if(et(l)&&l.contentEditable=="false")if(!((i=l.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)t+=s;else return!1;else e=l,t=s<0?jr(e):0}else return!1}}function jr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function et(e){return e.nodeType==1}function Jn(e){return e.nodeType==3}function Qc(e,t){return t?e.contains(et(t)?t:t.parentNode):!1}function Pde(e,t){for(;;){if(Jn(e)&&t)return e;if(et(e)&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=jr(e)}else if(e.parentNode&&!lm(e))t=wr(e),e=e.parentNode;else return null}}function zde(e,t){for(;;){if(Jn(e)&&t<e.nodeValue.length)return e;if(et(e)&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!lm(e))t=wr(e)+1,e=e.parentNode;else return null}}function Bde(e,t,n){for(let r=t==0,s=t==jr(e);r||s;){if(e==n)return!0;let i=wr(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,s=s&&i==jr(e)}}function lm(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const jx=function(e){return e.focusNode&&Xc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function pc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Hde(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Fde(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(jr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(jr(r.startContainer),r.startOffset)}}}const io=typeof navigator<"u"?navigator:null,AD=typeof document<"u"?document:null,ja=io&&io.userAgent||"",eE=/Edge\/(\d+)/.exec(ja),s6=/MSIE \d/.exec(ja),tE=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ja),ms=!!(s6||tE||eE),ma=s6?document.documentMode:tE?+tE[1]:eE?+eE[1]:0,Ps=!ms&&/gecko\/(\d+)/i.test(ja);Ps&&+(/Firefox\/(\d+)/.exec(ja)||[0,0])[1];const nE=!ms&&/Chrome\/(\d+)/.exec(ja),Cr=!!nE,i6=nE?+nE[1]:0,Lr=!ms&&!!io&&/Apple Computer/.test(io.vendor),rd=Lr&&(/Mobile\/\w+/.test(ja)||!!io&&io.maxTouchPoints>2),Js=rd||(io?/Mac/.test(io.platform):!1),o6=io?/Win/.test(io.platform):!1,Vo=/Android \d/.test(ja),Lx=!!AD&&"webkitFontSmoothing"in AD.documentElement.style,$de=Lx?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Vde(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _o(e,t){return typeof e=="number"?e:e[t]}function Ude(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function _D(e,t,n){if(!rE(t)&&t.left==0)return;let r=e.someProp("scrollThreshold")||0,s=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let l=n||e.dom;l;){if(!et(l)){l=nd(l);continue}let c=l==i.body,u=c?Vde(i):Ude(l),d=0,h=0;if(t.top<u.top+_o(r,"top")?h=-(u.top-t.top+_o(s,"top")):t.bottom>u.bottom-_o(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+_o(s,"top")-u.top:t.bottom-u.bottom+_o(s,"bottom")),t.left<u.left+_o(r,"left")?d=-(u.left-t.left+_o(s,"left")):t.right>u.right-_o(r,"right")&&(d=t.right-u.right+_o(s,"right")),d||h)if(c)i.defaultView.scrollBy(d,h);else{let g=l.scrollLeft,y=l.scrollTop;h&&(l.scrollTop+=h),d&&(l.scrollLeft+=d);let b=l.scrollLeft-g,w=l.scrollTop-y;t={left:t.left-b,top:t.top-w,right:t.right-b,bottom:t.bottom-w}}let m=c?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(m))break;l=m=="absolute"?l.offsetParent:nd(l)}}function qde(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,s;for(let i=(t.left+t.right)/2,l=n+1;l<Math.min(innerHeight,t.bottom);l+=5){let c=e.root.elementFromPoint(i,l);if(!c||c==e.dom||!e.dom.contains(c))continue;let u=c.getBoundingClientRect();if(u.top>=n-20){r=c,s=u.top;break}}return{refDOM:r,refTop:s,stack:l6(e.dom)}}function l6(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=nd(r));return t}function Gde({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;a6(n,r==0?0:r-t)}function a6(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:s,left:i}=e[n];r.scrollTop!=s+t&&(r.scrollTop=s+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let tf=null;function Kde(e){if(e.setActive)return e.setActive();if(tf)return e.focus(tf);let t=l6(e);e.focus(tf==null?{get preventScroll(){return tf={preventScroll:!0},!0}}:void 0),tf||(tf=!1,a6(t,0))}function c6(e,t){let n,r=2e8,s,i=0,l=t.top,c=t.top,u,d;for(let h=e.firstChild,m=0;h;h=h.nextSibling,m++){let g;if(et(h))g=h.getClientRects();else if(Jn(h))g=jo(h).getClientRects();else continue;for(let y=0;y<g.length;y++){let b=g[y];if(b.top<=l&&b.bottom>=c){l=Math.max(b.bottom,l),c=Math.min(b.top,c);let w=b.left>t.left?b.left-t.left:b.right<t.left?t.left-b.right:0;if(w<r){n=h,r=w,s=w&&Jn(n)?{left:b.right<t.left?b.right:b.left,top:t.top}:t,et(h)&&w&&(i=m+(t.left>=(b.left+b.right)/2?1:0));continue}}else b.top>t.top&&!u&&b.left<=t.left&&b.right>=t.left&&(u=h,d={left:Math.max(b.left,Math.min(b.right,t.left)),top:b.top});!n&&(t.left>=b.right&&t.top>=b.top||t.left>=b.left&&t.top>=b.bottom)&&(i=m+1)}}return!n&&u&&(n=u,s=d,r=0),n&&Jn(n)?Yde(n,s):!n||r?{node:e,offset:i}:c6(n,s)}function Yde(e,t){let n=e.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let l=Gl(r,1);if(l.top!=l.bottom&&D2(t,l)){s={node:e,offset:i+(t.left>=(l.left+l.right)/2?1:0)};break}}return r.detach(),s||{node:e,offset:0}}function D2(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Wde(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Xde(e,t,n){let{node:r,offset:s}=c6(t,n),i=-1;if(et(r)&&!r.firstChild){let l=r.getBoundingClientRect();i=l.left!=l.right&&n.left>(l.left+l.right)/2?1:-1}return e.docView.posFromDOM(r,s,i)}function Qde(e,t,n,r){let s=-1;for(let i=t,l=!1;i!=e.dom;){let c=e.docView.nearestDesc(i,!0),u;if(!c)return null;if(et(c.dom)&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((u=c.dom.getBoundingClientRect()).width||u.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!l&&u.left>r.left||u.top>r.top?s=c.posBefore:(!l&&u.right<r.left||u.bottom<r.top)&&(s=c.posAfter),l=!0),!c.contentDOM&&s<0&&!c.node.isText))return(c.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?c.posBefore:c.posAfter;i=c.dom.parentNode}return s>-1?s:e.docView.posFromDOM(t,n,-1)}function u6(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let l=e.childNodes[i];if(et(l)){let c=l.getClientRects();for(let u=0;u<c.length;u++){let d=c[u];if(D2(t,d))return u6(l,t,d)}}if((i=(i+1)%r)==s)break}return e}function Zde(e,t){let n=e.dom.ownerDocument,r,s=0,i=Fde(n,t.left,t.top);i&&({node:r,offset:s}=i);let l=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),c;if(!l||!e.dom.contains(l)){let d=e.dom.getBoundingClientRect();if(!D2(t,d)||(l=u6(e.dom,t,d),!l))return null}if(Lr)for(let d=l;r&&d;d=nd(d))d.draggable&&(r=void 0);if(l=Wde(l,t),r){if(Ps&&et(r)&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let h=r.childNodes[s],m;h.nodeName=="IMG"&&(m=h.getBoundingClientRect()).right<=t.left&&m.bottom>t.top&&s++}let d;Lx&&s&&et(r)&&et(d=r.childNodes[s-1])&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&s--,r==e.dom&&s==r.childNodes.length-1&&et(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?c=e.state.doc.content.size:(s==0||!et(r)||r.childNodes[s-1].nodeName!="BR")&&(c=Qde(e,r,s,t))}c==null&&(c=Xde(e,l,t));let u=e.docView.nearestDesc(l,!0);return{pos:c,inside:u?u.posAtStart-u.border:-1}}function rE(e){return e.top<e.bottom||e.left<e.right}function Gl(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(rE(r))return r}return Array.prototype.find.call(n,rE)||e.getBoundingClientRect()}const Jde=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function f6(e,t,n){let{node:r,offset:s,atom:i}=e.docView.domFromPos(t,n<0?-1:1),l=Lx||Ps;if(Jn(r))if(l&&(Jde.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let u=Gl(jo(r,s,s),n);if(Ps&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let d=Gl(jo(r,s-1,s-1),-1);if(d.top==u.top){let h=Gl(jo(r,s,s+1),-1);if(h.top!=u.top)return yh(h,h.left<d.left)}}return u}else{let u=s,d=s,h=n<0?1:-1;return n<0&&!s?(d++,h=-1):n>=0&&s==r.nodeValue.length?(u--,h=1):n<0?u--:d++,yh(Gl(jo(r,u,d),h),h<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==jr(r))){let u=r.childNodes[s-1];if(et(u))return a1(u.getBoundingClientRect(),!1)}if(i==null&&s<jr(r)){let u=r.childNodes[s];if(et(u))return a1(u.getBoundingClientRect(),!0)}return a1(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==jr(r))){let u=r.childNodes[s-1],d=Jn(u)?jo(u,jr(u)-(l?0:1)):et(u)&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return yh(Gl(d,1),!1)}if(i==null&&s<jr(r)){let u=r.childNodes[s];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?Jn(u)?jo(u,0,l?0:1):et(u)?u:null:null;if(d)return yh(Gl(d,-1),!0)}return yh(Gl(Jn(r)?jo(r):r,-n),n>=0)}function yh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function a1(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function d6(e,t,n){let r=e.state,s=e.root.activeElement;r!=t&&e.updateState(t),s!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),s!=e.dom&&s&&s.focus()}}function ehe(e,t,n){let r=t.selection,s=n=="up"?r.$from:r.$to;return d6(e,t,()=>{let{node:i}=e.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let c=e.docView.nearestDesc(i,!0);if(!c)break;if(c.node.isBlock){i=c.contentDOM||c.dom;break}i=c.dom.parentNode}let l=f6(e,s.pos,1);for(let c=i.firstChild;c;c=c.nextSibling){let u;if(et(c))u=c.getClientRects();else if(Jn(c))u=jo(c,0,c.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let h=u[d];if(h.bottom>h.top+1&&(n=="up"?l.top-h.top>(h.bottom-l.top)*2:h.bottom-l.bottom>(l.bottom-h.top)*2))return!1}}return!0})}const the=/[\u0590-\u08ac]/;function nhe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,l=s==r.parent.content.size,c=e.domSelection();return c?!the.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?i:l:d6(e,t,()=>{let{focusNode:u,focusOffset:d,anchorNode:h,anchorOffset:m}=e.domSelectionRange(),g=c.caretBidiLevel;c.modify("move",n,"character");let y=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:b,focusOffset:w}=e.domSelectionRange(),E=b&&!Qc(y,b)||u==b&&d==w;try{c.collapse(h,m),u&&(u!=h||d!=m)&&c.extend&&c.extend(u,d)}catch{}return g!=null&&(c.caretBidiLevel=g),E}):r.pos==r.start()||r.pos==r.end()}let DD=null,ID=null,jD=!1;function rhe(e,t,n){return DD==t&&ID==n?jD:(DD=t,ID=n,jD=n=="up"||n=="down"?ehe(e,t,n):nhe(e,t,n))}const ni=0,LD=1,bc=2,Ni=3;class am{constructor(t,n,r,s){this.parent=t,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=ni,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==t)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&Qc(this.contentDOM,t))if(r<0){let i,l;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((l=i.pmViewDesc)&&l.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(l)+l.size:this.posAtStart}else{let i,l;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((l=i.pmViewDesc)&&l.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(l):this.posAtEnd}let s;if(t==this.dom&&this.contentDOM)s=n>wr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=!!(t.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,s=t;s;s=s.parentNode){let i=this.getDesc(s),l;if(i&&(!n||i.node))if(r&&(l=i.nodeDOM)&&!(et(l)?Qc(l,t):l==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let s=t;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==t&&i!=r){for(;!s.border&&s.children.length;)for(let l=0;l<s.children.length;l++){let c=s.children[l];if(c.size){s=c;break}}return s}if(t<i)return s.descAt(t-r-s.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let l=this.children[r],c=i+l.size;if(c>t){s=t-i;break}i=c}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(;r>0;r--){let i=this.children[r-1];if(i.size||!(i instanceof p6||i instanceof h6&&i.side>=0))break}if(n<=0){let i,l=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,l=!1);return i&&n&&l&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?wr(i.dom)+1:0}}else{let i,l=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,l=!1);return i&&l&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?wr(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let l=r,c=0;;c++){let u=this.children[c],d=l+u.size;if(s==-1&&t<=d){let h=l+u.border;if(t>=h&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(t,n,h);t=l;for(let m=c;m>0;m--){let g=this.children[m-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){s=wr(g.dom)+1;break}t-=g.size}s==-1&&(s=0)}if(s>-1&&(d>n||c==this.children.length-1)){n=d;for(let h=c+1;h<this.children.length;h++){let m=this.children[h];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(-1)){i=wr(m.dom);break}n+=m.size}i==-1&&(i=this.contentDOM.childNodes.length);break}l=d}return{node:this.contentDOM,from:t,to:n,fromOffset:s,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(!et(n)||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,s=!1){let i=Math.min(t,n),l=Math.max(t,n);for(let y=0,b=0;y<this.children.length;y++){let w=this.children[y],E=b+w.size;if(i>b&&l<E)return w.setSelection(t-b-w.border,n-b-w.border,r,s);b=E}let c=this.domFromPos(t,t?-1:1),u=n==t?c:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),m=!1;if((Ps||Lr)&&t==n){let{node:y,offset:b}=c;if(Jn(y)){if(m=!!(b&&y.nodeValue[b-1]==`
350
- `),m&&b==y.nodeValue.length)for(let w=y,E;w;w=w.parentNode){if(E=w.nextSibling){E.nodeName=="BR"&&(c=u={node:E.parentNode,offset:wr(E)+1});break}let C=w.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let w=y.childNodes[b-1];m=w&&(w.nodeName=="BR"||w.contentEditable=="false")}}if(Ps&&h.focusNode&&h.focusNode!=u.node&&et(h.focusNode)){let y=h.focusNode.childNodes[h.focusOffset];y&&y.contentEditable=="false"&&(s=!0)}if(!(s||m&&Lr)&&Xc(c.node,c.offset,h.anchorNode,h.anchorOffset)&&Xc(u.node,u.offset,h.focusNode,h.focusOffset))return;let g=!1;if((d.extend||t==n)&&!(m&&Ps)){d.collapse(c.node,c.offset);try{t!=n&&d.extend(u.node,u.offset),g=!0}catch{}}if(!g){if(t>n){let b=c;c=u,u=b}let y=document.createRange();y.setEnd(u.node,u.offset),y.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(y)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],l=r+i.size;if(r==l?t<=l&&n>=r:t<l&&n>r){let c=r+i.border,u=l-i.border;if(t>=c&&n<=u){this.dirty=t==r||n==l?bc:LD,t==c&&n==u&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ni:i.markDirty(t-c,n-c);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?bc:Ni}r=l}this.dirty=bc}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?bc:LD;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class h6 extends am{constructor(t,n,r,s){let i,l=n.type.toDOM;if(typeof l=="function"&&(l=l(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){let c=et(l)?l:document.createElement("span");c!=l&&c.appendChild(l),c.hasAttribute("contenteditable")||(c.contentEditable="false"),c.classList.add("ProseMirror-widget")}super(t,[],l,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==ni&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class she extends am{constructor(t,n,r,s){super(t,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class ga extends am{constructor(t,n,r,s,i){super(t,[],r,s),this.mark=n,this.spec=i}static create(t,n,r,s){let i=s.nodeViews[n.type.name],l=i&&i(n,s,r);return(!l||!l.dom)&&(l=du.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ga(t,n,l.dom,l.contentDOM||l.dom,l)}parseRule(){return this.dirty&Ni||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ni&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=ni){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ni}}slice(t,n,r){let s=ga.create(this.parent,this.mark,!0,r),i=this.children,l=this.size;n<l&&(i=iE(i,n,l,r)),t>0&&(i=iE(i,0,t,r));for(let c=0;c<i.length;c++)i[c].parent=s;return s.children=i,s}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ya extends am{constructor(t,n,r,s,i,l,c){super(t,[],i,l),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=c}static create(t,n,r,s,i,l){let c=i.nodeViews[n.type.name],u,d=c&&c(n,i,()=>{if(!u)return l;if(u.parent)return u.parent.posBeforeChild(u)},r,s),h=d&&d.dom,m=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(!Jn(h))throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:m}=du.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!m&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let g=h;return h=y6(h,r,n),d?u=new ihe(t,n,r,s,h,m||null,g,d):n.isText?new Px(t,n,r,s,h,g):new ya(t,n,r,s,h,m||null,g)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let s=this.children[r];if(this.dom.contains(s.dom.parentNode)){n.contentElement=s.dom.parentNode;break}}if(!n.contentElement){let r=t&&t.find(s=>et(s)&&t.indexOf(s.parentNode)<0&&this.dom.contains(s));r?n.contentElement=r:n.getContent=()=>Me.empty}}return n}matchesNode(t,n,r){return this.dirty==ni&&t.eq(this.node)&&Ny(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,s=n,i=t.composing?this.localCompositionInfo(t,n):null,l=i&&i.pos>-1?i:null,c=i&&i.pos<0,u=new lhe(this,l&&l.node,t),d=this.node.inlineContent,h=d&&this.node.isBlock;uhe(this.node,this.innerDeco,(m,g,y)=>{m.spec.marks?u.syncToMarks(m.spec.marks,r,t,g):m.type.side>=0&&!y&&u.syncToMarks(g==this.node.childCount?Jt.none:this.node.child(g).marks,r,t,g),u.placeWidget(m,t,s)},(m,g,y,b)=>{u.syncToMarks(m.marks,r,t,b),h&&m.isAtom&&!m.isText&&u.addHackNode("IMG",u.top);let w;u.findNodeMatch(m,g,y,b)||c&&t.state.selection.from>s&&t.state.selection.to<s+m.nodeSize&&(w=u.findIndexWithChild(i.node))>-1&&u.updateNodeAt(m,g,y,w,t)||u.updateNextNode(m,g,y,t,b,s)||u.addNode(m,g,y,t,s),s+=m.nodeSize,d&&(h=m.isAtom&&!m.isText)}),u.syncToMarks([],r,t,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==bc)&&(l&&this.protectLocalComposition(t,l),m6(this.contentDOM,this.children,t),rd&&fhe(this.dom))}localCompositionInfo(t,n){let{from:r,to:s}=t.state.selection;if(!(t.state.selection instanceof ct)||r<n||s>n+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let l=i.nodeValue,c=dhe(this.node.content,l,r-n,s-n);return c<0?null:{node:i,pos:c,text:l}}else return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let l=new she(this,i,n,s);t.input.compositionNodes.push(l),this.children=iE(this.children,r,r+s.length,t,l)}update(t,n,r,s){return this.dirty==Ni||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,s),!0)}updateInner(t,n,r,s){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=ni}updateOuterDeco(t){if(Ny(t,this.outerDeco))return;let n=!et(this.nodeDOM),r=this.dom;this.dom=g6(this.dom,this.nodeDOM,sE(this.outerDeco,this.node,n),sE(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){et(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){et(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function PD(e,t,n,r,s){y6(r,t,e);let i=new ya(void 0,e,t,n,r,r,r);return i.contentDOM&&i.updateChildren(s,0),i}class Px extends ya{constructor(t,n,r,s,i,l){super(t,n,r,s,i,null,l)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,s){return this.dirty==Ni||this.dirty!=ni&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ni||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=t,this.dirty=ni,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let s=this.node.cut(t,n),i=document.createTextNode(s.text);return new Px(this.parent,s,this.outerDeco,this.innerDeco,i,i)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ni)}get domAtom(){return!1}isText(t){return this.node.text==t}}class p6 extends am{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==ni&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ihe extends ya{constructor(t,n,r,s,i,l,c,u){super(t,n,r,s,i,l,c),this.spec=u}update(t,n,r,s){if(this.dirty==Ni)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,s),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,s){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function m6(e,t,n){let r=e.firstChild,s=!1;for(let i=0;i<t.length;i++){let l=t[i],c=l.dom;if(c.parentNode==e){for(;c!=r;)r=zD(r),s=!0;r=r.nextSibling}else s=!0,e.insertBefore(c,r);if(l instanceof ga){let u=r?r.previousSibling:e.lastChild;m6(l.contentDOM,l.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=zD(r),s=!0;s&&n.trackWrites==e&&(n.trackWrites=null)}const Vh=function(e){e&&(this.nodeName=e)};Vh.prototype=Object.create(null);const vc=[new Vh];function sE(e,t,n){if(e.length==0)return vc;let r=n?vc[0]:new Vh,s=[r];for(let i=0;i<e.length;i++){let l=e[i].type.attrs;if(l){l.nodeName&&s.push(r=new Vh(l.nodeName));for(let c in l){let u=l[c];u!=null&&(n&&s.length==1&&s.push(r=new Vh(t.isInline?"span":"div")),c=="class"?r.class=(r.class?r.class+" ":"")+u:c=="style"?r.style=(r.style?r.style+";":"")+u:c!="nodeName"&&(r[c]=u))}}}return s}function g6(e,t,n,r){if(n==vc&&r==vc)return t;let s=t;for(let i=0;i<r.length;i++){let l=r[i],c=n[i];if(i){let u;c&&c.nodeName==l.nodeName&&s!=e&&(u=s.parentNode)&&u.nodeName.toLowerCase()==l.nodeName||(u=document.createElement(l.nodeName),u.pmIsDeco=!0,u.appendChild(s),c=vc[0]),s=u}ohe(s,c||vc[0],l)}return s}function ohe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&e.classList.add(s[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(t.style);)e.style.removeProperty(s[1])}n.style&&(e.style.cssText+=n.style)}}function y6(e,t,n){return g6(e,e,vc,sE(t,n,!et(e)))}function Ny(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function zD(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class lhe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=ahe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,s){let i=0,l=this.stack.length>>1,c=Math.min(l,t.length);for(;i<c&&(i==l-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<l;)this.destroyRest(),this.top.dirty=ni,this.index=this.stack.pop(),this.top=this.stack.pop(),l--;for(;l<t.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;s<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let h=this.index;h<d;h++){let m=this.top.children[h];if(m.matchesMark(t[l])&&!this.isLocked(m.dom)){u=h;break}}if(u<0&&this.index<this.top.children.length){let h=this.top.children[this.index];h instanceof ga&&h.dirty!=Ni&&h.mark.type==t[l].type&&h.spec.update&&!this.isLocked(h.dom)&&h.spec.update(t[l])&&(h.mark=t[l],u=this.index,this.changed=!0)}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let h=ga.create(this.top,t[l],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,l++}}findNodeMatch(t,n,r,s){let i=-1,l;if(s>=this.preMatch.index&&(l=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&l.matchesNode(t,n,r))i=this.top.children.indexOf(l,this.index);else for(let c=this.index,u=Math.min(this.top.children.length,c+5);c<u;c++){let d=this.top.children[c];if(d.matchesNode(t,n,r)&&!this.preMatch.matched.has(d)){i=c;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,s,i){let l=this.top.children[s];return l.dirty==Ni&&l.dom==l.contentDOM&&(l.dirty=bc),l.update(t,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}t=n}}updateNextNode(t,n,r,s,i,l){for(let c=this.index;c<this.top.children.length;c++){let u=this.top.children[c];if(u instanceof ya){let d=this.preMatch.matched.get(u);if(d!=null&&d!=i)return!1;let h=u.dom,m,g=this.isLocked(h)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=Ni&&Ny(n,u.outerDeco));if(!g&&u.update(t,n,r,s))return this.destroyBetween(this.index,c),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!g&&(m=this.recreateWrapper(u,t,n,r,s,l)))return this.destroyBetween(this.index,c),this.top.children[this.index]=m,m.contentDOM&&(m.dirty=bc,m.updateChildren(s,l+1),m.dirty=ni),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,s,i,l){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Ny(r,t.outerDeco)||!s.eq(t.innerDeco))return null;let c=ya.create(this.top,n,r,s,i,l);if(c.contentDOM){c.children=t.children,t.children=[];for(let u of c.children)u.parent=c}return t.destroy(),c}addNode(t,n,r,s,i){let l=ya.create(this.top,t,n,r,s,i);l.contentDOM&&l.updateChildren(s,i+1),this.top.children.splice(this.index++,0,l),this.changed=!0}placeWidget(t,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(t)&&(t==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new h6(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof ga;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Px)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Lr||Cr)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new p6(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||et(t)&&t.contains(this.lock.parentNode))}}function ahe(e,t){let n=t,r=n.children.length,s=e.childCount,i=new Map,l=[];e:for(;s>0;){let c;for(;;)if(r){let d=n.children[r-1];if(d instanceof ga)n=d,r=d.children.length;else{c=d,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=c.node;if(u){if(u!=e.child(s-1))break;--s,i.set(c,s),l.push(c)}}return{index:s,matched:i,matches:l.reverse()}}function che(e,t){return e.type.side-t.type.side}function uhe(e,t,n,r){let s=t.locals(e),i=0;if(s.length==0){for(let d=0;d<e.childCount;d++){let h=e.child(d);r(h,s,t.forChild(i,h),d),i+=h.nodeSize}return}let l=0,c=[],u=null;for(let d=0;;){let h,m;for(;l<s.length&&s[l].to==i;){let E=s[l++];E.widget&&(h?(m||(m=[h])).push(E):h=E)}if(h)if(m){m.sort(che);for(let E=0;E<m.length;E++)n(m[E],d,!!u)}else n(h,d,!!u);let g,y;if(u)y=-1,g=u,u=null;else if(d<e.childCount)y=d,g=e.child(d++);else break;for(let E=0;E<c.length;E++)c[E].to<=i&&c.splice(E--,1);for(;l<s.length&&s[l].from<=i&&s[l].to>i;)c.push(s[l++]);let b=i+g.nodeSize;if(g.isText){let E=b;l<s.length&&s[l].from<E&&(E=s[l].from);for(let C=0;C<c.length;C++)c[C].to<E&&(E=c[C].to);E<b&&(u=g.cut(E-i),g=g.cut(0,E-i),b=E,y=-1)}else for(;l<s.length&&s[l].to<b;)l++;let w=g.isInline&&!g.isLeaf?c.filter(E=>!E.inline):c.slice();r(g,w,t.forChild(i,g),y),i=b}}function fhe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function dhe(e,t,n,r){for(let s=0,i=0;s<e.childCount&&i<=r;){let l=e.child(s++),c=i;if(i+=l.nodeSize,!l.isText)continue;let u=l.text;for(;s<e.childCount;){let d=e.child(s++);if(i+=d.nodeSize,!d.isText)break;u+=d.text}if(i>=n){if(i>=r&&u.slice(r-t.length-c,r-c)==t)return r-t.length;let d=c<r?u.lastIndexOf(t,r-c-1):-1;if(d>=0&&d+t.length+c>=n)return c+d;if(n==r&&u.length>=r+t.length-c&&u.slice(r-c,r-c+t.length)==t)return r}}return-1}function iE(e,t,n,r,s){let i=[];for(let l=0,c=0;l<e.length;l++){let u=e[l],d=c,h=c+=u.size;d>=n||h<=t?i.push(u):(d<t&&i.push(u.slice(0,t-d,r)),s&&(i.push(s),s=void 0),h>n&&i.push(u.slice(n-d,u.size,r)))}return i}function I2(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),i=s&&s.size==0,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c=r.resolve(l),u,d;if(jx(n)){for(u=l;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&rt.isSelectable(s.node)&&s.parent&&!(s.node.isInline&&Bde(n.focusNode,n.focusOffset,s.dom))){let m=s.posBefore;d=new rt(l==m?c:r.resolve(m))}else if(Ps&&t=="key"&&l>e.state.selection.to&&et(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&s&&s.posAtStart>e.state.selection.to)for(let m=n.focusNode;;m=m.parentNode){if(getComputedStyle(m).overflow!="visible"){d=Nt.findFrom(r.resolve(s.posAtStart),1);break}if(m==s.dom||m.nextSibling||!m.parentNode||!et(m.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=l,g=l;for(let y=0;y<n.rangeCount;y++){let b=n.getRangeAt(y);m=Math.min(m,e.docView.posFromDOM(b.startContainer,b.startOffset,1)),g=Math.max(g,e.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(m<0)return null;[u,l]=g==e.state.selection.anchor?[g,m]:[m,g],c=r.resolve(l)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!d){let m=t=="pointer"||e.state.selection.head<c.pos&&!i?1:-1;d=j2(e,h,c,m)}return d}function x6(e){return e.editable?e.hasFocus():v6(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function el(e,t=!1){let n=e.state.selection;if(b6(e,n),!x6(e))return;let r=e.input.mouseDown;if(!t&&Cr&&r){let s=e.domSelectionRange(),i=e.domObserver.currentSelection;if(s.anchorNode&&i.anchorNode&&Xc(s.anchorNode,s.anchorOffset,i.anchorNode,i.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)phe(e);else{let{anchor:s,head:i}=n,l,c;BD&&!(n instanceof ct)&&(n.$from.parent.inlineContent||(l=HD(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(c=HD(e,n.to))),e.docView.setSelection(s,i,e,t),BD&&(l&&FD(l),c&&FD(c)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&hhe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const BD=Lr||Cr&&i6<63;function HD(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Lr&&s&&s.contentEditable=="false")return c1(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return c1(s);if(i)return c1(i)}}function c1(e){return e.contentEditable="true",Lr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function FD(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function hhe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!x6(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function phe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,wr(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&ms&&ma<=11&&(n.disabled=!0,n.disabled=!1)}function b6(e,t){if(t instanceof rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&($D(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else $D(e)}function $D(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function j2(e,t,n,r){return e.someProp("createSelectionBetween",s=>s(e,t,n))||ct.between(t,n,r)}function VD(e){return e.editable&&!e.hasFocus()?!1:v6(e)}function v6(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return Qc(e.dom,t.anchorNode)&&(e.editable||Qc(e.dom,t.focusNode))}catch{return!1}}function mhe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Xc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function oE(e,t){let{$anchor:n,$head:r}=e.selection,s=t>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return i&&Nt.findFrom(i,t)}function Yl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function UD(e,t,n){let r=e.state.selection;if(r instanceof ct)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let l=e.state.doc.resolve(s.pos+i.nodeSize*(t<0?-1:1));return Yl(e,new ct(r.$anchor,l))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let s=oE(e.state,t);return s&&s instanceof rt?Yl(e,s):!1}else if(!(Js&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter,l;if(!i||i.isText)return!1;let c=t<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(l=e.docView.descAt(c))&&!l.contentDOM?rt.isSelectable(i)?Yl(e,new rt(t<0?e.state.doc.resolve(s.pos-i.nodeSize):s)):Yl(e,new ct(e.state.doc.resolve(t<0?c:c+i.nodeSize))):!1}}else return!1;else{if(r instanceof rt&&r.node.isInline)return Yl(e,new ct(t>0?r.$to:r.$from));{let s=oE(e.state,t);return s?Yl(e,s):!1}}}function Uh(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR"):et(e)&&e.contentEditable=="false"}function nf(e,t){return t<0?ghe(e):yhe(e)}function ghe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s,i,l=!1;for(Ps&&et(n)&&r<jr(n)&&Uh(n.childNodes[r],-1)&&(l=!0);;)if(r>0){if(!et(n))break;let c=n.childNodes[r-1];if(Uh(c,-1))s=n,i=--r;else if(Jn(c))n=c,r=n.nodeValue.length;else break}else{if(S6(n))break;{let c=n.previousSibling;for(;c&&Uh(c,-1);)s=n.parentNode,i=wr(c),c=c.previousSibling;if(c)n=c,r=jr(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}l?lE(e,n,r):s&&lE(e,s,i)}function yhe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s=jr(n),i,l;for(;;)if(r<s){if(!et(n))break;let c=n.childNodes[r];if(Uh(c,1))i=n,l=++r;else break}else{if(S6(n))break;{let c=n.nextSibling;for(;c&&Uh(c,1);)i=c.parentNode,l=wr(c)+1,c=c.nextSibling;if(c)n=c,r=0,s=jr(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&lE(e,i,l)}function S6(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function xhe(e,t){for(;e&&t==e.childNodes.length&&!lm(e);)t=wr(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(Jn(n))return n;if(et(n)&&n.contentEditable=="false")break;e=n,t=0}}function bhe(e,t){for(;e&&!t&&!lm(e);)t=wr(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(Jn(n))return n;if(et(n)&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function lE(e,t,n){if(!Jn(t)){let i,l;(l=xhe(t,n))?(t=l,n=0):(i=bhe(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(!r)return;if(jx(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:s}=e;setTimeout(()=>{e.state==s&&el(e)},50)}function qD(e,t){let n=e.state.doc.resolve(t);if(!(Cr||o6)&&n.parent.inlineContent){let s=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),l=(i.top+i.bottom)/2;if(l>s.top&&l<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),l=(i.top+i.bottom)/2;if(l>s.top&&l<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function GD(e,t,n){let r=e.state.selection;if(r instanceof ct&&!r.empty||n.indexOf("s")>-1||Js&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let l=oE(e.state,t);if(l&&l instanceof rt)return Yl(e,l)}if(!s.parent.inlineContent){let l=t<0?s:i,c=r instanceof Ls?Nt.near(l,t):Nt.findFrom(l,t);return c?Yl(e,c):!1}return!1}function KD(e,t){if(!(e.state.selection instanceof ct))return!0;let{$head:n,$anchor:r,empty:s}=e.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let l=e.state.tr;return t<0?l.delete(n.pos-i.nodeSize,n.pos):l.delete(n.pos,n.pos+i.nodeSize),e.dispatch(l),!0}return!1}function YD(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function vhe(e){if(!Lr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&et(t)&&n==0&&t.firstChild&&et(t.firstChild)&&t.firstChild.contentEditable=="false"){let r=t.firstChild;YD(e,r,"true"),setTimeout(()=>YD(e,r,"false"),20)}return!1}function She(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function whe(e,t){let n=t.keyCode,r=She(t);if(n==8||Js&&n==72&&r=="c")return KD(e,-1)||nf(e,-1);if(n==46&&!t.shiftKey||Js&&n==68&&r=="c")return KD(e,1)||nf(e,1);if(n==13||n==27)return!0;if(n==37||Js&&n==66&&r=="c"){let s=n==37?qD(e,e.state.selection.from)=="ltr"?-1:1:-1;return UD(e,s,r)||nf(e,s)}else if(n==39||Js&&n==70&&r=="c"){let s=n==39?qD(e,e.state.selection.from)=="ltr"?1:-1:1;return UD(e,s,r)||nf(e,s)}else{if(n==38||Js&&n==80&&r=="c")return GD(e,-1,r)||nf(e,-1);if(n==40||Js&&n==78&&r=="c")return vhe(e)||GD(e,1,r)||nf(e,1);if(r==(Js?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function L2(e,t){e.someProp("transformCopied",y=>{t=y(t,e)});let n=[],{content:r,openStart:s,openEnd:i}=t;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let l=e.someProp("clipboardSerializer")||du.fromSchema(e.state.schema),c=R6(),u=c.createElement("div");u.appendChild(l.serializeFragment(r,{document:c}));let d=u.firstChild,h,m=0;for(;d&&et(d)&&(h=T6[d.nodeName.toLowerCase()]);){for(let y=h.length-1;y>=0;y--){let b=c.createElement(h[y]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),m++}d=u.firstChild}d&&et(d)&&d.setAttribute("data-pm-slice",`${s} ${i}${m?` -${m}`:""} ${JSON.stringify(n)}`);let g=e.someProp("clipboardTextSerializer",y=>y(t,e))||t.content.textBetween(0,t.content.size,`
351
-
352
- `);return{dom:u,text:g,slice:t}}function w6(e,t,n,r,s){let i=s.parent.type.spec.code,l,c;if(!n&&!t)return null;let u=!!t&&(r||i||!n);if(u){if(e.someProp("transformPastedText",g=>{t=g(t,i||r,e)}),i)return c=new He(Me.from(e.state.schema.text(t.replace(/\r\n?/g,`
353
- `))),0,0),e.someProp("transformPasted",g=>{c=g(c,e,!0)}),c;let m=e.someProp("clipboardTextParser",g=>g(t,s,r,e));if(m)c=m;else{let g=s.marks(),{schema:y}=e.state,b=du.fromSchema(y);l=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(w=>{let E=l.appendChild(document.createElement("p"));w&&E.appendChild(b.serializeNode(y.text(w,g)))})}}else e.someProp("transformPastedHTML",m=>{n=m(n,e)}),l=The(n),Lx&&Rhe(l);let d=l&&l.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let m=+h[3];m>0;m--){let g=l.firstChild;for(;g&&!et(g);)g=g.nextSibling;if(!g)break;l=g}if(c||(c=(e.someProp("clipboardParser")||e.someProp("domParser")||Zo.fromSchema(e.state.schema)).parseSlice(l,{preserveWhitespace:!!(u||h),context:s,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!Ehe.test(g.parentNode.nodeName)?{ignore:!0}:null}})),h)c=Ohe(WD(c,+h[1],+h[2]),h[4]);else if(c=He.maxOpen(Che(c.content,s),!0),c.openStart||c.openEnd){let m=0,g=0;for(let y=c.content.firstChild;m<c.openStart&&!y.type.spec.isolating;m++,y=y.firstChild);for(let y=c.content.lastChild;g<c.openEnd&&!y.type.spec.isolating;g++,y=y.lastChild);c=WD(c,m,g)}return e.someProp("transformPasted",m=>{c=m(c,e,u)}),c}const Ehe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Che(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let s=t.node(n).contentMatchAt(t.index(n)),i,l=[];if(e.forEach(c=>{if(!l)return;let u=s.findWrapping(c.type),d;if(!u)return l=null;if(d=l.length&&i.length&&C6(u,i,c,l[l.length-1],0))l[l.length-1]=d;else{l.length&&(l[l.length-1]=N6(l[l.length-1],i.length));let h=E6(c,u);l.push(h),s=s.matchType(h.type),i=u}}),l)return Me.from(l)}return e}function E6(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Me.from(e));return e}function C6(e,t,n,r,s){if(s<e.length&&s<t.length&&e[s]==t[s]){let i=C6(e,t,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==e.length-1?n.type:e[s+1]))return r.copy(r.content.append(Me.from(E6(n,e,s+1))))}}function N6(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,N6(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Me.empty,!0);return e.copy(n.append(r))}function aE(e,t,n,r,s,i){let l=t<0?e.firstChild:e.lastChild,c=l.content;return e.childCount>1&&(i=0),s<r-1&&(c=aE(c,t,n,r,s+1,i)),s>=n&&(c=t<0?l.contentMatchAt(0).fillBefore(c,i<=s).append(c):c.append(l.contentMatchAt(l.childCount).fillBefore(Me.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(c))}function WD(e,t,n){return t<e.openStart&&(e=new He(aE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new He(aE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const T6={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function R6(){return document.implementation.createHTMLDocument("title")}let xh=null;function Nhe(e){let t=window.trustedTypes;if(!t)return e;if(!xh){if(xh=t.defaultPolicy)try{return xh.createHTML(e)}catch{}xh=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return xh.createHTML(e)}function The(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=R6(),r=n.body,s=/<([a-z][^>\s]+)/i.exec(e),i;if((i=s&&T6[s[1].toLowerCase()])&&(e=i.map(l=>"<"+l+">").join("")+e+i.map(l=>"</"+l+">").reverse().join("")),r.innerHTML=Nhe(e),i)for(let l=0;l<i.length;l++)r=r.querySelector(i[l])||r;for(let l=0;l<n.styleSheets.length;l++){let c=n.styleSheets[l];for(let u=0;u<c.rules.length;u++){let d=c.rules[u];if(d instanceof CSSStyleRule){let h=r.querySelectorAll(d.selectorText);for(let m=0;m<h.length;m++)h[m].style.cssText+=d.style.cssText}}}return r}function Rhe(e){let t=e.querySelectorAll(Cr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Ohe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:s,openStart:i,openEnd:l}=e;for(let c=r.length-2;c>=0;c-=2){let u=n.nodes[r[c]];if(!u||u.hasRequiredAttrs())break;try{s=Me.from(u.create(r[c+1],s))}catch{break}i++,l++}return new He(s,i,l)}const es={},ts={},khe={touchstart:!0,touchmove:!0};class Mhe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ahe(e){for(let t in es){let n=es[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Dhe(e,r)&&!P2(e,r)&&(e.editable||!(r.type in ts))&&n(e,r)},khe[t]?{passive:!0}:void 0)}Lr&&e.dom.addEventListener("input",()=>null),cE(e)}function Uo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function _he(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function cE(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>P2(e,r))})}function P2(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Dhe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ihe(e,t){!P2(e,t)&&es[t.type]&&(e.editable||!(t.type in ts))&&es[t.type](e,t)}ts.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!A6(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Vo&&Cr&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),rd&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",s=>s(e,pc(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||whe(e,n)?n.preventDefault():Uo(e,"key")};ts.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};ts.keypress=(e,t)=>{let n=t;if(A6(e)||!n.charCode||n.ctrlKey&&!n.altKey||Js&&n.metaKey)return;if(e.someProp("handleKeyPress",s=>s(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ct)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!e.someProp("handleTextInput",l=>l(e,r.$from.pos,r.$to.pos,s,i))&&e.dispatch(i()),n.preventDefault()}};function cm(e){return{left:e.clientX,top:e.clientY}}function jhe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function z2(e,t,n,r,s){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let l=i.depth+1;l>0;l--)if(e.someProp(t,c=>l>i.depth?c(e,n,i.nodeAfter,i.before(l),s,!0):c(e,n,i.node(l),i.before(l),s,!1)))return!0;return!1}function um(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function Lhe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&rt.isSelectable(r)?(um(e,new rt(n)),!0):!1}function Phe(e,t){if(t==-1)return!1;let n=e.state.selection,r,s;n instanceof rt&&(r=n.node);let i=e.state.doc.resolve(t);for(let l=i.depth+1;l>0;l--){let c=l>i.depth?i.nodeAfter:i.node(l);if(rt.isSelectable(c)){r&&n.$from.depth>0&&l>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(l);break}}return s!=null?(um(e,rt.create(e.state.doc,s)),!0):!1}function zhe(e,t,n,r,s){return z2(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(s?Phe(e,n):Lhe(e,n))}function Bhe(e,t,n,r){return z2(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",s=>s(e,t,r))}function Hhe(e,t,n,r){return z2(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",s=>s(e,t,r))||Fhe(e,n,r)}function Fhe(e,t,n){if(n.button!=0)return!1;let r=O6(e,t,!0),s=e.state.doc;return r?(um(e,r),r instanceof ct&&s.eq(e.state.doc)&&(e.input.mouseDown=new Vhe(e,r)),!0):!1}function O6(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?ct.create(r,0,r.content.size):null;let s=r.resolve(t);for(let i=s.depth+1;i>0;i--){let l=i>s.depth?s.nodeAfter:s.node(i),c=s.before(i);if(l.inlineContent)return ct.create(r,c+1,c+1+l.content.size);if(n&&rt.isSelectable(l))return rt.create(r,c)}return null}function B2(e){return Ty(e)}const k6=Js?"metaKey":"ctrlKey";es.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=B2(e),s=Date.now(),i="singleClick";s-e.input.lastClick.time<500&&jhe(n,e.input.lastClick)&&!n[k6]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let l=e.posAtCoords(cm(n));l&&(i=="singleClick"?e.input.mouseDown=new $he(e,l,n,!!r):(i=="doubleClick"?Bhe:Hhe)(e,l.pos,l.inside,n)?n.preventDefault():Uo(e,"pointer"))};class M6{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class $he extends M6{constructor(t,n,r,s){super(t),this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[k6],this.allowDefault=r.shiftKey;let i,l;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),l=n.inside;else{let h=t.state.doc.resolve(n.pos);i=h.parent,l=h.depth?h.before():0}const c=s?null:r.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u&&et(u.nodeDOM)?u.nodeDOM:null;let{selection:d}=t.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof rt&&d.from<=l&&d.to>l)&&(this.mightDrag={node:i,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ps&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Uo(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||el(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(cm(t))),this.updateAllowDefault(t),this.allowDefault||!n?Uo(this.view,"pointer"):zhe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Lr&&this.mightDrag&&!this.mightDrag.node.isAtom||Cr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(um(this.view,Nt.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Uo(this.view,"pointer")}move(t){this.updateAllowDefault(t),Uo(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class Vhe extends M6{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),Uo(this.view,"pointer");let n=this.view.posAtCoords(cm(t)),r=n&&O6(this.view,n.inside,!1);if(!r)return;let{doc:s}=this.view.state,i=this.startSelection,[l,c]=r.from<i.from?[i.to,r.from]:[i.from,r.to];um(this.view,ct.create(s,l,c))}}es.touchstart=e=>{e.input.lastTouch=Date.now(),B2(e),Uo(e,"pointer")};es.touchmove=e=>{e.input.lastTouch=Date.now(),Uo(e,"pointer")};es.contextmenu=e=>B2(e);function A6(e,t){return e.composing?!0:Lr&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Uhe=Vo?5e3:-1;ts.compositionstart=ts.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ct&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Cr&&o6&&qhe(e)))e.markCursor=e.state.storedMarks||n.marks(),Ty(e,!0),e.markCursor=null;else if(Ty(e,!t.selection.empty),Ps&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&et(s)&&i!=0;){let l=i<0?s.lastChild:s.childNodes[i-1];if(!l)break;if(Jn(l)){let c=e.domSelection();c&&c.collapse(l,l.nodeValue.length);break}else s=l,i=-1}}e.input.composing=!0}_6(e,Uhe)};function qhe(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!et(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return et(r)&&r.contentEditable=="false"}ts.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,_6(e,20))};function _6(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ty(e),t))}function D6(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ghe(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Pde(t.focusNode,t.focusOffset),r=zde(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let l=n.pmViewDesc;if(!(!l||!l.isText(n.nodeValue)))return r}}return n||r}function Ty(e,t=!1){if(!(Vo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),D6(e),t||e.docView&&e.docView.dirty){let n=I2(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Khe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Np=ms&&ma<15||rd&&$de<604;es.copy=ts.cut=(e,t)=>{let n=t,r=e.state.selection,s=n.type=="cut";if(r.empty)return;let i=Np?null:n.clipboardData,l=r.content(),{dom:c,text:u}=L2(e,l);i?(n.preventDefault(),i.clearData(),i.setData("text/html",c.innerHTML),i.setData("text/plain",u)):Khe(e,c),s&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yhe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Whe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tp(e,r.value,null,s,t):Tp(e,r.textContent,r.innerHTML,s,t)},50)}function Tp(e,t,n,r,s){let i=w6(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,s,i||He.empty)))return!0;if(!i)return!1;let l=Yhe(i),c=l?e.state.tr.replaceSelectionWith(l,r):e.state.tr.replaceSelection(i);return e.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function I6(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ts.paste=(e,t)=>{let n=t;if(e.composing&&!Vo)return;let r=Np?null:n.clipboardData,s=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Tp(e,I6(r),r.getData("text/html"),s,n)?n.preventDefault():Whe(e,n)};class j6{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const Xhe=Js?"altKey":"ctrlKey";function L6(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[Xhe]}es.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=e.state.selection,i=s.empty?null:e.posAtCoords(cm(n)),l;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof rt?s.to-1:s.to))){if(r&&r.mightDrag)l=rt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&et(n.target)){let m=e.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=e.docView&&(l=rt.create(e.state.doc,m.posBefore))}}let c=(l||e.state.selection).content(),{dom:u,text:d,slice:h}=L2(e,c);(!n.dataTransfer.files.length||!Cr||i6>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Np?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Np||n.dataTransfer.setData("text/plain",d),e.dragging=new j6(h,L6(e,n),l)};es.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};ts.dragover=ts.dragenter=(e,t)=>t.preventDefault();ts.drop=(e,t)=>{try{Qhe(e,t,e.dragging)}finally{e.dragging=null}};function Qhe(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(cm(t));if(!r)return;let s=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",y=>{i=y(i,e,!1)}):i=w6(e,I6(t.dataTransfer),Np?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&L6(e,t));if(e.someProp("handleDrop",y=>y(e,t,i||He.empty,l))){t.preventDefault();return}if(!i)return;t.preventDefault();let c=i?sde(e.state.doc,s.pos,i):s.pos;c==null&&(c=s.pos);let u=e.state.tr;if(l){let{node:y}=n;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(c),h=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,m=u.doc;if(h?u.replaceRangeWith(d,d,i.content.firstChild):u.replaceRange(d,d,i),u.doc.eq(m))return;let g=u.doc.resolve(d);if(h&&rt.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))u.setSelection(new rt(g));else{let y=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((b,w,E,C)=>y=C),u.setSelection(j2(e,g,u.doc.resolve(y)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}es.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&el(e)},20))};es.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};es.beforeinput=(e,t)=>{if(Vo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,pc(8,"Backspace")))))return;let{$cursor:s}=e.state.selection;s&&s.pos>0&&e.dispatch(e.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let e in ts)es[e]=ts[e];function Rp(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ry{constructor(t,n){this.toDOM=t,this.spec=n||Pc,this.side=this.spec.side||0}map(t,n,r,s){let{pos:i,deleted:l}=t.mapResult(n.from+s,this.side<0?-1:1);return l?null:new Ei(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Ry&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Rp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class xa{constructor(t,n){this.attrs=t,this.spec=n||Pc}map(t,n,r,s){let i=t.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,l=t.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=l?null:new Ei(i,l,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof xa&&Rp(this.attrs,t.attrs)&&Rp(this.spec,t.spec)}static is(t){return t.type instanceof xa}destroy(){}}class H2{constructor(t,n){this.attrs=t,this.spec=n||Pc}map(t,n,r,s){let i=t.mapResult(n.from+s,1);if(i.deleted)return null;let l=t.mapResult(n.to+s,-1);return l.deleted||l.pos<=i.pos?null:new Ei(i.pos-r,l.pos-r,this)}valid(t,n){let{index:r,offset:s}=t.content.findIndex(n.from),i;return s==n.from&&!(i=t.child(r)).isText&&s+i.nodeSize==n.to}eq(t){return this==t||t instanceof H2&&Rp(this.attrs,t.attrs)&&Rp(this.spec,t.spec)}destroy(){}}class Ei{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Ei(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Ei(t,t,new Ry(n,r))}static inline(t,n,r,s){return new Ei(t,n,new xa(r,s))}static node(t,n,r,s){return new Ei(t,n,new H2(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof xa}get widget(){return this.type instanceof Ry}}const cf=[],Pc={};class bn{constructor(t,n){this.local=t.length?t:cf,this.children=n.length?n:cf}static create(t,n){return n.length?Oy(n,t,0,Pc):Dr}find(t,n,r){let s=[];return this.findInner(t??0,n??1e9,s,0,r),s}findInner(t,n,r,s,i){for(let l=0;l<this.local.length;l++){let c=this.local[l];c.from<=n&&c.to>=t&&(!i||i(c.spec))&&r.push(c.copy(c.from+s,c.to+s))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<n&&this.children[l+1]>t){let c=this.children[l]+1;this.children[l+2].findInner(t-c,n-c,r,s+c,i)}}map(t,n,r){return this==Dr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Pc)}mapInner(t,n,r,s,i){let l;for(let c=0;c<this.local.length;c++){let u=this.local[c].map(t,r,s);u&&u.type.valid(n,u)?(l||(l=[])).push(u):i.onRemove&&i.onRemove(this.local[c].spec)}return this.children.length?Zhe(this.children,l||[],t,n,r,s,i):l?new bn(l.sort(zc),cf):Dr}add(t,n){return n.length?this==Dr?bn.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let s,i=0;t.forEach((c,u)=>{let d=u+r,h;if(h=z6(n,c,d)){for(s||(s=this.children.slice());i<s.length&&s[i]<u;)i+=3;s[i]==u?s[i+2]=s[i+2].addInner(c,h,d+1):s.splice(i,0,u,u+c.nodeSize,Oy(h,c,d+1,Pc)),i+=3}});let l=P6(i?B6(n):n,-r);for(let c=0;c<l.length;c++)l[c].type.valid(t,l[c])||l.splice(c--,1);return new bn(l.length?this.local.concat(l).sort(zc):this.local,s||this.children)}remove(t){return t.length==0||this==Dr?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let l,c=r[i]+n,u=r[i+1]+n;for(let h=0,m;h<t.length;h++)(m=t[h])&&m.from>c&&m.to<u&&(t[h]=null,(l||(l=[])).push(m));if(!l)continue;r==this.children&&(r=this.children.slice());let d=r[i+2].removeInner(l,c+1);d!=Dr?r[i+2]=d:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,l;i<t.length;i++)if(l=t[i])for(let c=0;c<s.length;c++)s[c].eq(l,n)&&(s==this.local&&(s=this.local.slice()),s.splice(c--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new bn(s,r):Dr}forChild(t,n){if(this==Dr)return this;if(n.isLeaf)return bn.empty;let r,s;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=t){this.children[c]==t&&(r=this.children[c+2]);break}let i=t+1,l=i+n.content.size;for(let c=0;c<this.local.length;c++){let u=this.local[c];if(u.from<l&&u.to>i&&u.type instanceof xa){let d=Math.max(i,u.from)-i,h=Math.min(l,u.to)-i;d<h&&(s||(s=[])).push(u.copy(d,h))}}if(s){let c=new bn(s.sort(zc),cf);return r?new Ql([c,r]):c}return r||Dr}eq(t){if(this==t)return!0;if(!(t instanceof bn)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return F2(this.localsInner(t))}localsInner(t){if(this==Dr)return cf;if(t.inlineContent||!this.local.some(xa.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof xa||n.push(this.local[r]);return n}forEachSet(t){t(this)}}bn.empty=new bn([],[]);bn.removeOverlap=F2;const Dr=bn.empty;class Ql{constructor(t){this.members=t}map(t,n){const r=this.members.map(s=>s.map(t,n,Pc));return Ql.from(r)}forChild(t,n){if(n.isLeaf)return bn.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(t,n);i!=Dr&&(i instanceof Ql?r=r.concat(i.members):r.push(i))}return Ql.from(r)}eq(t){if(!(t instanceof Ql)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let l=0;l<i.length;l++)n.push(i[l])}}return n?F2(r?n:n.sort(zc)):cf}static from(t){switch(t.length){case 0:return Dr;case 1:return t[0];default:return new Ql(t.every(n=>n instanceof bn)?t:t.reduce((n,r)=>n.concat(r instanceof bn?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Zhe(e,t,n,r,s,i,l){let c=e.slice();for(let d=0,h=i;d<n.maps.length;d++){let m=0;n.maps[d].forEach((g,y,b,w)=>{let E=w-b-(y-g);for(let C=0;C<c.length;C+=3){let T=c[C+1];if(T<0||g>T+h-m)continue;let N=c[C]+h-m;y>=N?c[C+1]=g<=N?-2:-1:g>=h&&E&&(c[C]+=E,c[C+1]+=E)}m+=E}),h=n.maps[d].map(h,-1)}let u=!1;for(let d=0;d<c.length;d+=3)if(c[d+1]<0){if(c[d+1]==-2){u=!0,c[d+1]=-1;continue}let h=n.map(e[d]+i),m=h-s;if(m<0||m>=r.content.size){u=!0;continue}let g=n.map(e[d+1]+i,-1),y=g-s,{index:b,offset:w}=r.content.findIndex(m),E=r.maybeChild(b);if(E&&w==m&&w+E.nodeSize==y){let C=c[d+2].mapInner(n,E,h+1,e[d]+i+1,l);C!=Dr?(c[d]=m,c[d+1]=y,c[d+2]=C):(c[d+1]=-2,u=!0)}else u=!0}if(u){let d=Jhe(c,e,t,n,s,i,l),h=Oy(d,r,0,l);t=h.local;for(let m=0;m<c.length;m+=3)c[m+1]<0&&(c.splice(m,3),m-=3);for(let m=0,g=0;m<h.children.length;m+=3){let y=h.children[m];for(;g<c.length&&c[g]<y;)g+=3;c.splice(g,0,h.children[m],h.children[m+1],h.children[m+2])}}return new bn(t.sort(zc),c)}function P6(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let s=e[r];n.push(new Ei(s.from+t,s.to+t,s.type))}return n}function Jhe(e,t,n,r,s,i,l){function c(u,d){for(let h=0;h<u.local.length;h++){let m=u.local[h].map(r,s,d);m?n.push(m):l.onRemove&&l.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)c(u.children[h+2],u.children[h]+d+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&c(e[u+2],t[u]+i+1);return n}function z6(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,s=null;for(let i=0,l;i<e.length;i++)(l=e[i])&&l.from>n&&l.to<r&&((s||(s=[])).push(l),e[i]=null);return s}function B6(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Oy(e,t,n,r){let s=[],i=!1;t.forEach((c,u)=>{let d=z6(e,c,u+n);if(d){i=!0;let h=Oy(d,c,n+u+1,r);h!=Dr&&s.push(u,u+c.nodeSize,h)}});let l=P6(i?B6(e):e,-n).sort(zc);for(let c=0;c<l.length;c++)l[c].type.valid(t,l[c])||(r.onRemove&&r.onRemove(l[c].spec),l.splice(c--,1));return l.length||s.length?new bn(l,s):Dr}function zc(e,t){return e.from-t.from||e.to-t.to}function F2(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let s=n+1;s<t.length;s++){let i=t[s];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[s]=i.copy(i.from,r.to),XD(t,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),XD(t,s,r.copy(i.from,r.to)));break}}}return t}function XD(e,t,n){for(;t<e.length&&zc(n,e[t])>0;)t++;e.splice(t,0,n)}function u1(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Dr&&t.push(r)}),e.cursorWrapper&&t.push(bn.create(e.state.doc,[e.cursorWrapper.deco])),Ql.from(t)}const epe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tpe=ms&&ma<=11;class npe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class rpe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new npe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);ms&&ma<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Lr&&t.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),tpe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,epe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(VD(this.view)){if(this.suppressingSelectionUpdates)return el(this.view);if(ms&&ma<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Xc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=nd(i))n.add(i);for(let i=t.anchorNode;i;i=nd(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:Jn(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&VD(t)&&!this.ignoreSelectionChange(r),i=-1,l=-1,c=!1,u=[];if(t.editable)for(let h=0;h<n.length;h++){let m=this.registerMutation(n[h],u);m&&(i=i<0?m.from:Math.min(m.from,i),l=l<0?m.to:Math.max(m.to,l),m.typeOver&&(c=!0))}if(u.some(h=>h.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||Cr&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(h=>h.type=="childList"&&h.removedNodes.length))){for(let h of u)if(h.nodeName=="BR"&&h.parentNode){let m=h.nextSibling;for(;m&&et(m);){if(m.contentEditable=="false"){h.parentNode.removeChild(h);break}m=m.firstChild}}}else if(Ps&&u.length){let h=u.filter(m=>m.nodeName=="BR");if(h.length==2){let[m,g]=h;m.parentNode&&m.parentNode.parentNode==g.parentNode?g.remove():m.remove()}else{let{focusNode:m}=this.currentSelection;for(let g of h){let y=g.parentNode;y&&y.nodeName=="LI"&&(!m||ope(t,m)!=y)&&g.remove()}}}let d=null;i<0&&s&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&jx(r)&&(d=I2(t))&&d.eq(Nt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,el(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||s)&&(i>-1&&(t.docView.markDirty(i,l),spe(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,lpe(t,u)),this.handleDOMChange(i,l,c,u),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||el(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let h=0;h<t.addedNodes.length;h++){let m=t.addedNodes[h];n.push(m),Jn(m)&&(this.lastChangedTextNode=m)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let s=t.previousSibling,i=t.nextSibling;if(ms&&ma<=11&&t.addedNodes.length)for(let h=0;h<t.addedNodes.length;h++){let{previousSibling:m,nextSibling:g}=t.addedNodes[h];(!m||Array.prototype.indexOf.call(t.addedNodes,m)<0)&&(s=m),(!g||Array.prototype.indexOf.call(t.addedNodes,g)<0)&&(i=g)}let l=s&&s.parentNode==t.target?wr(s)+1:0,c=r.localPosFromDOM(t.target,l,-1),u=i&&i.parentNode==t.target?wr(i):t.target.childNodes.length,d=r.localPosFromDOM(t.target,u,1);return{from:c,to:d}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let QD=new WeakMap,ZD=!1;function spe(e){if(!QD.has(e)&&(QD.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ps,ZD)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ZD=!0}}function JD(e,t){let n=t.startContainer,r=t.startOffset,s=t.endContainer,i=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return Xc(l.node,l.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function ipe(e,t){if(t.getComposedRanges){let s=t.getComposedRanges(e.root)[0];if(s)return JD(e,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?JD(e,n):null}function ope(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function lpe(e,t){var n;let{focusNode:r,focusOffset:s}=e.domSelectionRange();for(let i of t)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let l=i.nextSibling;for(;l&&l.nodeName!="TD"&&l.nodeName!="TH";)l=l.nextSibling;if(l){let c=l;for(;;){let u=c.firstChild;if(!u||!et(u)||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;c=u}c.insertBefore(i,c.firstChild),r==i&&e.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function ape(e,t,n,r){let{node:s,fromOffset:i,toOffset:l,from:c,to:u}=e.docView.parseRange(t,n),d=e.domSelectionRange(),h,m=d.anchorNode;if(m&&Qc(e.dom,m)&&(h=[{node:m,offset:d.anchorOffset}],jx(d)||h.push({node:d.focusNode,offset:d.focusOffset})),Cr&&e.input.lastKeyCode===8)for(let C=l;C>i;C--){let T=s.childNodes[C-1],N=T.pmViewDesc;if(T.nodeName=="BR"&&!N){l=C;break}if(!N||N.size)break}let g=e.state.doc,y=e.someProp("domParser")||Zo.fromSchema(e.state.schema),b=g.resolve(c),w=null,E=y.parse(s,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:l,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:cpe(r),context:b});if(h&&h[0].pos!=null){let C=h[0].pos,T=h[1]&&h[1].pos;T==null&&(T=C),w={anchor:C+c,head:T+c}}return{doc:E,sel:w,from:c,to:u}}const cpe=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(Lr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Lr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},upe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function fpe(e,t,n,r,s){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let k=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,I=I2(e,k);if(I&&!e.state.selection.eq(I)){if(Cr&&Vo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",P=>P(e,pc(13,"Enter"))))return;let _=e.state.tr.setSelection(I);k=="pointer"?_.setMeta("pointer",!0):k=="key"&&_.scrollIntoView(),i&&_.setMeta("composition",i),e.dispatch(_)}return}let l=e.state.doc.resolve(t),c=l.sharedDepth(n);t=l.before(c+1),n=e.state.doc.resolve(n).after(c+1);let u=e.state.selection,d=ape(e,t,n,s),h=e.state.doc,m=h.slice(d.from,d.to),g,y;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(g=e.state.selection.to,y="end"):(g=e.state.selection.from,y="start"),e.input.lastKeyCode=null;let b=mpe(m.content,d.doc.content,d.from,g,y);if(b&&e.input.domChangeCount++,(rd&&e.input.lastIOSEnter>Date.now()-225||Vo)&&s.some(k=>et(k)&&!upe.test(k.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",k=>k(e,pc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof ct&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let k=eI(e,e.state.doc,d.sel);if(k&&!k.eq(e.state.selection)){let I=e.state.tr.setSelection(k);i&&I.setMeta("composition",i),e.dispatch(I)}}return}e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof ct&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),ms&&ma<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>d.from&&d.doc.textBetween(b.start-d.from-1,b.start-d.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let w=d.doc.resolveNoCache(b.start-d.from),E=d.doc.resolveNoCache(b.endB-d.from),C=h.resolve(b.start),T=w.sameParent(E)&&w.parent.inlineContent&&C.end()>=b.endA;if((rd&&e.input.lastIOSEnter>Date.now()-225&&(!T||s.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!T&&ppe(d.doc,w.pos,E.pos))&&e.someProp("handleKeyDown",k=>k(e,pc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>b.start&&hpe(h,b.start,b.endA,w,E)&&e.someProp("handleKeyDown",k=>k(e,pc(8,"Backspace")))){Vo&&Cr&&e.domObserver.suppressSelectionUpdates();return}Cr&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),Vo&&!T&&w.start()!=E.start()&&E.parentOffset==0&&w.depth==E.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==b.endA&&(b.endB-=2,E=d.doc.resolveNoCache(b.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(k){return k(e,pc(13,"Enter"))})},20));let N=b.start,R=b.endA,M=k=>{let I=k||e.state.tr.replace(N,R,d.doc.slice(b.start-d.from,b.endB-d.from));if(d.sel){let _=eI(e,I.doc,d.sel);_&&!(Cr&&e.composing&&_.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(_.head==N||_.head==I.mapping.map(R)-1)||ms&&_.empty&&_.head==N)&&I.setSelection(_)}return i&&I.setMeta("composition",i),I.scrollIntoView()},D;if(T)if(w.pos==E.pos){ms&&ma<=11&&w.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>el(e),20));let k=M(e.state.tr.delete(N,R)),I=h.resolve(b.start).marksAcross(h.resolve(b.endA));I&&k.ensureMarks(I),e.dispatch(k)}else if(b.endA==b.endB&&(D=dpe(w.parent.content.cut(w.parentOffset,E.parentOffset),C.parent.content.cut(C.parentOffset,b.endA-C.start())))){let k=M(e.state.tr);D.type=="add"?k.addMark(N,R,D.mark):k.removeMark(N,R,D.mark),e.dispatch(k)}else if(w.parent.child(w.index()).isText&&w.index()==E.index()-(E.textOffset?0:1)){let k=w.parent.textBetween(w.parentOffset,E.parentOffset),I=()=>M(e.state.tr.insertText(k,N,R));e.someProp("handleTextInput",_=>_(e,N,R,k,I))||e.dispatch(I())}else e.dispatch(M());else e.dispatch(M())}function eI(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:j2(e,t.resolve(n.anchor),t.resolve(n.head))}function dpe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,s=n,i=r,l,c,u;for(let h=0;h<r.length;h++)s=r[h].removeFromSet(s);for(let h=0;h<n.length;h++)i=n[h].removeFromSet(i);if(s.length==1&&i.length==0)c=s[0],l="add",u=h=>h.mark(c.addToSet(h.marks));else if(s.length==0&&i.length==1)c=i[0],l="remove",u=h=>h.mark(c.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<t.childCount;h++)d.push(u(t.child(h)));if(Me.from(d).eq(e))return{mark:c,type:l}}function hpe(e,t,n,r,s){if(n-t<=s.pos-r.pos||f1(r,!0,!1)<s.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let c=i.nodeAfter;return c!=null&&n==t+c.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let l=e.resolve(f1(i,!0,!0));return!l.parent.isTextblock||l.pos>n||f1(l,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(l.parent.content)}function ppe(e,t,n){let r=0,s=0;return e.nodesBetween(t,n,(i,l)=>{i.isTextblock&&l>=t&&l<n?r++:(i.isText?/\S/.test(i.text.slice(Math.max(0,t-l),Math.min(i.nodeSize,n-l))):i.isLeaf)&&s++}),s==0&&r==1}function f1(e,t,n){let r=e.depth,s=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,s++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function mpe(e,t,n,r,s){let i=e.findDiffStart(t,n),l=n+e.size,c=n+t.size;if(i==null)return null;let{a:u,b:d}=e.findDiffEnd(t,l,c);if(s=="end"){let h=Math.max(0,i-Math.min(u,d));r-=u+h-i}if(u<i&&l<c){let h=r<=i&&r>=u?i-r:0;i-=h,d=i+(d-u),u=i}else if(d<i){let h=r<=i&&r>=d?i-r:0;i-=h,u=i+(u-d),d=i}return{start:i,endA:u,endB:d}}class H6{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Mhe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(iI),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=rI(this),nI(this),this.nodeViews=sI(this),this.docView=PD(this.state.doc,tI(this),u1(this),this.dom,this),this.domObserver=new rpe(this,(r,s,i,l)=>fpe(this,r,s,i,l)),this.domObserver.start(),Ahe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&cE(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(iI),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let s=this.state,i=!1,l=!1;t.storedMarks&&this.composing&&(D6(this),l=!0),this.state=t;let c=s.plugins!=t.plugins||this._props.plugins!=n.plugins;if(c||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=sI(this);ype(y,this.nodeViews)&&(this.nodeViews=y,i=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&cE(this),this.editable=rI(this),nI(this);let u=u1(this),d=tI(this),h=s.plugins!=t.plugins&&!s.doc.eq(t.doc)?"reset":t.scrollToSelection>s.scrollToSelection?"to selection":"preserve",m=i||!this.docView.matchesNode(t.doc,d,u);(m||!t.selection.eq(s.selection))&&(l=!0);let g=h=="preserve"&&l&&this.dom.style.overflowAnchor==null&&qde(this);if(l){this.domObserver.stop();let y=m&&(ms||Cr)&&!this.composing&&!s.selection.empty&&!t.selection.empty&&gpe(s.selection,t.selection);if(m){let w=Cr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ghe(this)),(i||!this.docView.update(t.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=PD(t.doc,d,u,this.dom,this)),w&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(y=!0)}let b=this.input.mouseDown;y||!(b&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&mhe(this)&&b.delaySelUpdate())?el(this,y):(b6(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,s),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():g&&Gde(g)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!Qc(this.dom,t))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof rt){let n=this.docView.domAfterPos(this.state.selection.from);et(n)&&_D(this,n.getBoundingClientRect(),t)}else _D(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new j6(t.slice,t.move,s<0?void 0:rt.create(this.state.doc,s))}someProp(t,n){let r=this._props&&this._props[t],s;if(r!=null&&(s=n?n(r):r))return s;for(let l=0;l<this.directPlugins.length;l++){let c=this.directPlugins[l].props[t];if(c!=null&&(s=n?n(c):c))return s}let i=this.state.plugins;if(i)for(let l=0;l<i.length;l++){let c=i[l].props[t];if(c!=null&&(s=n?n(c):c))return s}}hasFocus(){if(ms){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Kde(this.dom),el(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return Zde(this,t)}coordsAtPos(t,n=1){return f6(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let s=this.docView.posFromDOM(t,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(t,n){return rhe(this,n||this.state,t)}pasteHTML(t,n){return Tp(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Tp(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return L2(this,t)}destroy(){this.docView&&(_he(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],u1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jde())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return Ihe(this,t)}domSelectionRange(){let t=this.dom.isConnected!==!1&&this.domSelection();return t?Lr&&this.root.nodeType===11&&Hde(this.dom.ownerDocument)==this.dom&&ipe(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}H6.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function tI(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Ei.node(0,e.state.doc.content.size,t)]}function nI(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ei.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rI(e){return!e.someProp("editable",t=>t(e.state)===!1)}function gpe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function sI(e){let t=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(t,s)||(t[s]=r[s])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function ype(e,t){let n=0,r=0;for(let s in e){if(e[s]!=t[s])return!0;n++}for(let s in t)r++;return n!=r}function iI(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ma={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ky={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xpe=typeof navigator<"u"&&/Mac/.test(navigator.platform),bpe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Er=0;Er<10;Er++)Ma[48+Er]=Ma[96+Er]=String(Er);for(var Er=1;Er<=24;Er++)Ma[Er+111]="F"+Er;for(var Er=65;Er<=90;Er++)Ma[Er]=String.fromCharCode(Er+32),ky[Er]=String.fromCharCode(Er);for(var d1 in Ma)ky.hasOwnProperty(d1)||(ky[d1]=Ma[d1]);function vpe(e){var t=xpe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||bpe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ky:Ma)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Spe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),wpe=typeof navigator<"u"&&/Win/.test(navigator.platform);function Epe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,i,l;for(let c=0;c<t.length-1;c++){let u=t[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))s=!0;else if(/^s(hift)?$/i.test(u))i=!0;else if(/^mod$/i.test(u))Spe?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),l&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function Cpe(e){let t=Object.create(null);for(let n in e)t[Epe(n)]=e[n];return t}function h1(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Npe(e){return new $s({props:{handleKeyDown:Tpe(e)}})}function Tpe(e){let t=Cpe(e);return function(n,r){let s=vpe(r),i,l=t[h1(s,r)];if(l&&l(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let c=t[h1(s,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(wpe&&r.ctrlKey&&r.altKey)&&(i=Ma[r.keyCode])&&i!=s){let c=t[h1(i,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var My=200,or=function(){};or.prototype.append=function(t){return t.length?(t=or.from(t),!this.length&&t||t.length<My&&this.leafAppend(t)||this.length<My&&t.leafPrepend(this)||this.appendInner(t)):this};or.prototype.prepend=function(t){return t.length?or.from(t).append(this):this};or.prototype.appendInner=function(t){return new Rpe(this,t)};or.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?or.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};or.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};or.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};or.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,l){return s.push(t(i,l))},n,r),s};or.from=function(t){return t instanceof or?t:t&&t.length?new F6(t):or.empty};var F6=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new t(this.values.slice(s,i))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,i,l,c){for(var u=i;u<l;u++)if(s(this.values[u],c+u)===!1)return!1},t.prototype.forEachInvertedInner=function(s,i,l,c){for(var u=i-1;u>=l;u--)if(s(this.values[u],c+u)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=My)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=My)return new t(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(or);or.empty=new F6([]);var Rpe=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,i,l){var c=this.left.length;if(s<c&&this.left.forEachInner(r,s,Math.min(i,c),l)===!1||i>c&&this.right.forEachInner(r,Math.max(s-c,0),Math.min(this.length,i)-c,l+c)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,i,l){var c=this.left.length;if(s>c&&this.right.forEachInvertedInner(r,s-c,Math.max(i,c)-c,l+c)===!1||i<c&&this.left.forEachInvertedInner(r,Math.min(s,c),i,l)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(or);const Ope=500;class xi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let l=t.tr,c,u,d=[],h=[];return this.items.forEach((m,g)=>{if(!m.step){s||(s=this.remapping(r,g+1),i=s.maps.length),i--,h.push(m);return}if(s){h.push(new qi(m.map));let y=m.step.map(s.slice(i)),b;y&&l.maybeStep(y).doc&&(b=l.mapping.maps[l.mapping.maps.length-1],d.push(new qi(b,void 0,void 0,d.length+h.length))),i--,b&&s.appendMap(b,i)}else l.maybeStep(m.step);if(m.selection)return c=s?m.selection.map(s.slice(i)):m.selection,u=new xi(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:l,selection:c}}addTransform(t,n,r,s){let i=[],l=this.eventCount,c=this.items,u=!s&&c.length?c.get(c.length-1):null;for(let h=0;h<t.steps.length;h++){let m=t.steps[h].invert(t.docs[h]),g=new qi(t.mapping.maps[h],m,n),y;(y=u&&u.merge(g))&&(g=y,h?i.pop():c=c.slice(0,c.length-1)),i.push(g),n&&(l++,n=void 0),s||(u=g)}let d=l-r.depth;return d>Mpe&&(c=kpe(c,d),l-=d),new xi(c.append(i),l)}remapping(t,n){let r=new Ep;return this.items.forEach((s,i)=>{let l=s.mirrorOffset!=null&&i-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,l)},t,n),r}addMaps(t){return this.eventCount==0?this:new xi(this.items.append(t.map(n=>new qi(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],s=this.items.length-n,i=t.mapping,l=t.steps.length,c=this.eventCount;this.items.forEach(g=>{g.selection&&c--},s);let u=n;this.items.forEach(g=>{let y=i.getMirror(--u);if(y==null)return;l=Math.min(l,y);let b=i.maps[y];if(g.step){let w=t.steps[y].invert(t.docs[y]),E=g.selection&&g.selection.map(i.slice(u+1,y));E&&c++,r.push(new qi(b,w,E))}else r.push(new qi(b))},s);let d=[];for(let g=n;g<l;g++)d.push(new qi(i.maps[g]));let h=this.items.slice(0,s).append(d).append(r),m=new xi(h,c);return m.emptyItemCount()>Ope&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,s=[],i=0;return this.items.forEach((l,c)=>{if(c>=t)s.push(l),l.selection&&i++;else if(l.step){let u=l.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=l.selection&&l.selection.map(n.slice(r));h&&i++;let m=new qi(d.invert(),u,h),g,y=s.length-1;(g=s.length&&s[y].merge(m))?s[y]=g:s.push(m)}}else l.map&&r--},this.items.length,0),new xi(or.from(s.reverse()),i)}}xi.empty=new xi(or.empty,0);function kpe(e,t){let n;return e.forEach((r,s)=>{if(r.selection&&t--==0)return n=s,!1}),e.slice(n)}class qi{constructor(t,n,r,s){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new qi(n.getMap().invert(),n,this.selection)}}}class Wl{constructor(t,n,r,s,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const Mpe=20;function Ape(e,t,n,r){let s=n.getMeta(ba),i;if(s)return s.historyState;n.getMeta($6)&&(e=new Wl(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(l&&l.getMeta(ba))return l.getMeta(ba).redo?new Wl(e.done.addTransform(n,void 0,r,L0(t)),e.undone,oI(n.mapping.maps),e.prevTime,e.prevComposition):new Wl(e.done,e.undone.addTransform(n,void 0,r,L0(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),u=e.prevTime==0||!l&&e.prevComposition!=c&&(e.prevTime<(n.time||0)-r.newGroupDelay||!_pe(n,e.prevRanges)),d=l?p1(e.prevRanges,n.mapping):oI(n.mapping.maps);return new Wl(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,L0(t)),xi.empty,d,n.time,c??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Wl(e.done.rebased(n,i),e.undone.rebased(n,i),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Wl(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function _pe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&s>=t[i]&&(n=!0)}),n}function oI(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,s,i,l)=>t.push(i,l));return t}function p1(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),i=t.map(e[r+1],-1);s<=i&&n.push(s,i)}return n}function Dpe(e,t,n){let r=L0(t),s=ba.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let l=i.selection.resolve(i.transform.doc),c=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),s,r),u=new Wl(n?c:i.remaining,n?i.remaining:c,null,0,-1);return i.transform.setSelection(l).setMeta(ba,{redo:n,historyState:u})}let m1=!1,lI=null;function L0(e){let t=e.plugins;if(lI!=t){m1=!1,lI=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){m1=!0;break}}return m1}function Ipe(e){return e.setMeta($6,!0)}const ba=new Mi("history"),$6=new Mi("closeHistory");function hbe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new $s({key:ba,state:{init(){return new Wl(xi.empty,xi.empty,null,0,-1)},apply(t,n,r){return Ape(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,s=r=="historyUndo"?jpe:r=="historyRedo"?Lpe:null;return!s||!t.editable?!1:(n.preventDefault(),s(t.state,t.dispatch))}}}})}function V6(e,t){return(n,r)=>{let s=ba.getState(n);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(r){let i=Dpe(s,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const jpe=V6(!1,!0),Lpe=V6(!0,!0);function pbe(e){return e.getMeta(ba)!=null}function zx(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Nf=class U6{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:s}=n,{tr:i}=r,l=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([c,u])=>[c,(...h)=>{const m=u(...h)(l);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(i),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:l}=s,c=[],u=!!t,d=t||i.tr,h=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),c.every(g=>g===!0)),m={...Object.fromEntries(Object.entries(r).map(([g,y])=>[g,(...w)=>{const E=this.buildProps(d,n),C=y(...w)(E);return c.push(C),m}])),run:h};return m}static createFakeChain(){const t=new Proxy({},{get:(n,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>t}});return t}createCan(t){const{rawCommands:n,state:r}=this,s=!1,i=t||r.tr,l=this.buildProps(i,s);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...d)=>u(...d)({...l,dispatch:void 0})])),chain:()=>this.createChain(i,s)}}static createFallbackCan(){const t=U6.createFakeChain();return new Proxy({chain:()=>t},{get:(n,r)=>{if(r!=="then")return r==="chain"?n.chain:()=>!1}})}buildProps(t,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:l}=s,c={tr:t,editor:s,view:l,state:zx({state:i,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...h)=>d(...h)(c)]))}};return c}};const Ppe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),zpe=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),Bpe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:l})=>{e.doc.nodesBetween(i.pos,l.pos,(c,u)=>{if(c.type.isText)return;const{doc:d,mapping:h}=t,m=d.resolve(h.map(u)),g=d.resolve(h.map(u+c.nodeSize)),y=m.blockRange(g);if(!y)return;const b=gd(y);if(c.type.isTextblock){const{defaultType:w}=m.parent.contentMatchAt(m.index());t.setNodeMarkup(y.start,w)}(b||b===0)&&t.lift(y,b)})}),!0},Hpe=e=>t=>e(t),Fpe=()=>({state:e,dispatch:t})=>e6(e,t),$pe=(e,t)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const l=r.mapping.map(t);return r.insert(l,i.content),r.setSelection(new ct(r.doc.resolve(Math.max(l-1,0)))),!0},Vpe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(t){const l=s.before(i),c=s.after(i);e.delete(l,c).scrollIntoView()}return!0}return!1};function lr(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}const Upe=e=>({tr:t,state:n,dispatch:r})=>{const s=lr(e,n.schema),i=t.selection.$anchor;for(let l=i.depth;l>0;l-=1)if(i.node(l).type===s){if(r){const c=i.before(l),u=i.after(l);t.delete(c,u).scrollIntoView()}return!0}return!1},qpe=e=>({tr:t,dispatch:n})=>{const{from:r,to:s}=e;return n&&t.delete(r,s),!0},Gpe=e=>e.content?/^text(\*|\+)/.test(e.content):!1,aI=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return Gpe(r)?n==="left"?e.start()-1:e.end()+1:e.pos},Kpe=(e,t,n)=>({from:aI(e,n,"left"),to:aI(t,n,"right")}),Ype=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){const n=e.tr,{ranges:r}=e.selection,s=n.steps.length;r.forEach(i=>{const l=n.mapping.slice(s),c=n.doc.resolve(l.map(i.$from.pos)),u=n.doc.resolve(l.map(i.$to.pos)),{from:d,to:h}=Kpe(c,u,e.schema);n.deleteRange(d,h)}),n.selection.empty||n.setSelection(ct.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},Wpe=()=>({commands:e})=>e.keyboardShortcut("Enter"),Xpe=()=>({state:e,dispatch:t})=>vde(e,t);function $2(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Ay(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(s=>n.strict?t[s]===e[s]:$2(t[s])?t[s].test(e[s]):t[s]===e[s]):!0}function q6(e,t,n={}){return e.find(r=>r.type===t&&Ay(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function cI(e,t,n={}){return!!q6(e,t,n)}function V2(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===t))return;if(!n){const u=r.node.marks.find(d=>d.type===t);u&&(n=u.attrs)}if(!q6([...r.node.marks],t,n))return;let s=r.index,i=e.start()+r.offset,l=s+1,c=i+r.node.nodeSize;for(;s>0&&cI([...e.parent.child(s-1).marks],t,n);)s-=1,i-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&cI([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:i,to:c}}function ll(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Qpe=(e,t)=>({tr:n,state:r,dispatch:s})=>{const i=ll(e,r.schema),{doc:l,selection:c}=n,{$from:u,from:d,to:h}=c;if(s){const m=V2(u,i,t);if(m&&m.from<=d&&m.to>=h){const g=ct.create(l,m.from,m.to);n.setSelection(g)}}return!0},Zpe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function G6(e){return e instanceof ct}function Sc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function uE(e,t=null){if(!t)return null;const n=Nt.atStart(e),r=Nt.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const s=n.from,i=r.to;return t==="all"?ct.create(e,Sc(0,s,i),Sc(e.content.size,s,i)):ct.create(e,Sc(t,s,i),Sc(t,s,i))}function uI(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function _y(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Jpe(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const eme=(e=null,t={})=>({editor:n,view:r,tr:s,dispatch:i})=>{t={scrollIntoView:!0,...t};const l=()=>{(_y()||uI())&&r.dom.focus(),Jpe()&&!_y()&&!uI()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(i&&e===null&&!G6(n.state.selection))return l(),!0;const c=uE(s.doc,e)||n.state.selection,u=n.state.selection.eq(c);return i&&(u||s.setSelection(c),u&&s.storedMarks&&s.setStoredMarks(s.storedMarks),l()),!0},tme=(e,t)=>n=>e.every((r,s)=>t(r,{...n,index:s})),nme=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),K6=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&K6(r)}return e};function Dh(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return K6(n)}function Y6(e){return typeof(e==null?void 0:e.nodesBetween)=="function"}function sd(e,t,n){if(Y6(e))return e;const r=typeof e=="object"&&e!==null;n={slice:!0,parseOptions:{},...n};const s=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return Me.fromArray(e.map(l=>t.nodeFromJSON(l)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),sd("",t,n)}if(s){if(n.errorOnInvalidContent){let l=!1,c="";const u=new RB({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(l=!0,c=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Zo.fromSchema(u).parseSlice(Dh(e),n.parseOptions):Zo.fromSchema(u).parse(Dh(e),n.parseOptions),n.errorOnInvalidContent&&l)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const i=Zo.fromSchema(t);return n.slice?i.parseSlice(Dh(e),n.parseOptions).content:i.parse(Dh(e),n.parseOptions)}return sd("",t,n)}function W6(e){return!("type"in e)}function X6(e,t,n){const r=e.steps.length-1;if(r<t)return;const s=e.steps[r];if(!(s instanceof Mn||s instanceof ir))return;const i=e.mapping.maps[r];let l=0;i.forEach((c,u,d,h)=>{l===0&&(l=h)}),e.setSelection(Nt.near(e.doc.resolve(l),n))}const rme=(e,t,n)=>({tr:r,dispatch:s,editor:i})=>{if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c;const u=E=>{i.emit("contentError",{editor:i,error:E,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{sd(t,i.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(E){u(E)}try{var l;c=sd(t,i.schema,{parseOptions:d,errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck})}catch(E){return u(E),!1}let{from:h,to:m}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},g=!0,y=!0;const b=W6(c)?c.content:[c];if(b.forEach(E=>{E.check(),g=g?E.isText&&E.marks.length===0:!1,y=y?E.isBlock:!1}),h===m&&y){const{parent:E}=r.doc.resolve(h);E.isTextblock&&!E.type.spec.code&&!E.childCount&&(h-=1,m+=1)}let w;if(g)Array.isArray(t)?w=t.map(E=>E.text||"").join(""):Y6(t)?w=b.map(E=>{var C;return(C=E.text)!==null&&C!==void 0?C:""}).join(""):typeof t=="object"&&t&&t.text?w=t.text:w=t,r.insertText(w,h,m);else{w=Me.from(b);const E=r.doc.resolve(h),C=E.node(),T=E.parentOffset===0,N=C.isText||C.isTextblock,R=C.content.size>0;T&&N&&R&&y&&(h=Math.max(0,h-1)),r.replaceWith(h,m,b)}n.updateSelection&&X6(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:w}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:w})}return!0};function Q6(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const sme=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{pos:s,attrs:i,content:l,updateSelection:c=!0}=e;let u;typeof s=="number"?u=t.doc.resolve(s):s?u=s:u=t.selection.$from;const d=Q6(u.parent.contentMatchAt(u.index()));if(!d)return!1;const h=Object.keys(d.spec.attrs||{}),m=i?Object.fromEntries(Object.entries(i).filter(([y])=>h.includes(y))):{};let g;if(l){const y=sd(l,r.schema);g=d.createAndFill(m,y)}else g=d.createAndFill(m);return g?(n&&(t.insert(u.pos,g),c&&X6(t,t.steps.length-1,-1)),!0):!1},ime=()=>({state:e,dispatch:t})=>yde(e,t),ome=()=>({state:e,dispatch:t})=>xde(e,t),lme=()=>({state:e,dispatch:t})=>KB(e,t),ame=()=>({state:e,dispatch:t})=>QB(e,t),Z6=(e,t)=>{const n=e.resolve(t),r=n.nodeBefore,s=n.nodeAfter;return!r||!s?!1:!r.type.spec.isolating&&!s.type.spec.isolating},cme=()=>({state:e,dispatch:t,tr:n})=>{try{const r=_x(e.doc,e.selection.$from.pos,-1);return r==null||!Z6(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},ume=()=>({state:e,dispatch:t,tr:n})=>{try{const r=_x(e.doc,e.selection.$from.pos,1);return r==null||!Z6(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},fme=()=>({state:e,dispatch:t})=>mde(e,t),dme=()=>({state:e,dispatch:t})=>gde(e,t);function J6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function hme(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,s,i,l;for(let c=0;c<t.length-1;c+=1){const u=t[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))s=!0;else if(/^s(hift)?$/i.test(u))i=!0;else if(/^mod$/i.test(u))_y()||J6()?l=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),l&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const pme=e=>({editor:t,view:n,tr:r,dispatch:s})=>{const i=hme(e).split(/-(?!$)/),l=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),c=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,c))});return u==null||u.steps.forEach(d=>{const h=d.map(r.mapping);h&&s&&r.maybeStep(h)}),!0};function Op(e,t,n={}){const{from:r,to:s,empty:i}=e.selection,l=t?lr(t,e.schema):null,c=[];e.doc.nodesBetween(r,s,(h,m)=>{if(h.isText)return;const g=Math.max(r,m),y=Math.min(s,m+h.nodeSize);c.push({node:h,from:g,to:y})});const u=s-r,d=c.filter(h=>l?l.name===h.node.type.name:!0).filter(h=>Ay(h.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}const mme=(e,t={})=>({state:n,dispatch:r})=>Op(n,lr(e,n.schema),t)?bde(n,r):!1,gme=()=>({state:e,dispatch:t})=>t6(e,t),yme=e=>({state:t,dispatch:n})=>{const r=lr(e,t.schema);return Ade(r)(t,n)},xme=()=>({state:e,dispatch:t})=>JB(e,t);function Bx(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function fI(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,s)=>(n.includes(s)||(r[s]=e[s]),r),{})}const bme=(e,t)=>({tr:n,state:r,dispatch:s})=>{let i=null,l=null;const c=Bx(typeof e=="string"?e:e.name,r.schema);if(!c)return!1;c==="node"&&(i=lr(e,r.schema)),c==="mark"&&(l=ll(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,m)=>{i&&i===h.type&&(u=!0,s&&n.setNodeMarkup(m,void 0,fI(h.attrs,t))),l&&h.marks.length&&h.marks.forEach(g=>{l===g.type&&(u=!0,s&&n.addMark(m,m+h.nodeSize,l.create(fI(g.attrs,t))))})})}),u},vme=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Sme=()=>({tr:e,dispatch:t})=>{if(t){const n=new Ls(e.doc);e.setSelection(n)}return!0},wme=()=>({state:e,dispatch:t})=>WB(e,t),Eme=()=>({state:e,dispatch:t})=>ZB(e,t),Cme=()=>({state:e,dispatch:t})=>Ede(e,t),Nme=()=>({state:e,dispatch:t})=>Tde(e,t),Tme=()=>({state:e,dispatch:t})=>Nde(e,t);function fE(e,t,n={},r={}){return sd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Rme=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:l,commands:c})=>{const{doc:u}=i;if(r.preserveWhitespace!=="full"){const d=fE(e,s.schema,r,{errorOnInvalidContent:t??s.options.enableContentCheck});if(l){const h=W6(d)?d.content:[d];i.replaceWith(0,u.content.size,h).setMeta("preventUpdate",!n)}return!0}return l&&i.setMeta("preventUpdate",!n),c.insertContentAt({from:0,to:u.content.size},e,{parseOptions:r,errorOnInvalidContent:t??s.options.enableContentCheck})};function eH(e,t){const n=ll(t,e.schema),{from:r,to:s,empty:i}=e.selection,l=[];i?(e.storedMarks&&l.push(...e.storedMarks),l.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,s,u=>{l.push(...u.marks)});const c=l.find(u=>u.type.name===n.name);return c?{...c.attrs}:{}}function Ome(e,t){const n=new $B(e);return t.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function mbe(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function kme(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Hx(e){return t=>kme(t.$from,e)}function Ke(e,t,n){return e.config[t]===void 0&&e.parent?Ke(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ke(e.parent,t,n):null}):e.config[t]}function U2(e){return e.map(t=>{const n=Ke(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return n?[t,...U2(n())]:t}).flat(10)}function q2(e,t){const n=du.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function dE(e){return typeof e=="function"}function Gt(e,t=void 0,...n){return dE(e)?t?e.bind(t)(...n):e(...n):e}function Mme(e={}){return Object.keys(e).length===0&&e.constructor===Object}function id(e){return{baseExtensions:e.filter(t=>t.type==="extension"),nodeExtensions:e.filter(t=>t.type==="node"),markExtensions:e.filter(t=>t.type==="mark")}}function tH(e){const t=[],{nodeExtensions:n,markExtensions:r}=id(e),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},l=n.filter(d=>d.name!=="text").map(d=>d.name),c=r.map(d=>d.name),u=[...l,...c];return e.forEach(d=>{const h=Ke(d,"addGlobalAttributes",{name:d.name,options:d.options,storage:d.storage,extensions:s});h&&h().forEach(m=>{let g;Array.isArray(m.types)?g=m.types:m.types==="*"?g=u:m.types==="nodes"?g=l:m.types==="marks"?g=c:g=[],g.forEach(y=>{Object.entries(m.attributes).forEach(([b,w])=>{t.push({type:y,name:b,attribute:{...i,...w}})})})})}),s.forEach(d=>{const h=Ke(d,"addAttributes",{name:d.name,options:d.options,storage:d.storage});if(!h)return;const m=h();Object.entries(m).forEach(([g,y])=>{const b={...i,...y};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,t.push({type:d.name,name:g,attribute:b})})}),t}function Ame(e){const t=[];let n="",r=!1,s=!1,i=0;const l=e.length;for(let c=0;c<l;c+=1){const u=e[c];if(u==="'"&&!s){r=!r,n+=u;continue}if(u==='"'&&!r){s=!s,n+=u;continue}if(!r&&!s){if(u==="("){i+=1,n+=u;continue}if(u===")"&&i>0){i-=1,n+=u;continue}if(u===";"&&i===0){t.push(n),n="";continue}}n+=u}return n&&t.push(n),t}function dI(e){const t=[],n=Ame(e||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],l=i.indexOf(":");if(l===-1)continue;const c=i.slice(0,l).trim(),u=i.slice(l+1).trim();c&&u&&t.push([c,u])}return t}function _me(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([s,i])=>{if(s==="__proto__"){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:i,writable:!0});return}if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],c=r[s]?r[s].split(" "):[],u=l.filter(d=>!c.includes(d));r[s]=[...c,...u].join(" ")}else if(s==="style"){const l=new Map([...dI(r[s]),...dI(i)]);r[s]=Array.from(l.entries()).map(([c,u])=>`${c}: ${u}`).join("; ")}else r[s]=i}),r},{})}function Dy(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>_me(n,r),{})}function Dme(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function hI(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const s=t.reduce((i,l)=>{const c=l.attribute.parseHTML?l.attribute.parseHTML(n):Dme(n.getAttribute(l.name));return c==null?i:{...i,[l.name]:c}},{});return{...r,...s}}}}function pI(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Mme(n)?!1:n!=null))}function mI(e){var t,n;const r={};return!(!(e==null||(t=e.attribute)===null||t===void 0)&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function nH(e,t){var n;const r=tH(e),{nodeExtensions:s,markExtensions:i}=id(e),l=(n=s.find(d=>Ke(d,"topNode")))===null||n===void 0?void 0:n.name,c=Object.fromEntries(s.map(d=>{const h=r.filter(E=>E.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:t},g=pI({...e.reduce((E,C)=>{const T=Ke(C,"extendNodeSchema",m);return{...E,...T?T(d):{}}},{}),content:Gt(Ke(d,"content",m)),marks:Gt(Ke(d,"marks",m)),group:Gt(Ke(d,"group",m)),inline:Gt(Ke(d,"inline",m)),atom:Gt(Ke(d,"atom",m)),selectable:Gt(Ke(d,"selectable",m)),draggable:Gt(Ke(d,"draggable",m)),code:Gt(Ke(d,"code",m)),whitespace:Gt(Ke(d,"whitespace",m)),linebreakReplacement:Gt(Ke(d,"linebreakReplacement",m)),defining:Gt(Ke(d,"defining",m)),isolating:Gt(Ke(d,"isolating",m)),attrs:Object.fromEntries(h.map(mI))}),y=Gt(Ke(d,"parseHTML",m));y&&(g.parseDOM=y.map(E=>hI(E,h)));const b=Ke(d,"renderHTML",m);b&&(g.toDOM=E=>b({node:E,HTMLAttributes:Dy(E,h)}));const w=Ke(d,"renderText",m);return w&&(g.toText=w),[d.name,g]})),u=Object.fromEntries(i.map(d=>{const h=r.filter(w=>w.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:t},g=pI({...e.reduce((w,E)=>{const C=Ke(E,"extendMarkSchema",m);return{...w,...C?C(d):{}}},{}),inclusive:Gt(Ke(d,"inclusive",m)),excludes:Gt(Ke(d,"excludes",m)),group:Gt(Ke(d,"group",m)),spanning:Gt(Ke(d,"spanning",m)),code:Gt(Ke(d,"code",m)),attrs:Object.fromEntries(h.map(mI))}),y=Gt(Ke(d,"parseHTML",m));y&&(g.parseDOM=y.map(w=>hI(w,h)));const b=Ke(d,"renderHTML",m);return b&&(g.toDOM=w=>b({mark:w,HTMLAttributes:Dy(w,h)})),[d.name,g]}));return new RB({topNode:l,nodes:c,marks:u})}function Ime(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function qh(e){return e.sort((n,r)=>{const s=Ke(n,"priority")||100,i=Ke(r,"priority")||100;return s>i?-1:s<i?1:0})}function G2(e){const t=qh(U2(e)),n=Ime(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function jme(e,t){return nH(G2(e),t)}function gbe(e,t){const n=jme(t),r=Dh(e);return Zo.fromSchema(n).parse(r).toJSON()}function rH(e,t,n){const{from:r,to:s}=t,{blockSeparator:i=`
354
-
355
- `,textSerializers:l={}}=n||{};let c="";return e.nodesBetween(r,s,(u,d,h,m)=>{u.isBlock&&d>r&&(c+=i);const g=l==null?void 0:l[u.type.name];if(g)return h&&(c+=g({node:u,pos:d,parent:h,index:m,range:t})),!1;if(u.isText){var y;c+=u==null||(y=u.text)===null||y===void 0?void 0:y.slice(Math.max(r,d)-d,s-d)}}),c}function Lme(e,t){return rH(e,{from:0,to:e.content.size},t)}function sH(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function Pme(e,t){const n=lr(t,e.schema),{from:r,to:s}=e.selection,i=[];e.doc.nodesBetween(r,s,c=>{i.push(c)});const l=i.reverse().find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function zme(e,t){const n=Bx(typeof t=="string"?t:t.name,e.schema);return n==="node"?Pme(e,t):n==="mark"?eH(e,t):{}}function Bme(e,t=JSON.stringify){const n={};return e.filter(r=>{const s=t(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function Hme(e){const t=Bme(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function iH(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((s,i)=>{const l=[];if(s.ranges.length)s.forEach((c,u)=>{l.push({from:c,to:u})});else{const{from:c,to:u}=n[i];if(c===void 0||u===void 0)return;l.push({from:c,to:u})}l.forEach(({from:c,to:u})=>{const d=t.slice(i).map(c,-1),h=t.slice(i).map(u),m=t.invert().map(d,-1),g=t.invert().map(h);r.push({oldRange:{from:m,to:g},newRange:{from:d,to:h}})})}),Hme(r)}function oH(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(s=>{const i=V2(n.resolve(e),s.type);i&&r.push({mark:s,...i})}):n.nodesBetween(e,t,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(l=>({from:i,to:i+s.nodeSize,mark:l})))}),r}const ybe=(e,t,n,r=20)=>{const s=e.doc.resolve(n);let i=r,l=null;for(;i>0&&l===null;){const c=s.node(i);(c==null?void 0:c.type.name)===t?l=c:i-=1}return[l,i]},xbe=e=>{const t=e.depth-1;if(t<0)return null;const n=e.index(t);return n===0?null:e.node(t).child(n-1)};function rf(e,t){return t.nodes[e]||t.marks[e]||null}function P0(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=e.find(i=>i.type===t&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}const Fme=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(s,i,l,c)=>{var u,d;const h=((u=(d=s.type.spec).toText)===null||u===void 0?void 0:u.call(d,{node:s,pos:i,parent:l,index:c}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?h:h.slice(0,Math.max(0,r-i))}),n};function hE(e,t,n={}){const{empty:r,ranges:s}=e.selection,i=t?ll(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>Ay(h.attrs,n,{strict:!1}));let l=0;const c=[];if(s.forEach(({$from:h,$to:m})=>{const g=h.pos,y=m.pos;e.doc.nodesBetween(g,y,(b,w)=>{if(i&&b.inlineContent&&!b.type.allowsMarkType(i))return!1;if(!b.isText&&!b.marks.length)return;const E=Math.max(g,w),C=Math.min(y,w+b.nodeSize),T=C-E;l+=T,c.push(...b.marks.map(N=>({mark:N,from:E,to:C})))})}),l===0)return!1;const u=c.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>Ay(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=c.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=l}function $me(e,t,n={}){if(!t)return Op(e,null,n)||hE(e,null,n);const r=Bx(t,e.schema);return r==="node"?Op(e,t,n):r==="mark"?hE(e,t,n):!1}const bbe=(e,t)=>{const{$from:n,$to:r,$anchor:s}=e.selection;if(t){const i=Hx(c=>c.type.name===t)(e.selection);if(!i)return!1;const l=e.doc.resolve(i.pos+1);return s.pos+1===l.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},vbe=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function gI(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function g1(e,t){const{nodeExtensions:n}=id(t),r=n.find(i=>i.name===e);if(!r)return!1;const s=Gt(Ke(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof s!="string"?!1:s.split(" ").includes("list")}function K2(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name==="hardBreak")return!0;if(e.isText){var r;return!/\S/.test((r=e.text)!==null&&r!==void 0?r:"")}}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let s=!0;return e.content.forEach(i=>{s!==!1&&(K2(i,{ignoreWhitespace:n,checkChildren:t})||(s=!1))}),s}return!1}function Sbe(e){return e instanceof rt}var lH=class aH{constructor(t){this.position=t}static fromJSON(t){return new aH(t.position)}toJSON(){return{position:this.position}}};function Vme(e,t){const n=t.mapping.mapResult(e.position);return{position:new lH(n.pos),mapResult:n}}function Ume(e){return new lH(e)}function qme(e,t,n){const{selection:r}=t;let s=null;if(G6(r)&&(s=r.$cursor),s){var i;const c=(i=e.storedMarks)!==null&&i!==void 0?i:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(c)||!c.some(u=>u.type.excludes(n)))}const{ranges:l}=r;return l.some(({$from:c,$to:u})=>{let d=c.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(c.pos,u.pos,(h,m,g)=>{if(d)return!1;if(h.isInline){const y=!g||g.type.allowsMarkType(n),b=!!n.isInSet(h.marks)||!h.marks.some(w=>w.type.excludes(n));d=y&&b}return!d}),d})}const Gme=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:l,ranges:c}=i,u=ll(e,r.schema);if(s)if(l){const d=eH(r,u);n.addStoredMark(u.create({...d,...t}))}else c.forEach(d=>{const h=d.$from.pos,m=d.$to.pos;r.doc.nodesBetween(h,m,(g,y)=>{const b=Math.max(y,h),w=Math.min(y+g.nodeSize,m);g.marks.find(E=>E.type===u)?g.marks.forEach(E=>{u===E.type&&n.addMark(b,w,u.create({...E.attrs,...t}))}):n.addMark(b,w,u.create(t))})});return qme(r,n,u)},Kme=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Yme=(e,t={})=>({state:n,dispatch:r,chain:s})=>{const i=lr(e,n.schema);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:c})=>kD(i,{...l,...t})(n)?!0:c.clearNodes()).command(({state:c})=>kD(i,{...l,...t})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Wme=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,s=Sc(e,0,r.content.size),i=rt.create(r,s);t.setSelection(i)}return!0},Xme=(e,t)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let l,c;return typeof t=="number"?(l=t,c=t):t&&"from"in t&&"to"in t?(l=t.from,c=t.to):(l=i.from,c=i.to),s&&n.doc.nodesBetween(l,c,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:e})}),!0},Qme=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:s,to:i}=typeof e=="number"?{from:e,to:e}:e,l=ct.atStart(r).from,c=ct.atEnd(r).to,u=Sc(s,l,c),d=Sc(i,l,c),h=ct.create(r,u,d);t.setSelection(h)}return!0},Zme=e=>({state:t,dispatch:n})=>{const r=lr(e,t.schema);return Ide(r)(t,n)};function yI(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(s=>t==null?void 0:t.includes(s.type.name));e.tr.ensureMarks(r)}}const Jme=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:l}=t,{$from:c,$to:u}=i,d=s.extensionManager.attributes,h=P0(d,c.node().type.name,c.node().attrs);if(i instanceof rt&&i.node.isBlock)return!c.parentOffset||!Jo(l,c.pos)?!1:(r&&(e&&yI(n,s.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const m=u.parentOffset===u.parent.content.size,g=c.depth===0?void 0:Q6(c.node(-1).contentMatchAt(c.indexAfter(-1)));let y=m&&g?[{type:g,attrs:h}]:void 0;const b=i instanceof ct&&!i.empty?$o.create({doc:t.doc,selection:i}).tr.deleteSelection():null,w=b?b.doc:t.doc,E=b?b.mapping.map(c.pos):c.pos;let C=Jo(w,E,1,y);if(!y&&!C&&Jo(w,E,1,g?[{type:g}]:void 0)&&(C=!0,y=g?[{type:g,attrs:h}]:void 0),r){if(C){const T=t.steps.length;if(i instanceof ct&&t.deleteSelection(),t.split(t.mapping.slice(T).map(c.pos),1,y),g&&!m&&!c.parentOffset&&c.parent.type!==g){const N=t.mapping.slice(T).map(c.before()),R=t.doc.resolve(N);c.node(-1).canReplaceWith(R.index(),R.index()+1,g)&&t.setNodeMarkup(t.mapping.slice(T).map(c.before()),g)}}e&&yI(n,s.extensionManager.splittableMarks),t.scrollIntoView()}return C},ege=(e,t={})=>({tr:n,state:r,dispatch:s,editor:i})=>{const l=lr(e,r.schema),{$from:c,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const h=c.node(-1);if(h.type!==l)return!1;const m=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){var g;let R=Me.empty;const M=c.index(-1)?1:c.index(-2)?2:3;for(let H=c.depth-M;H>=c.depth-3;H-=1)R=Me.from(c.node(H).copy(R));const D=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,k={...P0(m,c.node().type.name,c.node().attrs),...t},I=((g=l.contentMatch.defaultType)===null||g===void 0?void 0:g.createAndFill(k))||void 0;R=R.append(Me.from(l.createAndFill(null,I)||void 0));const _=c.before(c.depth-(M-1));n.replace(_,c.after(-D),new He(R,4-M,0));let P=-1;n.doc.nodesBetween(_,n.doc.content.size,(H,z)=>{if(P>-1)return!1;H.isTextblock&&H.content.size===0&&(P=z+1)}),P>-1&&n.setSelection(ct.near(n.doc.resolve(P))),n.scrollIntoView()}return!0}const y=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,b={...P0(m,h.type.name,h.attrs),...t},w={...P0(m,c.node().type.name,c.node().attrs),...t},E=c.parentOffset===0&&c.index(-1)===0,C=c.before(-1);n.delete(c.pos,u.pos);const T=E?h.attrs:b,N=y?[{type:l,attrs:T},{type:y,attrs:w}]:[{type:l,attrs:T}];if(!Jo(n.doc,c.pos,2))return!1;if(s){const{selection:R,storedMarks:M}=r,{splittableMarks:D}=i.extensionManager,k=M||R.$to.parentOffset&&R.$from.marks();if(n.split(c.pos,2,N).scrollIntoView(),E&&n.setNodeMarkup(C,void 0,b),!k||!s)return!0;const I=k.filter(_=>D.includes(_.type.name));n.ensureMarks(I)}return!0};function xI(e){return!e||e==="1"?null:e}function cH(e,t){return xI(e)===xI(t)}const y1=(e,t)=>{const n=Hx(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&Ia(e.doc,n.pos))||!cH(n.node.attrs.type,s==null?void 0:s.attrs.type)||e.join(n.pos),!0},x1=(e,t)=>{const n=Hx(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&Ia(e.doc,r))||!cH(n.node.attrs.type,s==null?void 0:s.attrs.type)||e.join(r),!0};function tge(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),s=t.resolve(n.nodeSize-1);return ct.between(r,s)}const nge=(e,t,n,r={})=>({editor:s,tr:i,state:l,dispatch:c,chain:u,commands:d,can:h})=>{const{extensions:m,splittableMarks:g}=s.extensionManager,y=lr(e,l.schema),b=lr(t,l.schema),{selection:w,storedMarks:E}=l,{$from:C,$to:T}=w,N=C.blockRange(T),R=E||w.$to.parentOffset&&w.$from.marks();if(!N)return!1;const M=Hx(U=>g1(U.type.name,m))(w),D=w.from===0&&w.to===l.doc.content.size,k=l.doc.content.content,I=k.length===1?k[0]:null,_=D&&I&&g1(I.type.name,m)?{node:I,pos:0}:null,P=M??_,H=!!M&&N.depth>=1&&N.depth-M.depth<=1,z=!!_;if((H||z)&&P){if(P.node.type===y)return D&&z?u().command(({tr:U,dispatch:j})=>{const B=tge(U);return B?(U.setSelection(B),j&&j(U),!0):!1}).liftListItem(b).run():d.liftListItem(b);if(g1(P.node.type.name,m)&&y.validContent(P.node.content))return u().command(()=>(i.setNodeMarkup(P.pos,y),!0)).command(()=>y1(i,y)).command(()=>x1(i,y)).run()}return!n||!R||!c?u().command(()=>h().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>y1(i,y)).command(()=>x1(i,y)).run():u().command(()=>{const U=h().wrapInList(y,r),j=R.filter(B=>g.includes(B.type.name));return i.ensureMarks(j),U?!0:d.clearNodes()}).wrapInList(y,r).command(()=>y1(i,y)).command(()=>x1(i,y)).run()},rge=(e,t={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,l=ll(e,r.schema);return hE(r,l,t)?s.unsetMark(l,{extendEmptyMarkRange:i}):s.setMark(l,t)},sge=(e,t,n={})=>({state:r,commands:s})=>{const i=lr(e,r.schema),l=lr(t,r.schema),c=Op(r,i,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),c?s.setNode(l,u):s.setNode(i,{...u,...n})},ige=(e,t={})=>({state:n,commands:r})=>{const s=lr(e,n.schema);return Op(n,s,t)?r.lift(s):r.wrapIn(s,t)},oge=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(e))){if(t){const l=e.tr,c=i.transform;for(let u=c.steps.length-1;u>=0;u-=1)l.step(c.steps[u].invert(c.docs[u]));if(i.text){const u=l.doc.resolve(i.from).marks();l.replaceWith(i.from,i.to,e.schema.text(i.text,u))}else l.delete(i.from,i.to)}return!0}}return!1},lge=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{ignoreClearable:s=!1}=e,{selection:i}=t,{empty:l,ranges:c}=i;if(l)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(h=>s||!u.includes(h.name));c.forEach(h=>{for(const m of d)t.removeMark(h.$from.pos,h.$to.pos,m)})}return!0},age=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{extendEmptyMarkRange:i=!1}=t,{selection:l}=n,c=ll(e,r.schema),{$from:u,empty:d,ranges:h}=l;if(!s)return!0;if(d&&i){var m;let{from:g,to:y}=l;const b=V2(u,c,(m=u.marks().find(w=>w.type===c))===null||m===void 0?void 0:m.attrs);b&&(g=b.from,y=b.to),n.removeMark(g,y,c)}else h.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,c)});return n.removeStoredMark(c),!0},cge=e=>({tr:t,state:n,dispatch:r})=>{const{selection:s}=n;let i,l;return typeof e=="number"?(i=e,l=e):e&&"from"in e&&"to"in e?(i=e.from,l=e.to):(i=s.from,l=s.to),r&&t.doc.nodesBetween(i,l,(c,u)=>{if(c.isText)return;const d={...c.attrs};delete d.dir,t.setNodeMarkup(u,void 0,d)}),!0},uge=(e,t={})=>({tr:n,state:r,dispatch:s})=>{let i=null,l=null;const c=Bx(typeof e=="string"?e:e.name,r.schema);if(!c)return!1;c==="node"&&(i=lr(e,r.schema)),c==="mark"&&(l=ll(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,m=d.$to.pos;let g,y,b,w;n.selection.empty?r.doc.nodesBetween(h,m,(E,C)=>{i&&i===E.type&&(u=!0,b=Math.max(C,h),w=Math.min(C+E.nodeSize,m),g=C,y=E)}):r.doc.nodesBetween(h,m,(E,C)=>{C<h&&i&&i===E.type&&(u=!0,b=Math.max(C,h),w=Math.min(C+E.nodeSize,m),g=C,y=E),C>=h&&C<=m&&(i&&i===E.type&&(u=!0,s&&n.setNodeMarkup(C,void 0,{...E.attrs,...t})),l&&E.marks.length&&E.marks.forEach(T=>{if(l===T.type&&(u=!0,s)){const N=Math.max(C,h),R=Math.min(C+E.nodeSize,m);n.addMark(N,R,l.create({...T.attrs,...t}))}}))}),y&&(g!==void 0&&s&&n.setNodeMarkup(g,void 0,{...y.attrs,...t}),l&&y.marks.length&&y.marks.forEach(E=>{l===E.type&&s&&n.addMark(b,w,l.create({...E.attrs,...t}))}))}),u},uf=new Mi("__tiptap_decorations__"),fge=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(uf,{type:"force",name:e}),!0),dge=(e,t={})=>({state:n,dispatch:r})=>{const s=lr(e,n.schema);return Rde(s,t)(n,r)},hge=(e,t={})=>({state:n,dispatch:r})=>{const s=lr(e,n.schema);return Ode(s,t)(n,r)};var pge=xfe({blur:()=>Ppe,clearContent:()=>zpe,clearNodes:()=>Bpe,command:()=>Hpe,createParagraphNear:()=>Fpe,cut:()=>$pe,deleteCurrentNode:()=>Vpe,deleteNode:()=>Upe,deleteRange:()=>qpe,deleteSelection:()=>Ype,enter:()=>Wpe,exitCode:()=>Xpe,extendMarkRange:()=>Qpe,first:()=>Zpe,focus:()=>eme,forEach:()=>tme,insertContent:()=>nme,insertContentAt:()=>rme,insertDefaultBlock:()=>sme,joinBackward:()=>lme,joinDown:()=>ome,joinForward:()=>ame,joinItemBackward:()=>cme,joinItemForward:()=>ume,joinTextblockBackward:()=>fme,joinTextblockForward:()=>dme,joinUp:()=>ime,keyboardShortcut:()=>pme,lift:()=>mme,liftEmptyBlock:()=>gme,liftListItem:()=>yme,newlineInCode:()=>xme,resetAttributes:()=>bme,scrollIntoView:()=>vme,selectAll:()=>Sme,selectNodeBackward:()=>wme,selectNodeForward:()=>Eme,selectParentNode:()=>Cme,selectTextblockEnd:()=>Nme,selectTextblockStart:()=>Tme,setContent:()=>Rme,setMark:()=>Gme,setMeta:()=>Kme,setNode:()=>Yme,setNodeSelection:()=>Wme,setTextDirection:()=>Xme,setTextSelection:()=>Qme,sinkListItem:()=>Zme,splitBlock:()=>Jme,splitListItem:()=>ege,toggleList:()=>nge,toggleMark:()=>rge,toggleNode:()=>sge,toggleWrap:()=>ige,undoInputRule:()=>oge,unsetAllMarks:()=>lge,unsetMark:()=>age,unsetTextDirection:()=>cge,updateAttributes:()=>uge,updateDecorations:()=>fge,wrapIn:()=>dge,wrapInList:()=>hge});const bh=new WeakMap;function mge(e,t){var n;bh.set(e,((n=bh.get(e))!==null&&n!==void 0?n:0)+1);try{return t()}finally{var r;const s=((r=bh.get(e))!==null&&r!==void 0?r:1)-1;s>0?bh.set(e,s):bh.delete(e)}}var gge=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function yge(e){return e.kind==="widget"}function uH(e,t){const n=[],r=new Set;for(const s of e)s.kind==="widget"&&yge(s)&&r.add(s.key),n.push(s.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function xge(e,t,n){const{decorations:r,widgetKeys:s}=uH(t,n);return{set:bn.create(e,r),widgetKeys:s}}function fH({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n?!0:e===n&&n===r}function bge({decorations:e,from:t,to:n,docSize:r,extensionName:s,warnedExtensions:i}){return e.filter(l=>fH({position:l.anchor,from:t,to:n,docSize:r})?!0:(l.anchor===n||i.has(s)||(i.add(s),console.warn(`[tiptap warn]: Extension "${s}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function vge(e){var t;const n=(t=e.spec)===null||t===void 0?void 0:t.key;return typeof n=="string"?n:void 0}function dH(e){return e.jsonID==="attr"}function Sge(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||dH(e))return!0;const n=e;return typeof n.from=="number"&&typeof n.to=="number"}function wge(e,t){let n=null,r=0,s=0;for(let i=0;i<e.childCount&&!(s>t.to);i+=1){const l=s+e.child(i).nodeSize;l>=t.from&&(n===null&&(n=s),r=l),s=l}return n===null?null:{from:n,to:r}}function Ege(e,t){if(e.steps.some(i=>!Sge(i)))return{type:"full"};const n=iH(e).map(({newRange:i})=>i);e.steps.forEach((i,l)=>{if(!dH(i))return;const c=e.mapping.slice(l);n.push({from:c.map(i.pos,-1),to:c.map(i.pos+1)})});const r=[];for(const i of n){const l=wge(t,i);l&&r.push(l)}r.sort((i,l)=>i.from-l.from);const s=[];for(const i of r){const l=s[s.length-1];l&&i.from<=l.to?l.to=Math.max(l.to,i.to):s.push({...i})}return{type:"ranges",ranges:s}}function hH(e,t,n,r){return e.map(t,n,{onRemove:s=>{const i=s==null?void 0:s.key;typeof i=="string"&&r.delete(i)}})}function Cge(e,t,n){var r,s;const i=(r=t.decorationSetsByExtension[e])!==null&&r!==void 0?r:bn.empty,l=new Set((s=t.widgetKeysByExtension[e])!==null&&s!==void 0?s:[]);return{set:hH(i,n.mapping,n.doc,l),widgetKeys:l}}function bI(e,t){const n=Object.values(t).flatMap(r=>r.find());return bn.create(e,n)}function vI(e){const t=new Set;for(const n of Object.values(e))for(const r of n)t.add(r);return t}function Nge(e,t){var n;switch((n=t.update)!==null&&n!==void 0?n:"document"){case"document":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw new Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Tge(e,t,n){return n?!0:e.update==="manual"?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}const Rge=new Set;var Oge=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:t})=>{const n=uf.getState(t);n&&this.warnDuplicateWidgetKeys(n)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:t,spec:n})=>Nge(t,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return(e=(t=uf.getState(this.editor.state))===null||t===void 0?void 0:t.widgetKeys)!==null&&e!==void 0?e:Rge}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){const t=[];for(const{name:n,addDecorations:r}of e){const s=r();s&&t.push({name:n,spec:s})}return t}createPlugin(){const{editor:e,entries:t}=this;return new $s({key:uf,state:{init:(n,r)=>{const s={},i={};for(const{name:c,spec:u}of t){const{set:d,widgetKeys:h}=this.buildFullSet(c,u,r);s[c]=d,i[c]=h}const l={decorationSetsByExtension:s,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(r.doc,s),widgetKeys:vI(i)};return this.warnDuplicateWidgetKeys(l),l},apply:(n,r,s,i)=>{const l=n.getMeta(uf),c=(l==null?void 0:l.type)==="force"&&!l.name,u=(l==null?void 0:l.type)==="force"?l.name:void 0,d={},h={},m=new Set;return mge(e,()=>{for(const{name:g,spec:y}of t){const b=c||u===g;if(Tge(y,{editor:e,tr:n,oldState:s,newState:i},b))if(y.update==="changedRanges"&&n.docChanged&&!b){const w=this.applyChangedRangesRecompute(g,y,r,n,i);d[g]=w.set,h[g]=w.widgetKeys,m.add(g)}else{const{set:w,widgetKeys:E}=this.buildFullSet(g,y,i);d[g]=w,h[g]=E,m.add(g)}else{const w=Cge(g,r,n);d[g]=w.set,h[g]=w.widgetKeys}}}),m.size===0&&!n.docChanged?r:{decorationSetsByExtension:d,widgetKeysByExtension:h,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:d,recomputedNames:m}),widgetKeys:vI(h)}}},props:{decorations(n){var r,s;return(r=(s=uf.getState(n))===null||s===void 0?void 0:s.mergedDecorationSet)!==null&&r!==void 0?r:bn.empty}}})}applyChangedRangesRecompute(e,t,n,r,s){const i=Ege(r,s.doc);return i.type==="full"?this.buildFullSet(e,t,s):this.rebuildRanges(e,t,n,r,s,i.ranges)}rebuildRanges(e,t,n,r,s,i){var l,c;const u=(l=n.decorationSetsByExtension[e])!==null&&l!==void 0?l:bn.empty,d=new Set((c=n.widgetKeysByExtension[e])!==null&&c!==void 0?c:[]);let h=hH(u,r.mapping,r.doc,d);const m=s.doc.content.size;for(const{from:g,to:y}of i){const b=h.find(g,y).filter(C=>fH({position:C.from,from:g,to:y,docSize:m}));for(const C of b){const T=vge(C);T&&d.delete(T)}h=h.remove(b);const{decorations:w,widgetKeys:E}=uH(bge({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:s,view:this.mountedView,from:g,to:y})),from:g,to:y,docSize:m,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);h=h.add(s.doc,w);for(const C of E)d.add(C)}return{set:h,widgetKeys:d}}buildFullSet(e,t,n){const r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return xge(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(e){}buildMergedSet(e,t){const n=Object.keys(t);return n.length===1?t[n[0]]:bI(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:s}){return e.length===1?r[e[0].name]:s.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):bI(n.doc,r)}};function kge(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>Object.prototype.hasOwnProperty.call(t,s)&&Object.is(e[s],t[s]))}function wbe(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof rt){const i=r.index();return r.parent.canReplaceWith(i,i+1,t)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(t))return!0;s-=1}return!1}function Mge(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return t&&s.setAttribute("nonce",t),s.setAttribute("data-tiptap-style",""),s.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(s),s}const Age={lt:"<",gt:">",quot:'"',amp:"&"};function Ebe(e){return e.replace(/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(lt|gt|quot|amp));/g,(t,n,r,s)=>n!==void 0?SI(Number(n)):r!==void 0?SI(parseInt(r,16)):Age[s])}const _ge=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function SI(e){var t;return e===0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint((t=_ge.get(e))!==null&&t!==void 0?t:e)}function Cbe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Dge(e){return typeof e=="number"}function Ige(e){return Object.prototype.toString.call(e).slice(8,-1)}function f0(e){return Ige(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Nbe(e,t,n){const r=e.split(`
356
- `),s=[];let i="",l=0;const c=t.baseIndentSize||2;for(;l<r.length;){const h=r[l],m=h.match(t.itemPattern);if(!m){if(s.length>0)break;if(h.trim()===""){l+=1,i=`${i}${h}
357
- `;continue}else return}const g=t.extractItemData(m),{indentLevel:y,mainContent:b}=g;i=`${i}${h}
358
- `;const w=[b];for(l+=1;l<r.length;){var u;const N=r[l];if(N.trim()===""){var d;const R=r.slice(l+1).findIndex(M=>M.trim()!=="");if(R===-1)break;if((((d=r[l+1+R].match(/^(\s*)/))===null||d===void 0||(d=d[1])===null||d===void 0?void 0:d.length)||0)>y){w.push(N),i=`${i}${N}
359
- `,l+=1;continue}else break}if((((u=N.match(/^(\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>y)w.push(N),i=`${i}${N}
360
- `,l+=1;else break}let E;const C=w.slice(1);if(C.length>0){const N=C.map(R=>R.slice(y+c)).join(`
361
- `);N.trim()&&(t.customNestedParser?E=t.customNestedParser(N):E=n.blockTokens(N))}const T=t.createToken(g,E);s.push(T)}if(s.length!==0)return{items:s,raw:i}}const wI=4;function EI(e){let t=0;for(const n of e)t=n===" "?t+wI-t%wI:t+1;return t}function Tbe(e,t,n,r,s){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[l,...c]=e.content;let u=`${i}${t.renderChildren([l])}`;return c&&c.length>0&&c.forEach((d,h)=>{var m,g;const y=(m=(g=t.renderChild)===null||g===void 0?void 0:g.call(t,d,h+1))!==null&&m!==void 0?m:t.renderChildren([d]);if(y!=null){const b=E=>{if(!(s!=null&&s.alignNestedToPrefix))return t.indent(E);const C=t.indent(""),T=EI(i);return(EI(C)>=T?C:" ".repeat(T))+E},w=y.split(`
362
- `).map(E=>b(E||"")).join(`
363
- `);u+=d.type==="paragraph"?`
364
-
365
- ${w}`:`
366
- ${w}`}}),u}function CI(e){return typeof e.type=="string"?e.type:e.type.name}function Rbe(e,t){if(e.length!==t.length)return!1;const n=Array.from({length:t.length},()=>!1);return e.every(r=>{const s=CI(r),i=t.findIndex((l,c)=>!n[c]&&s===CI(l)&&kge(r.attrs,l.attrs));return i===-1?!1:(n[i]=!0,!0)})}function pH(e,t){const n={...e};return f0(e)&&f0(t)&&Object.keys(t).forEach(r=>{f0(t[r])&&f0(e[r])?n[r]=pH(e[r],t[r]):n[r]=t[r]}),n}function jge(e,t,n={}){const{state:r}=t,{doc:s,tr:i}=r,l=e;s.descendants((c,u)=>{const d=i.mapping.map(u),h=i.mapping.map(u)+c.nodeSize;let m=null;if(c.marks.forEach(y=>{if(y!==l)return!1;m=y}),!m)return;let g=!1;if(Object.keys(n).forEach(y=>{n[y]!==m.attrs[y]&&(g=!0)}),g){const y=e.type.create({...e.attrs,...n});i.removeMark(d,h,e.type),i.addMark(d,h,y)}}),i.docChanged&&t.view.dispatch(i)}var Fx=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!==null&&t!==void 0?t:!0}};const Lge=(e,t)=>{if($2(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Pge(e){const{editor:t,from:n,to:r,text:s,insertText:i}=e;if(!i)return{inputTransaction:null,tr:t.view.state.tr};const l=t.view.state.tr.insertText(s,n,r);return{inputTransaction:l,tr:$o.create({doc:l.doc,selection:l.selection,storedMarks:l.storedMarks}).tr}}function zge(e){const{editor:t,from:n,to:r,text:s,rule:i,match:l,plugin:c,insertText:u}=e,{view:d}=t,{inputTransaction:h,tr:m}=Pge({editor:t,from:n,to:r,text:s,insertText:u}),g=h?n+s.length:r,y=zx({state:d.state,transaction:m}),b={from:n-(l[0].length-s.length),to:g},{commands:w,chain:E,can:C}=new Nf({editor:t,state:y});return i.handler({state:y,range:b,match:l,commands:w,chain:E,can:C})===null||!m.steps.length?!1:(h&&(d.dispatch(h),!d.state.doc.eq(h.doc))||(Ipe(m),m.setMeta("inputRule",!0),i.undoable&&m.setMeta(c,{transform:m,from:n,to:g,text:s}),d.dispatch(m)),!0)}function Bge(e,t,n){const r=t[0].length-n.length;if(r<=0)return!0;const s=e.parentOffset-r;return s>=0&&e.parent.textBetween(s,e.parentOffset)===t[0].slice(0,r)}function d0(e){var t;const{editor:n,from:r,to:s,text:i,rules:l,plugin:c,insertText:u}=e,{view:d}=n;if(d.composing)return!1;const h=d.state.doc.resolve(r);if(h.parent.type.spec.code||!((t=h.nodeBefore||h.nodeAfter)===null||t===void 0)&&t.marks.find(g=>g.type.spec.code))return!1;const m=Fme(h)+i;for(const g of l){const y=Lge(m,g.find);if(!(!y||!Bge(h,y,i))&&zge({editor:n,from:r,to:s,text:i,rule:g,match:y,plugin:c,insertText:u}))return!0}return!1}function Hge(e){const{editor:t,rules:n}=e,r=new $s({state:{init(){return null},apply(s,i,l){const c=s.getMeta(r);if(c)return c;const u=s.getMeta("applyInputRules");return u&&setTimeout(()=>{let{text:d}=u;typeof d=="string"?d=d:d=q2(Me.from(d),l.schema);const{from:h}=u,m=h+d.length;d0({editor:t,from:h,to:m,text:d,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,l,c){return d0({editor:t,from:i,to:l,text:c,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&d0({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:l}=s.state.selection;return l?d0({editor:t,from:l.pos,to:l.pos,text:`
367
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Y2=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Gt(Ke(this,"addOptions",{name:this.name}))}}get storage(){return{...Gt(Ke(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>pH(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Fge=class mH extends Y2{constructor(...t){super(...t),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new mH(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!i.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=i.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",s.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},$ge=class{constructor(e){this.find=e.find,this.handler=e.handler}};const Vge=(e,t,n)=>{if($2(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=e,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function Uge(e){const{editor:t,state:n,from:r,to:s,rule:i,pasteEvent:l,dropEvent:c}=e,{commands:u,chain:d,can:h}=new Nf({editor:t,state:n}),m=[];return n.doc.nodesBetween(r,s,(g,y)=>{var b,w,E,C;if(!((b=g.type)===null||b===void 0||(b=b.spec)===null||b===void 0)&&b.code||!(g.isText||g.isTextblock||g.isInline))return;const T=(w=(E=(C=g.content)===null||C===void 0?void 0:C.size)!==null&&E!==void 0?E:g.nodeSize)!==null&&w!==void 0?w:0,N=Math.max(r,y),R=Math.min(s,y+T);if(N>=R)return;const M=g.isText?g.text||"":g.textBetween(N-y,R-y,void 0,"");Vge(M,i.find,l).forEach(D=>{if(D.index===void 0)return;const k=N+D.index+1,I=k+D[0].length,_={from:n.tr.mapping.map(k),to:n.tr.mapping.map(I)},P=i.handler({state:n,range:_,match:D,commands:u,chain:d,can:h,pasteEvent:l,dropEvent:c});m.push(P)})}),m.every(g=>g!==null)}let sf=null;const qge=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function Gge(e){const{editor:t,rules:n}=e;let r=null,s=!1,i=!1,l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const u=({state:d,from:h,to:m,rule:g,pasteEvt:y})=>{const b=d.tr,w=zx({state:d,transaction:b});if(!(!Uge({editor:t,state:w,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:y,dropEvent:c})||!b.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return t.on("destroy",()=>{sf===t&&(sf=null)}),n.map(d=>new $s({view(h){const m=y=>{var b;r=!((b=h.dom.parentElement)===null||b===void 0)&&b.contains(y.target)?h.dom.parentElement:null,r&&(sf=t)},g=()=>{sf&&(sf=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(i=r===h.dom.parentElement,c=m,!i){const g=sf;g!=null&&g.isEditable&&setTimeout(()=>{if(g.isDestroyed)return;const y=g.state.selection;y&&g.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(h,m)=>{var g;const y=(g=m.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return l=m,s=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,g)=>{const y=h[0],b=y.getMeta("uiEvent")==="paste"&&!s,w=y.getMeta("uiEvent")==="drop"&&!i,E=y.getMeta("applyPasteRules"),C=!!E;if(!b&&!w&&!C)return;if(C){let{text:R}=E;typeof R=="string"?R=R:R=q2(Me.from(R),g.schema);const{from:M}=E,D=M+R.length,k=qge(R);return u({rule:d,state:g,from:M,to:{b:D},pasteEvt:k})}const T=m.doc.content.findDiffStart(g.doc.content),N=m.doc.content.findDiffEnd(g.doc.content);if(!(!Dge(T)||!N||T===N.b))return u({rule:d,state:g,from:T,to:N,pasteEvt:l})}}))}var $x=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=G2(e),this.schema=nH(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=Ke(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:rf(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this,t=qh([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:rf(r.name,this.schema)},i=[],l=Ke(r,"addKeyboardShortcuts",s);let c={};if(r.type==="mark"&&Ke(r,"exitable",s)&&(c.ArrowRight=()=>Fge.handleExit({editor:e,mark:r})),l){const g=Object.fromEntries(Object.entries(l()).map(([y,b])=>[y,()=>b({editor:e})]));c={...c,...g}}const u=Npe(c);i.push(u);const d=Ke(r,"addInputRules",s);if(gI(r,e.options.enableInputRules)&&d){const g=d();if(g&&g.length){const y=Hge({editor:e,rules:g}),b=Array.isArray(y)?y:[y];i.push(...b)}}const h=Ke(r,"addPasteRules",s);if(gI(r,e.options.enablePasteRules)&&h){const g=h();if(g&&g.length){const y=Gge({editor:e,rules:g});i.push(...y)}}const m=Ke(r,"addProseMirrorPlugins",s);if(m){const g=m();i.push(...g)}return i}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;const{editor:t}=this;(e=this.decorationManager)===null||e===void 0||e.destroy();const n=[];return this.extensions.forEach(r=>{const s=Ke(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:rf(r.name,this.schema)});s&&n.push({name:r.name,addDecorations:s})}),this.decorationManager=new Oge({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return tH(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=id(this.extensions);return Object.fromEntries(t.filter(n=>!!Ke(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),s=Ke(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:lr(n.name,this.schema)});if(!s)return[];const i=s();if(!i)return[];const l=(c,u,d,h,m)=>{const g=Dy(c,r);return i({node:c,view:u,getPos:d,decorations:h,innerDecorations:m,editor:e,extension:n,HTMLAttributes:g})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return qh([...this.extensions].reverse()).reduceRight((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:rf(r.name,this.schema)},i=Ke(r,"dispatchTransaction",s);return i?l=>{i.call(s,{transaction:l,next:n})}:n},e)}transformPastedHTML(e){const{editor:t}=this;return qh([...this.extensions]).reduce((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:rf(r.name,this.schema)},i=Ke(r,"transformPastedHTML",s);return i?(l,c)=>{const u=n(l,c);return i.call(s,u)}:n},e||(n=>n))}get markViews(){const{editor:e}=this,{markExtensions:t}=id(this.extensions);return Object.fromEntries(t.filter(n=>!!Ke(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s=Ke(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:ll(n.name,this.schema)});if(!s)return[];const i=(l,c,u)=>{const d=Dy(l,r);return s()({mark:l,view:c,inline:u,editor:e,extension:n,HTMLAttributes:d,updateAttributes:h=>{jge(l,e,h)}})};return[n.name,i]}))}destroy(){var e;(e=this.decorationManager)===null||e===void 0||e.destroy(),this.extensions.forEach(t=>{let n=t;for(;n.parent;){const r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:rf(t.name,this.schema)};if(t.type==="mark"){var r,s;(!((r=Gt(Ke(t,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(t.name),!((s=Gt(Ke(t,"clearable",n)))!==null&&s!==void 0)||s||this.nonClearableMarks.push(t.name)}const i=Ke(t,"onBeforeCreate",n),l=Ke(t,"onCreate",n),c=Ke(t,"onUpdate",n),u=Ke(t,"onSelectionUpdate",n),d=Ke(t,"onTransaction",n),h=Ke(t,"onFocus",n),m=Ke(t,"onBlur",n),g=Ke(t,"onDestroy",n);i&&this.editor.on("beforeCreate",i),l&&this.editor.on("create",l),c&&this.editor.on("update",c),u&&this.editor.on("selectionUpdate",u),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),m&&this.editor.on("blur",m),g&&this.editor.on("destroy",g)})}};$x.resolve=G2;$x.sort=qh;$x.flatten=U2;var co=class gH extends Y2{constructor(...t){super(...t),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new gH(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};const Kge=co.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $s({key:new Mi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:s}=t,i=sH(n),{blockSeparator:l}=this.options,c={...l!==void 0?{blockSeparator:l}:{},textSerializers:i};return[...s.ranges].sort((u,d)=>u.$from.pos-d.$from.pos).map(({$from:u,$to:d})=>rH(r,{from:u.pos,to:d.pos},c)).join(l??`
368
-
369
- `)}}})]}}),Yge=co.create({name:"commands",addCommands(){return{...pge}}}),Wge=co.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;const s=()=>{var i,l,c;if((i=(l=this.editor.options.coreExtensionOptions)===null||l===void 0||(l=l.delete)===null||l===void 0||(c=l.filterTransaction)===null||c===void 0?void 0:c.call(l,e))!==null&&i!==void 0?i:e.getMeta("y-sync$"))return;const u=Ome(e.before,[e,...t]);iH(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(m,g)=>{const y=g+m.nodeSize-2,b=h.oldRange.from<=g&&y<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:y,newFrom:u.mapping.map(g),newTo:u.mapping.map(y),deletedRange:h.oldRange,newRange:h.newRange,partial:!b,editor:this.editor,transaction:e,combinedTransform:u})})});const d=u.mapping;u.steps.forEach((h,m)=>{if(h instanceof wi){var g,y;const b=d.slice(m).map(h.from,-1),w=d.slice(m).map(h.to),E=d.invert().map(b,-1),C=d.invert().map(w),T=b>0?(g=u.doc.nodeAt(b-1))===null||g===void 0?void 0:g.marks.some(R=>R.eq(h.mark)):!1,N=(y=u.doc.nodeAt(w))===null||y===void 0?void 0:y.marks.some(R=>R.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:E,to:C},newRange:{from:b,to:w},partial:!!(N||T),editor:this.editor,transaction:e,combinedTransform:u})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(s,0):s()}}),Xge=co.create({name:"drop",addProseMirrorPlugins(){return[new $s({key:new Mi("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Qge=co.create({name:"editable",addProseMirrorPlugins(){return[new $s({key:new Mi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Zge=new Mi("focusEvents"),Jge=co.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new $s({key:Zge,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),e0e=co.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:c})=>{const{selection:u,doc:d}=c,{empty:h,$anchor:m}=u,{pos:g,parent:y}=m,b=m.parent.isTextblock&&g>0?c.doc.resolve(g-1):m,w=b.parent.type.spec.isolating,E=m.pos-m.parentOffset,C=w&&b.parent.childCount===1?E===m.pos:Nt.atStart(d).from===g;return!h||!y.type.isTextblock||y.textContent.length||!C||C&&m.parent.type.name==="paragraph"?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _y()||J6()?i:s},addProseMirrorPlugins(){return[new $s({key:new Mi("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(y=>y.getMeta("composition")))return;const r=e.some(y=>y.docChanged)&&!t.doc.eq(n.doc),s=e.some(y=>y.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:l,to:c}=t.selection,u=Nt.atStart(t.doc).from,d=Nt.atEnd(t.doc).to;if(i||!(l===u&&c===d)||!K2(n.doc))return;const h=n.tr,m=zx({state:n,transaction:h}),{commands:g}=new Nf({editor:this.editor,state:m});if(g.clearNodes(),!!h.steps.length)return h}})]}}),t0e=co.create({name:"paste",addProseMirrorPlugins(){return[new $s({key:new Mi("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),n0e=co.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new $s({key:new Mi("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!==null&&e!==void 0?e:"0"}}}})]}}),r0e=co.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=id(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new $s({key:new Mi("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}});let NI=!1;function s0e(e){if(NI)return;NI=!0;let t;try{t=Mn.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof Me||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var i0e=class Ih{get name(){return this.node.type.name}constructor(t,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new Ih(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Ih(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Ih(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,l=n.isInline,c=this.pos+r+(i?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(c);if(!s&&!l&&u.depth<=this.depth)return;const d=new Ih(u,this.editor,s,s||l?n:null);s&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===t)if(Object.keys(n).length>0){const i=s.node.attrs,l=Object.keys(n);for(let c=0;c<l.length;c+=1){const u=l[c];if(i[u]!==n[u])break}}else r=s;s=s.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(l=>{r&&s.length>0||(l.node.type.name===t&&i.every(c=>n[c]===l.node.attrs[c])&&s.push(l),!(r&&s.length>0)&&(s=s.concat(l.querySelectorAll(t,n,r))))}),s}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}};const o0e=`.ProseMirror {
370
- position: relative;
371
- }
372
-
373
- .ProseMirror {
374
- word-wrap: break-word;
375
- white-space: pre-wrap;
376
- white-space: break-spaces;
377
- -webkit-font-variant-ligatures: none;
378
- font-variant-ligatures: none;
379
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
380
- }
381
-
382
- .ProseMirror [contenteditable="false"] {
383
- white-space: normal;
384
- }
385
-
386
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
387
- white-space: pre-wrap;
388
- }
389
-
390
- .ProseMirror pre {
391
- white-space: pre-wrap;
392
- }
393
-
394
- img.ProseMirror-separator {
395
- display: inline !important;
396
- border: none !important;
397
- margin: 0 !important;
398
- width: 0 !important;
399
- height: 0 !important;
400
- }
401
-
402
- .ProseMirror-gapcursor {
403
- display: none;
404
- pointer-events: none;
405
- position: absolute;
406
- margin: 0;
407
- }
408
-
409
- .ProseMirror-gapcursor:after {
410
- content: "";
411
- display: block;
412
- position: absolute;
413
- top: -2px;
414
- width: 20px;
415
- border-top: 1px solid black;
416
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
417
- }
418
-
419
- @keyframes ProseMirror-cursor-blink {
420
- to {
421
- visibility: hidden;
422
- }
423
- }
424
-
425
- .ProseMirror-hideselection *::selection {
426
- background: transparent;
427
- }
428
-
429
- .ProseMirror-hideselection *::-moz-selection {
430
- background: transparent;
431
- }
432
-
433
- .ProseMirror-hideselection * {
434
- caret-color: transparent;
435
- }
436
-
437
- .ProseMirror-focused .ProseMirror-gapcursor {
438
- display: block;
439
- }`;var Obe=class extends gge{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Vme,createMappablePosition:Ume},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const n=uE(t,this.options.autofocus);this.editorState=$o.create({doc:t,schema:this.schema,selection:n||void 0})}s0e(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Nf.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Nf.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Mge(o0e,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=dE(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(l=>!l.key.startsWith(i))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[Qge,Kge.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),Yge,Jge,e0e,n0e.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),Xge,t0e,Wge,r0e.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new $x(n,this)}createCommandManager(){this.commandManager=new Nf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=fE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const n=fE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=$o.create({doc:n,schema:this.schema,selection:uE(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;const t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return dE(t)?n=>({role:"textbox",...t(n)}):{role:"textbox",...t}}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,l=this.extensionManager.transformPastedHTML(i);this.editorView=new H6(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:s,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var h;return(h=this.capturedTransaction)===null||h===void 0?void 0:h.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),s=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!s)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),c=l==null?void 0:l.getMeta("focus"),u=l==null?void 0:l.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),u&&this.emit("blur",{editor:this,event:u.event,transaction:l}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||i.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return zme(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return $me(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return q2(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
440
-
441
- `,textSerializers:n={}}=e||{};return Lme(this.state.doc,{blockSeparator:t,textSerializers:{...sH(this.schema),...n}})}get isEmpty(){return K2(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new i0e(t,this,!1,n)}get $doc(){return this.$pos(0)}};function kbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=t,l=r[r.length-1],c=r[0];if(l){const u=c.search(/\S/),d=n.from+c.indexOf(l),h=d+l.length;if(oH(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(y=>y===e.type&&y!==g.mark.type)).filter(g=>g.to>d).length)return null;h<n.to&&i.delete(h,n.to),d>n.from&&i.delete(n.from+u,d);const m=n.from+u+l.length;i.addMark(n.from+u,m,e.type.create(s||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function Mbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r)||{},{tr:i}=t,l=n.from;let c=n.to;const u=e.type.create(s);if(r[1]){let d=l+r[0].lastIndexOf(r[1]);d>c?d=c:c=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,l+r[0].length-1),i.replaceWith(d,c,u)}else if(r[0]){const d=e.type.isInline?l:l-1;i.insert(d,e.type.create(s)).delete(i.mapping.map(l),i.mapping.map(c))}i.scrollIntoView()},undoable:e.undoable})}function Abe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),i=Gt(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function _be(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const i=Gt(e.getAttributes,void 0,r)||{},l=t.tr.delete(n.from,n.to),c=l.doc.resolve(n.from).blockRange(),u=c&&R2(c,e.type,i);if(!u)return null;if(l.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:g}=e.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(w=>g.includes(w.type.name));l.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const d=l.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Ia(l.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&l.join(n.from-1)},undoable:e.undoable})}var l0e=class yH extends Y2{constructor(...t){super(...t),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new yH(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Dbe(e){return new $ge({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const i=Gt(e.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:l}=t,c=r[r.length-1],u=r[0];let d=n.to;if(c){const h=u.search(/\S/),m=n.from+u.indexOf(c),g=m+c.length;if(oH(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(b=>b===e.type&&b!==y.mark.type)).filter(y=>y.to>m).length)return null;g<n.to&&l.delete(g,n.to),m>n.from&&l.delete(n.from+h,m),d=n.from+h+c.length,l.addMark(n.from+h,d,e.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||l.removeStoredMark(e.type)}}})}const h0="codeLink",b1="data-code-link",TI="data-code",a0e=/^\[(`?)([^\]`\n]+)\1\]\(code:([^)\s]+)\)/,c0e=/\[[^\]\n]*\]\(code:/,u0e="rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[0.875em] data-code:font-mono",f0e=/^[^\]`\n]+$/,d0e=/^[^)\s]+$/,h0e="#",p0e=({lineStart:e,lineEnd:t})=>e===t?`L${String(e)}`:`L${String(e)}-${String(t)}`,m0e=({path:e,range:t,label:n,isCode:r})=>{const s=n.trim();return f0e.test(s)&&d0e.test(e)?{linkId:`${e}${h0e}${p0e(t)}`,label:s,isCode:r}:null},RI=e=>typeof e=="string"?e:"",v1=e=>({linkId:RI(e==null?void 0:e.linkId),label:RI(e==null?void 0:e.label),isCode:(e==null?void 0:e.isCode)===!0}),g0e=({linkId:e,label:t,isCode:n})=>`[${n?`\`${t}\``:t}](code:${e})`,y0e=e=>{const t=a0e.exec(e);return t===null?null:{raw:t[0],isCode:t[1]!=="",label:t[2],linkId:t[3]}},Ibe=l0e.create({name:h0,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes:()=>({linkId:{default:""},label:{default:""},isCode:{default:!1}}),parseHTML:()=>[{tag:`span[${b1}]`,getAttrs:e=>({linkId:e.getAttribute(b1)??"",label:e.textContent,isCode:e.hasAttribute(TI)})}],renderHTML:({node:e})=>{const{linkId:t,label:n,isCode:r}=v1(e.attrs);return["span",{[b1]:t,...r?{[TI]:""}:{},class:u0e,title:t},n]},markdownTokenizer:{name:h0,level:"inline",start:e=>e.search(c0e),tokenize:e=>{const t=y0e(e);return t===null?void 0:{type:h0,...t}}},parseMarkdown:e=>({type:h0,attrs:v1(e)}),renderMarkdown:e=>g0e(v1(e.attrs))}),x0e="Link to code",b0e="Pick a file of the Flight Plan, select the lines the link points at, and name the link.",v0e="File",S0e="Search the files of the Flight Plan",w0e="Link these lines",E0e="Select the lines in the code: click a line number, then another with Shift.",C0e="Label",N0e="Show the label as code",T0e="Write a label without a backtick or a closing square bracket.",vh=({reviewKey:e,selectedText:t,onInsert:n,onClose:r})=>{const s=O.useId(),i=w2(e,"flight-plan"),[l,c]=O.useState(null),[u,d]=O.useState(null),[h,m]=O.useState(t),[g,y]=O.useState(!1),b=S2(e,l),w=l===null||u===null?null:m0e({path:l,range:u,label:h,isCode:g}),E=l!==null&&u!==null&&h.trim()!==""&&w===null,C=T=>{c(T),d(null),i.onQueryChange(T)};return x.jsx(cu,{open:!0,onOpenChange:T=>{T||r()},children:x.jsxs(uu,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:x0e}),x.jsx(fu,{children:b0e})]}),x.jsx(C2,{label:v0e,hint:null,placeholder:S0e,query:i.query,files:i.files,message:i.message,errorMessage:i.errorMessage,onQueryChange:i.onQueryChange,onSelect:C}),l===null?x.jsx("span",{}):x.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[x.jsx(E2,{path:l,lines:b.lines,statusMessage:b.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:w0e,focusOn:u,className:"flex-1",onHighlightCode:d}),x.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:u===null?E0e:bp(u)})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("label",{htmlFor:s,className:"text-sm font-bold",children:C0e}),x.jsx(Mx,{id:s,value:h,"aria-invalid":E,onChange:T=>{m(T.target.value)}}),E?x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T0e}):null,x.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:g,className:"size-4 accent-(--primary)",onChange:T=>{y(T.target.checked)}}),N0e]})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:"Cancel"}),x.jsx(nt,{type:"button",disabled:w===null,onClick:()=>{w!==null&&n(w)},children:"Insert"})]})]})})},R0e=({choice:e,isPending:t,onComplete:n,onClose:r})=>{const s=O.useId(),[i,l]=O.useState(e.selectedId);return x.jsx(cu,{open:!0,onOpenChange:c=>{c||r()},children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e.title}),x.jsx(fu,{children:e.description})]}),e.emptyMessage===null?x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e.title}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:e.options.map(c=>x.jsxs("li",{className:"border-b border-border py-3",children:[x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:s,checked:i===c.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{l(c.id)}}),x.jsx("span",{className:"min-w-0 font-bold",children:c.label})]}),x.jsx("span",{className:"block pl-7 text-sm text-muted-foreground",children:c.detail})]},c.id))})]}):x.jsx("p",{className:"text-muted-foreground",children:e.emptyMessage}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:e.cancelLabel}),x.jsx(nt,{type:"button",variant:"outline",disabled:t,onClick:()=>{n(null)},children:e.skipLabel}),e.emptyMessage===null?x.jsx(nt,{type:"button",disabled:t||i===null,onClick:()=>{n(i)},children:e.confirmLabel}):null]})]})})},O0e=({anchorId:e,heading:t,action:n=null,children:r})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) pt-6 pb-8",children:[x.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[x.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),n]}),r]}),k0e=O.lazy(async()=>await $t(()=>import("./index-PzkXPYSX.js"),__vite__mapDeps([23,24]))),M0e="Loading the editor…",A0e=({anchorId:e,heading:t,context:n,markdown:r,isDraft:s,unwrittenLabel:i,codeLinks:l,editing:c,renderCodeLinkDialog:u,onOpenCodeLink:d})=>{const h=(c==null?void 0:c.isWriting)===!0;return x.jsxs(O0e,{anchorId:e,heading:t,action:c===null||h?null:x.jsx(nt,{variant:"link",size:"sm",onClick:c.onEdit,children:"Edit"}),children:[c!==null&&h?x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:M0e}),children:x.jsx(k0e,{label:t,markdown:r,isSaving:c.isSaving,errorMessage:c.errorMessage,renderCodeLinkDialog:u,onSave:c.onSave,onCancel:c.onCancel})}):null,!h&&s?x.jsx(so,{isPending:!0,lineCount:4,className:"max-w-[44rem] text-base",children:x.jsx("p",{className:"text-muted-foreground",children:i})}):null,!h&&!s?x.jsx(Hs,{blocks:n,codeLinks:l,onOpenCodeLink:d}):null]})},_0e=({anchorId:e,heading:t,emptyMessage:n,entries:r,placeholder:s,submitLabel:i,isSubmitting:l,renderEditor:c,onComment:u})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsx("h2",{id:`${e}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),x.jsxs("div",{className:"flex max-w-[52rem] flex-col",children:[n===null?null:x.jsx("p",{className:"pb-4 text-muted-foreground",children:n}),r.map(d=>x.jsx(H4,{comment:d,verdictLabel:d.verdictLabel,locationLabel:d.locationLabel,className:"border-t py-3 first:border-t-0 first:pt-0"},d.id)),x.jsx(VC,{label:s,submitLabel:i,cancelLabel:null,isSubmitting:l,className:"border-t pt-4",renderEditor:c,onSubmit:u})]})]}),D0e=({label:e,options:t,value:n,className:r,onChange:s})=>{const i=O.useId();return x.jsxs("fieldset",{className:Ne("grid gap-1.5",r),children:[x.jsx("legend",{className:"float-left text-sm font-bold",children:e}),x.jsx("span",{className:"clear-left inline-flex w-fit overflow-hidden rounded-lg border border-input bg-card",children:t.map(l=>x.jsxs("label",{className:"flex h-[calc(2rem-2px)] cursor-pointer items-center border-l border-input px-3 text-sm transition-colors duration-[180ms] ease-out first:border-l-0 hover:bg-muted has-checked:bg-foreground has-checked:font-bold has-checked:text-background has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring",children:[x.jsx("input",{type:"radio",name:i,className:"sr-only",checked:n===l.value,onChange:()=>{s(l.value)}}),x.jsx("span",{className:"text-box-cap",children:l.label})]},l.value))})]})},I0e="flex w-full max-w-xl items-center gap-3 rounded-lg border border-input bg-card px-3 py-2 text-left transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-expanded:bg-muted",OI=({option:e})=>x.jsxs("span",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-bold",children:e.label}),e.tagLabel===null?null:x.jsx("span",{className:"text-sm text-muted-foreground",children:e.tagLabel})]}),kI=({label:e,dialogTitle:t,dialogDescription:n,chooseLabel:r,cancelLabel:s,options:i,selectedKey:l,describedBy:c,onChoose:u})=>{const d=O.useId(),[h,m]=O.useState(!1),[g,y]=O.useState(l),b=i.find(C=>C.key===l),w=()=>{y(l),m(!0)},E=()=>{u(g),m(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-label":`${e}: ${(b==null?void 0:b.label)??""}`,"aria-describedby":c,className:I0e,onClick:w,children:[x.jsx("span",{className:"min-w-0 flex-1",children:b===void 0?null:x.jsxs(x.Fragment,{children:[x.jsx(OI,{option:b}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:b.summary})]})}),x.jsx(kC,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]}),x.jsx(cu,{open:h,onOpenChange:m,children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t}),x.jsx(fu,{children:n})]}),x.jsxs("form",{action:E,className:"grid gap-4",children:[x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:i.map(C=>x.jsx("li",{className:"border-b border-border py-3",children:x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:d,checked:g===C.key,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{y(C.key)}}),x.jsxs("span",{className:"min-w-0",children:[x.jsx(OI,{option:C}),x.jsx("span",{className:"block text-sm",children:C.summary}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.description}),C.note===null?null:x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.note})]})]})},C.key))})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:()=>{m(!1)},children:s}),x.jsx(nt,{type:"submit",children:r})]})]})]})})]})},MI="manual",j0e=["writer","model","effort"],S1="border-t border-border pt-6 pb-5",w1="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",E1="max-w-[62ch] pb-3 text-sm text-muted-foreground",xH="border-b border-border py-3 last:border-b-0",L0e="size-4 shrink-0 accent-(--primary)",bH="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",vH=`${L0e} row-span-2 mt-1`,pE="col-start-2 max-w-[62ch] text-sm text-muted-foreground",P0e="min-h-20 w-full max-w-xl resize-y rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",z0e=({option:e,groupName:t,isChosen:n,model:r,effort:s,onChoose:i,onModelChange:l,onEffortChange:c})=>{const u=e.unavailableReason===null,d=e.modelOptions.find(m=>m.model===r),h=(d==null?void 0:d.hasEffortChoice)===!0;return x.jsxs("li",{className:xH,children:[x.jsxs("label",{className:Ne(bH,u?"":"cursor-default"),children:[x.jsx("input",{type:"radio",name:t,checked:n,disabled:!u,className:vH,onChange:i}),x.jsx("span",{className:"font-bold",children:e.label}),e.unavailableReason===null?x.jsx("span",{className:pE,children:e.description}):x.jsxs("span",{className:pE,children:[x.jsx("span",{className:"font-bold text-foreground",children:"Unavailable."}),` ${e.unavailableReason}`]})]}),n&&(e.hasModelChoice||h)?x.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-x-6 gap-y-3 pl-7",children:[e.hasModelChoice?x.jsx(x4,{label:e.modelLegend,options:e.modelOptions.map(m=>({value:m.model,label:m.label})),value:r,className:"w-60",onChange:m=>{const g=e.modelOptions.find(y=>y.model===m);g!==void 0&&l(g)}}):null,d!==void 0&&h?x.jsx(D0e,{label:e.effortLegend,options:d.effortOptions.map(m=>({value:m.effort,label:m.label})),value:s,onChange:c}):null]}):null]})},W2=({form:e,problem:t,errorMessage:n,isPending:r,dataNotice:s,className:i,onSubmit:l})=>{var L;const c=O.useId(),u=O.useId(),d=O.useId(),h=O.useId(),m=O.useId(),g=O.useId(),y=O.useId(),[b,w]=O.useState(e.configuration.selectedPreset),[E,C]=O.useState(e.order.selectedOrder),[T,N]=O.useState(e.order.customOrder),[R,M]=O.useState(e.writer.selectedKey),[D,k]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedModel]))),[I,_]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedEffort]))),P=e.writer.agents.find($=>$.agent===R),H=e.order.options.find($=>$.order===E),z=((L=e.configuration.options.find($=>$.preset===b))==null?void 0:L.rewriteNotice)??null,U=(t==null?void 0:t.field)==="customOrder"?t.message:null,j=t!==null&&j0e.includes(t.field)?t.message:null,B=()=>{l({preset:b,order:E,customOrder:T,writer:P===void 0?{kind:"manual"}:{kind:"agent",agent:P.agent,model:D[P.agent]??P.selectedModel,effort:I[P.agent]??P.selectedEffort}})};return x.jsxs("form",{action:B,className:i,children:[x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":c,children:[x.jsx("h3",{id:c,className:w1,children:e.configuration.heading}),x.jsx("p",{id:u,className:E1,children:e.configuration.hint}),x.jsx(kI,{label:e.configuration.heading,dialogTitle:e.configuration.dialogTitle,dialogDescription:e.configuration.dialogDescription,chooseLabel:e.configuration.chooseLabel,cancelLabel:e.configuration.cancelLabel,options:e.configuration.options.map($=>({key:$.preset,label:$.label,tagLabel:$.tagLabel,summary:$.bestFor,description:$.description,note:$.note})),selectedKey:b,describedBy:u,onChoose:$=>{const q=e.configuration.options.find(G=>G.preset===$);q!==void 0&&w(q.preset)}}),z===null?null:x.jsx("p",{role:"status",className:"max-w-[62ch] pt-3 text-sm font-bold text-foreground",children:z})]}),x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":d,children:[x.jsx("h3",{id:d,className:w1,children:e.order.heading}),x.jsx("p",{id:h,className:E1,children:e.order.hint}),x.jsx(kI,{label:e.order.heading,dialogTitle:e.order.dialogTitle,dialogDescription:e.order.dialogDescription,chooseLabel:e.order.chooseLabel,cancelLabel:e.order.cancelLabel,options:e.order.options.map($=>({key:$.order,label:$.label,tagLabel:$.tagLabel,summary:$.summary,description:$.description,note:null})),selectedKey:E,describedBy:h,onChoose:$=>{const q=e.order.options.find(G=>G.order===$);q!==void 0&&C(q.order)}}),(H==null?void 0:H.promptField)==null?null:x.jsxs("div",{className:"mt-4 grid max-w-xl gap-1.5",children:[x.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:H.promptField.label}),x.jsx("textarea",{id:m,value:T,placeholder:H.promptField.placeholder,"aria-invalid":U!==null,"aria-describedby":U===null?void 0:g,className:P0e,onChange:$=>{N($.target.value)}}),U===null?null:x.jsx("p",{id:g,role:"alert",className:"text-sm text-destructive",children:U})]})]}),x.jsxs("fieldset",{className:S1,children:[x.jsx("legend",{className:`${w1} float-left w-full`,children:e.writer.heading}),x.jsx("p",{className:`${E1} clear-left`,children:e.writer.hint}),x.jsxs("ul",{className:"border-t border-border",children:[e.writer.agents.map($=>x.jsx(z0e,{option:$,groupName:y,isChosen:R===$.agent,model:D[$.agent]??$.selectedModel,onChoose:()=>{M($.agent)},effort:I[$.agent]??$.selectedEffort,onModelChange:q=>{k(G=>({...G,[$.agent]:q.model})),_(G=>({...G,[$.agent]:q.selectedEffort}))},onEffortChange:q=>{_(G=>({...G,[$.agent]:q}))}},$.agent)),x.jsx("li",{className:xH,children:x.jsxs("label",{className:bH,children:[x.jsx("input",{type:"radio",name:y,checked:R===MI,className:vH,onChange:()=>{M(MI)}}),x.jsx("span",{className:"font-bold",children:e.writer.manual.label}),x.jsx("span",{className:pE,children:e.writer.manual.description})]})})]}),j===null?null:x.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:j})]}),x.jsxs("footer",{className:"border-t border-border pt-4",children:[n===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:n}),x.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[s===null?null:x.jsx("p",{className:"flex-1 text-sm text-muted-foreground",children:s}),x.jsx(nt,{type:"submit",disabled:r,children:r?e.pendingLabel:(P==null?void 0:P.submitLabel)??e.writer.manual.submitLabel})]})]})]})},B0e="target",H0e="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",F0e="border-b border-border py-3 last:border-b-0",$0e="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",V0e="row-span-2 mt-1 size-4 shrink-0 accent-(--primary)",U0e="col-start-2 max-w-[62ch] text-sm text-muted-foreground",q0e=({creationForm:e,targetSearch:t,problem:n,errorMessage:r,isPending:s,onTargetQueryChange:i,onTargetSelect:l,onSubmit:c})=>{var b;const u=O.useId(),[d,h]=O.useState(e.initialization.selectedKind),m=((b=e.initialization.options.find(w=>w.kind===d))==null?void 0:b.authorWriting)??null,g=(n==null?void 0:n.field)===B0e?n.message:null,y=()=>{m!==null&&c({preset:e.form.configuration.selectedPreset,order:e.form.order.selectedOrder,customOrder:e.form.order.customOrder,writer:{kind:"author",start:m.start}})};return x.jsxs("div",{className:"grid max-w-208 gap-4",children:[x.jsx(uB,{label:e.target.label,hint:e.target.hint,placeholder:e.target.placeholder,value:t.value,suggestions:t.options,message:t.message,errorMessage:g,className:"max-w-xl",onValueChange:i,onSelect:l}),x.jsxs("fieldset",{className:"pt-2",children:[x.jsx("legend",{className:`${H0e} float-left w-full pb-2`,children:e.initialization.legend}),x.jsx("ul",{className:"clear-left border-t border-border",children:e.initialization.options.map(w=>x.jsx("li",{className:F0e,children:x.jsxs("label",{className:$0e,children:[x.jsx("input",{type:"radio",name:u,checked:d===w.kind,className:V0e,onChange:()=>{h(w.kind)}}),x.jsx("span",{className:"font-bold",children:w.label}),x.jsx("span",{className:U0e,children:w.description})]})},w.kind))})]}),m===null?x.jsx(W2,{form:e.form,problem:g===null?n:null,errorMessage:r,isPending:s,dataNotice:null,onSubmit:c}):x.jsxs("form",{action:y,className:"border-t border-border pt-4",children:[r===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:r}),x.jsx("div",{className:"flex justify-end",children:x.jsx(nt,{type:"submit",disabled:s,children:s?e.pendingLabel:m.submitLabel})})]})]})},G0e="Searching…",AI="",K0e="",Y0e="author",W0e=(e,t)=>{var g,y,b,w,E;const n=ii(),r=jp(),s=Ri(),[i,l]=O.useState(null),c=O.useDeferredValue(i??AI),{data:u}=fj(n.review.creationForm.queryOptions({repositoryName:e,targetId:t})),d=Zc({...n.review.searchTargets.queryOptions({repositoryName:e,query:c}),placeholderData:SE}),h=i===null?u.target.selected:null,m=Nn(n.review.request.mutationOptions({onSuccess:async C=>{C.kind==="requested"&&(C.prompt!==null&&await navigator.clipboard.writeText(C.prompt).catch(()=>{}),await s.invalidateQueries(n.review.get.pathFilter()))}}));return{creationForm:u,targetSearch:{value:i??(h==null?void 0:h.label)??AI,options:((g=d.data)==null?void 0:g.options)??[],message:((y=d.data)==null?void 0:y.message)??(d.isPending?G0e:null)},problem:((b=m.data)==null?void 0:b.kind)==="rejected"?m.data:null,errorMessage:((w=m.data)==null?void 0:w.kind)==="unavailable"?m.data.message:((E=m.error)==null?void 0:E.message)??null,isPending:m.isPending,onTargetQueryChange:l,onTargetSelect:C=>{m.reset(),l(null),r({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e,branchId:C}})},onSubmit:C=>{C.writer.kind!==Y0e&&Q1(),m.mutate({repositoryName:e,targetId:(h==null?void 0:h.id)??K0e,...C})}}},X0e=({repositoryName:e,targetId:t})=>{const n=W0e(e,t);return x.jsx("div",{className:"pt-8",children:x.jsx(q0e,{creationForm:n.creationForm,targetSearch:n.targetSearch,problem:n.problem,errorMessage:n.errorMessage,isPending:n.isPending,onTargetQueryChange:n.onTargetQueryChange,onTargetSelect:n.onTargetSelect,onSubmit:n.onSubmit})})},Q0e=({isOpen:e,rebuildForm:t,loadingLabel:n,problem:r,errorMessage:s,isPending:i,onSubmit:l,onClose:c})=>x.jsx(cu,{open:e,onOpenChange:u=>{u||c()},children:x.jsx(uu,{className:"max-h-[calc(100dvh-4rem)] overflow-y-auto sm:max-w-3xl",children:t===null?x.jsxs(Oa,{children:[x.jsx(ka,{children:n}),s===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}):x.jsxs(x.Fragment,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t.title}),x.jsx(fu,{className:"max-w-[62ch]",children:t.description})]}),x.jsx(W2,{form:t.form,problem:r,errorMessage:s,isPending:i,dataNotice:null,onSubmit:l})]})})}),Z0e={},J0e=()=>{},C1="flex flex-wrap items-center gap-x-3 gap-y-1 border-b py-2.5 text-sm",eye=({staleNotice:e,unassignedFiles:t,progress:n,onShowUnassignedFiles:r,onCopyPrompt:s})=>x.jsxs("div",{children:[e===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text [&_code]:bg-transparent [&_code]:px-0",children:x.jsx(Gf,{inlines:e.message,codeLinks:Z0e,onOpenCodeLink:J0e})}),x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{s(e.prompt,e.copiedMessage)},children:e.promptLabel})]}),t===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text",children:t.message}),x.jsx(nt,{variant:"outline",size:"sm",onClick:r,children:t.actionLabel})]}),n===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:n.isWriting?"awaiting-review":"stale",tone:n.isWriting?"status":"signal",className:n.isWriting?"motion-safe:animate-pulse":""}),x.jsx("p",{className:"font-bold text-signal-text",children:n.label}),x.jsx("progress",{"aria-label":n.countLabel,value:n.writtenCount,max:n.totalCount,className:"h-1.5 w-40 appearance-none overflow-hidden rounded-[0.225rem] bg-muted [&::-moz-progress-bar]:bg-signal [&::-webkit-progress-bar]:bg-muted [&::-webkit-progress-value]:bg-signal [&::-webkit-progress-value]:transition-[width] [&::-webkit-progress-value]:duration-300"}),x.jsx("p",{className:"text-foreground tabular-nums",children:n.countLabel}),x.jsx("p",{className:"text-muted-foreground",children:n.message}),n.prompt===null?null:x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{n.prompt!==null&&s(n.prompt.text,n.prompt.copiedMessage)},children:n.prompt.label})]})]}),tye="Label",nye="Files",rye="No files yet.",sye="Add a file",iye="Search the changed files",oye="Close",lye="Delete",SH=({reviewKey:e,legend:t,label:n,paths:r,isSaving:s,isDeleting:i,errorMessage:l,onSave:c,onDelete:u,onClose:d})=>{const h=O.useId(),m=O.useId(),g=w2(e,"changed"),[y,b]=O.useState(n),[w,E]=O.useState(r),C=T=>{E(N=>N.includes(T)?N:[...N,T]),g.onQueryChange("")};return x.jsxs("form",{"aria-label":t,action:()=>{c({title:y,paths:w})},className:"relative mt-6 grid max-w-[44rem] gap-4 rounded-lg border border-foreground p-4",children:[x.jsx(un,{icon:"close",label:oye,className:"absolute top-2 right-2",onClick:d}),x.jsxs("div",{className:"grid gap-1.5 pr-8",children:[x.jsx("label",{htmlFor:h,className:"text-sm font-bold",children:tye}),x.jsx(Mx,{id:h,value:y,onChange:T=>{b(T.target.value)}})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("p",{id:m,className:"text-sm font-bold",children:nye}),w.length===0?x.jsx("p",{className:"text-sm text-muted-foreground",children:rye}):x.jsx("ul",{"aria-labelledby":m,className:"grid gap-0.5",children:w.map(T=>x.jsxs("li",{className:"flex items-center justify-between gap-2",children:[x.jsx("span",{className:"min-w-0 truncate font-mono text-[0.8rem]",title:T,children:T}),x.jsx(un,{icon:"close",label:`Remove ${T}`,onClick:()=>{E(N=>N.filter(R=>R!==T))}})]},T))})]}),x.jsx(C2,{label:sye,hint:null,placeholder:iye,query:g.query,files:g.files,message:g.message,errorMessage:g.errorMessage,onQueryChange:g.onQueryChange,onSelect:C}),l===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}),x.jsxs("div",{className:"flex justify-end gap-2",children:[u===null?null:x.jsx(nt,{type:"button",variant:"destructive",disabled:i,onClick:u,children:lye}),x.jsx(nt,{type:"submit",disabled:s,children:s?"Saving…":"Save"})]})]})},aye=({heading:e,detailLabel:t,children:n=null})=>x.jsxs("div",{className:"flex items-baseline gap-3 pt-6",children:[x.jsx("h2",{className:"text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",children:e}),n,t===null?null:x.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:t})]}),cye="text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",uye="text-sm text-muted-foreground tabular-nums",fye="Edit segment",dye=({reviewKey:e,heading:t,isTitleDraft:n,detailLabel:r,outline:s,authoring:i})=>i===null?t===null?null:x.jsx(aye,{heading:t,detailLabel:r,children:x.jsx(so,{isPending:n,className:"w-64 self-center text-[1.75rem]",children:null})}):i.writing.isWriting?x.jsx(SH,{reviewKey:e,legend:s.heading,label:s.label,paths:s.paths,isSaving:i.writing.isSaving,isDeleting:i.isPending,errorMessage:i.writing.errorMessage,onSave:i.writing.onSave,onDelete:i.onRemove,onClose:i.writing.onCancel}):x.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[x.jsx("h2",{className:cye,children:s.heading}),x.jsx("p",{className:uye,children:s.detailLabel}),x.jsx(nt,{variant:"link",size:"sm",onClick:i.writing.onEdit,children:fye})]}),hye=({selection:e,onComment:t,onAsk:n})=>e===null||e.commentRange===null&&n===null?null:x.jsxs("div",{role:"toolbar","aria-label":"Selected code",className:"fixed z-50 flex -translate-y-full gap-0.5 rounded-lg border border-foreground bg-popover p-1 duration-150 animate-in fade-in-0",style:{left:e.left,top:e.top},onMouseDown:r=>{r.preventDefault()},children:[e.commentRange===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{e.commentRange!==null&&t(e.path,e.commentRange)},children:"Add comment"}),n===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{n(e)},children:"Ask the agent"})]}),pye=({heading:e,message:t,children:n})=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] pt-10",children:[x.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[x.jsx("span",{className:"h-9 w-1 bg-(--line)"}),x.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),x.jsxs("div",{className:"pt-5",children:[x.jsx("h2",{className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:e}),x.jsx("p",{className:"max-w-[62ch] text-muted-foreground",children:t}),n]})]}),mye=({heading:e,message:t,...n})=>x.jsxs("div",{className:"max-w-208",children:[x.jsx(pye,{heading:e,message:t}),x.jsx(W2,{...n,className:"pt-6 pl-10"})]}),gye="Close",yye="Cancel",xye=({title:e,description:t,paths:n,confirmation:r,onClose:s})=>x.jsx(cu,{open:!0,onOpenChange:i=>{i||s()},children:x.jsxs(uu,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e}),x.jsx(fu,{children:(r==null?void 0:r.warning)??t})]}),x.jsx("ul",{"aria-label":e,className:"grid max-h-80 gap-1 overflow-y-auto",children:n.map(i=>x.jsx("li",{className:"font-mono text-[0.8rem] break-all",children:i},i))}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:s,children:r===null?gye:yye}),r===null?null:x.jsx(nt,{type:"button",onClick:r.onConfirm,children:r.confirmLabel})]})]})}),bye=O.lazy(async()=>await $t(()=>import("./index-DCCyA67N.js"),__vite__mapDeps([25,24]))),vye="Loading the editor…",Sye="Remove the file from the walkthrough",_I="Edit the waypoint",wye="Remove the waypoint",Eye="my-1.5 mr-4 ml-18 rounded-md border border-foreground bg-background p-4 font-sans whitespace-normal",Cye=e=>e.rows.flatMap(t=>t.kind==="waypoint"?[t.waypoint]:[]),Nye=e=>e.lines===null?[]:[{id:e.id,title:e.title,attentionLabel:e.attentionLabel,...e.lines}],Tye=({reviewKey:e,segmentId:t,file:n,openWaypointIds:r,currentWaypointId:s,isPending:i,codeLinks:l,renderCodeLinkDialog:c,onOpenCodeLink:u,onToggleWaypoint:d,onRemove:h,onRemoveWaypoint:m})=>{var R;const[g,y]=O.useState(null),b=S2(e,n.path),w=Cye(n),E=new Set((R=b.lines)==null?void 0:R.map(M=>M.numberLabel)),C=M=>M.lines!==null&&E.has(String(M.lines.lineEnd)),T=()=>{y(null)},N=M=>M.id===g?x.jsx("div",{id:M.anchorId,className:Eye,children:x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:vye}),children:x.jsx(bye,{reviewKey:e,segmentId:t,waypointId:M.id,legend:`${_I}: ${M.title}`,text:M.text,renderCodeLinkDialog:c,onClose:T})})}):x.jsx(UC,{waypoint:M,isOpen:r.has(M.id),isCurrent:M.id===s,isReviewPending:!1,codeLinks:l,actions:x.jsxs(x.Fragment,{children:[x.jsx(un,{icon:"edit",label:`${_I}: ${M.title}`,onClick:()=>{y(M.id)}}),x.jsx(un,{icon:"delete",label:`${wye}: ${M.title}`,isDisabled:i,onClick:()=>{m(M.id)}})]}),onOpenCodeLink:u,onToggle:()=>{d(M.id)},onReviewedChange:null});return x.jsxs("article",{id:n.anchorId,"aria-label":n.title,className:"scroll-mt-(--waypoint-scroll-margin) pt-6",children:[n.summary.length===0?null:x.jsx("ul",{className:"flex list-disc flex-col gap-2 pb-4 pl-5",children:hd(n.summary).map(({key:M,item:D})=>x.jsx("li",{children:x.jsx(Hs,{blocks:D,codeLinks:l,onOpenCodeLink:u})},M))}),x.jsxs("div",{className:"flex items-center gap-3 pb-2",children:[x.jsx("h3",{className:"min-w-0 truncate text-[0.9375rem] leading-5 font-semibold",children:n.title}),x.jsx("p",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.waypointCountLabel}),x.jsx("span",{className:"flex-1"}),x.jsx(un,{icon:"remove",label:`${Sye}: ${n.path}`,isDisabled:i,onClick:h})]}),b.lines===null?null:x.jsx("div",{className:"bg-code empty:hidden",children:w.filter(M=>!C(M)).map(M=>x.jsx("div",{children:N(M)},M.id))}),x.jsx(E2,{path:n.path,lines:b.lines,statusMessage:b.statusMessage,waypoints:w.flatMap(Nye),waypointOptions:"always-on",highlightButtonLabel:null,focusOn:null,renderWaypoint:({id:M})=>w.filter(D=>D.id===M).map(N),onHighlightCode:null})]})},Rye=(e,t)=>{var w,E;const n=ii(),r=Ri(),[s,i]=O.useState(!1),[l,c]=O.useState(null),u=bG(n.conversation.watch.subscriptionOptions(e,{enabled:s})),d=Zc({...n.conversation.modelChoice.queryOptions(e),enabled:s}),h=C=>{t(C.message)},m=Nn(n.conversation.sendMessage.mutationOptions({onSuccess:C=>{C.kind==="sent"&&c(null)},onError:h})),g=Nn(n.conversation.answerQuestions.mutationOptions({onError:h})),y=Nn(n.conversation.chooseModel.mutationOptions({onSuccess:async C=>{C.kind==="rejected"&&t(C.message),await r.invalidateQueries(n.conversation.modelChoice.pathFilter())},onError:h})),b=((w=g.data)==null?void 0:w.kind)==="rejected"&&g.variables!==void 0?{batchId:g.variables.batchId,message:g.data.message}:null;return{isOpen:s,reference:l,conversation:u.data,modelChoice:d.data??null,isSending:m.isPending,sendProblem:((E=m.data)==null?void 0:E.kind)==="rejected"?m.data.message:null,answering:{pendingBatchId:g.isPending?g.variables.batchId:null,rejection:b},onToggle:()=>{i(C=>!C)},onClose:()=>{i(!1)},onAsk:C=>{c(C),i(!0)},onClearReference:()=>{c(null)},onSend:C=>{m.mutate({...e,body:C,reference:l})},onAnswer:(C,T)=>{g.mutate({...e,batchId:C,answers:T.map(N=>({...N,pickedLabels:[...N.pickedLabels]}))})},onChooseModel:C=>{y.mutate({...e,model:C})}}},Oye="[data-line]",kye="[data-path]",Mye=6,mE=10,DI=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(Oye))??null},II=e=>Number.parseInt(e.dataset.line??"",mE),jI=e=>{const{commentSide:t,commentLine:n}=e.dataset;return(t==="old"||t==="new")&&n!==void 0?{side:t,lineLabel:n}:null},Aye=(e,t)=>{if(t===null)return null;const n=Number.parseInt(t.lineLabel,mE),r=(e==null?void 0:e.side)===t.side?Number.parseInt(e.lineLabel,mE):n;return{side:t.side,startLineLabel:String(Math.min(r,n)),lineLabel:String(Math.max(r,n))}},LI=()=>{const e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0)return null;const t=DI(e.anchorNode),n=DI(e.focusNode),r=(t==null?void 0:t.closest(kye))??null,s=r==null?void 0:r.dataset.path;if(t===null||n===null||r===null||s===void 0||!r.contains(n))return null;const i=II(t),l=II(n);if(Number.isNaN(i)||Number.isNaN(l))return null;const c=e.getRangeAt(0).getBoundingClientRect();return{path:s,lineStart:i,lineEnd:l,commentRange:Aye(jI(t),jI(n)),left:c.left,top:c.top-Mye}},_ye=()=>{const[e,t]=O.useState(null);return O.useEffect(()=>{const n=()=>{t(LI())},r=()=>{t(null)},s=()=>{LI()===null&&t(null)};return document.addEventListener("selectionchange",s),document.addEventListener("mouseup",n),document.addEventListener("keyup",n),window.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("selectionchange",s),document.removeEventListener("mouseup",n),document.removeEventListener("keyup",n),window.removeEventListener("scroll",r)}},[]),e},Dye=(e,{title:t,body:n})=>{if(!fL()||Notification.permission!=="granted")return;const r=new Notification(t,{body:n,tag:e});r.addEventListener("click",()=>{window.focus(),r.close()})},Iye=(e,t,n,r)=>{const s=O.useRef(null);O.useEffect(()=>{if(t){s.current=e;return}n===null||s.current!==e||(s.current=null,r(n.title),Dye(e,n))},[e,t,n,r])},jye=e=>{var d,h;const t=ii(),n=Ri(),[r,s]=O.useState([]),i=m=>{s(g=>g.filter(y=>y!==m))},l=Nn(t.review.editContext.mutationOptions({onSuccess:async(m,{segmentId:g})=>{m.kind==="saved"&&(await n.invalidateQueries(t.review.get.pathFilter()),i(g))}})),u=(((d=l.data)==null?void 0:d.kind)==="rejected"?l.data.message:null)??((h=l.error)==null?void 0:h.message)??null;return m=>{var y;const g=((y=l.variables)==null?void 0:y.segmentId)===m;return{isWriting:r.includes(m),isSaving:g&&l.isPending,errorMessage:g?u:null,onEdit:()=>{g&&l.reset(),s(b=>[...b,m])},onSave:b=>{l.mutate({...e,segmentId:m,context:b})},onCancel:()=>{g&&l.reset(),i(m)}}}},Lye="The line you drew ends at this card.",Pye=["add-card","change-card","describe"],PI=e=>Pye.includes(e.kind),zye=(e,t)=>{var R,M,D;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(null),[u,d]=O.useState([]),h=k=>{d(I=>I.filter(_=>_!==k))},m=Nn(n.review.editJourney.mutationOptions({onSuccess:async(k,{segmentId:I,edit:_})=>{if(k.kind==="rejected"){PI(_)||t(k.message);return}await Promise.all([r.invalidateQueries(n.review.get.pathFilter()),r.invalidateQueries(n.review.cardForm.pathFilter()),r.invalidateQueries(n.review.cardBlocks.pathFilter())]),_.kind==="add-card"&&(i(null),c(k.nodeId===null?null:{segmentId:I,nodeId:k.nodeId})),_.kind==="change-card"&&c(null),_.kind==="describe"&&h(I)},onError:(k,{edit:I})=>{PI(I)||t(k.message)}})),g=(k,I)=>{m.mutate({...e,segmentId:k,edit:I})},y=((R=m.variables)==null?void 0:R.edit)??null,w=(((M=m.data)==null?void 0:M.kind)==="rejected"?m.data.message:null)??((D=m.error)==null?void 0:D.message)??null,E=(y==null?void 0:y.kind)==="add-card",C=k=>{E&&m.reset(),i(k)},T=(y==null?void 0:y.kind)==="change-card",N=k=>{var I;return(y==null?void 0:y.kind)==="describe"&&((I=m.variables)==null?void 0:I.segmentId)===k};return{authoringOf:k=>({board:{isPending:m.isPending,onAddCard:()=>{C({segmentId:k,lineEnd:null})},onClearDiagram:()=>{g(k,{kind:"clear-diagram"})},onRemoveDiagram:()=>{g(k,{kind:"remove-diagram"})},onAddCardAtLineEnd:I=>{C({segmentId:k,lineEnd:{...I,places:[...I.places]}})},onMoveCards:I=>{g(k,{kind:"move-cards",places:[...I]})},onDrawLine:I=>{g(k,{kind:"add-line",...I})},onRemoveLine:I=>{g(k,{kind:"remove-line",...I})},onEditCard:I=>{T&&m.reset(),c({segmentId:k,nodeId:I})},onRemoveCard:I=>{g(k,{kind:"remove-card",nodeId:I})}},description:{isWriting:u.includes(k),isSaving:N(k)&&m.isPending,errorMessage:N(k)?w:null,onEdit:()=>{N(k)&&m.reset(),d(I=>[...I,k])},onSave:I=>{g(k,{kind:"describe",description:I})},onCancel:()=>{N(k)&&m.reset(),h(k)}},onAddDiagram:()=>{g(k,{kind:"add-diagram"})}}),cardAddition:s===null?null:{segmentId:s.segmentId,note:s.lineEnd===null?null:Lye,isSaving:E&&m.isPending,errorMessage:E?w:null,onSubmit:k=>{g(s.segmentId,{kind:"add-card",...k,...s.lineEnd===null?{}:{lineEnd:s.lineEnd}})},onClose:()=>{i(null)}},cardChange:l===null?null:{...l,isSaving:T&&m.isPending,errorMessage:T?w:null,onSave:k=>{g(l.segmentId,{kind:"change-card",nodeId:l.nodeId,...k})},onClose:()=>{c(null)}}}},Bye=10,Hye="Review submitted",Iy=e=>Number.parseInt(e,Bye),zI=(e,t)=>({path:e,side:t.side,startLine:Iy(t.startLineLabel),endLine:Iy(t.lineLabel)}),Fye=(e,t,n,r)=>{if(n===null)return null;const s={path:t,anchorLineLabel:n.lineLabel,range:{side:n.side,startLineLabel:n.lineLabel,lineLabel:n.lineLabel}};if(!r||(e==null?void 0:e.path)!==t||e.range.side!==n.side)return s;const i=Iy(e.anchorLineLabel),l=Iy(n.lineLabel);return{...e,range:{side:n.side,startLineLabel:String(Math.min(i,l)),lineLabel:String(Math.max(i,l))}}},$ye=(e,t)=>{var _;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(0),[u,d]=O.useState(""),[h,m]=O.useState(!1),g=O.useDeferredValue(u),y=async()=>{await r.invalidateQueries(n.review.get.pathFilter())},b=async()=>{await Promise.all([y(),r.invalidateQueries(n.review.searchReviewers.pathFilter())])},w=P=>{t(P.message)},E={onSuccess:y,onError:w},C=Nn(n.review.addComment.mutationOptions({onSuccess:async()=>{i(null),await y()},onError:w})),T=Nn(n.review.discardComment.mutationOptions(E)),N=Nn(n.review.replyToThread.mutationOptions(E)),R=Nn(n.review.resolveThread.mutationOptions(E)),M=Nn(n.review.submit.mutationOptions({onSuccess:async()=>{c(P=>P+1),t(Hye),await Promise.all([y(),r.invalidateQueries(n.repository.list.pathFilter())])}})),D=Nn(n.review.requestReviewer.mutationOptions({onSuccess:b,onError:w})),k=Nn(n.review.removeReviewRequest.mutationOptions({onSuccess:b,onError:w})),I=Zc({...n.review.searchReviewers.queryOptions({...e,query:g}),enabled:h,placeholderData:SE});return{composingRangeOf:P=>(s==null?void 0:s.path)===P?s.range:null,isCommentPending:C.isPending||N.isPending||R.isPending||T.isPending,isSubmitting:M.isPending,isDiscarding:T.isPending,submissionCount:l,submissionError:((_=M.error)==null?void 0:_.message)??null,reviewerRequesting:{query:u,options:I.data??null,isPending:D.isPending||k.isPending,onOpen:()=>{m(!0)},onSearch:d,onRequest:P=>{D.mutate({...e,login:P})},onRemove:P=>{k.mutate({...e,login:P})}},onStartComment:(P,H,z)=>{i(U=>Fye(U,P,H,z))},onStartRangeComment:(P,H)=>{i({path:P,anchorLineLabel:H.startLineLabel,range:H})},onAddComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!1})},onPostComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!0})},onComment:P=>{C.mutate({...e,position:null,body:P,shouldPostNow:!0})},onReply:(P,H)=>{N.mutate({...e,threadId:P,body:H})},onResolveThread:(P,H)=>{R.mutate({...e,threadId:P,isResolved:H})},onDiscardComment:P=>{T.mutate({...e,commentId:P})},onSubmit:(P,H)=>{M.mutate({...e,verdict:P,body:H})}}},Vye=e=>{const[t,n]=O.useState(!1);return O.useEffect(()=>{const r=()=>{n(window.scrollY>e)};return r(),window.addEventListener("scroll",r,{passive:!0}),()=>{window.removeEventListener("scroll",r)}},[e]),t},Uye=(e,t)=>{var l,c;const n=ii(),r=Ri(),s=Nn(n.review.generateSection.mutationOptions({onSuccess:async u=>{u.kind==="generated"&&(u.prompt!==null&&await navigator.clipboard.writeText(u.prompt).catch(()=>{}),await r.invalidateQueries(n.review.get.pathFilter()),t(u.message))}})),i=((l=s.data)==null?void 0:l.kind)==="unavailable"?s.data.message:((c=s.error)==null?void 0:c.message)??null;return{generatingSection:s.isPending?s.variables.section:null,errorMessageOf:u=>{var d;return((d=s.variables)==null?void 0:d.section)===u?i:null},onGenerate:u=>{s.mutate({...e,section:u})}}},BI=e=>e.kind==="add"||e.kind==="change",qye=(e,t)=>{var w,E,C;const n=ii(),r=Ri(),[s,i]=O.useState([]),[l,c]=O.useState(!1),u=T=>{i(N=>N.filter(R=>R!==T))},d=Nn(n.review.editSegments.mutationOptions({onSuccess:async(T,{edit:N})=>{if(T.kind==="rejected"){BI(N)||t(T.message);return}await r.invalidateQueries(n.review.get.pathFilter()),N.kind==="add"&&c(!1),(N.kind==="change"||N.kind==="remove")&&u(N.segmentId)},onError:(T,{edit:N})=>{BI(N)||t(T.message)}})),h=T=>{d.mutate({...e,edit:"paths"in T?{...T,paths:[...T.paths]}:T})},m=((w=d.variables)==null?void 0:w.edit)??null,y=(((E=d.data)==null?void 0:E.kind)==="rejected"?d.data.message:null)??((C=d.error)==null?void 0:C.message)??null,b=(m==null?void 0:m.kind)==="add";return{isPending:d.isPending,onMove:(T,N)=>{h({kind:"move",segmentId:T,direction:N})},addition:{isWriting:l,isSaving:b&&d.isPending,errorMessage:b?y:null,onEdit:()=>{b&&d.reset(),c(!0)},onSave:T=>{h({kind:"add",...T})},onCancel:()=>{b&&d.reset(),c(!1)}},authoringOf:T=>{const N=(m==null?void 0:m.kind)==="change"&&m.segmentId===T;return{writing:{isWriting:s.includes(T),isSaving:N&&d.isPending,errorMessage:N?y:null,onEdit:()=>{N&&d.reset(),i(R=>R.includes(T)?R:[...R,T])},onSave:R=>{h({kind:"change",segmentId:T,...R})},onCancel:()=>{N&&d.reset(),u(T)}},isPending:d.isPending,onRemove:()=>{h({kind:"remove",segmentId:T})}}}}},Gye=2500,Kye=()=>{const[e,t]=O.useState(null);O.useEffect(()=>{if(e===null)return;const r=window.setTimeout(()=>{t(null)},Gye);return()=>{window.clearTimeout(r)}},[e]);const n=O.useCallback(r=>{t({message:r})},[]);return[(e==null?void 0:e.message)??null,n]},Yye=(e,t)=>{const n=ii(),r=Ri(),s=Nn(n.review.editWalkthrough.mutationOptions({onSuccess:async i=>{i.kind==="rejected"?t(i.message):await r.invalidateQueries(n.review.get.pathFilter())},onError:i=>{t(i.message)}}));return{isPending:s.isPending,onMoveFile:(i,l,c)=>{s.mutate({...e,segmentId:i,edit:{kind:"move-file",path:l,direction:c}})},onRemoveFile:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-file",path:l}})},onRemoveWaypoint:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-waypoint",waypointId:l}})}}},Wye="j",Xye="k",Qye="input, textarea, select, [contenteditable='true']",Zye=e=>e instanceof Element&&e.closest(Qye)!==null,Jye=(e,t)=>{const n=O.useEffectEvent(e),r=O.useEffectEvent(t);O.useEffect(()=>{const s=i=>{i.repeat||i.metaKey||i.ctrlKey||i.altKey||Zye(i.target)||(i.key===Wye&&r(),i.key===Xye&&n())};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[])},gE=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start"})},exe=(e,t)=>{const[n,r]=O.useState(()=>new Set),[s,i]=O.useState(null),l=e.flatMap(y=>y.walkthrough.files.flatMap(b=>b.rows.flatMap(w=>w.kind==="waypoint"?[w.waypoint]:[]))),c=l.find(y=>y.id===s)??null,u=c===null?(t==null?void 0:t.lastWaypointId)??null:c.previousId,d=c===null?(t==null?void 0:t.firstWaypointId)??null:c.nextId,h=y=>{const b=l.find(w=>w.id===y);b!==void 0&&(i(b.id),r(w=>new Set([...w,b.id])),gE(b.anchorId))},m=()=>{h(u)},g=()=>{h(d)};return Jye(m,g),{openWaypointIds:n,currentWaypointId:s,positionLabel:(c==null?void 0:c.positionLabel)??null,canStepBack:u!==null,canStepForward:d!==null,onPrevious:m,onNext:g,onToggleWaypoint:y=>{i(y),r(b=>new Set(b.has(y)?[...b].filter(w=>w!==y):[...b,y]))},onOpenCodeLink:y=>{const b=l.find(w=>w.anchorId===y);b===void 0?gE(y):h(b.id)}}},txe=O.lazy(async()=>await $t(()=>import("./index-B1Rm0SQ5.js"),__vite__mapDeps([26,24]))),nxe=O.lazy(async()=>await $t(()=>import("./index-V8tnJR9v.js"),__vite__mapDeps([27,24]))),rxe=O.lazy(async()=>await $t(()=>import("./index-PzkXPYSX.js"),__vite__mapDeps([23,24]))),sxe=O.lazy(async()=>await $t(()=>import("./index-BaflOxvR.js"),__vite__mapDeps([28,24]))),ixe=5e3,oxe=480,wH="The backend did not say what went wrong.",lxe="Could not copy to the clipboard",axe="Loading the options…",yE="Loading the editor…",cxe="Add a segment",uxe="New segment",fxe="This Flight Plan has no segments yet.",dxe="Publish anyway",hxe="Arrange segments",pxe="Move a segment up or down. The order is saved as you go.",mxe="Arrange files",gxe="Move a file up or down in the Code Walkthrough. The order is saved as you go.",yxe=[],xxe=[],bxe="text-4xl leading-10 font-bold tracking-[-0.02em]",vxe="[--line:var(--primary-text)]",Sxe="[--band-height:3.5rem] [--walkthrough-heading-height:2.75rem] [--section-scroll-margin:4.5rem] [--file-header-top:6.25rem] [--waypoint-scroll-margin:9.75rem] [--chat-width:26rem]",N1=e=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(sxe,{...e})}),EH=(e,t)=>({repositoryName:e.repoName,targetId:e.branchId,filterKeys:t.filter??null,isShowingReviewed:t.reviewed??!1}),jbe=({params:e,search:t,onSearchChange:n})=>{var Ae,Le,Ie,Ue,We,Oe,De,ne,he;const r=ii(),s=Ri(),i=jp(),l=O.use(Qj),c={repositoryName:e.repoName,targetId:e.branchId},{data:u}=fj({...r.review.get.queryOptions(EH(e,t)),refetchInterval:ixe,refetchIntervalInBackground:!0}),[d,h]=O.useState(null),[m,g]=O.useState(null),[y,b]=O.useState(!1),[w,E]=O.useState(!1),[C,T]=O.useState(null),[N,R]=Kye(),{isOwn:M}=u,D=u.kind==="artifact"?u.progress:null;Iye(`${e.repoName}/${e.branchId}`,D!==null,u.kind==="artifact"?u.completion:null,R);const k=_ye(),I=jye(c),_=qye(c,R),P=zye(c,R),H=Yye(c,R),z=Uye(c,R),U=$ye(c,R),j=Vye(oxe),B=Rye(c,R),L=Zc({...r.review.rebuildForm.queryOptions({...c,mode:d??"update"}),enabled:d!==null,gcTime:0}),$=async()=>{await s.invalidateQueries(r.review.get.pathFilter())},q=se=>{R(se.message)},G=(se,Te)=>{navigator.clipboard.writeText(se).then(()=>{R(Te)},()=>{R(lxe)})},W=Nn(r.review.setReviewed.mutationOptions({onSuccess:$,onError:q})),Z=Nn(r.review.publish.mutationOptions({onSuccess:async({message:se})=>{R(se),await $()},onError:q})),re=Nn(r.review.markComplete.mutationOptions({onSuccess:async({message:se,targetId:Te})=>{R(se),E(!1),await $(),Te!==e.branchId&&i({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e.repoName,branchId:Te}})},onError:q})),de=Nn(r.review.request.mutationOptions({onSuccess:async se=>{se.kind==="requested"&&(se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),F=Nn(r.review.rebuild.mutationOptions({onSuccess:async se=>{se.kind==="rebuilt"&&(h(null),se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),X=Nn(r.review.delete.mutationOptions({onSuccess:async({message:se})=>{R(se),await Promise.all([$(),s.invalidateQueries(r.review.creationForm.pathFilter())])},onError:q})),te=se=>{F.reset(),h(se)},J=u.kind==="artifact"?u:null,K=(J==null?void 0:J.segments.find(se=>se.id===C))??null,ce=exe((J==null?void 0:J.segments)??xxe,(J==null?void 0:J.walkthroughControls.stepping)??null),{openWaypointIds:ye,currentWaypointId:ge}=ce,oe=ce.onOpenCodeLink,xe=ce.onToggleWaypoint,Se=[...(J==null?void 0:J.rail.groups.flatMap(se=>se.sections))??[],...(J==null?void 0:J.rail.sections)??[]],ke=Oce(Se.flatMap(se=>[se.anchorId,...se.children.map(Te=>Te.anchorId)])),_e=n,we=se=>{const Te=J==null?void 0:J.segments.find(Ve=>Ve.anchorId===se);Te!==void 0&&(_.authoringOf(Te.id).writing.onEdit(),gE(se))},Re=(se,Te)=>{s.query({...r.review.codeReference.queryOptions({...c,path:se.path,lineStart:se.lineStart,lineEnd:se.lineEnd}),staleTime:"static"}).then(Te,Ve=>{R(Ve instanceof Error?Ve.message:wH)})};return x.jsxs("div",{className:Ne("px-6 pb-16 transition-[margin] duration-200 ease-out",B.isOpen?"mr-(--chat-width)":"",vxe,Sxe),children:[x.jsx("title",{children:u.shell.documentTitle}),l===null?null:Bs.createPortal(x.jsxs(x.Fragment,{children:[x.jsx(RG,{lineColor:"primary"}),x.jsx(Aue,{header:u.shell.header,changedFiles:u.kind==="missing"?u.changedFiles:null,authorLabel:u.shell.authorLabel,reviewerRequesting:U.reviewerRequesting,actions:u.kind==="missing"?null:x.jsxs(x.Fragment,{children:[x.jsx(Yce,{label:u.chatLabel,isPressed:B.isOpen,onClick:B.onToggle}),!M||u.unassignedFiles===null?null:x.jsx(Xce,{label:u.unassignedFiles.label,onClick:()=>{g({kind:"list"})}}),u.completeAction===null?null:x.jsx(Wce,{label:u.completeAction.label,isPending:re.isPending,onClick:()=>{var se;((se=u.completeAction)==null?void 0:se.pullRequestChoice)==null?re.mutate({...c,pullRequestTargetId:null}):E(!0)}}),u.sharing===null?null:x.jsx(Jce,{sharing:u.sharing,publishingKey:Z.isPending?Z.variables.destination:null,onPublish:se=>{u.unassignedFiles===null?Z.mutate({...c,destination:se}):g({kind:"publish",destination:se})}}),u.reviewDraft===null?null:x.jsx(Zce,{draft:u.reviewDraft,isSubmitting:U.isSubmitting,isDiscarding:U.isDiscarding,errorMessage:U.submissionError,submissionCount:U.submissionCount,renderEditor:N1,onSubmit:U.onSubmit,onDiscard:U.onDiscardComment}),x.jsx(Qce,{forgeLink:u.shell.header.kind==="pull-request"?u.shell.header.forgeLink:null,rebuild:M?null:{onUpdate:()=>{te("update")},onRegenerate:()=>{te("regenerate")}},onDelete:()=>{X.mutate(c)}})]})})]}),l),x.jsx(Q0e,{isOpen:d!==null,rebuildForm:L.isFetching?null:L.data??null,loadingLabel:axe,problem:((Ae=F.data)==null?void 0:Ae.kind)==="rejected"?F.data:null,errorMessage:((Le=F.data)==null?void 0:Le.kind)==="unavailable"?F.data.message:((Ie=F.error)==null?void 0:Ie.message)??((Ue=L.error)==null?void 0:Ue.message)??null,isPending:F.isPending,onSubmit:se=>{d!==null&&(Q1(),F.mutate({...c,...se,mode:d}))},onClose:()=>{h(null)}}),u.kind==="missing"&&M?x.jsx(O.Suspense,{fallback:null,children:x.jsx(X0e,{repositoryName:e.repoName,targetId:e.branchId})}):null,u.kind==="missing"&&!M?x.jsx(mye,{heading:u.heading,message:u.message,form:u.form,problem:((We=de.data)==null?void 0:We.kind)==="rejected"?de.data:null,errorMessage:((Oe=de.data)==null?void 0:Oe.kind)==="unavailable"?de.data.message:((De=de.error)==null?void 0:De.message)??null,isPending:de.isPending,dataNotice:u.shell.notice,onSubmit:se=>{Q1(),de.mutate({...c,...se})}}):null,u.kind==="missing"?null:x.jsxs(p4,{value:((ne=u.progress)==null?void 0:ne.isWriting)===!0?u.progress.label:null,children:[x.jsx(eye,{staleNotice:u.staleNotice,unassignedFiles:M?null:u.unassignedFiles,progress:u.progress,onShowUnassignedFiles:()=>{g({kind:"list"})},onCopyPrompt:G}),x.jsxs("div",{className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8",children:[x.jsx("aside",{className:"sticky top-[calc(var(--band-height)+0.5rem)] max-h-[calc(100dvh-var(--band-height)-1rem)] self-start overflow-y-auto pt-5 pb-4",children:x.jsx(Iue,{label:"Review sections",groups:u.rail.groups,sections:u.rail.sections,currentAnchorId:ke,onEditGroup:M?we:null,onArrangeGroups:M&&u.segments.some(se=>se.outline.canMoveUp)?()=>{b(!0)}:null})}),x.jsxs("div",{className:"min-w-0",children:[u.segments.map(se=>x.jsxs("section",{id:se.anchorId,"aria-label":(M?se.outline.heading:se.heading)??void 0,className:"scroll-mt-(--section-scroll-margin) not-first:border-t-4 not-first:border-foreground",children:[x.jsx(dye,{reviewKey:c,heading:se.heading,isTitleDraft:se.isTitleDraft,detailLabel:se.detailLabel,outline:se.outline,authoring:M?_.authoringOf(se.id):null}),x.jsx(A0e,{...se.context,codeLinks:u.codeLinks,editing:M?I(se.id):null,renderCodeLinkDialog:Te=>x.jsx(vh,{reviewKey:c,...Te}),onOpenCodeLink:oe}),se.offers.journey===null?x.jsx(Nce,{...se.journey,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,isReviewPending:W.isPending,authoring:M?P.authoringOf(se.id):null,renderDescriptionEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(rxe,{...Te,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})})}):null,onOpenCodeLink:oe,onWaypointReviewedChange:M?null:(Te,Ve)=>{W.mutate({...c,subject:{kind:"waypoint",id:Te},isReviewed:Ve})}}):x.jsx(US,{kind:"board",...se.offers.journey,isGenerating:z.generatingSection===se.offers.journey.section,errorMessage:z.errorMessageOf(se.offers.journey.section),onGenerate:()=>{z.onGenerate("journey")}}),se.offers.blast===null?null:x.jsx(US,{kind:"board",...se.offers.blast,isGenerating:z.generatingSection===se.offers.blast.section,errorMessage:z.errorMessageOf(se.offers.blast.section),onGenerate:()=>{z.onGenerate("blast")}}),se.blast===null?null:x.jsx(QZ,{...se.blast,codeLinks:u.codeLinks,renderImpactEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:yE}),children:x.jsx(nxe,{...Te,reviewKey:c,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})},Te.path)}):null,onOpenCodeLink:oe,onOpenFile:oe}),x.jsxs(oee,{anchorId:se.walkthrough.anchorId,heading:se.walkthrough.heading,intro:se.walkthrough.intro,coverageLabel:se.walkthrough.coverageLabel,controls:u.walkthroughControls,positionLabel:ce.positionLabel??u.walkthroughControls.stepping.idleLabel,canStepBack:ce.canStepBack,canStepForward:ce.canStepForward,emptyMessage:se.walkthrough.emptyMessage,codeLinks:u.codeLinks,onArrangeFiles:M&&se.walkthrough.fileOrder.length>1?()=>{T(se.id)}:null,onOpenCodeLink:oe,onPrevious:ce.onPrevious,onNext:ce.onNext,onFilterChange:Te=>{_e({filter:Te===null?void 0:[...Te]})},onShowReviewedChange:M?null:Te=>{_e({reviewed:Te?!0:void 0})},children:[se.offers.findings===null?null:x.jsx(US,{kind:"notice",...se.offers.findings,isGenerating:z.generatingSection===se.offers.findings.section,errorMessage:z.errorMessageOf(se.offers.findings.section),onGenerate:()=>{z.onGenerate("findings")}}),M?se.walkthrough.files.map(Te=>x.jsx(Tye,{reviewKey:c,segmentId:se.id,file:Te,openWaypointIds:ye,currentWaypointId:ge,isPending:H.isPending,codeLinks:u.codeLinks,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve}),onOpenCodeLink:oe,onToggleWaypoint:xe,onRemove:()=>{H.onRemoveFile(se.id,Te.path)},onRemoveWaypoint:Ve=>{H.onRemoveWaypoint(se.id,Ve)}},Te.anchorId)):se.walkthrough.files.map(Te=>x.jsx(yee,{file:Te,openWaypointIds:ye,currentWaypointId:ge,isReviewPending:W.isPending,composer:u.composer,composingRange:U.composingRangeOf(Te.path),isCommentPending:U.isCommentPending,renderCommentEditor:N1,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,onOpenCodeLink:oe,onToggleWaypoint:xe,onWaypointReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"waypoint",id:Ve},isReviewed:jt})},onFileReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"file",path:Ve},isReviewed:jt})},onStartComment:U.onStartComment,onAddComment:U.onAddComment,onPostComment:U.onPostComment,onReply:U.onReply,onResolveThread:U.onResolveThread,onDiscardComment:U.onDiscardComment},Te.anchorId))]})]},se.id)),M&&u.segments.length===0&&!_.addition.isWriting?x.jsx("p",{className:"pt-6 text-muted-foreground",children:fxe}):null,M&&_.addition.isWriting?x.jsx(SH,{reviewKey:c,legend:uxe,label:"",paths:yxe,isSaving:_.addition.isSaving,isDeleting:!1,errorMessage:_.addition.errorMessage,onSave:_.addition.onSave,onDelete:null,onClose:_.addition.onCancel}):null,M&&!_.addition.isWriting?x.jsx(nt,{variant:"outline",className:"mt-6",onClick:_.addition.onEdit,children:cxe}):null,u.conversation===null||u.composer===null?null:x.jsx(_0e,{anchorId:u.conversation.anchorId,heading:u.conversation.heading,emptyMessage:u.conversation.emptyMessage,entries:u.conversation.entries,placeholder:u.composer.placeholder,submitLabel:u.composer.commentLabel,isSubmitting:U.isCommentPending,renderEditor:N1,onComment:U.onComment})]})]}),y&&M?x.jsx(iD,{title:hxe,description:pxe,entries:u.segments.map(se=>({id:se.id,...se.outline})),isPending:_.isPending,onMove:_.onMove,onClose:()=>{b(!1)}}):null,!M||K===null?null:x.jsx(iD,{title:mxe,description:gxe,entries:K.walkthrough.fileOrder.map(se=>({id:se.path,...se})),isPending:H.isPending,onMove:(se,Te)=>{H.onMoveFile(K.id,se,Te)},onClose:()=>{T(null)}}),!M||P.cardAddition===null?null:x.jsx(gfe,{reviewKey:c,addition:P.cardAddition}),!M||P.cardChange===null?null:x.jsx(O.Suspense,{fallback:null,children:x.jsx(txe,{reviewKey:c,change:P.cardChange,renderCodeLinkDialog:se=>x.jsx(vh,{reviewKey:c,...se})})}),w&&((he=u.completeAction)==null?void 0:he.pullRequestChoice)!=null?x.jsx(R0e,{choice:u.completeAction.pullRequestChoice,isPending:re.isPending,onComplete:se=>{re.mutate({...c,pullRequestTargetId:se})},onClose:()=>{E(!1)}}):null,m===null||u.unassignedFiles===null?null:x.jsx(xye,{title:u.unassignedFiles.title,description:u.unassignedFiles.description,paths:u.unassignedFiles.paths,confirmation:m.kind==="list"?null:{warning:u.unassignedFiles.publishWarning,confirmLabel:dxe,onConfirm:()=>{Z.mutate({...c,destination:m.destination}),g(null)}},onClose:()=>{g(null)}}),x.jsx(hye,{selection:k,onComment:(se,Te)=>{var Ve;U.onStartRangeComment(se,Te),(Ve=window.getSelection())==null||Ve.removeAllRanges()},onAsk:se=>{Re(se,({reference:Te})=>{B.onAsk(Te)})}}),B.isOpen&&B.conversation!==void 0?x.jsx(hJ,{conversation:B.conversation,modelChoice:B.modelChoice,codeLinks:u.codeLinks,reference:B.reference,isSending:B.isSending,sendProblem:B.sendProblem,answering:B.answering,onSend:B.onSend,onAnswer:B.onAnswer,onChooseModel:B.onChooseModel,onClearReference:B.onClearReference,onOpenCodeLink:oe,onClose:B.onClose}):null,j&&!B.isOpen?x.jsx(un,{icon:"top",label:"Back to top",variant:"outline",className:"fixed right-4 bottom-4 z-30",onClick:()=>{window.scrollTo({top:0})}}):null]}),x.jsx(jue,{message:N})]})},Lbe=({error:e})=>{const t=gs();return x.jsxs("section",{role:"alert",className:"max-w-prose px-6 pt-8",children:[x.jsx("h1",{className:bxe,children:"Could not open this review"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:wH}),x.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[x.jsx(nt,{onClick:()=>{t.invalidate()},children:"Try again"}),x.jsx(Ff,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},wxe=e=>typeof e=="boolean"?e:void 0,Exe=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,Cxe=e=>({filter:Exe(e.filter),reviewed:wxe(e.reviewed)}),Nxe=()=>$t(()=>import("./_branchId-CPb8-qBw.js"),[]),Txe=()=>$t(()=>import("./_branchId-LiwHskkW.js"),[]),Rxe=ys()({staticData:{isFullWidth:!0},validateSearch:Cxe,loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{const s=await e.query({...t.review.get.queryOptions(EH(n,r)),staleTime:"static"});s.kind!=="missing"||!s.isOwn||await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:n.branchId}),staleTime:"static"})},component:fn(Txe,"component"),pendingComponent:q7,errorComponent:fn(Nxe,"errorComponent")}),Oxe=()=>$t(()=>import("./create-DBv4ZLt7.js"),[]),kxe=()=>$t(()=>import("./create-BWsYjEs5.js"),[]),Mxe=ys()({loader:async({context:{queryClient:e,trpc:t},params:n})=>{await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:null}),staleTime:"static"})},component:fn(kxe,"component"),errorComponent:fn(Oxe,"errorComponent")}),Axe=()=>$t(()=>import("./index-CeY9TXPf.js"),__vite__mapDeps([29,7])),_xe=()=>$t(()=>import("./index-BKKD-dvv.js"),__vite__mapDeps([30,11])),Dxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.list.queryOptions(),staleTime:"static"})},component:fn(_xe,"component"),pendingComponent:ru,errorComponent:fn(Axe,"errorComponent")}),Ixe=()=>$t(()=>import("./_id-DlHylI1F.js"),__vite__mapDeps([31,7])),jxe=()=>$t(()=>import("./_id-BDFgPH36.js"),__vite__mapDeps([32,24])),Lxe=ys()({validateSearch:e=>typeof e.field=="string"?{field:e.field}:{},loaderDeps:({search:e})=>({field:e.field??null}),loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{await e.query({...t.configuration.get.queryOptions({id:n.id,field:r.field}),staleTime:"static"})},component:fn(jxe,"component"),pendingComponent:ru,errorComponent:fn(Ixe,"errorComponent")}),Pxe=()=>$t(()=>import("./create-DXgFUVIW.js"),__vite__mapDeps([33,7])),zxe=()=>$t(()=>import("./create-DBNC2wSp.js"),__vite__mapDeps([34,11])),Bxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.creationForm.queryOptions(),staleTime:"static"})},component:fn(zxe,"component"),pendingComponent:ru,errorComponent:fn(Pxe,"errorComponent")}),Hxe=m7.update({id:"/",path:"/",getParentRoute:()=>nu}),al=y7.update({id:"/settings",path:"/settings",getParentRoute:()=>nu}),Fxe=x7.update({id:"/",path:"/",getParentRoute:()=>al}),$xe=E7.update({id:"/agents",path:"/agents",getParentRoute:()=>al}),Vxe=R7.update({id:"/configuration",path:"/configuration",getParentRoute:()=>al}),Uxe=A7.update({id:"/forges",path:"/forges",getParentRoute:()=>al}),qxe=j7.update({id:"/repositories",path:"/repositories",getParentRoute:()=>al}),Gxe=F7.update({id:"/setup/",path:"/setup/",getParentRoute:()=>nu}),Kxe=U7.update({id:"/artifact/claude/download",path:"/artifact/claude/download",getParentRoute:()=>nu}),Yxe=Rxe.update({id:"/pr-reviews/$repoName/$branchId",path:"/pr-reviews/$repoName/$branchId",getParentRoute:()=>nu}),Wxe=Mxe.update({id:"/pr-reviews/$repoName/create",path:"/pr-reviews/$repoName/create",getParentRoute:()=>nu}),Xxe=Dxe.update({id:"/profiles/",path:"/profiles/",getParentRoute:()=>al}),Qxe=Lxe.update({id:"/profiles/$id",path:"/profiles/$id",getParentRoute:()=>al}),Zxe=Bxe.update({id:"/profiles/create",path:"/profiles/create",getParentRoute:()=>al}),Jxe={SettingsAgentsRoute:$xe,SettingsConfigurationRoute:Vxe,SettingsForgesRoute:Uxe,SettingsRepositoriesRoute:qxe,SettingsIndexRoute:Fxe,SettingsProfilesIdRoute:Qxe,SettingsProfilesCreateRoute:Zxe,SettingsProfilesIndexRoute:Xxe},ebe=al._addFileChildren(Jxe),tbe={IndexRoute:Hxe,SettingsRouteRoute:ebe,SetupIndexRoute:Gxe,ArtifactClaudeDownloadRoute:Kxe,PrReviewsRepoNameBranchIdRoute:Yxe,PrReviewsRepoNameCreateRoute:Wxe},nbe=nu._addFileChildren(tbe)._addFileTypes(),rbe=(e,t)=>BU({routeTree:nbe,context:e,defaultPreload:"intent",defaultPreloadStaleTime:0,...t===void 0?{}:{history:t}}),sbe=({queryClient:e,trpcClient:t,history:n})=>{const r=rbe({queryClient:e,trpc:CG(t,e)},n);return x.jsx(l$,{client:e,children:x.jsx(SG,{trpcClient:t,queryClient:e,children:x.jsx($U,{router:r})})})},CH=document.getElementById("root");if(!CH)throw new Error("Missing #root element in index.html");const ibe=sbe({queryClient:new _$,trpcClient:EG(wG())});W$.createRoot(CH).render(x.jsx(O.StrictMode,{children:ibe}));export{W0e as $,gx as A,nt as B,RG as C,cu as D,b7 as E,eee as F,C7 as G,O7 as H,un as I,_7 as J,hd as K,g4 as L,F7 as M,Mx as N,Wj as O,x4 as P,D0e as Q,m7 as R,uB as S,YM as T,U7 as U,$7 as V,abe as W,Lbe as X,Rxe as Y,jbe as Z,Mxe as _,uu as a,bn as a$,q0e as a0,jp as a1,Lxe as a2,S2 as a3,bp as a4,E2 as a5,ft as a6,co as a7,pge as a8,qh as a9,Abe as aA,Nt as aB,Mbe as aC,wbe as aD,Sbe as aE,rt as aF,Ome as aG,pbe as aH,Mn as aI,iH as aJ,mbe as aK,oH as aL,zme as aM,$ge as aN,Fx as aO,Tbe as aP,Op as aQ,xbe as aR,Me as aS,vbe as aT,bbe as aU,ybe as aV,lr as aW,Dy as aX,Nbe as aY,sde as aZ,Tpe as a_,U2 as aa,Gt as ab,Ke as ac,Ebe as ad,Rbe as ae,gbe as af,jme as ag,Cbe as ah,kge as ai,vC as aj,od as ak,Obe as al,zE as am,Mi as an,$s as ao,ube as ap,_y as aq,uI as ar,l0e as as,_be as at,_me as au,He as av,ct as aw,Fge as ax,Dbe as ay,kbe as az,Oa as b,Ei as b0,hbe as b1,Lpe as b2,jpe as b3,K2 as b4,Ibe as b5,h0 as b6,ka as c,fu as d,md as e,fbe as f,ii as g,Ri as h,Zc as i,x as j,Nn as k,SE as l,tee as m,nee as n,X9 as o,D0 as p,Ff as q,O as r,dbe as s,Ne as t,gs as u,NG as v,fj as w,Qj as x,tu as y,Bs as z};